1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

WIP: start reworking PeepAnimationGroup

This commit is contained in:
Aaron van Geffen
2024-12-02 19:58:00 +01:00
parent 7127e4555e
commit b0da41fef5
9 changed files with 187 additions and 122 deletions

View File

@@ -15,6 +15,7 @@
#include "../core/Guard.hpp"
#include "../core/Json.hpp"
#include "../peep/PeepAnimations.h"
#include "../rct12/RCT12.h"
using namespace OpenRCT2;
@@ -94,7 +95,7 @@ void PeepAnimationsObject::ReadJson(IReadObjectContext* context, json_t& root)
if (groupJson.contains("legacyPosition"))
{
auto position = Json::GetNumber<uint8_t>(groupJson["legacyPosition"]);
if (position <= EnumValue(PeepAnimationGroup::Count))
if (position <= EnumValue(RCT12PeepAnimationGroup::Count))
{
group.legacyPosition = static_cast<PeepAnimationGroup>(position);
}
@@ -104,6 +105,16 @@ void PeepAnimationsObject::ReadJson(IReadObjectContext* context, json_t& root)
}
}
ImageIndex PeepAnimationsObject::GetInlineImageId() const
{
return _imageOffsetId;
}
const PeepAnimation& PeepAnimationsObject::GetPeepAnimation(PeepAnimationGroup animGroup, PeepAnimationType animType) const
{
return _animationGroups[EnumValue(animGroup)][animType];
}
size_t PeepAnimationsObject::GetNumAnimationGroups() const
{
return _animationGroups.size();