Difference between revisions of "DVARs (BO1)"

From COD Engine Research
Jump to: navigation, search
m
Line 18: Line 18:
 
#define DVAR_AUTOEXEC (1 << 15) // 0x8000
 
#define DVAR_AUTOEXEC (1 << 15) // 0x8000
  
/* dvar->type */
+
enum dvarType_t
#define DVAR_TYPE_BOOL 0
+
{
#define DVAR_TYPE_FLOAT 1
+
  DVAR_TYPE_BOOL = 0x0,
#define DVAR_TYPE_FLOAT_2 2
+
  DVAR_TYPE_FLOAT = 0x1,
#define DVAR_TYPE_FLOAT_3 3
+
  DVAR_TYPE_FLOAT_2 = 0x2,
#define DVAR_TYPE_FLOAT_4 4
+
  DVAR_TYPE_FLOAT_3 = 0x3,
#define DVAR_TYPE_INT 5
+
  DVAR_TYPE_FLOAT_4 = 0x4,
#define DVAR_TYPE_ENUM 6
+
  DVAR_TYPE_INT = 0x5,
#define DVAR_TYPE_STRING 7
+
  DVAR_TYPE_ENUM = 0x6,
#define DVAR_TYPE_COLOR 8
+
  DVAR_TYPE_STRING = 0x7,
#define DVAR_TYPE_INT64 9
+
  DVAR_TYPE_COLOR = 0x8,
#define DVAR_TYPE_LINEAR_COLOR_RGB 10
+
  DVAR_TYPE_INT64 = 0x9,
#define DVAR_TYPE_COLOR_XYZ 11
+
  DVAR_TYPE_LINEAR_COLOR_RGB = 0xA,
 +
  DVAR_TYPE_COLOR_XYZ = 0xB,
 +
  DVAR_TYPE_COUNT = 0xC,
 +
};
  
 
union DvarLimits
 
union DvarLimits
Line 43: Line 46:
 
int max;
 
int max;
 
} integer;
 
} integer;
 
struct {
 
float min;
 
float max;
 
} value, vector;
 
  
 
struct {
 
struct {
Line 53: Line 51:
 
unsigned long long max;
 
unsigned long long max;
 
} integer64;
 
} integer64;
 +
 +
struct {
 +
float min;
 +
float max;
 +
} value, vector;
 
};
 
};
  
Line 73: Line 76:
 
const char *description;
 
const char *description;
 
unsigned int hash;
 
unsigned int hash;
unsigned short flags; // 0xC
+
unsigned int flags;
int type; // 0x10
+
dvarType_t type;
bool modified; // 0x14
+
bool modified;
DvarValue current; // 0x18
+
bool loadedFromSaveGame;
 +
DvarValue current;
 
DvarValue latched;
 
DvarValue latched;
 
DvarValue reset;
 
DvarValue reset;

Revision as of 18:07, 27 December 2014

/* dvar->flags */
#define DVAR_ARCHIVE		(1 << 0)	// 0x0001
#define DVAR_USERINFO		(1 << 1)	// 0x0002
#define DVAR_SERVERINFO		(1 << 2)	// 0x0004
#define DVAR_SYSTEMINFO		(1 << 3)	// 0x0008
#define DVAR_INIT		(1 << 4)	// 0x0010
#define DVAR_LATCH		(1 << 5)	// 0x0020
#define DVAR_ROM		(1 << 6)	// 0x0040
#define DVAR_CHEAT		(1 << 7)	// 0x0080
#define DVAR_DEVELOPER		(1 << 8)	// 0x0100
#define DVAR_SAVED		(1 << 9)	// 0x0200
#define DVAR_NORESTART		(1 << 10)	// 0x0400
#define DVAR_CHANGEABLE_RESET	(1 << 12)	// 0x1000
#define DVAR_EXTERNAL		(1 << 14)	// 0x4000
#define DVAR_AUTOEXEC		(1 << 15)	// 0x8000
 
enum dvarType_t
{
  DVAR_TYPE_BOOL = 0x0,
  DVAR_TYPE_FLOAT = 0x1,
  DVAR_TYPE_FLOAT_2 = 0x2,
  DVAR_TYPE_FLOAT_3 = 0x3,
  DVAR_TYPE_FLOAT_4 = 0x4,
  DVAR_TYPE_INT = 0x5,
  DVAR_TYPE_ENUM = 0x6,
  DVAR_TYPE_STRING = 0x7,
  DVAR_TYPE_COLOR = 0x8,
  DVAR_TYPE_INT64 = 0x9,
  DVAR_TYPE_LINEAR_COLOR_RGB = 0xA,
  DVAR_TYPE_COLOR_XYZ = 0xB,
  DVAR_TYPE_COUNT = 0xC,
};
 
union DvarLimits
{
	struct {
		int stringCount;
		const char **strings;
	} enumeration;
 
	struct {
		int min;
		int max;
	} integer;
 
	struct {
		unsigned long long min;
		unsigned long long max;
	} integer64;
 
	struct {
		float min;
		float max;
	} value, vector;
};
 
union DvarValue
{
	bool enabled;
	int integer;
	unsigned int unsignedInt;
	unsigned long long integer64;
	float value;
	float vector[4];
	const char *string;
	char color[4];
};
 
#pragma pack(push, 4)
struct dvar_s
{
	const char *name;
	const char *description;
	unsigned int hash;
	unsigned int flags;
	dvarType_t type;
	bool modified;
	bool loadedFromSaveGame;
	DvarValue current;
	DvarValue latched;
	DvarValue reset;
	DvarValue unknown;
	DvarLimits domain;
	dvar_s *next;
	dvar_s *hashNext;
};
#pragma pack(pop)