- implement +SQUAREPIXELS flag

This commit is contained in:
Rachael Alexanderson 2024-09-07 23:09:18 -04:00
parent 76c8b6da57
commit 5895f9b1b1
No known key found for this signature in database
GPG key ID: 26A8ACCE97115EE0
3 changed files with 3 additions and 1 deletions

View file

@ -503,6 +503,7 @@ 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
};
// This translucency value produces the closest match to Heretic's TINTTAB.

View file

@ -1036,7 +1036,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|RF_FLATSPRITE))
if ((thing->renderflags & (RF_ROLLSPRITE|RF_FLATSPRITE)) || (thing->renderflags2 & RF2_SQUAREPIXELS))
{
double ps = di->Level->pixelstretch;
double mult = 1.0 / sqrt(ps); // shrink slightly

View file

@ -386,6 +386,7 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(RF2, CAMFOLLOWSPLAYER, AActor, renderflags2),
DEFINE_FLAG(RF2, NOMIPMAP, AActor, renderflags2),
DEFINE_FLAG(RF2, ISOMETRICSPRITES, AActor, renderflags2),
DEFINE_FLAG(RF2, SQUAREPIXELS, AActor, renderflags2),
// Bounce flags
DEFINE_FLAG2(BOUNCE_Walls, BOUNCEONWALLS, AActor, BounceFlags),