I'll be honest what am I doing???
This commit is contained in:
NepDisk 2025-05-25 02:01:33 -04:00
parent 6874f7ca70
commit c83d5cebd4
4 changed files with 17 additions and 6 deletions

View file

@ -991,6 +991,13 @@ void HWR_GetLevelFlat(levelflat_t *levelflat, boolean noencoremap)
if (!grMipmap->data && !grMipmap->downloaded)
{
UINT8 *colormap = colormaps;
if (!noencoremap && encoremap)
{
colormap += COLORMAP_REMAPOFFSET;
}
grMipmap->format = GL_TEXFMT_P_8;
grMipmap->flags = TF_WRAPXY|TF_CHROMAKEYED;

View file

@ -532,7 +532,6 @@ levelflat_t *foundflats;
//SoM: Other files want this info.
size_t P_PrecacheLevelFlats(void)
{
lumpnum_t lump;
size_t i;
//SoM: 4/18/2000: New flat code to make use of levelflats.
@ -581,6 +580,7 @@ Ploadflat (levelflat_t *levelflat, const char *flatname, boolean resize)
// Look for a flat
int texturenum = R_CheckFlatNumForName(levelflat->name);
lumpnum_t texturelump = W_CheckNumForName(levelflat->name);
if (texturenum <= 0)
{
// If we can't find a flat, try looking for a texture!
@ -588,7 +588,8 @@ Ploadflat (levelflat_t *levelflat, const char *flatname, boolean resize)
if (texturenum <= 0)
{
// Use "not found" texture
texturenum = R_CheckTextureNumForName("REDWALL");
texturenum = R_CheckTextureNumForName(MISSING_TEXTURE);
texturelump = W_CheckNumForName(MISSING_TEXTURE);
// Give up?
if (texturenum <= 0)
@ -600,6 +601,7 @@ Ploadflat (levelflat_t *levelflat, const char *flatname, boolean resize)
}
levelflat->texture_id = texturenum;
levelflat->lump = texturelump;
levelflat->terrain =
K_GetTerrainForTextureName(levelflat->name);

View file

@ -66,6 +66,7 @@ struct levelflat_t
terrain_t *terrain;
UINT8 type;
INT32 texture_id;
lumpnum_t lump;
};
extern size_t numlevelflats;

View file

@ -953,14 +953,15 @@ void *R_GetFlat(levelflat_t *levelflat)
// FIXME: checking this every time a flat is fetched for drawing is stupid...
// sadly they are not cached anywhere else so i have no choice
/*boolean doremap = W_NeedPaletteRemap(flatlumpnum, false);
lumpnum_t flatlumpnum = levelflat->lump;
boolean doremap = W_NeedPaletteRemap(flatlumpnum, false);
void *flat = W_CacheLumpNum(flatlumpnum, PU_LEVEL);
if (doremap)
R_DoPaletteRemapFlat(flat, W_LumpLength(levelflat->texture_id));
return flat;*/
R_DoPaletteRemapFlat(flat, W_LumpLength(flatlumpnum));
return flat;
// FIXME: How do I convert above for new format.
return R_GetFlatForTexture(R_GetTextureNumForFlat(levelflat));
//return R_GetFlatForTexture(R_GetTextureNumForFlat(levelflat));
}
//