mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Merge branch 'master' into new-menus
This commit is contained in:
commit
70c8a33cb2
3 changed files with 16 additions and 56 deletions
|
|
@ -580,15 +580,7 @@ or NULL if we want to allocate it now.
|
||||||
static INT32
|
static INT32
|
||||||
Ploadflat (levelflat_t *levelflat, const char *flatname, boolean resize)
|
Ploadflat (levelflat_t *levelflat, const char *flatname, boolean resize)
|
||||||
{
|
{
|
||||||
#ifndef NO_PNG_LUMPS
|
|
||||||
UINT8 buffer[8];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lumpnum_t flatnum;
|
|
||||||
int texturenum;
|
int texturenum;
|
||||||
UINT8 *flatpatch;
|
|
||||||
size_t lumplength;
|
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
// Scan through the already found flats, return if it matches.
|
// Scan through the already found flats, return if it matches.
|
||||||
|
|
@ -616,17 +608,12 @@ Ploadflat (levelflat_t *levelflat, const char *flatname, boolean resize)
|
||||||
strlcpy(levelflat->name, flatname, sizeof (levelflat->name));
|
strlcpy(levelflat->name, flatname, sizeof (levelflat->name));
|
||||||
strupr(levelflat->name);
|
strupr(levelflat->name);
|
||||||
|
|
||||||
/* If we can't find a flat, try looking for a texture! */
|
|
||||||
if (( flatnum = R_GetFlatNumForName(levelflat->name) ) == LUMPERROR)
|
|
||||||
{
|
|
||||||
if (( texturenum = R_CheckTextureNumForName(levelflat->name) ) == -1)
|
if (( texturenum = R_CheckTextureNumForName(levelflat->name) ) == -1)
|
||||||
{
|
{
|
||||||
// check for REDWALL
|
// check for missing texture
|
||||||
if (( texturenum = R_CheckTextureNumForName("REDWALL") ) != -1)
|
if (( texturenum = R_CheckTextureNumForName(MISSING_TEXTURE) ) != -1)
|
||||||
goto texturefound;
|
goto texturefound;
|
||||||
// check for REDFLR
|
|
||||||
else if (( flatnum = R_GetFlatNumForName("REDFLR") ) != LUMPERROR)
|
|
||||||
goto flatfound;
|
|
||||||
// nevermind
|
// nevermind
|
||||||
levelflat->type = LEVELFLAT_NONE;
|
levelflat->type = LEVELFLAT_NONE;
|
||||||
}
|
}
|
||||||
|
|
@ -639,35 +626,6 @@ texturefound:
|
||||||
/* start out unanimated */
|
/* start out unanimated */
|
||||||
levelflat->u.texture.basenum = -1;
|
levelflat->u.texture.basenum = -1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
flatfound:
|
|
||||||
/* This could be a flat, patch, or PNG. */
|
|
||||||
flatpatch = W_CacheLumpNum(flatnum, PU_CACHE);
|
|
||||||
lumplength = W_LumpLength(flatnum);
|
|
||||||
if (Picture_CheckIfDoomPatch((softwarepatch_t *)flatpatch, lumplength))
|
|
||||||
levelflat->type = LEVELFLAT_PATCH;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#ifndef NO_PNG_LUMPS
|
|
||||||
/*
|
|
||||||
Only need eight bytes for PNG headers.
|
|
||||||
FIXME: Put this elsewhere.
|
|
||||||
*/
|
|
||||||
W_ReadLumpHeader(flatnum, buffer, 8, 0);
|
|
||||||
if (Picture_IsLumpPNG(buffer, lumplength))
|
|
||||||
levelflat->type = LEVELFLAT_PNG;
|
|
||||||
else
|
|
||||||
#endif/*NO_PNG_LUMPS*/
|
|
||||||
levelflat->type = LEVELFLAT_FLAT;/* phew */
|
|
||||||
}
|
|
||||||
if (flatpatch)
|
|
||||||
Z_Free(flatpatch);
|
|
||||||
|
|
||||||
levelflat->u.flat. lumpnum = flatnum;
|
|
||||||
levelflat->u.flat.baselumpnum = LUMPERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
levelflat->terrain =
|
levelflat->terrain =
|
||||||
K_GetTerrainForTextureName(levelflat->name);
|
K_GetTerrainForTextureName(levelflat->name);
|
||||||
|
|
|
||||||
|
|
@ -1712,7 +1712,7 @@ INT32 R_TextureNumForName(const char *name)
|
||||||
static INT32 redwall = -2;
|
static INT32 redwall = -2;
|
||||||
CONS_Debug(DBG_SETUP, "WARNING: R_TextureNumForName: %.8s not found\n", name);
|
CONS_Debug(DBG_SETUP, "WARNING: R_TextureNumForName: %.8s not found\n", name);
|
||||||
if (redwall == -2)
|
if (redwall == -2)
|
||||||
redwall = R_CheckTextureNumForName("REDWALL");
|
redwall = R_CheckTextureNumForName(MISSING_TEXTURE);
|
||||||
if (redwall != -1)
|
if (redwall != -1)
|
||||||
return redwall;
|
return redwall;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@
|
||||||
#pragma interface
|
#pragma interface
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define MISSING_TEXTURE "AASMELLY" // Replacement for invalid textures
|
||||||
|
|
||||||
// A single patch from a texture definition,
|
// A single patch from a texture definition,
|
||||||
// basically a rectangular area within
|
// basically a rectangular area within
|
||||||
// the texture rectangle.
|
// the texture rectangle.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue