Remove WallSpriteTile global

This commit is contained in:
Magnus Norddahl 2017-01-09 14:51:34 +01:00
parent b9024f87a0
commit bb2806c9ca
6 changed files with 8 additions and 21 deletions

View file

@ -79,17 +79,6 @@ namespace swrenderer
{
using namespace drawerargs;
FTexture *WallSpriteTile;
//
// INITIALIZATION FUNCTIONS
//
//
// GAME FUNCTIONS
//
bool DrewAVoxel;
static vissprite_t **spritesorter;

View file

@ -38,8 +38,6 @@ EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
namespace swrenderer
{
extern FTexture *WallSpriteTile;
bool R_ClipSpriteColumnWithPortals(vissprite_t* spr);

View file

@ -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;

View file

@ -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);
}

View file

@ -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;

View file

@ -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);
}