Merge pull request #11901 from tupaschoal/prevent-shadow-peep-5

Rename some Peep member variables to use TitleCase
This commit is contained in:
Tulio Leao 2020-06-08 18:08:56 -03:00 committed by GitHub
commit c2322d79c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 534 additions and 534 deletions

View File

@ -2015,17 +2015,17 @@ static rct_string_id window_guest_inventory_format_item(Peep* peep, int32_t item
ft.Add<uint32_t>(SPRITE_ID_PALETTE_COLOUR_1(peep->tshirt_colour) | ShopItems[item].Image);
break;
case SHOP_ITEM_PHOTO2:
ride = get_ride(peep->photo2_ride_ref);
ride = get_ride(peep->Photo2RideRef);
if (ride != nullptr)
ride->FormatNameTo(gCommonFormatArgs + 6);
break;
case SHOP_ITEM_PHOTO3:
ride = get_ride(peep->photo3_ride_ref);
ride = get_ride(peep->Photo3RideRef);
if (ride != nullptr)
ride->FormatNameTo(gCommonFormatArgs + 6);
break;
case SHOP_ITEM_PHOTO4:
ride = get_ride(peep->photo4_ride_ref);
ride = get_ride(peep->Photo4RideRef);
if (ride != nullptr)
ride->FormatNameTo(gCommonFormatArgs + 6);
break;

View File

@ -449,10 +449,10 @@ void game_fix_save_vars()
// Fix possibly invalid field values
FOR_ALL_GUESTS (spriteIndex, peep)
{
if (peep->current_ride_station >= MAX_STATIONS)
if (peep->CurrentRideStation >= MAX_STATIONS)
{
const uint8_t srcStation = peep->current_ride_station;
const uint8_t rideIdx = peep->current_ride;
const uint8_t srcStation = peep->CurrentRideStation;
const uint8_t rideIdx = peep->CurrentRide;
if (rideIdx == RIDE_ID_NULL)
{
continue;
@ -461,7 +461,7 @@ void game_fix_save_vars()
if (ride == nullptr)
{
log_warning("Couldn't find ride %u, resetting ride on peep %u", rideIdx, spriteIndex);
peep->current_ride = RIDE_ID_NULL;
peep->CurrentRide = RIDE_ID_NULL;
continue;
}
auto ft = Formatter::Common();
@ -478,7 +478,7 @@ void game_fix_save_vars()
else
{
log_warning("Amending ride station to %u.", station);
peep->current_ride_station = station;
peep->CurrentRideStation = station;
}
}
}

View File

@ -247,20 +247,20 @@ struct GameStateSnapshots final : public IGameStateSnapshots
COMPARE_FIELD(Peep, ride_types_been_on[i]);
}
COMPARE_FIELD(Peep, item_extra_flags);
COMPARE_FIELD(Peep, photo2_ride_ref);
COMPARE_FIELD(Peep, photo3_ride_ref);
COMPARE_FIELD(Peep, photo4_ride_ref);
COMPARE_FIELD(Peep, current_ride);
COMPARE_FIELD(Peep, current_ride_station);
COMPARE_FIELD(Peep, current_train);
COMPARE_FIELD(Peep, time_to_sitdown);
COMPARE_FIELD(Peep, special_sprite);
COMPARE_FIELD(Peep, action_sprite_type);
COMPARE_FIELD(Peep, next_action_sprite_type);
COMPARE_FIELD(Peep, action_sprite_image_offset);
COMPARE_FIELD(Peep, action);
COMPARE_FIELD(Peep, action_frame);
COMPARE_FIELD(Peep, step_progress);
COMPARE_FIELD(Peep, Photo2RideRef);
COMPARE_FIELD(Peep, Photo3RideRef);
COMPARE_FIELD(Peep, Photo4RideRef);
COMPARE_FIELD(Peep, CurrentRide);
COMPARE_FIELD(Peep, CurrentRideStation);
COMPARE_FIELD(Peep, CurrentTrain);
COMPARE_FIELD(Peep, TimeToSitdown);
COMPARE_FIELD(Peep, SpecialSprite);
COMPARE_FIELD(Peep, ActionSpriteType);
COMPARE_FIELD(Peep, NextActionSpriteType);
COMPARE_FIELD(Peep, ActionSpriteImageOffset);
COMPARE_FIELD(Peep, Action);
COMPARE_FIELD(Peep, ActionFrame);
COMPARE_FIELD(Peep, StepProgress);
COMPARE_FIELD(Peep, GuestNextInQueue);
COMPARE_FIELD(Peep, MazeLastEdge);
COMPARE_FIELD(Peep, InteractionRideIndex);

View File

@ -164,13 +164,13 @@ private:
peep->RidesBeenOn[ride_id_offset] &= ~(1 << ride_id_bit);
if (peep->state == PEEP_STATE_WATCHING)
{
if (peep->current_ride == _rideIndex)
if (peep->CurrentRide == _rideIndex)
{
peep->current_ride = RIDE_ID_NULL;
if (peep->time_to_stand >= 50)
peep->CurrentRide = RIDE_ID_NULL;
if (peep->TimeToStand >= 50)
{
// make peep stop watching the ride
peep->time_to_stand = 50;
peep->TimeToStand = 50;
}
}
}
@ -194,21 +194,21 @@ private:
}
if (peep->item_extra_flags & PEEP_ITEM_PHOTO2)
{
if (peep->photo2_ride_ref == _rideIndex)
if (peep->Photo2RideRef == _rideIndex)
{
peep->item_extra_flags &= ~PEEP_ITEM_PHOTO2;
}
}
if (peep->item_extra_flags & PEEP_ITEM_PHOTO3)
{
if (peep->photo3_ride_ref == _rideIndex)
if (peep->Photo3RideRef == _rideIndex)
{
peep->item_extra_flags &= ~PEEP_ITEM_PHOTO3;
}
}
if (peep->item_extra_flags & PEEP_ITEM_PHOTO4)
{
if (peep->photo4_ride_ref == _rideIndex)
if (peep->Photo4RideRef == _rideIndex)
{
peep->item_extra_flags &= ~PEEP_ITEM_PHOTO4;
}

View File

@ -160,11 +160,11 @@ private:
{
newPeep->sprite_identifier = 1;
newPeep->window_invalidate_flags = 0;
newPeep->action = PEEP_ACTION_NONE_2;
newPeep->special_sprite = 0;
newPeep->action_sprite_image_offset = 0;
newPeep->Action = PEEP_ACTION_NONE_2;
newPeep->SpecialSprite = 0;
newPeep->ActionSpriteImageOffset = 0;
newPeep->WalkingFrameNum = 0;
newPeep->action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
newPeep->ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_NONE;
newPeep->PathCheckOptimisation = 0;
newPeep->type = PEEP_TYPE_STAFF;
newPeep->outside_of_park = 0;

View File

@ -100,7 +100,7 @@ public:
{
peep->PeepFlags |= PEEP_FLAGS_SLOW_WALK;
}
peep->action_frame = 0;
peep->ActionFrame = 0;
peep->UpdateCurrentActionSpriteType();
peep->Invalidate();

View File

@ -689,13 +689,13 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep
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->current_ride);
auto ride = get_ride(peep->CurrentRide);
if (ride != nullptr && (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
{
auto train = GET_VEHICLE(ride->vehicles[peep->current_train]);
auto train = GET_VEHICLE(ride->vehicles[peep->CurrentTrain]);
if (train != nullptr)
{
auto car = train->GetCar(peep->current_car);
auto car = train->GetCar(peep->CurrentCar);
if (car != nullptr)
{
focus.sprite.sprite_id = car->sprite_index;
@ -706,7 +706,7 @@ viewport_focus viewport_update_smart_guest_follow(rct_window* window, Peep* peep
}
if (peep->x == LOCATION_NULL && overallFocus)
{
auto ride = get_ride(peep->current_ride);
auto ride = get_ride(peep->CurrentRide);
if (ride != nullptr)
{
auto xy = ride->overall_view.ToTileCentre();

View File

@ -249,7 +249,7 @@ std::optional<CoordsXYZ> news_item_get_subject_location(int32_t type, int32_t su
}
// Find which ride peep is on
Ride* ride = get_ride(peep->current_ride);
Ride* ride = get_ride(peep->CurrentRide);
if (ride == nullptr || !(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
{
subjectLoc = std::nullopt;
@ -257,9 +257,9 @@ std::optional<CoordsXYZ> news_item_get_subject_location(int32_t type, int32_t su
}
// Find the first car of the train peep is on
sprite = try_get_sprite(ride->vehicles[peep->current_train]);
sprite = try_get_sprite(ride->vehicles[peep->CurrentTrain]);
// Find the actual car peep is on
for (int32_t i = 0; i < peep->current_car && sprite != nullptr; i++)
for (int32_t i = 0; i < peep->CurrentCar && sprite != nullptr; i++)
{
sprite = try_get_sprite(sprite->vehicle.next_vehicle_on_train);
}

View File

@ -69,12 +69,12 @@ void peep_paint(paint_session* session, const Peep* peep, int32_t imageDirection
rct_peep_animation_entry sprite = g_peep_animation_entries[peep->sprite_type];
PeepActionSpriteType spriteType = peep->action_sprite_type;
uint8_t imageOffset = peep->action_sprite_image_offset;
PeepActionSpriteType spriteType = peep->ActionSpriteType;
uint8_t imageOffset = peep->ActionSpriteImageOffset;
if (peep->action == PEEP_ACTION_NONE_1)
if (peep->Action == PEEP_ACTION_NONE_1)
{
spriteType = peep->next_action_sprite_type;
spriteType = peep->NextActionSpriteType;
imageOffset = 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -1646,9 +1646,9 @@ static int32_t guest_path_find_leaving_park(Peep* peep, uint8_t edges)
static int32_t guest_path_find_park_entrance(Peep* peep, uint8_t edges)
{
// If entrance no longer exists, choose a new one
if ((peep->PeepFlags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN) && peep->current_ride >= gParkEntrances.size())
if ((peep->PeepFlags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN) && peep->CurrentRide >= gParkEntrances.size())
{
peep->current_ride = 0xFF;
peep->CurrentRide = RIDE_ID_NULL;
peep->PeepFlags &= ~(PEEP_FLAGS_PARK_ENTRANCE_CHOSEN);
}
@ -1671,11 +1671,11 @@ static int32_t guest_path_find_park_entrance(Peep* peep, uint8_t edges)
if (chosenEntrance == 0xFF)
return guest_path_find_aimless(peep, edges);
peep->current_ride = chosenEntrance;
peep->CurrentRide = chosenEntrance;
peep->PeepFlags |= PEEP_FLAGS_PARK_ENTRANCE_CHOSEN;
}
const auto& entrance = gParkEntrances[peep->current_ride];
const auto& entrance = gParkEntrances[peep->CurrentRide];
gPeepPathFindGoalPosition = TileCoordsXYZ(entrance);
gPeepPathFindIgnoreForeignQueues = true;

View File

@ -499,18 +499,18 @@ bool Peep::CheckForPath()
PeepActionSpriteType Peep::GetActionSpriteType()
{
if (action >= PEEP_ACTION_NONE_1)
if (Action >= PEEP_ACTION_NONE_1)
{ // PEEP_ACTION_NONE_1 or PEEP_ACTION_NONE_2
return PeepSpecialSpriteToSpriteTypeMap[special_sprite];
return PeepSpecialSpriteToSpriteTypeMap[SpecialSprite];
}
else if (action < std::size(PeepActionToSpriteTypeMap))
else if (Action < std::size(PeepActionToSpriteTypeMap))
{
return PeepActionToSpriteTypeMap[action];
return PeepActionToSpriteTypeMap[Action];
}
else
{
openrct2_assert(
action >= std::size(PeepActionToSpriteTypeMap) && action < PEEP_ACTION_NONE_1, "Invalid peep action %u", action);
Action >= std::size(PeepActionToSpriteTypeMap) && Action < PEEP_ACTION_NONE_1, "Invalid peep action %u", Action);
return PEEP_ACTION_SPRITE_TYPE_NONE;
}
}
@ -525,18 +525,18 @@ void Peep::UpdateCurrentActionSpriteType()
return;
}
PeepActionSpriteType newActionSpriteType = GetActionSpriteType();
if (action_sprite_type == newActionSpriteType)
if (ActionSpriteType == newActionSpriteType)
{
return;
}
Invalidate();
action_sprite_type = newActionSpriteType;
ActionSpriteType = newActionSpriteType;
const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[sprite_type].sprite_bounds;
sprite_width = spriteBounds[action_sprite_type].sprite_width;
sprite_height_negative = spriteBounds[action_sprite_type].sprite_height_negative;
sprite_height_positive = spriteBounds[action_sprite_type].sprite_height_positive;
sprite_width = spriteBounds[ActionSpriteType].sprite_width;
sprite_height_negative = spriteBounds[ActionSpriteType].sprite_height_negative;
sprite_height_positive = spriteBounds[ActionSpriteType].sprite_height_positive;
Invalidate();
}
@ -544,15 +544,15 @@ void Peep::UpdateCurrentActionSpriteType()
/* rct2: 0x00693BE5 */
void Peep::SwitchToSpecialSprite(uint8_t special_sprite_id)
{
if (special_sprite_id == special_sprite)
if (special_sprite_id == SpecialSprite)
return;
special_sprite = special_sprite_id;
SpecialSprite = special_sprite_id;
// If NONE_1 or NONE_2
if (action >= PEEP_ACTION_NONE_1)
if (Action >= PEEP_ACTION_NONE_1)
{
action_sprite_image_offset = 0;
ActionSpriteImageOffset = 0;
}
UpdateCurrentActionSpriteType();
}
@ -582,10 +582,10 @@ std::optional<CoordsXY> Peep::UpdateAction()
*/
std::optional<CoordsXY> Peep::UpdateAction(int16_t& xy_distance)
{
_unk_F1AEF0 = action_sprite_image_offset;
if (action == PEEP_ACTION_NONE_1)
_unk_F1AEF0 = ActionSpriteImageOffset;
if (Action == PEEP_ACTION_NONE_1)
{
action = PEEP_ACTION_NONE_2;
Action = PEEP_ACTION_NONE_2;
}
CoordsXY diffrenceLoc = { x - destination_x, y - destination_y };
@ -595,7 +595,7 @@ std::optional<CoordsXY> Peep::UpdateAction(int16_t& xy_distance)
xy_distance = x_delta + y_delta;
if (action == PEEP_ACTION_NONE_1 || action == PEEP_ACTION_NONE_2)
if (Action == PEEP_ACTION_NONE_1 || Action == PEEP_ACTION_NONE_2)
{
if (xy_distance <= destination_tolerance)
{
@ -623,30 +623,30 @@ std::optional<CoordsXY> Peep::UpdateAction(int16_t& xy_distance)
loc += word_981D7C[nextDirection / 8];
WalkingFrameNum++;
const rct_peep_animation* peepAnimation = g_peep_animation_entries[sprite_type].sprite_animation;
const uint8_t* imageOffset = peepAnimation[action_sprite_type].frame_offsets;
if (WalkingFrameNum >= peepAnimation[action_sprite_type].num_frames)
const uint8_t* imageOffset = peepAnimation[ActionSpriteType].frame_offsets;
if (WalkingFrameNum >= peepAnimation[ActionSpriteType].num_frames)
{
WalkingFrameNum = 0;
}
action_sprite_image_offset = imageOffset[WalkingFrameNum];
ActionSpriteImageOffset = imageOffset[WalkingFrameNum];
return loc;
}
const rct_peep_animation* peepAnimation = g_peep_animation_entries[sprite_type].sprite_animation;
action_frame++;
ActionFrame++;
// If last frame of action
if (action_frame >= peepAnimation[action_sprite_type].num_frames)
if (ActionFrame >= peepAnimation[ActionSpriteType].num_frames)
{
action_sprite_image_offset = 0;
action = PEEP_ACTION_NONE_2;
ActionSpriteImageOffset = 0;
Action = PEEP_ACTION_NONE_2;
UpdateCurrentActionSpriteType();
return { { x, y } };
}
action_sprite_image_offset = peepAnimation[action_sprite_type].frame_offsets[action_frame];
ActionSpriteImageOffset = peepAnimation[ActionSpriteType].frame_offsets[ActionFrame];
// If not throwing up and not at the frame where sick appears.
if (action != PEEP_ACTION_THROW_UP || action_frame != 15)
if (Action != PEEP_ACTION_THROW_UP || ActionFrame != 15)
{
return { { x, y } };
}
@ -680,7 +680,7 @@ void peep_decrement_num_riders(Peep* peep)
{
if (peep->state == PEEP_STATE_ON_RIDE || peep->state == PEEP_STATE_ENTERING_RIDE)
{
auto ride = get_ride(peep->current_ride);
auto ride = get_ride(peep->CurrentRide);
if (ride != nullptr)
{
ride->num_riders = std::max(0, ride->num_riders - 1);
@ -704,7 +704,7 @@ void peep_window_state_update(Peep* peep)
{
if (peep->state == PEEP_STATE_ON_RIDE || peep->state == PEEP_STATE_ENTERING_RIDE)
{
auto ride = get_ride(peep->current_ride);
auto ride = get_ride(peep->CurrentRide);
if (ride != nullptr)
{
ride->num_riders++;
@ -744,10 +744,10 @@ void Peep::PickupAbort(int32_t old_x)
if (x != LOCATION_NULL)
{
SetState(PEEP_STATE_FALLING);
action = PEEP_ACTION_NONE_2;
special_sprite = 0;
action_sprite_image_offset = 0;
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
Action = PEEP_ACTION_NONE_2;
SpecialSprite = 0;
ActionSpriteImageOffset = 0;
ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_NONE;
PathCheckOptimisation = 0;
}
@ -793,16 +793,16 @@ bool Peep::Place(const TileCoordsXYZ& location, bool apply)
{
MoveTo(destination);
SetState(PEEP_STATE_FALLING);
action = PEEP_ACTION_NONE_2;
special_sprite = 0;
action_sprite_image_offset = 0;
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
Action = PEEP_ACTION_NONE_2;
SpecialSprite = 0;
ActionSpriteImageOffset = 0;
ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_NONE;
PathCheckOptimisation = 0;
sprite_position_tween_reset();
if (type == PEEP_TYPE_GUEST)
{
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_INVALID;
ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_INVALID;
happiness_target = std::max(happiness_target - 10, 0);
UpdateCurrentActionSpriteType();
}
@ -875,12 +875,12 @@ void Peep::Remove()
*/
void Peep::UpdateFalling()
{
if (action == PEEP_ACTION_DROWNING)
if (Action == PEEP_ACTION_DROWNING)
{
// Check to see if we are ready to drown.
UpdateAction();
Invalidate();
if (action == PEEP_ACTION_DROWNING)
if (Action == PEEP_ACTION_DROWNING)
return;
if (gConfigNotifications.guest_died)
@ -939,9 +939,9 @@ void Peep::UpdateFalling()
InsertNewThought(PEEP_THOUGHT_TYPE_DROWNING, PEEP_THOUGHT_ITEM_NONE);
action = PEEP_ACTION_DROWNING;
action_frame = 0;
action_sprite_image_offset = 0;
Action = PEEP_ACTION_DROWNING;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
peep_window_state_update(this);
@ -1115,15 +1115,15 @@ void Peep::Update()
stepsToTake = 95;
if ((PeepFlags & PEEP_FLAGS_SLOW_WALK) && state != PEEP_STATE_QUEUING)
stepsToTake /= 2;
if (action == PEEP_ACTION_NONE_2 && (GetNextIsSloped()))
if (Action == PEEP_ACTION_NONE_2 && (GetNextIsSloped()))
{
stepsToTake /= 2;
if (state == PEEP_STATE_QUEUING)
stepsToTake += stepsToTake / 2;
}
uint32_t carryCheck = step_progress + stepsToTake;
step_progress = carryCheck;
uint32_t carryCheck = StepProgress + stepsToTake;
StepProgress = carryCheck;
if (carryCheck <= 255)
{
auto guest = AsGuest();
@ -1446,11 +1446,11 @@ void peep_applause()
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->action_frame = 0;
peep->action_sprite_image_offset = 0;
peep->Action = PEEP_ACTION_CLAP;
peep->ActionFrame = 0;
peep->ActionSpriteImageOffset = 0;
peep->UpdateCurrentActionSpriteType();
}
}
@ -1566,11 +1566,11 @@ static constexpr const uint8_t tshirt_colours[] = {
void Peep::InsertNewThought(PeepThoughtType thoughtType, uint8_t thoughtArguments)
{
PeepActionType newAction = PeepThoughtToActionMap[thoughtType].action;
if (newAction != PEEP_ACTION_NONE_2 && this->action >= PEEP_ACTION_NONE_1)
if (newAction != PEEP_ACTION_NONE_2 && this->Action >= PEEP_ACTION_NONE_1)
{
action = newAction;
action_frame = 0;
action_sprite_image_offset = 0;
Action = newAction;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
}
@ -1618,19 +1618,19 @@ Peep* Peep::Generate(const CoordsXYZ& coords)
peep->sprite_type = PEEP_SPRITE_TYPE_NORMAL;
peep->outside_of_park = 1;
peep->state = PEEP_STATE_FALLING;
peep->action = PEEP_ACTION_NONE_2;
peep->special_sprite = 0;
peep->action_sprite_image_offset = 0;
peep->Action = PEEP_ACTION_NONE_2;
peep->SpecialSprite = 0;
peep->ActionSpriteImageOffset = 0;
peep->WalkingFrameNum = 0;
peep->action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
peep->ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_NONE;
peep->PeepFlags = 0;
peep->FavouriteRide = RIDE_ID_NULL;
peep->FavouriteRideRating = 0;
const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[peep->sprite_type].sprite_bounds;
peep->sprite_width = spriteBounds[peep->action_sprite_type].sprite_width;
peep->sprite_height_negative = spriteBounds[peep->action_sprite_type].sprite_height_negative;
peep->sprite_height_positive = spriteBounds[peep->action_sprite_type].sprite_height_positive;
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;
peep->MoveTo(coords);
peep->sprite_direction = 0;
@ -1794,7 +1794,7 @@ void Peep::FormatActionTo(void* argsV) const
switch (state)
{
case PEEP_STATE_FALLING:
ft.Add<rct_string_id>(action == PEEP_ACTION_DROWNING ? STR_DROWNING : STR_WALKING);
ft.Add<rct_string_id>(Action == PEEP_ACTION_DROWNING ? STR_DROWNING : STR_WALKING);
break;
case PEEP_STATE_1:
ft.Add<rct_string_id>(STR_WALKING);
@ -1803,7 +1803,7 @@ void Peep::FormatActionTo(void* argsV) const
case PEEP_STATE_LEAVING_RIDE:
case PEEP_STATE_ENTERING_RIDE:
{
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride != nullptr)
{
ft.Add<rct_string_id>(ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE);
@ -1818,7 +1818,7 @@ void Peep::FormatActionTo(void* argsV) const
case PEEP_STATE_BUYING:
{
ft.Add<rct_string_id>(STR_AT_RIDE);
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride != nullptr)
{
ride->FormatNameTo(ft.Buf());
@ -1848,7 +1848,7 @@ void Peep::FormatActionTo(void* argsV) const
case PEEP_STATE_QUEUING_FRONT:
case PEEP_STATE_QUEUING:
{
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride != nullptr)
{
ft.Add<rct_string_id>(STR_QUEUING_FOR);
@ -1860,18 +1860,18 @@ void Peep::FormatActionTo(void* argsV) const
ft.Add<rct_string_id>(STR_SITTING);
break;
case PEEP_STATE_WATCHING:
if (current_ride != RIDE_ID_NULL)
if (CurrentRide != RIDE_ID_NULL)
{
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride != nullptr)
{
ft.Add<rct_string_id>((current_seat & 0x1) ? STR_WATCHING_CONSTRUCTION_OF : STR_WATCHING_RIDE);
ft.Add<rct_string_id>((StandingFlags & 0x1) ? STR_WATCHING_CONSTRUCTION_OF : STR_WATCHING_RIDE);
ride->FormatNameTo(ft.Buf());
}
}
else
{
ft.Add<rct_string_id>((current_seat & 0x1) ? STR_WATCHING_NEW_RIDE_BEING_CONSTRUCTED : STR_LOOKING_AT_SCENERY);
ft.Add<rct_string_id>((StandingFlags & 0x1) ? STR_WATCHING_NEW_RIDE_BEING_CONSTRUCTED : STR_LOOKING_AT_SCENERY);
}
break;
case PEEP_STATE_PICKED:
@ -1906,7 +1906,7 @@ void Peep::FormatActionTo(void* argsV) const
else
{
ft.Add<rct_string_id>(STR_RESPONDING_TO_RIDE_BREAKDOWN_CALL);
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride != nullptr)
{
ride->FormatNameTo(ft.Buf());
@ -1920,7 +1920,7 @@ void Peep::FormatActionTo(void* argsV) const
case PEEP_STATE_FIXING:
{
ft.Add<rct_string_id>(STR_FIXING_RIDE);
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride != nullptr)
{
ride->FormatNameTo(ft.Buf());
@ -1934,7 +1934,7 @@ void Peep::FormatActionTo(void* argsV) const
case PEEP_STATE_HEADING_TO_INSPECTION:
{
ft.Add<rct_string_id>(STR_HEADING_TO_RIDE_FOR_INSPECTION);
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride != nullptr)
{
ride->FormatNameTo(ft.Buf());
@ -1948,7 +1948,7 @@ void Peep::FormatActionTo(void* argsV) const
case PEEP_STATE_INSPECTING:
{
ft.Add<rct_string_id>(STR_INSPECTING_RIDE);
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride != nullptr)
{
ride->FormatNameTo(ft.Buf());
@ -2236,15 +2236,15 @@ void peep_set_map_tooltip(Peep* peep)
*/
void Peep::SwitchNextActionSpriteType()
{
// TBD: Add nextActionSpriteType as function parameter and make peep->next_action_sprite_type obsolete?
if (next_action_sprite_type != action_sprite_type)
// TBD: Add nextActionSpriteType as function parameter and make peep->NextActionSpriteType obsolete?
if (NextActionSpriteType != ActionSpriteType)
{
Invalidate();
action_sprite_type = next_action_sprite_type;
ActionSpriteType = NextActionSpriteType;
const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[sprite_type].sprite_bounds;
sprite_width = spriteBounds[next_action_sprite_type].sprite_width;
sprite_height_negative = spriteBounds[next_action_sprite_type].sprite_height_negative;
sprite_height_positive = spriteBounds[next_action_sprite_type].sprite_height_positive;
sprite_width = spriteBounds[NextActionSpriteType].sprite_width;
sprite_height_negative = spriteBounds[NextActionSpriteType].sprite_height_negative;
sprite_height_positive = spriteBounds[NextActionSpriteType].sprite_height_positive;
Invalidate();
}
}
@ -2308,14 +2308,14 @@ static bool peep_update_queue_position(Peep* peep, uint8_t previous_action)
}
}
if (peep->action < PEEP_ACTION_NONE_1)
if (peep->Action < PEEP_ACTION_NONE_1)
peep->UpdateAction();
if (peep->action != PEEP_ACTION_NONE_2)
if (peep->Action != PEEP_ACTION_NONE_2)
return true;
peep->action = PEEP_ACTION_NONE_1;
peep->next_action_sprite_type = PEEP_ACTION_SPRITE_TYPE_WATCH_RIDE;
peep->Action = PEEP_ACTION_NONE_1;
peep->NextActionSpriteType = PEEP_ACTION_SPRITE_TYPE_WATCH_RIDE;
if (previous_action != PEEP_ACTION_NONE_1)
peep->Invalidate();
return true;
@ -2385,7 +2385,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl
{
// Guest is in the ride queue.
peep->sub_state = 11;
peep->action_sprite_image_offset = _unk_F1AEF0;
peep->ActionSpriteImageOffset = _unk_F1AEF0;
return;
}
@ -2415,7 +2415,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl
}
// Guest has decided to go on the ride.
peep->action_sprite_image_offset = _unk_F1AEF0;
peep->ActionSpriteImageOffset = _unk_F1AEF0;
peep->InteractionRideIndex = rideIndex;
uint16_t previous_last = ride->stations[stationNum].LastPeepInQueue;
@ -2423,8 +2423,8 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl
peep->GuestNextInQueue = previous_last;
ride->stations[stationNum].QueueLength++;
peep->current_ride = rideIndex;
peep->current_ride_station = stationNum;
peep->CurrentRide = rideIndex;
peep->CurrentRideStation = stationNum;
peep->DaysInQueue = 0;
peep->SetState(PEEP_STATE_QUEUING);
peep->sub_state = 11;
@ -2813,7 +2813,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen
// Check if this queue is connected to the ride the
// peep is queuing for, i.e. the player hasn't edited
// the queue, rebuilt the ride, etc.
if (peep->current_ride == rideIndex)
if (peep->CurrentRide == rideIndex)
{
peep_footpath_move_forward(peep, x, y, tile_element, vandalism_present);
}
@ -2852,8 +2852,8 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen
ride->stations[stationNum].QueueLength++;
peep_decrement_num_riders(peep);
peep->current_ride = rideIndex;
peep->current_ride_station = stationNum;
peep->CurrentRide = rideIndex;
peep->CurrentRideStation = stationNum;
peep->state = PEEP_STATE_QUEUING;
peep->DaysInQueue = 0;
peep_window_state_update(peep);
@ -2962,7 +2962,7 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen
peep->destination_y = (y & 0xFFE0) + 16;
peep->destination_tolerance = 3;
peep->current_ride = rideIndex;
peep->CurrentRide = rideIndex;
peep->SetState(PEEP_STATE_ENTERING_RIDE);
peep->sub_state = PEEP_SHOP_APPROACH;
@ -2985,9 +2985,9 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen
{
if (peep->GuestHeadingToRideId == rideIndex)
peep->GuestHeadingToRideId = 0xFF;
peep->action_sprite_image_offset = _unk_F1AEF0;
peep->ActionSpriteImageOffset = _unk_F1AEF0;
peep->SetState(PEEP_STATE_BUYING);
peep->current_ride = rideIndex;
peep->CurrentRide = rideIndex;
peep->sub_state = 0;
}
@ -3034,10 +3034,10 @@ void Peep::PerformNextAction(uint8_t& pathing_result)
void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result)
{
pathing_result = 0;
PeepActionType previousAction = action;
PeepActionType previousAction = Action;
if (action == PEEP_ACTION_NONE_1)
action = PEEP_ACTION_NONE_2;
if (Action == PEEP_ACTION_NONE_1)
Action = PEEP_ACTION_NONE_2;
if (state == PEEP_STATE_QUEUING)
{
@ -3401,11 +3401,11 @@ static void peep_release_balloon(Guest* peep, int16_t spawn_height)
*/
void Peep::RemoveFromQueue()
{
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride == nullptr)
return;
auto& station = ride->stations[current_ride_station];
auto& station = ride->stations[CurrentRideStation];
// Make sure we don't underflow, building while paused might reset it to 0 where peeps have
// not yet left the queue.
if (station.QueueLength > 0)

View File

@ -632,36 +632,36 @@ struct Peep : SpriteBase
money16 paid_on_drink;
uint8_t ride_types_been_on[16];
uint32_t item_extra_flags;
uint8_t photo2_ride_ref;
uint8_t photo3_ride_ref;
uint8_t photo4_ride_ref;
uint8_t current_ride;
StationIndex current_ride_station;
uint8_t current_train;
uint8_t Photo2RideRef;
uint8_t Photo3RideRef;
uint8_t Photo4RideRef;
uint8_t CurrentRide;
StationIndex CurrentRideStation;
uint8_t CurrentTrain;
union
{
struct
{
uint8_t current_car;
uint8_t current_seat;
uint8_t CurrentCar;
uint8_t CurrentSeat;
};
uint16_t time_to_sitdown;
uint16_t TimeToSitdown;
struct
{
uint8_t time_to_stand;
uint8_t standing_flags;
uint8_t TimeToStand;
uint8_t StandingFlags;
};
};
// Normally 0, 1 for carrying sliding board on spiral slide ride, 2 for carrying lawn mower
uint8_t special_sprite;
PeepActionSpriteType action_sprite_type;
uint8_t SpecialSprite;
PeepActionSpriteType ActionSpriteType;
// Seems to be used like a local variable, as it's always set before calling SwitchNextActionSpriteType, which
// reads this again
PeepActionSpriteType next_action_sprite_type;
uint8_t action_sprite_image_offset;
PeepActionType action;
uint8_t action_frame;
uint8_t step_progress;
PeepActionSpriteType NextActionSpriteType;
uint8_t ActionSpriteImageOffset;
PeepActionType Action;
uint8_t ActionFrame;
uint8_t StepProgress;
union
{
uint16_t MechanicTimeSinceCall; // time getting to ride to fix

View File

@ -745,14 +745,14 @@ static uint8_t staff_mechanic_direction_surface(Peep* peep)
{
uint8_t direction = scenario_rand() & 3;
auto ride = get_ride(peep->current_ride);
auto ride = get_ride(peep->CurrentRide);
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->current_ride_station);
auto location = ride_get_exit_location(ride, peep->CurrentRideStation);
if (location.isNull())
{
location = ride_get_entrance_location(ride, peep->current_ride_station);
location = ride_get_entrance_location(ride, peep->CurrentRideStation);
}
CoordsXY chosenTile = location.ToCoordsXY();
@ -838,15 +838,15 @@ static uint8_t staff_mechanic_direction_path(Peep* peep, uint8_t validDirections
pathDirections |= (1 << direction);
// Mechanic is heading to ride (either broken down or for inspection).
auto ride = get_ride(peep->current_ride);
auto ride = get_ride(peep->CurrentRide);
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. */
TileCoordsXYZD location = ride_get_exit_location(ride, peep->current_ride_station);
TileCoordsXYZD location = ride_get_exit_location(ride, peep->CurrentRideStation);
if (location.isNull())
{
location = ride_get_entrance_location(ride, peep->current_ride_station);
location = ride_get_entrance_location(ride, peep->CurrentRideStation);
// If no entrance is present either. This is an incorrect state.
if (location.isNull())
@ -1064,11 +1064,11 @@ static void staff_entertainer_update_nearby_peeps(Peep* peep)
*/
bool Staff::DoEntertainerPathFinding()
{
if (((scenario_rand() & 0xFFFF) <= 0x4000) && (action == PEEP_ACTION_NONE_1 || action == PEEP_ACTION_NONE_2))
if (((scenario_rand() & 0xFFFF) <= 0x4000) && (Action == PEEP_ACTION_NONE_1 || Action == PEEP_ACTION_NONE_2))
{
action = (scenario_rand() & 1) ? PEEP_ACTION_WAVE_2 : PEEP_ACTION_JOY;
action_frame = 0;
action_sprite_image_offset = 0;
Action = (scenario_rand() & 1) ? PEEP_ACTION_WAVE_2 : PEEP_ACTION_JOY;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
staff_entertainer_update_nearby_peeps(this);
@ -1254,16 +1254,16 @@ void Staff::UpdateWatering()
return;
sprite_direction = (var_37 & 3) << 3;
action = PEEP_ACTION_STAFF_WATERING;
action_frame = 0;
action_sprite_image_offset = 0;
Action = PEEP_ACTION_STAFF_WATERING;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
sub_state = 1;
}
else if (sub_state == 1)
{
if (action != PEEP_ACTION_NONE_2)
if (Action != PEEP_ACTION_NONE_2)
{
UpdateAction();
Invalidate();
@ -1318,16 +1318,16 @@ void Staff::UpdateEmptyingBin()
return;
sprite_direction = (var_37 & 3) << 3;
action = PEEP_ACTION_STAFF_EMPTY_BIN;
action_frame = 0;
action_sprite_image_offset = 0;
Action = PEEP_ACTION_STAFF_EMPTY_BIN;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
sub_state = 1;
}
else if (sub_state == 1)
{
if (action == PEEP_ACTION_NONE_2)
if (Action == PEEP_ACTION_NONE_2)
{
StateReset();
return;
@ -1336,7 +1336,7 @@ void Staff::UpdateEmptyingBin()
UpdateAction();
Invalidate();
if (action_frame != 11)
if (ActionFrame != 11)
return;
TileElement* tile_element = map_get_first_element_at(NextLoc);
@ -1390,7 +1390,7 @@ void Staff::UpdateSweeping()
if (!CheckForPath())
return;
if (action == PEEP_ACTION_STAFF_SWEEP && action_frame == 8)
if (Action == PEEP_ACTION_STAFF_SWEEP && ActionFrame == 8)
{
// Remove sick at this location
litter_remove_at(x, y, z);
@ -1407,9 +1407,9 @@ void Staff::UpdateSweeping()
var_37++;
if (var_37 != 2)
{
action = PEEP_ACTION_STAFF_SWEEP;
action_frame = 0;
action_sprite_image_offset = 0;
Action = PEEP_ACTION_STAFF_SWEEP;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
return;
}
@ -1422,14 +1422,14 @@ void Staff::UpdateSweeping()
*/
void Staff::UpdateHeadingToInspect()
{
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride == nullptr)
{
SetState(PEEP_STATE_FALLING);
return;
}
if (ride_get_exit_location(ride, current_ride_station).isNull())
if (ride_get_exit_location(ride, CurrentRideStation).isNull())
{
ride->lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION;
SetState(PEEP_STATE_FALLING);
@ -1474,12 +1474,12 @@ void Staff::UpdateHeadingToInspect()
return;
}
if (current_ride != rideEntranceExitElement->AsEntrance()->GetRideIndex())
if (CurrentRide != rideEntranceExitElement->AsEntrance()->GetRideIndex())
return;
uint8_t exit_index = rideEntranceExitElement->AsEntrance()->GetStationIndex();
if (current_ride_station != exit_index)
if (CurrentRideStation != exit_index)
return;
if (pathingResult & PATHING_RIDE_ENTRANCE)
@ -1508,7 +1508,7 @@ void Staff::UpdateHeadingToInspect()
int16_t delta_y = abs(y - destination_y);
if (auto loc = UpdateAction())
{
int32_t newZ = ride->stations[current_ride_station].GetBaseZ();
int32_t newZ = ride->stations[CurrentRideStation].GetBaseZ();
if (delta_y < 20)
{
@ -1529,7 +1529,7 @@ void Staff::UpdateHeadingToInspect()
*/
void Staff::UpdateAnswering()
{
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride == nullptr || ride->mechanic_status != RIDE_MECHANIC_STATUS_HEADING)
{
SetState(PEEP_STATE_FALLING);
@ -1538,9 +1538,9 @@ void Staff::UpdateAnswering()
if (sub_state == 0)
{
action = PEEP_ACTION_STAFF_ANSWER_CALL;
action_frame = 0;
action_sprite_image_offset = 0;
Action = PEEP_ACTION_STAFF_ANSWER_CALL;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
@ -1550,7 +1550,7 @@ void Staff::UpdateAnswering()
}
else if (sub_state == 1)
{
if (action == PEEP_ACTION_NONE_2)
if (Action == PEEP_ACTION_NONE_2)
{
sub_state = 2;
peep_window_state_update(this);
@ -1585,12 +1585,12 @@ void Staff::UpdateAnswering()
return;
}
if (current_ride != rideEntranceExitElement->AsEntrance()->GetRideIndex())
if (CurrentRide != rideEntranceExitElement->AsEntrance()->GetRideIndex())
return;
uint8_t exit_index = rideEntranceExitElement->AsEntrance()->GetStationIndex();
if (current_ride_station != exit_index)
if (CurrentRideStation != exit_index)
return;
if (pathingResult & PATHING_RIDE_ENTRANCE)
@ -1619,7 +1619,7 @@ void Staff::UpdateAnswering()
int16_t delta_y = abs(y - destination_y);
if (auto loc = UpdateAction())
{
int32_t newZ = ride->stations[current_ride_station].GetBaseZ();
int32_t newZ = ride->stations[CurrentRideStation].GetBaseZ();
if (delta_y < 20)
{
@ -1855,10 +1855,10 @@ void Staff::Tick128UpdateStaff()
return;
sprite_type = newSpriteType;
action_sprite_image_offset = 0;
ActionSpriteImageOffset = 0;
WalkingFrameNum = 0;
if (action < PEEP_ACTION_NONE_1)
action = PEEP_ACTION_NONE_2;
if (Action < PEEP_ACTION_NONE_1)
Action = PEEP_ACTION_NONE_2;
PeepFlags &= ~PEEP_FLAGS_SLOW_WALK;
if (gSpriteTypeToSlowWalkMap[newSpriteType])
@ -1866,7 +1866,7 @@ void Staff::Tick128UpdateStaff()
PeepFlags |= PEEP_FLAGS_SLOW_WALK;
}
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_INVALID;
ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_INVALID;
UpdateCurrentActionSpriteType();
}
@ -2065,7 +2065,7 @@ static constexpr const uint32_t FixingSubstatesForBreakdown[9] = {
*/
void Staff::UpdateFixing(int32_t steps)
{
auto ride = get_ride(current_ride);
auto ride = get_ride(CurrentRide);
if (ride == nullptr)
{
SetState(PEEP_STATE_FALLING);
@ -2241,13 +2241,13 @@ bool Staff::UpdateFixingFixVehicle(bool firstRun, Ride* ride)
{
sprite_direction = PeepDirection << 3;
action = (scenario_rand() & 1) ? PEEP_ACTION_STAFF_FIX_2 : PEEP_ACTION_STAFF_FIX;
action_sprite_image_offset = 0;
action_frame = 0;
Action = (scenario_rand() & 1) ? PEEP_ACTION_STAFF_FIX_2 : PEEP_ACTION_STAFF_FIX;
ActionSpriteImageOffset = 0;
ActionFrame = 0;
UpdateCurrentActionSpriteType();
}
if (action == PEEP_ACTION_NONE_2)
if (Action == PEEP_ACTION_NONE_2)
{
return true;
}
@ -2255,8 +2255,8 @@ bool Staff::UpdateFixingFixVehicle(bool firstRun, Ride* ride)
UpdateAction();
Invalidate();
uint8_t actionFrame = (action == PEEP_ACTION_STAFF_FIX) ? 0x25 : 0x50;
if (action_frame != actionFrame)
uint8_t actionFrame = (Action == PEEP_ACTION_STAFF_FIX) ? 0x25 : 0x50;
if (ActionFrame != actionFrame)
{
return false;
}
@ -2282,14 +2282,14 @@ bool Staff::UpdateFixingFixVehicleMalfunction(bool firstRun, Ride* ride)
if (!firstRun)
{
sprite_direction = PeepDirection << 3;
action = PEEP_ACTION_STAFF_FIX_3;
action_sprite_image_offset = 0;
action_frame = 0;
Action = PEEP_ACTION_STAFF_FIX_3;
ActionSpriteImageOffset = 0;
ActionFrame = 0;
UpdateCurrentActionSpriteType();
}
if (action == PEEP_ACTION_NONE_2)
if (Action == PEEP_ACTION_NONE_2)
{
return true;
}
@ -2297,7 +2297,7 @@ bool Staff::UpdateFixingFixVehicleMalfunction(bool firstRun, Ride* ride)
UpdateAction();
Invalidate();
if (action_frame != 0x65)
if (ActionFrame != 0x65)
{
return false;
}
@ -2336,7 +2336,7 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, Ride* ride)
return true;
}
auto stationPos = ride->stations[current_ride_station].GetStart();
auto stationPos = ride->stations[CurrentRideStation].GetStart();
if (stationPos.isNull())
{
return true;
@ -2389,14 +2389,14 @@ bool Staff::UpdateFixingFixStationEnd(bool firstRun)
if (!firstRun)
{
sprite_direction = PeepDirection << 3;
action = PEEP_ACTION_STAFF_CHECKBOARD;
action_frame = 0;
action_sprite_image_offset = 0;
Action = PEEP_ACTION_STAFF_CHECKBOARD;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
}
if (action == PEEP_ACTION_NONE_2)
if (Action == PEEP_ACTION_NONE_2)
{
return true;
}
@ -2424,7 +2424,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, Ride* ride)
return true;
}
auto stationPosition = ride->stations[current_ride_station].GetStart();
auto stationPosition = ride->stations[CurrentRideStation].GetStart();
if (stationPosition.isNull())
{
return true;
@ -2433,7 +2433,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, Ride* ride)
CoordsXYE input;
input.x = stationPosition.x;
input.y = stationPosition.y;
input.element = map_get_track_element_at_from_ride({ input.x, input.y, stationPosition.z }, current_ride);
input.element = map_get_track_element_at_from_ride({ input.x, input.y, stationPosition.z }, CurrentRide);
if (input.element == nullptr)
{
return true;
@ -2506,14 +2506,14 @@ bool Staff::UpdateFixingFixStationStart(bool firstRun, Ride* ride)
sprite_direction = PeepDirection << 3;
action = PEEP_ACTION_STAFF_FIX;
action_frame = 0;
action_sprite_image_offset = 0;
Action = PEEP_ACTION_STAFF_FIX;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
}
if (action == PEEP_ACTION_NONE_2)
if (Action == PEEP_ACTION_NONE_2)
{
return true;
}
@ -2534,14 +2534,14 @@ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride* ride)
{
sprite_direction = PeepDirection << 3;
action = PEEP_ACTION_STAFF_FIX_GROUND;
action_frame = 0;
action_sprite_image_offset = 0;
Action = PEEP_ACTION_STAFF_FIX_GROUND;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
}
if (action == PEEP_ACTION_NONE_2)
if (Action == PEEP_ACTION_NONE_2)
{
return true;
}
@ -2549,13 +2549,13 @@ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride* ride)
UpdateAction();
Invalidate();
if (action_frame == 0x28)
if (ActionFrame == 0x28)
{
ride->mechanic_status = RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES;
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE;
}
if (action_frame == 0x13 || action_frame == 0x19 || action_frame == 0x1F || action_frame == 0x25 || action_frame == 0x2B)
if (ActionFrame == 0x13 || ActionFrame == 0x19 || ActionFrame == 0x1F || ActionFrame == 0x25 || ActionFrame == 0x2B)
{
audio_play_sound_at_location(SoundId::MechanicFix, { x, y, z });
}
@ -2572,10 +2572,10 @@ bool Staff::UpdateFixingMoveToStationExit(bool firstRun, Ride* ride)
{
if (!firstRun)
{
auto stationPosition = ride_get_exit_location(ride, current_ride_station).ToCoordsXY();
auto stationPosition = ride_get_exit_location(ride, CurrentRideStation).ToCoordsXY();
if (stationPosition.isNull())
{
stationPosition = ride_get_entrance_location(ride, current_ride_station).ToCoordsXY();
stationPosition = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXY();
if (stationPosition.isNull())
{
@ -2618,7 +2618,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* r
if (state == PEEP_STATE_INSPECTING)
{
UpdateRideInspected(current_ride);
UpdateRideInspected(CurrentRide);
StaffRidesInspected++;
window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME | RIDE_INVALIDATE_RIDE_LIST;
@ -2630,14 +2630,14 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride* r
window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME | RIDE_INVALIDATE_RIDE_LIST;
sprite_direction = PeepDirection << 3;
action = PEEP_ACTION_STAFF_ANSWER_CALL_2;
action_frame = 0;
action_sprite_image_offset = 0;
Action = PEEP_ACTION_STAFF_ANSWER_CALL_2;
ActionFrame = 0;
ActionSpriteImageOffset = 0;
UpdateCurrentActionSpriteType();
}
if (action != PEEP_ACTION_NONE_2)
if (Action != PEEP_ACTION_NONE_2)
{
UpdateAction();
Invalidate();
@ -2658,10 +2658,10 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, Ride* ride)
{
if (!firstRun)
{
auto exitPosition = ride_get_exit_location(ride, current_ride_station).ToCoordsXY();
auto exitPosition = ride_get_exit_location(ride, CurrentRideStation).ToCoordsXY();
if (exitPosition.isNull())
{
exitPosition = ride_get_entrance_location(ride, current_ride_station).ToCoordsXY();
exitPosition = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXY();
if (exitPosition.isNull())
{
@ -2684,7 +2684,7 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, Ride* ride)
int16_t xy_distance;
if (auto loc = UpdateAction(xy_distance))
{
uint16_t stationHeight = ride->stations[current_ride_station].GetBaseZ();
uint16_t stationHeight = ride->stations[CurrentRideStation].GetBaseZ();
if (xy_distance >= 16)
{

View File

@ -1391,18 +1391,18 @@ private:
dst->sprite_identifier = SPRITE_IDENTIFIER_PEEP;
// Peep vs. staff (including which kind)
dst->sprite_type = RCT1::GetPeepSpriteType(src->sprite_type);
dst->action = static_cast<PeepActionType>(src->action);
dst->special_sprite = src->special_sprite;
dst->next_action_sprite_type = static_cast<PeepActionSpriteType>(src->next_action_sprite_type);
dst->action_sprite_image_offset = src->action_sprite_image_offset;
dst->Action = static_cast<PeepActionType>(src->action);
dst->SpecialSprite = src->special_sprite;
dst->NextActionSpriteType = static_cast<PeepActionSpriteType>(src->next_action_sprite_type);
dst->ActionSpriteImageOffset = src->action_sprite_image_offset;
dst->WalkingFrameNum = src->no_action_frame_num;
dst->action_sprite_type = static_cast<PeepActionSpriteType>(src->action_sprite_type);
dst->action_frame = src->action_frame;
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;
dst->sprite_width = spriteBounds[dst->action_sprite_type].sprite_width;
dst->sprite_height_negative = spriteBounds[dst->action_sprite_type].sprite_height_negative;
dst->sprite_height_positive = spriteBounds[dst->action_sprite_type].sprite_height_positive;
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;
dst->MoveTo({ src->x, src->y, src->z });
invalidate_sprite_2(dst);
@ -1423,7 +1423,7 @@ private:
dst->next_flags = src->next_flags;
dst->var_37 = src->var_37;
dst->time_to_consume = src->time_to_consume;
dst->step_progress = src->step_progress;
dst->StepProgress = src->step_progress;
dst->VandalismSeen = src->vandalism_seen;
dst->type = static_cast<PeepType>(src->type);
@ -1466,11 +1466,11 @@ private:
dst->nausea_tolerance = src->nausea_tolerance;
dst->window_invalidate_flags = 0;
dst->current_ride = src->current_ride;
dst->current_ride_station = src->current_ride_station;
dst->current_train = src->current_train;
dst->current_car = src->current_car;
dst->current_seat = src->current_seat;
dst->CurrentRide = src->current_ride;
dst->CurrentRideStation = src->current_ride_station;
dst->CurrentTrain = src->current_train;
dst->CurrentCar = src->current_car;
dst->CurrentSeat = src->current_seat;
dst->GuestTimeOnRide = src->time_on_ride;
dst->DaysInQueue = src->days_in_queue;
@ -3004,7 +3004,7 @@ private:
Peep* peep;
FOR_ALL_GUESTS (i, peep)
{
if (peep->state == PEEP_STATE_QUEUING_FRONT && peep->current_ride == 0)
if (peep->state == PEEP_STATE_QUEUING_FRONT && peep->CurrentRide == 0)
{
peep->RemoveFromQueue();
peep->SetState(PEEP_STATE_FALLING);

View File

@ -1169,20 +1169,20 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src)
dst->ride_types_been_on[i] = src->ride_types_been_on[i];
}
dst->item_extra_flags = src->item_extra_flags;
dst->photo2_ride_ref = src->photo2_ride_ref;
dst->photo3_ride_ref = src->photo3_ride_ref;
dst->photo4_ride_ref = src->photo4_ride_ref;
dst->current_ride = src->current_ride;
dst->current_ride_station = src->current_ride_station;
dst->current_train = src->current_train;
dst->time_to_sitdown = src->time_to_sitdown;
dst->special_sprite = src->special_sprite;
dst->action_sprite_type = static_cast<uint8_t>(src->action_sprite_type);
dst->next_action_sprite_type = static_cast<uint8_t>(src->next_action_sprite_type);
dst->action_sprite_image_offset = src->action_sprite_image_offset;
dst->action = static_cast<uint8_t>(src->action);
dst->action_frame = src->action_frame;
dst->step_progress = src->step_progress;
dst->photo2_ride_ref = src->Photo2RideRef;
dst->photo3_ride_ref = src->Photo3RideRef;
dst->photo4_ride_ref = src->Photo4RideRef;
dst->current_ride = src->CurrentRide;
dst->current_ride_station = src->CurrentRideStation;
dst->current_train = src->CurrentTrain;
dst->time_to_sitdown = src->TimeToSitdown;
dst->special_sprite = src->SpecialSprite;
dst->action_sprite_type = static_cast<uint8_t>(src->ActionSpriteType);
dst->next_action_sprite_type = static_cast<uint8_t>(src->NextActionSpriteType);
dst->action_sprite_image_offset = src->ActionSpriteImageOffset;
dst->action = static_cast<uint8_t>(src->Action);
dst->action_frame = src->ActionFrame;
dst->step_progress = src->StepProgress;
dst->next_in_queue = src->GuestNextInQueue;
dst->direction = src->PeepDirection;
dst->interaction_ride_index = src->InteractionRideIndex;

View File

@ -1434,20 +1434,20 @@ public:
dst->ride_types_been_on[i] = src->ride_types_been_on[i];
}
dst->item_extra_flags = src->item_extra_flags;
dst->photo2_ride_ref = src->photo2_ride_ref;
dst->photo3_ride_ref = src->photo3_ride_ref;
dst->photo4_ride_ref = src->photo4_ride_ref;
dst->current_ride = src->current_ride;
dst->current_ride_station = src->current_ride_station;
dst->current_train = src->current_train;
dst->time_to_sitdown = src->time_to_sitdown;
dst->special_sprite = src->special_sprite;
dst->action_sprite_type = static_cast<PeepActionSpriteType>(src->action_sprite_type);
dst->next_action_sprite_type = static_cast<PeepActionSpriteType>(src->next_action_sprite_type);
dst->action_sprite_image_offset = src->action_sprite_image_offset;
dst->action = static_cast<PeepActionType>(src->action);
dst->action_frame = src->action_frame;
dst->step_progress = src->step_progress;
dst->Photo2RideRef = src->photo2_ride_ref;
dst->Photo3RideRef = src->photo3_ride_ref;
dst->Photo4RideRef = src->photo4_ride_ref;
dst->CurrentRide = src->current_ride;
dst->CurrentRideStation = src->current_ride_station;
dst->CurrentTrain = src->current_train;
dst->TimeToSitdown = src->time_to_sitdown;
dst->SpecialSprite = src->special_sprite;
dst->ActionSpriteType = static_cast<PeepActionSpriteType>(src->action_sprite_type);
dst->NextActionSpriteType = static_cast<PeepActionSpriteType>(src->next_action_sprite_type);
dst->ActionSpriteImageOffset = src->action_sprite_image_offset;
dst->Action = static_cast<PeepActionType>(src->action);
dst->ActionFrame = src->action_frame;
dst->StepProgress = src->step_progress;
dst->GuestNextInQueue = src->next_in_queue;
dst->PeepDirection = src->direction;
dst->InteractionRideIndex = src->interaction_ride_index;

View File

@ -334,16 +334,16 @@ void Ride::QueueInsertGuestAtFront(StationIndex stationIndex, Peep* peep)
assert(peep != nullptr);
peep->GuestNextInQueue = SPRITE_INDEX_NULL;
Peep* queueHeadGuest = GetQueueHeadGuest(peep->current_ride_station);
Peep* queueHeadGuest = GetQueueHeadGuest(peep->CurrentRideStation);
if (queueHeadGuest == nullptr)
{
stations[peep->current_ride_station].LastPeepInQueue = peep->sprite_index;
stations[peep->CurrentRideStation].LastPeepInQueue = peep->sprite_index;
}
else
{
queueHeadGuest->GuestNextInQueue = peep->sprite_index;
}
UpdateQueueLength(peep->current_ride_station);
UpdateQueueLength(peep->CurrentRideStation);
}
/**
@ -1106,7 +1106,7 @@ void ride_remove_peeps(Ride* 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->current_ride != ride->id)
if (peep->CurrentRide != ride->id)
continue;
peep_decrement_num_riders(peep);
@ -2604,7 +2604,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->current_ride != ride->id)
|| mechanic->CurrentRide != ride->id)
{
ride->mechanic_status = RIDE_MECHANIC_STATUS_CALLING;
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE;
@ -2639,8 +2639,8 @@ static void ride_call_mechanic(Ride* ride, Peep* mechanic, int32_t forInspection
ride->mechanic_status = RIDE_MECHANIC_STATUS_HEADING;
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE;
ride->mechanic = mechanic->sprite_index;
mechanic->current_ride = ride->id;
mechanic->current_ride_station = ride->inspection_station;
mechanic->CurrentRide = ride->id;
mechanic->CurrentRideStation = ride->inspection_station;
}
/**
@ -5491,7 +5491,7 @@ void Ride::StopGuestsQueuing()
{
if (peep->state != PEEP_STATE_QUEUING)
continue;
if (peep->current_ride != id)
if (peep->CurrentRide != id)
continue;
peep->RemoveFromQueue();

View File

@ -3055,7 +3055,7 @@ void Vehicle::PeepEasterEggHereWeAre() const
Peep* curPeep = GET_PEEP(vehicle->peep[i]);
if (curPeep->PeepFlags & PEEP_FLAGS_HERE_WE_ARE)
{
curPeep->InsertNewThought(PEEP_THOUGHT_TYPE_HERE_WE_ARE, curPeep->current_ride);
curPeep->InsertNewThought(PEEP_THOUGHT_TYPE_HERE_WE_ARE, curPeep->CurrentRide);
}
}
} while ((spriteId = vehicle->next_vehicle_on_train) != SPRITE_INDEX_NULL);

View File

@ -210,12 +210,12 @@ static bool map_animation_invalidate_small_scenery(const CoordsXYZ& loc)
continue;
if (peep->z != loc.z)
continue;
if (peep->action < PEEP_ACTION_NONE_1)
if (peep->Action < PEEP_ACTION_NONE_1)
continue;
peep->action = PEEP_ACTION_CHECK_TIME;
peep->action_frame = 0;
peep->action_sprite_image_offset = 0;
peep->Action = PEEP_ACTION_CHECK_TIME;
peep->ActionFrame = 0;
peep->ActionSpriteImageOffset = 0;
peep->UpdateCurrentActionSpriteType();
invalidate_sprite_1(peep);
break;

View File

@ -191,20 +191,20 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right)
COMPARE_FIELD(ride_types_been_on[i]);
}
COMPARE_FIELD(item_extra_flags);
COMPARE_FIELD(photo2_ride_ref);
COMPARE_FIELD(photo3_ride_ref);
COMPARE_FIELD(photo4_ride_ref);
COMPARE_FIELD(current_ride);
COMPARE_FIELD(current_ride_station);
COMPARE_FIELD(current_train);
COMPARE_FIELD(time_to_sitdown);
COMPARE_FIELD(special_sprite);
COMPARE_FIELD(action_sprite_type);
COMPARE_FIELD(next_action_sprite_type);
COMPARE_FIELD(action_sprite_image_offset);
COMPARE_FIELD(action);
COMPARE_FIELD(action_frame);
COMPARE_FIELD(step_progress);
COMPARE_FIELD(Photo2RideRef);
COMPARE_FIELD(Photo3RideRef);
COMPARE_FIELD(Photo4RideRef);
COMPARE_FIELD(CurrentRide);
COMPARE_FIELD(CurrentRideStation);
COMPARE_FIELD(CurrentTrain);
COMPARE_FIELD(TimeToSitdown);
COMPARE_FIELD(SpecialSprite);
COMPARE_FIELD(ActionSpriteType);
COMPARE_FIELD(NextActionSpriteType);
COMPARE_FIELD(ActionSpriteImageOffset);
COMPARE_FIELD(Action);
COMPARE_FIELD(ActionFrame);
COMPARE_FIELD(StepProgress);
COMPARE_FIELD(GuestNextInQueue);
COMPARE_FIELD(MazeLastEdge);
COMPARE_FIELD(InteractionRideIndex);