mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 23:32:02 +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)
|
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)
|
else if (sprite.voxel)
|
||||||
{
|
{
|
||||||
|
|
|
@ -599,7 +599,7 @@ namespace swrenderer
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
R_DrawWallSprite(spr, clipbot, cliptop);
|
RenderWallSprite::Render(spr, clipbot, cliptop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -59,7 +59,7 @@ EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
|
||||||
|
|
||||||
namespace swrenderer
|
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;
|
FWallCoords wallc;
|
||||||
double x1, x2;
|
double x1, x2;
|
||||||
|
@ -135,7 +135,7 @@ namespace swrenderer
|
||||||
vis->wallc = wallc;
|
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;
|
int x1, x2;
|
||||||
double iyscale;
|
double iyscale;
|
||||||
|
@ -223,7 +223,7 @@ namespace swrenderer
|
||||||
R_SetColorMapLight(usecolormap, light, shade);
|
R_SetColorMapLight(usecolormap, light, shade);
|
||||||
}
|
}
|
||||||
if (!R_ClipSpriteColumnWithPortals(x, spr))
|
if (!R_ClipSpriteColumnWithPortals(x, spr))
|
||||||
R_WallSpriteColumn(x, WallSpriteTile, maskedScaleY, sprflipvert, mfloorclip, mceilingclip);
|
DrawColumn(x, WallSpriteTile, maskedScaleY, sprflipvert, mfloorclip, mceilingclip);
|
||||||
light += lightstep;
|
light += lightstep;
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ namespace swrenderer
|
||||||
R_FinishSetPatchStyle();
|
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;
|
float iscale = swall[x] * maskedScaleY;
|
||||||
double spryscale = 1 / iscale;
|
double spryscale = 1 / iscale;
|
||||||
|
|
|
@ -17,7 +17,13 @@
|
||||||
|
|
||||||
namespace swrenderer
|
namespace swrenderer
|
||||||
{
|
{
|
||||||
void R_ProjectWallSprite(AActor *thing, const DVector3 &pos, FTextureID picnum, const DVector2 &scale, int renderflags, int spriteshade);
|
class RenderWallSprite
|
||||||
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);
|
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