2018-12-24 17:22:56 -05:00
|
|
|
#pragma once
|
|
|
|
|
2018-12-26 14:21:20 -05:00
|
|
|
#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;
|
|
|
|
|
2018-12-26 14:21:20 -05:00
|
|
|
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);
|
2019-01-12 06:31:02 -05:00
|
|
|
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;
|
|
|
|
|
2019-01-17 17:09:50 -05:00
|
|
|
typedef unsigned int (*SL_GetStringOfSize_t)(const char *str, unsigned int user, unsigned int len, int type);
|
|
|
|
extern SL_GetStringOfSize_t SL_GetStringOfSize;
|
|
|
|
|
2018-12-26 14:21:20 -05:00
|
|
|
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;
|
2019-01-17 17:09:50 -05:00
|
|
|
extern unsigned int* scr_numArgs;
|
2019-01-16 16:44:50 -05:00
|
|
|
extern VariableValue** scr_stackPtr;
|
2019-01-17 17:09:50 -05:00
|
|
|
extern VariableValue** scr_stackEndPtr;
|
2019-01-16 16:44:50 -05:00
|
|
|
|
|
|
|
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-17 15:05:48 -05:00
|
|
|
extern int* g_script_error_level;
|
|
|
|
extern jmp_buf* g_script_error;
|
|
|
|
|
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);
|
2019-01-17 17:09:50 -05:00
|
|
|
unsigned int SL_GetString(const char *str, unsigned int user);
|
2018-12-24 17:22:56 -05:00
|
|
|
}
|
2018-12-26 14:21:20 -05:00
|
|
|
|
2018-12-24 17:22:56 -05:00
|
|
|
bool is_mp();
|
|
|
|
bool is_sp();
|
|
|
|
bool is_dedi();
|
|
|
|
|
|
|
|
void initialize(launcher::mode mode);
|
2018-12-26 14:21:20 -05:00
|
|
|
}
|