mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 22:34:33 +01:00
Move painting for explosion flare entity
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "../audio/audio.h"
|
||||
#include "../core/DataSerialiser.h"
|
||||
#include "../paint/Paint.h"
|
||||
#include "../paint/sprite/Paint.Sprite.h"
|
||||
#include "../scenario/Scenario.h"
|
||||
#include "EntityRegistry.h"
|
||||
@@ -321,6 +322,9 @@ void ExplosionFlare::Serialise(DataSerialiser& stream)
|
||||
stream << frame;
|
||||
}
|
||||
|
||||
void ExplosionFlare::Paint() const
|
||||
void ExplosionFlare::Paint(paint_session* session, int32_t imageDirection) const
|
||||
{
|
||||
// TODO: Create constant in sprites.h
|
||||
uint32_t imageId = 22896 + (frame / 256);
|
||||
PaintAddImageAsParent(session, imageId, { 0, 0, z }, { 1, 1, 0 });
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
class DataSerialiser;
|
||||
struct CoordsXYZ;
|
||||
struct paint_session;
|
||||
|
||||
struct VehicleCrashParticle : EntityBase
|
||||
{
|
||||
@@ -51,7 +52,7 @@ struct ExplosionFlare : EntityBase
|
||||
static void Create(const CoordsXYZ& flarePos);
|
||||
void Update();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
void Paint() const;
|
||||
void Paint(paint_session* session, int32_t imageDirection) const;
|
||||
};
|
||||
|
||||
struct ExplosionCloud : EntityBase
|
||||
|
||||
@@ -81,12 +81,3 @@ template<> void PaintEntity(paint_session* session, const CrashSplashParticle* c
|
||||
uint32_t imageId = 22927 + (crashSplash->frame / 256);
|
||||
PaintAddImageAsParent(session, imageId, { 0, 0, crashSplash->z }, { 1, 1, 0 });
|
||||
}
|
||||
|
||||
template<> void PaintEntity(paint_session* session, const ExplosionFlare* flare, int32_t imageDirection)
|
||||
{
|
||||
// Like a flare
|
||||
if (flare == nullptr)
|
||||
return;
|
||||
uint32_t imageId = 22896 + (flare->frame / 256);
|
||||
PaintAddImageAsParent(session, imageId, { 0, 0, flare->z }, { 1, 1, 0 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user