Difference between revisions of "DVARs (BO2)"

From COD Engine Research
Jump to: navigation, search
 
Line 18: Line 18:
 
#define DVAR_AUTOEXEC (1 << 15) // 0x8000
 
#define DVAR_AUTOEXEC (1 << 15) // 0x8000
  
/* dvar->type */
+
enum dvarType_t
#define DVAR_TYPE_BOOL 1
+
{
#define DVAR_TYPE_FLOAT 2
+
  DVAR_TYPE_INVALID = 0x0,
#define DVAR_TYPE_FLOAT_2 3
+
  DVAR_TYPE_BOOL = 0x1,
#define DVAR_TYPE_FLOAT_3 4
+
  DVAR_TYPE_FLOAT = 0x2,
#define DVAR_TYPE_FLOAT_4 5
+
  DVAR_TYPE_FLOAT_2 = 0x3,
#define DVAR_TYPE_INT 6
+
  DVAR_TYPE_FLOAT_3 = 0x4,
#define DVAR_TYPE_ENUM 7
+
  DVAR_TYPE_FLOAT_4 = 0x5,
#define DVAR_TYPE_STRING 8
+
  DVAR_TYPE_INT = 0x6,
#define DVAR_TYPE_COLOR 9
+
  DVAR_TYPE_ENUM = 0x7,
#define DVAR_TYPE_INT64 10
+
  DVAR_TYPE_STRING = 0x8,
#define DVAR_TYPE_LINEAR_COLOR_RGB 11
+
  DVAR_TYPE_COLOR = 0x9,
#define DVAR_TYPE_COLOR_XYZ 12
+
  DVAR_TYPE_INT64 = 0xA,
 +
  DVAR_TYPE_LINEAR_COLOR_RGB = 0xB,
 +
  DVAR_TYPE_COLOR_XYZ = 0xC,
 +
  DVAR_TYPE_COUNT = 0xD,
 +
};
  
 
union DvarLimits
 
union DvarLimits
 
{
 
{
struct {
+
  struct {
int stringCount;
+
    int stringCount;
const char **strings;
+
    const char **strings;
} enumeration;
+
  } enumeration;
  
struct {
+
  struct {
int min;
+
    int min;
int max;
+
    int max;
} integer;
+
  } integer;
  
struct {
+
  struct {
float min;
+
    float min;
float max;
+
    float max;
} value, vector;
+
  } value, vector;
  
struct {
+
  struct {
unsigned long long min;
+
    __int64 min;
unsigned long long max;
+
    __int64 max;
} integer64;
+
  } integer64;
 
};
 
};
  
 
union DvarValue
 
union DvarValue
 
{
 
{
bool enabled;
+
  bool enabled;
int integer;
+
  int integer;
unsigned int unsignedInt;
+
  unsigned int unsignedInt;
unsigned long long integer64;
+
  __int64 integer64;
float value;
+
  unsigned __int64 unsignedInt64;
float vector[4];
+
  float value;
const char *string;
+
  vec4_t vector;
char color[4];
+
  const char *string;
 +
  char color[4];
 
};
 
};
  
 
#pragma pack(push, 4)
 
#pragma pack(push, 4)
struct dvar_s
+
struct dvar_t
 
{
 
{
const char *name;
+
  const char *name;
const char *unknown1; // description?
+
  const char *description;
int hashForName;
+
  int hash;
int flags;
+
  unsigned int flags;
int type;
+
  dvarType_t type;
bool modified;
+
  bool modified;
DvarValue current;
+
  DvarValue current;
DvarValue latched;
+
  DvarValue latched;
DvarValue reset;
+
  DvarValue reset;
DvarValue unknown2;
+
  DvarLimits domain;
DvarLimits limits;
+
  dvar_t *hashNext;
dvar_s *next;
+
 
int unknown3;
 
int unknown3;
 
};
 
};
 
#pragma pack(pop)
 
#pragma pack(pop)
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 08:13, 21 December 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
 
enum dvarType_t
{
  DVAR_TYPE_INVALID = 0x0,
  DVAR_TYPE_BOOL = 0x1,
  DVAR_TYPE_FLOAT = 0x2,
  DVAR_TYPE_FLOAT_2 = 0x3,
  DVAR_TYPE_FLOAT_3 = 0x4,
  DVAR_TYPE_FLOAT_4 = 0x5,
  DVAR_TYPE_INT = 0x6,
  DVAR_TYPE_ENUM = 0x7,
  DVAR_TYPE_STRING = 0x8,
  DVAR_TYPE_COLOR = 0x9,
  DVAR_TYPE_INT64 = 0xA,
  DVAR_TYPE_LINEAR_COLOR_RGB = 0xB,
  DVAR_TYPE_COLOR_XYZ = 0xC,
  DVAR_TYPE_COUNT = 0xD,
};
 
union DvarLimits
{
  struct {
    int stringCount;
    const char **strings;
  } enumeration;
 
  struct {
    int min;
    int max;
  } integer;
 
  struct {
    float min;
    float max;
  } value, vector;
 
  struct {
    __int64 min;
    __int64 max;
  } integer64;
};
 
union DvarValue
{
  bool enabled;
  int integer;
  unsigned int unsignedInt;
  __int64 integer64;
  unsigned __int64 unsignedInt64;
  float value;
  vec4_t vector;
  const char *string;
  char color[4];
};
 
#pragma pack(push, 4)
struct dvar_t
{
  const char *name;
  const char *description;
  int hash;
  unsigned int flags;
  dvarType_t type;
  bool modified;
  DvarValue current;
  DvarValue latched;
  DvarValue reset;
  DvarLimits domain;
  dvar_t *hashNext;
	int unknown3;
};
#pragma pack(pop)