DVARs (BO2)

From COD Engine Research
Revision as of 18:52, 21 August 2014 by Aerosoul94 (Talk | contribs)

Jump to: navigation, search
/* 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)