light: factor out TEX_SPECIAL tests to Face_IsLightmapped

This commit is contained in:
Eric Wasylishen 2017-10-03 14:10:57 -06:00
parent dff71edfe9
commit 71d675ce09
2 changed files with 3 additions and 3 deletions

View File

@ -105,7 +105,7 @@ Face_ShouldBounce(const mbsp_t *bsp, const bsp2_dface_t *face)
return false; return false;
} }
if (bsp->texinfo[face->texinfo].flags & TEX_SPECIAL) { if (!Face_IsLightmapped(bsp, face)) {
return false; return false;
} }

View File

@ -2672,7 +2672,7 @@ WriteLightmaps(bspdata_t *bspdata, bsp2_dface_t *face, facesup_t *facesup, const
// sanity check that we don't save a lightmap for a non-lightmapped face // sanity check that we don't save a lightmap for a non-lightmapped face
{ {
const char *texname = Face_TextureName(bsp, face); const char *texname = Face_TextureName(bsp, face);
Q_assert(!(bsp->texinfo[face->texinfo].flags & TEX_SPECIAL)); Q_assert(Face_IsLightmapped(bsp, face));
Q_assert(Q_strcasecmp(texname, "skip") != 0); Q_assert(Q_strcasecmp(texname, "skip") != 0);
Q_assert(Q_strcasecmp(texname, "trigger") != 0); Q_assert(Q_strcasecmp(texname, "trigger") != 0);
} }
@ -2796,7 +2796,7 @@ LightFace(bspdata_t *bspdata, bsp2_dface_t *face, facesup_t *facesup, const glob
for (int i = 0; i < MAXLIGHTMAPS; i++) for (int i = 0; i < MAXLIGHTMAPS; i++)
face->styles[i] = 255; face->styles[i] = 255;
} }
if (bsp->texinfo[face->texinfo].flags & TEX_SPECIAL) if (!Face_IsLightmapped(bsp, face))
return; return;
/* don't save lightmaps for "trigger" texture */ /* don't save lightmaps for "trigger" texture */