Rename some Peep member variables to use TitleCase (#11931)

* Rename Peep::destination_tolerance to use TitleCase

* Rename Peep::destination_y to use TitleCase

* Rename Peep::destination_x to use TitleCase

* Rename Peep::trousers_colour to use Title Case

* Rename Peep::tshirt_colour to use TitleCase

* Rename Peep::no_of_rides to use Title Case

* Rename Peep::staff_type to use TitleCase

* Rename Peep::type to use TitleCase

* Rename Peep::sprite_type to use TitleCase

* Rename Peep::sub_state to use TitleCase

* Rename Peep::state to use TitleCase

* Rename Peep::outside_of_park to use TitleCase

* Rename Peep::next_flags to use TitleCase

* Rename Peep::name to use TitleCase

* Rename Peep::NoOfRides to GuestNoOfRides

* Rename Peep::Type to AssignedPeepType

* Rename Peep::GuestNoOfRides to GuestNumRides
This commit is contained in:
Tulio Leao 2020-06-14 02:31:08 -03:00 committed by GitHub
parent de045978de
commit e54a3d89f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 680 additions and 679 deletions

View File

@ -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);

View File

@ -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<money32>(peep->PaidOnRides);
ft.Add<uint16_t>(peep->no_of_rides);
if (peep->no_of_rides != 1)
ft.Add<uint16_t>(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<uint32_t>(SPRITE_ID_PALETTE_COLOUR_1(peep->tshirt_colour) | ShopItems[item].Image);
ft.Add<uint32_t>(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;

View File

@ -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

View File

@ -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)
{

View File

@ -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;

View File

@ -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;

View File

@ -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<money32>(gStaffWageTable[peep->staff_type]);
Formatter::Common().Add<money32>(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<void*>(&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<void*>(&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;
}

View File

@ -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<int32_t>::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);
}
}

View File

@ -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++;
}

View File

@ -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);

View File

@ -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<GameActionResult>(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<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_CANT_NAME_GUEST, STR_NONE);

View File

@ -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)
{

View File

@ -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();
}

View File

@ -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);

View File

@ -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<PeepSpriteType>(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;

View File

@ -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;
}
}

View File

@ -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<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
@ -94,7 +94,7 @@ public:
Peep* peep = GET_PEEP(_spriteIndex);
auto spriteType = static_cast<PeepSpriteType>(_costume + 4);
peep->sprite_type = spriteType;
peep->SpriteType = spriteType;
peep->PeepFlags &= ~PEEP_FLAGS_SLOW_WALK;
if (peep_slow_walking_types[spriteType])
{

View File

@ -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<GameActionResult>(
@ -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<GameActionResult>(

View File

@ -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<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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++;

View File

@ -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

View File

@ -251,7 +251,7 @@ std::optional<CoordsXYZ> 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;

View File

@ -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);

View File

@ -59,7 +59,7 @@ void sprite_paint_setup(paint_session* session, const uint16_t x, const uint16_t
if (spr->generic.Is<Peep>())
{
const Peep* peep = reinterpret_cast<const Peep*>(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;
}

View File

@ -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<STAFF_TYPE>(staffType), session->MapPosition))

View File

@ -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<STAFF_TYPE>(staffType), session->MapPosition))

File diff suppressed because it is too large Load Diff

View File

@ -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<MAX_STATIONS>& 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);

View File

