mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-01 16:41:22 +00:00
Convert r_wallsprite to a class
This commit is contained in:
parent
7bed0ffeb6
commit
ee2811450d
4 changed files with 15 additions and 9 deletions
|
@ -867,7 +867,7 @@ namespace swrenderer
|
|||
{
|
||||
if ((sprite.renderflags & RF_SPRITETYPEMASK) == RF_WALLSPRITE)
|
||||
{
|
||||
R_ProjectWallSprite(thing, sprite.pos, sprite.picnum, sprite.spriteScale, sprite.renderflags, spriteshade);
|
||||
RenderWallSprite::Project(thing, sprite.pos, sprite.picnum, sprite.spriteScale, sprite.renderflags, spriteshade);
|
||||
}
|
||||
else if (sprite.voxel)
|
||||
{
|
||||
|
|
|
@ -599,7 +599,7 @@ namespace swrenderer
|
|||
}
|
||||
else
|
||||
{
|
||||
R_DrawWallSprite(spr, clipbot, cliptop);
|
||||
RenderWallSprite::Render(spr, clipbot, cliptop);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -59,7 +59,7 @@ EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
|
|||
|
||||
namespace swrenderer
|
||||
{
|
||||
void R_ProjectWallSprite(AActor *thing, const DVector3 &pos, FTextureID picnum, const DVector2 &scale, int renderflags, int spriteshade)
|
||||
void RenderWallSprite::Project(AActor *thing, const DVector3 &pos, FTextureID picnum, const DVector2 &scale, int renderflags, int spriteshade)
|
||||
{
|
||||
FWallCoords wallc;
|
||||
double x1, x2;
|
||||
|
@ -135,7 +135,7 @@ namespace swrenderer
|
|||
vis->wallc = wallc;
|
||||
}
|
||||
|
||||
void R_DrawWallSprite(vissprite_t *spr, const short *mfloorclip, const short *mceilingclip)
|
||||
void RenderWallSprite::Render(vissprite_t *spr, const short *mfloorclip, const short *mceilingclip)
|
||||
{
|
||||
int x1, x2;
|
||||
double iyscale;
|
||||
|
@ -223,7 +223,7 @@ namespace swrenderer
|
|||
R_SetColorMapLight(usecolormap, light, shade);
|
||||
}
|
||||
if (!R_ClipSpriteColumnWithPortals(x, spr))
|
||||
R_WallSpriteColumn(x, WallSpriteTile, maskedScaleY, sprflipvert, mfloorclip, mceilingclip);
|
||||
DrawColumn(x, WallSpriteTile, maskedScaleY, sprflipvert, mfloorclip, mceilingclip);
|
||||
light += lightstep;
|
||||
x++;
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ namespace swrenderer
|
|||
R_FinishSetPatchStyle();
|
||||
}
|
||||
|
||||
void R_WallSpriteColumn(int x, FTexture *WallSpriteTile, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip)
|
||||
void RenderWallSprite::DrawColumn(int x, FTexture *WallSpriteTile, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip)
|
||||
{
|
||||
float iscale = swall[x] * maskedScaleY;
|
||||
double spryscale = 1 / iscale;
|
||||
|
|
|
@ -17,7 +17,13 @@
|
|||
|
||||
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, FTexture *WallSpriteTile, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip);
|
||||
class RenderWallSprite
|
||||
{
|
||||
public:
|
||||
static void Project(AActor *thing, const DVector3 &pos, FTextureID picnum, const DVector2 &scale, int renderflags, int spriteshade);
|
||||
static void Render(vissprite_t *spr, const short *mfloorclip, const short *mceilingclip);
|
||||
|
||||
private:
|
||||
static void DrawColumn(int x, FTexture *WallSpriteTile, float maskedScaleY, bool sprflipvert, const short *mfloorclip, const short *mceilingclip);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue