Difference between revisions of "DVARs (MW2)"

From COD Engine Research
Jump to: navigation, search
m
m
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:DVARs]]
+
[[Category:Game Structures]]
 
[[Category:MW2]]
 
[[Category:MW2]]
<syntaxhighlight lang="c">
+
<syntaxhighlight lang="cpp">
union DvarLimits
+
/* dvar->flags */
{
+
#define DVAR_ARCHIVE 1
struct {
+
#define DVAR_LATCH 2
int stringCount;
+
#define DVAR_CHEAT 4
const char **strings;
+
#define DVAR_USER_CREATED 0x100
} enumeration;
+
#define DVAR_SAVED 0x200
+
#define DVAR_SERVERINFO 0x400
struct {
+
#define DVAR_INIT 0x800
int min;
+
#define DVAR_CHANGEABLE_RESET 0x1000
int max;
+
#define DVAR_ROM 0x2000
} integer;
+
#define DVAR_EXTERNAL 0x4000
+
#define DVAR_AUTOEXEC 0x8000
struct {
+
 
float min;
+
/* dvar->type */
float max;
+
#define DVAR_TYPE_BOOL 0
} value, vector;
+
#define DVAR_TYPE_FLOAT 1
+
#define DVAR_TYPE_FLOAT_2 2
struct {
+
#define DVAR_TYPE_FLOAT_3 3
unsigned __int64 min;
+
#define DVAR_TYPE_FLOAT_4 4
unsigned __int64 max;
+
#define DVAR_TYPE_INT 5
} integer64;
+
#define DVAR_TYPE_ENUM 6
};
+
#define DVAR_TYPE_STRING 7
+
#define DVAR_TYPE_COLOR 8
union DvarValue
+
#define DVAR_TYPE_FLOAT_3_COLOR 9
{
+
#define DVAR_TYPE_COUNT 10
bool enabled;
+
 
int integer;
+
union DvarLimits
unsigned __int64 integer64;
+
{
unsigned int unsignedInt;
+
struct {
float value;
+
int stringCount;
float vector[4];
+
const char **strings;
const char *string;
+
} enumeration;
char color[4];
+
};
+
struct {
+
int min;
#define DVAR_TYPE_BOOL 0
+
int max;
#define DVAR_TYPE_FLOAT 1
+
} integer;
#define DVAR_TYPE_FLOAT_2 2
+
#define DVAR_TYPE_FLOAT_3 3
+
struct {
#define DVAR_TYPE_FLOAT_4 4
+
float min;
#define DVAR_TYPE_INT 5
+
float max;
#define DVAR_TYPE_ENUM 6
+
} value, vector;
#define DVAR_TYPE_STRING 7
+
}; //0x8
#define DVAR_TYPE_COLOR 8
+
 
#define DVAR_TYPE_INT64 9
+
union DvarValue
#define DVAR_TYPE_COUNT 10
+
{
+
bool enabled;
struct dvar_s
+
int integer;
{
+
unsigned int unsignedInt;
const char *name;
+
float value;
//The description was removed for the latest updates (TU7 and TU8 on Xbox 360)
+
float vector[4];
// const char *description;
+
const char *string;
unsigned __int16 flags;
+
char color[4];
char type;
+
}; //0x10
bool modified;
+
 
DvarValue current;
+
struct dvar_s
DvarValue latched;
+
{
DvarValue reset;
+
const char *name; //0x0
DvarLimits domain;
+
#ifndef XBOX
dvar_s * next;
+
const char *description; //0x4
};
+
#endif
</syntaxhighlight>
+
unsigned __int16 flags; //0x8
 +
char type; //0xA
 +
bool modified; //0xB
 +
DvarValue current; //0xC
 +
DvarValue latched; //0x1C
 +
DvarValue reset; //0x2C
 +
DvarLimits domain; //0x3C
 +
dvar_s * next; //0x44
 +
};
 +
</syntaxhighlight>

Latest revision as of 12:10, 22 December 2014

/* dvar->flags */
#define DVAR_ARCHIVE		1
#define DVAR_LATCH		2
#define DVAR_CHEAT		4
#define DVAR_USER_CREATED	0x100
#define DVAR_SAVED		0x200
#define DVAR_SERVERINFO		0x400
#define DVAR_INIT		0x800
#define DVAR_CHANGEABLE_RESET	0x1000
#define DVAR_ROM		0x2000
#define DVAR_EXTERNAL		0x4000
#define DVAR_AUTOEXEC		0x8000
 
/* dvar->type */
#define DVAR_TYPE_BOOL		0
#define DVAR_TYPE_FLOAT		1
#define DVAR_TYPE_FLOAT_2	2
#define DVAR_TYPE_FLOAT_3	3
#define DVAR_TYPE_FLOAT_4	4
#define DVAR_TYPE_INT		5
#define DVAR_TYPE_ENUM		6
#define DVAR_TYPE_STRING	7
#define DVAR_TYPE_COLOR		8
#define DVAR_TYPE_FLOAT_3_COLOR	9
#define DVAR_TYPE_COUNT		10
 
union DvarLimits
{
	struct {
		int stringCount;
		const char **strings;
	} enumeration;
 
	struct {
		int min;
		int max;
	} integer;
 
	struct {
		float min;
		float max;
	} value, vector;
}; //0x8
 
union DvarValue
{
	bool enabled;
	int integer;
	unsigned int unsignedInt;
	float value;
	float vector[4];
	const char *string;
	char color[4];
}; //0x10
 
struct dvar_s
{
	const char *name; //0x0
#ifndef XBOX
	const char *description; //0x4
#endif
	unsigned __int16 flags; //0x8
	char type; //0xA
	bool modified; //0xB
	DvarValue current; //0xC
	DvarValue latched; //0x1C
	DvarValue reset; //0x2C
	DvarLimits domain; //0x3C
	dvar_s * next; //0x44
};