#include "quakedef.h"
#include "cgame_api.h"
+#include "cl_collision.h"
#define CGVM_RENDERENTITIES 1024
static void (*cgvm_networkcode[256])(unsigned char num);
-static byte *cgvm_netbuffer;
+static qbyte *cgvm_netbuffer;
static int cgvm_netbufferlength;
static int cgvm_netbufferpos;
CG_Init(); // API call
}
-void CL_CGVM_ParseNetwork(byte *netbuffer, int length)
+void CL_CGVM_ParseNetwork(qbyte *netbuffer, int length)
{
int num;
cgvm_netbuffer = netbuffer;
{
num = CGVM_MSG_ReadByte();
if (cgvm_networkcode[num])
- cgvm_networkcode[num]((byte)num);
+ cgvm_networkcode[num]((qbyte)num);
else
Host_Error("CL_CGVM_ParseNetwork: unregistered network code %i", num);
}
return;
if (cgvm_renderentity >= CGVM_RENDERENTITIES
- || r_refdef.numentities >= MAX_VISEDICTS)
+ || r_refdef.numentities >= r_refdef.maxentities)
return;
r = cgvm_renderentities + cgvm_renderentity;
Con_Printf("CGVM_Draw_Entity: invalid model index %i\n", e->model);
return;
}
- r->model = cgvm_model[e->model]; //Mod_ForName(e->model, false, false, false);
- /*
- if (!r->model)
- {
- Con_Printf("CGVM_Draw_Entity: unable to find model \"%s\"");
- return;
- }
- */
+ r->model = cgvm_model[e->model];
r->frame = e->frame2;
// FIXME: support colormapping?
middle[2] = (worldmins[2] + worldmaxs[2]) * 0.5f;
VectorAdd(start, middle, start2);
VectorAdd(end, middle, end2);
- frac = TraceLine((float *)start2, (float *)end2, impactpos, impactnormal, 0, true);
+ frac = CL_TraceLine((float *)start2, (float *)end2, impactpos, impactnormal, 0, true, NULL);
VectorSubtract(impactpos, middle, impactpos);
- //VectorCopy(end, impactpos);
- //VectorClear(impactnormal);
*impactentnum = -1;
return frac;
}
void CGVM_Stain(const float *origin, float radius, int cr1, int cg1, int cb1, int ca1, int cr2, int cg2, int cb2, int ca2)
{
- R_Stain((float *)origin, radius, cr1, cg1, cb1, ca1, cr2, cg2, cb2, ca2);
+ if (cl_stainmaps.integer)
+ R_Stain((float *)origin, radius, cr1, cg1, cb1, ca1, cr2, cg2, cb2, ca2);
}
+