@ -330,12 +330,12 @@ template<> bool SpriteBase::Is<Peep>() const
Guest* Peep::AsGuest()
{
return type == PEEP_TYPE_GUEST ? static_cast<Guest*>(this) : nullptr;
return AssignedPeepType == PEEP_TYPE_GUEST ? static_cast<Guest*>(this) : nullptr;
}
Staff* Peep::AsStaff()
{
return type == PEEP_TYPE_STAFF ? static_cast<Staff*>(this) : nullptr;
return AssignedPeepType == PEEP_TYPE_STAFF ? static_cast<Staff*>(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<Peep>())
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<CoordsXY> 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<CoordsXY> 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<CoordsXY> 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<CoordsXY> 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<CoordsXY> 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<uint8_t>(scenario_rand() % std::size(tshirt_colours));
peep->tshirt_colour = tshirt_colours[tshirtColour];
peep->TshirtColour = tshirt_colours[tshirtColour];
uint8_t trousersColour = static_cast<uint8_t>(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<uint8_t*>(argsV));
switch (state)
switch (State)
{
case PEEP_STATE_FALLING:
ft.Add<rct_string_id>(Action == PEEP_ACTION_DROWNING ? STR_DROWNING : STR_WALKING);
@ -1895,11 +1895,11 @@ void Peep::FormatActionTo(void* argsV) const
ft.Add<rct_string_id>(STR_EMPTYING_LITTER_BIN);
break;
case PEEP_STATE_ANSWERING:
if (sub_state == 0)
if (SubState == 0)
{
ft.Add<rct_string_id>(STR_WALKING);
}
else if (sub_state == 1)
else if (SubState == 1)
{
ft.Add<rct_string_id>(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<uint8_t*>(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<rct_string_id>(STR_STRING).Add<const char*>(name).NumBytes();
return ft.Add<rct_string_id>(STR_STRING).Add<const char*>(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<rct_string_id>((peep->PeepFlags & PEEP_FLAGS_TRACKING) ? STR_TRACKED_GUEST_MAP_TIP : STR_GUEST_MAP_TIP);
ft.Add<uint32_t>(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>())
{
Peep* other_peep = reinterpret_cast<Peep*>(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();
}

View File

@ -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];

View File

@ -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<PeepSpriteType>(value + PEEP_SPRITE_TYPE_ENTERTAINER_PANDA);
SpriteType = static_cast<PeepSpriteType>(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;

View File

@ -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<PeepActionType>(src->action);
dst->SpecialSprite = src->special_sprite;
dst->NextActionSpriteType = static_cast<PeepActionSpriteType>(src->next_action_sprite_type);
@ -1399,7 +1399,7 @@ private:
dst->ActionSpriteType = static_cast<PeepActionSpriteType>(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<PeepState>(src->state);
dst->sub_state = src->sub_state;
dst->State = static_cast<PeepState>(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<PeepType>(src->type);
dst->AssignedPeepType = static_cast<PeepType>(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);

View File

@ -1096,9 +1096,9 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src)
ExportSpriteCommonProperties(dst, static_cast<const SpriteBase*>(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<int>(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<uint8_t>(src->state);
dst->sub_state = src->sub_state;
dst->sprite_type = static_cast<uint8_t>(src->sprite_type);
dst->peep_type = static_cast<uint8_t>(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<uint8_t>(src->State);
dst->sub_state = src->SubState;
dst->sprite_type = static_cast<uint8_t>(src->SpriteType);
dst->peep_type = static_cast<uint8_t>(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;

View File

@ -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<PeepState>(src->state);
dst->sub_state = src->sub_state;
dst->sprite_type = static_cast<PeepSpriteType>(src->sprite_type);
dst->type = static_cast<PeepType>(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<PeepState>(src->state);
dst->SubState = src->sub_state;
dst->SpriteType = static_cast<PeepSpriteType>(src->sprite_type);
dst->AssignedPeepType = static_cast<PeepType>(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;

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -142,7 +142,7 @@ namespace OpenRCT2::Scripting
auto peep = static_cast<Peep*>(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<CoordsXY>(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();
}

View File

@ -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<ScStaff>(spriteId)));
else
result.push_back(GetObjectAsDukValue(_context, std::make_shared<ScGuest>(spriteId)));
@ -200,7 +200,7 @@ namespace OpenRCT2::Scripting
case SPRITE_IDENTIFIER_VEHICLE:
return GetObjectAsDukValue(_context, std::make_shared<ScVehicle>(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<ScStaff>(spriteId));
else
return GetObjectAsDukValue(_context, std::make_shared<ScGuest>(spriteId));

View File

@ -422,14 +422,14 @@ void footpath_interrupt_peeps(const CoordsXYZ& footpathPos)
if (entity->generic.Is<Peep>())
{
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();
}
}

View File

@ -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;

View File

@ -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;

View File

@ -291,7 +291,7 @@ rct_sprite_checksum sprite_checksum()
if (copy.generic.Is<Peep>())
{
// 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

View File

@ -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

View File

@ -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);

View File

@ -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);