Difference between revisions of "DVARs (BO1)"

From COD Engine Research
Jump to: navigation, search
(Created page with "<syntaxhighlight lang="cpp"> dvar->flags: #define DVAR_ARCHIVE (1 << 0) // 0x0001 #define DVAR_USERINFO (1 << 1) // 0x0002 #define DVAR_SERVERINFO (1 << 2) // 0x0004 #...")
(No difference)

Revision as of 17:44, 12 January 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			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_INT64			9
#define DVAR_TYPE_LINEAR_COLOR_RGB	10
#define DVAR_TYPE_COLOR_XYZ		11
 
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 *description;
	unsigned int hash;
	unsigned short flags;	// 0xC
	int type;		// 0x10
	bool modified;		// 0x14
	DvarValue current;	// 0x18
	DvarValue latched;
	DvarValue reset;
	DvarValue unknown;
	DvarLimits domain;
	dvar_s *next;
	dvar_s *hashNext;
};
#pragma pack(pop)