1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 08:14:38 +01:00

Part of #16033: create constants for crash particles

This commit is contained in:
kysrit
2025-05-12 17:09:50 -04:00
committed by GitHub
parent f949e17f09
commit 3529c0be3a
2 changed files with 18 additions and 9 deletions

View File

@@ -694,6 +694,17 @@ enum : ImageIndex
SPR_RIDE_DESIGN_PREVIEW_MAZE_ICE_BLOCKS = 21992,
SPR_RIDE_DESIGN_PREVIEW_MAZE_WOODEN_FENCES = 21993,
SPR_VEHICLE_CRASH_PARTICLE_1 = 22577,
SPR_VEHICLE_CRASH_PARTICLE_2 = 22589,
SPR_VEHICLE_CRASH_PARTICLE_3 = 22601,
SPR_VEHICLE_CRASH_PARTICLE_4 = 22613,
SPR_VEHICLE_CRASH_PARTICLE_5 = 22625,
SPR_STEAM_PARTICLE = 22637,
SPR_EXPLOSION_CLOUD = 22878,
SPR_EXPLOSION_FLARE = 22896,
SPR_CRASH_SPLASH_PARTICLE = 22927,
SPR_LAND_OWNERSHIP_AVAILABLE = 22955,
SPR_LAND_CONSTRUCTION_RIGHTS_AVAILABLE = 22956,

View File

@@ -8,6 +8,7 @@
*****************************************************************************/
#include "Particle.h"
#include "../SpriteIds.h"
#include "../audio/Audio.h"
#include "../core/DataSerialiser.h"
#include "../paint/Paint.h"
@@ -19,9 +20,9 @@
#include <iterator>
// TODO: Create constants in SpriteIds.h
static constexpr uint32_t kVehicleCrashParticleSprites[kCrashedVehicleParticleNumberTypes] = {
22577, 22589, 22601, 22613, 22625,
SPR_VEHICLE_CRASH_PARTICLE_1, SPR_VEHICLE_CRASH_PARTICLE_2, SPR_VEHICLE_CRASH_PARTICLE_3,
SPR_VEHICLE_CRASH_PARTICLE_4, SPR_VEHICLE_CRASH_PARTICLE_5,
};
template<>
@@ -223,8 +224,7 @@ void CrashSplashParticle::Paint(PaintSession& session, int32_t imageDirection) c
{
PROFILED_FUNCTION();
// TODO: Create constant in SpriteIds.h
uint32_t imageId = 22927 + (frame / 256);
uint32_t imageId = SPR_CRASH_SPLASH_PARTICLE + (frame / 256);
PaintAddImageAsParent(session, ImageId(imageId), { 0, 0, z }, { 1, 1, 0 });
}
@@ -282,8 +282,7 @@ void SteamParticle::Paint(PaintSession& session, int32_t imageDirection) const
{
PROFILED_FUNCTION();
// TODO: Create constant in SpriteIds.h
uint32_t imageId = 22637 + (frame / 256);
uint32_t imageId = SPR_STEAM_PARTICLE + (frame / 256);
PaintAddImageAsParent(session, ImageId(imageId), { 0, 0, z }, { 1, 1, 0 });
}
@@ -328,7 +327,7 @@ void ExplosionCloud::Paint(PaintSession& session, int32_t imageDirection) const
{
PROFILED_FUNCTION();
uint32_t imageId = 22878 + (frame / 256);
uint32_t imageId = SPR_EXPLOSION_CLOUD + (frame / 256);
PaintAddImageAsParent(session, ImageId(imageId), { 0, 0, z }, { 1, 1, 0 });
}
@@ -373,7 +372,6 @@ void ExplosionFlare::Paint(PaintSession& session, int32_t imageDirection) const
{
PROFILED_FUNCTION();
// TODO: Create constant in SpriteIds.h
uint32_t imageId = 22896 + (frame / 256);
uint32_t imageId = SPR_EXPLOSION_FLARE + (frame / 256);
PaintAddImageAsParent(session, ImageId(imageId), { 0, 0, z }, { 1, 1, 0 });
}