From 0d847797635d652e31f6be8e4cd49376f279454c Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Sun, 7 Jun 2020 21:19:44 -0300 Subject: [PATCH] Rename Peep::next_action_sprite_type to TitleCase --- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/paint/sprite/Paint.Peep.cpp | 2 +- src/openrct2/peep/Guest.cpp | 10 +++++----- src/openrct2/peep/Peep.cpp | 14 +++++++------- src/openrct2/peep/Peep.h | 2 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- test/tests/S6ImportExportTests.cpp | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 42575861bb..a5ee7ef0bd 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -256,7 +256,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, time_to_sitdown); COMPARE_FIELD(Peep, special_sprite); COMPARE_FIELD(Peep, action_sprite_type); - COMPARE_FIELD(Peep, next_action_sprite_type); + COMPARE_FIELD(Peep, NextActionSpriteType); COMPARE_FIELD(Peep, ActionSpriteImageOffset); COMPARE_FIELD(Peep, Action); COMPARE_FIELD(Peep, ActionFrame); diff --git a/src/openrct2/paint/sprite/Paint.Peep.cpp b/src/openrct2/paint/sprite/Paint.Peep.cpp index 35e10e708c..ebc6cea1e7 100644 --- a/src/openrct2/paint/sprite/Paint.Peep.cpp +++ b/src/openrct2/paint/sprite/Paint.Peep.cpp @@ -74,7 +74,7 @@ void peep_paint(paint_session* session, const Peep* peep, int32_t imageDirection if (peep->Action == PEEP_ACTION_NONE_1) { - spriteType = peep->next_action_sprite_type; + spriteType = peep->NextActionSpriteType; imageOffset = 0; } diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 3da217b9ec..f57a913cdf 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -1233,7 +1233,7 @@ void Guest::UpdateSitting() sprite_direction = ((var_37 + 2) & 3) * 8; Action = PEEP_ACTION_NONE_1; - next_action_sprite_type = PEEP_ACTION_SPRITE_TYPE_SITTING_IDLE; + NextActionSpriteType = PEEP_ACTION_SPRITE_TYPE_SITTING_IDLE; SwitchNextActionSpriteType(); sub_state = PEEP_SITTING_SAT_DOWN; @@ -5604,7 +5604,7 @@ void Guest::UpdateQueuing() } else { - if (!(TimeInQueue & 0x3F) && Action == PEEP_ACTION_NONE_1 && next_action_sprite_type == 2) + if (!(TimeInQueue & 0x3F) && Action == PEEP_ACTION_NONE_1 && NextActionSpriteType == 2) { switch (sprite_type) { @@ -5743,7 +5743,7 @@ void Guest::UpdateWatching() sprite_direction = (var_37 & 3) * 8; Action = PEEP_ACTION_NONE_1; - next_action_sprite_type = PEEP_ACTION_SPRITE_TYPE_WATCH_RIDE; + NextActionSpriteType = PEEP_ACTION_SPRITE_TYPE_WATCH_RIDE; SwitchNextActionSpriteType(); @@ -6782,13 +6782,13 @@ void Guest::SetSpriteType(PeepSpriteType new_sprite_type) if (state == PEEP_STATE_SITTING) { Action = PEEP_ACTION_NONE_1; - next_action_sprite_type = PEEP_ACTION_SPRITE_TYPE_SITTING_IDLE; + NextActionSpriteType = PEEP_ACTION_SPRITE_TYPE_SITTING_IDLE; SwitchNextActionSpriteType(); } if (state == PEEP_STATE_WATCHING) { Action = PEEP_ACTION_NONE_1; - next_action_sprite_type = PEEP_ACTION_SPRITE_TYPE_WATCH_RIDE; + NextActionSpriteType = PEEP_ACTION_SPRITE_TYPE_WATCH_RIDE; SwitchNextActionSpriteType(); } } diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index d04155ee5d..da0a7ccb65 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -2236,15 +2236,15 @@ void peep_set_map_tooltip(Peep* peep) */ void Peep::SwitchNextActionSpriteType() { - // TBD: Add nextActionSpriteType as function parameter and make peep->next_action_sprite_type obsolete? - if (next_action_sprite_type != action_sprite_type) + // TBD: Add nextActionSpriteType as function parameter and make peep->NextActionSpriteType obsolete? + if (NextActionSpriteType != action_sprite_type) { Invalidate(); - action_sprite_type = next_action_sprite_type; + action_sprite_type = NextActionSpriteType; const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[sprite_type].sprite_bounds; - sprite_width = spriteBounds[next_action_sprite_type].sprite_width; - sprite_height_negative = spriteBounds[next_action_sprite_type].sprite_height_negative; - sprite_height_positive = spriteBounds[next_action_sprite_type].sprite_height_positive; + sprite_width = spriteBounds[NextActionSpriteType].sprite_width; + sprite_height_negative = spriteBounds[NextActionSpriteType].sprite_height_negative; + sprite_height_positive = spriteBounds[NextActionSpriteType].sprite_height_positive; Invalidate(); } } @@ -2315,7 +2315,7 @@ static bool peep_update_queue_position(Peep* peep, uint8_t previous_action) return true; peep->Action = PEEP_ACTION_NONE_1; - peep->next_action_sprite_type = PEEP_ACTION_SPRITE_TYPE_WATCH_RIDE; + peep->NextActionSpriteType = PEEP_ACTION_SPRITE_TYPE_WATCH_RIDE; if (previous_action != PEEP_ACTION_NONE_1) peep->Invalidate(); return true; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 84c666347e..c5fe4e1d7e 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -657,7 +657,7 @@ struct Peep : SpriteBase PeepActionSpriteType action_sprite_type; // 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; + PeepActionSpriteType NextActionSpriteType; uint8_t ActionSpriteImageOffset; PeepActionType Action; uint8_t ActionFrame; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index f2cff84a29..fb94cddf7d 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1393,7 +1393,7 @@ private: dst->sprite_type = RCT1::GetPeepSpriteType(src->sprite_type); 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->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); diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 87c8213bd3..d8341dd883 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1178,7 +1178,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) 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->next_action_sprite_type = static_cast(src->next_action_sprite_type); + dst->next_action_sprite_type = static_cast(src->NextActionSpriteType); dst->action_sprite_image_offset = src->ActionSpriteImageOffset; dst->action = static_cast(src->Action); dst->action_frame = src->ActionFrame; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index f87d25a021..d7f34cbad3 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1443,7 +1443,7 @@ public: 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->next_action_sprite_type = static_cast(src->next_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); dst->ActionFrame = src->action_frame; diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index e6ef759a33..f26d313713 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -200,7 +200,7 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(time_to_sitdown); COMPARE_FIELD(special_sprite); COMPARE_FIELD(action_sprite_type); - COMPARE_FIELD(next_action_sprite_type); + COMPARE_FIELD(NextActionSpriteType); COMPARE_FIELD(ActionSpriteImageOffset); COMPARE_FIELD(Action); COMPARE_FIELD(ActionFrame);