Cleanup R_GetFlatForTexture
This commit is contained in:
parent
41a62d7823
commit
fbea771486
1 changed files with 7 additions and 6 deletions
|
|
@ -561,11 +561,14 @@ done:
|
|||
|
||||
UINT8 *R_GetFlatForTexture(size_t texnum)
|
||||
{
|
||||
texture_t *texture = textures[texnum];
|
||||
if (texnum >= (unsigned)numtextures)
|
||||
return NULL;
|
||||
|
||||
texture_t *texture = textures[texnum];
|
||||
if (texture->flat != NULL)
|
||||
return texture->flat;
|
||||
|
||||
// Special case: Textures that are flats don't need to be converted FROM a texture INTO a flat.
|
||||
if (texture->type == TEXTURETYPE_FLAT)
|
||||
{
|
||||
texpatch_t *patch = &texture->patches[0];
|
||||
|
|
@ -588,13 +591,11 @@ UINT8 *R_GetFlatForTexture(size_t texnum)
|
|||
else
|
||||
#endif
|
||||
texture->flat = pdata;
|
||||
|
||||
return texture->flat;
|
||||
}
|
||||
else
|
||||
texture->flat = (UINT8 *)Picture_TextureToFlat(texnum);
|
||||
|
||||
texture->flat = (UINT8 *)Picture_TextureToFlat(texnum);
|
||||
|
||||
flatmemory += texture->width + texture->height;
|
||||
flatmemory += texture->width * texture->height;
|
||||
|
||||
return texture->flat;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue