mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-02-02 19:56:13 +01:00
Start working on peep entity animation object conversion
This commit is contained in:
@@ -90,10 +90,30 @@ void PeepAnimationsObject::ReadJson(IReadObjectContext* context, json_t& root)
|
||||
group[typeEnum] = anim;
|
||||
}
|
||||
|
||||
// Is this animation group replacing a legacy group?
|
||||
if (groupJson.contains("legacyPosition"))
|
||||
{
|
||||
auto position = Json::GetNumber<uint8_t>(groupJson["legacyPosition"]);
|
||||
if (position <= EnumValue(PeepAnimationGroup::Count))
|
||||
{
|
||||
group.legacyPosition = static_cast<PeepAnimationGroup>(position);
|
||||
}
|
||||
}
|
||||
|
||||
_animationGroups.push_back(group);
|
||||
}
|
||||
}
|
||||
|
||||
size_t PeepAnimationsObject::GetNumAnimationGroups() const
|
||||
{
|
||||
return _animationGroups.size();
|
||||
}
|
||||
|
||||
PeepAnimationGroup PeepAnimationsObject::GetLegacyPosition(PeepAnimationGroup animGroup) const
|
||||
{
|
||||
return _animationGroups[EnumValue(animGroup)].legacyPosition;
|
||||
}
|
||||
|
||||
void PeepAnimationsObject::DrawPreview(DrawPixelInfo& dpi, int32_t width, int32_t height) const
|
||||
{
|
||||
auto centre = ScreenCoordsXY{ width / 2, height / 2 };
|
||||
|
||||
Reference in New Issue
Block a user