From a250c35f79cc2ac17890688c29c351611db5e31f Mon Sep 17 00:00:00 2001 From: viciious Date: Mon, 6 Nov 2023 11:38:36 +0300 Subject: [PATCH] More #if MIPLEVELS > 1 stuff --- r_data.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/r_data.c b/r_data.c index 22144838b..38e98d50c 100644 --- a/r_data.c +++ b/r_data.c @@ -77,35 +77,21 @@ void R_InitTextures (void) if (c >= 'a' && c <= 'z') texture->name[j] = c - ('a' - 'A'); } - texture->mipcount = 0; + + texture->mipcount = 1; for (j = 0; j < MIPLEVELS; j++) texture->data[j] = NULL; /* not cached yet */ + if (start >= 0 && end > 0) texture->lumpnum = W_CheckRangeForName(texture->name, start, end); else texture->lumpnum = W_CheckNumForName(texture->name); if (texture->lumpnum == -1) texture->lumpnum = 0; -#if 0 - uint8_t* data = R_CheckPixels(texture->lumpnum); - if (data) { - int j; - for (j = 0; j < texture->width * texture->height; j++) - { - if (!D_strncasecmp(texture->name, "SP_HOT1", 7)) - continue; - if (!D_strncasecmp(texture->name, "SW1HOT", 6)) - continue; - if (!D_strncasecmp(texture->name, "SW2HOT", 6)) - continue; - if (data[j] == 248 || data[j] == 249) - I_Error("%d %s", data[j] & 0xff, texture->name); - } - } -#endif } texmips = false; +#if MIPLEVELS > 1 for (i = 0; i < numtextures; i++) { int w = textures[i].width, h = textures[i].height; @@ -148,6 +134,7 @@ void R_InitTextures (void) break; } } +#endif /* */ /* translation table for global animation */ @@ -220,7 +207,9 @@ void R_InitFlats (void) void R_InitData (void) { +#if MIPLEVELS > 1 int i; +#endif dc_playpals = (uint8_t*)W_POINTLUMPNUM(W_GetNumForName("PLAYPALS")); @@ -228,10 +217,12 @@ void R_InitData (void) R_InitFlats (); R_InitSpriteDefs((const char **)sprnames); +#if MIPLEVELS > 1 if (!texmips) { for (i = 0; i < numtextures; i++) textures[i].mipcount = 1; } +#endif } @@ -649,7 +640,7 @@ void R_InitSpriteDefs(const char** namelist) for (j = 0; j < 8; j++) { int x; - int lump = spriteframes[i].lump[j]; + int lump = sprtemp[i].lump[j]; if (lump < 0) break;