From 632264809f6ee1df80d746e0d1f96c11806cc268 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 28 Dec 2023 22:19:28 +0300 Subject: [PATCH] engine: ref_api: add PARMs to get pointers to engine data like cl, host, world, etc. Partially expose cl and host. --- engine/ref_api.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/engine/ref_api.h b/engine/ref_api.h index 4cc8af71..5599584a 100644 --- a/engine/ref_api.h +++ b/engine/ref_api.h @@ -28,6 +28,7 @@ GNU General Public License for more details. #include "r_efx.h" #include "com_image.h" #include "filesystem.h" +#include "common/protocol.h" // RefAPI changelog: // 1. Initial release @@ -120,6 +121,26 @@ typedef struct ref_globals_s int desktopBitsPixel; } ref_globals_t; +typedef struct ref_client_s +{ + double time; + double oldtime; + int viewentity; + int playernum; + int maxclients; + int nummodels; + model_t *models[MAX_MODELS+1]; + qboolean paused; + vec3_t simorg; +} ref_client_t; + +typedef struct ref_host_s +{ + double realtime; + double frametime; + int features; +} ref_host_t; + enum { GL_KEEP_UNIT = -1, @@ -262,6 +283,12 @@ typedef enum PARM_NUMENTITIES = -12, // local game only PARM_NUMMODELS = -13, // cl.nummodels PARM_WORLD_VERSION = -14, + PARM_GET_CLIENT_PTR = -15, // ref_client_t + PARM_GET_HOST_PTR = -16, // ref_host_t + PARM_GET_WORLD_PTR = -17, // world + PARM_GET_MOVEVARS_PTR = -18, // clgame.movevars + PARM_GET_PALETTE_PTR = -19, // clgame.palette + PARM_GET_VIEWENT_PTR = -20, // clgame.viewent } ref_parm_e; typedef struct ref_api_s