Convert r_sprite into a class

This commit is contained in:
Magnus Norddahl 2017-01-11 18:17:28 +01:00
parent deae5bb1a6
commit 164af7264f
5 changed files with 11 additions and 7 deletions

View file

@ -875,7 +875,7 @@ namespace swrenderer
}
else
{
R_ProjectSprite(thing, sprite.pos, sprite.tex, sprite.spriteScale, sprite.renderflags, fakeside, fakefloor, fakeceiling, sec, spriteshade);
RenderSprite::Project(thing, sprite.pos, sprite.tex, sprite.spriteScale, sprite.renderflags, fakeside, fakefloor, fakeceiling, sec, spriteshade);
}
}
}

View file

@ -579,7 +579,7 @@ namespace swrenderer
short *mfloorclip = screenheightarray;
short *mceilingclip = zeroarray;
R_DrawVisSprite(vis, mfloorclip, mceilingclip);
RenderSprite::Render(vis, mfloorclip, mceilingclip);
}
void R_DrawRemainingPlayerSprites()

View file

@ -57,7 +57,7 @@ EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor)
namespace swrenderer
{
void R_ProjectSprite(AActor *thing, const DVector3 &pos, FTexture *tex, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int spriteshade)
void RenderSprite::Project(AActor *thing, const DVector3 &pos, FTexture *tex, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int spriteshade)
{
// transform the origin point
double tr_x = pos.X - ViewPos.X;
@ -271,7 +271,7 @@ namespace swrenderer
}
}
void R_DrawVisSprite(vissprite_t *vis, const short *mfloorclip, const short *mceilingclip)
void RenderSprite::Render(vissprite_t *vis, const short *mfloorclip, const short *mceilingclip)
{
fixed_t frac;
FTexture *tex;

View file

@ -17,6 +17,10 @@
namespace swrenderer
{
void R_ProjectSprite(AActor *thing, const DVector3 &pos, FTexture *tex, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int spriteshade);
void R_DrawVisSprite(vissprite_t *vis, const short *mfloorclip, const short *mceilingclip);
class RenderSprite
{
public:
static void Project(AActor *thing, const DVector3 &pos, FTexture *tex, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int spriteshade);
static void Render(vissprite_t *vis, const short *mfloorclip, const short *mceilingclip);
};
}

View file

@ -595,7 +595,7 @@ namespace swrenderer
{
if (!spr->bWallSprite)
{
R_DrawVisSprite(spr, clipbot, cliptop);
RenderSprite::Render(spr, clipbot, cliptop);
}
else
{