mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 07:14:31 +01:00
Move painting for VehicleCrashParticle entity
This commit is contained in:
@@ -145,8 +145,22 @@ void VehicleCrashParticle::Serialise(DataSerialiser& stream)
|
||||
stream << acceleration_z;
|
||||
}
|
||||
|
||||
void VehicleCrashParticle::Paint() const
|
||||
void VehicleCrashParticle::Paint(paint_session* session, int32_t imageDirection) const
|
||||
{
|
||||
rct_drawpixelinfo& dpi = session->DPI;
|
||||
if (dpi.zoom_level > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Create constants in sprites.h
|
||||
static constexpr uint32_t vehicle_particle_base_sprites[] = {
|
||||
22577, 22589, 22601, 22613, 22625,
|
||||
};
|
||||
|
||||
uint32_t imageId = vehicle_particle_base_sprites[crashed_sprite_base] + frame / 256;
|
||||
imageId = imageId | (colour[0] << 19) | (colour[1] << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS;
|
||||
PaintAddImageAsParent(session, imageId, { 0, 0, z }, { 1, 1, 0 });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@ struct VehicleCrashParticle : EntityBase
|
||||
static void Create(rct_vehicle_colour colours, const CoordsXYZ& vehiclePos);
|
||||
void Update();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
void Paint() const;
|
||||
void Paint(paint_session* session, int32_t imageDirection) const;
|
||||
};
|
||||
|
||||
struct CrashSplashParticle : EntityBase
|
||||
|
||||
@@ -24,11 +24,6 @@ static constexpr const int8_t money_wave[] = {
|
||||
0, 1, 2, 2, 3, 3, 3, 3, 2, 2, 1, 0, -1, -2, -2, -3, -3, -3, -3, -2, -2, -1,
|
||||
};
|
||||
|
||||
/** rct2: 0x0097ED90 */
|
||||
const uint32_t vehicle_particle_base_sprites[] = {
|
||||
22577, 22589, 22601, 22613, 22625,
|
||||
};
|
||||
|
||||
template<> void PaintEntity(paint_session* session, const SteamParticle* particle, int32_t imageDirection)
|
||||
{
|
||||
uint32_t imageId = 22637 + (particle->frame / 256);
|
||||
@@ -50,18 +45,3 @@ template<> void PaintEntity(paint_session* session, const MoneyEffect* moneyEffe
|
||||
session, value, stringId, moneyEffect->y, moneyEffect->z, const_cast<int8_t*>(&money_wave[moneyEffect->Wiggle % 22]),
|
||||
moneyEffect->OffsetX, session->CurrentRotation);
|
||||
}
|
||||
|
||||
template<> void PaintEntity(paint_session* session, const VehicleCrashParticle* particle, int32_t imageDirection)
|
||||
{
|
||||
rct_drawpixelinfo* dpi = &session->DPI;
|
||||
if (dpi->zoom_level > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (particle == nullptr)
|
||||
return;
|
||||
uint32_t imageId = vehicle_particle_base_sprites[particle->crashed_sprite_base] + particle->frame / 256;
|
||||
imageId = imageId | (particle->colour[0] << 19) | (particle->colour[1] << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS;
|
||||
PaintAddImageAsParent(session, imageId, { 0, 0, particle->z }, { 1, 1, 0 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user