// 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"));
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);
// 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();
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:
#undef spawn
-#define localcmd cmd
-
int(string str, string sub, int startpos) _strstrofs = #221;
#define strstrofs _strstrofs
int(string str, int ofs) _str2chr = #222;
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;
//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
float random(void) = #12; // Returns a random number > 0 and < 1
void cmd(string command, ...) = #13;
+void localcmd(string command, ...) = #13;
// cvar cmds
#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);