mirror of https://github.com/OpenRCT2/OpenRCT2.git
Move painting for Balloon entity
This commit is contained in:
parent
eaff0a343d
commit
30349f80f5
|
@ -13,6 +13,7 @@
|
|||
#include "../audio/audio.h"
|
||||
#include "../core/DataSerialiser.h"
|
||||
#include "../network/network.h"
|
||||
#include "../paint/Paint.h"
|
||||
#include "../scenario/Scenario.h"
|
||||
#include "../util/Util.h"
|
||||
#include "EntityRegistry.h"
|
||||
|
@ -107,6 +108,14 @@ void Balloon::Serialise(DataSerialiser& stream)
|
|||
stream << colour;
|
||||
}
|
||||
|
||||
void Balloon::Paint() const
|
||||
void Balloon::Paint(paint_session* session, int32_t imageDirection) const
|
||||
{
|
||||
uint32_t imageId = 22651 + (frame & 7);
|
||||
if (popped != 0)
|
||||
{
|
||||
imageId += 8;
|
||||
}
|
||||
|
||||
imageId = imageId | (colour << 19) | IMAGE_TYPE_REMAP;
|
||||
PaintAddImageAsParent(session, imageId, { 0, 0, z }, { 1, 1, 0 });
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
class DataSerialiser;
|
||||
struct CoordsXYZ;
|
||||
struct paint_session;
|
||||
|
||||
struct Balloon : EntityBase
|
||||
{
|
||||
|
@ -26,5 +27,5 @@ struct Balloon : EntityBase
|
|||
void Pop();
|
||||
void Press();
|
||||
void Serialise(DataSerialiser& stream);
|
||||
void Paint() const;
|
||||
void Paint(paint_session* session, int32_t imageDirection) const;
|
||||
};
|
||||
|
|
|
@ -135,17 +135,3 @@ template<> void PaintEntity(paint_session* session, const JumpingFountain* jumpi
|
|||
|
||||
PaintAddImageAsParentRotated(session, ebx, imageId, 0, 0, 32, 1, 3, height, bb[ebx & 1].x, bb[ebx & 1].y, height);
|
||||
}
|
||||
|
||||
template<> void PaintEntity(paint_session* session, const Balloon* balloon, int32_t imageDirection)
|
||||
{
|
||||
if (balloon == nullptr)
|
||||
return;
|
||||
uint32_t imageId = 22651 + (balloon->frame & 7);
|
||||
if (balloon->popped != 0)
|
||||
{
|
||||
imageId += 8;
|
||||
}
|
||||
|
||||
imageId = imageId | (balloon->colour << 19) | IMAGE_TYPE_REMAP;
|
||||
PaintAddImageAsParent(session, imageId, { 0, 0, balloon->z }, { 1, 1, 0 });
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue