diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index a5ee7ef0bd..be2be73864 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -255,7 +255,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, current_train); COMPARE_FIELD(Peep, time_to_sitdown); COMPARE_FIELD(Peep, special_sprite); - COMPARE_FIELD(Peep, action_sprite_type); + COMPARE_FIELD(Peep, ActionSpriteType); COMPARE_FIELD(Peep, NextActionSpriteType); COMPARE_FIELD(Peep, ActionSpriteImageOffset); COMPARE_FIELD(Peep, Action); diff --git a/src/openrct2/actions/StaffHireNewAction.hpp b/src/openrct2/actions/StaffHireNewAction.hpp index 96972ae055..ef795815b5 100644 --- a/src/openrct2/actions/StaffHireNewAction.hpp +++ b/src/openrct2/actions/StaffHireNewAction.hpp @@ -164,7 +164,7 @@ private: newPeep->special_sprite = 0; newPeep->ActionSpriteImageOffset = 0; newPeep->WalkingFrameNum = 0; - newPeep->action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE; + newPeep->ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_NONE; newPeep->PathCheckOptimisation = 0; newPeep->type = PEEP_TYPE_STAFF; newPeep->outside_of_park = 0; diff --git a/src/openrct2/paint/sprite/Paint.Peep.cpp b/src/openrct2/paint/sprite/Paint.Peep.cpp index ebc6cea1e7..c5d32343f6 100644 --- a/src/openrct2/paint/sprite/Paint.Peep.cpp +++ b/src/openrct2/paint/sprite/Paint.Peep.cpp @@ -69,7 +69,7 @@ void peep_paint(paint_session* session, const Peep* peep, int32_t imageDirection rct_peep_animation_entry sprite = g_peep_animation_entries[peep->sprite_type]; - PeepActionSpriteType spriteType = peep->action_sprite_type; + PeepActionSpriteType spriteType = peep->ActionSpriteType; uint8_t imageOffset = peep->ActionSpriteImageOffset; if (peep->Action == PEEP_ACTION_NONE_1) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index f57a913cdf..c47ff4b8e5 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -6776,7 +6776,7 @@ void Guest::SetSpriteType(PeepSpriteType new_sprite_type) PeepFlags |= PEEP_FLAGS_SLOW_WALK; } - action_sprite_type = PEEP_ACTION_SPRITE_TYPE_INVALID; + ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_INVALID; UpdateCurrentActionSpriteType(); if (state == PEEP_STATE_SITTING) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index da0a7ccb65..6e1026c93a 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -525,18 +525,18 @@ void Peep::UpdateCurrentActionSpriteType() return; } PeepActionSpriteType newActionSpriteType = GetActionSpriteType(); - if (action_sprite_type == newActionSpriteType) + if (ActionSpriteType == newActionSpriteType) { return; } Invalidate(); - action_sprite_type = newActionSpriteType; + ActionSpriteType = newActionSpriteType; const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[sprite_type].sprite_bounds; - sprite_width = spriteBounds[action_sprite_type].sprite_width; - sprite_height_negative = spriteBounds[action_sprite_type].sprite_height_negative; - sprite_height_positive = spriteBounds[action_sprite_type].sprite_height_positive; + sprite_width = spriteBounds[ActionSpriteType].sprite_width; + sprite_height_negative = spriteBounds[ActionSpriteType].sprite_height_negative; + sprite_height_positive = spriteBounds[ActionSpriteType].sprite_height_positive; Invalidate(); } @@ -623,8 +623,8 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) loc += word_981D7C[nextDirection / 8]; WalkingFrameNum++; const rct_peep_animation* peepAnimation = g_peep_animation_entries[sprite_type].sprite_animation; - const uint8_t* imageOffset = peepAnimation[action_sprite_type].frame_offsets; - if (WalkingFrameNum >= peepAnimation[action_sprite_type].num_frames) + const uint8_t* imageOffset = peepAnimation[ActionSpriteType].frame_offsets; + if (WalkingFrameNum >= peepAnimation[ActionSpriteType].num_frames) { WalkingFrameNum = 0; } @@ -636,14 +636,14 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) ActionFrame++; // If last frame of action - if (ActionFrame >= peepAnimation[action_sprite_type].num_frames) + if (ActionFrame >= peepAnimation[ActionSpriteType].num_frames) { ActionSpriteImageOffset = 0; Action = PEEP_ACTION_NONE_2; UpdateCurrentActionSpriteType(); return { { x, y } }; } - ActionSpriteImageOffset = peepAnimation[action_sprite_type].frame_offsets[ActionFrame]; + ActionSpriteImageOffset = peepAnimation[ActionSpriteType].frame_offsets[ActionFrame]; // If not throwing up and not at the frame where sick appears. if (Action != PEEP_ACTION_THROW_UP || ActionFrame != 15) @@ -747,7 +747,7 @@ void Peep::PickupAbort(int32_t old_x) Action = PEEP_ACTION_NONE_2; special_sprite = 0; ActionSpriteImageOffset = 0; - action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE; + ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_NONE; PathCheckOptimisation = 0; } @@ -796,13 +796,13 @@ bool Peep::Place(const TileCoordsXYZ& location, bool apply) Action = PEEP_ACTION_NONE_2; special_sprite = 0; ActionSpriteImageOffset = 0; - action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE; + ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_NONE; PathCheckOptimisation = 0; sprite_position_tween_reset(); if (type == PEEP_TYPE_GUEST) { - action_sprite_type = PEEP_ACTION_SPRITE_TYPE_INVALID; + ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_INVALID; happiness_target = std::max(happiness_target - 10, 0); UpdateCurrentActionSpriteType(); } @@ -1622,15 +1622,15 @@ Peep* Peep::Generate(const CoordsXYZ& coords) peep->special_sprite = 0; peep->ActionSpriteImageOffset = 0; peep->WalkingFrameNum = 0; - peep->action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE; + peep->ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_NONE; peep->PeepFlags = 0; peep->FavouriteRide = RIDE_ID_NULL; peep->FavouriteRideRating = 0; const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[peep->sprite_type].sprite_bounds; - peep->sprite_width = spriteBounds[peep->action_sprite_type].sprite_width; - peep->sprite_height_negative = spriteBounds[peep->action_sprite_type].sprite_height_negative; - peep->sprite_height_positive = spriteBounds[peep->action_sprite_type].sprite_height_positive; + peep->sprite_width = spriteBounds[peep->ActionSpriteType].sprite_width; + peep->sprite_height_negative = spriteBounds[peep->ActionSpriteType].sprite_height_negative; + peep->sprite_height_positive = spriteBounds[peep->ActionSpriteType].sprite_height_positive; peep->MoveTo(coords); peep->sprite_direction = 0; @@ -2237,10 +2237,10 @@ void peep_set_map_tooltip(Peep* peep) void Peep::SwitchNextActionSpriteType() { // TBD: Add nextActionSpriteType as function parameter and make peep->NextActionSpriteType obsolete? - if (NextActionSpriteType != action_sprite_type) + if (NextActionSpriteType != ActionSpriteType) { Invalidate(); - action_sprite_type = NextActionSpriteType; + ActionSpriteType = NextActionSpriteType; const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[sprite_type].sprite_bounds; sprite_width = spriteBounds[NextActionSpriteType].sprite_width; sprite_height_negative = spriteBounds[NextActionSpriteType].sprite_height_negative; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index c5fe4e1d7e..c401b11197 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -654,7 +654,7 @@ struct Peep : SpriteBase }; // Normally 0, 1 for carrying sliding board on spiral slide ride, 2 for carrying lawn mower uint8_t special_sprite; - PeepActionSpriteType action_sprite_type; + PeepActionSpriteType ActionSpriteType; // Seems to be used like a local variable, as it's always set before calling SwitchNextActionSpriteType, which // reads this again PeepActionSpriteType NextActionSpriteType; diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 7aaaade281..bea2d7e90b 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -1866,7 +1866,7 @@ void Staff::Tick128UpdateStaff() PeepFlags |= PEEP_FLAGS_SLOW_WALK; } - action_sprite_type = PEEP_ACTION_SPRITE_TYPE_INVALID; + ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_INVALID; UpdateCurrentActionSpriteType(); } diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index fb94cddf7d..07ca2fd9f5 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1396,13 +1396,13 @@ private: dst->NextActionSpriteType = static_cast(src->next_action_sprite_type); dst->ActionSpriteImageOffset = src->action_sprite_image_offset; dst->WalkingFrameNum = src->no_action_frame_num; - dst->action_sprite_type = static_cast(src->action_sprite_type); + dst->ActionSpriteType = static_cast(src->action_sprite_type); dst->ActionFrame = src->action_frame; const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[dst->sprite_type].sprite_bounds; - dst->sprite_width = spriteBounds[dst->action_sprite_type].sprite_width; - dst->sprite_height_negative = spriteBounds[dst->action_sprite_type].sprite_height_negative; - dst->sprite_height_positive = spriteBounds[dst->action_sprite_type].sprite_height_positive; + dst->sprite_width = spriteBounds[dst->ActionSpriteType].sprite_width; + dst->sprite_height_negative = spriteBounds[dst->ActionSpriteType].sprite_height_negative; + dst->sprite_height_positive = spriteBounds[dst->ActionSpriteType].sprite_height_positive; dst->MoveTo({ src->x, src->y, src->z }); invalidate_sprite_2(dst); diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index d8341dd883..313833a7d8 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1177,7 +1177,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) dst->current_train = src->current_train; dst->time_to_sitdown = src->time_to_sitdown; dst->special_sprite = src->special_sprite; - dst->action_sprite_type = static_cast(src->action_sprite_type); + dst->action_sprite_type = static_cast(src->ActionSpriteType); dst->next_action_sprite_type = static_cast(src->NextActionSpriteType); dst->action_sprite_image_offset = src->ActionSpriteImageOffset; dst->action = static_cast(src->Action); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index d7f34cbad3..76884eca8f 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1442,7 +1442,7 @@ public: dst->current_train = src->current_train; dst->time_to_sitdown = src->time_to_sitdown; dst->special_sprite = src->special_sprite; - dst->action_sprite_type = static_cast(src->action_sprite_type); + dst->ActionSpriteType = static_cast(src->action_sprite_type); dst->NextActionSpriteType = static_cast(src->next_action_sprite_type); dst->ActionSpriteImageOffset = src->action_sprite_image_offset; dst->Action = static_cast(src->action); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index f26d313713..273be2a122 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -199,7 +199,7 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(current_train); COMPARE_FIELD(time_to_sitdown); COMPARE_FIELD(special_sprite); - COMPARE_FIELD(action_sprite_type); + COMPARE_FIELD(ActionSpriteType); COMPARE_FIELD(NextActionSpriteType); COMPARE_FIELD(ActionSpriteImageOffset); COMPARE_FIELD(Action);