Difference between revisions of "DVARs (BO1)"

From COD Engine Research
Jump to: navigation, search
m
Line 83: Line 83:
 
DvarValue latched;
 
DvarValue latched;
 
DvarValue reset;
 
DvarValue reset;
DvarValue unknown;
+
DvarValue saved;
 
DvarLimits domain;
 
DvarLimits domain;
dvar_s *next;
 
 
dvar_s *hashNext;
 
dvar_s *hashNext;
 
};
 
};
 
#pragma pack(pop)
 
#pragma pack(pop)
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 22:53, 23 February 2015

/* 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
 
enum dvarType_t
{
  DVAR_TYPE_BOOL = 0x0,
  DVAR_TYPE_FLOAT = 0x1,
  DVAR_TYPE_FLOAT_2 = 0x2,
  DVAR_TYPE_FLOAT_3 = 0x3,
  DVAR_TYPE_FLOAT_4 = 0x4,
  DVAR_TYPE_INT = 0x5,
  DVAR_TYPE_ENUM = 0x6,
  DVAR_TYPE_STRING = 0x7,
  DVAR_TYPE_COLOR = 0x8,
  DVAR_TYPE_INT64 = 0x9,
  DVAR_TYPE_LINEAR_COLOR_RGB = 0xA,
  DVAR_TYPE_COLOR_XYZ = 0xB,
  DVAR_TYPE_COUNT = 0xC,
};
 
union DvarLimits
{
	struct {
		int stringCount;
		const char **strings;
	} enumeration;
 
	struct {
		int min;
		int max;
	} integer;
 
	struct {
		unsigned long long min;
		unsigned long long max;
	} integer64;
 
	struct {
		float min;
		float max;
	} value, vector;
};
 
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 int flags;
	dvarType_t type;
	bool modified;
	bool loadedFromSaveGame;
	DvarValue current;
	DvarValue latched;
	DvarValue reset;
	DvarValue saved;
	DvarLimits domain;
	dvar_s *hashNext;
};
#pragma pack(pop)