Difference between revisions of "DVARs (BO2)"

From COD Engine Research
Jump to: navigation, search
Line 19: Line 19:
  
 
/* dvar->type */
 
/* dvar->type */
#define DVAR_TYPE_BOOL 0
+
#define DVAR_TYPE_BOOL 1
#define DVAR_TYPE_FLOAT 1
+
#define DVAR_TYPE_FLOAT 2
#define DVAR_TYPE_FLOAT_2 2
+
#define DVAR_TYPE_FLOAT_2 3
#define DVAR_TYPE_FLOAT_3 3
+
#define DVAR_TYPE_FLOAT_3 4
#define DVAR_TYPE_FLOAT_4 4
+
#define DVAR_TYPE_FLOAT_4 5
#define DVAR_TYPE_INT 5
+
#define DVAR_TYPE_INT 6
#define DVAR_TYPE_ENUM 6
+
#define DVAR_TYPE_ENUM 7
#define DVAR_TYPE_STRING 7
+
#define DVAR_TYPE_STRING 8
#define DVAR_TYPE_COLOR 8
+
#define DVAR_TYPE_COLOR 9
#define DVAR_TYPE_INT64 9
+
#define DVAR_TYPE_INT64 10
#define DVAR_TYPE_LINEAR_COLOR_RGB 10
+
#define DVAR_TYPE_LINEAR_COLOR_RGB 11
#define DVAR_TYPE_COLOR_XYZ 11
+
#define DVAR_TYPE_COLOR_XYZ 12
  
 
union DvarLimits
 
union DvarLimits
Line 70: Line 70:
 
struct dvar_s
 
struct dvar_s
 
{
 
{
char *name;
+
const char *name;
char *unknown; // description?
+
const char *unknown1; // description?
 
int hashForName;
 
int hashForName;
 
 
int flags;
 
int flags;
 
int type;
 
int type;
 
bool modified;
 
bool modified;
 
 
DvarValue current;
 
DvarValue current;
short unk1;
 
short unk2;
 
 
 
DvarValue latched;
 
DvarValue latched;
short unk3;
 
short unk4;
 
 
 
DvarValue reset;
 
DvarValue reset;
short unk5;
+
DvarValue unknown2;
short unk6;
+
 
+
 
DvarLimits limits;
 
DvarLimits limits;
short unk7;
 
short unk8;
 
 
 
dvar_s *next;
 
dvar_s *next;
 
int unknown3;
 
int unknown3;

Revision as of 18:52, 21 August 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
 
/* dvar->type */
#define DVAR_TYPE_BOOL			1
#define DVAR_TYPE_FLOAT			2
#define DVAR_TYPE_FLOAT_2		3
#define DVAR_TYPE_FLOAT_3		4
#define DVAR_TYPE_FLOAT_4		5
#define DVAR_TYPE_INT			6
#define DVAR_TYPE_ENUM			7
#define DVAR_TYPE_STRING		8
#define DVAR_TYPE_COLOR			9
#define DVAR_TYPE_INT64			10
#define DVAR_TYPE_LINEAR_COLOR_RGB	11
#define DVAR_TYPE_COLOR_XYZ		12
 
union DvarLimits
{
	struct {
		int stringCount;
		const char **strings;
	} enumeration;
 
	struct {
		int min;
		int max;
	} integer;
 
	struct {
		float min;
		float max;
	} value, vector;
 
	struct {
		unsigned long long min;
		unsigned long long max;
	} integer64;
};
 
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 *unknown1;	// description?
	int hashForName;
	int flags;
	int type;
	bool modified;
	DvarValue current;
	DvarValue latched;
	DvarValue reset;
	DvarValue unknown2;
	DvarLimits limits;
	dvar_s *next;
	int unknown3;
};
#pragma pack(pop)