light: handle bsp's with no textures

This commit is contained in:
Eric Wasylishen 2016-04-10 15:39:49 -07:00
parent f2a57d5b71
commit 9e2d54a9af
2 changed files with 5 additions and 0 deletions

View File

@ -1749,6 +1749,8 @@ static const char *
Face_TextureName(const bsp2_t *bsp, const bsp2_dface_t *face) Face_TextureName(const bsp2_t *bsp, const bsp2_dface_t *face)
{ {
int texnum = bsp->texinfo[face->texinfo].miptex; int texnum = bsp->texinfo[face->texinfo].miptex;
if (!bsp->texdatasize)
return "";
const dmiptexlump_t *miplump = bsp->dtexdata.header; const dmiptexlump_t *miplump = bsp->dtexdata.header;
if (!miplump->dataofs[texnum]) if (!miplump->dataofs[texnum])
return ""; //sometimes the texture just wasn't written. including its name. return ""; //sometimes the texture just wasn't written. including its name.

View File

@ -148,6 +148,9 @@ Face_Contents(const bsp2_t *bsp, const bsp2_dface_t *face)
if (!(bsp->texinfo[face->texinfo].flags & TEX_SPECIAL)) if (!(bsp->texinfo[face->texinfo].flags & TEX_SPECIAL))
return CONTENTS_SOLID; return CONTENTS_SOLID;
if (!bsp->texdatasize)
return CONTENTS_SOLID; // no textures in bsp
int texnum = bsp->texinfo[face->texinfo].miptex; int texnum = bsp->texinfo[face->texinfo].miptex;
const dmiptexlump_t *miplump = bsp->dtexdata.header; const dmiptexlump_t *miplump = bsp->dtexdata.header;
const miptex_t *miptex; const miptex_t *miptex;