From d6c7aaf69c94eca443cda240e53ed3791cbbe876 Mon Sep 17 00:00:00 2001 From: WantDiscussion <62322762+WantDiscussion@users.noreply.github.com> Date: Thu, 19 Mar 2020 01:04:57 +1100 Subject: [PATCH] Fix: Light effects are drawn off-centre in some rotations --- contributors.md | 1 + distribution/changelog.txt | 1 + src/openrct2/drawing/LightFX.cpp | 26 ++------------------------ 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/contributors.md b/contributors.md index 591c81809d..54f9146e30 100644 --- a/contributors.md +++ b/contributors.md @@ -137,6 +137,7 @@ The following people are not part of the development team, but have been contrib * Denis Khabenkov (kodmord) * Kevin Laframboise (klaframboise) * Tushar Sariya (TusharSariya) +* (WantDiscussion) ## Toolchain * (Balletie) - macOS diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 1af1094577..aa720164a3 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -37,6 +37,7 @@ - Fix: [#10898] Banner text has an offset in tile inspector window. - Fix: [#10904] RCT1/LL-scenarios with red water won't open. - Fix: [#10941] The Clear Scenery tool gives refunds for ghost elements. +- Fix: [#10963] Light effects are drawn off-centre in some rotations. - Improved: [#682] The staff patrol area is now drawn on the water, instead of on the surface under water. - Improved: [#10858] Added horizontal grid lines to finance charts. - Improved: [#10884] Added y-axes and labels to park window charts. diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 8a0b0a18f0..3c5271b74b 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -674,30 +674,8 @@ void lightfx_add_3d_light(uint32_t lightID, uint16_t lightIDqualifier, int16_t x void lightfx_add_3d_light_magic_from_drawing_tile( const CoordsXY& mapPosition, int16_t offsetX, int16_t offsetY, int16_t offsetZ, uint8_t lightType) { - int16_t x = mapPosition.x + offsetX; - int16_t y = mapPosition.y + offsetY; - - switch (get_current_rotation()) - { - case 0: - x += 16; - y += 16; - break; - case 1: - x += 16; - y += 16; - break; - case 2: - x += 16; - y -= 16; - break; - case 3: - x += 16; - y -= 16; - break; - default: - return; - } + int16_t x = mapPosition.x + offsetX + 16; + int16_t y = mapPosition.y + offsetY + 16; lightfx_add_3d_light((x << 16) | y, (offsetZ << 8) | LIGHTFX_LIGHT_QUALIFIER_MAP, x, y, offsetZ, lightType); }