From b4d3a767934f9584408659393e545628343d4745 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 13 Jul 2019 03:20:21 +0000 Subject: [PATCH] Fix stupid bug with sprite shadows in Polymost git-svn-id: https://svn.eduke32.com/eduke32@7789 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index b8022b5a5..258655689 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -4268,7 +4268,6 @@ skip: tsprShadow->z = shadowZ; tsprShadow->pal = ud.shadow_pal; - #ifdef USE_OPENGL if (videoGetRenderMode() >= REND_POLYMOST) { @@ -4282,11 +4281,11 @@ skip: } else { - int const ii - = getangle(tsprShadow->x - g_player[screenpeek].ps->pos.x, tsprShadow->y - g_player[screenpeek].ps->pos.y); + int const camang = display_mirror ? ((2048 - fix16_to_int(CAMERA(q16ang))) & 2047) : fix16_to_int(CAMERA(q16ang)); + vec2_t const ofs = { sintable[(camang+512)&2047]>>11, sintable[(camang)&2047]>>11}; - tsprShadow->x += sintable[(ii+2560)&2047]>>9; - tsprShadow->y += sintable[(ii+2048)&2047]>>9; + tsprShadow->x += ofs.x; + tsprShadow->y += ofs.y; } } #endif