DVARs (Ghosts): Difference between revisions
Created page with "Category:Ghosts Category:Game Structures <source lang="cpp"> →dvar->flags: #define DVAR_SCRIPT_DEFINED 0x10 struct dvar_t { const char *name; unsigned int fl..." |
No edit summary |
||
| Line 4: | Line 4: | ||
/* dvar->flags */ | /* dvar->flags */ | ||
#define DVAR_SCRIPT_DEFINED 0x10 | #define DVAR_SCRIPT_DEFINED 0x10 | ||
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]; | |||
}; | |||
struct dvar_t | struct dvar_t | ||
Revision as of 02:46, 22 January 2015
/* dvar->flags */
#define DVAR_SCRIPT_DEFINED 0x10
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];
};
struct dvar_t
{
const char *name;
unsigned int flags;
enum : char
{
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_FLOAT_3_COLOR = 0x9,
DVAR_TYPE_COUNT = 0xA,
} type;
bool modified;
DvarValue current;
DvarValue latched;
DvarValue reset;
DvarLimits domain;
dvar_t *hashNext;
};