Use angle between viewz and mobj z to determine splat sprite angle

This commit is contained in:
James R 2022-10-31 19:03:09 -07:00 committed by AJ Martinez
parent 26eb1cf9e2
commit 603a1671b4
2 changed files with 15 additions and 4 deletions

View file

@ -5254,9 +5254,16 @@ static void HWR_ProjectSprite(mobj_t *thing)
I_Error("sprframes NULL for sprite %d\n", thing->sprite);
#endif
ang = R_PointToAngle (interp.x, interp.y) - interp.angle;
if (mirrored)
ang = InvAngle(ang);
if (splat)
{
ang = R_PointToAngle2(0, viewz, 0, interp.z);
}
else
{
ang = R_PointToAngle (interp.x, interp.y) - interp.angle;
if (mirrored)
ang = InvAngle(ang);
}
if (sprframe->rotate == SRF_SINGLE)
{

View file

@ -1755,7 +1755,11 @@ static void R_ProjectSprite(mobj_t *thing)
I_Error("R_ProjectSprite: sprframes NULL for sprite %d\n", thing->sprite);
#endif
if (sprframe->rotate != SRF_SINGLE || papersprite)
if (splat)
{
ang = R_PointToAngle2(0, viewz, 0, interp.z);
}
else if (sprframe->rotate != SRF_SINGLE || papersprite)
{
ang = R_PointToAngle (interp.x, interp.y) - interp.angle;
if (mirrored)