From d9e36e55927c269c480425ad7265ddbfe2614c4e Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Sun, 7 Jun 2020 20:23:21 -0300 Subject: [PATCH] Rename Peep::action_sprite_image_offset to TitleCase --- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/actions/StaffHireNewAction.hpp | 2 +- src/openrct2/paint/sprite/Paint.Peep.cpp | 2 +- src/openrct2/peep/Guest.cpp | 42 ++++++++++----------- src/openrct2/peep/Peep.cpp | 28 +++++++------- src/openrct2/peep/Peep.h | 2 +- src/openrct2/peep/Staff.cpp | 24 ++++++------ src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/world/MapAnimation.cpp | 2 +- test/tests/S6ImportExportTests.cpp | 2 +- 12 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 5eacdf259b..42575861bb 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -257,7 +257,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, special_sprite); COMPARE_FIELD(Peep, action_sprite_type); COMPARE_FIELD(Peep, next_action_sprite_type); - COMPARE_FIELD(Peep, action_sprite_image_offset); + COMPARE_FIELD(Peep, ActionSpriteImageOffset); COMPARE_FIELD(Peep, Action); COMPARE_FIELD(Peep, ActionFrame); COMPARE_FIELD(Peep, StepProgress); diff --git a/src/openrct2/actions/StaffHireNewAction.hpp b/src/openrct2/actions/StaffHireNewAction.hpp index 5d2c4151fa..96972ae055 100644 --- a/src/openrct2/actions/StaffHireNewAction.hpp +++ b/src/openrct2/actions/StaffHireNewAction.hpp @@ -162,7 +162,7 @@ private: newPeep->window_invalidate_flags = 0; newPeep->Action = PEEP_ACTION_NONE_2; newPeep->special_sprite = 0; - newPeep->action_sprite_image_offset = 0; + newPeep->ActionSpriteImageOffset = 0; newPeep->WalkingFrameNum = 0; newPeep->action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE; newPeep->PathCheckOptimisation = 0; diff --git a/src/openrct2/paint/sprite/Paint.Peep.cpp b/src/openrct2/paint/sprite/Paint.Peep.cpp index d30587c535..35e10e708c 100644 --- a/src/openrct2/paint/sprite/Paint.Peep.cpp +++ b/src/openrct2/paint/sprite/Paint.Peep.cpp @@ -70,7 +70,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; - uint8_t imageOffset = peep->action_sprite_image_offset; + 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 59a15872b6..3da217b9ec 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -459,7 +459,7 @@ void Guest::GivePassingPeepsPizza(Guest* passingPeep) { passingPeep->Action = PEEP_ACTION_WAVE_2; passingPeep->ActionFrame = 0; - passingPeep->action_sprite_image_offset = 0; + passingPeep->ActionSpriteImageOffset = 0; passingPeep->UpdateCurrentActionSpriteType(); } } @@ -476,7 +476,7 @@ void Guest::MakePassingPeepsSick(Guest* passingPeep) { passingPeep->Action = PEEP_ACTION_THROW_UP; passingPeep->ActionFrame = 0; - passingPeep->action_sprite_image_offset = 0; + passingPeep->ActionSpriteImageOffset = 0; passingPeep->UpdateCurrentActionSpriteType(); } } @@ -521,7 +521,7 @@ void Guest::UpdateEasterEggInteractions() { Action = PEEP_ACTION_JOY; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } } @@ -1049,7 +1049,7 @@ void Guest::Tick128UpdateGuest(int32_t index) { Action = PEEP_ACTION_THROW_UP; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } } @@ -1281,7 +1281,7 @@ void Guest::UpdateSitting() } Action = PEEP_ACTION_SITTING_EAT_FOOD; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); return; } @@ -1309,7 +1309,7 @@ void Guest::UpdateSitting() Action = PEEP_ACTION_SITTING_CHECK_WATCH; } ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); return; } @@ -2405,7 +2405,7 @@ void Guest::ReadMap() { Action = PEEP_ACTION_READ_MAP; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } } @@ -3402,7 +3402,7 @@ void Guest::UpdateBuying() { Action = PEEP_ACTION_WITHDRAW_MONEY; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); @@ -4126,11 +4126,11 @@ void Guest::UpdateRideLeaveVehicle() return; } - action_sprite_image_offset++; - if (action_sprite_image_offset & 3) + ActionSpriteImageOffset++; + if (ActionSpriteImageOffset & 3) return; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; vehicle->num_peeps--; vehicle->mass -= mass; @@ -4841,7 +4841,7 @@ void Guest::UpdateRideMazePathfinding() { Action = PEEP_ACTION_JUMP; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } } @@ -5265,7 +5265,7 @@ void Guest::UpdateWalking() { Action = PEEP_ACTION_WAVE_2; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } @@ -5280,7 +5280,7 @@ void Guest::UpdateWalking() { Action = PEEP_ACTION_TAKE_PHOTO; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } @@ -5295,7 +5295,7 @@ void Guest::UpdateWalking() { Action = PEEP_ACTION_DRAW_PICTURE; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } @@ -5593,7 +5593,7 @@ void Guest::UpdateQueuing() // Eat Food/Look at watch Action = PEEP_ACTION_EAT_FOOD; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } if (TimeInQueue >= 3500 && (0xFFFF & scenario_rand()) <= 93) @@ -5633,7 +5633,7 @@ void Guest::UpdateQueuing() // Eat food Action = PEEP_ACTION_EAT_FOOD; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); break; default: @@ -5771,7 +5771,7 @@ void Guest::UpdateWatching() { Action = PEEP_ACTION_EAT_FOOD; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); return; } @@ -5781,7 +5781,7 @@ void Guest::UpdateWatching() { Action = PEEP_ACTION_TAKE_PHOTO; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); return; } @@ -5792,7 +5792,7 @@ void Guest::UpdateWatching() { Action = PEEP_ACTION_WAVE; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); return; } @@ -6763,7 +6763,7 @@ void Guest::SetSpriteType(PeepSpriteType new_sprite_type) return; sprite_type = new_sprite_type; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; WalkingFrameNum = 0; if (Action >= PEEP_ACTION_NONE_1) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 3f8ab15717..d04155ee5d 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -552,7 +552,7 @@ void Peep::SwitchToSpecialSprite(uint8_t special_sprite_id) // If NONE_1 or NONE_2 if (Action >= PEEP_ACTION_NONE_1) { - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; } UpdateCurrentActionSpriteType(); } @@ -582,7 +582,7 @@ std::optional Peep::UpdateAction() */ std::optional Peep::UpdateAction(int16_t& xy_distance) { - _unk_F1AEF0 = action_sprite_image_offset; + _unk_F1AEF0 = ActionSpriteImageOffset; if (Action == PEEP_ACTION_NONE_1) { Action = PEEP_ACTION_NONE_2; @@ -628,7 +628,7 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) { WalkingFrameNum = 0; } - action_sprite_image_offset = imageOffset[WalkingFrameNum]; + ActionSpriteImageOffset = imageOffset[WalkingFrameNum]; return loc; } @@ -638,12 +638,12 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) // If last frame of action if (ActionFrame >= peepAnimation[action_sprite_type].num_frames) { - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; Action = PEEP_ACTION_NONE_2; UpdateCurrentActionSpriteType(); return { { x, y } }; } - action_sprite_image_offset = peepAnimation[action_sprite_type].frame_offsets[ActionFrame]; + ActionSpriteImageOffset = peepAnimation[action_sprite_type].frame_offsets[ActionFrame]; // If not throwing up and not at the frame where sick appears. if (Action != PEEP_ACTION_THROW_UP || ActionFrame != 15) @@ -746,7 +746,7 @@ void Peep::PickupAbort(int32_t old_x) SetState(PEEP_STATE_FALLING); Action = PEEP_ACTION_NONE_2; special_sprite = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE; PathCheckOptimisation = 0; } @@ -795,7 +795,7 @@ bool Peep::Place(const TileCoordsXYZ& location, bool apply) SetState(PEEP_STATE_FALLING); Action = PEEP_ACTION_NONE_2; special_sprite = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE; PathCheckOptimisation = 0; sprite_position_tween_reset(); @@ -941,7 +941,7 @@ void Peep::UpdateFalling() Action = PEEP_ACTION_DROWNING; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); peep_window_state_update(this); @@ -1450,7 +1450,7 @@ void peep_applause() { peep->Action = PEEP_ACTION_CLAP; peep->ActionFrame = 0; - peep->action_sprite_image_offset = 0; + peep->ActionSpriteImageOffset = 0; peep->UpdateCurrentActionSpriteType(); } } @@ -1570,7 +1570,7 @@ void Peep::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArgument { Action = newAction; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } @@ -1620,7 +1620,7 @@ Peep* Peep::Generate(const CoordsXYZ& coords) peep->state = PEEP_STATE_FALLING; peep->Action = PEEP_ACTION_NONE_2; peep->special_sprite = 0; - peep->action_sprite_image_offset = 0; + peep->ActionSpriteImageOffset = 0; peep->WalkingFrameNum = 0; peep->action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE; peep->PeepFlags = 0; @@ -2385,7 +2385,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl { // Guest is in the ride queue. peep->sub_state = 11; - peep->action_sprite_image_offset = _unk_F1AEF0; + peep->ActionSpriteImageOffset = _unk_F1AEF0; return; } @@ -2415,7 +2415,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl } // Guest has decided to go on the ride. - peep->action_sprite_image_offset = _unk_F1AEF0; + peep->ActionSpriteImageOffset = _unk_F1AEF0; peep->InteractionRideIndex = rideIndex; uint16_t previous_last = ride->stations[stationNum].LastPeepInQueue; @@ -2985,7 +2985,7 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen { if (peep->GuestHeadingToRideId == rideIndex) peep->GuestHeadingToRideId = 0xFF; - peep->action_sprite_image_offset = _unk_F1AEF0; + peep->ActionSpriteImageOffset = _unk_F1AEF0; peep->SetState(PEEP_STATE_BUYING); peep->current_ride = rideIndex; peep->sub_state = 0; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 9e9c5debfe..84c666347e 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -658,7 +658,7 @@ struct Peep : SpriteBase // Seems to be used like a local variable, as it's always set before calling SwitchNextActionSpriteType, which // reads this again PeepActionSpriteType next_action_sprite_type; - uint8_t action_sprite_image_offset; + uint8_t ActionSpriteImageOffset; PeepActionType Action; uint8_t ActionFrame; uint8_t StepProgress; diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index e550d96bc4..7aaaade281 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -1068,7 +1068,7 @@ bool Staff::DoEntertainerPathFinding() { Action = (scenario_rand() & 1) ? PEEP_ACTION_WAVE_2 : PEEP_ACTION_JOY; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); staff_entertainer_update_nearby_peeps(this); @@ -1256,7 +1256,7 @@ void Staff::UpdateWatering() sprite_direction = (var_37 & 3) << 3; Action = PEEP_ACTION_STAFF_WATERING; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); sub_state = 1; @@ -1320,7 +1320,7 @@ void Staff::UpdateEmptyingBin() sprite_direction = (var_37 & 3) << 3; Action = PEEP_ACTION_STAFF_EMPTY_BIN; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); sub_state = 1; @@ -1409,7 +1409,7 @@ void Staff::UpdateSweeping() { Action = PEEP_ACTION_STAFF_SWEEP; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); return; } @@ -1540,7 +1540,7 @@ void Staff::UpdateAnswering() { Action = PEEP_ACTION_STAFF_ANSWER_CALL; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); @@ -1855,7 +1855,7 @@ void Staff::Tick128UpdateStaff() return; sprite_type = newSpriteType; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; WalkingFrameNum = 0; if (Action < PEEP_ACTION_NONE_1) Action = PEEP_ACTION_NONE_2; @@ -2242,7 +2242,7 @@ bool Staff::UpdateFixingFixVehicle(bool firstRun, Ride* ride) sprite_direction = PeepDirection << 3; Action = (scenario_rand() & 1) ? PEEP_ACTION_STAFF_FIX_2 : PEEP_ACTION_STAFF_FIX; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; ActionFrame = 0; UpdateCurrentActionSpriteType(); } @@ -2283,7 +2283,7 @@ bool Staff::UpdateFixingFixVehicleMalfunction(bool firstRun, Ride* ride) { sprite_direction = PeepDirection << 3; Action = PEEP_ACTION_STAFF_FIX_3; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; ActionFrame = 0; UpdateCurrentActionSpriteType(); @@ -2391,7 +2391,7 @@ bool Staff::UpdateFixingFixStationEnd(bool firstRun) sprite_direction = PeepDirection << 3; Action = PEEP_ACTION_STAFF_CHECKBOARD; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } @@ -2508,7 +2508,7 @@ bool Staff::UpdateFixingFixStationStart(bool firstRun, Ride* ride) Action = PEEP_ACTION_STAFF_FIX; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } @@ -2536,7 +2536,7 @@ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride* ride) Action = PEEP_ACTION_STAFF_FIX_GROUND; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } @@ -2632,7 +2632,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* r sprite_direction = PeepDirection << 3; Action = PEEP_ACTION_STAFF_ANSWER_CALL_2; ActionFrame = 0; - action_sprite_image_offset = 0; + ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); } diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index d97a43f46f..f2cff84a29 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1394,7 +1394,7 @@ private: dst->Action = static_cast(src->action); dst->special_sprite = src->special_sprite; dst->next_action_sprite_type = static_cast(src->next_action_sprite_type); - dst->action_sprite_image_offset = src->action_sprite_image_offset; + 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->ActionFrame = src->action_frame; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 51c2b271a6..87c8213bd3 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1179,7 +1179,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) dst->special_sprite = src->special_sprite; dst->action_sprite_type = static_cast(src->action_sprite_type); dst->next_action_sprite_type = static_cast(src->next_action_sprite_type); - dst->action_sprite_image_offset = src->action_sprite_image_offset; + dst->action_sprite_image_offset = src->ActionSpriteImageOffset; dst->action = static_cast(src->Action); dst->action_frame = src->ActionFrame; dst->step_progress = src->StepProgress; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index f963ff88bd..f87d25a021 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1444,7 +1444,7 @@ public: dst->special_sprite = src->special_sprite; dst->action_sprite_type = static_cast(src->action_sprite_type); dst->next_action_sprite_type = static_cast(src->next_action_sprite_type); - dst->action_sprite_image_offset = src->action_sprite_image_offset; + dst->ActionSpriteImageOffset = src->action_sprite_image_offset; dst->Action = static_cast(src->action); dst->ActionFrame = src->action_frame; dst->StepProgress = src->step_progress; diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index fff11ed20d..88e7a3cdef 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -215,7 +215,7 @@ static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc) peep->Action = PEEP_ACTION_CHECK_TIME; peep->ActionFrame = 0; - peep->action_sprite_image_offset = 0; + peep->ActionSpriteImageOffset = 0; peep->UpdateCurrentActionSpriteType(); invalidate_sprite_1(peep); break; diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index cdd510530a..e6ef759a33 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -201,7 +201,7 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(special_sprite); COMPARE_FIELD(action_sprite_type); COMPARE_FIELD(next_action_sprite_type); - COMPARE_FIELD(action_sprite_image_offset); + COMPARE_FIELD(ActionSpriteImageOffset); COMPARE_FIELD(Action); COMPARE_FIELD(ActionFrame); COMPARE_FIELD(StepProgress);