Unify what mobj->rollangle and mobj->pitch do for papersprites in both renderers

This commit is contained in:
lachablock 2021-05-24 21:36:28 +10:00
parent 3c9a05e1b8
commit ec2495d4c9
2 changed files with 18 additions and 6 deletions

View file

@ -5122,9 +5122,15 @@ static void HWR_ProjectSprite(mobj_t *thing)
spr_topoffset = spritecachedinfo[lumpoff].topoffset;
#ifdef ROTSPRITE
rollangle = FixedMul(FINECOSINE((ang) >> ANGLETOFINESHIFT), thing->roll)
+ FixedMul(FINESINE((ang) >> ANGLETOFINESHIFT), thing->pitch)
+ thing->rollangle;
if (papersprite)
rollangle = thing->pitch // pitch should flip the sprite rotation on one side of the papersprite (OpenGL does this by default)
+ (ang >= ANGLE_180 ? -1 : 1) * thing->rollangle; // rollangle should use the same rotation for both sides of a papersprite (Software behavior parity)
else
{
rollangle = FixedMul(FINECOSINE((ang) >> ANGLETOFINESHIFT), thing->roll)
+ FixedMul(FINESINE((ang) >> ANGLETOFINESHIFT), thing->pitch)
+ thing->rollangle;
}
if (rollangle
&& !(splat && !(thing->renderflags & RF_NOSPLATROLLANGLE)))
{

View file

@ -1579,9 +1579,15 @@ static void R_ProjectSprite(mobj_t *thing)
patch = W_CachePatchNum(sprframe->lumppat[rot], PU_SPRITE);
#ifdef ROTSPRITE
rollangle = FixedMul(FINECOSINE((ang) >> ANGLETOFINESHIFT), thing->roll)
+ FixedMul(FINESINE((ang) >> ANGLETOFINESHIFT), thing->pitch)
+ thing->rollangle;
if (papersprite)
rollangle = (ang >= ANGLE_180 ? -1 : 1) * thing->pitch // pitch should flip the sprite rotation on one side of the papersprite
+ thing->rollangle; // rollangle should use the same rotation for both sides of a papersprite
else
{
rollangle = FixedMul(FINECOSINE((ang) >> ANGLETOFINESHIFT), thing->roll)
+ FixedMul(FINESINE((ang) >> ANGLETOFINESHIFT), thing->pitch)
+ thing->rollangle;
}
if (rollangle
&& !(splat && !(thing->renderflags & RF_NOSPLATROLLANGLE)))
{