From 5a51f28ba0637ff9e9b8a53ba04c704bb7384fb0 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 8 Jan 2017 20:46:51 +0100 Subject: [PATCH] Fix balloons, import balloons, ducks and steam particles --- src/openrct2/rct1.h | 9 +++- src/openrct2/rct1/S4Importer.cpp | 84 +++++++++++++++++++++++++++++++- 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/src/openrct2/rct1.h b/src/openrct2/rct1.h index 4d8b906463..f2875119ff 100644 --- a/src/openrct2/rct1.h +++ b/src/openrct2/rct1.h @@ -405,7 +405,14 @@ typedef union rct1_sprite { uint8 pad_00[0x100]; rct1_unk_sprite unknown; rct1_peep peep; - rct_litter litter; + 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; } rct1_sprite; assert_struct_size(rct1_sprite, 0x100); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 39d93f42fc..d099aecd9e 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -799,6 +799,7 @@ private: { ImportPeeps(); ImportLitter(); + ImportMiscSprites(); } void ImportPeeps() @@ -863,9 +864,19 @@ private: dst->tshirt_colour = RCT1::GetColour(src->tshirt_colour); dst->trousers_colour = RCT1::GetColour(src->trousers_colour); - dst->balloon_colour = RCT1::GetColour(src->balloon_colour); dst->umbrella_colour = RCT1::GetColour(src->umbrella_colour); dst->hat_colour = RCT1::GetColour(src->hat_colour); + // Balloons were always blue in RCT1 without AA/LL + if (_gameVersion == FILE_VERSION_RCT1) + { + dst->balloon_colour = COLOUR_LIGHT_BLUE; + } + else + { + dst->balloon_colour = RCT1::GetColour(src->balloon_colour); + } + + dst->destination_x = src->destination_x; dst->destination_y = src->destination_y; dst->destination_tolerence = src->destination_tolerence; @@ -1008,6 +1019,77 @@ private: } } + void ImportMiscSprites() + { + for (int i = 0; i < RCT1_MAX_SPRITES; i++) + { + if (_s4.sprites[i].unknown.sprite_identifier == SPRITE_IDENTIFIER_MISC) + { + rct1_unk_sprite * src = &_s4.sprites[i].unknown; + rct_unk_sprite * dst = (rct_unk_sprite *) create_sprite(SPRITE_IDENTIFIER_MISC); + move_sprite_to_list((rct_sprite *) dst, SPRITE_LIST_MISC * 2); + + dst->sprite_identifier = src->sprite_identifier; + dst->misc_identifier = src->misc_identifier; + dst->x = src->x; + dst->y = src->y; + dst->z = src->z; + dst->sprite_direction = src->sprite_direction; + + switch (src->misc_identifier) { + case SPRITE_MISC_STEAM_PARTICLE: + ImportSteamParticle((rct_steam_particle *) dst, (rct_steam_particle *) src); + break; + case SPRITE_MISC_MONEY_EFFECT: + break; + case SPRITE_MISC_CRASHED_VEHICLE_PARTICLE: + break; + case SPRITE_MISC_EXPLOSION_CLOUD: + break; + case SPRITE_MISC_CRASH_SPLASH: + break; + case SPRITE_MISC_EXPLOSION_FLARE: + break; + case SPRITE_MISC_JUMPING_FOUNTAIN_WATER: + break; + case SPRITE_MISC_BALLOON: + ImportBalloon((rct_balloon*)dst, (rct_balloon*)src); + break; + case SPRITE_MISC_DUCK: + ImportDuck((rct_duck*)dst, (rct_duck*)src); + break; + } + + sprite_move(src->x, src->y, src->z, (rct_sprite *) dst); + invalidate_sprite_2((rct_sprite *) dst); + } + } + } + + void ImportSteamParticle(rct_steam_particle * dst, rct_steam_particle * src) + { + dst->frame = src->frame; + } + + void ImportBalloon(rct_balloon * dst, rct_balloon * src) + { + // Balloons were always blue in RCT1 without AA/LL + if (_gameVersion == FILE_VERSION_RCT1) + { + dst->colour = COLOUR_LIGHT_BLUE; + } + else + { + dst->colour = RCT1::GetColour(src->colour); + } + } + + void ImportDuck(rct_duck * dst, rct_duck * src) + { + dst->frame = src->frame; + dst->state = src->state; + } + void ImportPeepSpawns() { for (int i = 0; i < 2; i++)