Merge branch 'public_flatsprite' into 'public_flatsprite'

OpenGL: Paper Sprites: The Thousands of Bugs

See merge request STJr/SRB2!253
This commit is contained in:
Monster Iestyn 2018-06-11 14:46:51 -04:00
commit 5f09f60856
1 changed files with 12 additions and 13 deletions

View File

@ -5248,8 +5248,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
I_Error("sprframes NULL for sprite %d\n", thing->sprite); I_Error("sprframes NULL for sprite %d\n", thing->sprite);
#endif #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) if (sprframe->rotate == SRF_SINGLE)
{ {
@ -5258,7 +5257,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
lumpoff = sprframe->lumpid[0]; //Fab: see note above lumpoff = sprframe->lumpid[0]; //Fab: see note above
flip = sprframe->flip; // Will only be 0x00 or 0xFF 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) if (flip)
flip = 0; flip = 0;
@ -5279,6 +5278,14 @@ static void HWR_ProjectSprite(mobj_t *thing)
//Fab: lumpid is the index for spritewidth,spriteoffset... tables //Fab: lumpid is the index for spritewidth,spriteoffset... tables
lumpoff = sprframe->lumpid[rot]; lumpoff = sprframe->lumpid[rot];
flip = sprframe->flip & (1<<rot); flip = sprframe->flip & (1<<rot);
if (papersprite && ang < ANGLE_180)
{
if (flip)
flip = 0;
else
flip = 1<<rot;
}
} }
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES) if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
@ -5286,16 +5293,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
if (papersprite) if (papersprite)
{ {
if (flip && sprframe->rotate != SRF_SINGLE) rightsin = FIXED_TO_FLOAT(FINESINE((thing->angle)>>ANGLETOFINESHIFT));
{ rightcos = FIXED_TO_FLOAT(FINECOSINE((thing->angle)>>ANGLETOFINESHIFT));
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));
}
} }
else else
{ {