diff --git a/src/openrct2/entity/Duck.cpp b/src/openrct2/entity/Duck.cpp index 3677a45c34..cd0ed2b47c 100644 --- a/src/openrct2/entity/Duck.cpp +++ b/src/openrct2/entity/Duck.cpp @@ -12,6 +12,7 @@ #include "../audio/audio.h" #include "../core/DataSerialiser.h" #include "../localisation/Date.h" +#include "../paint/Paint.h" #include "../scenario/Scenario.h" #include "../sprites.h" #include "../world/Surface.h" @@ -363,6 +364,15 @@ void Duck::Serialise(DataSerialiser& stream) stream << state; } -void Duck::Paint() const +void Duck::Paint(paint_session* session, int32_t imageDirection) const { + rct_drawpixelinfo& dpi = session->DPI; + if (dpi.zoom_level > 1) + return; + + uint32_t imageId = GetFrameImage(imageDirection); + if (imageId != 0) + { + PaintAddImageAsParent(session, imageId, { 0, 0, z }, { 1, 1, 0 }); + } } diff --git a/src/openrct2/entity/Duck.h b/src/openrct2/entity/Duck.h index 263df19779..78c831724c 100644 --- a/src/openrct2/entity/Duck.h +++ b/src/openrct2/entity/Duck.h @@ -13,6 +13,7 @@ class DataSerialiser; struct CoordsXY; +struct paint_session; struct Duck : EntityBase { @@ -38,7 +39,7 @@ struct Duck : EntityBase bool IsFlying(); void Remove(); void Serialise(DataSerialiser& stream); - void Paint() const; + void Paint(paint_session* session, int32_t imageDirection) const; private: void UpdateFlyToWater(); diff --git a/src/openrct2/paint/sprite/Paint.Misc.cpp b/src/openrct2/paint/sprite/Paint.Misc.cpp index 98519cbd37..cbdc03b46b 100644 --- a/src/openrct2/paint/sprite/Paint.Misc.cpp +++ b/src/openrct2/paint/sprite/Paint.Misc.cpp @@ -149,18 +149,3 @@ template<> void PaintEntity(paint_session* session, const Balloon* balloon, int3 imageId = imageId | (balloon->colour << 19) | IMAGE_TYPE_REMAP; PaintAddImageAsParent(session, imageId, { 0, 0, balloon->z }, { 1, 1, 0 }); } - -template<> void PaintEntity(paint_session* session, const Duck* duck, int32_t imageDirection) -{ - rct_drawpixelinfo* dpi = &session->DPI; - if (dpi->zoom_level <= 1) - { - if (duck == nullptr) - return; - uint32_t imageId = duck->GetFrameImage(imageDirection); - if (imageId != 0) - { - PaintAddImageAsParent(session, imageId, { 0, 0, duck->z }, { 1, 1, 0 }); - } - } -}