iw5-mod/src/game/game.hpp

66 lines
1.8 KiB
C++
Raw Normal View History

2018-12-24 17:22:56 -05:00
#pragma once
#include "structs.hpp"
2018-12-24 17:22:56 -05:00
#include "launcher/launcher.hpp"
#define SELECT_VALUE(sp, mp, dedi) (game::is_sp() ? (sp) : (game::is_mp() ? (mp) : (dedi)))
namespace game
{
namespace native
{
2018-12-28 07:59:44 -05:00
typedef void (*Cmd_AddCommand_t)(const char* cmdName, void (*function)(), cmd_function_t* allocedCmd);
2018-12-28 06:50:34 -05:00
extern Cmd_AddCommand_t Cmd_AddCommand;
2019-01-16 10:19:21 -05:00
typedef void (*Com_Error_t)(int code, const char *fmt, ...);
extern Com_Error_t Com_Error;
typedef void (*Conbuf_AppendText_t)(const char* message);
extern Conbuf_AppendText_t Conbuf_AppendText;
2018-12-28 07:59:44 -05:00
typedef void (*DB_LoadXAssets_t)(XZoneInfo* zoneInfo, unsigned int zoneCount, int sync);
extern DB_LoadXAssets_t DB_LoadXAssets;
2019-01-13 13:03:46 -05:00
typedef void (*MSG_ReadData_t)(msg_t* msg, void* data, int len);
extern MSG_ReadData_t MSG_ReadData;
2019-01-13 13:03:46 -05:00
typedef void (*RemoveRefToValue_t)(scriptType_e type, VariableUnion u);
extern RemoveRefToValue_t RemoveRefToValue;
typedef void (*Sys_ShowConsole_t)();
2018-12-24 17:22:56 -05:00
extern Sys_ShowConsole_t Sys_ShowConsole;
2018-12-28 06:50:34 -05:00
2019-01-13 13:03:46 -05:00
typedef void (*VM_Notify_t)(unsigned int notifyListOwnerId, unsigned int stringValue, VariableValue* top);
extern VM_Notify_t VM_Notify;
2018-12-28 06:50:34 -05:00
extern int* cmd_args;
extern int* cmd_argc;
extern const char*** cmd_argv;
2019-01-13 13:03:46 -05:00
extern short* scrVarGlob;
extern char** scrMemTreePub;
2019-01-16 16:44:50 -05:00
extern unsigned int* scr_numParam;
extern VariableValue** scr_stackPtr;
extern scr_call_t* scr_instanceFunctions;
extern scr_call_t* scr_globalFunctions;
2019-01-16 10:19:21 -05:00
extern unsigned int* levelEntityId;
2019-01-13 13:03:46 -05:00
void AddRefToValue(VariableValue* value);
2019-01-16 16:44:50 -05:00
void Scr_ClearOutParams();
2019-01-13 13:03:46 -05:00
scr_entref_t Scr_GetEntityIdRef(unsigned int id);
2019-01-16 16:44:50 -05:00
scr_call_t Scr_GetFunc(unsigned int index);
2019-01-13 13:03:46 -05:00
const char* SL_ConvertToString(unsigned int stringValue);
2018-12-24 17:22:56 -05:00
}
2018-12-24 17:22:56 -05:00
bool is_mp();
bool is_sp();
bool is_dedi();
void initialize(launcher::mode mode);
}