1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 04:23:20 +01:00

Rename Peep::action_sprite_type to use TitleCase

This commit is contained in:
Tulio Leao
2020-06-07 21:22:13 -03:00
parent 0d84779763
commit 89a084cbc9
11 changed files with 31 additions and 31 deletions

View File

@@ -255,7 +255,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots
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, ActionSpriteType);
COMPARE_FIELD(Peep, NextActionSpriteType);
COMPARE_FIELD(Peep, ActionSpriteImageOffset);
COMPARE_FIELD(Peep, Action);

View File

@@ -164,7 +164,7 @@ private:
newPeep->special_sprite = 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

@@ -69,7 +69,7 @@ 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;
PeepActionSpriteType spriteType = peep->ActionSpriteType;
uint8_t imageOffset = peep->ActionSpriteImageOffset;
if (peep->Action == PEEP_ACTION_NONE_1)

View File

@@ -6776,7 +6776,7 @@ void Guest::SetSpriteType(PeepSpriteType new_sprite_type)
PeepFlags |= PEEP_FLAGS_SLOW_WALK;
}
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_INVALID;
ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_INVALID;
UpdateCurrentActionSpriteType();
if (state == PEEP_STATE_SITTING)

View File

@@ -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();
}
@@ -623,8 +623,8 @@ 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;
}
@@ -636,14 +636,14 @@ std::optional<CoordsXY> Peep::UpdateAction(int16_t& xy_distance)
ActionFrame++;
// If last frame of action
if (ActionFrame >= peepAnimation[action_sprite_type].num_frames)
if (ActionFrame >= peepAnimation[ActionSpriteType].num_frames)
{
ActionSpriteImageOffset = 0;
Action = PEEP_ACTION_NONE_2;
UpdateCurrentActionSpriteType();
return { { x, y } };
}
ActionSpriteImageOffset = peepAnimation[action_sprite_type].frame_offsets[ActionFrame];
ActionSpriteImageOffset = peepAnimation[ActionSpriteType].frame_offsets[ActionFrame];
// If not throwing up and not at the frame where sick appears.
if (Action != PEEP_ACTION_THROW_UP || ActionFrame != 15)
@@ -747,7 +747,7 @@ void Peep::PickupAbort(int32_t old_x)
Action = PEEP_ACTION_NONE_2;
special_sprite = 0;
ActionSpriteImageOffset = 0;
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
ActionSpriteType = PEEP_ACTION_SPRITE_TYPE_NONE;
PathCheckOptimisation = 0;
}
@@ -796,13 +796,13 @@ bool Peep::Place(const TileCoordsXYZ& location, bool apply)
Action = PEEP_ACTION_NONE_2;
special_sprite = 0;
ActionSpriteImageOffset = 0;
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
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();
}
@@ -1622,15 +1622,15 @@ Peep* Peep::Generate(const CoordsXYZ& coords)
peep->special_sprite = 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;
@@ -2237,10 +2237,10 @@ void peep_set_map_tooltip(Peep* peep)
void Peep::SwitchNextActionSpriteType()
{
// TBD: Add nextActionSpriteType as function parameter and make peep->NextActionSpriteType obsolete?
if (NextActionSpriteType != action_sprite_type)
if (NextActionSpriteType != ActionSpriteType)
{
Invalidate();
action_sprite_type = NextActionSpriteType;
ActionSpriteType = NextActionSpriteType;
const rct_sprite_bounds* spriteBounds = g_peep_animation_entries[sprite_type].sprite_bounds;
sprite_width = spriteBounds[NextActionSpriteType].sprite_width;
sprite_height_negative = spriteBounds[NextActionSpriteType].sprite_height_negative;

View File

@@ -654,7 +654,7 @@ struct Peep : SpriteBase
};
// Normally 0, 1 for carrying sliding board on spiral slide ride, 2 for carrying lawn mower
uint8_t special_sprite;
PeepActionSpriteType action_sprite_type;
PeepActionSpriteType ActionSpriteType;
// Seems to be used like a local variable, as it's always set before calling SwitchNextActionSpriteType, which
// reads this again
PeepActionSpriteType NextActionSpriteType;

View File

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

View File

@@ -1396,13 +1396,13 @@ private:
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->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);

View File

@@ -1177,7 +1177,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src)
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->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);

View File

@@ -1442,7 +1442,7 @@ public:
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->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);