mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-07 10:30:44 +00:00
Unify what mobj->rollangle and mobj->pitch do for papersprites in both renderers
This commit is contained in:
parent
3c9a05e1b8
commit
ec2495d4c9
2 changed files with 18 additions and 6 deletions
|
@ -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)))
|
||||
{
|
||||
|
|
|
@ -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)))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue