Refactor peep struct

This commit is contained in:
Ted John
2019-02-28 19:28:58 +00:00
committed by Michael Steenbeek
parent 453855993d
commit cdec457abd
61 changed files with 855 additions and 757 deletions

View File

@@ -207,9 +207,9 @@ public:
switch (intent->GetWindowClass())
{
case WC_PEEP:
return window_guest_open((rct_peep*)intent->GetPointerExtra(INTENT_EXTRA_PEEP));
return window_guest_open((Peep*)intent->GetPointerExtra(INTENT_EXTRA_PEEP));
case WC_FIRE_PROMPT:
return window_staff_fire_prompt_open((rct_peep*)intent->GetPointerExtra(INTENT_EXTRA_PEEP));
return window_staff_fire_prompt_open((Peep*)intent->GetPointerExtra(INTENT_EXTRA_PEEP));
case WC_INSTALL_TRACK:
return window_install_track_open(intent->GetStringExtra(INTENT_EXTRA_PATH).c_str());
case WC_GUEST_LIST:

View File

@@ -41,7 +41,7 @@ static void viewport_interaction_remove_footpath_item(TileElement* tileElement,
static void viewport_interaction_remove_park_wall(TileElement* tileElement, int32_t x, int32_t y);
static void viewport_interaction_remove_large_scenery(TileElement* tileElement, int32_t x, int32_t y);
static void viewport_interaction_remove_park_entrance(TileElement* tileElement, int32_t x, int32_t y);
static rct_peep* viewport_interaction_get_closest_peep(int32_t x, int32_t y, int32_t maxDistance);
static Peep* viewport_interaction_get_closest_peep(int32_t x, int32_t y, int32_t maxDistance);
/**
*
@@ -581,13 +581,13 @@ static void viewport_interaction_remove_large_scenery(TileElement* tileElement,
}
}
static rct_peep* viewport_interaction_get_closest_peep(int32_t x, int32_t y, int32_t maxDistance)
static Peep* viewport_interaction_get_closest_peep(int32_t x, int32_t y, int32_t maxDistance)
{
int32_t distance, closestDistance;
uint16_t spriteIndex;
rct_window* w;
rct_viewport* viewport;
rct_peep *peep, *closestPeep;
Peep *peep, *closestPeep;
w = window_find_from_point(x, y);
if (w == nullptr)

View File

@@ -607,7 +607,7 @@ static void window_game_bottom_toolbar_draw_news_item(rct_drawpixelinfo* dpi, rc
break;
}
rct_peep* peep = GET_PEEP(newsItem->Assoc);
Peep* peep = GET_PEEP(newsItem->Assoc);
int32_t clip_x = 10, clip_y = 19;
if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_ENTERTAINER)

View File

@@ -474,7 +474,7 @@ static constexpr const uint32_t window_guest_page_enabled_widgets[] = {
* rct2: 0x006989E9
*
*/
rct_window* window_guest_open(rct_peep* peep)
rct_window* window_guest_open(Peep* peep)
{
if (peep->type == PEEP_TYPE_STAFF)
{
@@ -530,7 +530,7 @@ rct_window* window_guest_open(rct_peep* peep)
*/
void window_guest_disable_widgets(rct_window* w)
{
rct_peep* peep = &get_sprite(w->number)->peep;
Peep* peep = &get_sprite(w->number)->peep;
uint64_t disabled_widgets = 0;
if (peep_can_be_picked_up(peep))
@@ -604,7 +604,7 @@ void window_guest_overview_resize(rct_window* w)
*/
void window_guest_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex)
{
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
switch (widgetIndex)
{
@@ -709,7 +709,7 @@ void window_guest_viewport_init(rct_window* w)
focus.sprite.sprite_id = w->number;
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
if (peep->state == PEEP_STATE_PICKED)
{
@@ -839,7 +839,7 @@ static void window_guest_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dp
x = 14;
y = 20;
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_ENTERTAINER)
y++;
@@ -896,7 +896,7 @@ static void window_guest_stats_tab_paint(rct_window* w, rct_drawpixelinfo* dpi)
int32_t x = widget->left + w->x;
int32_t y = widget->top + w->y;
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
int32_t image_id = get_peep_face_sprite_large(peep);
if (w->page == WINDOW_GUEST_STATS)
{
@@ -1032,7 +1032,7 @@ void window_guest_overview_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Draw the centred label
uint32_t argument1, argument2;
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
get_arguments_from_action(peep, &argument1, &argument2);
set_format_arg(0, uint32_t, argument1);
set_format_arg(4, uint32_t, argument2);
@@ -1095,7 +1095,7 @@ void window_guest_overview_invalidate(rct_window* w)
| (1ULL << WIDX_TAB_6));
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
set_format_arg(0, rct_string_id, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);
@@ -1170,7 +1170,7 @@ void window_guest_overview_update(rct_window* w)
int32_t random = util_rand() & 0xFFFF;
if (random <= 0x2AAA)
{
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
peep_insert_new_thought(peep, PEEP_THOUGHT_TYPE_WATCHED, PEEP_THOUGHT_ITEM_NONE);
}
}
@@ -1232,7 +1232,7 @@ void window_guest_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
w->picked_peep_frame = 0;
}
rct_peep* peep;
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;
@@ -1321,7 +1321,7 @@ void window_guest_unknown_05(rct_window* w)
void window_guest_stats_update(rct_window* w)
{
w->frame_no++;
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
peep->window_invalidate_flags &= ~PEEP_INVALIDATE_PEEP_STATS;
window_invalidate(w);
@@ -1341,7 +1341,7 @@ void window_guest_stats_invalidate(rct_window* w)
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
set_format_arg(0, rct_string_id, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);
@@ -1405,7 +1405,7 @@ void window_guest_stats_paint(rct_window* w, rct_drawpixelinfo* dpi)
window_guest_inventory_tab_paint(w, dpi);
// ebx
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
// Not sure why this is not stats widgets
// cx
@@ -1589,7 +1589,7 @@ void window_guest_rides_update(rct_window* w)
widget_invalidate(w, WIDX_TAB_2);
widget_invalidate(w, WIDX_TAB_3);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
// Every 2048 ticks do a full window_invalidate
int32_t number_of_ticks = gScenarioTicks - peep->time_in_park;
@@ -1697,7 +1697,7 @@ void window_guest_rides_invalidate(rct_window* w)
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
set_format_arg(0, uint16_t, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);
@@ -1732,7 +1732,7 @@ void window_guest_rides_paint(rct_window* w, rct_drawpixelinfo* dpi)
window_guest_thoughts_tab_paint(w, dpi);
window_guest_inventory_tab_paint(w, dpi);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
// cx
int32_t x = w->x + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].left + 2;
@@ -1829,7 +1829,7 @@ void window_guest_finance_invalidate(rct_window* w)
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
set_format_arg(0, rct_string_id, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);
@@ -1862,7 +1862,7 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi)
window_guest_thoughts_tab_paint(w, dpi);
window_guest_inventory_tab_paint(w, dpi);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
// cx
int32_t x = w->x + window_guest_finance_widgets[WIDX_PAGE_BACKGROUND].left + 4;
@@ -1944,7 +1944,7 @@ void window_guest_finance_paint(rct_window* w, rct_drawpixelinfo* dpi)
*/
void window_guest_thoughts_resize(rct_window* w)
{
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
if (peep->window_invalidate_flags & PEEP_INVALIDATE_PEEP_THOUGHTS)
{
peep->window_invalidate_flags &= ~PEEP_INVALIDATE_PEEP_THOUGHTS;
@@ -1980,7 +1980,7 @@ void window_guest_thoughts_invalidate(rct_window* w)
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
set_format_arg(0, rct_string_id, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);
@@ -2013,7 +2013,7 @@ void window_guest_thoughts_paint(rct_window* w, rct_drawpixelinfo* dpi)
window_guest_thoughts_tab_paint(w, dpi);
window_guest_inventory_tab_paint(w, dpi);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
// cx
int32_t x = w->x + window_guest_thoughts_widgets[WIDX_PAGE_BACKGROUND].left + 4;
@@ -2048,7 +2048,7 @@ void window_guest_thoughts_paint(rct_window* w, rct_drawpixelinfo* dpi)
*/
void window_guest_inventory_resize(rct_window* w)
{
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
if (peep->window_invalidate_flags & PEEP_INVALIDATE_PEEP_INVENTORY)
{
peep->window_invalidate_flags &= ~PEEP_INVALIDATE_PEEP_INVENTORY;
@@ -2084,7 +2084,7 @@ void window_guest_inventory_invalidate(rct_window* w)
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
set_format_arg(0, rct_string_id, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);
@@ -2103,7 +2103,7 @@ void window_guest_inventory_invalidate(rct_window* w)
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_6);
}
static rct_string_id window_guest_inventory_format_item(rct_peep* peep, int32_t item)
static rct_string_id window_guest_inventory_format_item(Peep* peep, int32_t item)
{
Ride* ride;
@@ -2192,33 +2192,35 @@ void window_guest_inventory_paint(rct_window* w, rct_drawpixelinfo* dpi)
window_guest_thoughts_tab_paint(w, dpi);
window_guest_inventory_tab_paint(w, dpi);
rct_peep* peep = GET_PEEP(w->number);
rct_widget* pageBackgroundWidget = &window_guest_inventory_widgets[WIDX_PAGE_BACKGROUND];
int32_t x = w->x + pageBackgroundWidget->left + 4;
int32_t y = w->y + pageBackgroundWidget->top + 2;
int32_t itemNameWidth = pageBackgroundWidget->right - pageBackgroundWidget->left - 8;
int32_t maxY = w->y + w->height - 22;
int32_t numItems = 0;
gfx_draw_string_left(dpi, STR_CARRYING, nullptr, COLOUR_BLACK, x, y);
y += 10;
for (int32_t item = 0; item < SHOP_ITEM_COUNT; item++)
const auto guest = (GET_PEEP(w->number))->AsGuest();
if (guest != nullptr)
{
if (y >= maxY)
break;
if (!peep->HasItem(item))
continue;
rct_widget* pageBackgroundWidget = &window_guest_inventory_widgets[WIDX_PAGE_BACKGROUND];
int32_t x = w->x + pageBackgroundWidget->left + 4;
int32_t y = w->y + pageBackgroundWidget->top + 2;
int32_t itemNameWidth = pageBackgroundWidget->right - pageBackgroundWidget->left - 8;
rct_string_id stringId = window_guest_inventory_format_item(peep, item);
y += gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, itemNameWidth, stringId, COLOUR_BLACK);
numItems++;
}
int32_t maxY = w->y + w->height - 22;
int32_t numItems = 0;
if (numItems == 0)
{
gfx_draw_string_left(dpi, STR_NOTHING, nullptr, COLOUR_BLACK, x, y);
gfx_draw_string_left(dpi, STR_CARRYING, nullptr, COLOUR_BLACK, x, y);
y += 10;
for (int32_t item = 0; item < SHOP_ITEM_COUNT; item++)
{
if (y >= maxY)
break;
if (!guest->HasItem(item))
continue;
rct_string_id stringId = window_guest_inventory_format_item(guest, item);
y += gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, itemNameWidth, stringId, COLOUR_BLACK);
numItems++;
}
if (numItems == 0)
{
gfx_draw_string_left(dpi, STR_NOTHING, nullptr, COLOUR_BLACK, x, y);
}
}
}

View File

@@ -158,12 +158,12 @@ static uint8_t _window_guest_list_group_index[240];
static char _window_guest_list_filter_name[32];
static int32_t window_guest_list_is_peep_in_filter(rct_peep* peep);
static int32_t window_guest_list_is_peep_in_filter(Peep* peep);
static void window_guest_list_find_groups();
static void get_arguments_from_peep(rct_peep* peep, uint32_t* argument_1, uint32_t* argument_2);
static void get_arguments_from_peep(Peep* peep, uint32_t* argument_1, uint32_t* argument_2);
static bool guest_should_be_visible(rct_peep* peep);
static bool guest_should_be_visible(Peep* peep);
void window_guest_list_init_vars()
{
@@ -471,7 +471,7 @@ static void window_guest_list_update(rct_window* w)
static void window_guest_list_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height)
{
int32_t i, y, numGuests, spriteIndex;
rct_peep* peep;
Peep* peep;
switch (_window_guest_list_selected_tab)
{
@@ -538,7 +538,7 @@ static void window_guest_list_scrollgetsize(rct_window* w, int32_t scrollIndex,
static void window_guest_list_scrollmousedown(rct_window* w, int32_t scrollIndex, int32_t x, int32_t y)
{
int32_t i, spriteIndex;
rct_peep* peep;
Peep* peep;
switch (_window_guest_list_selected_tab)
{
@@ -717,7 +717,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
{
int32_t spriteIndex, numGuests, i, j, y;
rct_string_id format;
rct_peep* peep;
Peep* peep;
rct_peep_thought* thought;
uint32_t argument_1, argument_2;
@@ -863,7 +863,7 @@ static void window_guest_list_textinput(rct_window* w, rct_widgetindex widgetInd
* returns 0 for in filter and 1 for not in filter
* rct2: 0x0069B865
*/
static int32_t window_guest_list_is_peep_in_filter(rct_peep* peep)
static int32_t window_guest_list_is_peep_in_filter(Peep* peep)
{
char temp;
@@ -893,7 +893,7 @@ static int32_t window_guest_list_is_peep_in_filter(rct_peep* peep)
* argument_1 (0x013CE952) gCommonFormatArgs
* argument_2 (0x013CE954) gCommonFormatArgs + 2
*/
static void get_arguments_from_peep(rct_peep* peep, uint32_t* argument_1, uint32_t* argument_2)
static void get_arguments_from_peep(Peep* peep, uint32_t* argument_1, uint32_t* argument_2)
{
switch (_window_guest_list_selected_view)
{
@@ -933,7 +933,7 @@ static void get_arguments_from_peep(rct_peep* peep, uint32_t* argument_1, uint32
static void window_guest_list_find_groups()
{
int32_t spriteIndex, spriteIndex2, groupIndex, faceIndex;
rct_peep *peep, *peep2;
Peep *peep, *peep2;
uint32_t tick256 = floor2(gScenarioTicks, 256);
if (_window_guest_list_selected_view == _window_guest_list_last_find_groups_selected_view)
@@ -1061,7 +1061,7 @@ static void window_guest_list_find_groups()
}
}
static bool guest_should_be_visible(rct_peep* peep)
static bool guest_should_be_visible(Peep* peep)
{
if (_window_guest_list_tracking_only && !(peep->peep_flags & PEEP_FLAGS_TRACKING))
return false;

View File

@@ -1042,7 +1042,7 @@ static MapCoordsXY window_map_transform_to_map_coords(CoordsXY c)
*/
static void window_map_paint_peep_overlay(rct_drawpixelinfo* dpi)
{
rct_peep* peep;
Peep* peep;
uint16_t spriteIndex;
FOR_ALL_PEEPS (spriteIndex, peep)

View File

@@ -318,7 +318,7 @@ static void window_news_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32
break;
}
rct_peep* peep = GET_PEEP(newsItem->Assoc);
Peep* peep = GET_PEEP(newsItem->Assoc);
int32_t clip_x = 10, clip_y = 19;
// If normal peep set sprite to normal (no food)

View File

@@ -1714,7 +1714,7 @@ rct_window* window_ride_open_vehicle(rct_vehicle* vehicle)
rct_window* w2 = window_find_by_number(WC_PEEP, peepSpriteIndex);
if (w2 == nullptr)
{
rct_peep* peep = &(get_sprite(peepSpriteIndex)->peep);
Peep* peep = &(get_sprite(peepSpriteIndex)->peep);
auto intent = Intent(WC_PEEP);
intent.putExtra(INTENT_EXTRA_PEEP, peep);
context_open_intent(&intent);
@@ -3758,7 +3758,7 @@ static void window_ride_operating_paint(rct_window* w, rct_drawpixelinfo* dpi)
static void window_ride_locate_mechanic(rct_window* w)
{
Ride* ride;
rct_peep* mechanic;
Peep* mechanic;
ride = get_ride(w->number);
@@ -4176,14 +4176,14 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Mechanic status
if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)
{
rct_peep* peep;
uint16_t spriteIndex;
switch (ride->mechanic_status)
{
case RIDE_MECHANIC_STATUS_CALLING:
{
stringId = STR_NO_MECHANICS_ARE_HIRED_MESSAGE;
uint16_t spriteIndex;
Peep* peep;
FOR_ALL_STAFF (spriteIndex, peep)
{
if (peep->staff_type == STAFF_TYPE_MECHANIC)
@@ -4193,6 +4193,7 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi)
}
}
break;
}
case RIDE_MECHANIC_STATUS_HEADING:
stringId = STR_MEHCANIC_IS_HEADING_FOR_THE_RIDE;
break;
@@ -4213,11 +4214,11 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi)
}
else
{
rct_peep* mechanicSprite = &(get_sprite(ride->mechanic)->peep);
if (mechanicSprite->IsMechanic())
auto peep = (&(get_sprite(ride->mechanic)->peep))->AsStaff();
if (peep != nullptr && peep->IsMechanic())
{
set_format_arg(0, rct_string_id, mechanicSprite->name_string_idx);
set_format_arg(2, uint32_t, mechanicSprite->id);
set_format_arg(0, rct_string_id, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);
gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x + 4, y, 280, stringId, COLOUR_BLACK);
}
}

View File

@@ -308,7 +308,7 @@ static PatrolAreaValue _staffPatrolAreaPaintValue = PatrolAreaValue::NONE;
*
* rct2: 0x006BEE98
*/
rct_window* window_staff_open(rct_peep* peep)
rct_window* window_staff_open(Peep* peep)
{
rct_window* w = window_bring_to_front_by_number(WC_PEEP, peep->sprite_index);
if (w == nullptr)
@@ -351,7 +351,7 @@ rct_window* window_staff_open(rct_peep* peep)
*/
void window_staff_disable_widgets(rct_window* w)
{
rct_peep* peep = &get_sprite(w->number)->peep;
Peep* peep = &get_sprite(w->number)->peep;
uint64_t disabled_widgets = (1 << WIDX_TAB_4);
if (peep->staff_type == STAFF_TYPE_SECURITY)
@@ -444,7 +444,7 @@ void window_staff_set_page(rct_window* w, int32_t page)
*/
void window_staff_overview_mouseup(rct_window* w, rct_widgetindex widgetIndex)
{
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
switch (widgetIndex)
{
@@ -563,7 +563,7 @@ void window_staff_overview_mousedown(rct_window* w, rct_widgetindex widgetIndex,
window_dropdown_show_text(x, y, extray, w->colours[1], 0, 2);
gDropdownDefaultIndex = 0;
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
// Disable clear patrol area if no area is set.
if (!(gStaffModes[peep->staff_id] & 2))
@@ -586,7 +586,7 @@ void window_staff_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex,
// Clear patrol
if (dropdownIndex == 1)
{
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++)
{
gStaffPatrolAreas[peep->staff_id * STAFF_PATROL_AREA_SIZE + i] = 0;
@@ -629,7 +629,7 @@ void window_staff_overview_update(rct_window* w)
*/
static void window_staff_set_order(rct_window* w, int32_t order_id)
{
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
uint8_t newOrders = peep->staff_orders ^ (1 << order_id);
auto staffSetOrdersAction = StaffSetOrdersAction(w->number, newOrders);
@@ -735,7 +735,7 @@ void window_staff_stats_update(rct_window* w)
w->frame_no++;
widget_invalidate(w, WIDX_TAB_3);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
if (peep->window_invalidate_flags & PEEP_INVALIDATE_STAFF_STATS)
{
peep->window_invalidate_flags &= ~PEEP_INVALIDATE_STAFF_STATS;
@@ -768,7 +768,7 @@ void window_staff_stats_invalidate(rct_window* w)
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
set_format_arg(0, rct_string_id, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);
@@ -803,7 +803,7 @@ void window_staff_options_invalidate(rct_window* w)
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
set_format_arg(0, rct_string_id, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);
@@ -881,7 +881,7 @@ void window_staff_overview_invalidate(rct_window* w)
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
set_format_arg(0, rct_string_id, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);
@@ -946,7 +946,7 @@ void window_staff_overview_paint(rct_window* w, rct_drawpixelinfo* dpi)
// Draw the centred label
uint32_t argument1, argument2;
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
get_arguments_from_action(peep, &argument1, &argument2);
set_format_arg(0, uint32_t, argument1);
set_format_arg(4, uint32_t, argument2);
@@ -1028,7 +1028,7 @@ void window_staff_overview_tab_paint(rct_window* w, rct_drawpixelinfo* dpi)
x = 14;
y = 20;
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_ENTERTAINER)
y++;
@@ -1095,7 +1095,7 @@ void window_staff_stats_paint(rct_window* w, rct_drawpixelinfo* dpi)
window_staff_options_tab_paint(w, dpi);
window_staff_stats_tab_paint(w, dpi);
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
int32_t x = w->x + window_staff_stats_widgets[WIDX_RESIZE].left + 4;
int32_t y = w->y + window_staff_stats_widgets[WIDX_RESIZE].top + 4;
@@ -1172,7 +1172,7 @@ void window_staff_overview_tool_update(rct_window* w, rct_widgetindex widgetInde
w->picked_peep_frame = 0;
}
rct_peep* peep;
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;
@@ -1213,7 +1213,7 @@ void window_staff_overview_tool_down(rct_window* w, rct_widgetindex widgetIndex,
if (sprite == nullptr || sprite->IsPeep() == false)
return;
rct_peep& peep = sprite->peep;
Peep& peep = sprite->peep;
if (peep.type != PEEP_TYPE_STAFF)
return;
@@ -1253,7 +1253,7 @@ void window_staff_overview_tool_drag(rct_window* w, rct_widgetindex widgetIndex,
if (sprite == nullptr || sprite->IsPeep() == false)
return;
rct_peep& peep = sprite->peep;
Peep& peep = sprite->peep;
if (peep.type != PEEP_TYPE_STAFF)
return;
@@ -1325,7 +1325,7 @@ void window_staff_viewport_init(rct_window* w)
focus.sprite_id = w->number;
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
if (peep->state == PEEP_STATE_PICKED)
{
@@ -1396,7 +1396,7 @@ void window_staff_options_mousedown(rct_window* w, rct_widgetindex widgetIndex,
return;
}
rct_peep* peep = GET_PEEP(w->number);
Peep* peep = GET_PEEP(w->number);
int32_t checkedIndex = -1;
// This will be moved below where Items Checked is when all
// of dropdown related functions are finished. This prevents

View File

@@ -75,7 +75,7 @@ static rct_window_event_list window_staff_fire_events = {
/** Based off of rct2: 0x6C0A77 */
rct_window* window_staff_fire_prompt_open(rct_peep* peep)
rct_window* window_staff_fire_prompt_open(Peep* peep)
{
rct_window * w;
@@ -103,7 +103,7 @@ rct_window* window_staff_fire_prompt_open(rct_peep* peep)
*/
static void window_staff_fire_mouseup(rct_window *w, rct_widgetindex widgetIndex)
{
rct_peep* peep = &get_sprite(w->number)->peep;
Peep* peep = &get_sprite(w->number)->peep;
switch (widgetIndex){
case WIDX_YES:
@@ -123,7 +123,7 @@ static void window_staff_fire_paint(rct_window *w, rct_drawpixelinfo *dpi)
{
window_draw_widgets(w, dpi);
rct_peep* peep = &get_sprite(w->number)->peep;
Peep* peep = &get_sprite(w->number)->peep;
set_format_arg(0, rct_string_id, peep->name_string_idx);
set_format_arg(2, uint32_t, peep->id);

View File

@@ -314,7 +314,7 @@ void window_staff_list_update(rct_window* w)
if (window_find_by_class(WC_MAP) != nullptr)
{
int32_t spriteIndex;
rct_peep* peep;
Peep* peep;
gWindowMapFlashingFlags |= (1 << 2);
FOR_ALL_STAFF (spriteIndex, peep)
{
@@ -348,7 +348,7 @@ static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetInde
bool isPatrolAreaSet = staff_is_patrol_area_set(200 + selectedPeepType, x, y);
uint16_t spriteIndex;
rct_peep *peep, *closestPeep = nullptr;
Peep *peep, *closestPeep = nullptr;
int32_t closestPeepDistance = std::numeric_limits<int32_t>::max();
FOR_ALL_STAFF (spriteIndex, peep)
{
@@ -416,7 +416,7 @@ void window_staff_list_toolabort(rct_window* w, rct_widgetindex widgetIndex)
void window_staff_list_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height)
{
int32_t i, spriteIndex;
rct_peep* peep;
Peep* peep;
uint16_t staffCount = 0;
FOR_ALL_STAFF (spriteIndex, peep)
@@ -454,7 +454,7 @@ void window_staff_list_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t
void window_staff_list_scrollmousedown(rct_window* w, int32_t scrollIndex, int32_t x, int32_t y)
{
int32_t i, spriteIndex;
rct_peep* peep;
Peep* peep;
i = y / SCROLLABLE_ROW_HEIGHT;
FOR_ALL_STAFF (spriteIndex, peep)
@@ -658,7 +658,7 @@ void window_staff_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_
int32_t spriteIndex, y, i, staffOrderIcon_x, staffOrders, staffOrderSprite;
uint32_t argument_1, argument_2;
uint8_t selectedTab;
rct_peep* peep;
Peep* peep;
gfx_fill_rect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, ColourMapA[w->colours[1]].mid_light);

View File

@@ -622,7 +622,7 @@ static void window_title_command_editor_tool_down(rct_window* w, rct_widgetindex
if (spriteIdentifier == SPRITE_IDENTIFIER_PEEP)
{
validSprite = true;
rct_peep* peep = GET_PEEP(spriteIndex);
Peep* peep = GET_PEEP(spriteIndex);
format_string(command.SpriteName, USER_STRING_MAX_LENGTH, peep->name_string_idx, &peep->id);
}
else if (spriteIdentifier == SPRITE_IDENTIFIER_VEHICLE)

View File

@@ -16,7 +16,7 @@
using loadsave_callback = void (*)(int32_t result, const utf8* path);
using scenarioselect_callback = void (*)(const utf8* path);
struct rct_peep;
struct Peep;
struct TileElement;
struct rct_vehicle;
@@ -31,7 +31,7 @@ rct_window* window_editor_main_open();
rct_window* window_editor_objective_options_open();
rct_window* window_editor_scenario_options_open();
rct_window* window_footpath_open();
rct_window* window_guest_open(rct_peep* peep);
rct_window* window_guest_open(Peep* peep);
rct_window* window_land_open();
rct_window* window_land_rights_open();
rct_window* window_main_open();
@@ -48,7 +48,7 @@ rct_window* window_server_start_open();
rct_window* window_shortcut_change_open(int32_t selected_key);
rct_window* window_shortcut_keys_open();
rct_window* window_staff_list_open();
rct_window* window_staff_open(rct_peep* peep);
rct_window* window_staff_open(Peep* peep);
rct_window* window_themes_open();
rct_window* window_title_exit_open();
rct_window* window_title_logo_open();
@@ -82,7 +82,7 @@ void window_guest_list_init_vars();
void window_guest_list_refresh_list();
rct_window* window_guest_list_open();
rct_window* window_guest_list_open_with_filter(int32_t type, int32_t index);
rct_window* window_staff_fire_prompt_open(rct_peep* peep);
rct_window* window_staff_fire_prompt_open(Peep* peep);
void window_title_editor_open(int32_t tab);
void window_title_command_editor_open(struct TitleSequence* sequence, int32_t command, bool insert);
rct_window* window_scenarioselect_open(scenarioselect_callback callback, bool titleEditor);

View File

@@ -280,10 +280,11 @@ static void cheat_generate_guests(int32_t count)
static void cheat_set_guest_parameter(int32_t parameter, int32_t value)
{
int32_t spriteIndex;
rct_peep* peep;
FOR_ALL_GUESTS (spriteIndex, peep)
Peep* p;
FOR_ALL_GUESTS (spriteIndex, p)
{
auto peep = p->AsGuest();
assert(peep != nullptr);
switch (parameter)
{
case GUEST_PARAMETER_HAPPINESS:
@@ -327,10 +328,11 @@ static void cheat_set_guest_parameter(int32_t parameter, int32_t value)
static void cheat_give_all_guests(int32_t object)
{
int32_t spriteIndex;
rct_peep* peep;
FOR_ALL_GUESTS (spriteIndex, peep)
Peep* p;
FOR_ALL_GUESTS (spriteIndex, p)
{
auto peep = p->AsGuest();
assert(peep != nullptr);
switch (object)
{
case OBJECT_MONEY:
@@ -356,7 +358,7 @@ static void cheat_give_all_guests(int32_t object)
static void cheat_remove_all_guests()
{
rct_peep* peep;
Peep* peep;
rct_vehicle* vehicle;
uint16_t spriteIndex, nextSpriteIndex;
ride_id_t rideIndex;
@@ -418,7 +420,7 @@ static void cheat_remove_all_guests()
static void cheat_explode_guests()
{
int32_t sprite_index;
rct_peep* peep;
Peep* peep;
FOR_ALL_GUESTS (sprite_index, peep)
{
@@ -432,7 +434,7 @@ static void cheat_explode_guests()
static void cheat_set_staff_speed(uint8_t value)
{
uint16_t spriteIndex;
rct_peep* peep;
Peep* peep;
FOR_ALL_STAFF (spriteIndex, peep)
{

View File

@@ -849,7 +849,7 @@ void game_convert_strings_to_rct2(rct_s6_data* s6)
void game_fix_save_vars()
{
// Recalculates peep count after loading a save to fix corrupted files
rct_peep* peep;
Peep* peep;
uint16_t spriteIndex;
uint16_t peepCount = 0;
FOR_ALL_GUESTS (spriteIndex, peep)
@@ -863,7 +863,7 @@ void game_fix_save_vars()
peep_sort();
// Peeps to remove have to be cached here, as removing them from within the loop breaks iteration
std::vector<rct_peep*> peepsToRemove;
std::vector<Peep*> peepsToRemove;
// Fix possibly invalid field values
FOR_ALL_GUESTS (spriteIndex, peep)

View File

@@ -62,7 +62,7 @@ public:
GA_ERROR::INVALID_PARAMETERS, STR_CANT_NAME_GUEST, STR_ERR_INVALID_NAME_FOR_GUEST);
}
rct_peep* peep = GET_PEEP(_spriteIndex);
Peep* peep = GET_PEEP(_spriteIndex);
if (peep->type != PEEP_TYPE_GUEST)
{
log_warning("Invalid game command for sprite %u", _spriteIndex);
@@ -91,7 +91,7 @@ public:
return std::make_unique<GameActionResult>(GA_ERROR::UNKNOWN, STR_CANT_NAME_GUEST, gGameCommandErrorText);
}
rct_peep* peep = GET_PEEP(_spriteIndex);
Peep* peep = GET_PEEP(_spriteIndex);
if (peep->type != PEEP_TYPE_GUEST)
{
log_warning("Invalid game command for sprite %u", _spriteIndex);

View File

@@ -140,7 +140,7 @@ private:
}
uint16_t spriteIndex;
rct_peep* peep;
Peep* peep;
FOR_ALL_GUESTS (spriteIndex, peep)
{
uint8_t ride_id_bit = _rideIndex % 8;

View File

@@ -66,7 +66,7 @@ public:
// Update each staff member's uniform
int32_t spriteIndex;
rct_peep* peep;
Peep* peep;
FOR_ALL_PEEPS (spriteIndex, peep)
{
if (peep->type == PEEP_TYPE_STAFF && peep->staff_type == _staffType)

View File

@@ -73,7 +73,7 @@ public:
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
}
rct_peep* peep = GET_PEEP(_spriteIndex);
Peep* peep = GET_PEEP(_spriteIndex);
if (peep->type != PEEP_TYPE_STAFF || peep->staff_type != STAFF_TYPE_ENTERTAINER)
{
log_warning("Invalid game command for sprite %u", _spriteIndex);
@@ -91,7 +91,7 @@ public:
GameActionResult::Ptr Execute() const override
{
rct_peep* peep = GET_PEEP(_spriteIndex);
Peep* peep = GET_PEEP(_spriteIndex);
auto spriteType = static_cast<PeepSpriteType>(_costume + 4);
peep->sprite_type = spriteType;

View File

@@ -63,7 +63,7 @@ public:
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER);
}
rct_peep* peep = GET_PEEP(_spriteIndex);
Peep* peep = GET_PEEP(_spriteIndex);
if (peep->type != PEEP_TYPE_STAFF)
{
log_warning("Invalid game command for sprite %u", _spriteIndex);
@@ -95,7 +95,7 @@ public:
GA_ERROR::UNKNOWN, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, gGameCommandErrorText);
}
rct_peep* peep = GET_PEEP(_spriteIndex);
Peep* peep = GET_PEEP(_spriteIndex);
if (peep->type != PEEP_TYPE_STAFF)
{
log_warning("Invalid game command for sprite %u", _spriteIndex);

Some files were not shown because too many files have changed in this diff Show More