Skip to content

Commit

Permalink
More #if MIPLEVELS > 1 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
viciious committed Nov 6, 2023
1 parent 5eab2ae commit 781bfe1
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -148,6 +134,7 @@ void R_InitTextures (void)
break;
}
}
#endif

/* */
/* translation table for global animation */
Expand Down Expand Up @@ -220,18 +207,22 @@ void R_InitFlats (void)

void R_InitData (void)
{
#if MIPLEVELS > 1
int i;
#endif

dc_playpals = (uint8_t*)W_POINTLUMPNUM(W_GetNumForName("PLAYPALS"));

R_InitTextures ();
R_InitFlats ();
R_InitSpriteDefs((const char **)sprnames);

#if MIPLEVELS > 1
if (!texmips) {
for (i = 0; i < numtextures; i++)
textures[i].mipcount = 1;
}
#endif
}


Expand Down

0 comments on commit 781bfe1

Please sign in to comment.