DVARs (MW2): Difference between revisions

From COD Engine Research
m Reverted edits by Aerosoul94 (talk) to last revision by CraigChrist8239
No edit summary
Line 1: Line 1:
[[Category:DVARs]]
[[Category:DVARs]]
[[Category:MW2]]
[[Category:MW2]]
union DvarLimits
<syntaxhighlight lang="cpp">
{
/* dvar->flags */
struct {
#define DVAR_ARCHIVE 1
int stringCount;
#define DVAR_LATCH 2
const char **strings;
#define DVAR_CHEAT 4
} enumeration;
#define DVAR_USER_CREATED 0x100
#define DVAR_SAVED 0x200
struct {
#define DVAR_SERVERINFO 0x400
int min;
#define DVAR_INIT 0x800
int max;
#define DVAR_CHANGEABLE_RESET 0x1000
} integer;
#define DVAR_ROM 0x2000
#define DVAR_EXTERNAL 0x4000
struct {
#define DVAR_AUTOEXEC 0x8000
float min;
 
float max;
/* dvar->type */
} value, vector;
#define DVAR_TYPE_BOOL 0
};
#define DVAR_TYPE_FLOAT 1
#define DVAR_TYPE_FLOAT_2 2
union DvarValue
#define DVAR_TYPE_FLOAT_3 3
{
#define DVAR_TYPE_FLOAT_4 4
bool enabled;
#define DVAR_TYPE_INT 5
int integer;
#define DVAR_TYPE_ENUM 6
unsigned int unsignedInt;
#define DVAR_TYPE_STRING 7
float value;
#define DVAR_TYPE_COLOR 8
float vector[4];
#define DVAR_TYPE_DEV_TWEAK 9
const char *string;
#define DVAR_TYPE_COUNT 10
char color[4];
 
};
union DvarLimits
{
#define DVAR_TYPE_BOOL 0
struct {
#define DVAR_TYPE_FLOAT 1
int stringCount;
#define DVAR_TYPE_FLOAT_2 2
const char **strings;
#define DVAR_TYPE_FLOAT_3 3
} enumeration;
#define DVAR_TYPE_FLOAT_4 4
#define DVAR_TYPE_INT 5
struct {
#define DVAR_TYPE_ENUM 6
int min;
#define DVAR_TYPE_STRING 7
int max;
#define DVAR_TYPE_COLOR 8
} integer;
#define DVAR_TYPE_DEV_TWEAK 9
#define DVAR_TYPE_COUNT 10
struct {
float min;
struct dvar_s
float max;
{
} value, vector;
const char *name;
};
//The description was removed for the latest updates (TU7 and TU8 on Xbox 360)
 
// const char *description;
union DvarValue
unsigned __int16 flags;
{
char type;
bool enabled;
bool modified;
int integer;
DvarValue current;
unsigned int unsignedInt;
DvarValue latched;
float value;
DvarValue reset;
float vector[4];
DvarLimits domain;
const char *string;
dvar_s * next;
char color[4];
};
};
 
struct dvar_s
{
const char *name;
//The description was removed for the latest updates (TU7 and TU8 on Xbox 360)
// const char *description;
unsigned __int16 flags;
char type;
bool modified;
DvarValue current;
DvarValue latched;
DvarValue reset;
DvarLimits domain;
dvar_s * next;
};
</syntaxhighlight>

Revision as of 20:08, 12 January 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_DEV_TWEAK	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;
};

union DvarValue
{
	bool enabled;
	int integer;
	unsigned int unsignedInt;
	float value;
	float vector[4];
	const char *string;
	char color[4];
};

struct dvar_s
{
	const char *name;
	//The description was removed for the latest updates (TU7 and TU8 on Xbox 360)
//	const char *description;
	unsigned __int16 flags;
	char type;
	bool modified;
	DvarValue current;
	DvarValue latched;
	DvarValue reset;
	DvarLimits domain;
	dvar_s * next;
};