Difference between revisions of "DVARs (MW2)"

From COD Engine Research
Jump to: navigation, search
m
m (Reverted edits by Aerosoul94 (talk) to last revision by CraigChrist8239)
Line 1: Line 1:
 
[[Category:DVARs]]
 
[[Category:DVARs]]
 
[[Category:MW2]]
 
[[Category:MW2]]
<syntaxhighlight lang="c">
 
 
  union DvarLimits
 
  union DvarLimits
 
  {
 
  {
Line 18: Line 17:
 
  float max;
 
  float max;
 
  } value, vector;
 
  } value, vector;
 
struct {
 
unsigned __int64 min;
 
unsigned __int64 max;
 
} integer64;
 
 
  };
 
  };
 
   
 
   
Line 29: Line 23:
 
  bool enabled;
 
  bool enabled;
 
  int integer;
 
  int integer;
unsigned __int64 integer64;
 
 
  unsigned int unsignedInt;
 
  unsigned int unsignedInt;
 
  float value;
 
  float value;
Line 38: Line 31:
 
   
 
   
 
  #define DVAR_TYPE_BOOL 0
 
  #define DVAR_TYPE_BOOL 0
  #define DVAR_TYPE_FLOAT 1
+
  #define DVAR_TYPE_FLOAT 1
 
  #define DVAR_TYPE_FLOAT_2 2
 
  #define DVAR_TYPE_FLOAT_2 2
 
  #define DVAR_TYPE_FLOAT_3 3
 
  #define DVAR_TYPE_FLOAT_3 3
Line 45: Line 38:
 
  #define DVAR_TYPE_ENUM 6
 
  #define DVAR_TYPE_ENUM 6
 
  #define DVAR_TYPE_STRING 7
 
  #define DVAR_TYPE_STRING 7
  #define DVAR_TYPE_COLOR 8
+
  #define DVAR_TYPE_COLOR 8
  #define DVAR_TYPE_INT64 9
+
  #define DVAR_TYPE_DEV_TWEAK 9
  #define DVAR_TYPE_COUNT 10
+
  #define DVAR_TYPE_COUNT 10
 
   
 
   
 
  struct dvar_s
 
  struct dvar_s
Line 63: Line 56:
 
  dvar_s * next;
 
  dvar_s * next;
 
  };
 
  };
</syntaxhighlight>
 

Revision as of 18:57, 11 January 2014

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

struct dvar_s
{
	const char *name;
	//The description was removed for the latest updates (TU7 and TU8 on Xbox 360)
//	const char *description;
	unsigned __int16 flags;
	char type;
	bool modified;
	DvarValue current;
	DvarValue latched;
	DvarValue reset;
	DvarLimits domain;
	dvar_s * next;
};