1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-01 19:25:12 +01:00

Move invalidation out of Peep::UpdateSpriteBoundingBox

This commit is contained in:
Aaron van Geffen
2024-12-17 18:38:43 +01:00
parent 92dac978dc
commit ec14a6dca8
3 changed files with 12 additions and 8 deletions

View File

@@ -353,19 +353,17 @@ void Peep::UpdateCurrentAnimationType()
AnimationType = newAnimationType;
Invalidate();
UpdateSpriteBoundingBox();
Invalidate();
}
void Peep::UpdateSpriteBoundingBox()
{
Invalidate();
const SpriteBounds* spriteBounds = &GetSpriteBounds(AnimationGroup, AnimationType);
SpriteData.Width = spriteBounds->sprite_width;
SpriteData.HeightMin = spriteBounds->sprite_height_negative;
SpriteData.HeightMax = spriteBounds->sprite_height_positive;
Invalidate();
const& auto spriteBounds = GetSpriteBounds(AnimationGroup, AnimationType);
SpriteData.Width = spriteBounds.sprite_width;
SpriteData.HeightMin = spriteBounds.sprite_height_negative;
SpriteData.HeightMax = spriteBounds.sprite_height_positive;
}
/* rct2: 0x00693BE5 */

View File

@@ -923,7 +923,9 @@ namespace OpenRCT2::Scripting
const auto& animationGroup = GetPeepAnimation(peep->AnimationGroup, peep->AnimationType);
peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset];
peep->Invalidate();
peep->UpdateSpriteBoundingBox();
peep->Invalidate();
}
uint8_t ScGuest::animationOffset_get() const

View File

@@ -354,7 +354,9 @@ namespace OpenRCT2::Scripting
auto& animationGroup = GetPeepAnimation(peep->AnimationGroup, peep->AnimationType);
peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset];
peep->Invalidate();
peep->UpdateSpriteBoundingBox();
peep->Invalidate();
}
uint8_t ScStaff::animationOffset_get() const
@@ -387,7 +389,9 @@ namespace OpenRCT2::Scripting
peep->AnimationFrameNum = offset;
peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset];
peep->Invalidate();
peep->UpdateSpriteBoundingBox();
peep->Invalidate();
}
uint8_t ScStaff::animationLength_get() const