//4 feature darkplaces csqc: add builtins to clientside qc for gl calls
extern cvar_t v_flipped;
-extern cvar_t r_equalize_entities_fullbright;
r_refdef_view_t csqc_original_r_refdef_view;
r_refdef_view_t csqc_main_r_refdef_view;
if( mod ) {
// TODO: check if this breaks needed consistency and maybe add a cvar for it too?? [1/10/2008 Black]
- // LordHavoc: erm you broke it by commenting this out - setmodel must do setsize or else the qc can't find out the model size, and ssqc does this by necessity, consistency.
+ // LadyHavoc: erm you broke it by commenting this out - setmodel must do setsize or else the qc can't find out the model size, and ssqc does this by necessity, consistency.
SetMinMaxSize (prog, e, mod->normalmins, mod->normalmaxs);
}
else
flags = 0;
else
{
- // LordHavoc: we only let the qc set certain flags, others are off-limits
+ // LadyHavoc: we only let the qc set certain flags, others are off-limits
flags = (int)PRVM_G_FLOAT(OFS_PARM6) & (CHANNELFLAG_RELIABLE | CHANNELFLAG_FORCELOOP | CHANNELFLAG_PAUSED | CHANNELFLAG_FULLVOLUME);
}
tracebox (vector1, vector mins, vector maxs, vector2, tryents)
=================
*/
-// LordHavoc: added this for my own use, VERY useful, similar to traceline
+// LadyHavoc: added this for my own use, VERY useful, similar to traceline
static void VM_CL_tracebox (prvm_prog_t *prog)
{
vec3_t v1, v2, m1, m2;
gravity = 1.0f;
gravity *= cl.movevars_gravity * 0.05;
- for (i = 0;i < 200;i++) // LordHavoc: sanity check; never trace more than 10 seconds
+ for (i = 0;i < 200;i++) // LadyHavoc: sanity check; never trace more than 10 seconds
{
PRVM_clientedictvector(tossent, velocity)[2] -= gravity;
VectorMA (PRVM_clientedictvector(tossent, angles), 0.05, PRVM_clientedictvector(tossent, avelocity), PRVM_clientedictvector(tossent, angles));
// (note: this is the reason you can't blow up fallen zombies)
if (PRVM_clientedictfloat(ent, solid) == SOLID_NOT && !sv_gameplayfix_blowupfallenzombies.integer)
continue;
- // LordHavoc: compare against bounding box rather than center so it
+ // LadyHavoc: compare against bounding box rather than center so it
// doesn't miss large objects, and use DotProduct instead of Length
// for a major speedup
VectorSubtract(org, PRVM_clientedictvector(ent, origin), eorg);
r_refdef.scene.numlights = 0;
// restore the view settings to the values that VM_CL_UpdateView received from the client code
r_refdef.view = csqc_original_r_refdef_view;
+ // polygonbegin without draw2d arg has to guess
+ prog->polygonbegin_guess2d = false;
VectorCopy(cl.csqc_vieworiginfromengine, cl.csqc_vieworigin);
VectorCopy(cl.csqc_viewanglesfromengine, cl.csqc_viewangles);
cl.csqc_vidvars.drawworld = r_drawworld.integer != 0;
{
if (!(staticent->render.effects & EF_FULLBRIGHT))
staticent->render.flags |= RENDER_LIGHT;
- else if(r_equalize_entities_fullbright.integer)
- staticent->render.flags |= RENDER_LIGHT | RENDER_EQUALIZE;
}
// turn off shadows from transparent objects
if (!(staticent->render.effects & (EF_NOSHADOW | EF_ADDITIVE | EF_NODEPTHTEST)) && (staticent->render.alpha >= 1))
if (PRVM_clientedictfloat(ent, health) > 0 && cl_bob.value && cl_bobcycle.value)
{
double bob, cycle;
- // LordHavoc: this code is *weird*, but not replacable (I think it
+ // LadyHavoc: this code is *weird*, but not replacable (I think it
// should be done in QC on the server, but oh well, quake is quake)
- // LordHavoc: figured out bobup: the time at which the sin is at 180
+ // LadyHavoc: figured out bobup: the time at which the sin is at 180
// degrees (which allows lengthening or squishing the peak or valley)
cycle = cl.time/cl_bobcycle.value;
cycle -= (int)cycle;
t = Sys_DirtyTime() - t;if (t < 0 || t >= 1800) t = 0;
prog->functions[PRVM_clientfunction(CSQC_UpdateView)].totaltime -= t;
+ // polygonbegin without draw2d arg has to guess
+ prog->polygonbegin_guess2d = false;
+
// update the views
if (ismain)
{
texname = PRVM_G_STRING(OFS_PARM0);
drawflags = (int)PRVM_G_FLOAT(OFS_PARM1);
- // weird hacky way to figure out if this is a 2D HUD polygon or a scene polygon
- draw2d = (prog->argc >= 3 ? (int)PRVM_G_FLOAT(OFS_PARM2) : r_refdef.draw2dstage);
+ if (prog->argc >= 3)
+ draw2d = PRVM_G_FLOAT(OFS_PARM2) != 0;
+ else
+ {
+ // weird hacky way to figure out if this is a 2D HUD polygon or a scene
+ // polygon, for compatibility with mods aimed at old darkplaces versions
+ // - polygonbegin_guess2d is 0 if the most recent major call was
+ // clearscene, 1 if the most recent major call was drawpic (and similar)
+ // or renderscene
+ draw2d = prog->polygonbegin_guess2d;
+ }
// we need to remember whether this is a 2D or 3D mesh we're adding to
mod = draw2d ? CL_Mesh_UI() : CL_Mesh_CSQC();
prog->polygonbegin_model = mod;
- Mod_Mesh_AddSurface(mod, Mod_Mesh_GetTexture(mod, texname, drawflags, TEXF_ALPHA, MATERIALFLAG_VERTEXCOLOR), draw2d);
+ Mod_Mesh_AddSurface(mod, Mod_Mesh_GetTexture(mod, texname, drawflags, TEXF_ALPHA, MATERIALFLAG_WALL | MATERIALFLAG_VERTEXCOLOR | MATERIALFLAG_ALPHAGEN_VERTEX), draw2d);
}
//void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex
NULL, // #397
NULL, // #398
NULL, // #399
-// LordHavoc's range #400-#499
+// LadyHavoc's range #400-#499
VM_CL_copyentity, // #400 void(entity from, entity to) copyentity (DP_QC_COPYENTITY)
NULL, // #401 void(entity ent, float colors) setcolor (DP_QC_SETCOLOR)
VM_findchain, // #402 entity(.string fld, string match) findchain (DP_QC_FINDCHAIN)
{
VM_Cmd_Init(prog);
prog->polygonbegin_model = NULL;
+ prog->polygonbegin_guess2d = 0;
}
void CLVM_reset_cmd(prvm_prog_t *prog)
World_End(&cl.world);
VM_Cmd_Reset(prog);
prog->polygonbegin_model = NULL;
+ prog->polygonbegin_guess2d = 0;
}