diff --git a/src/swrenderer/scene/r_things.cpp b/src/swrenderer/scene/r_things.cpp index 623e3758de..9e129af872 100644 --- a/src/swrenderer/scene/r_things.cpp +++ b/src/swrenderer/scene/r_things.cpp @@ -79,17 +79,6 @@ namespace swrenderer { using namespace drawerargs; -FTexture *WallSpriteTile; - -// -// INITIALIZATION FUNCTIONS -// - - -// - -// GAME FUNCTIONS -// bool DrewAVoxel; static vissprite_t **spritesorter; diff --git a/src/swrenderer/scene/r_things.h b/src/swrenderer/scene/r_things.h index f870c8f22f..6db9f3f4e1 100644 --- a/src/swrenderer/scene/r_things.h +++ b/src/swrenderer/scene/r_things.h @@ -38,8 +38,6 @@ EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor); namespace swrenderer { -extern FTexture *WallSpriteTile; - bool R_ClipSpriteColumnWithPortals(vissprite_t* spr); diff --git a/src/swrenderer/things/r_decal.cpp b/src/swrenderer/things/r_decal.cpp index 043d6e57b6..1483e42120 100644 --- a/src/swrenderer/things/r_decal.cpp +++ b/src/swrenderer/things/r_decal.cpp @@ -115,7 +115,7 @@ namespace swrenderer } } - WallSpriteTile = TexMan(decal->PicNum, true); + FTexture *WallSpriteTile = TexMan(decal->PicNum, true); flipx = (BYTE)(decal->RenderFlags & RF_XFLIP); if (WallSpriteTile == NULL || WallSpriteTile->UseType == FTexture::TEX_Null) @@ -290,7 +290,7 @@ namespace swrenderer { // calculate lighting R_SetColorMapLight(usecolormap, light, wallshade); } - R_DecalColumn(x, maskedScaleY, sprflipvert, mfloorclip, mceilingclip); + R_DecalColumn(x, WallSpriteTile, maskedScaleY, sprflipvert, mfloorclip, mceilingclip); light += lightstep; x++; } @@ -311,7 +311,7 @@ namespace swrenderer WallC = savecoord; } - void R_DecalColumn(int x, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip) + void R_DecalColumn(int x, FTexture *WallSpriteTile, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip) { float iscale = swall[x] * maskedScaleY; double spryscale = 1 / iscale; diff --git a/src/swrenderer/things/r_decal.h b/src/swrenderer/things/r_decal.h index 5399fb3707..461675a71d 100644 --- a/src/swrenderer/things/r_decal.h +++ b/src/swrenderer/things/r_decal.h @@ -22,5 +22,5 @@ namespace swrenderer void R_RenderDecals(side_t *wall, drawseg_t *draw_segment, int wallshade, float lightleft, float lightstep, seg_t *curline, const FWallCoords &wallC); void R_RenderDecal(side_t *wall, DBaseDecal *first, drawseg_t *clipper, int wallshade, float lightleft, float lightstep, seg_t *curline, FWallCoords wallC, int pass); - void R_DecalColumn(int x, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip); + void R_DecalColumn(int x, FTexture *WallSpriteTile, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip); } diff --git a/src/swrenderer/things/r_wallsprite.cpp b/src/swrenderer/things/r_wallsprite.cpp index 674bd12187..fe1aabb64d 100644 --- a/src/swrenderer/things/r_wallsprite.cpp +++ b/src/swrenderer/things/r_wallsprite.cpp @@ -185,7 +185,7 @@ namespace swrenderer calclighting = true; // Draw it - WallSpriteTile = spr->pic; + FTexture *WallSpriteTile = spr->pic; if (spr->renderflags & RF_YFLIP) { sprflipvert = true; @@ -222,7 +222,7 @@ namespace swrenderer R_SetColorMapLight(usecolormap, light, shade); } if (!R_ClipSpriteColumnWithPortals(spr)) - R_WallSpriteColumn(x, maskedScaleY, sprflipvert, mfloorclip, mceilingclip); + R_WallSpriteColumn(x, WallSpriteTile, maskedScaleY, sprflipvert, mfloorclip, mceilingclip); light += lightstep; x++; } @@ -230,7 +230,7 @@ namespace swrenderer R_FinishSetPatchStyle(); } - void R_WallSpriteColumn(int x, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip) + void R_WallSpriteColumn(int x, FTexture *WallSpriteTile, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip) { float iscale = swall[x] * maskedScaleY; double spryscale = 1 / iscale; diff --git a/src/swrenderer/things/r_wallsprite.h b/src/swrenderer/things/r_wallsprite.h index a3ed29170b..2fe78a68e2 100644 --- a/src/swrenderer/things/r_wallsprite.h +++ b/src/swrenderer/things/r_wallsprite.h @@ -19,5 +19,5 @@ namespace swrenderer { void R_ProjectWallSprite(AActor *thing, const DVector3 &pos, FTextureID picnum, const DVector2 &scale, int renderflags, int spriteshade); void R_DrawWallSprite(vissprite_t *spr, const short *mfloorclip, const short *mceilingclip); - void R_WallSpriteColumn(int x, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip); + void R_WallSpriteColumn(int x, FTexture *WallSpriteTile, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip); }