From f0ddfc119ca0e3e880163337495b53a23b60012c Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Thu, 4 Apr 2024 21:17:48 +1000 Subject: [PATCH] Update dpdefs --- qcsrc/client/main.qc | 2 +- qcsrc/client/view.qc | 2 +- qcsrc/dpdefs/doc.md | 4 ++-- qcsrc/dpdefs/menudefs.qh | 2 -- qcsrc/dpdefs/upstream/csprogsdefs.qc | 16 ++++++++++------ qcsrc/dpdefs/upstream/dpextensions.qc | 2 +- qcsrc/dpdefs/upstream/menudefs.qc | 1 + qcsrc/lib/_all.inc | 8 ++++---- 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 4bc3d8007..5044ef034 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -43,7 +43,7 @@ // CSQC_Init : Called every time the CSQC code is initialized (essentially at map load) // Useful for precaching things -void CSQC_Init() +void CSQC_Init(float apilevel, string enginename, float engineversion) { prvm_language = strzone(cvar_string("prvm_language")); diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index bf6e22c61..6a011d3f8 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -1550,7 +1550,7 @@ void View_UpdateFov() setproperty(VF_FOV, fov); } -void CSQC_UpdateView(entity this, float w, float h) +void CSQC_UpdateView(entity this, float w, float h, bool notmenu) { TC(int, w); TC(int, h); diff --git a/qcsrc/dpdefs/doc.md b/qcsrc/dpdefs/doc.md index b49bb6f57..fa44a529e 100644 --- a/qcsrc/dpdefs/doc.md +++ b/qcsrc/dpdefs/doc.md @@ -17,7 +17,7 @@ // 3 = mousemove absolute, x, y (DP_CSQC) bool CSQC_InputEvent(int eventtype, int x, int y); -void CSQC_UpdateView(int width, int height); +void CSQC_UpdateView(int vid_width, int vid_height, bool notmenu); // catch commands registered with registercommand bool CSQC_ConsoleCommand(string cmd); bool CSQC_Parse_TempEntity(); @@ -30,7 +30,7 @@ entity CSQC_Ent_Spawn(int entnum); void CSQC_Ent_Update(bool isnew); void CSQC_Ent_Remove(); -void CSQC_Init(); +void CSQC_Init(float apilevel, string enginename, float engineversion); void CSQC_Shutdown(); // input: diff --git a/qcsrc/dpdefs/menudefs.qh b/qcsrc/dpdefs/menudefs.qh index 036d87ff2..d738f9ede 100644 --- a/qcsrc/dpdefs/menudefs.qh +++ b/qcsrc/dpdefs/menudefs.qh @@ -18,8 +18,6 @@ #undef spawn -#define localcmd cmd - int(string str, string sub, int startpos) _strstrofs = #221; #define strstrofs _strstrofs int(string str, int ofs) _str2chr = #222; diff --git a/qcsrc/dpdefs/upstream/csprogsdefs.qc b/qcsrc/dpdefs/upstream/csprogsdefs.qc index e392bf8ea..bc921c457 100644 --- a/qcsrc/dpdefs/upstream/csprogsdefs.qc +++ b/qcsrc/dpdefs/upstream/csprogsdefs.qc @@ -42,13 +42,17 @@ float trace_inopen; float trace_inwater; // -// required prog functions +// prog functions called by engine // -void() CSQC_Init; -void() CSQC_Shutdown; -float(float f, float t, float n) CSQC_InputEvent; -void(float w, float h) CSQC_UpdateView; -float(string s) CSQC_ConsoleCommand; +void CSQC_Init(float apilevel, string enginename, float engineversion); +void CSQC_Shutdown(); +float CSQC_InputEvent(float evtype, float scanx, float chary); +void CSQC_UpdateView(float vid_width, float vid_height, float notmenu); // required for EXT_CSQC (preferred) +float CSQC_ConsoleCommand(string cmdstr); +#ifdef CSQC_SIMPLE // hud-only CSQC + void CSQC_DrawHud(vector virtsize, float showscores); // required for CSQC_SIMPLE (fallback) + void CSQC_DrawScores(vector virtsize, float showscores); +#endif //these fields are read and set by the default player physics vector pmove_org; diff --git a/qcsrc/dpdefs/upstream/dpextensions.qc b/qcsrc/dpdefs/upstream/dpextensions.qc index f7e5b08ec..8a4d93c48 100644 --- a/qcsrc/dpdefs/upstream/dpextensions.qc +++ b/qcsrc/dpdefs/upstream/dpextensions.qc @@ -35,7 +35,7 @@ float(string s) checkextension = #99; //field definitions: .float buttonchat; //description: -//true if the player is currently chatting (in messagemode, menus or console) +//true if the player is currently chatting (in messagemode, menus or console) or if their game window is not active. //DP_BUTTONUSE //idea: id Software diff --git a/qcsrc/dpdefs/upstream/menudefs.qc b/qcsrc/dpdefs/upstream/menudefs.qc index b987491b7..93bdff12d 100644 --- a/qcsrc/dpdefs/upstream/menudefs.qc +++ b/qcsrc/dpdefs/upstream/menudefs.qc @@ -182,6 +182,7 @@ vector vectoangles(vector v) = #11; float random(void) = #12; // Returns a random number > 0 and < 1 void cmd(string command, ...) = #13; +void localcmd(string command, ...) = #13; // cvar cmds diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index 0bef0b6e0..d33bda1d1 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -285,16 +285,16 @@ MACRO_END #endif #ifdef CSQC - void _CSQC_Init(); - void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); } + void _CSQC_Init(float apilevel, string enginename, float engineversion); + void CSQC_Init(float apilevel, string enginename, float engineversion) { if (_CSQC_Init) _CSQC_Init(apilevel, enginename, engineversion); } #define CSQC_Init _CSQC_Init void _CSQC_Shutdown(); void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); } #define CSQC_Shutdown _CSQC_Shutdown - void _CSQC_UpdateView(entity this, float w, float h); - void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); } + void _CSQC_UpdateView(entity this, float w, float h, bool notmenu); + void CSQC_UpdateView(float w, float h, bool notmenu) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h, notmenu); } #define CSQC_UpdateView _CSQC_UpdateView bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary); -- 2.39.2