1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 21:13:05 +01:00

Make sprite_misc_explosion_cloud_create use CoordsXYZ

This commit is contained in:
Tulio Leao
2020-06-21 13:58:13 -03:00
parent ae1e9b75ed
commit 2e31a7d64d
4 changed files with 9 additions and 9 deletions

View File

@@ -714,7 +714,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
{
audio_play_sound_at_location(SoundId::Crash, { x, y, z });
sprite_misc_explosion_cloud_create(x, y, z + 16);
sprite_misc_explosion_cloud_create({ x, y, z + 16 });
sprite_misc_explosion_flare_create(x, y, z + 16);
Remove();

View File

@@ -3570,7 +3570,7 @@ void Vehicle::UpdateCollisionSetup()
audio_play_sound_at_location(SoundId::Crash, { train->x, train->y, train->z });
sprite_misc_explosion_cloud_create(train->x, train->y, train->z);
sprite_misc_explosion_cloud_create({ train->x, train->y, train->z });
for (int32_t i = 0; i < 10; i++)
{
@@ -5294,7 +5294,7 @@ void Vehicle::CrashOnLand()
sub_state = 2;
audio_play_sound_at_location(SoundId::Crash, { x, y, z });
sprite_misc_explosion_cloud_create(x, y, z);
sprite_misc_explosion_cloud_create({ x, y, z });
sprite_misc_explosion_flare_create(x, y, z);
uint8_t numParticles = std::min(sprite_width, static_cast<uint8_t>(7));
@@ -5397,9 +5397,9 @@ void Vehicle::UpdateCrash()
curVehicle->crash_z++;
if ((scenario_rand() & 0xFFFF) <= 0x1555)
{
auto xOffset = (scenario_rand() & 2) - 1;
auto yOffset = (scenario_rand() & 2) - 1;
sprite_misc_explosion_cloud_create(curVehicle->x + xOffset, curVehicle->y + yOffset, curVehicle->z);
int32_t xOffset = (scenario_rand() & 2) - 1;
int32_t yOffset = (scenario_rand() & 2) - 1;
sprite_misc_explosion_cloud_create({ curVehicle->x + xOffset, curVehicle->y + yOffset, curVehicle->z });
}
}
if (curVehicle->var_C8 + 7281 > 0xFFFF)

View File

@@ -521,7 +521,7 @@ static void sprite_steam_particle_update(SteamParticle* steam)
*
* rct2: 0x0067363D
*/
void sprite_misc_explosion_cloud_create(int32_t x, int32_t y, int32_t z)
void sprite_misc_explosion_cloud_create(const CoordsXYZ& cloudPos)
{
SpriteGeneric* sprite = &create_sprite(SPRITE_IDENTIFIER_MISC)->generic;
if (sprite != nullptr)
@@ -530,7 +530,7 @@ void sprite_misc_explosion_cloud_create(int32_t x, int32_t y, int32_t z)
sprite->sprite_height_negative = 32;
sprite->sprite_height_positive = 34;
sprite->sprite_identifier = SPRITE_IDENTIFIER_MISC;
sprite->MoveTo({ x, y, z + 4 });
sprite->MoveTo(cloudPos + CoordsXYZ{ 0, 0, 4 });
sprite->type = SPRITE_MISC_EXPLOSION_CLOUD;
sprite->frame = 0;
}

View File

@@ -222,7 +222,7 @@ void sprite_remove(SpriteBase* sprite);
void litter_create(int32_t x, int32_t y, int32_t z, int32_t direction, int32_t type);
void litter_remove_at(int32_t x, int32_t y, int32_t z);
uint16_t remove_floating_sprites();
void sprite_misc_explosion_cloud_create(int32_t x, int32_t y, int32_t z);
void sprite_misc_explosion_cloud_create(const CoordsXYZ& cloudPos);
void sprite_misc_explosion_flare_create(int32_t x, int32_t y, int32_t z);
uint16_t sprite_get_first_in_quadrant(int32_t x, int32_t y);
void sprite_position_tween_store_a();