mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-16 17:51:27 +00:00
Fix paper sprites apparently "turning" around sometimes when you turn the camera, when they're supposed to be still (sawb.wad for instance)
I cleaned up some of Sryder's changes a little too I guess
This commit is contained in:
parent
459d8064ee
commit
8290ae9fd4
1 changed files with 22 additions and 25 deletions
|
@ -5122,15 +5122,26 @@ 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 || papersprite)
|
if (papersprite)
|
||||||
{
|
{
|
||||||
ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
|
// Use the actual view angle, rather than the angle formed
|
||||||
if (papersprite)
|
// between the view point and the thing
|
||||||
|
// this makes sure paper sprites always appear at the right angle!
|
||||||
|
// Note: DO NOT do this in software mode version, it actually
|
||||||
|
// makes papersprites look WORSE there (I know, I've tried)
|
||||||
|
// Monster Iestyn - 13/05/17
|
||||||
|
ang = dup_viewangle - thing->angle;
|
||||||
|
ang_scale = FIXED_TO_FLOAT(FINESINE(ang>>ANGLETOFINESHIFT));
|
||||||
|
ang_scalez = FIXED_TO_FLOAT(FINECOSINE(ang>>ANGLETOFINESHIFT));
|
||||||
|
|
||||||
|
if (ang_scale < 0)
|
||||||
{
|
{
|
||||||
ang_scale = FIXED_TO_FLOAT(FINESINE(ang>>ANGLETOFINESHIFT));
|
ang_scale = -ang_scale;
|
||||||
ang_scalez = FIXED_TO_FLOAT(FINECOSINE(ang>>ANGLETOFINESHIFT));
|
ang_scalez = -ang_scalez;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (sprframe->rotate != SRF_SINGLE)
|
||||||
|
ang = R_PointToAngle (thing->x, thing->y) - thing->angle;
|
||||||
|
|
||||||
if (sprframe->rotate == SRF_SINGLE)
|
if (sprframe->rotate == SRF_SINGLE)
|
||||||
{
|
{
|
||||||
|
@ -5163,16 +5174,8 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
else
|
else
|
||||||
offset = FIXED_TO_FLOAT(spritecachedinfo[lumpoff].offset) * this_scale;
|
offset = FIXED_TO_FLOAT(spritecachedinfo[lumpoff].offset) * this_scale;
|
||||||
|
|
||||||
if (ang_scale < 0)
|
z1 = tz - (offset * ang_scalez);
|
||||||
{
|
tx -= offset * ang_scale;
|
||||||
z1 = tz + offset * ang_scalez;
|
|
||||||
tx += offset * ang_scale;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
z1 = tz - offset * ang_scalez;
|
|
||||||
tx -= offset * ang_scale;
|
|
||||||
}
|
|
||||||
|
|
||||||
// project x
|
// project x
|
||||||
x1 = gr_windowcenterx + (tx * gr_centerx / tz);
|
x1 = gr_windowcenterx + (tx * gr_centerx / tz);
|
||||||
|
@ -5184,16 +5187,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
x1 = tx;
|
x1 = tx;
|
||||||
|
|
||||||
offset = FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width) * this_scale;
|
offset = FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width) * this_scale;
|
||||||
if (ang_scale < 0)
|
|
||||||
{
|
z2 = z1 + (offset * ang_scalez);
|
||||||
z2 = z1 - offset * ang_scalez;
|
tx += offset * ang_scale;
|
||||||
tx -= offset * ang_scale;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
z2 = z1 + offset * ang_scalez;
|
|
||||||
tx += offset * ang_scale;
|
|
||||||
}
|
|
||||||
if (papersprite && max(z1, z2) < ZCLIP_PLANE)
|
if (papersprite && max(z1, z2) < ZCLIP_PLANE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue