From 9974d36747054a0f6a6284d65443c9ec0cc87515 Mon Sep 17 00:00:00 2001 From: Doomhack Date: Tue, 12 May 2020 21:33:02 +0100 Subject: [PATCH] Handle multi-patch skys. --- source/r_hotpath.iwram.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/source/r_hotpath.iwram.c b/source/r_hotpath.iwram.c index 0a37100..6013629 100644 --- a/source/r_hotpath.iwram.c +++ b/source/r_hotpath.iwram.c @@ -1214,31 +1214,14 @@ static void R_DoDrawPlane(visplane_t *pl) const texture_t* tex = R_GetOrLoadTexture(_g->skytexture); - const unsigned int widthmask = tex->widthmask; - const patch_t* patch = tex->patches[0].patch; - - const boolean multitex_sky = (tex->patchcount > 1); - - unsigned int inv_width; - - if(multitex_sky) - inv_width = UDiv32(FRACUNIT, patch->width); - // killough 10/98: Use sky scrolling offset for (x = pl->minx; (dcvars.x = x) <= pl->maxx; x++) { if ((dcvars.yl = pl->top[x]) != -1 && dcvars.yl <= (dcvars.yh = pl->bottom[x])) // dropoff overflow { - int xc = ((viewangle + xtoviewangle[x]) >> ANGLETOSKYSHIFT) & widthmask; - - if(multitex_sky) - { - const unsigned int p = ((xc * inv_width) >> FRACBITS); - xc -= (patch->width * p); - patch = tex->patches[p].patch; - } + int xc = ((viewangle + xtoviewangle[x]) >> ANGLETOSKYSHIFT); - const column_t* column = (const column_t *) ((const byte *)patch + patch->columnofs[xc]); + const column_t* column = R_GetColumn(tex, xc); dcvars.source = (const byte*)column + 3; R_DrawColumn(&dcvars);