From e18abdd6a4c073412ada30cd6483f1b195fb9498 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 17 Dec 2024 18:54:43 +0100 Subject: [PATCH] Compensate inferred sprite bounds for balloon/hat/umbrella sprites --- distribution/changelog.txt | 1 + src/openrct2/peep/PeepAnimationData.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index b7981dc69c..b9c63b5763 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -5,6 +5,7 @@ - Improved: [#23404] Folders are now paired with an icon in the load/save window. - Fix: [#23286] Currency formatted incorrectly in the in game console. - Fix: [#23348] Console set commands don't print output properly. +- Fix: [#23376] Peeps with balloons, hats and umbrellas may leave artifacts on screen. 0.4.17 (2024-12-08) ------------------------------------------------------------------------ diff --git a/src/openrct2/peep/PeepAnimationData.cpp b/src/openrct2/peep/PeepAnimationData.cpp index 3a2dae4e05..ec499fcf3a 100644 --- a/src/openrct2/peep/PeepAnimationData.cpp +++ b/src/openrct2/peep/PeepAnimationData.cpp @@ -999,6 +999,15 @@ namespace OpenRCT2 continue; anim.bounds = inferMaxAnimationDimensions(anim); + + // Balloons, hats and umbrellas are painted separately, so the inference + // algorithm doesn't account for those. We manually compensate for these here. + // Between 8-12 pixels are needed, depending on rotation, so we're generalising. + auto pag = PeepAnimationGroup(groupKey); + if (pag == PeepAnimationGroup::Balloon || pag == PeepAnimationGroup::Hat || pag == PeepAnimationGroup::Umbrella) + { + anim.bounds.sprite_height_negative += 12; + } } } }