diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index 3aa5cbd709..f8d5ac6a04 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -213,32 +213,10 @@ struct rct1_ride }; assert_struct_size(rct1_ride, 0x260); -struct rct1_unk_sprite +struct rct1_unk_sprite : RCT12SpriteBase { - uint8_t sprite_identifier; // 0x00 - uint8_t misc_identifier; // 0x01 - uint16_t next_in_quadrant; // 0x02 - uint16_t next; // 0x04 - uint16_t previous; // 0x06 - uint8_t linked_list_type_offset; // 0x08 Valid values are SPRITE_LINKEDLIST_OFFSET_... - // Height from centre of sprite to bottom - uint8_t sprite_height_negative; // 0x09 - uint16_t sprite_index; // 0x0A - uint16_t flags; // 0x0C - int16_t x; // 0x0E - int16_t y; // 0x10 - int16_t z; // 0x12 - // Width from centre of sprite to edge - uint8_t sprite_width; // 0x14 - // Height from centre of sprite to top - uint8_t sprite_height_positive; // 0x15 - int16_t sprite_left; // 0x16 - int16_t sprite_top; // 0x18 - int16_t sprite_right; // 0x1A - int16_t sprite_bottom; // 0x1C - uint8_t sprite_direction; // direction of sprite? 0x1e - uint8_t pad_1F[3]; // 0x1f - rct_string_id name_string_idx; // 0x22 + uint8_t pad_1F[3]; // 0x1f + rct_string_id name_string_idx; // 0x22 uint16_t var_24; uint16_t frame; // 0x26 uint8_t var_28[3]; @@ -247,32 +225,10 @@ struct rct1_unk_sprite uint8_t var_71; }; -struct rct1_vehicle +struct rct1_vehicle : RCT12SpriteBase { - uint8_t sprite_identifier; // 0x00 - uint8_t is_child; // 0x01 - uint16_t next_in_quadrant; // 0x02 - uint16_t next; // 0x04 - uint16_t previous; // 0x06 - uint8_t linked_list_type_offset; // 0x08 Valid values are SPRITE_LINKEDLIST_OFFSET_... - // Height from centre of sprite to bottom - uint8_t sprite_height_negative; // 0x09 - uint16_t sprite_index; // 0x0A - uint16_t flags; // 0x0C - int16_t x; // 0x0E - int16_t y; // 0x10 - int16_t z; // 0x12 - // Width from centre of sprite to edge - uint8_t sprite_width; // 0x14 - // Height from centre of sprite to top - uint8_t sprite_height_positive; // 0x15 - int16_t sprite_left; // 0x16 - int16_t sprite_top; // 0x18 - int16_t sprite_right; // 0x1A - int16_t sprite_bottom; // 0x1C - uint8_t sprite_direction; // 0x1E - uint8_t vehicle_sprite_type; // 0x1F - uint8_t bank_rotation; // 0x20 + uint8_t vehicle_sprite_type; // 0x1F + uint8_t bank_rotation; // 0x20 uint8_t pad_21[3]; int32_t remaining_distance; // 0x24 int32_t velocity; // 0x28 @@ -372,30 +328,8 @@ struct rct1_vehicle uint8_t colours_extended; // 0xD7 }; -struct rct1_peep +struct rct1_peep : RCT12SpriteBase { - uint8_t sprite_identifier; // 0x00 - uint8_t misc_identifier; // 0x01 - uint16_t next_in_quadrant; // 0x02 - uint16_t next; // 0x04 - uint16_t previous; // 0x06 - uint8_t linked_list_type_offset; // 0x08 Valid values are SPRITE_LINKEDLIST_OFFSET_... - // Height from centre of sprite to bottom - uint8_t sprite_height_negative; // 0x09 - uint16_t sprite_index; // 0x0A - uint16_t flags; // 0x0C - int16_t x; // 0x0E - int16_t y; // 0x10 - int16_t z; // 0x12 - // Width from centre of sprite to edge - uint8_t sprite_width; // 0x14 - // Height from centre of sprite to top - uint8_t sprite_height_positive; // 0x15 - int16_t sprite_left; // 0x16 - int16_t sprite_top; // 0x18 - int16_t sprite_right; // 0x1A - int16_t sprite_bottom; // 0x1C - uint8_t sprite_direction; // 0x1E uint8_t pad_1F[3]; rct_string_id name_string_idx; // 0x22 uint16_t next_x; // 0x24 @@ -483,14 +417,14 @@ struct rct1_peep uint8_t rides_been_on[32]; // 0x7C // 255 bit bitmap of every ride the peep has been on see // window_peep_rides_update for how to use. - uint32_t id; // 0x9C - money32 cash_in_pocket; // 0xA0 - money32 cash_spent; // 0xA4 - int32_t time_in_park; // 0xA8 - int8_t rejoin_queue_timeout; // 0xAC - uint8_t previous_ride; // 0xAD - uint16_t previous_ride_time_out; // 0xAE - rct_peep_thought thoughts[PEEP_MAX_THOUGHTS]; // 0xB0 + uint32_t id; // 0x9C + money32 cash_in_pocket; // 0xA0 + money32 cash_spent; // 0xA4 + int32_t time_in_park; // 0xA8 + int8_t rejoin_queue_timeout; // 0xAC + uint8_t previous_ride; // 0xAD + uint16_t previous_ride_time_out; // 0xAE + RCT12PeepThought thoughts[RCT12_PEEP_MAX_THOUGHTS]; // 0xB0 uint8_t pad_C4; union { @@ -578,14 +512,14 @@ union rct1_sprite rct1_unk_sprite unknown; rct1_vehicle vehicle; rct1_peep peep; - rct_litter litter; - rct_balloon balloon; - rct_sprite duck; - rct_jumping_fountain jumping_fountain; - rct_money_effect money_effect; - rct_crashed_vehicle_particle crashed_vehicle_particle; - rct_crash_splash crash_splash; - rct_steam_particle steam_particle; + RCT12SpriteLitter litter; + RCT12SpriteBalloon balloon; + RCT12SpriteDuck duck; + RCT12SpriteJumpingFountain jumping_fountain; + RCT12SpriteMoneyEffect money_effect; + RCT12SpriteCrashedVehicleParticle crashed_vehicle_particle; + RCT12SpriteCrashSplash crash_splash; + RCT12SpriteSteamParticle steam_particle; }; assert_struct_size(rct1_sprite, 0x100); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 98bcef0446..7c2886c75a 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1174,7 +1174,7 @@ private: dst->ride_subtype = ride->subtype; dst->vehicle_type = vehicleEntryIndex; - dst->is_child = src->is_child; + dst->is_child = src->type; dst->var_44 = src->var_44; dst->remaining_distance = src->remaining_distance; @@ -1536,9 +1536,14 @@ private: dst->photo1_ride_ref = src->photo1_ride_ref; - for (size_t i = 0; i < PEEP_MAX_THOUGHTS; i++) + for (size_t i = 0; i < std::size(src->thoughts); i++) { - dst->thoughts[i] = src->thoughts[i]; + auto srcThought = &src->thoughts[i]; + auto dstThought = &dst->thoughts[i]; + dstThought->type = (PeepThoughtType)srcThought->type; + dstThought->item = srcThought->type; + dstThought->freshness = srcThought->freshness; + dstThought->fresh_timeout = srcThought->fresh_timeout; } dst->previous_ride = src->previous_ride; @@ -1652,7 +1657,7 @@ private: { if (sprite.unknown.sprite_identifier == SPRITE_IDENTIFIER_LITTER) { - rct_litter* srcLitter = &sprite.litter; + const auto* srcLitter = &sprite.litter; rct_litter* litter = (rct_litter*)create_sprite(SPRITE_IDENTIFIER_LITTER); move_sprite_to_list((rct_sprite*)litter, SPRITE_LIST_LITTER * 2); @@ -1685,7 +1690,7 @@ private: move_sprite_to_list((rct_sprite*)dst, SPRITE_LIST_MISC * 2); dst->sprite_identifier = src->sprite_identifier; - dst->type = src->misc_identifier; + dst->type = src->type; dst->flags = src->flags; dst->sprite_direction = src->sprite_direction; dst->sprite_width = src->sprite_width; @@ -1694,7 +1699,7 @@ private: sprite_move(src->x, src->y, src->z, (rct_sprite*)dst); - switch (src->misc_identifier) + switch (src->type) { case SPRITE_MISC_STEAM_PARTICLE: ImportSteamParticle((rct_steam_particle*)dst, (rct_steam_particle*)src); diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 21b3e6b059..d8277f102f 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -37,6 +37,8 @@ #define RCT12_MAX_USER_STRINGS 1024 #define RCT12_USER_STRING_MAX_LENGTH 32 +#define RCT12_PEEP_MAX_THOUGHTS 5 + #pragma pack(push, 1) struct rct12_award @@ -366,4 +368,134 @@ struct RCT12EightCarsCorruptElement15 : RCT12TileElementBase }; assert_struct_size(RCT12EightCarsCorruptElement15, 8); +struct RCT12SpriteBase +{ + uint8_t sprite_identifier; // 0x00 + uint8_t type; // 0x01 + uint16_t next_in_quadrant; // 0x02 + uint16_t next; // 0x04 + uint16_t previous; // 0x06 + uint8_t linked_list_type_offset; // 0x08 + uint8_t sprite_height_negative; // 0x09 + uint16_t sprite_index; // 0x0A + uint16_t flags; // 0x0C + int16_t x; // 0x0E + int16_t y; // 0x10 + int16_t z; // 0x12 + uint8_t sprite_width; // 0x14 + uint8_t sprite_height_positive; // 0x15 + int16_t sprite_left; // 0x16 + int16_t sprite_top; // 0x18 + int16_t sprite_right; // 0x1A + int16_t sprite_bottom; // 0x1C + uint8_t sprite_direction; // 0x1E +}; +assert_struct_size(RCT12SpriteBase, 0x1F); + +struct RCT12SpriteBalloon : RCT12SpriteBase +{ + uint8_t pad_1F[0x24 - 0x1F]; + uint16_t popped; // 0x24 + uint8_t time_to_move; // 0x26 + uint8_t frame; // 0x27 + uint8_t pad_28[4]; + uint8_t colour; // 0x2C +}; +assert_struct_size(RCT12SpriteBalloon, 0x2D); + +struct RCT12SpriteDuck : RCT12SpriteBase +{ + uint8_t pad_1F[0x26 - 0x1F]; + uint16_t frame; // 0x26 + uint8_t pad_28[0x30 - 0x28]; + int16_t target_x; // 0x30 + int16_t target_y; // 0x32 + uint8_t pad_34[0x14]; + uint8_t state; // 0x48 +}; +assert_struct_size(RCT12SpriteDuck, 0x49); + +struct RCT12SpriteLitter : RCT12SpriteBase +{ + uint8_t pad_1F[0x24 - 0x1F]; + uint32_t creationTick; // 0x24 +}; +assert_struct_size(RCT12SpriteLitter, 0x28); + +struct RCT12SpriteParticle : RCT12SpriteBase +{ + uint8_t pad_1F[0x26 - 0x1F]; + uint16_t frame; // 0x26 +}; +assert_struct_size(RCT12SpriteParticle, 0x28); + +struct RCT12SpriteJumpingFountain : RCT12SpriteBase +{ + uint8_t pad_1F[0x26 - 0x1F]; + uint8_t num_ticks_alive; // 0x26 + uint8_t frame; // 0x27 + uint8_t pad_28[0x2F - 0x28]; + uint8_t fountain_flags; // 0x2F + int16_t target_x; // 0x30 + int16_t target_y; // 0x32 + uint8_t pad_34[0x46 - 0x34]; + uint16_t iteration; // 0x46 +}; +assert_struct_size(RCT12SpriteJumpingFountain, 0x48); + +struct RCT12SpriteMoneyEffect : RCT12SpriteBase +{ + uint8_t pad_1F[0x24 - 0x1F]; + uint16_t move_delay; // 0x24 + uint8_t num_movements; // 0x26 + uint8_t vertical; + money32 value; // 0x28 + uint8_t pad_2C[0x44 - 0x2C]; + int16_t offset_x; // 0x44 + uint16_t wiggle; // 0x46 +}; +assert_struct_size(RCT12SpriteMoneyEffect, 0x48); + +struct RCT12SpriteCrashedVehicleParticle : RCT12SpriteBase +{ + uint8_t pad_1F[0x24 - 0x1F]; + uint16_t time_to_live; // 0x24 + uint16_t frame; // 0x26 + uint8_t pad_28[0x2C - 0x28]; + uint8_t colour[2]; // 0x2C + uint16_t crashed_sprite_base; // 0x2E + int16_t velocity_x; // 0x30 + int16_t velocity_y; // 0x32 + int16_t velocity_z; // 0x34 + uint8_t pad_36[0x38 - 0x36]; + int32_t acceleration_x; // 0x38 + int32_t acceleration_y; // 0x3C + int32_t acceleration_z; // 0x40 +}; +assert_struct_size(RCT12SpriteCrashedVehicleParticle, 0x44); + +struct RCT12SpriteCrashSplash : RCT12SpriteBase +{ + uint8_t pad_1F[0x26 - 0x1F]; + uint16_t frame; // 0x26 +}; +assert_struct_size(RCT12SpriteCrashSplash, 0x28); + +struct RCT12SpriteSteamParticle : RCT12SpriteBase +{ + uint8_t pad_1F[0x24 - 0x1F]; + uint16_t time_to_move; // 0x24 + uint16_t frame; // 0x26 +}; +assert_struct_size(RCT12SpriteSteamParticle, 0x28); + +struct RCT12PeepThought +{ + uint8_t type; + uint8_t item; + uint8_t freshness; + uint8_t fresh_timeout; +}; +assert_struct_size(RCT12PeepThought, 4); + #pragma pack(pop) diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 241272cce1..df81561bc2 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -302,6 +302,183 @@ struct rct_scores_entry }; assert_struct_size(rct_scores_entry, 0x02B0); +struct RCT2SpritePeep : RCT12SpriteBase +{ + uint8_t pad_1F[0x22 - 0x1F]; + rct_string_id name_string_idx; // 0x22 + uint16_t next_x; // 0x24 + uint16_t next_y; // 0x26 + uint8_t next_z; // 0x28 + uint8_t next_flags; // 0x29 + uint8_t outside_of_park; // 0x2A + uint8_t state; // 0x2B + uint8_t sub_state; // 0x2C + uint8_t sprite_type; // 0x2D + uint8_t peep_type; // 0x2E + union + { + uint8_t staff_type; // 0x2F + uint8_t no_of_rides; // 0x2F + }; + uint8_t tshirt_colour; // 0x30 + uint8_t trousers_colour; // 0x31 + uint16_t destination_x; // 0x32 + uint16_t destination_y; // 0x34 + uint8_t destination_tolerance; // 0x36 + uint8_t var_37; + uint8_t energy; // 0x38 + uint8_t energy_target; // 0x39 + uint8_t happiness; // 0x3A + uint8_t happiness_target; // 0x3B + uint8_t nausea; // 0x3C + uint8_t nausea_target; // 0x3D + uint8_t hunger; // 0x3E + uint8_t thirst; // 0x3F + uint8_t toilet; // 0x40 + uint8_t mass; // 0x41 + uint8_t time_to_consume; // 0x42 + uint8_t intensity; // 0x43 + uint8_t nausea_tolerance; // 0x44 + uint8_t window_invalidate_flags; // 0x45 + money16 paid_on_drink; // 0x46 + uint8_t ride_types_been_on[16]; // 0x48 + uint32_t item_extra_flags; // 0x58 + uint8_t photo2_ride_ref; // 0x5C + uint8_t photo3_ride_ref; // 0x5D + uint8_t photo4_ride_ref; // 0x5E + uint8_t pad_5F[0x09]; // 0x5F + uint8_t current_ride; // 0x68 + uint8_t current_ride_station; // 0x69 + uint8_t current_train; // 0x6A + union + { + struct + { + uint8_t current_car; // 0x6B + uint8_t current_seat; // 0x6C + }; + uint16_t time_to_sitdown; // 0x6B + struct + { + uint8_t time_to_stand; // 0x6B + uint8_t standing_flags; // 0x6C + }; + }; + uint8_t special_sprite; // 0x6D + uint8_t action_sprite_type; // 0x6E + uint8_t next_action_sprite_type; // 0x6F + uint8_t action_sprite_image_offset; // 0x70 + uint8_t action; // 0x71 + uint8_t action_frame; // 0x72 + uint8_t step_progress; // 0x73 + union + { + uint16_t mechanic_time_since_call; + uint16_t next_in_queue; // 0x74 + }; + uint8_t pad_76; + uint8_t pad_77; + union + { + uint8_t maze_last_edge; // 0x78 + uint8_t direction; + }; + uint8_t interaction_ride_index; + uint16_t time_in_queue; // 0x7A + uint8_t rides_been_on[32]; // 0x7C + uint32_t id; // 0x9C + money32 cash_in_pocket; // 0xA0 + money32 cash_spent; // 0xA4 + int32_t time_in_park; // 0xA8 + int8_t rejoin_queue_timeout; // 0xAC + uint8_t previous_ride; // 0xAD + uint16_t previous_ride_time_out; // 0xAE + RCT12PeepThought thoughts[RCT12_PEEP_MAX_THOUGHTS]; // 0xB0 + uint8_t path_check_optimisation; // 0xC4 + union + { + uint8_t staff_id; // 0xC5 + uint8_t guest_heading_to_ride_id; // 0xC5 + }; + union + { + uint8_t staff_orders; // 0xC6 + uint8_t peep_is_lost_countdown; // 0xC6 + }; + uint8_t photo1_ride_ref; // 0xC7 + uint32_t peep_flags; // 0xC8 + rct12_xyzd8 pathfind_goal; // 0xCC + rct12_xyzd8 pathfind_history[4]; // 0xD0 + uint8_t no_action_frame_num; // 0xE0 + uint8_t litter_count; // 0xE1 + union + { + uint8_t time_on_ride; // 0xE2 + uint8_t staff_mowing_timeout; // 0xE2 + }; + uint8_t disgusting_count; // 0xE3 + union + { + money16 paid_to_enter; // 0xE4 + uint16_t staff_lawns_mown; // 0xE4 + uint16_t staff_rides_fixed; // 0xE4 + }; + union + { + money16 paid_on_rides; // 0xE6 + uint16_t staff_gardens_watered; // 0xE6 + uint16_t staff_rides_inspected; // 0xE6 + }; + union + { + money16 paid_on_food; // 0xE8 + uint16_t staff_litter_swept; // 0xE8 + }; + union + { + money16 paid_on_souvenirs; // 0xEA + uint16_t staff_bins_emptied; // 0xEA + }; + uint8_t no_of_food; // 0xEC + uint8_t no_of_drinks; // 0xED + uint8_t no_of_souvenirs; // 0xEE + uint8_t vandalism_seen; // 0xEF 0xC0 vandalism thought timeout, 0x3F vandalism tiles seen + uint8_t voucher_type; // 0xF0 + uint8_t voucher_arguments; // 0xF1 ride_id or string_offset_id + uint8_t surroundings_thought_timeout; // 0xF2 + uint8_t angriness; // 0xF3 + uint8_t time_lost; // 0xF4 the time the peep has been lost when it reaches 254 generates the lost thought + uint8_t days_in_queue; // 0xF5 + uint8_t balloon_colour; // 0xF6 + uint8_t umbrella_colour; // 0xF7 + uint8_t hat_colour; // 0xF8 + uint8_t favourite_ride; // 0xF9 + uint8_t favourite_ride_rating; // 0xFA + uint8_t pad_FB; + uint32_t item_standard_flags; // 0xFC +}; +assert_struct_size(RCT2SpritePeep, 0x100); + +union RCT2Sprite +{ +private: + uint8_t pad_00[0x100]; + +public: + RCT12SpriteBase unknown; + rct_vehicle vehicle; + RCT2SpritePeep peep; + RCT12SpriteLitter litter; + RCT12SpriteBalloon balloon; + RCT12SpriteDuck duck; + RCT12SpriteJumpingFountain jumping_fountain; + RCT12SpriteMoneyEffect money_effect; + RCT12SpriteCrashedVehicleParticle crashed_vehicle_particle; + RCT12SpriteCrashSplash crash_splash; + RCT12SpriteSteamParticle steam_particle; +}; +assert_struct_size(RCT2Sprite, 0x100); + #pragma pack(pop) #endif diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index add46c7e11..86b4c0765e 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -832,9 +832,9 @@ public: { // The number of riders might have overflown or underflown. Re-calculate the value. uint16_t numRiders = 0; - for (const rct_sprite& sprite : _s6.sprites) + for (const auto& sprite : _s6.sprites) { - if (sprite.generic.sprite_identifier == SPRITE_IDENTIFIER_PEEP) + if (sprite.unknown.sprite_identifier == SPRITE_IDENTIFIER_PEEP) { if (sprite.peep.current_ride == rideIndex && (sprite.peep.state == PEEP_STATE_ON_RIDE || sprite.peep.state == PEEP_STATE_ENTERING_RIDE)) @@ -1057,13 +1057,13 @@ public: gSpriteListCount[SPRITE_LIST_NULL] += (MAX_SPRITES - RCT2_MAX_SPRITES); } - void ImportSprite(rct_sprite* dst, const rct_sprite* src) + void ImportSprite(rct_sprite* dst, const RCT2Sprite* src) { std::memset(dst, 0, sizeof(rct_sprite)); - switch (src->generic.sprite_identifier) + switch (src->unknown.sprite_identifier) { case SPRITE_IDENTIFIER_NULL: - ImportSpriteCommonProperties((rct_sprite_common*)dst, (const rct_sprite_common*)src); + ImportSpriteCommonProperties((rct_sprite_common*)dst, &src->unknown); break; case SPRITE_IDENTIFIER_VEHICLE: ImportSpriteVehicle(&dst->vehicle, &src->vehicle); @@ -1072,21 +1072,21 @@ public: ImportSpritePeep(&dst->peep, &src->peep); break; case SPRITE_IDENTIFIER_MISC: - ImportSpriteMisc(&dst->generic, &src->generic); + ImportSpriteMisc(&dst->generic, &src->unknown); break; case SPRITE_IDENTIFIER_LITTER: ImportSpriteLitter(&dst->litter, &src->litter); break; default: - ImportSpriteCommonProperties((rct_sprite_common*)dst, (const rct_sprite_common*)src); - log_warning("Sprite identifier %d can not be imported."); + ImportSpriteCommonProperties((rct_sprite_common*)dst, (const RCT12SpriteBase*)src); + log_warning("Sprite identifier %d can not be imported.", src->unknown.sprite_identifier); break; } } void ImportSpriteVehicle(rct_vehicle* dst, const rct_vehicle* src) { - ImportSpriteCommonProperties((rct_sprite_common*)dst, (const rct_sprite_common*)src); + ImportSpriteCommonProperties((rct_sprite_common*)dst, (const RCT12SpriteBase*)src); dst->vehicle_sprite_type = src->vehicle_sprite_type; dst->bank_rotation = src->bank_rotation; dst->remaining_distance = src->remaining_distance; @@ -1152,18 +1152,19 @@ public: dst->target_seat_rotation = src->target_seat_rotation; } - void ImportSpritePeep(rct_peep* dst, const rct_peep* src) + void ImportSpritePeep(rct_peep* dst, const RCT2SpritePeep* src) { - ImportSpriteCommonProperties((rct_sprite_common*)dst, (const rct_sprite_common*)src); + ImportSpriteCommonProperties((rct_sprite_common*)dst, src); + dst->name_string_idx = src->name_string_idx; dst->next_x = src->next_x; dst->next_y = src->next_y; dst->next_z = src->next_z; dst->next_flags = src->next_flags; dst->outside_of_park = src->outside_of_park; - dst->state = src->state; + dst->state = (PeepState)src->state; dst->sub_state = src->sub_state; - dst->sprite_type = src->sprite_type; - dst->type = src->type; + dst->sprite_type = (PeepSpriteType)src->sprite_type; + dst->type = (PeepType)src->peep_type; dst->no_of_rides = src->no_of_rides; dst->tshirt_colour = src->tshirt_colour; dst->trousers_colour = src->trousers_colour; @@ -1199,10 +1200,10 @@ 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 = src->action_sprite_type; - dst->next_action_sprite_type = src->next_action_sprite_type; + dst->action_sprite_type = (PeepActionSpriteType)src->action_sprite_type; + dst->next_action_sprite_type = (PeepActionSpriteType)src->next_action_sprite_type; dst->action_sprite_image_offset = src->action_sprite_image_offset; - dst->action = src->action; + dst->action = (PeepActionType)src->action; dst->action_frame = src->action_frame; dst->step_progress = src->step_progress; dst->next_in_queue = src->next_in_queue; @@ -1222,7 +1223,12 @@ public: dst->previous_ride_time_out = src->previous_ride_time_out; for (size_t i = 0; i < std::size(src->thoughts); i++) { - dst->thoughts[i] = src->thoughts[i]; + auto srcThought = &src->thoughts[i]; + auto dstThought = &dst->thoughts[i]; + dstThought->type = (PeepThoughtType)srcThought->type; + dstThought->item = srcThought->type; + dstThought->freshness = srcThought->freshness; + dstThought->fresh_timeout = srcThought->fresh_timeout; } dst->path_check_optimisation = src->path_check_optimisation; dst->guest_heading_to_ride_id = src->guest_heading_to_ride_id; @@ -1259,7 +1265,7 @@ public: dst->item_standard_flags = src->item_standard_flags; } - void ImportSpriteMisc(rct_sprite_common* cdst, const rct_sprite_common* csrc) + void ImportSpriteMisc(rct_sprite_common* cdst, const RCT12SpriteBase* csrc) { ImportSpriteCommonProperties(cdst, csrc); switch (cdst->type) @@ -1267,7 +1273,7 @@ public: case SPRITE_MISC_STEAM_PARTICLE: { auto src = (const rct_steam_particle*)csrc; - auto dst = (rct_steam_particle*)cdst; + auto dst = (RCT12SpriteSteamParticle*)cdst; dst->time_to_move = src->time_to_move; dst->frame = src->frame; break; @@ -1275,7 +1281,7 @@ public: case SPRITE_MISC_MONEY_EFFECT: { auto src = (const rct_money_effect*)csrc; - auto dst = (rct_money_effect*)cdst; + auto dst = (RCT12SpriteMoneyEffect*)cdst; dst->move_delay = src->move_delay; dst->num_movements = src->num_movements; dst->vertical = src->vertical; @@ -1287,7 +1293,7 @@ public: case SPRITE_MISC_CRASHED_VEHICLE_PARTICLE: { auto src = (const rct_crashed_vehicle_particle*)csrc; - auto dst = (rct_crashed_vehicle_particle*)cdst; + auto dst = (RCT12SpriteCrashedVehicleParticle*)cdst; dst->frame = src->frame; dst->time_to_live = src->time_to_live; dst->frame = src->frame; @@ -1306,7 +1312,7 @@ public: case SPRITE_MISC_EXPLOSION_FLARE: case SPRITE_MISC_CRASH_SPLASH: { - auto src = (const rct_sprite_generic*)csrc; + auto src = (const RCT12SpriteParticle*)csrc; auto dst = (rct_sprite_generic*)cdst; dst->frame = src->frame; break; @@ -1314,7 +1320,7 @@ public: case SPRITE_MISC_JUMPING_FOUNTAIN_WATER: case SPRITE_MISC_JUMPING_FOUNTAIN_SNOW: { - auto src = (const rct_jumping_fountain*)csrc; + auto src = (const RCT12SpriteJumpingFountain*)csrc; auto dst = (rct_jumping_fountain*)cdst; dst->num_ticks_alive = src->num_ticks_alive; dst->frame = src->frame; @@ -1326,7 +1332,7 @@ public: } case SPRITE_MISC_BALLOON: { - auto src = (const rct_balloon*)csrc; + auto src = (const RCT12SpriteBalloon*)csrc; auto dst = (rct_balloon*)cdst; dst->popped = src->popped; dst->time_to_move = src->time_to_move; @@ -1336,7 +1342,7 @@ public: } case SPRITE_MISC_DUCK: { - auto src = (const rct_duck*)csrc; + auto src = (const RCT12SpriteDuck*)csrc; auto dst = (rct_duck*)cdst; dst->frame = src->frame; dst->target_x = src->target_x; @@ -1345,18 +1351,18 @@ public: break; } default: - log_warning("Misc. sprite type %d can not be imported."); + log_warning("Misc. sprite type %d can not be imported.", cdst->type); break; } } - void ImportSpriteLitter(rct_litter* dst, const rct_litter* src) + void ImportSpriteLitter(rct_litter* dst, const RCT12SpriteLitter* src) { ImportSpriteCommonProperties(dst, src); dst->creationTick = src->creationTick; } - void ImportSpriteCommonProperties(rct_sprite_common* dst, const rct_sprite_common* src) + void ImportSpriteCommonProperties(rct_sprite_common* dst, const RCT12SpriteBase* src) { dst->sprite_identifier = src->sprite_identifier; dst->type = src->type; @@ -1377,7 +1383,6 @@ public: dst->sprite_right = src->sprite_right; dst->sprite_bottom = src->sprite_bottom; dst->sprite_direction = src->sprite_direction; - dst->name_string_idx = src->name_string_idx; } }; diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index 3b2a68188a..39c4667a10 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -111,7 +111,7 @@ struct rct_s6_data // SC6[6] uint32_t next_free_tile_element_pointer_index; - rct_sprite sprites[RCT2_MAX_SPRITES]; + RCT2Sprite sprites[RCT2_MAX_SPRITES]; uint16_t sprite_lists_head[6]; uint16_t sprite_lists_count[6]; rct_string_id park_name;