for (leafsurfaceindex = 0;leafsurfaceindex < numleafsurfaces;leafsurfaceindex++)
{
surfaceindex = leafsurfaceindices[leafsurfaceindex];
+ surface = surfaces + surfaceindex;
+ if(!surface->texture)
+ continue;
if (CHECKPVSBIT(info->outsurfacepvs, surfaceindex))
continue;
SETPVSBIT(info->outsurfacepvs, surfaceindex);
- surface = surfaces + surfaceindex;
if (!BoxesOverlap(info->lightmins, info->lightmaxs, surface->mins, surface->maxs))
continue;
addedtris = false;
for (surfacenum = 0, mark = leaf->firstleafsurface;surfacenum < leaf->numleafsurfaces;surfacenum++, mark++)
{
surface = info->model->data_surfaces + *mark;
+ if(!surface->texture)
+ continue;
if (surface->texture->supercontents & SUPERCONTENTS_SOLID)
{
for (k = 0;k < surface->num_triangles;k++)
surface = model->data_surfaces + node->firstsurface;
for (i = 0;i < node->numsurfaces;i++, surface++)
{
+ if(!surface->texture)
+ continue;
if (!(surface->texture->basematerialflags & MATERIALFLAG_WALL) || !surface->lightmapinfo || !surface->lightmapinfo->samples)
continue; // no lightmaps
surface = model->data_surfaces + node->firstsurface;
for (i = 0;i < node->numsurfaces;i++, surface++)
{
+ if(!surface->texture)
+ continue;
// skip surfaces whose bounding box does not include the point
// if (!BoxesOverlap(mid, mid, surface->mins, surface->maxs))
// continue;
mod->DrawSky = R_Q1BSP_DrawSky;
for (j = 0, surface = &mod->data_surfaces[mod->firstmodelsurface];j < mod->nummodelsurfaces;j++, surface++)
- if (surface->texture->basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA))
+ if (surface->texture && surface->texture->basematerialflags & (MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION | MATERIALFLAG_CAMERA))
break;
if (j < mod->nummodelsurfaces)
mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes;
for (j = 0;j < mod->nummodelsurfaces;j++)
{
const msurface_t *surface = mod->data_surfaces + j + mod->firstmodelsurface;
+ if(!surface->texture)
+ continue;
t = (int)(surface->texture - mod->data_textures);
numsurfacesfortexture[t]++;
}
for (j = 0;j < mod->nummodelsurfaces;j++)
{
const msurface_t *surface = mod->data_surfaces + j + mod->firstmodelsurface;
+ if (!surface->texture)
+ continue;
t = (int)(surface->texture - mod->data_textures);
mod->sortedmodelsurfaces[firstsurfacefortexture[t]++] = j + mod->firstmodelsurface;
}