Added (SPF_)STRETCHPIXELS.

This counteracts the squaring implied by rolling sprites.
This commit is contained in:
Major Cooke 2024-10-14 14:15:30 -05:00 committed by Rachael Alexanderson
parent 2f30f720a4
commit cca1946201
No known key found for this signature in database
GPG key ID: 26A8ACCE97115EE0
4 changed files with 6 additions and 3 deletions

View file

@ -506,7 +506,8 @@ enum ActorRenderFlag2
RF2_CAMFOLLOWSPLAYER = 0x0040, // Matches the cam's base position and angles to the main viewpoint.
RF2_NOMIPMAP = 0x0080, // [Nash] forces no mipmapping on sprites. Useful for tiny sprites that need to remain visually crisp
RF2_ISOMETRICSPRITES = 0x0100,
RF2_SQUAREPIXELS = 0x0200, // apply +ROLLSPRITE scaling math so that non rolling sprites get the same scaling
RF2_SQUAREPIXELS = 0x0200, // apply +ROLLSPRITE scaling math so that non rolling sprites get the same scaling
RF2_STRETCHPIXELS = 0x0400, // don't apply SQUAREPIXELS for ROLLSPRITES
};
// This translucency value produces the closest match to Heretic's TINTTAB.

View file

@ -70,6 +70,7 @@ enum EParticleFlags
SPF_NOFACECAMERA = 1 << 12,
SPF_ROLLCENTER = 1 << 13,
SPF_NOMIPMAP = 1 << 14,
SPF_STRETCHPIXELS = 1 << 15,
};
class DVisualThinker;

View file

@ -1038,7 +1038,7 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
r.Scale(sprscale.X, isSpriteShadow ? sprscale.Y * 0.15 * thing->isoscaleY : sprscale.Y * thing->isoscaleY);
if ((thing->renderflags & RF_ROLLSPRITE) || (thing->renderflags2 & RF2_SQUAREPIXELS))
if (((thing->renderflags & RF_ROLLSPRITE) || (thing->renderflags2 & RF2_SQUAREPIXELS)) && !(thing->renderflags2 & RF2_STRETCHPIXELS))
{
double ps = di->Level->pixelstretch;
double mult = 1.0 / sqrt(ps); // shrink slightly
@ -1621,7 +1621,7 @@ void HWSprite::AdjustVisualThinker(HWDrawInfo* di, DVisualThinker* spr, sector_t
auto r = spi.GetSpriteRect();
r.Scale(spr->Scale.X, spr->Scale.Y);
if (spr->PT.flags & SPF_ROLL)
if ((spr->PT.flags & SPF_ROLL) && !(spr->PT.flags & SPF_STRETCHPIXELS))
{
double ps = di->Level->pixelstretch;
double mult = 1.0 / sqrt(ps); // shrink slightly

View file

@ -723,6 +723,7 @@ enum EParticleFlags
SPF_NOFACECAMERA = 1 << 12,
SPF_ROLLCENTER = 1 << 13,
SPF_NOMIPMAP = 1 << 14,
SPF_STRETCHPIXELS = 1 << 15,
SPF_RELATIVE = SPF_RELPOS|SPF_RELVEL|SPF_RELACCEL|SPF_RELANG
};