mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 23:32:04 +00:00
Convert r_sprite into a class
This commit is contained in:
parent
deae5bb1a6
commit
164af7264f
5 changed files with 11 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -595,7 +595,7 @@ namespace swrenderer
|
|||
{
|
||||
if (!spr->bWallSprite)
|
||||
{
|
||||
R_DrawVisSprite(spr, clipbot, cliptop);
|
||||
RenderSprite::Render(spr, clipbot, cliptop);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue