From ea915e5778702dbb86cb88a42c165f45489199a2 Mon Sep 17 00:00:00 2001 From: Sryder Date: Sat, 9 Jun 2018 22:58:03 +0100 Subject: [PATCH 1/2] Fix papersprites more for real this time (Seperate AL and AR sprites were broken, I figured out I was a dunce, oh noey) --- src/hardware/hw_main.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 72c487565..2f49ed7d1 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5248,8 +5248,7 @@ static void HWR_ProjectSprite(mobj_t *thing) I_Error("sprframes NULL for sprite %d\n", thing->sprite); #endif - if (sprframe->rotate != SRF_SINGLE) - ang = R_PointToAngle (thing->x, thing->y) - thing->angle; + ang = R_PointToAngle (thing->x, thing->y) - thing->angle; if (sprframe->rotate == SRF_SINGLE) { @@ -5258,7 +5257,7 @@ static void HWR_ProjectSprite(mobj_t *thing) lumpoff = sprframe->lumpid[0]; //Fab: see note above flip = sprframe->flip; // Will only be 0x00 or 0xFF - if (papersprite && (R_PointToAngle (thing->x, thing->y) - thing->angle < ANGLE_180)) + if (papersprite && ang < ANGLE_180) { if (flip) flip = 0; @@ -5279,6 +5278,14 @@ static void HWR_ProjectSprite(mobj_t *thing) //Fab: lumpid is the index for spritewidth,spriteoffset... tables lumpoff = sprframe->lumpid[rot]; flip = sprframe->flip & (1<skin && ((skin_t *)thing->skin)->flags & SF_HIRES) @@ -5286,16 +5293,8 @@ static void HWR_ProjectSprite(mobj_t *thing) if (papersprite) { - if (flip && sprframe->rotate != SRF_SINGLE) - { - rightsin = FIXED_TO_FLOAT(FINESINE((thing->angle+ANGLE_180)>>ANGLETOFINESHIFT)); - rightcos = FIXED_TO_FLOAT(FINECOSINE((thing->angle+ANGLE_180)>>ANGLETOFINESHIFT)); - } - else - { - rightsin = FIXED_TO_FLOAT(FINESINE((thing->angle)>>ANGLETOFINESHIFT)); - rightcos = FIXED_TO_FLOAT(FINECOSINE((thing->angle)>>ANGLETOFINESHIFT)); - } + rightsin = FIXED_TO_FLOAT(FINESINE((thing->angle)>>ANGLETOFINESHIFT)); + rightcos = FIXED_TO_FLOAT(FINECOSINE((thing->angle)>>ANGLETOFINESHIFT)); } else { From 54e92a96b35dedce8cbbd4ab597da1d2ef52973c Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 11 Jun 2018 19:36:47 +0100 Subject: [PATCH 2/2] backport fix to L/R sprite loading code from internal basically we don't want L/R sprites to always be flipped, for obvious reasons --- src/r_things.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index 1352209d7..fa0316bf7 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -148,7 +148,11 @@ static void R_InstallSpriteLump(UINT16 wad, // graphics patch sprtemp[frame].lumppat[r + rightfactor] = lumppat; sprtemp[frame].lumpid[r + rightfactor] = lumpid; } - sprtemp[frame].flip |= (flipped ? (0x0F << rightfactor) : 0); // 00001111 or 11110000 in binary, depending on rotation being ROT_L or ROT_R + if (flipped) + sprtemp[frame].flip |= (0x0F<