diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 0eaa88fe00..a8f376eaf3 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -281,7 +281,7 @@ namespace OpenRCT2::Ui::Windows auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); - uint32_t image_id_base = animObj->GetPeepAnimation(peep->AnimationGroup).base_image; + uint32_t image_id_base = animObj->GetPeepAnimation(peep->AnimationGroup).baseImage; image_id_base += currentFrame & 0xFFFFFFFC; image_id_base++; diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 654a119e84..f56ae9be65 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -569,7 +569,7 @@ namespace OpenRCT2::Ui::Windows auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); - int32_t animationFrame = animObj->GetPeepAnimation(peep->AnimationGroup).base_image + 1; + int32_t animationFrame = animObj->GetPeepAnimation(peep->AnimationGroup).baseImage + 1; int32_t animationFrameOffset = 0; if (page == WINDOW_GUEST_OVERVIEW) @@ -904,7 +904,7 @@ namespace OpenRCT2::Ui::Windows // Get pickup animation length const auto& pickAnim = animObj->GetPeepAnimation(peep->AnimationGroup, PeepAnimationType::Hanging); - const auto pickAnimLength = pickAnim.frame_offsets.size(); + const auto pickAnimLength = pickAnim.frameOffsets.size(); // Update pickup animation, can only happen in this tab. pickedPeepFrame++; @@ -1006,7 +1006,7 @@ namespace OpenRCT2::Ui::Windows auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); - auto baseImageId = animObj->GetPeepAnimation(peep->AnimationGroup, PeepAnimationType::Hanging).base_image; + auto baseImageId = animObj->GetPeepAnimation(peep->AnimationGroup, PeepAnimationType::Hanging).baseImage; baseImageId += pickedPeepFrame >> 2; gPickupPeepImage = ImageId(baseImageId, peep->TshirtColour, peep->TrousersColour); } diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index c8a30939ac..009b8f8836 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -629,7 +629,7 @@ namespace OpenRCT2::Ui::Windows // Tab 1 image auto i = (_selectedTab == TabId::Individual ? _tabAnimationIndex & ~3 : 0); auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest); - i += animObj->GetPeepAnimation(PeepAnimationGroup::Normal).base_image + 1; + i += animObj->GetPeepAnimation(PeepAnimationGroup::Normal).baseImage + 1; GfxDrawSprite( rt, ImageId(i, COLOUR_GREY, COLOUR_DARK_OLIVE_GREEN), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].midX(), widgets[WIDX_TAB_1].bottom - 6 }); diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 708f4dd5f3..c8393831d8 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -527,7 +527,7 @@ namespace OpenRCT2::Ui::Windows auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); - ImageIndex imageId = animObj->GetPeepAnimation(spriteType).base_image + 1; + ImageIndex imageId = animObj->GetPeepAnimation(spriteType).baseImage + 1; auto image = ImageId(imageId, peep->TshirtColour, peep->TrousersColour); GfxDrawSprite(clippedRT, image, clipCoords); break; diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index e02b3ba537..48c3784458 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -1236,7 +1236,7 @@ namespace OpenRCT2::Ui::Windows auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest); ImageId peepImage( - animObj->GetPeepAnimation(PeepAnimationGroup::Normal).base_image + 1, COLOUR_BRIGHT_RED, COLOUR_TEAL); + animObj->GetPeepAnimation(PeepAnimationGroup::Normal).baseImage + 1, COLOUR_BRIGHT_RED, COLOUR_TEAL); if (page == WINDOW_PARK_PAGE_GUESTS) peepImage = peepImage.WithIndexOffset(_peepAnimationFrame & 0xFFFFFFFC); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 0566cea295..65aead3f61 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1327,7 +1327,7 @@ namespace OpenRCT2::Ui::Windows spriteIndex = pickedPeepFrame & ~3; auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest); - spriteIndex += animObj->GetPeepAnimation(PeepAnimationGroup::Normal).base_image + 1; + spriteIndex += animObj->GetPeepAnimation(PeepAnimationGroup::Normal).baseImage + 1; GfxDrawSprite( rt, ImageId(spriteIndex, COLOUR_BRIGHT_RED, COLOUR_TEAL), diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 919945d1fc..6717fb4b7b 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -612,7 +612,7 @@ namespace OpenRCT2::Ui::Windows if (page == WINDOW_STAFF_OVERVIEW) animFrame = _tabAnimationOffset / 4; - auto imageIndex = anim.base_image + 1 + anim.frame_offsets[animFrame] * 4; + auto imageIndex = anim.baseImage + 1 + anim.frameOffsets[animFrame] * 4; GfxDrawSprite(clippedRT, ImageId(imageIndex, staff->TshirtColour, staff->TrousersColour), screenCoords); } @@ -633,7 +633,7 @@ namespace OpenRCT2::Ui::Windows // Get walking animation length const auto& walkingAnim = animObj->GetPeepAnimation(staff->AnimationGroup, PeepAnimationType::Walking); - const auto walkingAnimLength = walkingAnim.frame_offsets.size(); + const auto walkingAnimLength = walkingAnim.frameOffsets.size(); // Overview tab animation offset _tabAnimationOffset++; @@ -641,7 +641,7 @@ namespace OpenRCT2::Ui::Windows // Get pickup animation length const auto& pickAnim = animObj->GetPeepAnimation(staff->AnimationGroup, PeepAnimationType::Hanging); - const auto pickAnimLength = pickAnim.frame_offsets.size(); + const auto pickAnimLength = pickAnim.frameOffsets.size(); // Update pickup animation frame pickedPeepFrame++; @@ -695,7 +695,7 @@ namespace OpenRCT2::Ui::Windows auto* animObj = objManager.GetLoadedObject(staff->AnimationObjectIndex); auto& pickupAnim = animObj->GetPeepAnimation(staff->AnimationGroup, PeepAnimationType::Hanging); - auto baseImageId = pickupAnim.base_image + pickupAnim.frame_offsets[pickedPeepFrame >> 2]; + auto baseImageId = pickupAnim.baseImage + pickupAnim.frameOffsets[pickedPeepFrame >> 2]; gPickupPeepImage = ImageId(baseImageId, staff->TshirtColour, staff->TrousersColour); } diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 05556abdbe..b71f22dc86 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -173,7 +173,7 @@ namespace OpenRCT2::Ui::Windows auto& anim = animObj->GetPeepAnimation(PeepAnimationGroup::Normal); _tabAnimationIndex++; - if (_tabAnimationIndex >= anim.frame_offsets.size() * 4) + if (_tabAnimationIndex >= anim.frameOffsets.size() * 4) _tabAnimationIndex = 0; invalidateWidget(WIDX_STAFF_LIST_HANDYMEN_TAB + _selectedTab); @@ -612,7 +612,7 @@ namespace OpenRCT2::Ui::Windows auto frame = _selectedTab == tabIndex ? _tabAnimationIndex / 4 : 0; auto& anim = animObj->GetPeepAnimation(PeepAnimationGroup::Normal); - auto imageId = anim.base_image + 1 + anim.frame_offsets[frame] * 4; + auto imageId = anim.baseImage + 1 + anim.frameOffsets[frame] * 4; GfxDrawSprite( rt, ImageId(imageId, colour), @@ -635,7 +635,7 @@ namespace OpenRCT2::Ui::Windows { auto frame = _selectedTab == tabIndex ? _tabAnimationIndex / 4 : 0; auto& anim = animObj->GetPeepAnimation(PeepAnimationGroup::Normal); - auto imageId = anim.base_image + 1 + anim.frame_offsets[frame] * 4; + auto imageId = anim.baseImage + 1 + anim.frameOffsets[frame] * 4; GfxDrawSprite(clippedDpi, ImageId(imageId), { 15, 23 }); } diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index ab62b8fe4f..652364bc4d 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -480,12 +480,12 @@ bool Peep::UpdateActionAnimation() AnimationFrameNum++; // If last frame of action - if (AnimationFrameNum >= peepAnimation.frame_offsets.size()) + if (AnimationFrameNum >= peepAnimation.frameOffsets.size()) { return false; } - AnimationImageIdOffset = peepAnimation.frame_offsets[AnimationFrameNum]; + AnimationImageIdOffset = peepAnimation.frameOffsets[AnimationFrameNum]; return true; } @@ -539,11 +539,11 @@ void Peep::UpdateWalkingAnimation() WalkingAnimationFrameNum++; const PeepAnimation& peepAnimation = animObj->GetPeepAnimation(AnimationGroup, AnimationType); - if (WalkingAnimationFrameNum >= peepAnimation.frame_offsets.size()) + if (WalkingAnimationFrameNum >= peepAnimation.frameOffsets.size()) { WalkingAnimationFrameNum = 0; } - AnimationImageIdOffset = peepAnimation.frame_offsets[WalkingAnimationFrameNum]; + AnimationImageIdOffset = peepAnimation.frameOffsets[WalkingAnimationFrameNum]; } /** @@ -2762,7 +2762,7 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const auto& objManager = GetContext()->GetObjectManager(); auto* animObj = objManager.GetLoadedObject(AnimationObjectIndex); - uint32_t baseImageId = animObj->GetPeepAnimation(AnimationGroup, actionAnimationGroup).base_image; + uint32_t baseImageId = animObj->GetPeepAnimation(AnimationGroup, actionAnimationGroup).baseImage; // Offset frame onto the base image, using rotation except for the 'picked up' state if (actionAnimationGroup != PeepAnimationType::Hanging) diff --git a/src/openrct2/object/PeepAnimationsObject.cpp b/src/openrct2/object/PeepAnimationsObject.cpp index cc19a8d2ef..0387f1b62e 100644 --- a/src/openrct2/object/PeepAnimationsObject.cpp +++ b/src/openrct2/object/PeepAnimationsObject.cpp @@ -44,7 +44,7 @@ namespace OpenRCT2 auto& requiredAnimationMap = getAnimationsByPeepType(_peepType); for (auto& [typeStr, typeEnum] : requiredAnimationMap) { - group[typeEnum].base_image = _imageOffsetId + group[typeEnum].imageTableOffset; + group[typeEnum].baseImage = _imageOffsetId + group[typeEnum].imageTableOffset; group[typeEnum].bounds = inferMaxAnimationDimensions(group[typeEnum]); // Balloons, hats and umbrellas are painted separately, so the inference @@ -119,10 +119,10 @@ namespace OpenRCT2 if (referenceAnim.imageTableOffset != 0) { LOG_VERBOSE("Copying animation '%s' from primary group", std::string(typeStr).c_str()); - std::vector sequence = referenceAnim.frame_offsets; + std::vector sequence = referenceAnim.frameOffsets; group[typeEnum] = { .imageTableOffset = referenceAnim.imageTableOffset, - .frame_offsets = sequence, + .frameOffsets = sequence, }; continue; } @@ -142,7 +142,7 @@ namespace OpenRCT2 group[typeEnum] = { .imageTableOffset = Json::GetNumber(animJson["offset"]), - .frame_offsets = sequence, + .frameOffsets = sequence, }; } diff --git a/src/openrct2/peep/PeepAnimations.cpp b/src/openrct2/peep/PeepAnimations.cpp index f3eda41349..eb75bafd17 100644 --- a/src/openrct2/peep/PeepAnimations.cpp +++ b/src/openrct2/peep/PeepAnimations.cpp @@ -299,10 +299,10 @@ namespace OpenRCT2 .zoom_level = ZoomLevel{ 0 }, }; - const auto numImages = *(std::max_element(anim.frame_offsets.begin(), anim.frame_offsets.end())) + 1; + const auto numImages = *(std::max_element(anim.frameOffsets.begin(), anim.frameOffsets.end())) + 1; for (int32_t i = 0; i < numImages; ++i) { - GfxDrawSpriteSoftware(rt, ImageId(anim.base_image + i), { 0, 0 }); + GfxDrawSpriteSoftware(rt, ImageId(anim.baseImage + i), { 0, 0 }); } int32_t spriteWidth = -1; diff --git a/src/openrct2/peep/PeepAnimations.h b/src/openrct2/peep/PeepAnimations.h index a5c83e7379..67c6d83ec9 100644 --- a/src/openrct2/peep/PeepAnimations.h +++ b/src/openrct2/peep/PeepAnimations.h @@ -46,8 +46,8 @@ namespace OpenRCT2 struct PeepAnimation { ImageIndex imageTableOffset; - std::vector frame_offsets; - uint32_t base_image{}; + std::vector frameOffsets; + uint32_t baseImage{}; SpriteBounds bounds{}; }; diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.cpp b/src/openrct2/scripting/bindings/entity/ScGuest.cpp index 7fb67c27c0..83e0ee8291 100644 --- a/src/openrct2/scripting/bindings/entity/ScGuest.cpp +++ b/src/openrct2/scripting/bindings/entity/ScGuest.cpp @@ -873,9 +873,9 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, *animationType); - for (auto frameOffset : animationGroup.frame_offsets) + for (auto frameOffset : animationGroup.frameOffsets) { - auto imageId = animationGroup.base_image; + auto imageId = animationGroup.baseImage; if (animationType != PeepAnimationType::Hanging) imageId += rotation + frameOffset * 4; else @@ -930,7 +930,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset]; + peep->AnimationImageIdOffset = animationGroup.frameOffsets[offset]; peep->Invalidate(); peep->UpdateSpriteBoundingBox(); peep->Invalidate(); @@ -960,7 +960,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - auto length = animationGroup.frame_offsets.size(); + auto length = animationGroup.frameOffsets.size(); offset %= length; if (peep->IsActionWalking()) @@ -968,7 +968,7 @@ namespace OpenRCT2::Scripting else peep->AnimationFrameNum = offset; - peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset]; + peep->AnimationImageIdOffset = animationGroup.frameOffsets[offset]; peep->UpdateSpriteBoundingBox(); } @@ -984,7 +984,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - return static_cast(animationGroup.frame_offsets.size()); + return static_cast(animationGroup.frameOffsets.size()); } ScThought::ScThought(PeepThought backing) diff --git a/src/openrct2/scripting/bindings/entity/ScStaff.cpp b/src/openrct2/scripting/bindings/entity/ScStaff.cpp index 90e0b21eae..9c3d833409 100644 --- a/src/openrct2/scripting/bindings/entity/ScStaff.cpp +++ b/src/openrct2/scripting/bindings/entity/ScStaff.cpp @@ -295,9 +295,9 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, *animationType); - for (auto frameOffset : animationGroup.frame_offsets) + for (auto frameOffset : animationGroup.frameOffsets) { - auto imageId = animationGroup.base_image; + auto imageId = animationGroup.baseImage; if (animationType != PeepAnimationType::Hanging) imageId += rotation + frameOffset * 4; else @@ -346,7 +346,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset]; + peep->AnimationImageIdOffset = animationGroup.frameOffsets[offset]; peep->Invalidate(); peep->UpdateSpriteBoundingBox(); peep->Invalidate(); @@ -376,7 +376,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - auto length = animationGroup.frame_offsets.size(); + auto length = animationGroup.frameOffsets.size(); offset %= length; if (peep->IsActionWalking()) @@ -384,7 +384,7 @@ namespace OpenRCT2::Scripting else peep->AnimationFrameNum = offset; - peep->AnimationImageIdOffset = animationGroup.frame_offsets[offset]; + peep->AnimationImageIdOffset = animationGroup.frameOffsets[offset]; peep->Invalidate(); peep->UpdateSpriteBoundingBox(); peep->Invalidate(); @@ -402,7 +402,7 @@ namespace OpenRCT2::Scripting auto* animObj = objManager.GetLoadedObject(peep->AnimationObjectIndex); const auto& animationGroup = animObj->GetPeepAnimation(peep->AnimationGroup, peep->AnimationType); - return static_cast(animationGroup.frame_offsets.size()); + return static_cast(animationGroup.frameOffsets.size()); } ScHandyman::ScHandyman(EntityId Id)