mirror of
https://github.com/fedddddd/iw5-gsc-utils.git
synced 2025-04-23 05:55:44 +00:00
310 lines
5.0 KiB
C++
310 lines
5.0 KiB
C++
#pragma once
|
|
|
|
namespace game
|
|
{
|
|
typedef float vec_t;
|
|
typedef vec_t vec2_t[2];
|
|
typedef vec_t vec3_t[3];
|
|
typedef vec_t vec4_t[4];
|
|
|
|
struct cmd_function_t
|
|
{
|
|
cmd_function_t* next;
|
|
const char* name;
|
|
const char* autoCompleteDir;
|
|
const char* autoCompleteExt;
|
|
void(__cdecl* function)();
|
|
int flags;
|
|
};
|
|
|
|
struct CmdArgs
|
|
{
|
|
int nesting;
|
|
int localClientNum[8];
|
|
int controllerIndex[8];
|
|
int argc[8];
|
|
const char** argv[8];
|
|
};
|
|
|
|
struct msg_t
|
|
{
|
|
int overflowed;
|
|
int readOnly;
|
|
char* data;
|
|
char* splitData;
|
|
int maxsize;
|
|
int cursize;
|
|
int splitSize;
|
|
int readcount;
|
|
int bit;
|
|
int lastEntityRef;
|
|
};
|
|
|
|
struct XZoneInfo
|
|
{
|
|
const char* name;
|
|
int allocFlags;
|
|
int freeFlags;
|
|
};
|
|
|
|
struct scr_entref_t
|
|
{
|
|
unsigned __int16 entnum;
|
|
unsigned __int16 classnum;
|
|
};
|
|
|
|
typedef void(__cdecl* scr_call_t)(int entref);
|
|
|
|
enum MeansOfDeath
|
|
{
|
|
MOD_UNKNOWN = 0,
|
|
MOD_PISTOL_BULLET = 1,
|
|
MOD_RIFLE_BULLET = 2,
|
|
MOD_EXPLOSIVE_BULLET = 3,
|
|
MOD_GRENADE = 4,
|
|
MOD_GRENADE_SPLASH = 5,
|
|
MOD_PROJECTILE = 6,
|
|
MOD_PROJECTILE_SPLASH = 7,
|
|
MOD_MELEE = 8,
|
|
MOD_HEAD_SHOT = 9,
|
|
MOD_CRUSH = 10,
|
|
MOD_FALLING = 11,
|
|
MOD_SUICIDE = 12,
|
|
MOD_TRIGGER_HURT = 13,
|
|
MOD_EXPLOSIVE = 14,
|
|
MOD_IMPACT = 15,
|
|
MOD_NUM = 16
|
|
};
|
|
|
|
enum scriptType_e
|
|
{
|
|
SCRIPT_NONE = 0,
|
|
SCRIPT_OBJECT = 1,
|
|
SCRIPT_STRING = 2,
|
|
SCRIPT_ISTRING = 3,
|
|
SCRIPT_VECTOR = 4,
|
|
SCRIPT_FLOAT = 5,
|
|
SCRIPT_INTEGER = 6,
|
|
SCRIPT_END = 8,
|
|
SCRIPT_FUNCTION = 9,
|
|
SCRIPT_STRUCT = 19,
|
|
SCRIPT_ARRAY = 22,
|
|
};
|
|
|
|
struct VariableStackBuffer
|
|
{
|
|
const char* pos;
|
|
unsigned __int16 size;
|
|
unsigned __int16 bufLen;
|
|
unsigned __int16 localId;
|
|
char time;
|
|
char buf[1];
|
|
};
|
|
|
|
union VariableUnion
|
|
{
|
|
int intValue;
|
|
float floatValue;
|
|
unsigned int stringValue;
|
|
const float* vectorValue;
|
|
const char* codePosValue;
|
|
unsigned int pointerValue;
|
|
VariableStackBuffer* stackValue;
|
|
unsigned int entityId;
|
|
unsigned int uintValue;
|
|
};
|
|
|
|
struct VariableValue
|
|
{
|
|
VariableUnion u;
|
|
scriptType_e type;
|
|
};
|
|
|
|
struct function_stack_t
|
|
{
|
|
const char* pos;
|
|
unsigned int localId;
|
|
unsigned int localVarCount;
|
|
VariableValue* top;
|
|
VariableValue* startTop;
|
|
};
|
|
|
|
struct function_frame_t
|
|
{
|
|
function_stack_t fs;
|
|
int topType;
|
|
};
|
|
|
|
struct scrVmPub_t
|
|
{
|
|
unsigned int* localVars;
|
|
VariableValue* maxstack;
|
|
int function_count;
|
|
function_frame_t* function_frame;
|
|
VariableValue* top;
|
|
/*bool debugCode;
|
|
bool abort_on_error;
|
|
bool terminal_error;
|
|
bool block_execution;*/
|
|
unsigned int inparamcount;
|
|
unsigned int outparamcount;
|
|
unsigned int breakpointOutparamcount;
|
|
bool showError;
|
|
function_frame_t function_frame_start[32];
|
|
VariableValue stack[2048];
|
|
};
|
|
|
|
struct scr_classStruct_t
|
|
{
|
|
unsigned __int16 id;
|
|
unsigned __int16 entArrayId;
|
|
char charId;
|
|
const char* name;
|
|
};
|
|
|
|
struct ObjectVariableChildren
|
|
{
|
|
unsigned __int16 firstChild;
|
|
unsigned __int16 lastChild;
|
|
};
|
|
|
|
struct ObjectVariableValue_u_f
|
|
{
|
|
unsigned __int16 prev;
|
|
unsigned __int16 next;
|
|
};
|
|
|
|
union ObjectVariableValue_u_o_u
|
|
{
|
|
unsigned __int16 size;
|
|
unsigned __int16 entnum;
|
|
unsigned __int16 nextEntId;
|
|
unsigned __int16 self;
|
|
};
|
|
|
|
struct ObjectVariableValue_u_o
|
|
{
|
|
unsigned __int16 refCount;
|
|
ObjectVariableValue_u_o_u u;
|
|
};
|
|
|
|
union ObjectVariableValue_w
|
|
{
|
|
unsigned int type;
|
|
unsigned int classnum;
|
|
unsigned int notifyName;
|
|
unsigned int waitTime;
|
|
unsigned int parentLocalId;
|
|
};
|
|
|
|
struct ChildVariableValue_u_f
|
|
{
|
|
unsigned __int16 prev;
|
|
unsigned __int16 next;
|
|
};
|
|
|
|
union ChildVariableValue_u
|
|
{
|
|
ChildVariableValue_u_f f;
|
|
VariableUnion u;
|
|
};
|
|
|
|
struct ChildBucketMatchKeys_keys
|
|
{
|
|
unsigned __int16 name_hi;
|
|
unsigned __int16 parentId;
|
|
};
|
|
|
|
union ChildBucketMatchKeys
|
|
{
|
|
ChildBucketMatchKeys_keys keys;
|
|
unsigned int match;
|
|
};
|
|
|
|
struct ChildVariableValue
|
|
{
|
|
ChildVariableValue_u u;
|
|
unsigned __int16 next;
|
|
char type;
|
|
char name_lo;
|
|
ChildBucketMatchKeys k;
|
|
unsigned __int16 nextSibling;
|
|
unsigned __int16 prevSibling;
|
|
};
|
|
|
|
union ObjectVariableValue_u
|
|
{
|
|
ObjectVariableValue_u_f f;
|
|
ObjectVariableValue_u_o o;
|
|
};
|
|
|
|
struct ObjectVariableValue
|
|
{
|
|
ObjectVariableValue_u u;
|
|
ObjectVariableValue_w w;
|
|
};
|
|
|
|
struct scrVarGlob_t
|
|
{
|
|
ObjectVariableValue objectVariableValue[36864];
|
|
ObjectVariableChildren objectVariableChildren[36864];
|
|
unsigned __int16 childVariableBucket[65536];
|
|
ChildVariableValue childVariableValue[102400];
|
|
};
|
|
|
|
union DvarValue
|
|
{
|
|
bool enabled;
|
|
int integer;
|
|
unsigned int unsignedInt;
|
|
float value;
|
|
float vector[4];
|
|
const char* string;
|
|
char color[4];
|
|
};
|
|
|
|
struct enum_limit
|
|
{
|
|
int stringCount;
|
|
const char** strings;
|
|
};
|
|
|
|
struct int_limit
|
|
{
|
|
int min;
|
|
int max;
|
|
};
|
|
|
|
struct float_limit
|
|
{
|
|
float min;
|
|
float max;
|
|
};
|
|
|
|
union DvarLimits
|
|
{
|
|
enum_limit enumeration;
|
|
int_limit integer;
|
|
float_limit value;
|
|
float_limit vector;
|
|
};
|
|
|
|
struct dvar_t
|
|
{
|
|
const char* name;
|
|
unsigned int flags;
|
|
char type;
|
|
bool modified;
|
|
DvarValue current;
|
|
DvarValue latched;
|
|
DvarValue reset;
|
|
DvarLimits domain;
|
|
bool(__cdecl* domainFunc)(dvar_t*, DvarValue);
|
|
dvar_t* hashNext;
|
|
};
|
|
|
|
struct gentity_s
|
|
{
|
|
int entnum;
|
|
};
|
|
} |