Don't generate textures in R_GetColumn

Based on a commit by lactozilla
This commit is contained in:
NepDisk 2026-02-04 10:43:12 -05:00
parent d880abe8ea
commit ed26b6272b
3 changed files with 13 additions and 12 deletions

View file

@ -663,10 +663,12 @@ static void R_MakeSpans(void (*mapfunc)(drawspandata_t* ds, void(*spanfunc)(draw
//
static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc)(drawcolumndata_t*), boolean allow_parallel)
{
ZoneScoped;
INT32 x;
drawcolumndata_t dc {0};
const INT32 texture = texturetranslation[skytexture];
ZoneScoped;
if (mapnamespace == MNS_SRB2KART && !newview->sky)
{
@ -696,17 +698,13 @@ static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc)(drawcolumndata_t*), bo
}
dc.lightmap = colormaps;
dc.texturemid = skytexturemid;
dc.texheight = textureheight[skytexture]
>>FRACBITS;
dc.texheight = textureheight[texture] >>FRACBITS;
dc.sourcelength = dc.texheight;
x = pl->minx;
// Precache the texture so we don't corrupt the zoned heap off-main thread
if (!texturecache[texturetranslation[skytexture]])
{
R_GenerateTexture(texturetranslation[skytexture]);
}
R_CheckTextureCache(texture);
while (x <= pl->maxx)
{
@ -731,8 +729,7 @@ static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc)(drawcolumndata_t*), bo
dc.iscale = FixedMul(skyscale[viewssnum], FINECOSINE(xtoviewangle[viewssnum][x + i]>>ANGLETOFINESHIFT));
dc.x = x + i;
dc.source =
R_GetColumn(texturetranslation[skytexture],
-angle); // get negative of angle for each column to display sky correct way round! --Monster Iestyn 27/01/18
R_GetColumn(texture, -angle); // get negative of angle for each column to display sky correct way round! --Monster Iestyn 27/01/18
dc.brightmap = NULL;
colfunc(&dc);

View file

@ -1353,6 +1353,13 @@ static void R_RenderSegLoop (drawcolumndata_t* dc)
INT32 bottom;
INT32 i;
if (midtexture)
R_CheckTextureCache(midtexture);
if (toptexture)
R_CheckTextureCache(toptexture);
if (bottomtexture)
R_CheckTextureCache(bottomtexture);
for (; rw_x < rw_stopx; rw_x++)
{
// mark floor / ceiling areas

View file

@ -937,9 +937,6 @@ static inline INT32 wrap_column(fixed_t tex, INT32 col)
//
UINT8 *R_GetColumn(fixed_t tex, INT32 col)
{
if (!texturecache[tex])
R_GenerateTexture(tex);
return texturecache[tex] + LONG(texturecolumnofs[tex][wrap_column(tex, col)]);
}