diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 1b74736a67..32b27b684b 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1105,12 +1105,12 @@ void window_guest_overview_paint(rct_window* w, rct_drawpixelinfo* dpi) int32_t i = 0; for (; i < PEEP_MAX_THOUGHTS; ++i) { - if (peep->thoughts[i].type == PEEP_THOUGHT_TYPE_NONE) + if (peep->Thoughts[i].type == PEEP_THOUGHT_TYPE_NONE) { w->list_information_type = 0; return; } - if (peep->thoughts[i].freshness == 1) + if (peep->Thoughts[i].freshness == 1) { // If a fresh thought break; } @@ -1122,7 +1122,7 @@ void window_guest_overview_paint(rct_window* w, rct_drawpixelinfo* dpi) } x = widget->right - widget->left - w->list_information_type; - peep_thought_set_format_args(&peep->thoughts[i]); + peep_thought_set_format_args(&peep->Thoughts[i]); gfx_draw_string_left(&dpi_marquee, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, COLOUR_BLACK, x, 0); } @@ -1513,10 +1513,10 @@ void window_guest_stats_paint(rct_window* w, rct_drawpixelinfo* dpi) // Time in park y += LIST_ROW_HEIGHT + 1; - if (peep->time_in_park != -1) + if (peep->TimeInPark != -1) { int32_t eax = gScenarioTicks; - eax -= peep->time_in_park; + eax -= peep->TimeInPark; eax >>= 11; auto ft = Formatter::Common(); ft.Add(eax & 0xFFFF); @@ -1579,7 +1579,7 @@ void window_guest_rides_update(rct_window* w) if (guest != nullptr) { // Every 2048 ticks do a full window_invalidate - int32_t number_of_ticks = gScenarioTicks - peep->time_in_park; + int32_t number_of_ticks = gScenarioTicks - peep->TimeInPark; if (!(number_of_ticks & 0x7FF)) w->Invalidate(); @@ -1786,13 +1786,13 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi) // Cash in pocket auto ft = Formatter::Common(); - ft.Add(peep->cash_in_pocket); + ft.Add(peep->CashInPocket); gfx_draw_string_left(dpi, STR_GUEST_STAT_CASH_IN_POCKET, gCommonFormatArgs, COLOUR_BLACK, x, y); // Cash spent y += LIST_ROW_HEIGHT; ft = Formatter::Common(); - ft.Add(peep->cash_spent); + ft.Add(peep->CashSpent); gfx_draw_string_left(dpi, STR_GUEST_STAT_CASH_SPENT, gCommonFormatArgs, COLOUR_BLACK, x, y); y += LIST_ROW_HEIGHT * 2; @@ -1904,7 +1904,7 @@ void window_guest_thoughts_paint(rct_window* w, rct_drawpixelinfo* dpi) gfx_draw_string_left(dpi, STR_GUEST_RECENT_THOUGHTS_LABEL, nullptr, COLOUR_BLACK, x, y); y += 10; - for (rct_peep_thought* thought = peep->thoughts; thought < &peep->thoughts[PEEP_MAX_THOUGHTS]; ++thought) + for (rct_peep_thought* thought = peep->Thoughts; thought < &peep->Thoughts[PEEP_MAX_THOUGHTS]; ++thought) { if (thought->type == PEEP_THOUGHT_TYPE_NONE) return; diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 72d0fa6421..bb3b4a9370 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -792,7 +792,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, // For each thought for (uint32_t j = 0; j < PEEP_MAX_THOUGHTS; j++) { - thought = &peep->thoughts[j]; + thought = &peep->Thoughts[j]; if (thought->type == PEEP_THOUGHT_TYPE_NONE) break; if (thought->freshness == 0) @@ -800,7 +800,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, if (thought->freshness > 5) break; - peep_thought_set_format_args(&peep->thoughts[j]); + peep_thought_set_format_args(&peep->Thoughts[j]); gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 118, y }, 329); break; } @@ -911,7 +911,7 @@ static FilterArguments get_arguments_from_peep(const Peep* peep) break; case VIEW_THOUGHTS: { - auto thought = &peep->thoughts[0]; + auto thought = &peep->Thoughts[0]; if (thought->freshness <= 5 && thought->type != PEEP_THOUGHT_TYPE_NONE) { std::memset(gCommonFormatArgs, 0, sizeof(gCommonFormatArgs)); diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index f38f0d5da2..ebd7dc9766 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -1104,7 +1104,7 @@ void window_staff_stats_paint(rct_window* w, rct_drawpixelinfo* dpi) y += LIST_ROW_HEIGHT; } - gfx_draw_string_left(dpi, STR_STAFF_STAT_EMPLOYED_FOR, static_cast(&peep->time_in_park), COLOUR_BLACK, x, y); + gfx_draw_string_left(dpi, STR_STAFF_STAT_EMPLOYED_FOR, static_cast(&peep->TimeInPark), COLOUR_BLACK, x, y); y += LIST_ROW_HEIGHT; switch (peep->staff_type) diff --git a/src/openrct2-ui/windows/TitleCommandEditor.cpp b/src/openrct2-ui/windows/TitleCommandEditor.cpp index f2b9e91b75..72c6c75342 100644 --- a/src/openrct2-ui/windows/TitleCommandEditor.cpp +++ b/src/openrct2-ui/windows/TitleCommandEditor.cpp @@ -628,7 +628,7 @@ static void window_title_command_editor_tool_down( { uint8_t formatArgs[32]{}; peep->FormatNameTo(formatArgs); - format_string(command.SpriteName, USER_STRING_MAX_LENGTH, STR_STRINGID, &peep->id); + format_string(command.SpriteName, USER_STRING_MAX_LENGTH, STR_STRINGID, &peep->Id); } } else if (spriteIdentifier == SPRITE_IDENTIFIER_VEHICLE) diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index da24842e4f..0e8d47d2e8 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -465,7 +465,7 @@ void game_fix_save_vars() continue; } auto ft = Formatter::Common(); - ft.Add(peep->id); + ft.Add(peep->Id); auto curName = peep->GetName(); log_warning( "Peep %u (%s) has invalid ride station = %u for ride %u.", spriteIndex, curName.c_str(), srcStation, rideIdx); diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index f3fbb46b2a..a8af3ac086 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -261,24 +261,24 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, action); COMPARE_FIELD(Peep, action_frame); COMPARE_FIELD(Peep, step_progress); - COMPARE_FIELD(Peep, next_in_queue); - COMPARE_FIELD(Peep, maze_last_edge); - COMPARE_FIELD(Peep, interaction_ride_index); - COMPARE_FIELD(Peep, time_in_queue); + COMPARE_FIELD(Peep, GuestNextInQueue); + COMPARE_FIELD(Peep, MazeLastEdge); + COMPARE_FIELD(Peep, InteractionRideIndex); + COMPARE_FIELD(Peep, TimeInQueue); for (int i = 0; i < 32; i++) { - COMPARE_FIELD(Peep, rides_been_on[i]); + COMPARE_FIELD(Peep, RidesBeenOn[i]); } - COMPARE_FIELD(Peep, id); - COMPARE_FIELD(Peep, cash_in_pocket); - COMPARE_FIELD(Peep, cash_spent); - COMPARE_FIELD(Peep, time_in_park); - COMPARE_FIELD(Peep, rejoin_queue_timeout); - COMPARE_FIELD(Peep, previous_ride); - COMPARE_FIELD(Peep, previous_ride_time_out); + COMPARE_FIELD(Peep, Id); + COMPARE_FIELD(Peep, CashInPocket); + COMPARE_FIELD(Peep, CashSpent); + COMPARE_FIELD(Peep, TimeInPark); + COMPARE_FIELD(Peep, RejoinQueueTimeout); + COMPARE_FIELD(Peep, PreviousRide); + COMPARE_FIELD(Peep, PreviousRideTimeOut); for (int i = 0; i < PEEP_MAX_THOUGHTS; i++) { - COMPARE_FIELD(Peep, thoughts[i]); + COMPARE_FIELD(Peep, Thoughts[i]); } COMPARE_FIELD(Peep, PathCheckOptimisation); COMPARE_FIELD(Peep, GuestHeadingToRideId); diff --git a/src/openrct2/actions/RideDemolishAction.hpp b/src/openrct2/actions/RideDemolishAction.hpp index 789c6d23bf..935187f11c 100644 --- a/src/openrct2/actions/RideDemolishAction.hpp +++ b/src/openrct2/actions/RideDemolishAction.hpp @@ -160,8 +160,8 @@ private: uint8_t ride_id_bit = _rideIndex % 8; uint8_t ride_id_offset = _rideIndex / 8; - // clear ride from potentially being in rides_been_on - peep->rides_been_on[ride_id_offset] &= ~(1 << ride_id_bit); + // clear ride from potentially being in RidesBeenOn + peep->RidesBeenOn[ride_id_offset] &= ~(1 << ride_id_bit); if (peep->state == PEEP_STATE_WATCHING) { if (peep->current_ride == _rideIndex) @@ -227,15 +227,15 @@ private: { // Don't touch items after the first NONE thought as they are not valid // fixes issues with clearing out bad thought data in multiplayer - if (peep->thoughts[i].type == PEEP_THOUGHT_TYPE_NONE) + if (peep->Thoughts[i].type == PEEP_THOUGHT_TYPE_NONE) break; - if (peep->thoughts[i].type != PEEP_THOUGHT_TYPE_NONE && peep->thoughts[i].item == _rideIndex) + if (peep->Thoughts[i].type != PEEP_THOUGHT_TYPE_NONE && peep->Thoughts[i].item == _rideIndex) { // Clear top thought, push others up - memmove(&peep->thoughts[i], &peep->thoughts[i + 1], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); - peep->thoughts[PEEP_MAX_THOUGHTS - 1].type = PEEP_THOUGHT_TYPE_NONE; - peep->thoughts[PEEP_MAX_THOUGHTS - 1].item = PEEP_THOUGHT_ITEM_NONE; + memmove(&peep->Thoughts[i], &peep->Thoughts[i + 1], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); + peep->Thoughts[PEEP_MAX_THOUGHTS - 1].type = PEEP_THOUGHT_TYPE_NONE; + peep->Thoughts[PEEP_MAX_THOUGHTS - 1].item = PEEP_THOUGHT_ITEM_NONE; // Next iteration, check the new thought at this index i--; } diff --git a/src/openrct2/actions/SetCheatAction.hpp b/src/openrct2/actions/SetCheatAction.hpp index 064dca1be5..3e3726051d 100644 --- a/src/openrct2/actions/SetCheatAction.hpp +++ b/src/openrct2/actions/SetCheatAction.hpp @@ -632,7 +632,7 @@ private: switch (object) { case OBJECT_MONEY: - peep->cash_in_pocket = MONEY(1000, 00); + peep->CashInPocket = MONEY(1000, 00); break; case OBJECT_PARK_MAP: peep->ItemStandardFlags |= PEEP_ITEM_MAP; diff --git a/src/openrct2/actions/StaffHireNewAction.hpp b/src/openrct2/actions/StaffHireNewAction.hpp index b9b3aa9c45..6e6dffcb3b 100644 --- a/src/openrct2/actions/StaffHireNewAction.hpp +++ b/src/openrct2/actions/StaffHireNewAction.hpp @@ -179,7 +179,7 @@ private: uint16_t idSearchSpriteIndex; Peep* idSearchPeep; - // We search for the first available id for a given staff type + // We search for the first available Id for a given staff type uint32_t newStaffId = 0; for (;;) { @@ -191,7 +191,7 @@ private: if (idSearchPeep->staff_type != _staffType) continue; - if (idSearchPeep->id == newStaffId) + if (idSearchPeep->Id == newStaffId) { found = true; break; @@ -202,7 +202,7 @@ private: break; } - newPeep->id = newStaffId; + newPeep->Id = newStaffId; newPeep->staff_type = _staffType; PeepSpriteType spriteType = spriteTypes[_staffType]; @@ -231,7 +231,7 @@ private: } // Staff uses this - newPeep->time_in_park = gDateMonthsElapsed; + newPeep->TimeInPark = gDateMonthsElapsed; newPeep->PathfindGoal.x = 0xFF; newPeep->PathfindGoal.y = 0xFF; newPeep->PathfindGoal.z = 0xFF; diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index 9393f41ada..710855645d 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -92,12 +92,12 @@ static bool award_is_deserved_most_untidy(int32_t activeAwardTypes) if (peep->outside_of_park != 0) continue; - if (peep->thoughts[0].freshness > 5) + if (peep->Thoughts[0].freshness > 5) continue; - if (peep->thoughts[0].type == PEEP_THOUGHT_TYPE_BAD_LITTER - || peep->thoughts[0].type == PEEP_THOUGHT_TYPE_PATH_DISGUSTING - || peep->thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) + if (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_BAD_LITTER + || peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_PATH_DISGUSTING + || peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) { negativeCount++; } @@ -124,15 +124,15 @@ static bool award_is_deserved_most_tidy(int32_t activeAwardTypes) if (peep->outside_of_park != 0) continue; - if (peep->thoughts[0].freshness > 5) + if (peep->Thoughts[0].freshness > 5) continue; - if (peep->thoughts[0].type == PEEP_THOUGHT_TYPE_VERY_CLEAN) + if (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VERY_CLEAN) positiveCount++; - if (peep->thoughts[0].type == PEEP_THOUGHT_TYPE_BAD_LITTER - || peep->thoughts[0].type == PEEP_THOUGHT_TYPE_PATH_DISGUSTING - || peep->thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) + if (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_BAD_LITTER + || peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_PATH_DISGUSTING + || peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) { negativeCount++; } @@ -207,15 +207,15 @@ static bool award_is_deserved_most_beautiful(int32_t activeAwardTypes) if (peep->outside_of_park != 0) continue; - if (peep->thoughts[0].freshness > 5) + if (peep->Thoughts[0].freshness > 5) continue; - if (peep->thoughts[0].type == PEEP_THOUGHT_TYPE_SCENERY) + if (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_SCENERY) positiveCount++; - if (peep->thoughts[0].type == PEEP_THOUGHT_TYPE_BAD_LITTER - || peep->thoughts[0].type == PEEP_THOUGHT_TYPE_PATH_DISGUSTING - || peep->thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) + if (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_BAD_LITTER + || peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_PATH_DISGUSTING + || peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) { negativeCount++; } @@ -251,7 +251,7 @@ static bool award_is_deserved_safest([[maybe_unused]] int32_t activeAwardTypes) { if (peep->outside_of_park != 0) continue; - if (peep->thoughts[0].freshness <= 5 && peep->thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) + if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) peepsWhoDislikeVandalism++; } @@ -340,7 +340,7 @@ static bool award_is_deserved_best_food(int32_t activeAwardTypes) if (peep->outside_of_park != 0) continue; - if (peep->thoughts[0].freshness <= 5 && peep->thoughts[0].type == PEEP_THOUGHT_TYPE_HUNGRY) + if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_HUNGRY) hungryPeeps++; } return (hungryPeeps <= 12); @@ -386,7 +386,7 @@ static bool award_is_deserved_worst_food(int32_t activeAwardTypes) if (peep->outside_of_park != 0) continue; - if (peep->thoughts[0].freshness <= 5 && peep->thoughts[0].type == PEEP_THOUGHT_TYPE_HUNGRY) + if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_HUNGRY) hungryPeeps++; } return (hungryPeeps > 15); @@ -418,7 +418,7 @@ static bool award_is_deserved_best_restrooms([[maybe_unused]] int32_t activeAwar if (peep->outside_of_park != 0) continue; - if (peep->thoughts[0].freshness <= 5 && peep->thoughts[0].type == PEEP_THOUGHT_TYPE_TOILET) + if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_TOILET) guestsWhoNeedRestroom++; } return (guestsWhoNeedRestroom <= 16); @@ -550,8 +550,8 @@ static bool award_is_deserved_most_confusing_layout([[maybe_unused]] int32_t act continue; peepsCounted++; - if (peep->thoughts[0].freshness <= 5 - && (peep->thoughts[0].type == PEEP_THOUGHT_TYPE_LOST || peep->thoughts[0].type == PEEP_THOUGHT_TYPE_CANT_FIND)) + if (peep->Thoughts[0].freshness <= 5 + && (peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_LOST || peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_CANT_FIND)) peepsLost++; } diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 086a1f56fa..e17e57005c 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -805,7 +805,7 @@ void Guest::Tick128UpdateGuest(int32_t index) if (state == PEEP_STATE_WALKING && outside_of_park == 0 && !(PeepFlags & PEEP_FLAGS_LEAVING_PARK) && no_of_rides == 0 && GuestHeadingToRideId == RIDE_ID_NULL) { - uint32_t time_duration = gScenarioTicks - time_in_park; + uint32_t time_duration = gScenarioTicks - TimeInPark; time_duration /= 2048; if (time_duration >= 5) @@ -866,8 +866,7 @@ void Guest::Tick128UpdateGuest(int32_t index) possible_thoughts[num_thoughts++] = PEEP_THOUGHT_TYPE_TOILET; } - if (!(gParkFlags & PARK_FLAGS_NO_MONEY) && cash_in_pocket <= MONEY(9, 00) && happiness >= 105 - && energy >= 70) + if (!(gParkFlags & PARK_FLAGS_NO_MONEY) && CashInPocket <= MONEY(9, 00) && happiness >= 105 && energy >= 70) { /* The energy check was originally a second check on happiness. * This was superfluous so should probably check something else. @@ -953,7 +952,7 @@ void Guest::Tick128UpdateGuest(int32_t index) break; case PEEP_STATE_QUEUING: - if (time_in_queue >= 2000) + if (TimeInQueue >= 2000) { /* Peep happiness is affected once the peep has been waiting * too long in a queue. */ @@ -1551,12 +1550,12 @@ loc_69B119: { if (price != 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { - if (cash_in_pocket == 0) + if (CashInPocket == 0) { InsertNewThought(PEEP_THOUGHT_TYPE_SPENT_MONEY, PEEP_THOUGHT_ITEM_NONE); return false; } - if (price > cash_in_pocket) + if (price > CashInPocket) { InsertNewThought(PEEP_THOUGHT_TYPE_CANT_AFFORD, shopItem); return false; @@ -2030,7 +2029,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t } // This checks if there's a peep standing still at the very end of the queue. - if (maxD <= 13 && lastPeepInQueue->time_in_queue > 10) + if (maxD <= 13 && lastPeepInQueue->TimeInQueue > 10) { peep_tried_to_enter_full_queue(this, ride); return false; @@ -2046,7 +2045,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED || ridePrice != 0) { - if (previous_ride == ride->id) + if (PreviousRide == ride->id) { ChoseNotToGoOnRide(ride, peepAtRide, false); return false; @@ -2055,11 +2054,11 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t // Basic price checks if (ridePrice != 0 && !peep_has_voucher_for_free_ride(this, ride) && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { - if (ridePrice > cash_in_pocket) + if (ridePrice > CashInPocket) { if (peepAtRide) { - if (cash_in_pocket <= 0) + if (CashInPocket <= 0) { InsertNewThought(PEEP_THOUGHT_TYPE_SPENT_MONEY, PEEP_THOUGHT_ITEM_NONE); } @@ -2256,7 +2255,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t bool Guest::ShouldGoToShop(Ride* ride, bool peepAtShop) { // Peeps won't go to the same shop twice in a row. - if (ride->id == previous_ride) + if (ride->id == PreviousRide) { ChoseNotToGoOnRide(ride, peepAtShop, true); return false; @@ -2299,11 +2298,11 @@ bool Guest::ShouldGoToShop(Ride* ride, bool peepAtShop) // Basic price checks auto ridePrice = ride_get_price(ride); - if (ridePrice != 0 && ridePrice > cash_in_pocket) + if (ridePrice != 0 && ridePrice > CashInPocket) { if (peepAtShop) { - if (cash_in_pocket <= 0) + if (CashInPocket <= 0) { InsertNewThought(PEEP_THOUGHT_TYPE_SPENT_MONEY, PEEP_THOUGHT_ITEM_NONE); } @@ -2343,8 +2342,8 @@ void Guest::SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureTyp { assert(!(gParkFlags & PARK_FLAGS_NO_MONEY)); - cash_in_pocket = std::max(0, cash_in_pocket - amount); - cash_spent += amount; + CashInPocket = std::max(0, CashInPocket - amount); + CashSpent += amount; peep_expend_type += static_cast(amount); @@ -2367,13 +2366,13 @@ void Guest::SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureTyp void Guest::SetHasRidden(const Ride* ride) { - rides_been_on[ride->id / 8] |= 1 << (ride->id % 8); + RidesBeenOn[ride->id / 8] |= 1 << (ride->id % 8); SetHasRiddenRideType(ride->type); } bool Guest::HasRidden(const Ride* ride) const { - return rides_been_on[ride->id / 8] & (1 << (ride->id % 8)); + return RidesBeenOn[ride->id / 8] & (1 << (ride->id % 8)); } void Guest::SetHasRiddenRideType(int32_t rideType) @@ -2390,8 +2389,8 @@ void Guest::ChoseNotToGoOnRide(Ride* ride, bool peepAtRide, bool updateLastRide) { if (peepAtRide && updateLastRide) { - previous_ride = ride->id; - previous_ride_time_out = 0; + PreviousRide = ride->id; + PreviousRideTimeOut = 0; } if (ride->id == GuestHeadingToRideId) @@ -2425,8 +2424,8 @@ static bool peep_has_voucher_for_free_ride(Peep* peep, Ride* ride) static void peep_tried_to_enter_full_queue(Peep* peep, Ride* ride) { ride->lifecycle_flags |= RIDE_LIFECYCLE_QUEUE_FULL; - peep->previous_ride = ride->id; - peep->previous_ride_time_out = 0; + peep->PreviousRide = ride->id; + peep->PreviousRideTimeOut = 0; // Change status "Heading to" to "Walking" if queue is full if (ride->id == peep->GuestHeadingToRideId) { @@ -2547,7 +2546,7 @@ void Guest::GoToRideEntrance(Ride* ride) SetState(PEEP_STATE_ENTERING_RIDE); sub_state = PEEP_RIDE_IN_ENTRANCE; - rejoin_queue_timeout = 0; + RejoinQueueTimeout = 0; GuestTimeOnRide = 0; RemoveFromQueue(); @@ -2638,14 +2637,14 @@ static bool peep_check_ride_price_at_entrance(Guest* peep, Ride* ride, money32 r && peep->VoucherArguments == peep->current_ride) return true; - if (peep->cash_in_pocket <= 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) + if (peep->CashInPocket <= 0 && !(gParkFlags & PARK_FLAGS_NO_MONEY)) { peep->InsertNewThought(PEEP_THOUGHT_TYPE_SPENT_MONEY, PEEP_THOUGHT_ITEM_NONE); peep_update_ride_at_entrance_try_leave(peep); return false; } - if (ridePrice > peep->cash_in_pocket) + if (ridePrice > peep->CashInPocket) { peep->InsertNewThought(PEEP_THOUGHT_TYPE_CANT_AFFORD_0, peep->current_ride); peep_update_ride_at_entrance_try_leave(peep); @@ -2681,11 +2680,11 @@ static int16_t peep_calculate_ride_satisfaction(Guest* peep, Ride* ride) // Calculate satisfaction based on how long the peep has been in the queue for. // (For comparison: peeps start thinking "I've been queueing for a long time" at 3500 and // start leaving the queue at 4300.) - if (peep->time_in_queue >= 4500) + if (peep->TimeInQueue >= 4500) satisfaction -= 35; - else if (peep->time_in_queue >= 2250) + else if (peep->TimeInQueue >= 2250) satisfaction -= 10; - else if (peep->time_in_queue <= 750) + else if (peep->TimeInQueue <= 750) satisfaction += 10; // Peeps get a small boost in satisfaction if they've been on a ride of the same type before, @@ -3094,7 +3093,7 @@ static void peep_decide_whether_to_leave_park(Peep* peep) } else { - if (peep->energy >= 55 && peep->happiness >= 45 && peep->cash_in_pocket >= MONEY(5, 00)) + if (peep->energy >= 55 && peep->happiness >= 45 && peep->CashInPocket >= MONEY(5, 00)) { return; } @@ -3297,7 +3296,7 @@ void Guest::StopPurchaseThought(uint8_t ride_type) // Remove the related thought for (int32_t i = 0; i < PEEP_MAX_THOUGHTS; ++i) { - rct_peep_thought* thought = &thoughts[i]; + rct_peep_thought* thought = &Thoughts[i]; if (thought->type == PEEP_THOUGHT_TYPE_NONE) break; @@ -3310,7 +3309,7 @@ void Guest::StopPurchaseThought(uint8_t ride_type) memmove(thought, thought + 1, sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); } - thoughts[PEEP_MAX_THOUGHTS - 1].type = PEEP_THOUGHT_TYPE_NONE; + Thoughts[PEEP_MAX_THOUGHTS - 1].type = PEEP_THOUGHT_TYPE_NONE; window_invalidate_flags |= PEEP_INVALIDATE_PEEP_THOUGHTS; i--; @@ -3327,7 +3326,7 @@ static bool peep_should_use_cash_machine(Peep* peep, ride_id_t rideIndex) return false; if (peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK) return false; - if (peep->cash_in_pocket > MONEY(20, 00)) + if (peep->CashInPocket > MONEY(20, 00)) return false; if (115 + (scenario_rand() % 128) > peep->happiness) return false; @@ -3372,16 +3371,16 @@ void Guest::UpdateBuying() if (ride->type == RIDE_TYPE_CASH_MACHINE) { - if (current_ride != previous_ride) + if (current_ride != PreviousRide) { - cash_in_pocket += MONEY(50, 00); + CashInPocket += MONEY(50, 00); } window_invalidate_by_number(WC_PEEP, sprite_index); } sprite_direction ^= 0x10; destination_x = NextLoc.x + 16; destination_y = NextLoc.y + 16; - direction = direction_reverse(direction); + PeepDirection = direction_reverse(PeepDirection); SetState(PEEP_STATE_WALKING); return; @@ -3389,15 +3388,15 @@ void Guest::UpdateBuying() bool item_bought = false; - if (current_ride != previous_ride) + if (current_ride != PreviousRide) { if (ride->type == RIDE_TYPE_CASH_MACHINE) { item_bought = peep_should_use_cash_machine(this, current_ride); if (!item_bought) { - previous_ride = current_ride; - previous_ride_time_out = 0; + PreviousRide = current_ride; + PreviousRideTimeOut = 0; } else { @@ -3538,7 +3537,7 @@ static constexpr const CoordsXY _MazeEntranceStart[] = { static void peep_update_ride_leave_entrance_maze(Guest* peep, Ride* ride, CoordsXYZD& entrance_loc) { - peep->maze_last_edge = entrance_loc.direction + 1; + peep->MazeLastEdge = entrance_loc.direction + 1; entrance_loc.x += CoordsDirectionDelta[entrance_loc.direction].x; entrance_loc.y += CoordsDirectionDelta[entrance_loc.direction].y; @@ -3547,13 +3546,13 @@ static void peep_update_ride_leave_entrance_maze(Guest* peep, Ride* ride, Coords if (scenario_rand() & 0x40) { direction += 4; - peep->maze_last_edge += 2; + peep->MazeLastEdge += 2; } direction &= 0xF; // Direction is 11, 15, 3, or 7 peep->var_37 = direction; - peep->maze_last_edge &= 3; + peep->MazeLastEdge &= 3; entrance_loc.x += _MazeEntranceStart[direction / 4].x; entrance_loc.y += _MazeEntranceStart[direction / 4].y; @@ -3948,7 +3947,7 @@ void Guest::UpdateRideFreeVehicleCheck() if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES)) { - if (ride->status != RIDE_STATUS_OPEN || ride->vehicle_change_timeout != 0 || (++rejoin_queue_timeout) == 0) + if (ride->status != RIDE_STATUS_OPEN || ride->vehicle_change_timeout != 0 || (++RejoinQueueTimeout) == 0) { peep_update_ride_no_free_vehicle_rejoin_queue(this, ride); return; @@ -4017,7 +4016,7 @@ void Guest::UpdateRideFreeVehicleCheck() } Vehicle* currentTrain = GET_VEHICLE(ride->vehicles[current_train]); - if (ride->status == RIDE_STATUS_OPEN && ++rejoin_queue_timeout != 0 + if (ride->status == RIDE_STATUS_OPEN && ++RejoinQueueTimeout != 0 && !currentTrain->UpdateFlag(VEHICLE_UPDATE_FLAG_TRAIN_READY_DEPART)) { return; @@ -4885,7 +4884,7 @@ void Guest::UpdateRideMazePathfinding() if (openHedges == 0) return; - uint8_t mazeLastEdge = direction_reverse(maze_last_edge); + uint8_t mazeLastEdge = direction_reverse(MazeLastEdge); openHedges &= ~(1 << mazeLastEdge); if (openHedges == 0) openHedges |= (1 << mazeLastEdge); @@ -4935,15 +4934,15 @@ void Guest::UpdateRideMazePathfinding() switch (mazeType) { case maze_type::invalid: - maze_last_edge++; - maze_last_edge &= 3; + MazeLastEdge++; + MazeLastEdge &= 3; return; case maze_type::hedge: destination_x = targetLoc.x; destination_y = targetLoc.y; var_37 = _MazeGetNewDirectionFromEdge[var_37 / 4][chosenEdge]; - maze_last_edge = chosenEdge; + MazeLastEdge = chosenEdge; break; case maze_type::entrance_or_exit: targetLoc.x = destination_x; @@ -4959,7 +4958,7 @@ void Guest::UpdateRideMazePathfinding() destination_x = targetLoc.x; destination_y = targetLoc.y; var_37 = 16; - maze_last_edge = chosenEdge; + MazeLastEdge = chosenEdge; break; } @@ -5000,7 +4999,7 @@ void Guest::UpdateRideLeaveExit() } } - interaction_ride_index = RIDE_ID_NULL; + InteractionRideIndex = RIDE_ID_NULL; SetState(PEEP_STATE_FALLING); CoordsXY targetLoc = { x, y }; @@ -5552,14 +5551,14 @@ void Guest::UpdateQueuing() if (sub_state != 10) { bool is_front = true; - if (next_in_queue != SPRITE_INDEX_NULL) + if (GuestNextInQueue != SPRITE_INDEX_NULL) { - // Fix #4819: Occasionally the peep->next_in_queue is incorrectly set + // Fix #4819: Occasionally the peep->GuestNextInQueue is incorrectly set // to prevent this from causing the peeps to enter a loop // first check if the next in queue is actually nearby // if they are not then it's safe to assume that this is // the front of the queue. - Peep* next_peep = GET_PEEP(next_in_queue); + Peep* next_peep = GET_PEEP(GuestNextInQueue); if (abs(next_peep->x - x) < 32 && abs(next_peep->y - y) < 32) { is_front = false; @@ -5589,7 +5588,7 @@ void Guest::UpdateQueuing() return; if (sprite_type == PEEP_SPRITE_TYPE_NORMAL) { - if (time_in_queue >= 2000 && (0xFFFF & scenario_rand()) <= 119) + if (TimeInQueue >= 2000 && (0xFFFF & scenario_rand()) <= 119) { // Eat Food/Look at watch action = PEEP_ACTION_EAT_FOOD; @@ -5597,7 +5596,7 @@ void Guest::UpdateQueuing() action_sprite_image_offset = 0; UpdateCurrentActionSpriteType(); } - if (time_in_queue >= 3500 && (0xFFFF & scenario_rand()) <= 93) + if (TimeInQueue >= 3500 && (0xFFFF & scenario_rand()) <= 93) { // Create the I have been waiting in line ages thought InsertNewThought(PEEP_THOUGHT_TYPE_QUEUING_AGES, current_ride); @@ -5605,7 +5604,7 @@ void Guest::UpdateQueuing() } else { - if (!(time_in_queue & 0x3F) && action == PEEP_ACTION_NONE_1 && next_action_sprite_type == 2) + if (!(TimeInQueue & 0x3F) && action == PEEP_ACTION_NONE_1 && next_action_sprite_type == 2) { switch (sprite_type) { @@ -5642,7 +5641,7 @@ void Guest::UpdateQueuing() } } } - if (time_in_queue < 4300) + if (TimeInQueue < 4300) return; if (happiness <= 65 && (0xFFFF & scenario_rand()) < 2184) @@ -5679,7 +5678,7 @@ void Guest::UpdateEnteringPark() SetState(PEEP_STATE_FALLING); outside_of_park = 0; - time_in_park = gScenarioTicks; + TimeInPark = gScenarioTicks; increment_guests_in_park(); decrement_guests_heading_for_park(); auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 1ff4b4cd34..2f2b202050 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -118,7 +118,7 @@ static int32_t peep_move_one_tile(Direction direction, Peep* peep) return guest_surface_path_finding(peep); } - peep->direction = direction; + peep->PeepDirection = direction; peep->destination_x = newTile.x; peep->destination_y = newTile.y; peep->destination_tolerance = 2; @@ -415,9 +415,9 @@ static int32_t guest_path_find_aimless(Peep* peep, uint8_t edges) if (scenario_rand() & 1) { // If possible go straight - if (edges & (1 << peep->direction)) + if (edges & (1 << peep->PeepDirection)) { - return peep_move_one_tile(peep->direction, peep); + return peep_move_one_tile(peep->PeepDirection, peep); } } @@ -1496,13 +1496,13 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) peep->PathfindHistory[i].direction &= ~(1 << chosen_edge); /* Also remove the edge through which the peep * entered the junction from those left to try. */ - peep->PathfindHistory[i].direction &= ~(1 << direction_reverse(peep->direction)); + peep->PathfindHistory[i].direction &= ~(1 << direction_reverse(peep->PeepDirection)); #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 if (gPathFindDebug) { log_verbose( "Updating existing pf_history (in index: %d) for %d,%d,%d without entry edge %d & exit edge %d.", i, - loc.x, loc.y, loc.z, direction_reverse(peep->direction), chosen_edge); + loc.x, loc.y, loc.z, direction_reverse(peep->PeepDirection), chosen_edge); } #endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 return chosen_edge; @@ -1521,13 +1521,13 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) peep->PathfindHistory[i].direction &= ~(1 << chosen_edge); /* Also remove the edge through which the peep * entered the junction from those left to try. */ - peep->PathfindHistory[i].direction &= ~(1 << direction_reverse(peep->direction)); + peep->PathfindHistory[i].direction &= ~(1 << direction_reverse(peep->PeepDirection)); #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 if (gPathFindDebug) { log_verbose( "Storing new pf_history (in index: %d) for %d,%d,%d without entry edge %d & exit edge %d.", i, loc.x, loc.y, - loc.z, direction_reverse(peep->direction), chosen_edge); + loc.z, direction_reverse(peep->PeepDirection), chosen_edge); } #endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 } @@ -1935,7 +1935,7 @@ int32_t guest_path_finding(Guest* peep) edges = adjustedEdges; } - int32_t direction = direction_reverse(peep->direction); + int32_t direction = direction_reverse(peep->PeepDirection); // Check if in a dead end (i.e. only edge is where the peep came from) if (!(edges & ~(1 << direction))) { diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 190676c6c8..918a58d17b 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -1008,7 +1008,7 @@ void Peep::Update1() destination_x = x; destination_y = y; destination_tolerance = 10; - direction = sprite_direction >> 3; + PeepDirection = sprite_direction >> 3; } void Peep::SetState(PeepState new_state) @@ -1044,28 +1044,28 @@ static void peep_update_thoughts(Peep* peep) int32_t fresh_thought = -1; for (int32_t i = 0; i < PEEP_MAX_THOUGHTS; i++) { - if (peep->thoughts[i].type == PEEP_THOUGHT_TYPE_NONE) + if (peep->Thoughts[i].type == PEEP_THOUGHT_TYPE_NONE) break; - if (peep->thoughts[i].freshness == 1) + if (peep->Thoughts[i].freshness == 1) { add_fresh = 0; // If thought is fresh we wait 220 ticks // before allowing a new thought to become fresh. - if (++peep->thoughts[i].fresh_timeout >= 220) + if (++peep->Thoughts[i].fresh_timeout >= 220) { - peep->thoughts[i].fresh_timeout = 0; + peep->Thoughts[i].fresh_timeout = 0; // Thought is no longer fresh - peep->thoughts[i].freshness++; + peep->Thoughts[i].freshness++; add_fresh = 1; } } - else if (peep->thoughts[i].freshness > 1) + else if (peep->Thoughts[i].freshness > 1) { - if (++peep->thoughts[i].fresh_timeout == 0) + if (++peep->Thoughts[i].fresh_timeout == 0) { // When thought is older than ~6900 ticks remove it - if (++peep->thoughts[i].freshness >= 28) + if (++peep->Thoughts[i].freshness >= 28) { peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_THOUGHTS; @@ -1073,9 +1073,9 @@ static void peep_update_thoughts(Peep* peep) if (i < PEEP_MAX_THOUGHTS - 2) { memmove( - &peep->thoughts[i], &peep->thoughts[i + 1], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); + &peep->Thoughts[i], &peep->Thoughts[i + 1], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - i - 1)); } - peep->thoughts[PEEP_MAX_THOUGHTS - 1].type = PEEP_THOUGHT_TYPE_NONE; + peep->Thoughts[PEEP_MAX_THOUGHTS - 1].type = PEEP_THOUGHT_TYPE_NONE; } } } @@ -1089,7 +1089,7 @@ static void peep_update_thoughts(Peep* peep) // fresh. if (add_fresh && fresh_thought != -1) { - peep->thoughts[fresh_thought].freshness = 1; + peep->Thoughts[fresh_thought].freshness = 1; peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_THOUGHTS; } } @@ -1102,9 +1102,9 @@ void Peep::Update() { if (type == PEEP_TYPE_GUEST) { - if (previous_ride != RIDE_ID_NULL) - if (++previous_ride_time_out >= 720) - previous_ride = RIDE_ID_NULL; + if (PreviousRide != RIDE_ID_NULL) + if (++PreviousRideTimeOut >= 720) + PreviousRide = RIDE_ID_NULL; peep_update_thoughts(this); } @@ -1189,10 +1189,10 @@ void peep_problem_warnings_update() FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0 || peep->thoughts[0].freshness > 5) + if (peep->outside_of_park != 0 || peep->Thoughts[0].freshness > 5) continue; - switch (peep->thoughts[0].type) + switch (peep->Thoughts[0].type) { case PEEP_THOUGHT_TYPE_LOST: // 0x10 lost_counter++; @@ -1576,7 +1576,7 @@ void Peep::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArgument for (int32_t i = 0; i < PEEP_MAX_THOUGHTS; ++i) { - rct_peep_thought* thought = &thoughts[i]; + rct_peep_thought* thought = &Thoughts[i]; // Remove the oldest thought by setting it to NONE. if (thought->type == PEEP_THOUGHT_TYPE_NONE) break; @@ -1594,12 +1594,12 @@ void Peep::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArgument } } - memmove(&thoughts[1], &thoughts[0], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - 1)); + memmove(&Thoughts[1], &Thoughts[0], sizeof(rct_peep_thought) * (PEEP_MAX_THOUGHTS - 1)); - thoughts[0].type = thoughtType; - thoughts[0].item = thoughtArguments; - thoughts[0].freshness = 0; - thoughts[0].fresh_timeout = 0; + Thoughts[0].type = thoughtType; + Thoughts[0].item = thoughtArguments; + Thoughts[0].freshness = 0; + Thoughts[0].fresh_timeout = 0; window_invalidate_flags |= PEEP_INVALIDATE_PEEP_THOUGHTS; } @@ -1636,10 +1636,10 @@ Peep* Peep::Generate(const CoordsXYZ& coords) peep->sprite_direction = 0; peep->mass = (scenario_rand() & 0x1F) + 45; peep->PathCheckOptimisation = 0; - peep->interaction_ride_index = RIDE_ID_NULL; + peep->InteractionRideIndex = RIDE_ID_NULL; peep->type = PEEP_TYPE_GUEST; - peep->previous_ride = RIDE_ID_NULL; - peep->thoughts->type = PEEP_THOUGHT_TYPE_NONE; + peep->PreviousRide = RIDE_ID_NULL; + peep->Thoughts->type = PEEP_THOUGHT_TYPE_NONE; peep->window_invalidate_flags = 0; uint8_t intensityHighest = (scenario_rand() & 0x7) + 3; @@ -1715,11 +1715,11 @@ Peep* Peep::Generate(const CoordsXYZ& coords) peep->toilet = 0; peep->time_to_consume = 0; - std::fill_n(peep->rides_been_on, 32, 0x00); + std::fill_n(peep->RidesBeenOn, 32, 0x00); peep->no_of_rides = 0; std::fill_n(peep->ride_types_been_on, 16, 0x00); - peep->id = gNextGuestNumber++; + peep->Id = gNextGuestNumber++; peep->name = nullptr; money32 cash = (scenario_rand() & 0x3) * 100 - 100 + gGuestInitialCash; @@ -1741,9 +1741,9 @@ Peep* Peep::Generate(const CoordsXYZ& coords) cash = 0; } - peep->cash_in_pocket = cash; - peep->cash_spent = 0; - peep->time_in_park = -1; + peep->CashInPocket = cash; + peep->CashSpent = 0; + peep->TimeInPark = -1; peep->PathfindGoal.x = 0xFF; peep->PathfindGoal.y = 0xFF; peep->PathfindGoal.z = 0xFF; @@ -1988,17 +1988,17 @@ size_t Peep::FormatNameTo(void* argsV) const } ft.Add(staffNames[staffNameIndex]); - ft.Add(id); + ft.Add(Id); return ft.NumBytes(); } else if (gParkFlags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES) { - auto realNameStringId = get_real_name_string_id_from_id(id); + auto realNameStringId = get_real_name_string_id_from_id(Id); return ft.Add(realNameStringId).NumBytes(); } else { - return ft.Add(STR_GUEST_X).Add(id).NumBytes(); + return ft.Add(STR_GUEST_X).Add(Id).NumBytes(); } } else @@ -2255,11 +2255,11 @@ void Peep::SwitchNextActionSpriteType() */ static bool peep_update_queue_position(Peep* peep, uint8_t previous_action) { - peep->time_in_queue++; - if (peep->next_in_queue == SPRITE_INDEX_NULL) + peep->TimeInQueue++; + if (peep->GuestNextInQueue == SPRITE_INDEX_NULL) return false; - Peep* peep_next = GET_PEEP(peep->next_in_queue); + Peep* peep_next = GET_PEEP(peep->GuestNextInQueue); int16_t x_diff = abs(peep_next->x - peep->x); int16_t y_diff = abs(peep_next->y - peep->y); @@ -2327,7 +2327,7 @@ static bool peep_update_queue_position(Peep* peep, uint8_t previous_action) */ static void peep_return_to_centre_of_tile(Peep* peep) { - peep->direction = direction_reverse(peep->direction); + peep->PeepDirection = direction_reverse(peep->PeepDirection); peep->destination_x = (peep->x & 0xFFE0) + 16; peep->destination_y = (peep->y & 0xFFE0) + 16; peep->destination_tolerance = 5; @@ -2359,7 +2359,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl { // Default guest/staff behaviour attempting to enter a // ride exit is to turn around. - peep->interaction_ride_index = 0xFF; + peep->InteractionRideIndex = 0xFF; peep_return_to_centre_of_tile(peep); return; } @@ -2376,7 +2376,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl { // Default staff behaviour attempting to enter a // ride entrance is to turn around. - peep->interaction_ride_index = 0xFF; + peep->InteractionRideIndex = 0xFF; peep_return_to_centre_of_tile(peep); return; } @@ -2390,7 +2390,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl } // Guest is on a normal path, i.e. ride has no queue. - if (peep->interaction_ride_index == rideIndex) + if (peep->InteractionRideIndex == rideIndex) { // Peep is retrying the ride entrance without leaving // the path tile and without trying any other ride @@ -2409,18 +2409,18 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl { // Peep remembers that this is the last ride they // considered while on this path tile. - peep->interaction_ride_index = rideIndex; + peep->InteractionRideIndex = rideIndex; peep_return_to_centre_of_tile(peep); return; } // Guest has decided to go on the ride. peep->action_sprite_image_offset = _unk_F1AEF0; - peep->interaction_ride_index = rideIndex; + peep->InteractionRideIndex = rideIndex; uint16_t previous_last = ride->stations[stationNum].LastPeepInQueue; ride->stations[stationNum].LastPeepInQueue = peep->sprite_index; - peep->next_in_queue = previous_last; + peep->GuestNextInQueue = previous_last; ride->stations[stationNum].QueueLength++; peep->current_ride = rideIndex; @@ -2428,7 +2428,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl peep->DaysInQueue = 0; peep->SetState(PEEP_STATE_QUEUING); peep->sub_state = 11; - peep->time_in_queue = 0; + peep->TimeInQueue = 0; if (peep->PeepFlags & PEEP_FLAGS_TRACKING) { auto ft = Formatter::Common(); @@ -2459,9 +2459,9 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl } uint8_t entranceDirection = tile_element->GetDirection(); - if (entranceDirection != peep->direction) + if (entranceDirection != peep->PeepDirection) { - if (direction_reverse(entranceDirection) != peep->direction) + if (direction_reverse(entranceDirection) != peep->PeepDirection) { peep_return_to_centre_of_tile(peep); return; @@ -2484,8 +2484,8 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl } } - peep->destination_x += CoordsDirectionDelta[peep->direction].x; - peep->destination_y += CoordsDirectionDelta[peep->direction].y; + peep->destination_x += CoordsDirectionDelta[peep->PeepDirection].x; + peep->destination_y += CoordsDirectionDelta[peep->PeepDirection].y; peep->destination_tolerance = 9; peep->MoveTo({ x, y, peep->z }); peep->SetState(PEEP_STATE_LEAVING_PARK); @@ -2606,7 +2606,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY; } } - if (entranceFee > peep->cash_in_pocket) + if (entranceFee > peep->CashInPocket) { peep->state = PEEP_STATE_LEAVING_PARK; peep->var_37 = 1; @@ -2625,8 +2625,8 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl window_invalidate_by_number(WC_PARK_INFORMATION, 0); peep->var_37 = 1; - peep->destination_x += CoordsDirectionDelta[peep->direction].x; - peep->destination_y += CoordsDirectionDelta[peep->direction].y; + peep->destination_x += CoordsDirectionDelta[peep->PeepDirection].x; + peep->destination_y += CoordsDirectionDelta[peep->PeepDirection].y; peep->destination_tolerance = 7; peep->MoveTo({ x, y, peep->z }); } @@ -2820,7 +2820,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen else { // Queue got disconnected from the original ride. - peep->interaction_ride_index = 0xFF; + peep->InteractionRideIndex = 0xFF; guest->RemoveFromQueue(); peep->SetState(PEEP_STATE_1); peep_footpath_move_forward(peep, x, y, tile_element, vandalism_present); @@ -2834,7 +2834,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen if ((tile_element->AsPath()->HasQueueBanner()) && (tile_element->AsPath()->GetQueueBannerDirection() - == direction_reverse(peep->direction)) // Ride sign is facing the direction the peep is walking + == direction_reverse(peep->PeepDirection)) // Ride sign is facing the direction the peep is walking ) { /* Peep is approaching the entrance of a ride queue. @@ -2843,12 +2843,12 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen if (ride != nullptr && guest->ShouldGoOnRide(ride, stationNum, true, false)) { // Peep has decided to go on the ride at the queue. - peep->interaction_ride_index = rideIndex; + peep->InteractionRideIndex = rideIndex; // Add the peep to the ride queue. uint16_t old_last_peep = ride->stations[stationNum].LastPeepInQueue; ride->stations[stationNum].LastPeepInQueue = peep->sprite_index; - peep->next_in_queue = old_last_peep; + peep->GuestNextInQueue = old_last_peep; ride->stations[stationNum].QueueLength++; peep_decrement_num_riders(peep); @@ -2860,7 +2860,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen peep->sub_state = 10; peep->destination_tolerance = 2; - peep->time_in_queue = 0; + peep->TimeInQueue = 0; if (peep->PeepFlags & PEEP_FLAGS_TRACKING) { auto ft = Formatter::Common(); @@ -2891,7 +2891,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen } else { - peep->interaction_ride_index = 0xFF; + peep->InteractionRideIndex = 0xFF; if (peep->state == PEEP_STATE_QUEUING) { peep->RemoveFromQueue(); @@ -2927,7 +2927,7 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen return true; } - if (peep->interaction_ride_index == rideIndex) + if (peep->InteractionRideIndex == rideIndex) { peep_return_to_centre_of_tile(peep); return true; @@ -3130,7 +3130,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) int16_t height = abs(tile_element_height(newLoc) - z); if (height <= 3 || (type == PEEP_TYPE_STAFF && height <= 32)) { - interaction_ride_index = 0xFF; + InteractionRideIndex = 0xFF; if (state == PEEP_STATE_QUEUING) { RemoveFromQueue(); @@ -3220,7 +3220,7 @@ int32_t Peep::GetZOnSlope(int32_t tile_x, int32_t tile_y) rct_string_id get_real_name_string_id_from_id(uint32_t id) { - // Generate a name_string_idx from the peep id using bit twiddling + // Generate a name_string_idx from the peep Id using bit twiddling uint16_t ax = static_cast(id + 0xF0B); uint16_t dx = 0; static constexpr uint16_t twiddlingBitOrder[] = { 4, 9, 3, 7, 5, 8, 2, 1, 6, 0, 12, 11, 13, 10 }; @@ -3261,7 +3261,7 @@ int32_t peep_compare(const uint16_t sprite_index_a, const uint16_t sprite_index_ else { // Simple ID comparison for when both peeps use a number or a generated name - return peep_a->id - peep_b->id; + return peep_a->Id - peep_b->Id; } } @@ -3305,7 +3305,7 @@ void pathfind_logging_enable([[maybe_unused]] Peep* peep) { # if defined(PATHFIND_DEBUG) && PATHFIND_DEBUG /* Determine if the pathfinding debugging is wanted for this peep. */ - format_string(gPathFindDebugPeepName, sizeof(gPathFindDebugPeepName), peep->name_string_idx, &(peep->id)); + format_string(gPathFindDebugPeepName, sizeof(gPathFindDebugPeepName), peep->name_string_idx, &(peep->Id)); /* For guests, use the existing PEEP_FLAGS_TRACKING flag to * determine for which guest(s) the pathfinding debugging will @@ -3415,7 +3415,7 @@ void Peep::RemoveFromQueue() if (sprite_index == station.LastPeepInQueue) { - station.LastPeepInQueue = next_in_queue; + station.LastPeepInQueue = GuestNextInQueue; return; } @@ -3423,12 +3423,12 @@ void Peep::RemoveFromQueue() while (spriteId != SPRITE_INDEX_NULL) { Peep* other_peep = GET_PEEP(spriteId); - if (sprite_index == other_peep->next_in_queue) + if (sprite_index == other_peep->GuestNextInQueue) { - other_peep->next_in_queue = next_in_queue; + other_peep->GuestNextInQueue = GuestNextInQueue; return; } - spriteId = other_peep->next_in_queue; + spriteId = other_peep->GuestNextInQueue; } } diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index a1ad3de117..1410c4c051 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -664,27 +664,27 @@ struct Peep : SpriteBase uint8_t step_progress; union { - uint16_t mechanic_time_since_call; // time getting to ride to fix - uint16_t next_in_queue; + uint16_t MechanicTimeSinceCall; // time getting to ride to fix + uint16_t GuestNextInQueue; }; union { - uint8_t maze_last_edge; - Direction direction; // Direction ? + uint8_t MazeLastEdge; + Direction PeepDirection; // Direction ? }; - uint8_t interaction_ride_index; - uint16_t time_in_queue; - uint8_t rides_been_on[32]; + uint8_t InteractionRideIndex; + uint16_t TimeInQueue; + uint8_t RidesBeenOn[32]; // 255 bit bitmap of every ride the peep has been on see // window_peep_rides_update for how to use. - uint32_t id; - money32 cash_in_pocket; - money32 cash_spent; - int32_t time_in_park; - int8_t rejoin_queue_timeout; // whilst waiting for a free vehicle (or pair) in the entrance - uint8_t previous_ride; - uint16_t previous_ride_time_out; - rct_peep_thought thoughts[PEEP_MAX_THOUGHTS]; + uint32_t Id; + money32 CashInPocket; + money32 CashSpent; + int32_t TimeInPark; + int8_t RejoinQueueTimeout; // whilst waiting for a free vehicle (or pair) in the entrance + uint8_t PreviousRide; + uint16_t PreviousRideTimeOut; + rct_peep_thought Thoughts[PEEP_MAX_THOUGHTS]; uint8_t PathCheckOptimisation; // see peep.checkForPath union { diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 13402202f3..7a5c59a88d 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -366,7 +366,7 @@ void staff_reset_stats() FOR_ALL_STAFF (spriteIndex, peep) { - peep->time_in_park = gDateMonthsElapsed; + peep->TimeInPark = gDateMonthsElapsed; peep->StaffLawnsMown = 0; peep->StaffRidesFixed = 0; peep->StaffGardensWatered = 0; @@ -658,10 +658,10 @@ bool Staff::DoHandymanPathFinding() } else { - pathDirections &= ~(1 << direction_reverse(direction)); + pathDirections &= ~(1 << direction_reverse(PeepDirection)); if (pathDirections == 0) { - pathDirections |= 1 << direction_reverse(direction); + pathDirections |= 1 << direction_reverse(PeepDirection); } } @@ -687,7 +687,7 @@ bool Staff::DoHandymanPathFinding() chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection]; } - direction = newDirection; + PeepDirection = newDirection; destination_x = chosenTile.x + 16; destination_y = chosenTile.y + 16; destination_tolerance = 3; @@ -781,8 +781,8 @@ static uint8_t staff_mechanic_direction_path_rand(Peep* peep, uint8_t pathDirect { if (scenario_rand() & 1) { - if (pathDirections & (1 << peep->direction)) - return peep->direction; + if (pathDirections & (1 << peep->PeepDirection)) + return peep->PeepDirection; } // Modified from original to spam scenario_rand less @@ -794,7 +794,7 @@ static uint8_t staff_mechanic_direction_path_rand(Peep* peep, uint8_t pathDirect return direction; } // This will never happen as pathDirections always has a bit set. - return peep->direction; + return peep->PeepDirection; } /** @@ -813,10 +813,10 @@ static uint8_t staff_mechanic_direction_path(Peep* peep, uint8_t validDirections } // Check if this is dead end - i.e. only way out is the reverse direction. - pathDirections &= ~(1 << direction_reverse(peep->direction)); + pathDirections &= ~(1 << direction_reverse(peep->PeepDirection)); if (pathDirections == 0) { - pathDirections |= (1 << direction_reverse(peep->direction)); + pathDirections |= (1 << direction_reverse(peep->PeepDirection)); } direction = bitscanforward(pathDirections); @@ -921,7 +921,7 @@ bool Staff::DoMechanicPathFinding() chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection]; } - direction = newDirection; + PeepDirection = newDirection; destination_x = chosenTile.x + 16; destination_y = chosenTile.y + 16; destination_tolerance = (scenario_rand() & 7) + 2; @@ -947,10 +947,10 @@ static uint8_t staff_direction_path(Peep* peep, uint8_t validDirections, PathEle return staff_direction_surface(peep, scenario_rand() & 3); } - pathDirections &= ~(1 << direction_reverse(peep->direction)); + pathDirections &= ~(1 << direction_reverse(peep->PeepDirection)); if (pathDirections == 0) { - pathDirections |= (1 << direction_reverse(peep->direction)); + pathDirections |= (1 << direction_reverse(peep->PeepDirection)); } direction = bitscanforward(pathDirections); @@ -1004,7 +1004,7 @@ bool Staff::DoMiscPathFinding() chosenTile = CoordsXY{ NextLoc } + CoordsDirectionDelta[newDirection]; } - direction = newDirection; + PeepDirection = newDirection; destination_x = chosenTile.x + 16; destination_y = chosenTile.y + 16; destination_tolerance = (scenario_rand() & 7) + 2; @@ -1045,13 +1045,13 @@ static void staff_entertainer_update_nearby_peeps(Peep* peep) } else if (peep->state == PEEP_STATE_QUEUING) { - if (peep->time_in_queue > 200) + if (peep->TimeInQueue > 200) { - peep->time_in_queue -= 200; + peep->TimeInQueue -= 200; } else { - peep->time_in_queue = 0; + peep->TimeInQueue = 0; } peep->happiness_target = std::min(peep->happiness_target + 3, PEEP_MAX_HAPPINESS); } @@ -1444,15 +1444,15 @@ void Staff::UpdateHeadingToInspect() if (sub_state == 0) { - mechanic_time_since_call = 0; + MechanicTimeSinceCall = 0; peep_reset_pathfind_goal(this); sub_state = 2; } if (sub_state <= 3) { - mechanic_time_since_call++; - if (mechanic_time_since_call > 2500) + MechanicTimeSinceCall++; + if (MechanicTimeSinceCall > 2500) { if (ride->lifecycle_flags & RIDE_LIFECYCLE_DUE_INSPECTION && ride->mechanic_status == RIDE_MECHANIC_STATUS_HEADING) { @@ -1490,15 +1490,15 @@ void Staff::UpdateHeadingToInspect() } } - direction = rideEntranceExitElement->GetDirection(); + PeepDirection = rideEntranceExitElement->GetDirection(); - int32_t destX = NextLoc.x + 16 + DirectionOffsets[direction].x * 53; - int32_t destY = NextLoc.y + 16 + DirectionOffsets[direction].y * 53; + int32_t destX = NextLoc.x + 16 + DirectionOffsets[PeepDirection].x * 53; + int32_t destY = NextLoc.y + 16 + DirectionOffsets[PeepDirection].y * 53; destination_x = destX; destination_y = destY; destination_tolerance = 2; - sprite_direction = direction << 3; + sprite_direction = PeepDirection << 3; z = rideEntranceExitElement->base_height * 4; sub_state = 4; @@ -1554,7 +1554,7 @@ void Staff::UpdateAnswering() { sub_state = 2; peep_window_state_update(this); - mechanic_time_since_call = 0; + MechanicTimeSinceCall = 0; peep_reset_pathfind_goal(this); return; } @@ -1564,8 +1564,8 @@ void Staff::UpdateAnswering() } else if (sub_state <= 3) { - mechanic_time_since_call++; - if (mechanic_time_since_call > 2500) + MechanicTimeSinceCall++; + if (MechanicTimeSinceCall > 2500) { ride->mechanic_status = RIDE_MECHANIC_STATUS_CALLING; ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; @@ -1601,15 +1601,15 @@ void Staff::UpdateAnswering() } } - direction = rideEntranceExitElement->GetDirection(); + PeepDirection = rideEntranceExitElement->GetDirection(); - int32_t destX = NextLoc.x + 16 + DirectionOffsets[direction].x * 53; - int32_t destY = NextLoc.y + 16 + DirectionOffsets[direction].y * 53; + int32_t destX = NextLoc.x + 16 + DirectionOffsets[PeepDirection].x * 53; + int32_t destY = NextLoc.y + 16 + DirectionOffsets[PeepDirection].y * 53; destination_x = destX; destination_y = destY; destination_tolerance = 2; - sprite_direction = direction << 3; + sprite_direction = PeepDirection << 3; z = rideEntranceExitElement->base_height * 4; sub_state = 4; @@ -2211,7 +2211,7 @@ bool Staff::UpdateFixingMoveToBrokenDownVehicle(bool firstRun, Ride* ride) vehicle = GET_VEHICLE(vehicle->prev_vehicle_on_ride); } - CoordsXY offset = DirectionOffsets[direction]; + CoordsXY offset = DirectionOffsets[PeepDirection]; destination_x = (offset.x * -12) + vehicle->x; destination_y = (offset.y * -12) + vehicle->y; destination_tolerance = 2; @@ -2239,7 +2239,7 @@ bool Staff::UpdateFixingFixVehicle(bool firstRun, Ride* ride) { if (!firstRun) { - sprite_direction = direction << 3; + sprite_direction = PeepDirection << 3; action = (scenario_rand() & 1) ? PEEP_ACTION_STAFF_FIX_2 : PEEP_ACTION_STAFF_FIX; action_sprite_image_offset = 0; @@ -2281,7 +2281,7 @@ bool Staff::UpdateFixingFixVehicleMalfunction(bool firstRun, Ride* ride) { if (!firstRun) { - sprite_direction = direction << 3; + sprite_direction = PeepDirection << 3; action = PEEP_ACTION_STAFF_FIX_3; action_sprite_image_offset = 0; action_frame = 0; @@ -2388,7 +2388,7 @@ bool Staff::UpdateFixingFixStationEnd(bool firstRun) { if (!firstRun) { - sprite_direction = direction << 3; + sprite_direction = PeepDirection << 3; action = PEEP_ACTION_STAFF_CHECKBOARD; action_frame = 0; action_sprite_image_offset = 0; @@ -2504,7 +2504,7 @@ bool Staff::UpdateFixingFixStationStart(bool firstRun, Ride* ride) return true; } - sprite_direction = direction << 3; + sprite_direction = PeepDirection << 3; action = PEEP_ACTION_STAFF_FIX; action_frame = 0; @@ -2532,7 +2532,7 @@ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride* ride) { if (!firstRun) { - sprite_direction = direction << 3; + sprite_direction = PeepDirection << 3; action = PEEP_ACTION_STAFF_FIX_GROUND; action_frame = 0; @@ -2585,7 +2585,7 @@ bool Staff::UpdateFixingMoveToStationExit(bool firstRun, Ride* ride) stationPosition = stationPosition.ToTileCentre(); - CoordsXY stationPlatformDirection = DirectionOffsets[direction]; + CoordsXY stationPlatformDirection = DirectionOffsets[PeepDirection]; stationPosition.x += stationPlatformDirection.x * 20; stationPosition.y += stationPlatformDirection.y * 20; @@ -2629,7 +2629,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* r StaffRidesFixed++; window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME | RIDE_INVALIDATE_RIDE_LIST; - sprite_direction = direction << 3; + sprite_direction = PeepDirection << 3; action = PEEP_ACTION_STAFF_ANSWER_CALL_2; action_frame = 0; action_sprite_image_offset = 0; @@ -2672,7 +2672,7 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, Ride* ride) exitPosition = exitPosition.ToTileCentre(); - CoordsXY ebx_direction = DirectionOffsets[direction]; + CoordsXY ebx_direction = DirectionOffsets[PeepDirection]; exitPosition.x -= ebx_direction.x * 19; exitPosition.y -= ebx_direction.y * 19; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index d23ba62425..30a2bb8538 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1446,7 +1446,7 @@ private: dst->destination_x = src->destination_x; dst->destination_y = src->destination_y; dst->destination_tolerance = src->destination_tolerance; - dst->direction = src->direction; + dst->PeepDirection = src->direction; dst->energy = src->energy; dst->energy_target = src->energy_target; @@ -1474,12 +1474,12 @@ private: dst->GuestTimeOnRide = src->time_on_ride; dst->DaysInQueue = src->days_in_queue; - dst->interaction_ride_index = src->interaction_ride_index; + dst->InteractionRideIndex = src->interaction_ride_index; - dst->id = src->id; - dst->cash_in_pocket = src->cash_in_pocket; - dst->cash_spent = src->cash_spent; - dst->time_in_park = src->time_in_park; + dst->Id = src->id; + dst->CashInPocket = src->cash_in_pocket; + dst->CashSpent = src->cash_spent; + dst->TimeInPark = src->time_in_park; // This doubles as staff type dst->no_of_rides = src->no_of_rides; @@ -1503,7 +1503,7 @@ private: for (size_t i = 0; i < 32; i++) { - dst->rides_been_on[i] = src->rides_been_on[i]; + dst->RidesBeenOn[i] = src->rides_been_on[i]; } for (size_t i = 0; i < 16; i++) { @@ -1515,22 +1515,22 @@ private: for (size_t i = 0; i < std::size(src->thoughts); i++) { auto srcThought = &src->thoughts[i]; - auto dstThought = &dst->thoughts[i]; + auto dstThought = &dst->Thoughts[i]; dstThought->type = static_cast(srcThought->type); dstThought->item = srcThought->type; dstThought->freshness = srcThought->freshness; dstThought->fresh_timeout = srcThought->fresh_timeout; } - dst->previous_ride = src->previous_ride; - dst->previous_ride_time_out = src->previous_ride_time_out; + dst->PreviousRide = src->previous_ride; + dst->PreviousRideTimeOut = src->previous_ride_time_out; dst->PathCheckOptimisation = 0; dst->GuestHeadingToRideId = src->guest_heading_to_ride_id; // Doubles as staff orders dst->GuestIsLostCountdown = src->peep_is_lost_countdown; // The ID is fixed later - dst->next_in_queue = src->next_in_queue; + dst->GuestNextInQueue = src->next_in_queue; dst->PeepFlags = 0; dst->PathfindGoal.x = 0xFF; @@ -1581,7 +1581,7 @@ private: void FixPeepNextInQueue(Peep* peep, const uint16_t* spriteIndexMap) { - peep->next_in_queue = MapSpriteIndex(peep->next_in_queue, spriteIndexMap); + peep->GuestNextInQueue = MapSpriteIndex(peep->GuestNextInQueue, spriteIndexMap); } void ImportStaffPatrolArea(Peep* staffmember) diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index f6ec9d49d6..0b0dd720f0 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1125,7 +1125,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) } else if (gParkFlags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES) { - dst->name_string_idx = get_real_name_string_id_from_id(src->id); + dst->name_string_idx = get_real_name_string_id_from_id(src->Id); } else { @@ -1183,24 +1183,24 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) dst->action = static_cast(src->action); dst->action_frame = src->action_frame; dst->step_progress = src->step_progress; - dst->next_in_queue = src->next_in_queue; - dst->direction = src->direction; - dst->interaction_ride_index = src->interaction_ride_index; - dst->time_in_queue = src->time_in_queue; - for (size_t i = 0; i < std::size(src->rides_been_on); i++) + dst->next_in_queue = src->GuestNextInQueue; + dst->direction = src->PeepDirection; + dst->interaction_ride_index = src->InteractionRideIndex; + dst->time_in_queue = src->TimeInQueue; + for (size_t i = 0; i < std::size(src->RidesBeenOn); i++) { - dst->rides_been_on[i] = src->rides_been_on[i]; + dst->rides_been_on[i] = src->RidesBeenOn[i]; } - dst->id = src->id; - dst->cash_in_pocket = src->cash_in_pocket; - dst->cash_spent = src->cash_spent; - dst->time_in_park = src->time_in_park; - dst->rejoin_queue_timeout = src->rejoin_queue_timeout; - dst->previous_ride = src->previous_ride; - dst->previous_ride_time_out = src->previous_ride_time_out; - for (size_t i = 0; i < std::size(src->thoughts); i++) + dst->id = src->Id; + dst->cash_in_pocket = src->CashInPocket; + dst->cash_spent = src->CashSpent; + dst->time_in_park = src->TimeInPark; + dst->rejoin_queue_timeout = src->RejoinQueueTimeout; + dst->previous_ride = src->PreviousRide; + dst->previous_ride_time_out = src->PreviousRideTimeOut; + for (size_t i = 0; i < std::size(src->Thoughts); i++) { - auto srcThought = &src->thoughts[i]; + auto srcThought = &src->Thoughts[i]; auto dstThought = &dst->thoughts[i]; dstThought->type = static_cast(srcThought->type); dstThought->item = srcThought->item; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 56b91bb27c..fc193f0c54 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1448,25 +1448,25 @@ public: dst->action = static_cast(src->action); dst->action_frame = src->action_frame; dst->step_progress = src->step_progress; - dst->next_in_queue = src->next_in_queue; - dst->direction = src->direction; - dst->interaction_ride_index = src->interaction_ride_index; - dst->time_in_queue = src->time_in_queue; + dst->GuestNextInQueue = src->next_in_queue; + dst->PeepDirection = src->direction; + dst->InteractionRideIndex = src->interaction_ride_index; + dst->TimeInQueue = src->time_in_queue; for (size_t i = 0; i < std::size(src->rides_been_on); i++) { - dst->rides_been_on[i] = src->rides_been_on[i]; + dst->RidesBeenOn[i] = src->rides_been_on[i]; } - dst->id = src->id; - dst->cash_in_pocket = src->cash_in_pocket; - dst->cash_spent = src->cash_spent; - dst->time_in_park = src->time_in_park; - dst->rejoin_queue_timeout = src->rejoin_queue_timeout; - dst->previous_ride = src->previous_ride; - dst->previous_ride_time_out = src->previous_ride_time_out; + dst->Id = src->id; + dst->CashInPocket = src->cash_in_pocket; + dst->CashSpent = src->cash_spent; + dst->TimeInPark = src->time_in_park; + dst->RejoinQueueTimeout = src->rejoin_queue_timeout; + dst->PreviousRide = src->previous_ride; + dst->PreviousRideTimeOut = src->previous_ride_time_out; for (size_t i = 0; i < std::size(src->thoughts); i++) { auto srcThought = &src->thoughts[i]; - auto dstThought = &dst->thoughts[i]; + auto dstThought = &dst->Thoughts[i]; dstThought->type = static_cast(srcThought->type); dstThought->item = srcThought->item; dstThought->freshness = srcThought->freshness; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index ac04e63da0..c4d5423990 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -309,7 +309,7 @@ Peep* Ride::GetQueueHeadGuest(StationIndex stationIndex) const uint16_t spriteIndex = stations[stationIndex].LastPeepInQueue; while ((peep = try_get_guest(spriteIndex)) != nullptr) { - spriteIndex = peep->next_in_queue; + spriteIndex = peep->GuestNextInQueue; result = peep; } return result; @@ -322,7 +322,7 @@ void Ride::UpdateQueueLength(StationIndex stationIndex) uint16_t spriteIndex = stations[stationIndex].LastPeepInQueue; while ((peep = try_get_guest(spriteIndex)) != nullptr) { - spriteIndex = peep->next_in_queue; + spriteIndex = peep->GuestNextInQueue; count++; } stations[stationIndex].QueueLength = count; @@ -333,7 +333,7 @@ void Ride::QueueInsertGuestAtFront(StationIndex stationIndex, Peep* peep) assert(stationIndex < MAX_STATIONS); assert(peep != nullptr); - peep->next_in_queue = SPRITE_INDEX_NULL; + peep->GuestNextInQueue = SPRITE_INDEX_NULL; Peep* queueHeadGuest = GetQueueHeadGuest(peep->current_ride_station); if (queueHeadGuest == nullptr) { @@ -341,7 +341,7 @@ void Ride::QueueInsertGuestAtFront(StationIndex stationIndex, Peep* peep) } else { - queueHeadGuest->next_in_queue = peep->sprite_index; + queueHeadGuest->GuestNextInQueue = peep->sprite_index; } UpdateQueueLength(peep->current_ride_station); } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 26b5537d4c..d84ec1d5ce 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -8959,7 +8959,7 @@ loc_6DC743: if (z == 2) { Peep* peep = GET_PEEP(vehicle->peep[0]); - if (peep->id & 7) + if (peep->Id & 7) { z = 7; } @@ -8967,7 +8967,7 @@ loc_6DC743: if (z == 6) { Peep* peep = GET_PEEP(vehicle->peep[0]); - if (peep->id & 7) + if (peep->Id & 7) { z = 8; } diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/ScEntity.hpp index d75a358c04..20c4e521cd 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/ScEntity.hpp @@ -626,7 +626,7 @@ namespace OpenRCT2::Scripting int32_t cash_get() const { auto peep = GetPeep(); - return peep != nullptr ? peep->cash_in_pocket : 0; + return peep != nullptr ? peep->CashInPocket : 0; } void cash_set(int32_t value) { @@ -634,7 +634,7 @@ namespace OpenRCT2::Scripting auto peep = GetPeep(); if (peep != nullptr) { - peep->cash_in_pocket = std::max(0, value); + peep->CashInPocket = std::max(0, value); } } }; @@ -642,8 +642,8 @@ namespace OpenRCT2::Scripting class ScStaff : public ScPeep { public: - ScStaff(uint16_t id) - : ScPeep(id) + ScStaff(uint16_t Id) + : ScPeep(Id) { } diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index f451cc4931..f4a038f17c 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -728,7 +728,7 @@ Peep* Park::GenerateGuest() peep->destination_y = (peep->y & 0xFFE0) + 16; peep->destination_tolerance = 5; - peep->direction = direction; + peep->PeepDirection = direction; peep->var_37 = 0; peep->state = PEEP_STATE_ENTERING_PARK; } diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index 48d2658a27..e2a5e3a35b 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -94,7 +94,7 @@ protected: // 'destination' which is a close position that they will walk towards in a straight line - in this case, one // tile away. Stepping the peep will move them towards their destination, and once they reach it, a new // destination will be picked, to try and get the peep towards the overall pathfinding goal. - peep->direction = moveDir; + peep->PeepDirection = moveDir; peep->destination_x = peep->x + CoordsDirectionDelta[moveDir].x; peep->destination_y = peep->y + CoordsDirectionDelta[moveDir].y; peep->destination_tolerance = 2; diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index bf63ebf776..89755338a9 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -115,7 +115,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds) // Insert a rich guest auto richGuest = gs->GetPark().GenerateGuest(); - richGuest->cash_in_pocket = 3000; + richGuest->CashInPocket = 3000; // Wait for rich guest to get in queue bool matched = updateUntil(*gs, 1000, [&]() { return richGuest->state == PEEP_STATE_QUEUING; }); @@ -123,7 +123,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds) // Insert poor guest auto poorGuest = gs->GetPark().GenerateGuest(); - poorGuest->cash_in_pocket = 5; + poorGuest->CashInPocket = 5; // Wait for poor guest to get in queue matched = updateUntil(*gs, 1000, [&]() { return poorGuest->state == PEEP_STATE_QUEUING; }); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index f0afa9b8f4..a684d2c0c1 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -205,27 +205,27 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(action); COMPARE_FIELD(action_frame); COMPARE_FIELD(step_progress); - COMPARE_FIELD(next_in_queue); - COMPARE_FIELD(maze_last_edge); - COMPARE_FIELD(interaction_ride_index); - COMPARE_FIELD(time_in_queue); + COMPARE_FIELD(GuestNextInQueue); + COMPARE_FIELD(MazeLastEdge); + COMPARE_FIELD(InteractionRideIndex); + COMPARE_FIELD(TimeInQueue); for (int i = 0; i < 32; i++) { - COMPARE_FIELD(rides_been_on[i]); + COMPARE_FIELD(RidesBeenOn[i]); } - COMPARE_FIELD(id); - COMPARE_FIELD(cash_in_pocket); - COMPARE_FIELD(cash_spent); - COMPARE_FIELD(time_in_park); - COMPARE_FIELD(rejoin_queue_timeout); - COMPARE_FIELD(previous_ride); - COMPARE_FIELD(previous_ride_time_out); + COMPARE_FIELD(Id); + COMPARE_FIELD(CashInPocket); + COMPARE_FIELD(CashSpent); + COMPARE_FIELD(TimeInPark); + COMPARE_FIELD(RejoinQueueTimeout); + COMPARE_FIELD(PreviousRide); + COMPARE_FIELD(PreviousRideTimeOut); for (int i = 0; i < PEEP_MAX_THOUGHTS; i++) { - COMPARE_FIELD(thoughts[i].type); - COMPARE_FIELD(thoughts[i].item); - COMPARE_FIELD(thoughts[i].freshness); - COMPARE_FIELD(thoughts[i].fresh_timeout); + COMPARE_FIELD(Thoughts[i].type); + COMPARE_FIELD(Thoughts[i].item); + COMPARE_FIELD(Thoughts[i].freshness); + COMPARE_FIELD(Thoughts[i].fresh_timeout); } COMPARE_FIELD(PathCheckOptimisation); COMPARE_FIELD(GuestHeadingToRideId);