// free memory for resources that are no longer referenced
PRVM_GarbageCollection(prog);
// pass in width and height and menu/focus state as parameters (EXT_CSQC_1)
- PRVM_G_FLOAT(OFS_PARM0) = vid.width;
- PRVM_G_FLOAT(OFS_PARM1) = vid.height;
+ if (csqc_lowres.integer)
+ {
+ PRVM_G_FLOAT(OFS_PARM0) = vid_conwidth.value;
+ PRVM_G_FLOAT(OFS_PARM1) = vid_conheight.value;
+ }
+ else
+ {
+ PRVM_G_FLOAT(OFS_PARM0) = vid.mode.width;
+ PRVM_G_FLOAT(OFS_PARM1) = vid.mode.height;
+ }
/*
* This should be fine for now but FTEQW uses flags for keydest
* and checks that an array called "eyeoffset" is 0
PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
CSQC_SetGlobals(frametime);
+ PRVM_GarbageCollection(prog);
+
+ // width and height parameters are virtual in CSQC_SIMPLE engines
VectorSet(PRVM_G_VECTOR(OFS_PARM0), vid_conwidth.integer, vid_conheight.integer, 0);
PRVM_G_FLOAT(OFS_PARM1) = sb_showscores;
prog->ExecuteProgram(prog, PRVM_clientfunction(CSQC_DrawHud), "QC function CSQC_DrawHud is missing");
VectorCopy(cl.world.maxs, PRVM_clientedictvector(prog->edicts, absmax));
PRVM_clientedictfloat(prog->edicts, solid) = SOLID_BSP;
PRVM_clientedictfloat(prog->edicts, modelindex) = 1;
- PRVM_clientedictfloat(prog->edicts, model) = PRVM_SetEngineString(prog, cl.worldmodel->name);
+ PRVM_clientedictstring(prog->edicts, model) = PRVM_SetEngineString(prog, cl.worldmodel->name);
// call the prog init if it exists
if (PRVM_clientfunction(CSQC_Init))
{
PRVM_G_FLOAT(OFS_PARM0) = 1.0f; // CSQC_SIMPLE engines always pass 0, FTE always passes 1
- PRVM_G_INT(OFS_PARM1) = PRVM_SetEngineString(prog, gamename);
+ // always include "DarkPlaces" so it can be recognised when gamename doesn't include it
+ PRVM_G_INT(OFS_PARM1) = PRVM_SetEngineString(prog, va(vabuf, sizeof(vabuf), "DarkPlaces %s", gamename));
PRVM_G_FLOAT(OFS_PARM2) = 1.0f; // TODO DP versions...
prog->ExecuteProgram(prog, PRVM_clientfunction(CSQC_Init), "QC function CSQC_Init is missing");
}