Make crash_splash_create use CoordsXYZ

This commit is contained in:
Tulio Leao 2020-06-21 13:41:11 -03:00
parent 030686dc6b
commit 15bad3898d
3 changed files with 9 additions and 9 deletions

View File

@ -5357,11 +5357,11 @@ void Vehicle::CrashOnWater()
sub_state = 2;
audio_play_sound_at_location(SoundId::Water1, { x, y, z });
crash_splash_create(x, y, z);
crash_splash_create(x - 8, y - 9, z);
crash_splash_create(x + 11, y - 9, z);
crash_splash_create(x + 11, y + 8, z);
crash_splash_create(x - 4, y + 8, z);
crash_splash_create({ x, y, z });
crash_splash_create({ x - 8, y - 9, z });
crash_splash_create({ x + 11, y - 9, z });
crash_splash_create({ x + 11, y + 8, z });
crash_splash_create({ x - 4, y + 8, z });
for (int32_t i = 0; i < 10; ++i)
crashed_vehicle_particle_create(colours, { x - 4, y + 8, z });

View File

@ -96,7 +96,7 @@ void crashed_vehicle_particle_update(VehicleCrashParticle* particle)
{
// Splash
audio_play_sound_at_location(SoundId::Water2, { particle->x, particle->y, waterZ });
crash_splash_create(particle->x, particle->y, waterZ);
crash_splash_create({ particle->x, particle->y, waterZ });
sprite_remove(particle);
return;
}
@ -121,7 +121,7 @@ void crashed_vehicle_particle_update(VehicleCrashParticle* particle)
*
* rct2: 0x00673699
*/
void crash_splash_create(int32_t x, int32_t y, int32_t z)
void crash_splash_create(const CoordsXYZ& splashPos)
{
SpriteGeneric* sprite = &create_sprite(SPRITE_IDENTIFIER_MISC)->generic;
if (sprite != nullptr)
@ -130,7 +130,7 @@ void crash_splash_create(int32_t x, int32_t y, int32_t z)
sprite->sprite_height_negative = 51;
sprite->sprite_height_positive = 16;
sprite->sprite_identifier = SPRITE_IDENTIFIER_MISC;
sprite->MoveTo({ x, y, z + 3 });
sprite->MoveTo(splashPos + CoordsXYZ{ 0, 0, 3 });
sprite->type = SPRITE_MISC_CRASH_SPLASH;
sprite->frame = 0;
}

View File

@ -251,7 +251,7 @@ uint32_t duck_get_frame_image(const Duck* duck, int32_t direction);
///////////////////////////////////////////////////////////////
void crashed_vehicle_particle_create(rct_vehicle_colour colours, const CoordsXYZ& vehiclePos);
void crashed_vehicle_particle_update(VehicleCrashParticle* particle);
void crash_splash_create(int32_t x, int32_t y, int32_t z);
void crash_splash_create(const CoordsXYZ& splashPos);
void crash_splash_update(CrashSplashParticle* splash);
rct_sprite_checksum sprite_checksum();