t = (y + 0.5f) * (2.0f / NORMSIZE) - 1.0f;
switch(side)
{
+ default:
case 0:
v[0] = 1;
v[1] = -t;
if (l >= 0 && !strcmp(entname + l, ".bsp"))
{
strcpy(entname + l, ".ent");
- if ((entities = FS_LoadFile(entname, tempmempool, true)))
+ if ((entities = (char *)FS_LoadFile(entname, tempmempool, true)))
{
CL_ParseEntityLump(entities);
Mem_Free(entities);
void R_DrawNoModelCallback(const void *calldata1, int calldata2)
{
- const entity_render_t *ent = calldata1;
+ const entity_render_t *ent = (entity_render_t *)calldata1;
int i;
float f1, f2, *c, diff[3];
float color4f[6*4];
for (i = 0, c = varray_color4f + 4 * surface->num_firstvertex;i < surface->num_vertices;i++, c += 4)
{
const qbyte *lm = surface->lightmapinfo->samples + (surface->groupmesh->data_lightmapoffsets + surface->num_firstvertex)[i];
- float scale = d_lightstylevalue[surface->lightmapinfo->styles[0]] * (1.0f / 32768.0f);
- VectorScale(lm, scale, c);
- if (surface->lightmapinfo->styles[1] != 255)
+ if (lm)
{
- int size3 = ((surface->lightmapinfo->extents[0]>>4)+1)*((surface->lightmapinfo->extents[1]>>4)+1)*3;
- lm += size3;
- scale = d_lightstylevalue[surface->lightmapinfo->styles[1]] * (1.0f / 32768.0f);
- VectorMA(c, scale, lm, c);
- if (surface->lightmapinfo->styles[2] != 255)
+ float scale = d_lightstylevalue[surface->lightmapinfo->styles[0]] * (1.0f / 32768.0f);
+ VectorScale(lm, scale, c);
+ if (surface->lightmapinfo->styles[1] != 255)
{
+ int size3 = ((surface->lightmapinfo->extents[0]>>4)+1)*((surface->lightmapinfo->extents[1]>>4)+1)*3;
lm += size3;
- scale = d_lightstylevalue[surface->lightmapinfo->styles[2]] * (1.0f / 32768.0f);
+ scale = d_lightstylevalue[surface->lightmapinfo->styles[1]] * (1.0f / 32768.0f);
VectorMA(c, scale, lm, c);
- if (surface->lightmapinfo->styles[3] != 255)
+ if (surface->lightmapinfo->styles[2] != 255)
{
lm += size3;
- scale = d_lightstylevalue[surface->lightmapinfo->styles[3]] * (1.0f / 32768.0f);
+ scale = d_lightstylevalue[surface->lightmapinfo->styles[2]] * (1.0f / 32768.0f);
VectorMA(c, scale, lm, c);
+ if (surface->lightmapinfo->styles[3] != 255)
+ {
+ lm += size3;
+ scale = d_lightstylevalue[surface->lightmapinfo->styles[3]] * (1.0f / 32768.0f);
+ VectorMA(c, scale, lm, c);
+ }
}
}
}
+ else
+ VectorClear(c);
}
rsurface_lightmapcolor4f = varray_color4f;
}
static void RSurfShader_Transparent_Callback(const void *calldata1, int calldata2)
{
- const entity_render_t *ent = calldata1;
+ const entity_render_t *ent = (entity_render_t *)calldata1;
const msurface_t *surface = ent->model->data_surfaces + calldata2;
vec3_t modelorg;
texture_t *texture;