diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index a1d8d0864e..92d0e1caa1 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -618,17 +618,17 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo* dpi, rc int32_t clip_x = 10, clip_y = 19; - if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_ENTERTAINER) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF && peep->StaffType == STAFF_TYPE_ENTERTAINER) { clip_y += 3; } - uint32_t image_id_base = g_peep_animation_entries[peep->sprite_type].sprite_animation->base_image; + uint32_t image_id_base = g_peep_animation_entries[peep->SpriteType].sprite_animation->base_image; image_id_base += w->frame_no & 0xFFFFFFFC; image_id_base++; uint32_t image_id = image_id_base; - image_id |= SPRITE_ID_PALETTE_COLOUR_2(peep->tshirt_colour, peep->trousers_colour); + image_id |= SPRITE_ID_PALETTE_COLOUR_2(peep->TshirtColour, peep->TrousersColour); gfx_draw_sprite(&cliped_dpi, image_id, clip_x, clip_y, 0); diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index ea1554b7d9..c5f38509a9 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -501,7 +501,7 @@ static constexpr const rct_size16 window_guest_page_sizes[][2] = { */ rct_window* window_guest_open(Peep* peep) { - if (peep->type == PEEP_TYPE_STAFF) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF) { return window_staff_open(peep); } @@ -822,7 +822,7 @@ void window_guest_viewport_init(rct_window* w) w->viewport_focus_coordinates.z = focus.coordinate.z; w->viewport_focus_coordinates.rotation = focus.coordinate.rotation; - if (peep->state != PEEP_STATE_PICKED && w->viewport == nullptr) + if (peep->State != PEEP_STATE_PICKED && w->viewport == nullptr) { auto view_widget = &w->widgets[WIDX_VIEWPORT]; auto screenPos = ScreenCoordsXY{ view_widget->left + 1 + w->windowPos.x, view_widget->top + 1 + w->windowPos.y }; @@ -873,10 +873,10 @@ static void window_guest_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dp Peep* peep = GET_PEEP(w->number); - if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_ENTERTAINER) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF && peep->StaffType == STAFF_TYPE_ENTERTAINER) y++; - int32_t animationFrame = g_peep_animation_entries[peep->sprite_type].sprite_animation->base_image + 1; + int32_t animationFrame = g_peep_animation_entries[peep->SpriteType].sprite_animation->base_image + 1; int32_t animationFrameOffset = 0; @@ -887,7 +887,7 @@ static void window_guest_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dp } animationFrame += animationFrameOffset; - int32_t sprite_id = animationFrame | SPRITE_ID_PALETTE_COLOUR_2(peep->tshirt_colour, peep->trousers_colour); + int32_t sprite_id = animationFrame | SPRITE_ID_PALETTE_COLOUR_2(peep->TshirtColour, peep->TrousersColour); gfx_draw_sprite(&clip_dpi, sprite_id, x, y, 0); // If holding a balloon @@ -1261,10 +1261,10 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde Peep* peep; peep = GET_PEEP(w->number); - uint32_t imageId = g_peep_animation_entries[peep->sprite_type].sprite_animation[PEEP_ACTION_SPRITE_TYPE_UI].base_image; + uint32_t imageId = g_peep_animation_entries[peep->SpriteType].sprite_animation[PEEP_ACTION_SPRITE_TYPE_UI].base_image; imageId += w->picked_peep_frame >> 2; - imageId |= (peep->tshirt_colour << 19) | (peep->trousers_colour << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS; + imageId |= (peep->TshirtColour << 19) | (peep->TrousersColour << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS; gPickupPeepImage = imageId; } @@ -1807,8 +1807,8 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi) y += LIST_ROW_HEIGHT; ft = Formatter::Common(); ft.Add(peep->PaidOnRides); - ft.Add(peep->no_of_rides); - if (peep->no_of_rides != 1) + ft.Add(peep->GuestNumRides); + if (peep->GuestNumRides != 1) { gfx_draw_string_left(dpi, STR_GUEST_EXPENSES_RIDE_PLURAL, gCommonFormatArgs, COLOUR_BLACK, x, y); } @@ -2012,7 +2012,7 @@ static rct_string_id window_guest_inventory_format_item(Peep* peep, int32_t item break; case SHOP_ITEM_TSHIRT: ft.Rewind(); - ft.Add(SPRITE_ID_PALETTE_COLOUR_1(peep->tshirt_colour) | ShopItems[item].Image); + ft.Add(SPRITE_ID_PALETTE_COLOUR_1(peep->TshirtColour) | ShopItems[item].Image); break; case SHOP_ITEM_PHOTO2: ride = get_ride(peep->Photo2RideRef); @@ -2138,7 +2138,7 @@ void window_guest_debug_paint(rct_window* w, rct_drawpixelinfo* dpi) } screenCoords.y += LIST_ROW_HEIGHT; { - int32_t args[] = { peep->destination_x, peep->destination_y, peep->destination_tolerance }; + int32_t args[] = { peep->DestinationX, peep->DestinationY, peep->DestinationTolerance }; gfx_draw_string_left(dpi, STR_PEEP_DEBUG_DEST, args, 0, screenCoords.x, screenCoords.y); } screenCoords.y += LIST_ROW_HEIGHT; diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index bb3b4a9370..96cb1065ad 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -253,7 +253,7 @@ void window_guest_list_refresh_list() FOR_ALL_GUESTS (spriteIndex, peep) { sprite_set_flashing(peep, false); - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) continue; if (_window_guest_list_selected_filter != -1) { @@ -949,13 +949,13 @@ static void window_guest_list_find_groups() // Set all guests to unassigned FOR_ALL_GUESTS (spriteIndex, peep) - if (peep->outside_of_park == 0) + if (peep->OutsideOfPark == 0) peep->flags |= SPRITE_FLAGS_PEEP_VISIBLE; // For each guest / group FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0 || !(peep->flags & SPRITE_FLAGS_PEEP_VISIBLE)) + if (peep->OutsideOfPark != 0 || !(peep->flags & SPRITE_FLAGS_PEEP_VISIBLE)) continue; // New group, cap at 240 though @@ -978,7 +978,7 @@ static void window_guest_list_find_groups() // Find more peeps that belong to same group FOR_ALL_GUESTS (spriteIndex2, peep2) { - if (peep2->outside_of_park != 0 || !(peep2->flags & SPRITE_FLAGS_PEEP_VISIBLE)) + if (peep2->OutsideOfPark != 0 || !(peep2->flags & SPRITE_FLAGS_PEEP_VISIBLE)) continue; // Get and check if in same group diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index ae5698dd75..486487dfa7 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1075,7 +1075,7 @@ static void window_map_paint_peep_overlay(rct_drawpixelinfo* dpi) if (sprite_get_flashing(peep)) { - if (peep->type == PEEP_TYPE_STAFF) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF) { if ((gWindowMapFlashingFlags & (1 << 3)) != 0) { diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 929030a64c..f10bfa6145 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -336,10 +336,10 @@ static void window_news_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32 // If normal peep set sprite to normal (no food) // If staff set sprite to staff sprite int32_t sprite_type = 0; - if (peep->type == PEEP_TYPE_STAFF) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF) { - sprite_type = peep->sprite_type; - if (peep->staff_type == STAFF_TYPE_ENTERTAINER) + sprite_type = peep->SpriteType; + if (peep->StaffType == STAFF_TYPE_ENTERTAINER) { clip_y += 3; } @@ -347,7 +347,7 @@ static void window_news_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32 uint32_t image_id = g_peep_animation_entries[sprite_type].sprite_animation->base_image; image_id += 0xA0000001; - image_id |= (peep->tshirt_colour << 19) | (peep->trousers_colour << 24); + image_id |= (peep->TshirtColour << 19) | (peep->TrousersColour << 24); gfx_draw_sprite(&cliped_dpi, image_id, clip_x, clip_y, 0); break; diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index e31f24798c..65fef9339b 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -4352,7 +4352,7 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi) Peep* peep; FOR_ALL_STAFF (spriteIndex, peep) { - if (peep->staff_type == STAFF_TYPE_MECHANIC) + if (peep->StaffType == STAFF_TYPE_MECHANIC) { stringId = STR_CALLING_MECHANIC; break; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index b09b77409e..5ae48eec3a 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -336,7 +336,7 @@ rct_window* window_staff_open(Peep* peep) window_staff_disable_widgets(w); window_init_scroll_widgets(w); window_staff_viewport_init(w); - if (get_sprite(w->number)->peep.state == PEEP_STATE_PICKED) + if (get_sprite(w->number)->peep.State == PEEP_STATE_PICKED) window_event_mouse_up_call(w, WIDX_CHECKBOX_3); return w; @@ -351,7 +351,7 @@ void window_staff_disable_widgets(rct_window* w) Peep* peep = &get_sprite(w->number)->peep; uint64_t disabled_widgets = (1 << WIDX_TAB_4); - if (peep->staff_type == STAFF_TYPE_SECURITY) + if (peep->StaffType == STAFF_TYPE_SECURITY) { disabled_widgets |= (1 << WIDX_TAB_2); } @@ -810,7 +810,7 @@ void window_staff_options_invalidate(rct_window* w) peep->FormatNameTo(gCommonFormatArgs); - switch (peep->staff_type) + switch (peep->StaffType) { case STAFF_TYPE_ENTERTAINER: window_staff_options_widgets[WIDX_CHECKBOX_1].type = WWT_EMPTY; @@ -819,7 +819,7 @@ void window_staff_options_invalidate(rct_window* w) window_staff_options_widgets[WIDX_CHECKBOX_4].type = WWT_EMPTY; window_staff_options_widgets[WIDX_COSTUME_BOX].type = WWT_DROPDOWN; window_staff_options_widgets[WIDX_COSTUME_BTN].type = WWT_BUTTON; - window_staff_options_widgets[WIDX_COSTUME_BOX].text = StaffCostumeNames[peep->sprite_type - 4]; + window_staff_options_widgets[WIDX_COSTUME_BOX].text = StaffCostumeNames[peep->SpriteType - 4]; break; case STAFF_TYPE_HANDYMAN: window_staff_options_widgets[WIDX_CHECKBOX_1].type = WWT_CHECKBOX; @@ -1027,10 +1027,10 @@ void window_staff_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dpi) Peep* peep = GET_PEEP(w->number); - if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_ENTERTAINER) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF && peep->StaffType == STAFF_TYPE_ENTERTAINER) y++; - int32_t ebx = g_peep_animation_entries[peep->sprite_type].sprite_animation->base_image + 1; + int32_t ebx = g_peep_animation_entries[peep->SpriteType].sprite_animation->base_image + 1; int32_t eax = 0; @@ -1041,7 +1041,7 @@ void window_staff_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dpi) } ebx += eax; - int32_t sprite_id = ebx | SPRITE_ID_PALETTE_COLOUR_2(peep->tshirt_colour, peep->trousers_colour); + int32_t sprite_id = ebx | SPRITE_ID_PALETTE_COLOUR_2(peep->TshirtColour, peep->TrousersColour); gfx_draw_sprite(&clip_dpi, sprite_id, x, y, 0); // If holding a balloon @@ -1099,7 +1099,7 @@ void window_staff_stats_paint(rct_window* w, rct_drawpixelinfo* dpi) if (!(gParkFlags & PARK_FLAGS_NO_MONEY)) { - Formatter::Common().Add(gStaffWageTable[peep->staff_type]); + Formatter::Common().Add(gStaffWageTable[peep->StaffType]); gfx_draw_string_left(dpi, STR_STAFF_STAT_WAGES, gCommonFormatArgs, COLOUR_BLACK, x, y); y += LIST_ROW_HEIGHT; } @@ -1107,7 +1107,7 @@ void window_staff_stats_paint(rct_window* w, rct_drawpixelinfo* dpi) 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) + switch (peep->StaffType) { case STAFF_TYPE_HANDYMAN: gfx_draw_string_left(dpi, STR_STAFF_STAT_LAWNS_MOWN, static_cast(&peep->StaffLawnsMown), COLOUR_BLACK, x, y); @@ -1174,10 +1174,10 @@ void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetInde Peep* peep; peep = GET_PEEP(w->number); - uint32_t imageId = g_peep_animation_entries[peep->sprite_type].sprite_animation[PEEP_ACTION_SPRITE_TYPE_UI].base_image; + uint32_t imageId = g_peep_animation_entries[peep->SpriteType].sprite_animation[PEEP_ACTION_SPRITE_TYPE_UI].base_image; imageId += w->picked_peep_frame >> 2; - imageId |= (peep->tshirt_colour << 19) | (peep->trousers_colour << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS; + imageId |= (peep->TshirtColour << 19) | (peep->TrousersColour << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS; gPickupPeepImage = imageId; } @@ -1218,7 +1218,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex, return; Peep& peep = sprite->peep; - if (peep.type != PEEP_TYPE_STAFF) + if (peep.AssignedPeepType != PEEP_TYPE_STAFF) return; auto staff = peep.AsStaff(); @@ -1259,7 +1259,7 @@ void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex, return; Peep& peep = sprite->peep; - if (peep.type != PEEP_TYPE_STAFF) + if (peep.AssignedPeepType != PEEP_TYPE_STAFF) return; bool patrolAreaValue = peep.AsStaff()->IsPatrolAreaSet(destCoords); @@ -1336,7 +1336,7 @@ void window_staff_viewport_init(rct_window* w) Peep* peep = GET_PEEP(w->number); - if (peep->state == PEEP_STATE_PICKED) + if (peep->State == PEEP_STATE_PICKED) { focus.sprite_id = SPRITE_INDEX_NULL; } @@ -1372,7 +1372,7 @@ void window_staff_viewport_init(rct_window* w) w->viewport_focus_sprite.type = focus.type; w->viewport_focus_sprite.rotation = focus.rotation; - if (peep->state != PEEP_STATE_PICKED) + if (peep->State != PEEP_STATE_PICKED) { if (!(w->viewport)) { @@ -1414,7 +1414,7 @@ void window_staff_options_mousedown(rct_window* w, rct_widgetindex widgetIndex, for (int32_t i = 0; i < numCostumes; i++) { uint8_t costume = _availableCostumes[i]; - if (peep->sprite_type == PEEP_SPRITE_TYPE_ENTERTAINER_PANDA + costume) + if (peep->SpriteType == PEEP_SPRITE_TYPE_ENTERTAINER_PANDA + costume) { checkedIndex = i; } diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index e9ee701343..8c3da9fc06 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -193,7 +193,7 @@ void WindowStaffListRefresh() FOR_ALL_STAFF (spriteIndex, peep) { sprite_set_flashing(peep, false); - if (peep->staff_type != _windowStaffListSelectedTab) + if (peep->StaffType != _windowStaffListSelectedTab) continue; sprite_set_flashing(peep, true); @@ -345,7 +345,7 @@ void window_staff_list_update(rct_window* w) { sprite_set_flashing(peep, false); - if (peep->staff_type == _windowStaffListSelectedTab) + if (peep->StaffType == _windowStaffListSelectedTab) { sprite_set_flashing(peep, true); } @@ -381,7 +381,7 @@ static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetInde int32_t closestPeepDistance = std::numeric_limits::max(); FOR_ALL_STAFF (spriteIndex, peep) { - if (peep->staff_type != selectedPeepType) + if (peep->StaffType != selectedPeepType) continue; if (isPatrolAreaSet) @@ -713,7 +713,7 @@ void window_staff_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_ } auto staffOrderIcon_x = nameColumnSize + 20; - if (peep->staff_type != 3) + if (peep->StaffType != 3) { auto staffOrders = peep->StaffOrders; auto staffOrderSprite = staffOrderBaseSprites[_windowStaffListSelectedTab]; @@ -732,7 +732,7 @@ void window_staff_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_ } else { - gfx_draw_sprite(dpi, staffCostumeSprites[peep->sprite_type - 4], staffOrderIcon_x, y, 0); + gfx_draw_sprite(dpi, staffCostumeSprites[peep->SpriteType - 4], staffOrderIcon_x, y, 0); } } diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index c17aad3e4a..8c482e8942 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -437,7 +437,7 @@ void game_fix_save_vars() uint32_t peepCount = 0; FOR_ALL_GUESTS (spriteIndex, peep) { - if (!peep->outside_of_park) + if (!peep->OutsideOfPark) peepCount++; } diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 747d1de3e6..ad32ad9fad 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -214,18 +214,18 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, NextLoc.x); COMPARE_FIELD(Peep, NextLoc.y); COMPARE_FIELD(Peep, NextLoc.z); - COMPARE_FIELD(Peep, next_flags); - COMPARE_FIELD(Peep, outside_of_park); - COMPARE_FIELD(Peep, state); - COMPARE_FIELD(Peep, sub_state); - COMPARE_FIELD(Peep, sprite_type); - COMPARE_FIELD(Peep, type); - COMPARE_FIELD(Peep, no_of_rides); - COMPARE_FIELD(Peep, tshirt_colour); - COMPARE_FIELD(Peep, trousers_colour); - COMPARE_FIELD(Peep, destination_x); - COMPARE_FIELD(Peep, destination_y); - COMPARE_FIELD(Peep, destination_tolerance); + COMPARE_FIELD(Peep, NextFlags); + COMPARE_FIELD(Peep, OutsideOfPark); + COMPARE_FIELD(Peep, State); + COMPARE_FIELD(Peep, SubState); + COMPARE_FIELD(Peep, SpriteType); + COMPARE_FIELD(Peep, AssignedPeepType); + COMPARE_FIELD(Peep, GuestNumRides); + COMPARE_FIELD(Peep, TshirtColour); + COMPARE_FIELD(Peep, TrousersColour); + COMPARE_FIELD(Peep, DestinationX); + COMPARE_FIELD(Peep, DestinationY); + COMPARE_FIELD(Peep, DestinationTolerance); COMPARE_FIELD(Peep, Var37); COMPARE_FIELD(Peep, Energy); COMPARE_FIELD(Peep, EnergyTarget); diff --git a/src/openrct2/actions/GuestSetNameAction.hpp b/src/openrct2/actions/GuestSetNameAction.hpp index fbf295849e..dbc88875d0 100644 --- a/src/openrct2/actions/GuestSetNameAction.hpp +++ b/src/openrct2/actions/GuestSetNameAction.hpp @@ -73,7 +73,7 @@ public: } auto peep = GET_PEEP(_spriteIndex); - if (peep->type != PEEP_TYPE_GUEST) + if (peep->AssignedPeepType != PEEP_TYPE_GUEST) { log_warning("Invalid game command for sprite %u", _spriteIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_CANT_NAME_GUEST, STR_NONE); @@ -85,7 +85,7 @@ public: GameActionResult::Ptr Execute() const override { auto peep = GET_PEEP(_spriteIndex); - if (peep->type != PEEP_TYPE_GUEST) + if (peep->AssignedPeepType != PEEP_TYPE_GUEST) { log_warning("Invalid game command for sprite %u", _spriteIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_CANT_NAME_GUEST, STR_NONE); diff --git a/src/openrct2/actions/RideDemolishAction.hpp b/src/openrct2/actions/RideDemolishAction.hpp index 6f4dc1bb64..156d0508be 100644 --- a/src/openrct2/actions/RideDemolishAction.hpp +++ b/src/openrct2/actions/RideDemolishAction.hpp @@ -162,7 +162,7 @@ private: // clear ride from potentially being in RidesBeenOn peep->RidesBeenOn[ride_id_offset] &= ~(1 << ride_id_bit); - if (peep->state == PEEP_STATE_WATCHING) + if (peep->State == PEEP_STATE_WATCHING) { if (peep->CurrentRide == _rideIndex) { diff --git a/src/openrct2/actions/SetCheatAction.hpp b/src/openrct2/actions/SetCheatAction.hpp index 9ac2260a9b..f20a22cb31 100644 --- a/src/openrct2/actions/SetCheatAction.hpp +++ b/src/openrct2/actions/SetCheatAction.hpp @@ -703,7 +703,7 @@ private: { auto peep = GET_PEEP(spriteIndex); spriteIndex = peep->next; - if (peep->type == PEEP_TYPE_GUEST) + if (peep->AssignedPeepType == PEEP_TYPE_GUEST) { peep->Remove(); } diff --git a/src/openrct2/actions/StaffFireAction.hpp b/src/openrct2/actions/StaffFireAction.hpp index 49e1f70f05..e8385c39bb 100644 --- a/src/openrct2/actions/StaffFireAction.hpp +++ b/src/openrct2/actions/StaffFireAction.hpp @@ -48,7 +48,7 @@ public: } auto peep = GET_PEEP(_spriteId); - if (peep == nullptr || peep->sprite_identifier != SPRITE_IDENTIFIER_PEEP || peep->type != PEEP_TYPE_STAFF) + if (peep == nullptr || peep->sprite_identifier != SPRITE_IDENTIFIER_PEEP || peep->AssignedPeepType != PEEP_TYPE_STAFF) { log_error("Invalid spriteId. spriteId = %u", _spriteId); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE); @@ -60,7 +60,7 @@ public: GameActionResult::Ptr Execute() const override { auto peep = GET_PEEP(_spriteId); - if (peep == nullptr || peep->sprite_identifier != SPRITE_IDENTIFIER_PEEP || peep->type != PEEP_TYPE_STAFF) + if (peep == nullptr || peep->sprite_identifier != SPRITE_IDENTIFIER_PEEP || peep->AssignedPeepType != PEEP_TYPE_STAFF) { log_error("Invalid spriteId. spriteId = %u", _spriteId); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE); diff --git a/src/openrct2/actions/StaffHireNewAction.hpp b/src/openrct2/actions/StaffHireNewAction.hpp index 6315a5eb62..74274f8e4d 100644 --- a/src/openrct2/actions/StaffHireNewAction.hpp +++ b/src/openrct2/actions/StaffHireNewAction.hpp @@ -166,8 +166,8 @@ private: newPeep->WalkingFrameNum = 0; newPeep->ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_NONE; newPeep->PathCheckOptimisation = 0; - newPeep->type = PEEP_TYPE_STAFF; - newPeep->outside_of_park = 0; + newPeep->AssignedPeepType = PEEP_TYPE_STAFF; + newPeep->OutsideOfPark = 0; newPeep->PeepFlags = 0; newPeep->PaidToEnter = 0; newPeep->PaidOnRides = 0; @@ -188,7 +188,7 @@ private: FOR_ALL_STAFF (idSearchSpriteIndex, idSearchPeep) { - if (idSearchPeep->staff_type != _staffType) + if (idSearchPeep->StaffType != _staffType) continue; if (idSearchPeep->Id == newStaffId) @@ -203,15 +203,15 @@ private: } newPeep->Id = newStaffId; - newPeep->staff_type = _staffType; + newPeep->StaffType = _staffType; PeepSpriteType spriteType = spriteTypes[_staffType]; if (_staffType == STAFF_TYPE_ENTERTAINER) { spriteType = static_cast(PEEP_SPRITE_TYPE_ENTERTAINER_PANDA + _entertainerType); } - newPeep->name = nullptr; - newPeep->sprite_type = spriteType; + newPeep->Name = nullptr; + newPeep->SpriteType = spriteType; const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[spriteType].sprite_bounds; newPeep->sprite_width = spriteBounds->sprite_width; @@ -225,7 +225,7 @@ private: else { // NOTE: This state is required for the window to act. - newPeep->state = PEEP_STATE_PICKED; + newPeep->State = PEEP_STATE_PICKED; newPeep->MoveTo({ newPeep->x, newPeep->y, newPeep->z }); } @@ -238,8 +238,8 @@ private: newPeep->PathfindGoal.direction = INVALID_DIRECTION; uint8_t colour = staff_get_colour(_staffType); - newPeep->tshirt_colour = colour; - newPeep->trousers_colour = colour; + newPeep->TshirtColour = colour; + newPeep->TrousersColour = colour; // Staff energy determines their walking speed newPeep->Energy = 0x60; @@ -265,7 +265,7 @@ private: { // Find a location to place new staff member - newPeep->state = PEEP_STATE_FALLING; + newPeep->State = PEEP_STATE_FALLING; int16_t x, y, z; uint32_t count = 0; @@ -276,7 +276,7 @@ private: // Count number of walking guests FOR_ALL_GUESTS (sprite_index, guest) { - if (guest->state == PEEP_STATE_WALKING) + if (guest->State == PEEP_STATE_WALKING) { // Check the walking guest's tile. Only count them if they're on a path tile. guest_tile = map_get_path_element_at(TileCoordsXYZ{ guest->NextLoc }); @@ -291,7 +291,7 @@ private: uint32_t rand = scenario_rand_max(count); FOR_ALL_GUESTS (sprite_index, guest) { - if (guest->state == PEEP_STATE_WALKING) + if (guest->State == PEEP_STATE_WALKING) { guest_tile = map_get_path_element_at(TileCoordsXYZ{ guest->NextLoc }); if (guest_tile != nullptr) @@ -324,7 +324,7 @@ private: else { // User must pick a location - newPeep->state = PEEP_STATE_PICKED; + newPeep->State = PEEP_STATE_PICKED; x = newPeep->x; y = newPeep->y; z = newPeep->z; diff --git a/src/openrct2/actions/StaffSetColourAction.hpp b/src/openrct2/actions/StaffSetColourAction.hpp index b47214dc6b..185321cd23 100644 --- a/src/openrct2/actions/StaffSetColourAction.hpp +++ b/src/openrct2/actions/StaffSetColourAction.hpp @@ -69,10 +69,10 @@ public: Peep* peep; FOR_ALL_STAFF (spriteIndex, peep) { - if (peep->staff_type == _staffType) + if (peep->StaffType == _staffType) { - peep->tshirt_colour = _colour; - peep->trousers_colour = _colour; + peep->TshirtColour = _colour; + peep->TrousersColour = _colour; } } diff --git a/src/openrct2/actions/StaffSetCostumeAction.hpp b/src/openrct2/actions/StaffSetCostumeAction.hpp index b0c5f03226..0bde45e752 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.hpp +++ b/src/openrct2/actions/StaffSetCostumeAction.hpp @@ -74,7 +74,7 @@ public: } Peep* peep = GET_PEEP(_spriteIndex); - if (peep->type != PEEP_TYPE_STAFF || peep->staff_type != STAFF_TYPE_ENTERTAINER) + if (peep->AssignedPeepType != PEEP_TYPE_STAFF || peep->StaffType != STAFF_TYPE_ENTERTAINER) { log_warning("Invalid game command for sprite %u", _spriteIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); @@ -94,7 +94,7 @@ public: Peep* peep = GET_PEEP(_spriteIndex); auto spriteType = static_cast(_costume + 4); - peep->sprite_type = spriteType; + peep->SpriteType = spriteType; peep->PeepFlags &= ~PEEP_FLAGS_SLOW_WALK; if (peep_slow_walking_types[spriteType]) { diff --git a/src/openrct2/actions/StaffSetNameAction.hpp b/src/openrct2/actions/StaffSetNameAction.hpp index 55791ea27f..cacd89572e 100644 --- a/src/openrct2/actions/StaffSetNameAction.hpp +++ b/src/openrct2/actions/StaffSetNameAction.hpp @@ -59,7 +59,7 @@ public: } auto peep = GET_PEEP(_spriteIndex); - if (peep->type != PEEP_TYPE_STAFF) + if (peep->AssignedPeepType != PEEP_TYPE_STAFF) { log_warning("Invalid game command for sprite %u", _spriteIndex); return std::make_unique( @@ -72,7 +72,7 @@ public: GameActionResult::Ptr Execute() const override { auto peep = GET_PEEP(_spriteIndex); - if (peep->type != PEEP_TYPE_STAFF) + if (peep->AssignedPeepType != PEEP_TYPE_STAFF) { log_warning("Invalid game command for sprite %u", _spriteIndex); return std::make_unique( diff --git a/src/openrct2/actions/StaffSetOrdersAction.hpp b/src/openrct2/actions/StaffSetOrdersAction.hpp index 38e811fbf6..9d741464a4 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.hpp +++ b/src/openrct2/actions/StaffSetOrdersAction.hpp @@ -54,8 +54,8 @@ public: } Peep* peep = GET_PEEP(_spriteIndex); - if (peep->type != PEEP_TYPE_STAFF - || (peep->staff_type != STAFF_TYPE_HANDYMAN && peep->staff_type != STAFF_TYPE_MECHANIC)) + if (peep->AssignedPeepType != PEEP_TYPE_STAFF + || (peep->StaffType != STAFF_TYPE_HANDYMAN && peep->StaffType != STAFF_TYPE_MECHANIC)) { log_warning("Invalid game command for sprite %u", _spriteIndex); return std::make_unique(GA_ERROR::INVALID_PARAMETERS, STR_NONE); diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.hpp b/src/openrct2/actions/StaffSetPatrolAreaAction.hpp index 22d113461e..6a80804e6b 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.hpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.hpp @@ -51,7 +51,7 @@ public: } auto peep = GET_PEEP(_spriteId); - if (peep == nullptr || peep->sprite_identifier != SPRITE_IDENTIFIER_PEEP || peep->type != PEEP_TYPE_STAFF) + if (peep == nullptr || peep->sprite_identifier != SPRITE_IDENTIFIER_PEEP || peep->AssignedPeepType != PEEP_TYPE_STAFF) { log_error("Invalid spriteId. spriteId = %u", _spriteId); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE); @@ -63,7 +63,7 @@ public: GameActionResult::Ptr Execute() const override { auto peep = GET_PEEP(_spriteId); - if (peep == nullptr || peep->sprite_identifier != SPRITE_IDENTIFIER_PEEP || peep->type != PEEP_TYPE_STAFF) + if (peep == nullptr || peep->sprite_identifier != SPRITE_IDENTIFIER_PEEP || peep->AssignedPeepType != PEEP_TYPE_STAFF) { log_error("Invalid spriteId. spriteId = %u", _spriteId); return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE); diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 9a62689da3..ce248e84ed 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -443,7 +443,7 @@ static int32_t cc_staff(InteractiveConsole& console, const arguments_t& argv) { auto name = peep->GetName(); console.WriteFormatLine( - "staff id %03d type: %02u energy %03u name %s", i, peep->staff_type, peep->Energy, name.c_str()); + "staff id %03d type: %02u energy %03u name %s", i, peep->StaffType, peep->Energy, name.c_str()); } } else if (argv[0] == "set") @@ -491,8 +491,8 @@ static int32_t cc_staff(InteractiveConsole& console, const arguments_t& argv) return 1; } peep = GET_PEEP(int_val[0]); - bool is_entertainer = peep != nullptr && peep->type == PEEP_TYPE_STAFF - && peep->staff_type == STAFF_TYPE_ENTERTAINER; + bool is_entertainer = peep != nullptr && peep->AssignedPeepType == PEEP_TYPE_STAFF + && peep->StaffType == STAFF_TYPE_ENTERTAINER; if (!is_entertainer) { console.WriteLineError("Specified staff is not entertainer"); @@ -1595,7 +1595,7 @@ static int32_t cc_mp_desync(InteractiveConsole& console, const arguments_t& argv auto* peep = peeps[0]; if (peeps.size() > 1) peep = peeps[util_rand() % peeps.size() - 1]; - peep->tshirt_colour = util_rand() & 0xFF; + peep->TshirtColour = util_rand() & 0xFF; invalidate_sprite_0(peep); } break; diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 8a01d3edba..b9a20fd62f 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -647,9 +647,9 @@ void viewport_update_smart_sprite_follow(rct_window* window) { Peep* peep = GET_PEEP(window->viewport_smart_follow_sprite); - if (peep->type == PEEP_TYPE_GUEST) + if (peep->AssignedPeepType == PEEP_TYPE_GUEST) viewport_update_smart_guest_follow(window, peep); - else if (peep->type == PEEP_TYPE_STAFF) + else if (peep->AssignedPeepType == PEEP_TYPE_STAFF) viewport_update_smart_staff_follow(window, peep); } else if (sprite->generic.sprite_identifier == SPRITE_IDENTIFIER_VEHICLE) @@ -676,7 +676,7 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep focus.type = VIEWPORT_FOCUS_TYPE_SPRITE; focus.sprite.sprite_id = peep->sprite_index; - if (peep->state == PEEP_STATE_PICKED) + if (peep->State == PEEP_STATE_PICKED) { focus.sprite.sprite_id = SPRITE_INDEX_NULL; window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; @@ -686,8 +686,8 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep else { bool overallFocus = true; - if (peep->state == PEEP_STATE_ON_RIDE || peep->state == PEEP_STATE_ENTERING_RIDE - || (peep->state == PEEP_STATE_LEAVING_RIDE && peep->x == LOCATION_NULL)) + if (peep->State == PEEP_STATE_ON_RIDE || peep->State == PEEP_STATE_ENTERING_RIDE + || (peep->State == PEEP_STATE_LEAVING_RIDE && peep->x == LOCATION_NULL)) { auto ride = get_ride(peep->CurrentRide); if (ride != nullptr && (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) @@ -736,7 +736,7 @@ void viewport_update_smart_staff_follow(rct_window* window, Peep* peep) focus.sprite_id = window->viewport_smart_follow_sprite; - if (peep->state == PEEP_STATE_PICKED) + if (peep->State == PEEP_STATE_PICKED) { // focus.sprite.sprite_id = SPRITE_INDEX_NULL; window->viewport_smart_follow_sprite = SPRITE_INDEX_NULL; diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index 710855645d..18b0a0bed4 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -89,7 +89,7 @@ static bool award_is_deserved_most_untidy(int32_t activeAwardTypes) uint32_t negativeCount = 0; FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) continue; if (peep->Thoughts[0].freshness > 5) @@ -121,7 +121,7 @@ static bool award_is_deserved_most_tidy(int32_t activeAwardTypes) uint32_t negativeCount = 0; FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) continue; if (peep->Thoughts[0].freshness > 5) @@ -204,7 +204,7 @@ static bool award_is_deserved_most_beautiful(int32_t activeAwardTypes) uint32_t negativeCount = 0; FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) continue; if (peep->Thoughts[0].freshness > 5) @@ -249,7 +249,7 @@ static bool award_is_deserved_safest([[maybe_unused]] int32_t activeAwardTypes) auto peepsWhoDislikeVandalism = 0; FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) continue; if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_VANDALISM) peepsWhoDislikeVandalism++; @@ -286,10 +286,10 @@ static bool award_is_deserved_best_staff(int32_t activeAwardTypes) staffTypeFlags = 0; FOR_ALL_PEEPS (spriteIndex, peep) { - if (peep->type == PEEP_TYPE_STAFF) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF) { staffCount++; - staffTypeFlags |= (1 << peep->staff_type); + staffTypeFlags |= (1 << peep->StaffType); } else { @@ -337,7 +337,7 @@ static bool award_is_deserved_best_food(int32_t activeAwardTypes) Peep* peep; FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) continue; if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_HUNGRY) @@ -383,7 +383,7 @@ static bool award_is_deserved_worst_food(int32_t activeAwardTypes) Peep* peep; FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) continue; if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_HUNGRY) @@ -415,7 +415,7 @@ static bool award_is_deserved_best_restrooms([[maybe_unused]] int32_t activeAwar Peep* peep; FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) continue; if (peep->Thoughts[0].freshness <= 5 && peep->Thoughts[0].type == PEEP_THOUGHT_TYPE_TOILET) @@ -546,7 +546,7 @@ static bool award_is_deserved_most_confusing_layout([[maybe_unused]] int32_t act peepsLost = 0; FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) continue; peepsCounted++; diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index be802ad7eb..03e9759ac5 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -116,7 +116,7 @@ void finance_pay_wages() FOR_ALL_STAFF (spriteIndex, peep) { - finance_payment(gStaffWageTable[peep->staff_type] / 4, ExpenditureType::Wages); + finance_payment(gStaffWageTable[peep->StaffType] / 4, ExpenditureType::Wages); } } @@ -254,7 +254,7 @@ void finance_update_daily_profit() FOR_ALL_STAFF (sprite_index, peep) { - current_profit -= gStaffWageTable[peep->staff_type]; + current_profit -= gStaffWageTable[peep->StaffType]; } // Research costs diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index bf81323271..6660e48181 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -251,7 +251,7 @@ std::optional news_item_get_subject_location(int32_t type, int32_t su if (subjectLoc->x != LOCATION_NULL) break; - if (peep->state != PEEP_STATE_ON_RIDE && peep->state != PEEP_STATE_ENTERING_RIDE) + if (peep->State != PEEP_STATE_ON_RIDE && peep->State != PEEP_STATE_ENTERING_RIDE) { subjectLoc = std::nullopt; break; diff --git a/src/openrct2/paint/sprite/Paint.Peep.cpp b/src/openrct2/paint/sprite/Paint.Peep.cpp index c5d32343f6..f7bd5f4c01 100644 --- a/src/openrct2/paint/sprite/Paint.Peep.cpp +++ b/src/openrct2/paint/sprite/Paint.Peep.cpp @@ -24,7 +24,7 @@ void peep_paint(paint_session* session, const Peep* peep, int32_t imageDirection #ifdef __ENABLE_LIGHTFX__ if (lightfx_is_available()) { - if (peep->type == PEEP_TYPE_STAFF) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF) { int16_t peep_x, peep_y, peep_z; @@ -67,7 +67,7 @@ void peep_paint(paint_session* session, const Peep* peep, int32_t imageDirection return; } - rct_peep_animation_entry sprite = g_peep_animation_entries[peep->sprite_type]; + rct_peep_animation_entry sprite = g_peep_animation_entries[peep->SpriteType]; PeepActionSpriteType spriteType = peep->ActionSpriteType; uint8_t imageOffset = peep->ActionSpriteImageOffset; @@ -81,7 +81,7 @@ void peep_paint(paint_session* session, const Peep* peep, int32_t imageDirection // In the following 4 calls to sub_98197C/sub_98199C, we add 5 (instead of 3) to the // bound_box_offset_z to make sure peeps are drawn on top of railways uint32_t baseImageId = (imageDirection >> 3) + sprite.sprite_animation[spriteType].base_image + imageOffset * 4; - uint32_t imageId = baseImageId | peep->tshirt_colour << 19 | peep->trousers_colour << 24 | IMAGE_TYPE_REMAP + uint32_t imageId = baseImageId | peep->TshirtColour << 19 | peep->TrousersColour << 24 | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS; sub_98197C(session, imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 5); diff --git a/src/openrct2/paint/sprite/Paint.Sprite.cpp b/src/openrct2/paint/sprite/Paint.Sprite.cpp index 96bbb251f0..54e146164f 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.cpp +++ b/src/openrct2/paint/sprite/Paint.Sprite.cpp @@ -59,7 +59,7 @@ void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t if (spr->generic.Is()) { const Peep* peep = reinterpret_cast(spr); - if (!(peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_HANDYMAN)) + if (!(peep->AssignedPeepType == PEEP_TYPE_STAFF && peep->StaffType == STAFF_TYPE_HANDYMAN)) { continue; } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 982c3eb63f..b3e990a34b 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -906,7 +906,7 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile { patrolColour = COLOUR_GREY; } - staffType = staff->staff_type; + staffType = staff->StaffType; } if (staff_is_patrol_area_set_for_type(static_cast(staffType), session->MapPosition)) diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index e155c38358..b2df6cf8d6 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1089,7 +1089,7 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c { patrolColour = COLOUR_GREY; } - staffType = staff->staff_type; + staffType = staff->StaffType; } if (staff_is_patrol_area_set_for_type(static_cast(staffType), session->MapPosition)) diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index feb435b389..d60bd0a3e2 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -439,8 +439,8 @@ void Guest::ApplyEasterEggToNearbyGuests(easter_egg_function easter_egg) void Guest::GivePassingPeepsPurpleClothes(Guest* passingPeep) { - passingPeep->tshirt_colour = COLOUR_BRIGHT_PURPLE; - passingPeep->trousers_colour = COLOUR_BRIGHT_PURPLE; + passingPeep->TshirtColour = COLOUR_BRIGHT_PURPLE; + passingPeep->TrousersColour = COLOUR_BRIGHT_PURPLE; passingPeep->Invalidate(); } @@ -469,7 +469,7 @@ void Guest::MakePassingPeepsSick(Guest* passingPeep) { if (this == passingPeep) return; - if (passingPeep->state != PEEP_STATE_WALKING) + if (passingPeep->State != PEEP_STATE_WALKING) return; if (passingPeep->Action == PEEP_ACTION_NONE_1 || passingPeep->Action == PEEP_ACTION_NONE_2) @@ -710,7 +710,7 @@ void Guest::Tick128UpdateGuest(int32_t index) if (PeepFlags & PEEP_FLAGS_EXPLODE && x != LOCATION_NULL) { - if (state == PEEP_STATE_WALKING || state == PEEP_STATE_SITTING) + if (State == PEEP_STATE_WALKING || State == PEEP_STATE_SITTING) { audio_play_sound_at_location(SoundId::Crash, { x, y, z }); @@ -753,7 +753,7 @@ void Guest::Tick128UpdateGuest(int32_t index) if (Angriness != 0) Angriness--; - if (state == PEEP_STATE_WALKING || state == PEEP_STATE_SITTING) + if (State == PEEP_STATE_WALKING || State == PEEP_STATE_SITTING) { SurroundingsThoughtTimeout++; if (SurroundingsThoughtTimeout >= 18) @@ -774,7 +774,7 @@ void Guest::Tick128UpdateGuest(int32_t index) UpdateSpriteType(); - if (state == PEEP_STATE_ON_RIDE || state == PEEP_STATE_ENTERING_RIDE) + if (State == PEEP_STATE_ON_RIDE || State == PEEP_STATE_ENTERING_RIDE) { GuestTimeOnRide = std::min(255, GuestTimeOnRide + 1); @@ -802,7 +802,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 + if (State == PEEP_STATE_WALKING && OutsideOfPark == 0 && !(PeepFlags & PEEP_FLAGS_LEAVING_PARK) && GuestNumRides == 0 && GuestHeadingToRideId == RIDE_ID_NULL) { uint32_t time_duration = gScenarioTicks - TimeInPark; @@ -835,7 +835,7 @@ void Guest::Tick128UpdateGuest(int32_t index) * is executed to once every second time the encompassing * conditional executes. */ - if (outside_of_park == 0 && (state == PEEP_STATE_WALKING || state == PEEP_STATE_SITTING)) + if (OutsideOfPark == 0 && (State == PEEP_STATE_WALKING || State == PEEP_STATE_SITTING)) { uint8_t num_thoughts = 0; PeepThoughtType possible_thoughts[5]; @@ -923,7 +923,7 @@ void Guest::Tick128UpdateGuest(int32_t index) } } - switch (state) + switch (State) { case PEEP_STATE_WALKING: case PEEP_STATE_LEAVING_PARK: @@ -1002,7 +1002,7 @@ void Guest::Tick128UpdateGuest(int32_t index) peep_update_hunger(this); break; case PEEP_STATE_ENTERING_RIDE: - if (sub_state == 17 || sub_state == 15) + if (SubState == 17 || SubState == 15) { peep_decide_whether_to_leave_park(this); } @@ -1041,7 +1041,7 @@ void Guest::Tick128UpdateGuest(int32_t index) Toilet--; } - if (state == PEEP_STATE_WALKING && NauseaTarget >= 128) + if (State == PEEP_STATE_WALKING && NauseaTarget >= 128) { if ((scenario_rand() & 0xFF) <= static_cast((Nausea - 128) / 2)) { @@ -1064,7 +1064,7 @@ void Guest::Tick128UpdateGuest(int32_t index) TimeToConsume += 3; } - if (TimeToConsume != 0 && state != PEEP_STATE_ON_RIDE) + if (TimeToConsume != 0 && State != PEEP_STATE_ON_RIDE) { TimeToConsume = std::max(TimeToConsume - 3, 0); @@ -1204,9 +1204,9 @@ void Guest::TryGetUpFromSitting() SetState(PEEP_STATE_WALKING); // Set destination to the centre of the tile. - destination_x = (x & 0xFFE0) + 16; - destination_y = (y & 0xFFE0) + 16; - destination_tolerance = 5; + DestinationX = (x & 0xFFE0) + 16; + DestinationY = (y & 0xFFE0) + 16; + DestinationTolerance = 5; UpdateCurrentActionSpriteType(); } @@ -1216,7 +1216,7 @@ void Guest::TryGetUpFromSitting() */ void Guest::UpdateSitting() { - if (sub_state == PEEP_SITTING_TRYING_TO_SIT) + if (SubState == PEEP_SITTING_TRYING_TO_SIT) { if (!CheckForPath()) return; @@ -1236,12 +1236,12 @@ void Guest::UpdateSitting() NextActionSpriteType = PEEP_ACTION_SPRITE_TYPE_SITTING_IDLE; SwitchNextActionSpriteType(); - sub_state = PEEP_SITTING_SAT_DOWN; + SubState = PEEP_SITTING_SAT_DOWN; // Sets time to sit on seat TimeToSitdown = (129 - Energy) * 16 + 50; } - else if (sub_state == PEEP_SITTING_SAT_DOWN) + else if (SubState == PEEP_SITTING_SAT_DOWN) { if (Action < PEEP_ACTION_NONE_1) { @@ -1259,14 +1259,14 @@ void Guest::UpdateSitting() SetState(PEEP_STATE_WALKING); // Set destination to the centre of the tile - destination_x = (x & 0xFFE0) + 16; - destination_y = (y & 0xFFE0) + 16; - destination_tolerance = 5; + DestinationX = (x & 0xFFE0) + 16; + DestinationY = (y & 0xFFE0) + 16; + DestinationTolerance = 5; UpdateCurrentActionSpriteType(); return; } - if (sprite_type == PEEP_SPRITE_TYPE_UMBRELLA) + if (SpriteType == PEEP_SPRITE_TYPE_UMBRELLA) { TryGetUpFromSitting(); return; @@ -1292,7 +1292,7 @@ void Guest::UpdateSitting() TryGetUpFromSitting(); return; } - if (sprite_type == PEEP_SPRITE_TYPE_BALLOON || sprite_type == PEEP_SPRITE_TYPE_HAT) + if (SpriteType == PEEP_SPRITE_TYPE_BALLOON || SpriteType == PEEP_SPRITE_TYPE_HAT) { TryGetUpFromSitting(); return; @@ -1541,7 +1541,7 @@ bool Guest::DecideAndBuyItem(Ride* ride, int32_t shopItem, money32 price) { if (((scenario_rand() & 0x7F) + 0x73) > Happiness) return false; - else if (no_of_rides < 3) + else if (GuestNumRides < 3) return false; } @@ -1652,7 +1652,7 @@ loc_69B221: ItemStandardFlags |= (1u << shopItem); if (shopItem == SHOP_ITEM_TSHIRT) - tshirt_colour = ride->track_colour[0].main; + TshirtColour = ride->track_colour[0].main; if (shopItem == SHOP_ITEM_HAT) HatColour = ride->track_colour[0].main; @@ -1767,8 +1767,8 @@ void Guest::OnEnterRide(ride_id_t rideIndex) ride_update_satisfaction(ride, rideSatisfaction); // Update various peep stats. - if (no_of_rides < 255) - no_of_rides++; + if (GuestNumRides < 255) + GuestNumRides++; SetHasRidden(ride); peep_update_favourite_ride(this, ride); @@ -1847,7 +1847,7 @@ bool Guest::HasFood() const */ void Guest::PickRideToGoOn() { - if (state != PEEP_STATE_WALKING) + if (State != PEEP_STATE_WALKING) return; if (GuestHeadingToRideId != RIDE_ID_NULL) return; @@ -2501,7 +2501,7 @@ static void peep_choose_seat_from_car(Peep* peep, Ride* ride, Vehicle* vehicle) vehicle->next_free_seat++; vehicle->peep[peep->CurrentSeat] = peep->sprite_index; - vehicle->peep_tshirt_colours[peep->CurrentSeat] = peep->tshirt_colour; + vehicle->peep_tshirt_colours[peep->CurrentSeat] = peep->TshirtColour; } /** @@ -2539,12 +2539,12 @@ void Guest::GoToRideEntrance(Ride* ride) location.x += x_shift; location.y += y_shift; - destination_x = location.x; - destination_y = location.y; - destination_tolerance = 2; + DestinationX = location.x; + DestinationY = location.y; + DestinationTolerance = 2; SetState(PEEP_STATE_ENTERING_RIDE); - sub_state = PEEP_RIDE_IN_ENTRANCE; + SubState = PEEP_RIDE_IN_ENTRANCE; RejoinQueueTimeout = 0; GuestTimeOnRide = 0; @@ -2624,7 +2624,7 @@ static void peep_update_ride_at_entrance_try_leave(Guest* peep) { // Destination Tolerance is zero when peep has completely // entered entrance - if (peep->destination_tolerance == 0) + if (peep->DestinationTolerance == 0) { peep->RemoveFromQueue(); peep->SetState(PEEP_STATE_FALLING); @@ -2888,7 +2888,7 @@ static bool peep_should_go_on_ride_again(Peep* peep, Ride* ride) uint8_t r = (scenario_rand() & 0xFF); if (r <= 128) { - if (peep->no_of_rides > 7) + if (peep->GuestNumRides > 7) return false; if (r > 64) return false; @@ -3074,7 +3074,7 @@ static void peep_decide_whether_to_leave_park(Peep* peep) peep->Thirst--; } - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) { return; } @@ -3141,7 +3141,7 @@ static void peep_leave_park(Peep* peep) template static void peep_head_for_nearest_ride(Guest* peep, bool considerOnlyCloseRides, T predicate) { - if (peep->state != PEEP_STATE_SITTING && peep->state != PEEP_STATE_WATCHING && peep->state != PEEP_STATE_WALKING) + if (peep->State != PEEP_STATE_SITTING && peep->State != PEEP_STATE_WATCHING && peep->State != PEEP_STATE_WALKING) { return; } @@ -3360,7 +3360,7 @@ void Guest::UpdateBuying() return; } - if (sub_state == 1) + if (SubState == 1) { if (Action != PEEP_ACTION_NONE_2) { @@ -3378,8 +3378,8 @@ void Guest::UpdateBuying() window_invalidate_by_number(WC_PEEP, sprite_index); } sprite_direction ^= 0x10; - destination_x = NextLoc.x + 16; - destination_y = NextLoc.y + 16; + DestinationX = NextLoc.x + 16; + DestinationY = NextLoc.y + 16; PeepDirection = direction_reverse(PeepDirection); SetState(PEEP_STATE_WALKING); @@ -3450,7 +3450,7 @@ void Guest::UpdateBuying() { ride_update_popularity(ride, 0); } - sub_state = 1; + SubState = 1; } /** @@ -3469,7 +3469,7 @@ void Guest::UpdateRideAtEntrance() // zero to indicate it is final decision time (try_leave will pass). // When a peep has to return to the queue without getting on a ride // this is the state it will return to. - if (destination_tolerance != 0) + if (DestinationTolerance != 0) { int16_t xy_distance; if (auto loc = UpdateAction(xy_distance)) @@ -3484,7 +3484,7 @@ void Guest::UpdateRideAtEntrance() } else { - destination_tolerance = 0; + DestinationTolerance = 0; sprite_direction ^= (1 << 4); Invalidate(); } @@ -3557,13 +3557,13 @@ static void peep_update_ride_leave_entrance_maze(Guest* peep, Ride* ride, Coords entrance_loc.x += _MazeEntranceStart[direction / 4].x; entrance_loc.y += _MazeEntranceStart[direction / 4].y; - peep->destination_x = entrance_loc.x; - peep->destination_y = entrance_loc.y; - peep->destination_tolerance = 3; + peep->DestinationX = entrance_loc.x; + peep->DestinationY = entrance_loc.y; + peep->DestinationTolerance = 3; ride->cur_num_customers++; peep->OnEnterRide(peep->CurrentRide); - peep->sub_state = PEEP_RIDE_MAZE_PATHFINDING; + peep->SubState = PEEP_RIDE_MAZE_PATHFINDING; } static void peep_update_ride_leave_entrance_spiral_slide(Guest* peep, Ride* ride, CoordsXYZD& entrance_loc) @@ -3578,13 +3578,13 @@ static void peep_update_ride_leave_entrance_spiral_slide(Guest* peep, Ride* ride entrance_loc += SpiralSlideWalkingPath[peep->Var37]; - peep->destination_x = entrance_loc.x; - peep->destination_y = entrance_loc.y; + peep->DestinationX = entrance_loc.x; + peep->DestinationY = entrance_loc.y; peep->CurrentCar = 0; ride->cur_num_customers++; peep->OnEnterRide(peep->CurrentRide); - peep->sub_state = PEEP_RIDE_APPROACH_SPIRAL_SLIDE; + peep->SubState = PEEP_RIDE_APPROACH_SPIRAL_SLIDE; } static uint8_t peep_get_waypointed_seat_location( @@ -3641,9 +3641,9 @@ static void peep_update_ride_leave_entrance_waypoints(Peep* peep, Ride* ride) waypoint.x += vehicle_type->peep_loading_waypoints[peep->Var37 / 4][0].x; waypoint.y += vehicle_type->peep_loading_waypoints[peep->Var37 / 4][0].y; - peep->destination_x = waypoint.x; - peep->destination_y = waypoint.y; - peep->sub_state = PEEP_RIDE_APPROACH_VEHICLE_WAYPOINTS; + peep->DestinationX = waypoint.x; + peep->DestinationY = waypoint.y; + peep->SubState = PEEP_RIDE_APPROACH_VEHICLE_WAYPOINTS; } /** @@ -3673,9 +3673,9 @@ void Guest::UpdateRideAdvanceThroughEntrance() } } - if (sub_state == PEEP_RIDE_IN_ENTRANCE && xy_distance < distanceThreshold) + if (SubState == PEEP_RIDE_IN_ENTRANCE && xy_distance < distanceThreshold) { - sub_state = PEEP_RIDE_FREE_VEHICLE_CHECK; + SubState = PEEP_RIDE_FREE_VEHICLE_CHECK; } actionZ = ride->stations[CurrentRideStation].GetBaseZ(); @@ -3690,7 +3690,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() return; } - Guard::Assert(sub_state == PEEP_RIDE_LEAVE_ENTRANCE, "Peep substate should be LEAVE_ENTRANCE"); + Guard::Assert(SubState == PEEP_RIDE_LEAVE_ENTRANCE, "Peep substate should be LEAVE_ENTRANCE"); if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES)) { auto entranceLocation = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXYZD(); @@ -3758,10 +3758,10 @@ void Guest::UpdateRideAdvanceThroughEntrance() if (vehicle_type->flags & VEHICLE_ENTRY_FLAG_DODGEM_CAR_PLACEMENT) { - destination_x = vehicle->x; - destination_y = vehicle->y; - destination_tolerance = 15; - sub_state = PEEP_RIDE_APPROACH_VEHICLE; + DestinationX = vehicle->x; + DestinationY = vehicle->y; + DestinationTolerance = 15; + SubState = PEEP_RIDE_APPROACH_VEHICLE; return; } @@ -3781,20 +3781,20 @@ void Guest::UpdateRideAdvanceThroughEntrance() switch (vehicle->sprite_direction / 8) { case 0: - destination_x = vehicle->x - load_position; + DestinationX = vehicle->x - load_position; break; case 1: - destination_y = vehicle->y + load_position; + DestinationY = vehicle->y + load_position; break; case 2: - destination_x = vehicle->x + load_position; + DestinationX = vehicle->x + load_position; break; case 3: - destination_y = vehicle->y - load_position; + DestinationY = vehicle->y - load_position; break; } - sub_state = PEEP_RIDE_APPROACH_VEHICLE; + SubState = PEEP_RIDE_APPROACH_VEHICLE; } /** @@ -3839,12 +3839,12 @@ static void peep_go_to_ride_exit(Peep* peep, Ride* ride, int16_t x, int16_t y, i x -= x_shift; y -= y_shift; - peep->destination_x = x; - peep->destination_y = y; - peep->destination_tolerance = 2; + peep->DestinationX = x; + peep->DestinationY = y; + peep->DestinationTolerance = 2; peep->sprite_direction = exit_direction * 8; - peep->sub_state = PEEP_RIDE_APPROACH_EXIT; + peep->SubState = PEEP_RIDE_APPROACH_EXIT; } /** @@ -3870,7 +3870,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride) } } - sub_state = PEEP_RIDE_LEAVE_ENTRANCE; + SubState = PEEP_RIDE_LEAVE_ENTRANCE; uint8_t queueTime = DaysInQueue; if (queueTime < 253) queueTime += 3; @@ -3920,12 +3920,12 @@ static void peep_update_ride_no_free_vehicle_rejoin_queue(Peep* peep, Ride* ride x += 16 - DirectionOffsets[entranceLocation.direction].x * 20; y += 16 - DirectionOffsets[entranceLocation.direction].y * 20; - peep->destination_x = x; - peep->destination_y = y; - peep->destination_tolerance = 2; + peep->DestinationX = x; + peep->DestinationY = y; + peep->DestinationTolerance = 2; peep->SetState(PEEP_STATE_QUEUING_FRONT); - peep->sub_state = PEEP_RIDE_AT_ENTRANCE; + peep->SubState = PEEP_RIDE_AT_ENTRANCE; ride->QueueInsertGuestAtFront(peep->CurrentRideStation, peep); } @@ -4041,7 +4041,7 @@ void Guest::UpdateRideApproachVehicle() MoveTo({ *loc, z }); return; } - sub_state = PEEP_RIDE_ENTER_VEHICLE; + SubState = PEEP_RIDE_ENTER_VEHICLE; } void Guest::UpdateRideEnterVehicle() @@ -4069,7 +4069,7 @@ void Guest::UpdateRideEnterVehicle() if (seatedPeep != nullptr) { auto* seatedPeepAsGuest = seatedPeep->AsGuest(); - if (seatedPeepAsGuest == nullptr || seatedPeepAsGuest->sub_state != PEEP_RIDE_ENTER_VEHICLE) + if (seatedPeepAsGuest == nullptr || seatedPeepAsGuest->SubState != PEEP_RIDE_ENTER_VEHICLE) return; vehicle->num_peeps++; @@ -4079,7 +4079,7 @@ void Guest::UpdateRideEnterVehicle() seatedPeepAsGuest->MoveTo({ LOCATION_NULL, 0, 0 }); seatedPeepAsGuest->SetState(PEEP_STATE_ON_RIDE); seatedPeepAsGuest->GuestTimeOnRide = 0; - seatedPeepAsGuest->sub_state = PEEP_RIDE_ON_RIDE; + seatedPeepAsGuest->SubState = PEEP_RIDE_ON_RIDE; seatedPeepAsGuest->OnEnterRide(CurrentRide); } } @@ -4095,7 +4095,7 @@ void Guest::UpdateRideEnterVehicle() SetState(PEEP_STATE_ON_RIDE); GuestTimeOnRide = 0; - sub_state = PEEP_RIDE_ON_RIDE; + SubState = PEEP_RIDE_ON_RIDE; OnEnterRide(CurrentRide); } } @@ -4299,10 +4299,10 @@ void Guest::UpdateRideLeaveVehicle() waypointLoc.x += vehicleEntry->peep_loading_waypoints[Var37 / 4][1].x; waypointLoc.y += vehicleEntry->peep_loading_waypoints[Var37 / 4][1].y; - destination_x = waypointLoc.x; - destination_y = waypointLoc.y; - destination_tolerance = 2; - sub_state = PEEP_RIDE_APPROACH_EXIT_WAYPOINTS; + DestinationX = waypointLoc.x; + DestinationY = waypointLoc.y; + DestinationTolerance = 2; + SubState = PEEP_RIDE_APPROACH_EXIT_WAYPOINTS; } /** @@ -4346,10 +4346,10 @@ static void peep_update_ride_prepare_for_exit(Peep* peep) x -= x_shift; y -= y_shift; - peep->destination_x = x; - peep->destination_y = y; - peep->destination_tolerance = 2; - peep->sub_state = PEEP_RIDE_IN_EXIT; + peep->DestinationX = x; + peep->DestinationY = y; + peep->DestinationTolerance = 2; + peep->SubState = PEEP_RIDE_IN_EXIT; } /** @@ -4402,7 +4402,7 @@ void Guest::UpdateRideInExit() ride->no_secondary_items_sold++; } } - sub_state = PEEP_RIDE_LEAVE_EXIT; + SubState = PEEP_RIDE_LEAVE_EXIT; } #pragma warning(default : 6011) /** @@ -4448,7 +4448,7 @@ void Guest::UpdateRideApproachVehicleWaypoints() if (waypoint == 2) { - sub_state = PEEP_RIDE_ENTER_VEHICLE; + SubState = PEEP_RIDE_ENTER_VEHICLE; return; } @@ -4477,8 +4477,8 @@ void Guest::UpdateRideApproachVehicleWaypoints() targetLoc.x += vehicle_type->peep_loading_waypoints[Var37 / 4][waypoint].x; targetLoc.y += vehicle_type->peep_loading_waypoints[Var37 / 4][waypoint].y; - destination_x = targetLoc.x; - destination_y = targetLoc.y; + DestinationX = targetLoc.x; + DestinationY = targetLoc.y; } /** @@ -4541,8 +4541,8 @@ void Guest::UpdateRideApproachExitWaypoints() targetLoc.x += vehicleEntry->peep_loading_waypoints[Var37 / 4][Var37 & 3].x; targetLoc.y += vehicleEntry->peep_loading_waypoints[Var37 / 4][Var37 & 3].y; - destination_x = targetLoc.x; - destination_y = targetLoc.y; + DestinationX = targetLoc.x; + DestinationY = targetLoc.y; return; } @@ -4572,8 +4572,8 @@ void Guest::UpdateRideApproachExitWaypoints() targetLoc.x -= x_shift; targetLoc.y -= y_shift; - destination_x = targetLoc.x; - destination_y = targetLoc.y; + DestinationX = targetLoc.x; + DestinationY = targetLoc.y; } /** @@ -4596,9 +4596,9 @@ void Guest::UpdateRideApproachSpiralSlide() if (waypoint == 3) { - sub_state = 15; - destination_x = 0; - destination_y = 0; + SubState = 15; + DestinationX = 0; + DestinationY = 0; Var37 = (Var37 / 4) & 0xC; MoveTo({ LOCATION_NULL, y, z }); return; @@ -4626,9 +4626,9 @@ void Guest::UpdateRideApproachSpiralSlide() assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); targetLoc += SpiralSlideWalkingPath[Var37]; - destination_x = targetLoc.x; - destination_y = targetLoc.y; - sub_state = PEEP_RIDE_LEAVE_SPIRAL_SLIDE; + DestinationX = targetLoc.x; + DestinationY = targetLoc.y; + SubState = PEEP_RIDE_LEAVE_SPIRAL_SLIDE; return; } } @@ -4641,8 +4641,8 @@ void Guest::UpdateRideApproachSpiralSlide() assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); targetLoc += SpiralSlideWalkingPath[Var37]; - destination_x = targetLoc.x; - destination_y = targetLoc.y; + DestinationX = targetLoc.x; + DestinationY = targetLoc.y; } /** rct2: 0x00981F0C, 0x00981F0E */ @@ -4673,12 +4673,12 @@ void Guest::UpdateRideOnSpiralSlide() if ((Var37 & 3) == 0) { - switch (destination_x) + switch (DestinationX) { case 0: - destination_y++; - if (destination_y >= 30) - destination_x++; + DestinationY++; + if (DestinationY >= 30) + DestinationX++; return; case 1: if (ride->slide_in_use != 0) @@ -4686,9 +4686,9 @@ void Guest::UpdateRideOnSpiralSlide() ride->slide_in_use++; ride->slide_peep = sprite_index; - ride->slide_peep_t_shirt_colour = tshirt_colour; + ride->slide_peep_t_shirt_colour = TshirtColour; ride->spiral_slide_progress = 0; - destination_x++; + DestinationX++; return; case 2: return; @@ -4698,8 +4698,8 @@ void Guest::UpdateRideOnSpiralSlide() uint8_t dir = (Var37 / 4) & 3; // Set the location that the peep walks to go on slide again - destination_x = newLocation.x + _SpiralSlideEndWaypoint[dir].x; - destination_y = newLocation.y + _SpiralSlideEndWaypoint[dir].y; + DestinationX = newLocation.x + _SpiralSlideEndWaypoint[dir].x; + DestinationY = newLocation.y + _SpiralSlideEndWaypoint[dir].y; // Move the peep sprite to just at the end of the slide newLocation.x += _SpiralSlideEnd[dir].x; @@ -4731,9 +4731,9 @@ void Guest::UpdateRideOnSpiralSlide() assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); targetLoc += SpiralSlideWalkingPath[Var37]; - destination_x = targetLoc.x; - destination_y = targetLoc.y; - sub_state = PEEP_RIDE_APPROACH_SPIRAL_SLIDE; + DestinationX = targetLoc.x; + DestinationY = targetLoc.y; + SubState = PEEP_RIDE_APPROACH_SPIRAL_SLIDE; } /** @@ -4772,8 +4772,8 @@ void Guest::UpdateRideLeaveSpiralSlide() assert(ride->type == RIDE_TYPE_SPIRAL_SLIDE); targetLoc += SpiralSlideWalkingPath[Var37]; - destination_x = targetLoc.x; - destination_y = targetLoc.y; + DestinationX = targetLoc.x; + DestinationY = targetLoc.y; return; } waypoint = 3; @@ -4793,8 +4793,8 @@ void Guest::UpdateRideLeaveSpiralSlide() targetLoc.x -= xShift; targetLoc.y -= yShift; - destination_x = targetLoc.x; - destination_y = targetLoc.y; + DestinationX = targetLoc.x; + DestinationY = targetLoc.y; } /** rct2: 0x00981FE4 */ @@ -4846,7 +4846,7 @@ void Guest::UpdateRideMazePathfinding() } } - CoordsXY targetLoc = { destination_x & 0xFFE0, destination_y & 0xFFE0 }; + CoordsXY targetLoc = { DestinationX & 0xFFE0, DestinationY & 0xFFE0 }; int16_t stationBaseZ = ride->stations[0].GetBaseZ(); @@ -4898,8 +4898,8 @@ void Guest::UpdateRideMazePathfinding() targetLoc.x = CoordsDirectionDelta[chosenEdge].x / 2; targetLoc.y = CoordsDirectionDelta[chosenEdge].y / 2; - targetLoc.x += destination_x; - targetLoc.y += destination_y; + targetLoc.x += DestinationX; + targetLoc.y += DestinationY; enum class maze_type { @@ -4938,15 +4938,15 @@ void Guest::UpdateRideMazePathfinding() MazeLastEdge &= 3; return; case maze_type::hedge: - destination_x = targetLoc.x; - destination_y = targetLoc.y; + DestinationX = targetLoc.x; + DestinationY = targetLoc.y; Var37 = _MazeGetNewDirectionFromEdge[Var37 / 4][chosenEdge]; MazeLastEdge = chosenEdge; break; case maze_type::entrance_or_exit: - targetLoc.x = destination_x; - targetLoc.y = destination_y; + targetLoc.x = DestinationX; + targetLoc.y = DestinationY; if (chosenEdge & 1) { targetLoc.x = targetLoc.ToTileCentre().x; @@ -4955,8 +4955,8 @@ void Guest::UpdateRideMazePathfinding() { targetLoc.y = targetLoc.ToTileCentre().y; } - destination_x = targetLoc.x; - destination_y = targetLoc.y; + DestinationX = targetLoc.x; + DestinationY = targetLoc.y; Var37 = 16; MazeLastEdge = chosenEdge; break; @@ -5038,7 +5038,7 @@ void Guest::UpdateRideShopApproach() return; } - sub_state = PEEP_SHOP_INTERACT; + SubState = PEEP_SHOP_INTERACT; } /** @@ -5057,11 +5057,11 @@ void Guest::UpdateRideShopInteract() { if (Nausea <= 35) { - sub_state = PEEP_SHOP_LEAVE; + SubState = PEEP_SHOP_LEAVE; - destination_x = tileCenterX; - destination_y = tileCenterY; - destination_tolerance = 3; + DestinationX = tileCenterX; + DestinationY = tileCenterY; + DestinationTolerance = 3; HappinessTarget = std::min(HappinessTarget + 30, PEEP_MAX_HAPPINESS); Happiness = HappinessTarget; } @@ -5085,11 +5085,11 @@ void Guest::UpdateRideShopInteract() audio_play_sound_at_location(SoundId::ToiletFlush, { x, y, z }); } - sub_state = PEEP_SHOP_LEAVE; + SubState = PEEP_SHOP_LEAVE; - destination_x = tileCenterX; - destination_y = tileCenterY; - destination_tolerance = 3; + DestinationX = tileCenterX; + DestinationY = tileCenterY; + DestinationTolerance = 3; HappinessTarget = std::min(HappinessTarget + 30, PEEP_MAX_HAPPINESS); Happiness = HappinessTarget; @@ -5126,7 +5126,7 @@ void Guest::UpdateRideShopLeave() void Guest::UpdateGuest() { - switch (state) + switch (State) { case PEEP_STATE_QUEUING_FRONT: UpdateRide(); @@ -5174,9 +5174,9 @@ void Guest::UpdateGuest() * Used by entering_ride and queueing_front */ void Guest::UpdateRide() { - next_flags &= ~PEEP_NEXT_FLAG_IS_SLOPED; + NextFlags &= ~PEEP_NEXT_FLAG_IS_SLOPED; - switch (sub_state) + switch (SubState) { case PEEP_RIDE_AT_ENTRANCE: UpdateRideAtEntrance(); @@ -5363,7 +5363,7 @@ void Guest::UpdateWalking() // Check if vehicle is blocking the destination tile auto curPos = TileCoordsXYZ(CoordsXYZ{ x, y, z }); - auto dstPos = TileCoordsXYZ(CoordsXYZ{ destination_x, destination_y, NextLoc.z }); + auto dstPos = TileCoordsXYZ(CoordsXYZ{ DestinationX, DestinationY, NextLoc.z }); if (curPos.x != dstPos.x || curPos.y != dstPos.y) { if (footpath_is_blocked_by_vehicle(dstPos)) @@ -5406,7 +5406,7 @@ void Guest::UpdateWalking() peep_update_walking_break_scenery(this); - if (state != PEEP_STATE_WALKING) + if (State != PEEP_STATE_WALKING) return; if (PeepFlags & PEEP_FLAGS_LEAVING_PARK) @@ -5485,7 +5485,7 @@ void Guest::UpdateWalking() if (!sprite->generic.Is()) continue; - if (sprite->peep.state != PEEP_STATE_WATCHING) + if (sprite->peep.State != PEEP_STATE_WATCHING) continue; if (z != sprite->peep.z) @@ -5510,14 +5510,14 @@ void Guest::UpdateWalking() Var37 = chosen_edge | (chosen_position << 2); SetState(PEEP_STATE_WATCHING); - sub_state = 0; + SubState = 0; int32_t destX = (x & 0xFFE0) + _WatchingPositionOffsets[Var37 & 0x1F].x; int32_t destY = (y & 0xFFE0) + _WatchingPositionOffsets[Var37 & 0x1F].y; - destination_x = destX; - destination_y = destY; - destination_tolerance = 3; + DestinationX = destX; + DestinationY = destY; + DestinationTolerance = 3; if (CurrentSeat & 1) { @@ -5548,7 +5548,7 @@ void Guest::UpdateQueuing() return; } - if (sub_state != 10) + if (SubState != 10) { bool is_front = true; if (GuestNextInQueue != SPRITE_INDEX_NULL) @@ -5568,9 +5568,9 @@ void Guest::UpdateQueuing() if (is_front) { // Happens every time peep goes onto ride. - destination_tolerance = 0; + DestinationTolerance = 0; SetState(PEEP_STATE_QUEUING_FRONT); - sub_state = PEEP_RIDE_AT_ENTRANCE; + SubState = PEEP_RIDE_AT_ENTRANCE; return; } @@ -5586,7 +5586,7 @@ void Guest::UpdateQueuing() PerformNextAction(pathingResult); if (Action < PEEP_ACTION_NONE_1) return; - if (sprite_type == PEEP_SPRITE_TYPE_NORMAL) + if (SpriteType == PEEP_SPRITE_TYPE_NORMAL) { if (TimeInQueue >= 2000 && (0xFFFF & scenario_rand()) <= 119) { @@ -5606,7 +5606,7 @@ void Guest::UpdateQueuing() { if (!(TimeInQueue & 0x3F) && Action == PEEP_ACTION_NONE_1 && NextActionSpriteType == 2) { - switch (sprite_type) + switch (SpriteType) { case PEEP_SPRITE_TYPE_ICE_CREAM: case PEEP_SPRITE_TYPE_CHIPS: @@ -5677,7 +5677,7 @@ void Guest::UpdateEnteringPark() } SetState(PEEP_STATE_FALLING); - outside_of_park = 0; + OutsideOfPark = 0; TimeInPark = gScenarioTicks; increment_guests_in_park(); decrement_guests_heading_for_park(); @@ -5707,8 +5707,8 @@ void Guest::UpdateLeavingPark() return; } - outside_of_park = 1; - destination_tolerance = 5; + OutsideOfPark = 1; + DestinationTolerance = 5; decrement_guests_in_park(); auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); context_broadcast_intent(&intent); @@ -5728,7 +5728,7 @@ void Guest::UpdateLeavingPark() */ void Guest::UpdateWatching() { - if (sub_state == 0) + if (SubState == 0) { if (!CheckForPath()) return; @@ -5737,8 +5737,8 @@ void Guest::UpdateWatching() if (!(pathingResult & PATHING_DESTINATION_REACHED)) return; - destination_x = x; - destination_y = y; + DestinationX = x; + DestinationY = y; sprite_direction = (Var37 & 3) * 8; @@ -5747,12 +5747,12 @@ void Guest::UpdateWatching() SwitchNextActionSpriteType(); - sub_state++; + SubState++; TimeToStand = std::clamp(((129 - Energy) * 16 + 50) / 2, 0, 255); UpdateSpriteType(); } - else if (sub_state == 1) + else if (SubState == 1) { if (Action < PEEP_ACTION_NONE_1) { @@ -5810,9 +5810,9 @@ void Guest::UpdateWatching() SetState(PEEP_STATE_WALKING); UpdateSpriteType(); // Send peep to the centre of current tile. - destination_x = (x & 0xFFE0) + 16; - destination_y = (y & 0xFFE0) + 16; - destination_tolerance = 5; + DestinationX = (x & 0xFFE0) + 16; + DestinationY = (y & 0xFFE0) + 16; + DestinationTolerance = 5; UpdateCurrentActionSpriteType(); } } @@ -5823,7 +5823,7 @@ void Guest::UpdateWatching() */ void Guest::UpdateUsingBin() { - switch (sub_state) + switch (SubState) { case PEEP_USING_BIN_WALKING_TO_BIN: { @@ -5834,7 +5834,7 @@ void Guest::UpdateUsingBin() PerformNextAction(pathingResult); if (pathingResult & PATHING_DESTINATION_REACHED) { - sub_state = PEEP_USING_BIN_GOING_BACK; + SubState = PEEP_USING_BIN_GOING_BACK; } break; } @@ -6071,7 +6071,7 @@ bool Guest::UpdateWalkingFindBench() if (!sprite->generic.Is()) continue; - if (sprite->peep.state != PEEP_STATE_SITTING) + if (sprite->peep.State != PEEP_STATE_SITTING) continue; if (z != sprite->peep.z) @@ -6097,14 +6097,14 @@ bool Guest::UpdateWalkingFindBench() SetState(PEEP_STATE_SITTING); - sub_state = PEEP_SITTING_TRYING_TO_SIT; + SubState = PEEP_SITTING_TRYING_TO_SIT; int32_t benchX = (x & 0xFFE0) + BenchUseOffsets[Var37 & 0x7].x; int32_t benchY = (y & 0xFFE0) + BenchUseOffsets[Var37 & 0x7].y; - destination_x = benchX; - destination_y = benchY; - destination_tolerance = 3; + DestinationX = benchX; + DestinationY = benchY; + DestinationTolerance = 3; return true; } @@ -6181,14 +6181,14 @@ bool Guest::UpdateWalkingFindBin() peep->Var37 = chosen_edge; peep->SetState(PEEP_STATE_USING_BIN); - peep->sub_state = PEEP_USING_BIN_WALKING_TO_BIN; + peep->SubState = PEEP_USING_BIN_WALKING_TO_BIN; int32_t binX = (peep->x & 0xFFE0) + BinUseOffsets[peep->Var37 & 0x3].x; int32_t binY = (peep->y & 0xFFE0) + BinUseOffsets[peep->Var37 & 0x3].y; - peep->destination_x = binX; - peep->destination_y = binY; - peep->destination_tolerance = 3; + peep->DestinationX = binX; + peep->DestinationY = binY; + peep->DestinationTolerance = 3; return true; } @@ -6208,7 +6208,7 @@ static void peep_update_walking_break_scenery(Peep* peep) return; if (peep->Energy < 85) return; - if (peep->state != PEEP_STATE_WALKING) + if (peep->State != PEEP_STATE_WALKING) return; if ((peep->LitterCount & 0xC0) != 0xC0 && (peep->DisgustingCount & 0xC0) != 0xC0) @@ -6262,7 +6262,7 @@ static void peep_update_walking_break_scenery(Peep* peep) { sprite = get_sprite(sprite_id); - if (!sprite->generic.Is() || (sprite->peep.state != PEEP_STATE_SITTING) || (peep->z != sprite->peep.z)) + if (!sprite->generic.Is() || (sprite->peep.State != PEEP_STATE_SITTING) || (peep->z != sprite->peep.z)) { continue; } @@ -6275,7 +6275,7 @@ static void peep_update_walking_break_scenery(Peep* peep) FOR_ALL_STAFF (sprite_index, inner_peep) { - if (inner_peep->staff_type != STAFF_TYPE_SECURITY) + if (inner_peep->StaffType != STAFF_TYPE_SECURITY) continue; if (inner_peep->x == LOCATION_NULL) @@ -6759,10 +6759,10 @@ static bool peep_find_ride_to_look_at(Peep* peep, uint8_t edge, uint8_t* rideToV /* Part of 0x0069B8CC rct2: 0x0069BC31 */ void Guest::SetSpriteType(PeepSpriteType new_sprite_type) { - if (sprite_type == new_sprite_type) + if (SpriteType == new_sprite_type) return; - sprite_type = new_sprite_type; + SpriteType = new_sprite_type; ActionSpriteImageOffset = 0; WalkingFrameNum = 0; @@ -6779,13 +6779,13 @@ void Guest::SetSpriteType(PeepSpriteType new_sprite_type) ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_INVALID; UpdateCurrentActionSpriteType(); - if (state == PEEP_STATE_SITTING) + if (State == PEEP_STATE_SITTING) { Action = PEEP_ACTION_NONE_1; NextActionSpriteType = PEEP_ACTION_SPRITE_TYPE_SITTING_IDLE; SwitchNextActionSpriteType(); } - if (state == PEEP_STATE_WATCHING) + if (State == PEEP_STATE_WATCHING) { Action = PEEP_ACTION_NONE_1; NextActionSpriteType = PEEP_ACTION_SPRITE_TYPE_WATCH_RIDE; @@ -6843,7 +6843,7 @@ static item_pref_t item_order_preference[] = { */ void Guest::UpdateSpriteType() { - if (sprite_type == PEEP_SPRITE_TYPE_BALLOON && (scenario_rand() & 0xFFFF) <= 327) + if (SpriteType == PEEP_SPRITE_TYPE_BALLOON && (scenario_rand() & 0xFFFF) <= 327) { bool isBalloonPopped = false; if (x != LOCATION_NULL) @@ -6902,7 +6902,7 @@ void Guest::UpdateSpriteType() } } - if (state == PEEP_STATE_WATCHING && StandingFlags & (1 << 1)) + if (State == PEEP_STATE_WATCHING && StandingFlags & (1 << 1)) { SetSpriteType(PEEP_SPRITE_TYPE_WATCHING); return; diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 1caafead68..137162ab7c 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -119,12 +119,12 @@ static int32_t peep_move_one_tile(Direction direction, Peep* peep) } peep->PeepDirection = direction; - peep->destination_x = newTile.x; - peep->destination_y = newTile.y; - peep->destination_tolerance = 2; - if (peep->state != PEEP_STATE_QUEUING) + peep->DestinationX = newTile.x; + peep->DestinationY = newTile.y; + peep->DestinationTolerance = 2; + if (peep->State != PEEP_STATE_QUEUING) { - peep->destination_tolerance = (scenario_rand() & 7) + 2; + peep->DestinationTolerance = (scenario_rand() & 7) + 2; } return 0; } @@ -438,7 +438,7 @@ static int32_t guest_path_find_aimless(Peep* peep, uint8_t edges) */ static uint8_t peep_pathfind_get_max_number_junctions(Peep* peep) { - if (peep->type == PEEP_TYPE_STAFF) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF) return 8; // PEEP_FLAGS_2? It's cleared here but not set anywhere! @@ -626,7 +626,7 @@ static void peep_pathfind_heuristic_search( } bool nextInPatrolArea = inPatrolArea; - if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_MECHANIC) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF && peep->StaffType == STAFF_TYPE_MECHANIC) { nextInPatrolArea = peep->AsStaff()->IsLocationInPatrol(loc.ToCoordsXY()); if (inPatrolArea && !nextInPatrolArea) @@ -1169,9 +1169,9 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) /* The max number of tiles to check - a whole-search limit. * Mainly to limit the performance impact of the path finding. */ - int32_t maxTilesChecked = (peep->type == PEEP_TYPE_STAFF) ? 50000 : 15000; + int32_t maxTilesChecked = (peep->AssignedPeepType == PEEP_TYPE_STAFF) ? 50000 : 15000; // Used to allow walking through no entry banners - _peepPathFindIsStaff = (peep->type == PEEP_TYPE_STAFF); + _peepPathFindIsStaff = (peep->AssignedPeepType == PEEP_TYPE_STAFF); TileCoordsXYZ goal = gPeepPathFindGoalPosition; @@ -1401,7 +1401,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep) uint8_t endDirectionList[16] = { 0 }; bool inPatrolArea = false; - if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_MECHANIC) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF && peep->StaffType == STAFF_TYPE_MECHANIC) { /* Mechanics are the only staff type that * pathfind to a destination. Determine if the @@ -1855,7 +1855,7 @@ static void get_ride_queue_end(TileCoordsXYZ& loc) static StationIndex guest_pathfinding_select_random_station( const Guest* guest, int32_t numEntranceStations, std::bitset& entranceStations) { - int32_t select = guest->no_of_rides % numEntranceStations; + int32_t select = guest->GuestNumRides % numEntranceStations; while (select > 0) { for (StationIndex i = 0; i < MAX_STATIONS; i++) @@ -1913,7 +1913,7 @@ int32_t guest_path_finding(Guest* peep) return guest_surface_path_finding(peep); } - if (peep->outside_of_park == 0 && peep->HeadingForRideOrParkExit()) + if (peep->OutsideOfPark == 0 && peep->HeadingForRideOrParkExit()) { /* If this tileElement is adjacent to any non-wide paths, * remove all of the edges to wide paths. */ @@ -1971,7 +1971,7 @@ int32_t guest_path_finding(Guest* peep) // Peep is outside the park. // loc_694F19: - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) { #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 if (gPathFindDebug) @@ -1980,7 +1980,7 @@ int32_t guest_path_finding(Guest* peep) } pathfind_logging_disable(); #endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 - switch (peep->state) + switch (peep->State) { case PEEP_STATE_ENTERING_PARK: return guest_path_find_entering_park(peep, edges); diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 2cdddc1896..9c60ba6a28 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -330,12 +330,12 @@ template<> bool SpriteBase::Is() const Guest* Peep::AsGuest() { - return type == PEEP_TYPE_GUEST ? static_cast(this) : nullptr; + return AssignedPeepType == PEEP_TYPE_GUEST ? static_cast(this) : nullptr; } Staff* Peep::AsStaff() { - return type == PEEP_TYPE_STAFF ? static_cast(this) : nullptr; + return AssignedPeepType == PEEP_TYPE_STAFF ? static_cast(this) : nullptr; } void Peep::Invalidate() @@ -352,24 +352,24 @@ void Peep::MoveTo(const CoordsXYZ& newLocation) uint8_t Peep::GetNextDirection() const { - return next_flags & PEEP_NEXT_FLAG_DIRECTION_MASK; + return NextFlags & PEEP_NEXT_FLAG_DIRECTION_MASK; } bool Peep::GetNextIsSloped() const { - return next_flags & PEEP_NEXT_FLAG_IS_SLOPED; + return NextFlags & PEEP_NEXT_FLAG_IS_SLOPED; } bool Peep::GetNextIsSurface() const { - return next_flags & PEEP_NEXT_FLAG_IS_SURFACE; + return NextFlags & PEEP_NEXT_FLAG_IS_SURFACE; } void Peep::SetNextFlags(uint8_t next_direction, bool is_sloped, bool is_surface) { - next_flags = next_direction & PEEP_NEXT_FLAG_DIRECTION_MASK; - next_flags |= is_sloped ? PEEP_NEXT_FLAG_IS_SLOPED : 0; - next_flags |= is_surface ? PEEP_NEXT_FLAG_IS_SURFACE : 0; + NextFlags = next_direction & PEEP_NEXT_FLAG_DIRECTION_MASK; + NextFlags |= is_sloped ? PEEP_NEXT_FLAG_IS_SLOPED : 0; + NextFlags |= is_surface ? PEEP_NEXT_FLAG_IS_SURFACE : 0; } Peep* try_get_guest(uint16_t spriteIndex) @@ -379,7 +379,7 @@ Peep* try_get_guest(uint16_t spriteIndex) return nullptr; if (!sprite->generic.Is()) return nullptr; - if (sprite->peep.type != PEEP_TYPE_GUEST) + if (sprite->peep.AssignedPeepType != PEEP_TYPE_GUEST) return nullptr; return &sprite->peep; } @@ -520,7 +520,7 @@ PeepActionSpriteType Peep::GetActionSpriteType() */ void Peep::UpdateCurrentActionSpriteType() { - if (sprite_type >= std::size(g_peep_animation_entries)) + if (SpriteType >= std::size(g_peep_animation_entries)) { return; } @@ -533,7 +533,7 @@ void Peep::UpdateCurrentActionSpriteType() Invalidate(); ActionSpriteType = newActionSpriteType; - const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[sprite_type].sprite_bounds; + const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[SpriteType].sprite_bounds; sprite_width = spriteBounds[ActionSpriteType].sprite_width; sprite_height_negative = spriteBounds[ActionSpriteType].sprite_height_negative; sprite_height_positive = spriteBounds[ActionSpriteType].sprite_height_positive; @@ -588,7 +588,7 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) Action = PEEP_ACTION_NONE_2; } - CoordsXY diffrenceLoc = { x - destination_x, y - destination_y }; + CoordsXY diffrenceLoc = { x - DestinationX, y - DestinationY }; int32_t x_delta = abs(diffrenceLoc.x); int32_t y_delta = abs(diffrenceLoc.y); @@ -597,7 +597,7 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) if (Action == PEEP_ACTION_NONE_1 || Action == PEEP_ACTION_NONE_2) { - if (xy_distance <= destination_tolerance) + if (xy_distance <= DestinationTolerance) { return std::nullopt; } @@ -622,7 +622,7 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) CoordsXY loc = { x, y }; loc += word_981D7C[nextDirection / 8]; WalkingFrameNum++; - const rct_peep_animation* peepAnimation = g_peep_animation_entries[sprite_type].sprite_animation; + const rct_peep_animation* peepAnimation = g_peep_animation_entries[SpriteType].sprite_animation; const uint8_t* imageOffset = peepAnimation[ActionSpriteType].frame_offsets; if (WalkingFrameNum >= peepAnimation[ActionSpriteType].num_frames) { @@ -632,7 +632,7 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) return loc; } - const rct_peep_animation* peepAnimation = g_peep_animation_entries[sprite_type].sprite_animation; + const rct_peep_animation* peepAnimation = g_peep_animation_entries[SpriteType].sprite_animation; ActionFrame++; // If last frame of action @@ -678,7 +678,7 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) */ void peep_decrement_num_riders(Peep* peep) { - if (peep->state == PEEP_STATE_ON_RIDE || peep->state == PEEP_STATE_ENTERING_RIDE) + if (peep->State == PEEP_STATE_ON_RIDE || peep->State == PEEP_STATE_ENTERING_RIDE) { auto ride = get_ride(peep->CurrentRide); if (ride != nullptr) @@ -700,9 +700,9 @@ void peep_window_state_update(Peep* peep) if (w != nullptr) window_event_invalidate_call(w); - if (peep->type == PEEP_TYPE_GUEST) + if (peep->AssignedPeepType == PEEP_TYPE_GUEST) { - if (peep->state == PEEP_STATE_ON_RIDE || peep->state == PEEP_STATE_ENTERING_RIDE) + if (peep->State == PEEP_STATE_ON_RIDE || peep->State == PEEP_STATE_ENTERING_RIDE) { auto ride = get_ride(peep->CurrentRide); if (ride != nullptr) @@ -731,12 +731,12 @@ void Peep::Pickup() } MoveTo({ LOCATION_NULL, y, z }); SetState(PEEP_STATE_PICKED); - sub_state = 0; + SubState = 0; } void Peep::PickupAbort(int32_t old_x) { - if (state != PEEP_STATE_PICKED) + if (State != PEEP_STATE_PICKED) return; MoveTo({ old_x, y, z + 8 }); @@ -800,7 +800,7 @@ bool Peep::Place(const TileCoordsXYZ& location, bool apply) PathCheckOptimisation = 0; sprite_position_tween_reset(); - if (type == PEEP_TYPE_GUEST) + if (AssignedPeepType == PEEP_TYPE_GUEST) { ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_INVALID; HappinessTarget = std::max(HappinessTarget - 10, 0); @@ -828,7 +828,7 @@ void peep_sprite_remove(Peep* peep) window_close_by_number(WC_FIRE_PROMPT, peep->sprite_identifier); - if (peep->type == PEEP_TYPE_GUEST) + if (peep->AssignedPeepType == PEEP_TYPE_GUEST) { window_invalidate_by_class(WC_GUEST_LIST); @@ -839,9 +839,9 @@ void peep_sprite_remove(Peep* peep) window_invalidate_by_class(WC_STAFF_LIST); gStaffModes[peep->StaffId] = 0; - peep->type = PEEP_TYPE_INVALID; + peep->AssignedPeepType = PEEP_TYPE_INVALID; staff_update_greyed_patrol_areas(); - peep->type = PEEP_TYPE_STAFF; + peep->AssignedPeepType = PEEP_TYPE_STAFF; news_item_disable_news(NEWS_ITEM_PEEP, peep->sprite_index); } @@ -853,15 +853,15 @@ void peep_sprite_remove(Peep* peep) */ void Peep::Remove() { - if (type == PEEP_TYPE_GUEST) + if (AssignedPeepType == PEEP_TYPE_GUEST) { - if (outside_of_park == 0) + if (OutsideOfPark == 0) { decrement_guests_in_park(); auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); context_broadcast_intent(&intent); } - if (state == PEEP_STATE_ENTERING_PARK) + if (State == PEEP_STATE_ENTERING_PARK) { decrement_guests_heading_for_park(); } @@ -996,7 +996,7 @@ void Peep::Update1() if (!CheckForPath()) return; - if (type == PEEP_TYPE_GUEST) + if (AssignedPeepType == PEEP_TYPE_GUEST) { SetState(PEEP_STATE_WALKING); } @@ -1005,16 +1005,16 @@ void Peep::Update1() SetState(PEEP_STATE_PATROLLING); } - destination_x = x; - destination_y = y; - destination_tolerance = 10; + DestinationX = x; + DestinationY = y; + DestinationTolerance = 10; PeepDirection = sprite_direction >> 3; } void Peep::SetState(PeepState new_state) { peep_decrement_num_riders(this); - state = new_state; + State = new_state; peep_window_state_update(this); } @@ -1026,8 +1026,8 @@ void Peep::UpdatePicked() { if (gCurrentTicks & 0x1F) return; - sub_state++; - if (sub_state == 13) + SubState++; + if (SubState == 13) { InsertNewThought(PEEP_THOUGHT_TYPE_HELP, PEEP_THOUGHT_ITEM_NONE); } @@ -1100,7 +1100,7 @@ static void peep_update_thoughts(Peep* peep) */ void Peep::Update() { - if (type == PEEP_TYPE_GUEST) + if (AssignedPeepType == PEEP_TYPE_GUEST) { if (PreviousRide != RIDE_ID_NULL) if (++PreviousRideTimeOut >= 720) @@ -1111,14 +1111,14 @@ void Peep::Update() // Walking speed logic uint32_t stepsToTake = Energy; - if (stepsToTake < 95 && state == PEEP_STATE_QUEUING) + if (stepsToTake < 95 && State == PEEP_STATE_QUEUING) stepsToTake = 95; - if ((PeepFlags & PEEP_FLAGS_SLOW_WALK) && state != PEEP_STATE_QUEUING) + if ((PeepFlags & PEEP_FLAGS_SLOW_WALK) && State != PEEP_STATE_QUEUING) stepsToTake /= 2; if (Action == PEEP_ACTION_NONE_2 && (GetNextIsSloped())) { stepsToTake /= 2; - if (state == PEEP_STATE_QUEUING) + if (State == PEEP_STATE_QUEUING) stepsToTake += stepsToTake / 2; } @@ -1135,7 +1135,7 @@ void Peep::Update() else { // loc_68FD2F - switch (state) + switch (State) { case PEEP_STATE_FALLING: UpdateFalling(); @@ -1189,7 +1189,7 @@ void peep_problem_warnings_update() FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park != 0 || peep->Thoughts[0].freshness > 5) + if (peep->OutsideOfPark != 0 || peep->Thoughts[0].freshness > 5) continue; switch (peep->Thoughts[0].type) @@ -1383,7 +1383,7 @@ void peep_update_crowd_noise() if (viewport->viewPos.y + viewport->view_height < peep->sprite_top) continue; - visiblePeeps += peep->state == PEEP_STATE_QUEUING ? 1 : 2; + visiblePeeps += peep->State == PEEP_STATE_QUEUING ? 1 : 2; } // This function doesn't account for the fact that the screen might be so big that 100 peeps could potentially be very @@ -1439,14 +1439,14 @@ void peep_applause() { auto peep = p->AsGuest(); assert(peep != nullptr); - if (peep->outside_of_park != 0) + if (peep->OutsideOfPark != 0) continue; // Release balloon peep_release_balloon(peep, peep->z + 9); // Clap - if ((peep->state == PEEP_STATE_WALKING || peep->state == PEEP_STATE_QUEUING) && peep->Action >= 254) + if ((peep->State == PEEP_STATE_WALKING || peep->State == PEEP_STATE_QUEUING) && peep->Action >= 254) { peep->Action = PEEP_ACTION_CLAP; peep->ActionFrame = 0; @@ -1470,7 +1470,7 @@ void peep_update_days_in_queue() FOR_ALL_GUESTS (sprite_index, peep) { - if (peep->outside_of_park == 0 && peep->state == PEEP_STATE_QUEUING) + if (peep->OutsideOfPark == 0 && peep->State == PEEP_STATE_QUEUING) { if (peep->DaysInQueue < 255) { @@ -1615,9 +1615,9 @@ Peep* Peep::Generate(const CoordsXYZ& coords) Peep* peep = &create_sprite(SPRITE_IDENTIFIER_PEEP)->peep; peep->sprite_identifier = SPRITE_IDENTIFIER_PEEP; - peep->sprite_type = PEEP_SPRITE_TYPE_NORMAL; - peep->outside_of_park = 1; - peep->state = PEEP_STATE_FALLING; + peep->SpriteType = PEEP_SPRITE_TYPE_NORMAL; + peep->OutsideOfPark = 1; + peep->State = PEEP_STATE_FALLING; peep->Action = PEEP_ACTION_NONE_2; peep->SpecialSprite = 0; peep->ActionSpriteImageOffset = 0; @@ -1627,7 +1627,7 @@ Peep* Peep::Generate(const CoordsXYZ& coords) peep->FavouriteRide = RIDE_ID_NULL; peep->FavouriteRideRating = 0; - const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[peep->sprite_type].sprite_bounds; + const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[peep->SpriteType].sprite_bounds; peep->sprite_width = spriteBounds[peep->ActionSpriteType].sprite_width; peep->sprite_height_negative = spriteBounds[peep->ActionSpriteType].sprite_height_negative; peep->sprite_height_positive = spriteBounds[peep->ActionSpriteType].sprite_height_positive; @@ -1637,7 +1637,7 @@ Peep* Peep::Generate(const CoordsXYZ& coords) peep->Mass = (scenario_rand() & 0x1F) + 45; peep->PathCheckOptimisation = 0; peep->InteractionRideIndex = RIDE_ID_NULL; - peep->type = PEEP_TYPE_GUEST; + peep->AssignedPeepType = PEEP_TYPE_GUEST; peep->PreviousRide = RIDE_ID_NULL; peep->Thoughts->type = PEEP_THOUGHT_TYPE_NONE; peep->WindowInvalidateFlags = 0; @@ -1717,10 +1717,10 @@ Peep* Peep::Generate(const CoordsXYZ& coords) peep->TimeToConsume = 0; std::fill_n(peep->RidesBeenOn, 32, 0x00); - peep->no_of_rides = 0; + peep->GuestNumRides = 0; std::fill_n(peep->RideTypesBeenOn, 16, 0x00); peep->Id = gNextGuestNumber++; - peep->name = nullptr; + peep->Name = nullptr; money32 cash = (scenario_rand() & 0x3) * 100 - 100 + gGuestInitialCash; if (cash < 0) @@ -1767,10 +1767,10 @@ Peep* Peep::Generate(const CoordsXYZ& coords) peep->TimeLost = 0; uint8_t tshirtColour = static_cast(scenario_rand() % std::size(tshirt_colours)); - peep->tshirt_colour = tshirt_colours[tshirtColour]; + peep->TshirtColour = tshirt_colours[tshirtColour]; uint8_t trousersColour = static_cast(scenario_rand() % std::size(trouser_colours)); - peep->trousers_colour = trouser_colours[trousersColour]; + peep->TrousersColour = trouser_colours[trousersColour]; /* Minimum energy is capped at 32 and maximum at 128, so this initialises * a peep with approx 34%-100% energy. (65 - 32) / (128 - 32) ≈ 34% */ @@ -1791,7 +1791,7 @@ void Peep::FormatActionTo(Formatter& ft) const void Peep::FormatActionTo(void* argsV) const { Formatter ft(static_cast(argsV)); - switch (state) + switch (State) { case PEEP_STATE_FALLING: ft.Add(Action == PEEP_ACTION_DROWNING ? STR_DROWNING : STR_WALKING); @@ -1895,11 +1895,11 @@ void Peep::FormatActionTo(void* argsV) const ft.Add(STR_EMPTYING_LITTER_BIN); break; case PEEP_STATE_ANSWERING: - if (sub_state == 0) + if (SubState == 0) { ft.Add(STR_WALKING); } - else if (sub_state == 1) + else if (SubState == 1) { ft.Add(STR_ANSWERING_RADIO_CALL); } @@ -1970,9 +1970,9 @@ void Peep::FormatNameTo(Formatter& ft) const size_t Peep::FormatNameTo(void* argsV) const { Formatter ft(static_cast(argsV)); - if (name == nullptr) + if (Name == nullptr) { - if (type == PeepType::PEEP_TYPE_STAFF) + if (AssignedPeepType == PeepType::PEEP_TYPE_STAFF) { static constexpr const rct_string_id staffNames[] = { STR_HANDYMAN_X, @@ -1981,7 +1981,7 @@ size_t Peep::FormatNameTo(void* argsV) const STR_ENTERTAINER_X, }; - auto staffNameIndex = staff_type; + auto staffNameIndex = StaffType; if (staffNameIndex > sizeof(staffNames)) { staffNameIndex = 0; @@ -2003,7 +2003,7 @@ size_t Peep::FormatNameTo(void* argsV) const } else { - return ft.Add(STR_STRING).Add(name).NumBytes(); + return ft.Add(STR_STRING).Add(Name).NumBytes(); } } @@ -2018,8 +2018,8 @@ bool Peep::SetName(const std::string_view& value) { if (value.empty()) { - std::free(name); - name = nullptr; + std::free(Name); + Name = nullptr; return true; } else @@ -2029,8 +2029,8 @@ bool Peep::SetName(const std::string_view& value) { std::memcpy(newNameMemory, value.data(), value.size()); newNameMemory[value.size()] = '\0'; - std::free(name); - name = newNameMemory; + std::free(Name); + Name = newNameMemory; return true; } } @@ -2107,7 +2107,7 @@ static constexpr const bool peep_allow_pick_up[] = { */ bool peep_can_be_picked_up(Peep* peep) { - return peep_allow_pick_up[peep->state]; + return peep_allow_pick_up[peep->State]; } enum @@ -2216,7 +2216,7 @@ int32_t get_peep_face_sprite_large(Peep* peep) void peep_set_map_tooltip(Peep* peep) { auto ft = Formatter::MapTooltip(); - if (peep->type == PEEP_TYPE_GUEST) + if (peep->AssignedPeepType == PEEP_TYPE_GUEST) { ft.Add((peep->PeepFlags & PEEP_FLAGS_TRACKING) ? STR_TRACKED_GUEST_MAP_TIP : STR_GUEST_MAP_TIP); ft.Add(get_peep_face_sprite_small(peep)); @@ -2241,7 +2241,7 @@ void Peep::SwitchNextActionSpriteType() { Invalidate(); ActionSpriteType = NextActionSpriteType; - const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[sprite_type].sprite_bounds; + const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[SpriteType].sprite_bounds; sprite_width = spriteBounds[NextActionSpriteType].sprite_width; sprite_height_negative = spriteBounds[NextActionSpriteType].sprite_height_negative; sprite_height_positive = spriteBounds[NextActionSpriteType].sprite_height_positive; @@ -2328,9 +2328,9 @@ static bool peep_update_queue_position(Peep* peep, uint8_t previous_action) static void peep_return_to_centre_of_tile(Peep* peep) { peep->PeepDirection = direction_reverse(peep->PeepDirection); - peep->destination_x = (peep->x & 0xFFE0) + 16; - peep->destination_y = (peep->y & 0xFFE0) + 16; - peep->destination_tolerance = 5; + peep->DestinationX = (peep->x & 0xFFE0) + 16; + peep->DestinationY = (peep->y & 0xFFE0) + 16; + peep->DestinationTolerance = 5; } /** @@ -2381,10 +2381,10 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl return; } - if (peep->state == PEEP_STATE_QUEUING) + if (peep->State == PEEP_STATE_QUEUING) { // Guest is in the ride queue. - peep->sub_state = 11; + peep->SubState = 11; peep->ActionSpriteImageOffset = _unk_F1AEF0; return; } @@ -2427,7 +2427,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl peep->CurrentRideStation = stationNum; peep->DaysInQueue = 0; peep->SetState(PEEP_STATE_QUEUING); - peep->sub_state = 11; + peep->SubState = 11; peep->TimeInQueue = 0; if (peep->PeepFlags & PEEP_FLAGS_TRACKING) { @@ -2468,7 +2468,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl } // Peep is leaving the park. - if (peep->state != PEEP_STATE_WALKING) + if (peep->State != PEEP_STATE_WALKING) { peep_return_to_centre_of_tile(peep); return; @@ -2484,9 +2484,9 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl } } - peep->destination_x += CoordsDirectionDelta[peep->PeepDirection].x; - peep->destination_y += CoordsDirectionDelta[peep->PeepDirection].y; - peep->destination_tolerance = 9; + peep->DestinationX += CoordsDirectionDelta[peep->PeepDirection].x; + peep->DestinationY += CoordsDirectionDelta[peep->PeepDirection].y; + peep->DestinationTolerance = 9; peep->MoveTo({ x, y, peep->z }); peep->SetState(PEEP_STATE_LEAVING_PARK); @@ -2505,7 +2505,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl // Peep is entering the park. - if (peep->state != PEEP_STATE_ENTERING_PARK) + if (peep->State != PEEP_STATE_ENTERING_PARK) { peep_return_to_centre_of_tile(peep); return; @@ -2513,7 +2513,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl if (!(gParkFlags & PARK_FLAGS_PARK_OPEN)) { - peep->state = PEEP_STATE_LEAVING_PARK; + peep->State = PEEP_STATE_LEAVING_PARK; peep->Var37 = 1; decrement_guests_heading_for_park(); peep_window_state_update(peep); @@ -2580,7 +2580,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl if (!found) { - peep->state = PEEP_STATE_LEAVING_PARK; + peep->State = PEEP_STATE_LEAVING_PARK; peep->Var37 = 1; decrement_guests_heading_for_park(); peep_window_state_update(peep); @@ -2608,7 +2608,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl } if (entranceFee > peep->CashInPocket) { - peep->state = PEEP_STATE_LEAVING_PARK; + peep->State = PEEP_STATE_LEAVING_PARK; peep->Var37 = 1; decrement_guests_heading_for_park(); peep_window_state_update(peep); @@ -2625,9 +2625,9 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl window_invalidate_by_number(WC_PARK_INFORMATION, 0); peep->Var37 = 1; - peep->destination_x += CoordsDirectionDelta[peep->PeepDirection].x; - peep->destination_y += CoordsDirectionDelta[peep->PeepDirection].y; - peep->destination_tolerance = 7; + peep->DestinationX += CoordsDirectionDelta[peep->PeepDirection].x; + peep->DestinationY += CoordsDirectionDelta[peep->PeepDirection].y; + peep->DestinationTolerance = 7; peep->MoveTo({ x, y, peep->z }); } } @@ -2643,7 +2643,7 @@ static void peep_footpath_move_forward(Peep* peep, int16_t x, int16_t y, TileEle int16_t z = peep->GetZOnSlope(x, y); - if (peep->type == PEEP_TYPE_STAFF) + if (peep->AssignedPeepType == PEEP_TYPE_STAFF) { peep->MoveTo({ x, y, z }); return; @@ -2685,7 +2685,7 @@ static void peep_footpath_move_forward(Peep* peep, int16_t x, int16_t y, TileEle if (sprite->generic.Is()) { Peep* other_peep = reinterpret_cast(sprite); - if (other_peep->state != PEEP_STATE_WALKING) + if (other_peep->State != PEEP_STATE_WALKING) continue; if (abs(other_peep->z - peep->NextLoc.z) > 16) @@ -2708,7 +2708,7 @@ static void peep_footpath_move_forward(Peep* peep, int16_t x, int16_t y, TileEle } } - if (crowded >= 10 && peep->state == PEEP_STATE_WALKING && (scenario_rand() & 0xFFFF) <= 21845) + if (crowded >= 10 && peep->State == PEEP_STATE_WALKING && (scenario_rand() & 0xFFFF) <= 21845) { peep->InsertNewThought(PEEP_THOUGHT_TYPE_CROWDED, PEEP_THOUGHT_ITEM_NONE); peep->HappinessTarget = std::max(0, peep->HappinessTarget - 14); @@ -2789,7 +2789,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen int16_t z = tile_element->GetBaseZ(); if (map_is_location_owned({ x, y, z })) { - if (peep->outside_of_park == 1) + if (peep->OutsideOfPark == 1) { peep_return_to_centre_of_tile(peep); return; @@ -2797,7 +2797,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen } else { - if (peep->outside_of_park == 0) + if (peep->OutsideOfPark == 0) { peep_return_to_centre_of_tile(peep); return; @@ -2808,7 +2808,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen if (guest != nullptr && tile_element->AsPath()->IsQueue()) { auto rideIndex = tile_element->AsPath()->GetRideIndex(); - if (peep->state == PEEP_STATE_QUEUING) + if (peep->State == PEEP_STATE_QUEUING) { // Check if this queue is connected to the ride the // peep is queuing for, i.e. the player hasn't edited @@ -2854,12 +2854,12 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen peep_decrement_num_riders(peep); peep->CurrentRide = rideIndex; peep->CurrentRideStation = stationNum; - peep->state = PEEP_STATE_QUEUING; + peep->State = PEEP_STATE_QUEUING; peep->DaysInQueue = 0; peep_window_state_update(peep); - peep->sub_state = 10; - peep->destination_tolerance = 2; + peep->SubState = 10; + peep->DestinationTolerance = 2; peep->TimeInQueue = 0; if (peep->PeepFlags & PEEP_FLAGS_TRACKING) { @@ -2892,7 +2892,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen else { peep->InteractionRideIndex = 0xFF; - if (peep->state == PEEP_STATE_QUEUING) + if (peep->State == PEEP_STATE_QUEUING) { peep->RemoveFromQueue(); peep->SetState(PEEP_STATE_1); @@ -2958,13 +2958,13 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen money16 money = 0; guest->SpendMoney(money, cost, ExpenditureType::ParkRideTickets); } - peep->destination_x = (x & 0xFFE0) + 16; - peep->destination_y = (y & 0xFFE0) + 16; - peep->destination_tolerance = 3; + peep->DestinationX = (x & 0xFFE0) + 16; + peep->DestinationY = (y & 0xFFE0) + 16; + peep->DestinationTolerance = 3; peep->CurrentRide = rideIndex; peep->SetState(PEEP_STATE_ENTERING_RIDE); - peep->sub_state = PEEP_SHOP_APPROACH; + peep->SubState = PEEP_SHOP_APPROACH; peep->GuestTimeOnRide = 0; ride->cur_num_customers++; @@ -2988,7 +2988,7 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen peep->ActionSpriteImageOffset = _unk_F1AEF0; peep->SetState(PEEP_STATE_BUYING); peep->CurrentRide = rideIndex; - peep->sub_state = 0; + peep->SubState = 0; } return true; @@ -3039,7 +3039,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) if (Action == PEEP_ACTION_NONE_1) Action = PEEP_ACTION_NONE_2; - if (state == PEEP_STATE_QUEUING) + if (State == PEEP_STATE_QUEUING) { if (peep_update_queue_position(this, previousAction)) return; @@ -3080,7 +3080,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) if (map_is_edge(newLoc)) { - if (outside_of_park == 1) + if (OutsideOfPark == 1) { pathing_result |= PATHING_OUTSIDE_PARK; } @@ -3125,13 +3125,13 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) } } while (!(tileElement++)->IsLastForTile()); - if (type == PEEP_TYPE_STAFF || (GetNextIsSurface())) + if (AssignedPeepType == PEEP_TYPE_STAFF || (GetNextIsSurface())) { int16_t height = abs(tile_element_height(newLoc) - z); - if (height <= 3 || (type == PEEP_TYPE_STAFF && height <= 32)) + if (height <= 3 || (AssignedPeepType == PEEP_TYPE_STAFF && height <= 32)) { InteractionRideIndex = 0xFF; - if (state == PEEP_STATE_QUEUING) + if (State == PEEP_STATE_QUEUING) { RemoveFromQueue(); SetState(PEEP_STATE_1); @@ -3157,7 +3157,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) return; } - if (type == PEEP_TYPE_STAFF && !GetNextIsSurface()) + if (AssignedPeepType == PEEP_TYPE_STAFF && !GetNextIsSurface()) { // Prevent staff from leaving the path on their own unless they're allowed to mow. if (!((this->StaffOrders & STAFF_ORDERS_MOWING) && this->StaffMowingTimeout >= 12)) @@ -3247,12 +3247,12 @@ int32_t peep_compare(const uint16_t sprite_index_a, const uint16_t sprite_index_ Peep const* peep_b = GET_PEEP(sprite_index_b); // Compare types - if (peep_a->type != peep_b->type) + if (peep_a->AssignedPeepType != peep_b->AssignedPeepType) { - return peep_a->type - peep_b->type; + return peep_a->AssignedPeepType - peep_b->AssignedPeepType; } - if (peep_a->name == nullptr && peep_b->name == nullptr) + if (peep_a->Name == nullptr && peep_b->Name == nullptr) { if (gParkFlags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES) { @@ -3386,7 +3386,7 @@ static void peep_release_balloon(Guest* peep, int16_t spawn_height) { peep->ItemStandardFlags &= ~PEEP_ITEM_BALLOON; - if (peep->sprite_type == PEEP_SPRITE_TYPE_BALLOON && peep->x != LOCATION_NULL) + if (peep->SpriteType == PEEP_SPRITE_TYPE_BALLOON && peep->x != LOCATION_NULL) { create_balloon(peep->x, peep->y, spawn_height, peep->BalloonColour, false); peep->WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_INVENTORY; @@ -3438,7 +3438,7 @@ void Peep::RemoveFromQueue() */ void Peep::RemoveFromRide() { - if (state == PEEP_STATE_QUEUING) + if (State == PEEP_STATE_QUEUING) { RemoveFromQueue(); } diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 48b085ad98..67b832c2a5 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -596,24 +596,24 @@ public: struct Peep : SpriteBase { - char* name; + char* Name; CoordsXYZ NextLoc; - uint8_t next_flags; - uint8_t outside_of_park; - PeepState state; - uint8_t sub_state; - PeepSpriteType sprite_type; - PeepType type; + uint8_t NextFlags; + uint8_t OutsideOfPark; + PeepState State; + uint8_t SubState; + PeepSpriteType SpriteType; + PeepType AssignedPeepType; union { - uint8_t staff_type; - uint8_t no_of_rides; + uint8_t StaffType; + uint8_t GuestNumRides; }; - uint8_t tshirt_colour; - uint8_t trousers_colour; - uint16_t destination_x; // Location that the peep is trying to get to - uint16_t destination_y; - uint8_t destination_tolerance; // How close to destination before next action/state 0 = exact + uint8_t TshirtColour; + uint8_t TrousersColour; + uint16_t DestinationX; // Location that the peep is trying to get to + uint16_t DestinationY; + uint8_t DestinationTolerance; // How close to destination before next action/state 0 = exact uint8_t Var37; uint8_t Energy; uint8_t EnergyTarget; @@ -998,11 +998,11 @@ enum #define FOR_ALL_GUESTS(sprite_index, peep) \ FOR_ALL_PEEPS (sprite_index, peep) \ - if ((peep)->type == PEEP_TYPE_GUEST) + if ((peep)->AssignedPeepType == PEEP_TYPE_GUEST) #define FOR_ALL_STAFF(sprite_index, peep) \ FOR_ALL_PEEPS (sprite_index, peep) \ - if ((peep)->type == PEEP_TYPE_STAFF) + if ((peep)->AssignedPeepType == PEEP_TYPE_STAFF) // rct2: 0x00982708 extern rct_peep_animation_entry g_peep_animation_entries[PEEP_SPRITE_TYPE_COUNT]; diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index ea7ebc47da..56896abe37 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -155,7 +155,7 @@ void staff_update_greyed_patrol_areas() FOR_ALL_STAFF (sprite_index, peep) { - if (peep->staff_type == staff_type) + if (peep->StaffType == staff_type) { int32_t peepPatrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE; for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++) @@ -223,7 +223,7 @@ bool staff_can_ignore_wide_flag(Peep* staff, int32_t x, int32_t y, uint8_t z, Ti * both of these tiles are connected wide paths, the wide flag can be * ignored. */ - if (staff->type != PEEP_TYPE_STAFF) + if (staff->AssignedPeepType != PEEP_TYPE_STAFF) return false; if (!staff_is_location_on_patrol_edge(staff, x, y)) @@ -688,12 +688,12 @@ bool Staff::DoHandymanPathFinding() } PeepDirection = newDirection; - destination_x = chosenTile.x + 16; - destination_y = chosenTile.y + 16; - destination_tolerance = 3; - if (state == PEEP_STATE_QUEUING) + DestinationX = chosenTile.x + 16; + DestinationY = chosenTile.y + 16; + DestinationTolerance = 3; + if (State == PEEP_STATE_QUEUING) { - destination_tolerance = (scenario_rand() & 7) + 2; + DestinationTolerance = (scenario_rand() & 7) + 2; } return false; } @@ -746,7 +746,7 @@ static uint8_t staff_mechanic_direction_surface(Peep* peep) uint8_t direction = scenario_rand() & 3; auto ride = get_ride(peep->CurrentRide); - if (ride != nullptr && (peep->state == PEEP_STATE_ANSWERING || peep->state == PEEP_STATE_HEADING_TO_INSPECTION) + if (ride != nullptr && (peep->State == PEEP_STATE_ANSWERING || peep->State == PEEP_STATE_HEADING_TO_INSPECTION) && (scenario_rand() & 1)) { auto location = ride_get_exit_location(ride, peep->CurrentRideStation); @@ -823,23 +823,23 @@ static uint8_t staff_mechanic_direction_path(Peep* peep, uint8_t validDirections pathDirections &= ~(1 << direction); if (pathDirections == 0) { - if (peep->state != PEEP_STATE_ANSWERING && peep->state != PEEP_STATE_HEADING_TO_INSPECTION) + if (peep->State != PEEP_STATE_ANSWERING && peep->State != PEEP_STATE_HEADING_TO_INSPECTION) { return direction; } - if (peep->sub_state != 2) + if (peep->SubState != 2) { return direction; } - peep->sub_state = 3; + peep->SubState = 3; } pathDirections |= (1 << direction); // Mechanic is heading to ride (either broken down or for inspection). auto ride = get_ride(peep->CurrentRide); - if (ride != nullptr && (peep->state == PEEP_STATE_ANSWERING || peep->state == PEEP_STATE_HEADING_TO_INSPECTION)) + if (ride != nullptr && (peep->State == PEEP_STATE_ANSWERING || peep->State == PEEP_STATE_HEADING_TO_INSPECTION)) { /* Find location of the exit for the target ride station * or if the ride has no exit, the entrance. */ @@ -922,9 +922,9 @@ bool Staff::DoMechanicPathFinding() } PeepDirection = newDirection; - destination_x = chosenTile.x + 16; - destination_y = chosenTile.y + 16; - destination_tolerance = (scenario_rand() & 7) + 2; + DestinationX = chosenTile.x + 16; + DestinationY = chosenTile.y + 16; + DestinationTolerance = (scenario_rand() & 7) + 2; return false; } @@ -937,7 +937,7 @@ static uint8_t staff_direction_path(Peep* peep, uint8_t validDirections, PathEle { Direction direction = INVALID_DIRECTION; uint8_t pathDirections = pathElement->GetEdges(); - if (peep->state != PEEP_STATE_ANSWERING && peep->state != PEEP_STATE_HEADING_TO_INSPECTION) + if (peep->State != PEEP_STATE_ANSWERING && peep->State != PEEP_STATE_HEADING_TO_INSPECTION) { pathDirections &= validDirections; } @@ -1005,9 +1005,9 @@ bool Staff::DoMiscPathFinding() } PeepDirection = newDirection; - destination_x = chosenTile.x + 16; - destination_y = chosenTile.y + 16; - destination_tolerance = (scenario_rand() & 7) + 2; + DestinationX = chosenTile.x + 16; + DestinationY = chosenTile.y + 16; + DestinationTolerance = (scenario_rand() & 7) + 2; return false; } @@ -1039,11 +1039,11 @@ static void staff_entertainer_update_nearby_peeps(Peep* peep) if (y_dist > 96) continue; - if (peep->state == PEEP_STATE_WALKING) + if (peep->State == PEEP_STATE_WALKING) { peep->HappinessTarget = std::min(peep->HappinessTarget + 4, PEEP_MAX_HAPPINESS); } - else if (peep->state == PEEP_STATE_QUEUING) + else if (peep->State == PEEP_STATE_QUEUING) { if (peep->TimeInQueue > 200) { @@ -1083,7 +1083,7 @@ bool Staff::DoEntertainerPathFinding() */ bool Staff::DoPathFinding() { - switch (staff_type) + switch (StaffType) { case STAFF_TYPE_HANDYMAN: return DoHandymanPathFinding(); @@ -1102,12 +1102,12 @@ bool Staff::DoPathFinding() uint8_t Staff::GetCostume() const { - return sprite_type - PEEP_SPRITE_TYPE_ENTERTAINER_PANDA; + return SpriteType - PEEP_SPRITE_TYPE_ENTERTAINER_PANDA; } void Staff::SetCostume(uint8_t value) { - sprite_type = static_cast(value + PEEP_SPRITE_TYPE_ENTERTAINER_PANDA); + SpriteType = static_cast(value + PEEP_SPRITE_TYPE_ENTERTAINER_PANDA); } colour_t staff_get_colour(uint8_t staffType) @@ -1219,8 +1219,8 @@ void Staff::UpdateMowing() return; } - destination_x = _MowingWaypoints[Var37].x + NextLoc.x; - destination_y = _MowingWaypoints[Var37].y + NextLoc.y; + DestinationX = _MowingWaypoints[Var37].x + NextLoc.x; + DestinationY = _MowingWaypoints[Var37].y + NextLoc.y; if (Var37 != 7) continue; @@ -1243,7 +1243,7 @@ void Staff::UpdateMowing() void Staff::UpdateWatering() { StaffMowingTimeout = 0; - if (sub_state == 0) + if (SubState == 0) { if (!CheckForPath()) return; @@ -1259,9 +1259,9 @@ void Staff::UpdateWatering() ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); - sub_state = 1; + SubState = 1; } - else if (sub_state == 1) + else if (SubState == 1) { if (Action != PEEP_ACTION_NONE_2) { @@ -1307,7 +1307,7 @@ void Staff::UpdateEmptyingBin() { StaffMowingTimeout = 0; - if (sub_state == 0) + if (SubState == 0) { if (!CheckForPath()) return; @@ -1323,9 +1323,9 @@ void Staff::UpdateEmptyingBin() ActionSpriteImageOffset = 0; UpdateCurrentActionSpriteType(); - sub_state = 1; + SubState = 1; } - else if (sub_state == 1) + else if (SubState == 1) { if (Action == PEEP_ACTION_NONE_2) { @@ -1442,14 +1442,14 @@ void Staff::UpdateHeadingToInspect() return; } - if (sub_state == 0) + if (SubState == 0) { MechanicTimeSinceCall = 0; peep_reset_pathfind_goal(this); - sub_state = 2; + SubState = 2; } - if (sub_state <= 3) + if (SubState <= 3) { MechanicTimeSinceCall++; if (MechanicTimeSinceCall > 2500) @@ -1495,17 +1495,17 @@ void Staff::UpdateHeadingToInspect() 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; + DestinationX = destX; + DestinationY = destY; + DestinationTolerance = 2; sprite_direction = PeepDirection << 3; z = rideEntranceExitElement->base_height * 4; - sub_state = 4; - // Falls through into sub_state 4 + SubState = 4; + // Falls through into SubState 4 } - int16_t delta_y = abs(y - destination_y); + int16_t delta_y = abs(y - DestinationY); if (auto loc = UpdateAction()) { int32_t newZ = ride->stations[CurrentRideStation].GetBaseZ(); @@ -1520,7 +1520,7 @@ void Staff::UpdateHeadingToInspect() } SetState(PEEP_STATE_INSPECTING); - sub_state = 0; + SubState = 0; } /** @@ -1536,7 +1536,7 @@ void Staff::UpdateAnswering() return; } - if (sub_state == 0) + if (SubState == 0) { Action = PEEP_ACTION_STAFF_ANSWER_CALL; ActionFrame = 0; @@ -1544,15 +1544,15 @@ void Staff::UpdateAnswering() UpdateCurrentActionSpriteType(); - sub_state = 1; + SubState = 1; peep_window_state_update(this); return; } - else if (sub_state == 1) + else if (SubState == 1) { if (Action == PEEP_ACTION_NONE_2) { - sub_state = 2; + SubState = 2; peep_window_state_update(this); MechanicTimeSinceCall = 0; peep_reset_pathfind_goal(this); @@ -1562,7 +1562,7 @@ void Staff::UpdateAnswering() Invalidate(); return; } - else if (sub_state <= 3) + else if (SubState <= 3) { MechanicTimeSinceCall++; if (MechanicTimeSinceCall > 2500) @@ -1606,17 +1606,17 @@ void Staff::UpdateAnswering() 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; + DestinationX = destX; + DestinationY = destY; + DestinationTolerance = 2; sprite_direction = PeepDirection << 3; z = rideEntranceExitElement->base_height * 4; - sub_state = 4; - // Falls through into sub_state 4 + SubState = 4; + // Falls through into SubState 4 } - int16_t delta_y = abs(y - destination_y); + int16_t delta_y = abs(y - DestinationY); if (auto loc = UpdateAction()) { int32_t newZ = ride->stations[CurrentRideStation].GetBaseZ(); @@ -1631,7 +1631,7 @@ void Staff::UpdateAnswering() } SetState(PEEP_STATE_FIXING); - sub_state = 0; + SubState = 0; } /** rct2: 0x00992A5C */ @@ -1700,10 +1700,10 @@ static int32_t peep_update_patrolling_find_watering(Peep* peep) peep->SetState(PEEP_STATE_WATERING); peep->Var37 = chosen_position; - peep->sub_state = 0; - peep->destination_x = (peep->x & 0xFFE0) + _WateringUseOffsets[chosen_position].x; - peep->destination_y = (peep->y & 0xFFE0) + _WateringUseOffsets[chosen_position].y; - peep->destination_tolerance = 3; + peep->SubState = 0; + peep->DestinationX = (peep->x & 0xFFE0) + _WateringUseOffsets[chosen_position].x; + peep->DestinationY = (peep->y & 0xFFE0) + _WateringUseOffsets[chosen_position].y; + peep->DestinationTolerance = 3; return 1; } while (!(tile_element++)->IsLastForTile()); @@ -1769,10 +1769,10 @@ static int32_t peep_update_patrolling_find_bin(Peep* peep) peep->Var37 = chosen_position; peep->SetState(PEEP_STATE_EMPTYING_BIN); - peep->sub_state = 0; - peep->destination_x = (peep->x & 0xFFE0) + BinUseOffsets[chosen_position].x; - peep->destination_y = (peep->y & 0xFFE0) + BinUseOffsets[chosen_position].y; - peep->destination_tolerance = 3; + peep->SubState = 0; + peep->DestinationX = (peep->x & 0xFFE0) + BinUseOffsets[chosen_position].x; + peep->DestinationY = (peep->y & 0xFFE0) + BinUseOffsets[chosen_position].y; + peep->DestinationTolerance = 3; return 1; } @@ -1799,9 +1799,9 @@ static int32_t peep_update_patrolling_find_grass(Peep* peep) peep->SetState(PEEP_STATE_MOWING); peep->Var37 = 0; // Original code used .y for both x and y. Changed to .x to make more sense (both x and y are 28) - peep->destination_x = peep->NextLoc.x + _MowingWaypoints[0].x; - peep->destination_y = peep->NextLoc.y + _MowingWaypoints[0].y; - peep->destination_tolerance = 3; + peep->DestinationX = peep->NextLoc.x + _MowingWaypoints[0].x; + peep->DestinationY = peep->NextLoc.y + _MowingWaypoints[0].y; + peep->DestinationTolerance = 3; return 1; } } @@ -1833,9 +1833,9 @@ static int32_t peep_update_patrolling_find_sweeping(Peep* peep) peep->SetState(PEEP_STATE_SWEEPING); peep->Var37 = 0; - peep->destination_x = sprite->litter.x; - peep->destination_y = sprite->litter.y; - peep->destination_tolerance = 5; + peep->DestinationX = sprite->litter.x; + peep->DestinationY = sprite->litter.y; + peep->DestinationTolerance = 5; return 1; } @@ -1844,17 +1844,17 @@ static int32_t peep_update_patrolling_find_sweeping(Peep* peep) void Staff::Tick128UpdateStaff() { - if (staff_type != STAFF_TYPE_SECURITY) + if (StaffType != STAFF_TYPE_SECURITY) return; PeepSpriteType newSpriteType = PEEP_SPRITE_TYPE_SECURITY_ALT; - if (state != PEEP_STATE_PATROLLING) + if (State != PEEP_STATE_PATROLLING) newSpriteType = PEEP_SPRITE_TYPE_SECURITY; - if (sprite_type == newSpriteType) + if (SpriteType == newSpriteType) return; - sprite_type = newSpriteType; + SpriteType = newSpriteType; ActionSpriteImageOffset = 0; WalkingFrameNum = 0; if (Action < PEEP_ACTION_NONE_1) @@ -1872,12 +1872,13 @@ void Staff::Tick128UpdateStaff() bool Staff::IsMechanic() const { - return (sprite_identifier == SPRITE_IDENTIFIER_PEEP && type == PEEP_TYPE_STAFF && staff_type == STAFF_TYPE_MECHANIC); + return ( + sprite_identifier == SPRITE_IDENTIFIER_PEEP && AssignedPeepType == PEEP_TYPE_STAFF && StaffType == STAFF_TYPE_MECHANIC); } void Staff::UpdateStaff(uint32_t stepsToTake) { - switch (state) + switch (State) { case PEEP_STATE_PATROLLING: UpdatePatrolling(); @@ -1943,7 +1944,7 @@ void Staff::UpdatePatrolling() } } - if (staff_type != STAFF_TYPE_HANDYMAN) + if (StaffType != STAFF_TYPE_HANDYMAN) return; if (peep_update_patrolling_find_sweeping(this)) @@ -2075,20 +2076,20 @@ void Staff::UpdateFixing(int32_t steps) bool progressToNextSubstate = true; bool firstRun = true; - if ((state == PEEP_STATE_INSPECTING) + if ((State == PEEP_STATE_INSPECTING) && (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN))) { // Ride has broken down since Mechanic was called to inspect it. // Mechanic identifies the breakdown and switches to fixing it. - state = PEEP_STATE_FIXING; + State = PEEP_STATE_FIXING; } while (progressToNextSubstate) { - switch (sub_state) + switch (SubState) { case PEEP_FIXING_ENTER_STATION: - next_flags &= ~PEEP_NEXT_FLAG_IS_SLOPED; + NextFlags &= ~PEEP_NEXT_FLAG_IS_SLOPED; progressToNextSubstate = UpdateFixingEnterStation(ride); break; @@ -2151,10 +2152,10 @@ void Staff::UpdateFixing(int32_t steps) break; } - int32_t subState = sub_state; + int32_t subState = SubState; uint32_t sub_state_sequence_mask = FixingSubstatesForBreakdown[8]; - if (state != PEEP_STATE_INSPECTING) + if (State != PEEP_STATE_INSPECTING) { sub_state_sequence_mask = FixingSubstatesForBreakdown[ride->breakdown_reason_pending]; } @@ -2164,13 +2165,13 @@ void Staff::UpdateFixing(int32_t steps) subState++; } while ((sub_state_sequence_mask & (1 << subState)) == 0); - sub_state = subState & 0xFF; + SubState = subState & 0xFF; } } /** * rct2: 0x006C0EEC - * fixing sub_state: enter_station - applies to fixing all break down reasons and ride inspections. + * fixing SubState: enter_station - applies to fixing all break down reasons and ride inspections. */ bool Staff::UpdateFixingEnterStation(Ride* ride) { @@ -2182,7 +2183,7 @@ bool Staff::UpdateFixingEnterStation(Ride* ride) /** * rct2: 0x006C0F09 - * fixing sub_state: move_to_broken_down_vehicle - applies to fixing all vehicle specific breakdown reasons + * fixing SubState: move_to_broken_down_vehicle - applies to fixing all vehicle specific breakdown reasons * - see FixingSubstatesForBreakdown[] */ bool Staff::UpdateFixingMoveToBrokenDownVehicle(bool firstRun, Ride* ride) @@ -2212,9 +2213,9 @@ bool Staff::UpdateFixingMoveToBrokenDownVehicle(bool firstRun, Ride* ride) } CoordsXY offset = DirectionOffsets[PeepDirection]; - destination_x = (offset.x * -12) + vehicle->x; - destination_y = (offset.y * -12) + vehicle->y; - destination_tolerance = 2; + DestinationX = (offset.x * -12) + vehicle->x; + DestinationY = (offset.y * -12) + vehicle->y; + DestinationTolerance = 2; } if (auto loc = UpdateAction()) @@ -2228,7 +2229,7 @@ bool Staff::UpdateFixingMoveToBrokenDownVehicle(bool firstRun, Ride* ride) /** * rct2: 0x006C0FD3 - * fixing sub_state: fix_vehicle - applies to fixing vehicle with: + * fixing SubState: fix_vehicle - applies to fixing vehicle with: * 1. restraints stuck closed, * 2. doors stuck closed, * 3. restrains stuck open, @@ -2274,7 +2275,7 @@ bool Staff::UpdateFixingFixVehicle(bool firstRun, Ride* ride) /** * rct2: 0x006C107B - * fixing sub_state: fix_vehicle_malfunction - applies fixing to vehicle malfunction. + * fixing SubState: fix_vehicle_malfunction - applies fixing to vehicle malfunction. * - see FixingSubstatesForBreakdown[] */ bool Staff::UpdateFixingFixVehicleMalfunction(bool firstRun, Ride* ride) @@ -2323,7 +2324,7 @@ static constexpr const CoordsXY _StationFixingOffsets[] = { /** * rct2: 0x006C1114 - * fixing sub_state: move_to_station_end - applies to fixing station specific breakdowns: safety cut-out, control failure, + * fixing SubState: move_to_station_end - applies to fixing station specific breakdowns: safety cut-out, control failure, * inspection. * - see FixingSubstatesForBreakdown[] */ @@ -2355,18 +2356,18 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, Ride* ride) stationPos.x += 16 + offset.x; if (offset.x == 0) { - stationPos.x = destination_x; + stationPos.x = DestinationX; } stationPos.y += 16 + offset.y; if (offset.y == 0) { - stationPos.y = destination_y; + stationPos.y = DestinationY; } - destination_x = stationPos.x; - destination_y = stationPos.y; - destination_tolerance = 2; + DestinationX = stationPos.x; + DestinationY = stationPos.y; + DestinationTolerance = 2; } if (auto loc = UpdateAction()) @@ -2380,7 +2381,7 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, Ride* ride) /** * rct2: 0x006C11F5 - * fixing sub_state: fix_station_end - applies to fixing station specific breakdowns: safety cut-out, control failure, + * fixing SubState: fix_station_end - applies to fixing station specific breakdowns: safety cut-out, control failure, * inspection. * - see FixingSubstatesForBreakdown[] */ @@ -2409,7 +2410,7 @@ bool Staff::UpdateFixingFixStationEnd(bool firstRun) /** * rct2: 0x006C1239 - * fixing sub_state: move_to_station_start + * fixing SubState: move_to_station_start * 1. applies to fixing station specific breakdowns: safety cut-out, control failure, * 2. applies to fixing brake failure, * 3. applies to inspection. @@ -2465,18 +2466,18 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, Ride* ride) destinationX -= offset.x; if (offset.x == 0) { - destinationX = destination_x; + destinationX = DestinationX; } destinationY -= offset.y; if (offset.y == 0) { - destinationY = destination_y; + destinationY = DestinationY; } - destination_x = destinationX; - destination_y = destinationY; - destination_tolerance = 2; + DestinationX = destinationX; + DestinationY = destinationY; + DestinationTolerance = 2; } if (auto loc = UpdateAction()) @@ -2490,7 +2491,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, Ride* ride) /** * rct2: 0x006C1368 - * fixing sub_state: fix_station_start + * fixing SubState: fix_station_start * 1. applies to fixing station specific breakdowns: safety cut-out, control failure, * 2. applies to inspection. * - see FixingSubstatesForBreakdown[] @@ -2525,7 +2526,7 @@ bool Staff::UpdateFixingFixStationStart(bool firstRun, Ride* ride) /** * rct2: 0x006C13CE - * fixing sub_state: fix_station_brakes - applies to fixing brake failure + * fixing SubState: fix_station_brakes - applies to fixing brake failure * - see FixingSubstatesForBreakdown[] */ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride* ride) @@ -2565,7 +2566,7 @@ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride* ride) /** * rct2: 0x006C1474 - * fixing sub_state: move_to_station_exit - applies to fixing all failures & inspections + * fixing SubState: move_to_station_exit - applies to fixing all failures & inspections * - see FixingSubstatesForBreakdown[] */ bool Staff::UpdateFixingMoveToStationExit(bool firstRun, Ride* ride) @@ -2589,9 +2590,9 @@ bool Staff::UpdateFixingMoveToStationExit(bool firstRun, Ride* ride) stationPosition.x += stationPlatformDirection.x * 20; stationPosition.y += stationPlatformDirection.y * 20; - destination_x = stationPosition.x; - destination_y = stationPosition.y; - destination_tolerance = 2; + DestinationX = stationPosition.x; + DestinationY = stationPosition.y; + DestinationTolerance = 2; } if (auto loc = UpdateAction()) @@ -2607,7 +2608,7 @@ bool Staff::UpdateFixingMoveToStationExit(bool firstRun, Ride* ride) /** * rct2: 0x006C1504 - * fixing sub_state: finish_fix_or_inspect - applies to fixing all failures & inspections + * fixing SubState: finish_fix_or_inspect - applies to fixing all failures & inspections * - see FixingSubstatesForBreakdown[] */ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* ride) @@ -2616,7 +2617,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* r { ride->mechanic_status = RIDE_MECHANIC_STATUS_UNDEFINED; - if (state == PEEP_STATE_INSPECTING) + if (State == PEEP_STATE_INSPECTING) { UpdateRideInspected(CurrentRide); @@ -2651,7 +2652,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* r /** * rct2: 0x006C157E - * fixing sub_state: leave_by_entrance_exit - applies to fixing all failures & inspections + * fixing SubState: leave_by_entrance_exit - applies to fixing all failures & inspections * - see FixingSubstatesForBreakdown[] */ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, Ride* ride) @@ -2676,9 +2677,9 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, Ride* ride) exitPosition.x -= ebx_direction.x * 19; exitPosition.y -= ebx_direction.y * 19; - destination_x = exitPosition.x; - destination_y = exitPosition.y; - destination_tolerance = 2; + DestinationX = exitPosition.x; + DestinationY = exitPosition.y; + DestinationTolerance = 2; } int16_t xy_distance; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 1df55d5df4..892299c15b 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1390,7 +1390,7 @@ private: { dst->sprite_identifier = SPRITE_IDENTIFIER_PEEP; // Peep vs. staff (including which kind) - dst->sprite_type = RCT1::GetPeepSpriteType(src->sprite_type); + dst->SpriteType = RCT1::GetPeepSpriteType(src->sprite_type); dst->Action = static_cast(src->action); dst->SpecialSprite = src->special_sprite; dst->NextActionSpriteType = static_cast(src->next_action_sprite_type); @@ -1399,7 +1399,7 @@ private: dst->ActionSpriteType = static_cast(src->action_sprite_type); dst->ActionFrame = src->action_frame; - const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[dst->sprite_type].sprite_bounds; + const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[dst->SpriteType].sprite_bounds; dst->sprite_width = spriteBounds[dst->ActionSpriteType].sprite_width; dst->sprite_height_negative = spriteBounds[dst->ActionSpriteType].sprite_height_negative; dst->sprite_height_positive = spriteBounds[dst->ActionSpriteType].sprite_height_positive; @@ -1415,21 +1415,21 @@ private: dst->SetName(GetUserString(src->name_string_idx)); } - dst->outside_of_park = src->outside_of_park; + dst->OutsideOfPark = src->outside_of_park; - dst->state = static_cast(src->state); - dst->sub_state = src->sub_state; + dst->State = static_cast(src->state); + dst->SubState = src->sub_state; dst->NextLoc = { src->next_x, src->next_y, src->next_z * RCT1_COORDS_Z_STEP }; - dst->next_flags = src->next_flags; + dst->NextFlags = src->next_flags; dst->Var37 = src->var_37; dst->TimeToConsume = src->time_to_consume; dst->StepProgress = src->step_progress; dst->VandalismSeen = src->vandalism_seen; - dst->type = static_cast(src->type); + dst->AssignedPeepType = static_cast(src->type); - dst->tshirt_colour = RCT1::GetColour(src->tshirt_colour); - dst->trousers_colour = RCT1::GetColour(src->trousers_colour); + dst->TshirtColour = RCT1::GetColour(src->tshirt_colour); + dst->TrousersColour = RCT1::GetColour(src->trousers_colour); dst->UmbrellaColour = RCT1::GetColour(src->umbrella_colour); dst->HatColour = RCT1::GetColour(src->hat_colour); @@ -1443,9 +1443,9 @@ private: dst->BalloonColour = RCT1::GetColour(src->balloon_colour); } - dst->destination_x = src->destination_x; - dst->destination_y = src->destination_y; - dst->destination_tolerance = src->destination_tolerance; + dst->DestinationX = src->destination_x; + dst->DestinationY = src->destination_y; + dst->DestinationTolerance = src->destination_tolerance; dst->PeepDirection = src->direction; dst->Energy = src->energy; @@ -1482,7 +1482,7 @@ private: dst->TimeInPark = src->time_in_park; // This doubles as staff type - dst->no_of_rides = src->no_of_rides; + dst->GuestNumRides = src->no_of_rides; dst->AmountOfDrinks = src->no_of_drinks; dst->AmountOfFood = src->no_of_food; @@ -1553,9 +1553,9 @@ private: dst->ItemStandardFlags = src->item_standard_flags; - if (dst->type == PEEP_TYPE_GUEST) + if (dst->AssignedPeepType == PEEP_TYPE_GUEST) { - if (dst->outside_of_park && dst->state != PEEP_STATE_LEAVING_PARK) + if (dst->OutsideOfPark && dst->State != PEEP_STATE_LEAVING_PARK) { increment_guests_heading_for_park(); } @@ -3004,7 +3004,7 @@ private: Peep* peep; FOR_ALL_GUESTS (i, peep) { - if (peep->state == PEEP_STATE_QUEUING_FRONT && peep->CurrentRide == 0) + if (peep->State == PEEP_STATE_QUEUING_FRONT && peep->CurrentRide == 0) { peep->RemoveFromQueue(); peep->SetState(PEEP_STATE_FALLING); diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 9ab5d4ec16..ea0bd00f95 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1096,9 +1096,9 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) ExportSpriteCommonProperties(dst, static_cast(src)); auto generateName = true; - if (src->name != nullptr) + if (src->Name != nullptr) { - auto stringId = AllocateUserString(src->name); + auto stringId = AllocateUserString(src->Name); if (stringId != std::nullopt) { dst->name_string_idx = *stringId; @@ -1108,12 +1108,12 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) { log_warning( "Unable to allocate user string for peep #%d (%s) during S6 export.", static_cast(src->sprite_index), - src->name); + src->Name); } } if (generateName) { - if (src->type == PeepType::PEEP_TYPE_STAFF) + if (src->AssignedPeepType == PeepType::PEEP_TYPE_STAFF) { static constexpr const rct_string_id staffNames[] = { STR_HANDYMAN_X, @@ -1121,7 +1121,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) STR_SECURITY_GUARD_X, STR_ENTERTAINER_X, }; - dst->name_string_idx = staffNames[src->staff_type % sizeof(staffNames)]; + dst->name_string_idx = staffNames[src->StaffType % sizeof(staffNames)]; } else if (gParkFlags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES) { @@ -1136,18 +1136,18 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) dst->next_x = src->NextLoc.x; dst->next_y = src->NextLoc.y; dst->next_z = src->NextLoc.z / COORDS_Z_STEP; - dst->next_flags = src->next_flags; - dst->outside_of_park = src->outside_of_park; - dst->state = static_cast(src->state); - dst->sub_state = src->sub_state; - dst->sprite_type = static_cast(src->sprite_type); - dst->peep_type = static_cast(src->type); - dst->no_of_rides = src->no_of_rides; - dst->tshirt_colour = src->tshirt_colour; - dst->trousers_colour = src->trousers_colour; - dst->destination_x = src->destination_x; - dst->destination_y = src->destination_y; - dst->destination_tolerance = src->destination_tolerance; + dst->next_flags = src->NextFlags; + dst->outside_of_park = src->OutsideOfPark; + dst->state = static_cast(src->State); + dst->sub_state = src->SubState; + dst->sprite_type = static_cast(src->SpriteType); + dst->peep_type = static_cast(src->AssignedPeepType); + dst->no_of_rides = src->GuestNumRides; + dst->tshirt_colour = src->TshirtColour; + dst->trousers_colour = src->TrousersColour; + dst->destination_x = src->DestinationX; + dst->destination_y = src->DestinationY; + dst->destination_tolerance = src->DestinationTolerance; dst->var_37 = src->Var37; dst->energy = src->Energy; dst->energy_target = src->EnergyTarget; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index aef0c4fe74..23fd05548b 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1415,18 +1415,18 @@ public: dst->SetName(GetUserString(src->name_string_idx)); } dst->NextLoc = { src->next_x, src->next_y, src->next_z * COORDS_Z_STEP }; - dst->next_flags = src->next_flags; - dst->outside_of_park = src->outside_of_park; - dst->state = static_cast(src->state); - dst->sub_state = src->sub_state; - dst->sprite_type = static_cast(src->sprite_type); - dst->type = static_cast(src->peep_type); - dst->no_of_rides = src->no_of_rides; - dst->tshirt_colour = src->tshirt_colour; - dst->trousers_colour = src->trousers_colour; - dst->destination_x = src->destination_x; - dst->destination_y = src->destination_y; - dst->destination_tolerance = src->destination_tolerance; + dst->NextFlags = src->next_flags; + dst->OutsideOfPark = src->outside_of_park; + dst->State = static_cast(src->state); + dst->SubState = src->sub_state; + dst->SpriteType = static_cast(src->sprite_type); + dst->AssignedPeepType = static_cast(src->peep_type); + dst->GuestNumRides = src->no_of_rides; + dst->TshirtColour = src->tshirt_colour; + dst->TrousersColour = src->trousers_colour; + dst->DestinationX = src->destination_x; + dst->DestinationY = src->destination_y; + dst->DestinationTolerance = src->destination_tolerance; dst->Var37 = src->var_37; dst->Energy = src->energy; dst->EnergyTarget = src->energy_target; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 3e166aa30f..a0d3cacd0c 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1103,14 +1103,14 @@ void ride_remove_peeps(Ride* ride) Peep* peep; FOR_ALL_PEEPS (spriteIndex, peep) { - if (peep->state == PEEP_STATE_QUEUING_FRONT || peep->state == PEEP_STATE_ENTERING_RIDE - || peep->state == PEEP_STATE_LEAVING_RIDE || peep->state == PEEP_STATE_ON_RIDE) + if (peep->State == PEEP_STATE_QUEUING_FRONT || peep->State == PEEP_STATE_ENTERING_RIDE + || peep->State == PEEP_STATE_LEAVING_RIDE || peep->State == PEEP_STATE_ON_RIDE) { if (peep->CurrentRide != ride->id) continue; peep_decrement_num_riders(peep); - if (peep->state == PEEP_STATE_QUEUING_FRONT && peep->sub_state == PEEP_RIDE_AT_ENTRANCE) + if (peep->State == PEEP_STATE_QUEUING_FRONT && peep->SubState == PEEP_RIDE_AT_ENTRANCE) peep->RemoveFromQueue(); if (exitPosition.direction == INVALID_DIRECTION) @@ -1127,7 +1127,7 @@ void ride_remove_peeps(Ride* ride) peep->sprite_direction = exitPosition.direction; } - peep->state = PEEP_STATE_FALLING; + peep->State = PEEP_STATE_FALLING; peep->SwitchToSpecialSprite(0); peep->Happiness = std::min(peep->Happiness, peep->HappinessTarget) / 2; @@ -2170,7 +2170,7 @@ void Ride::UpdateSpiralSlide() slide_in_use--; Peep* peep = GET_PEEP(slide_peep); - peep->destination_x++; + peep->DestinationX++; } const uint8_t current_rotation = get_current_rotation(); @@ -2603,7 +2603,7 @@ static void ride_mechanic_status_update(Ride* ride, int32_t mechanicStatus) { auto mechanic = ride_get_mechanic(ride); if (mechanic == nullptr - || (mechanic->state != PEEP_STATE_HEADING_TO_INSPECTION && mechanic->state != PEEP_STATE_ANSWERING) + || (mechanic->State != PEEP_STATE_HEADING_TO_INSPECTION && mechanic->State != PEEP_STATE_ANSWERING) || mechanic->CurrentRide != ride->id) { ride->mechanic_status = RIDE_MECHANIC_STATUS_CALLING; @@ -2616,8 +2616,8 @@ static void ride_mechanic_status_update(Ride* ride, int32_t mechanicStatus) { auto mechanic = ride_get_mechanic(ride); if (mechanic == nullptr - || (mechanic->state != PEEP_STATE_HEADING_TO_INSPECTION && mechanic->state != PEEP_STATE_FIXING - && mechanic->state != PEEP_STATE_INSPECTING && mechanic->state != PEEP_STATE_ANSWERING)) + || (mechanic->State != PEEP_STATE_HEADING_TO_INSPECTION && mechanic->State != PEEP_STATE_FIXING + && mechanic->State != PEEP_STATE_INSPECTING && mechanic->State != PEEP_STATE_ANSWERING)) { ride->mechanic_status = RIDE_MECHANIC_STATUS_CALLING; ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; @@ -2635,7 +2635,7 @@ static void ride_mechanic_status_update(Ride* ride, int32_t mechanicStatus) static void ride_call_mechanic(Ride* ride, Peep* mechanic, int32_t forInspection) { mechanic->SetState(forInspection ? PEEP_STATE_HEADING_TO_INSPECTION : PEEP_STATE_ANSWERING); - mechanic->sub_state = 0; + mechanic->SubState = 0; ride->mechanic_status = RIDE_MECHANIC_STATUS_HEADING; ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; ride->mechanic = mechanic->sprite_index; @@ -2693,17 +2693,17 @@ Peep* find_closest_mechanic(int32_t x, int32_t y, int32_t forInspection) closestDistance = UINT_MAX; FOR_ALL_STAFF (spriteIndex, peep) { - if (peep->staff_type != STAFF_TYPE_MECHANIC) + if (peep->StaffType != STAFF_TYPE_MECHANIC) continue; if (!forInspection) { - if (peep->state == PEEP_STATE_HEADING_TO_INSPECTION) + if (peep->State == PEEP_STATE_HEADING_TO_INSPECTION) { - if (peep->sub_state >= 4) + if (peep->SubState >= 4) continue; } - else if (peep->state != PEEP_STATE_PATROLLING) + else if (peep->State != PEEP_STATE_PATROLLING) continue; if (!(peep->StaffOrders & STAFF_ORDERS_FIX_RIDES)) @@ -2711,7 +2711,7 @@ Peep* find_closest_mechanic(int32_t x, int32_t y, int32_t forInspection) } else { - if (peep->state != PEEP_STATE_PATROLLING || !(peep->StaffOrders & STAFF_ORDERS_INSPECT_RIDES)) + if (peep->State != PEEP_STATE_PATROLLING || !(peep->StaffOrders & STAFF_ORDERS_INSPECT_RIDES)) continue; } @@ -5489,7 +5489,7 @@ void Ride::StopGuestsQueuing() FOR_ALL_PEEPS (spriteIndex, peep) { - if (peep->state != PEEP_STATE_QUEUING) + if (peep->State != PEEP_STATE_QUEUING) continue; if (peep->CurrentRide != id) continue; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 7ea8b430b1..add63c14b9 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -4124,13 +4124,13 @@ void Vehicle::UpdateUnloadingPassengers() peep[seat * 2] = SPRITE_INDEX_NULL; curPeep->SetState(PEEP_STATE_LEAVING_RIDE); - curPeep->sub_state = PEEP_RIDE_LEAVE_VEHICLE; + curPeep->SubState = PEEP_RIDE_LEAVE_VEHICLE; curPeep = GET_PEEP(peep[seat * 2 + 1]); peep[seat * 2 + 1] = SPRITE_INDEX_NULL; curPeep->SetState(PEEP_STATE_LEAVING_RIDE); - curPeep->sub_state = PEEP_RIDE_LEAVE_VEHICLE; + curPeep->SubState = PEEP_RIDE_LEAVE_VEHICLE; } } else @@ -4164,7 +4164,7 @@ void Vehicle::UpdateUnloadingPassengers() { Peep* curPeep = GET_PEEP(train->peep[peepIndex]); curPeep->SetState(PEEP_STATE_LEAVING_RIDE); - curPeep->sub_state = PEEP_RIDE_LEAVE_VEHICLE; + curPeep->SubState = PEEP_RIDE_LEAVE_VEHICLE; } } } @@ -5284,7 +5284,7 @@ void Vehicle::KillPassengers(Ride* curRide) for (auto i = 0; i < num_peeps; i++) { Peep* curPeep = GET_PEEP(peep[i]); - if (curPeep->outside_of_park == 0) + if (curPeep->OutsideOfPark == 0) { decrement_guests_in_park(); auto intent = Intent(INTENT_ACTION_UPDATE_GUEST_COUNT); diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index ff2177d647..295e114c11 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -113,7 +113,7 @@ static void paint_ferris_wheel_structure( } Peep* peep = GET_PEEP(vehicle->peep[i]); - if (peep->state != PEEP_STATE_ON_RIDE) + if (peep->State != PEEP_STATE_ON_RIDE) { continue; } diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index c538c6a0c4..0bf3a48199 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -1222,7 +1222,7 @@ void vehicle_visual_mini_golf_player( uint32_t ebx = (frame << 2) + (imageDirection >> 3); uint32_t image_id = rideEntry->vehicles[0].base_image_id + 1 + ebx; - uint32_t peep_palette = sprite->peep.tshirt_colour << 19 | sprite->peep.trousers_colour << 24 | 0x0A0000000; + uint32_t peep_palette = sprite->peep.TshirtColour << 19 | sprite->peep.TrousersColour << 24 | 0x0A0000000; sub_98197C(session, image_id | peep_palette, 0, 0, 1, 1, 11, z, 0, 0, z + 5); } diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index 988ebcdc14..1e6ac89c1a 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -72,7 +72,7 @@ static void paint_space_rings_structure(paint_session* session, Ride* ride, uint if (vehicle != nullptr && vehicle->num_peeps > 0) { Peep* rider = GET_PEEP(vehicle->peep[0]); - imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(rider->tshirt_colour, rider->trousers_colour); + imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(rider->TshirtColour, rider->TrousersColour); imageId = ((baseImageId & 0x7FFFF) + 352 + frameNum) | imageColourFlags; sub_98199C(session, imageId, 0, 0, 20, 20, 23, height, -10, -10, height); } diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/ScEntity.hpp index 60a1b5bb06..6e76441da7 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/ScEntity.hpp @@ -142,7 +142,7 @@ namespace OpenRCT2::Scripting auto peep = static_cast(entity); // We can't remove a single peep from a ride at the moment as this can cause complications with the // vehicle car having an unsupported peep capacity. - if (peep->state == PEEP_STATE_ON_RIDE || peep->state == PEEP_STATE_ENTERING_RIDE) + if (peep->State == PEEP_STATE_ON_RIDE || peep->State == PEEP_STATE_ENTERING_RIDE) { duk_error(ctx, DUK_ERR_ERROR, "Removing a peep that is on a ride is currently unsupported."); } @@ -643,7 +643,7 @@ namespace OpenRCT2::Scripting auto peep = GetPeep(); if (peep != nullptr) { - return peep->type == PEEP_TYPE_STAFF ? "staff" : "guest"; + return peep->AssignedPeepType == PEEP_TYPE_STAFF ? "staff" : "guest"; } return ""; } @@ -695,7 +695,7 @@ namespace OpenRCT2::Scripting auto peep = GetPeep(); if (peep != nullptr) { - return ToDuk(ctx, CoordsXY(peep->destination_x, peep->destination_y)); + return ToDuk(ctx, CoordsXY(peep->DestinationX, peep->DestinationY)); } return ToDuk(ctx, nullptr); } @@ -707,8 +707,8 @@ namespace OpenRCT2::Scripting if (peep != nullptr) { auto pos = FromDuk(value); - peep->destination_x = pos.x; - peep->destination_y = pos.y; + peep->DestinationX = pos.x; + peep->DestinationY = pos.y; peep->Invalidate(); } } @@ -794,7 +794,7 @@ namespace OpenRCT2::Scripting uint8_t tshirtColour_get() const { auto peep = GetPeep(); - return peep != nullptr ? peep->tshirt_colour : 0; + return peep != nullptr ? peep->TshirtColour : 0; } void tshirtColour_set(uint8_t value) { @@ -802,7 +802,7 @@ namespace OpenRCT2::Scripting auto peep = GetPeep(); if (peep != nullptr) { - peep->tshirt_colour = value; + peep->TshirtColour = value; peep->Invalidate(); } } @@ -810,7 +810,7 @@ namespace OpenRCT2::Scripting uint8_t trousersColour_get() const { auto peep = GetPeep(); - return peep != nullptr ? peep->trousers_colour : 0; + return peep != nullptr ? peep->TrousersColour : 0; } void trousersColour_set(uint8_t value) { @@ -818,7 +818,7 @@ namespace OpenRCT2::Scripting auto peep = GetPeep(); if (peep != nullptr) { - peep->trousers_colour = value; + peep->TrousersColour = value; peep->Invalidate(); } } @@ -1085,7 +1085,7 @@ namespace OpenRCT2::Scripting auto peep = GetStaff(); if (peep != nullptr) { - switch (peep->staff_type) + switch (peep->StaffType) { case STAFF_TYPE_HANDYMAN: return "handyman"; @@ -1106,25 +1106,25 @@ namespace OpenRCT2::Scripting auto peep = GetStaff(); if (peep != nullptr) { - if (value == "handyman" && peep->staff_type != STAFF_TYPE_HANDYMAN) + if (value == "handyman" && peep->StaffType != STAFF_TYPE_HANDYMAN) { - peep->staff_type = STAFF_TYPE_HANDYMAN; - peep->sprite_type = PeepSpriteType::PEEP_SPRITE_TYPE_HANDYMAN; + peep->StaffType = STAFF_TYPE_HANDYMAN; + peep->SpriteType = PeepSpriteType::PEEP_SPRITE_TYPE_HANDYMAN; } - else if (value == "mechanic" && peep->staff_type != STAFF_TYPE_MECHANIC) + else if (value == "mechanic" && peep->StaffType != STAFF_TYPE_MECHANIC) { - peep->staff_type = STAFF_TYPE_MECHANIC; - peep->sprite_type = PeepSpriteType::PEEP_SPRITE_TYPE_MECHANIC; + peep->StaffType = STAFF_TYPE_MECHANIC; + peep->SpriteType = PeepSpriteType::PEEP_SPRITE_TYPE_MECHANIC; } - else if (value == "security" && peep->staff_type != STAFF_TYPE_SECURITY) + else if (value == "security" && peep->StaffType != STAFF_TYPE_SECURITY) { - peep->staff_type = STAFF_TYPE_SECURITY; - peep->sprite_type = PeepSpriteType::PEEP_SPRITE_TYPE_SECURITY; + peep->StaffType = STAFF_TYPE_SECURITY; + peep->SpriteType = PeepSpriteType::PEEP_SPRITE_TYPE_SECURITY; } - else if (value == "entertainer" && peep->staff_type != STAFF_TYPE_ENTERTAINER) + else if (value == "entertainer" && peep->StaffType != STAFF_TYPE_ENTERTAINER) { - peep->staff_type = STAFF_TYPE_ENTERTAINER; - peep->sprite_type = PeepSpriteType::PEEP_SPRITE_TYPE_ENTERTAINER_PANDA; + peep->StaffType = STAFF_TYPE_ENTERTAINER; + peep->SpriteType = PeepSpriteType::PEEP_SPRITE_TYPE_ENTERTAINER_PANDA; } } } @@ -1132,7 +1132,7 @@ namespace OpenRCT2::Scripting uint8_t colour_get() const { auto peep = GetStaff(); - return peep != nullptr ? peep->tshirt_colour : 0; + return peep != nullptr ? peep->TshirtColour : 0; } void colour_set(uint8_t value) @@ -1141,15 +1141,15 @@ namespace OpenRCT2::Scripting auto peep = GetStaff(); if (peep != nullptr) { - peep->tshirt_colour = value; - peep->trousers_colour = value; + peep->TshirtColour = value; + peep->TrousersColour = value; } } uint8_t costume_get() const { auto peep = GetStaff(); - if (peep != nullptr && peep->staff_type == STAFF_TYPE_ENTERTAINER) + if (peep != nullptr && peep->StaffType == STAFF_TYPE_ENTERTAINER) { return peep->GetCostume(); } diff --git a/src/openrct2/scripting/ScMap.hpp b/src/openrct2/scripting/ScMap.hpp index e37ac06783..ee1a0f8704 100644 --- a/src/openrct2/scripting/ScMap.hpp +++ b/src/openrct2/scripting/ScMap.hpp @@ -146,7 +146,7 @@ namespace OpenRCT2::Scripting { if (targetList == SPRITE_LIST_PEEP) { - if (sprite->peep.type == PEEP_TYPE_STAFF) + if (sprite->peep.AssignedPeepType == PEEP_TYPE_STAFF) result.push_back(GetObjectAsDukValue(_context, std::make_shared(spriteId))); else result.push_back(GetObjectAsDukValue(_context, std::make_shared(spriteId))); @@ -200,7 +200,7 @@ namespace OpenRCT2::Scripting case SPRITE_IDENTIFIER_VEHICLE: return GetObjectAsDukValue(_context, std::make_shared(spriteId)); case SPRITE_IDENTIFIER_PEEP: - if (sprite->peep.type == PEEP_TYPE_STAFF) + if (sprite->peep.AssignedPeepType == PEEP_TYPE_STAFF) return GetObjectAsDukValue(_context, std::make_shared(spriteId)); else return GetObjectAsDukValue(_context, std::make_shared(spriteId)); diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 6b01f1b7e2..7a4414094a 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -422,14 +422,14 @@ void footpath_interrupt_peeps(const CoordsXYZ& footpathPos) if (entity->generic.Is()) { Peep* peep = &entity->peep; - if (peep->state == PEEP_STATE_SITTING || peep->state == PEEP_STATE_WATCHING) + if (peep->State == PEEP_STATE_SITTING || peep->State == PEEP_STATE_WATCHING) { if (peep->z == footpathPos.z) { peep->SetState(PEEP_STATE_WALKING); - peep->destination_x = (peep->x & 0xFFE0) + 16; - peep->destination_y = (peep->y & 0xFFE0) + 16; - peep->destination_tolerance = 5; + peep->DestinationX = (peep->x & 0xFFE0) + 16; + peep->DestinationY = (peep->y & 0xFFE0) + 16; + peep->DestinationTolerance = 5; peep->UpdateCurrentActionSpriteType(); } } diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 88e7a3cdef..9137db0da1 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -206,7 +206,7 @@ static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc) continue; peep = &sprite->peep; - if (peep->state != PEEP_STATE_WALKING) + if (peep->State != PEEP_STATE_WALKING) continue; if (peep->z != loc.z) continue; diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 1870f19e21..4d90830b96 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -389,7 +389,7 @@ int32_t Park::CalculateParkRating() const Peep* peep; FOR_ALL_GUESTS (spriteIndex, peep) { - if (peep->outside_of_park == 0) + if (peep->OutsideOfPark == 0) { if (peep->Happiness > 128) { @@ -724,13 +724,13 @@ Peep* Park::GenerateGuest() peep->sprite_direction = direction << 3; // Get the centre point of the tile the peep is on - peep->destination_x = (peep->x & 0xFFE0) + 16; - peep->destination_y = (peep->y & 0xFFE0) + 16; + peep->DestinationX = (peep->x & 0xFFE0) + 16; + peep->DestinationY = (peep->y & 0xFFE0) + 16; - peep->destination_tolerance = 5; + peep->DestinationTolerance = 5; peep->PeepDirection = direction; peep->Var37 = 0; - peep->state = PEEP_STATE_ENTERING_PARK; + peep->State = PEEP_STATE_ENTERING_PARK; } } return peep; diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index fc995ef13e..1aabe18bf0 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -291,7 +291,7 @@ rct_sprite_checksum sprite_checksum() if (copy.generic.Is()) { // Name is pointer and will not be the same across clients - copy.peep.name = {}; + copy.peep.Name = {}; // We set this to 0 because as soon the client selects a guest the window will remove the // invalidation flags causing the sprite checksum to be different than on server, the flag does not affect diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index e2a5e3a35b..33f91c772f 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -72,7 +72,7 @@ protected: // Peeps that are outside of the park use specialized pathfinding which we don't want to // use here - peep->outside_of_park = 0; + peep->OutsideOfPark = 0; // An earlier iteration of this code just gave peeps a target position to walk to, but it turns out // that with no actual ride to head towards, when a peep reaches a junction they use the 'aimless' @@ -95,9 +95,9 @@ protected: // 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->PeepDirection = moveDir; - peep->destination_x = peep->x + CoordsDirectionDelta[moveDir].x; - peep->destination_y = peep->y + CoordsDirectionDelta[moveDir].y; - peep->destination_tolerance = 2; + peep->DestinationX = peep->x + CoordsDirectionDelta[moveDir].x; + peep->DestinationY = peep->y + CoordsDirectionDelta[moveDir].y; + peep->DestinationTolerance = 2; // Repeatedly step the peep, until they reach the target position or until the expected number of steps have // elapsed. Each step, check that the tile they are standing on is not marked as forbidden in the test data diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index 89755338a9..15bc708a70 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -118,7 +118,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds) richGuest->CashInPocket = 3000; // Wait for rich guest to get in queue - bool matched = updateUntil(*gs, 1000, [&]() { return richGuest->state == PEEP_STATE_QUEUING; }); + bool matched = updateUntil(*gs, 1000, [&]() { return richGuest->State == PEEP_STATE_QUEUING; }); ASSERT_TRUE(matched); // Insert poor guest @@ -126,7 +126,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds) poorGuest->CashInPocket = 5; // Wait for poor guest to get in queue - matched = updateUntil(*gs, 1000, [&]() { return poorGuest->state == PEEP_STATE_QUEUING; }); + matched = updateUntil(*gs, 1000, [&]() { return poorGuest->State == PEEP_STATE_QUEUING; }); ASSERT_TRUE(matched); // Raise the price of the ride to a value poor guest can't pay @@ -136,8 +136,8 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds) // since it doesn't have enough money to pay for it bool enteredTheRide = false; matched = updateUntil(*gs, 10000, [&]() { - enteredTheRide |= poorGuest->state == PEEP_STATE_ON_RIDE; - return poorGuest->state == PEEP_STATE_WALKING || enteredTheRide; + enteredTheRide |= poorGuest->State == PEEP_STATE_ON_RIDE; + return poorGuest->State == PEEP_STATE_WALKING || enteredTheRide; }); ASSERT_TRUE(matched); @@ -181,7 +181,7 @@ TEST_F(PlayTests, CarRideWithOneCarOnlyAcceptsTwoGuests) } // Wait until one of them is riding - auto guestIsOnRide = [](auto* g) { return g->state == PEEP_STATE_ON_RIDE; }; + auto guestIsOnRide = [](auto* g) { return g->State == PEEP_STATE_ON_RIDE; }; bool matched = updateUntil(*gs, 10000, [&]() { return std::any_of(guests.begin(), guests.end(), guestIsOnRide); }); ASSERT_TRUE(matched); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index d2182dc291..05a3adc737 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -158,18 +158,18 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(NextLoc.x); COMPARE_FIELD(NextLoc.y); COMPARE_FIELD(NextLoc.z); - COMPARE_FIELD(next_flags); - COMPARE_FIELD(outside_of_park); - COMPARE_FIELD(state); - COMPARE_FIELD(sub_state); - COMPARE_FIELD(sprite_type); - COMPARE_FIELD(type); - COMPARE_FIELD(no_of_rides); - COMPARE_FIELD(tshirt_colour); - COMPARE_FIELD(trousers_colour); - COMPARE_FIELD(destination_x); - COMPARE_FIELD(destination_y); - COMPARE_FIELD(destination_tolerance); + COMPARE_FIELD(NextFlags); + COMPARE_FIELD(OutsideOfPark); + COMPARE_FIELD(State); + COMPARE_FIELD(SubState); + COMPARE_FIELD(SpriteType); + COMPARE_FIELD(AssignedPeepType); + COMPARE_FIELD(GuestNumRides); + COMPARE_FIELD(TshirtColour); + COMPARE_FIELD(TrousersColour); + COMPARE_FIELD(DestinationX); + COMPARE_FIELD(DestinationY); + COMPARE_FIELD(DestinationTolerance); COMPARE_FIELD(Var37); COMPARE_FIELD(Energy); COMPARE_FIELD(EnergyTarget);