From 809e68fdc0f7855730ee3409e6f1ddfe975b671f Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Thu, 29 Apr 2021 09:07:36 +0200 Subject: refacto: don't use RenderingEngine singleton on CAO * we don't need on CAO side more than SceneManager, and temporary. Pass only required SceneManager as a parameter to build CAO and add them to the current scene * Use temporary the RenderingEngine singleton from ClientEnvironment, waitfor for better solution * Make ClientActiveObject::addToScene virtual function mandatory to be defined by children to ensure we don't forget to properly define it --- src/client/clientobject.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/client/clientobject.h') diff --git a/src/client/clientobject.h b/src/client/clientobject.h index ecd8059ef..dbc2f22cf 100644 --- a/src/client/clientobject.h +++ b/src/client/clientobject.h @@ -33,13 +33,17 @@ class LocalPlayer; struct ItemStack; class WieldMeshSceneNode; +namespace irr { namespace scene { + class ISceneManager; +}} + class ClientActiveObject : public ActiveObject { public: ClientActiveObject(u16 id, Client *client, ClientEnvironment *env); virtual ~ClientActiveObject(); - virtual void addToScene(ITextureSource *tsrc) {} + virtual void addToScene(ITextureSource *tsrc, irr::scene::ISceneManager *smgr) = 0; virtual void removeFromScene(bool permanent) {} virtual void updateLight(u32 day_night_ratio) {} -- cgit v1.2.3