diff --git a/src/swrenderer/drawers/r_draw.cpp b/src/swrenderer/drawers/r_draw.cpp index 181c4602f..c609e7c43 100644 --- a/src/swrenderer/drawers/r_draw.cpp +++ b/src/swrenderer/drawers/r_draw.cpp @@ -601,7 +601,7 @@ namespace swrenderer } } - void R_SetupSpanBits(FTexture *tex) + void R_SetSpanTexture(FTexture *tex) { using namespace drawerargs; @@ -616,6 +616,9 @@ namespace swrenderer { ds_ybits--; } + + ds_source = r_swtruecolor ? (const uint8_t*)tex->GetPixelsBgra() : tex->GetPixels(); + ds_source_mipmapped = tex->Mipmapped() && tex->GetWidth() > 1 && tex->GetHeight() > 1; } void R_SetSpanColormap(FDynamicColormap *colormap, int shade) @@ -623,14 +626,6 @@ namespace swrenderer R_SetDSColorMapLight(colormap, 0, shade); } - void R_SetSpanSource(FTexture *tex) - { - using namespace drawerargs; - - ds_source = r_swtruecolor ? (const uint8_t*)tex->GetPixelsBgra() : tex->GetPixels(); - ds_source_mipmapped = tex->Mipmapped() && tex->GetWidth() > 1 && tex->GetHeight() > 1; - } - ///////////////////////////////////////////////////////////////////////// void R_DrawWallColumn() diff --git a/src/swrenderer/drawers/r_draw.h b/src/swrenderer/drawers/r_draw.h index b16883022..cf8fb2c35 100644 --- a/src/swrenderer/drawers/r_draw.h +++ b/src/swrenderer/drawers/r_draw.h @@ -178,9 +178,8 @@ namespace swrenderer void R_SetDSColorMapLight(FSWColormap *base_colormap, float light, int shade); void R_SetTranslationMap(lighttable_t *translation); - void R_SetupSpanBits(FTexture *tex); + void R_SetSpanTexture(FTexture *tex); void R_SetSpanColormap(FDynamicColormap *colormap, int shade); - void R_SetSpanSource(FTexture *tex); void R_MapTiltedPlane(int y, int x1); void R_MapColoredPlane(int y, int x1); diff --git a/src/swrenderer/scene/r_plane.cpp b/src/swrenderer/scene/r_plane.cpp index 8f9661fbd..d7ecda8fe 100644 --- a/src/swrenderer/scene/r_plane.cpp +++ b/src/swrenderer/scene/r_plane.cpp @@ -1179,10 +1179,9 @@ void R_DrawSinglePlane (visplane_t *pl, fixed_t alpha, bool additive, bool maske { // Don't waste time on a masked texture if it isn't really masked. masked = false; } - R_SetupSpanBits(tex); + R_SetSpanTexture(tex); double xscale = pl->xform.xScale * tex->Scale.X; double yscale = pl->xform.yScale * tex->Scale.Y; - R_SetSpanSource(tex); basecolormap = pl->colormap; planeshade = LIGHT2SHADE(pl->lightlevel); diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 1af386d60..31081a210 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -1379,12 +1379,11 @@ void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints, sinrot = sin(rotation.Radians()); // Setup constant texture mapping parameters. - R_SetupSpanBits(tex); + R_SetSpanTexture(tex); if (colormap) R_SetSpanColormap(colormap, clamp(shade >> FRACBITS, 0, NUMCOLORMAPS - 1)); else R_SetSpanColormap(&identitycolormap, 0); - R_SetSpanSource(tex); if (ds_xbits != 0) { scalex = double(1u << (32 - ds_xbits)) / scalex;