DVARs (MW2)

From COD Engine Research
Revision as of 10:40, 1 January 2014 by Aerosoul94 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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];
};

#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_UNKNOWN	9
#define DVAR_TYPE_COUNT		10

struct dvar_s
{
	const char *name;
	// description was removed for the latest updates
//	const char *description;
	unsigned __int16 flags;
	char type;
	bool modified;
	DvarValue current;
	DvarValue latched;
	DvarValue reset;
	DvarLimits domain;
	dvar_s * next;
};