From 0160cdc51d020d590b7275178872ec93564dc857 Mon Sep 17 00:00:00 2001 From: numzero Date: Tue, 14 Mar 2023 18:25:05 +0300 Subject: [PATCH] Drop unused dependency of SceneManager on GUIEnvironment --- include/ISceneManager.h | 5 ----- source/Irrlicht/CIrrDeviceStub.cpp | 2 +- source/Irrlicht/CIrrDeviceStub.h | 3 +-- source/Irrlicht/CSceneManager.cpp | 24 +++++------------------- source/Irrlicht/CSceneManager.h | 9 +-------- 5 files changed, 8 insertions(+), 35 deletions(-) diff --git a/include/ISceneManager.h b/include/ISceneManager.h index 660d0aa..60d2d49 100644 --- a/include/ISceneManager.h +++ b/include/ISceneManager.h @@ -345,11 +345,6 @@ namespace scene This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ virtual video::IVideoDriver* getVideoDriver() = 0; - //! Get the active GUIEnvironment - /** \return Pointer to the GUIEnvironment - This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual gui::IGUIEnvironment* getGUIEnvironment() = 0; - //! Get the active FileSystem /** \return Pointer to the FileSystem This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ diff --git a/source/Irrlicht/CIrrDeviceStub.cpp b/source/Irrlicht/CIrrDeviceStub.cpp index 92cda75..6990673 100644 --- a/source/Irrlicht/CIrrDeviceStub.cpp +++ b/source/Irrlicht/CIrrDeviceStub.cpp @@ -92,7 +92,7 @@ void CIrrDeviceStub::createGUIAndScene() GUIEnvironment = gui::createGUIEnvironment(FileSystem, VideoDriver, Operator); // create Scene manager - SceneManager = scene::createSceneManager(VideoDriver, FileSystem, CursorControl, GUIEnvironment); + SceneManager = scene::createSceneManager(VideoDriver, FileSystem, CursorControl); setEventReceiver(UserReceiver); } diff --git a/source/Irrlicht/CIrrDeviceStub.h b/source/Irrlicht/CIrrDeviceStub.h index 5b7d92f..fd069b1 100644 --- a/source/Irrlicht/CIrrDeviceStub.h +++ b/source/Irrlicht/CIrrDeviceStub.h @@ -24,8 +24,7 @@ namespace irr namespace scene { - ISceneManager* createSceneManager(video::IVideoDriver* driver, - io::IFileSystem* fs, gui::ICursorControl* cc, gui::IGUIEnvironment *gui); + ISceneManager* createSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, gui::ICursorControl* cc); } namespace io diff --git a/source/Irrlicht/CSceneManager.cpp b/source/Irrlicht/CSceneManager.cpp index 440a44d..568c754 100644 --- a/source/Irrlicht/CSceneManager.cpp +++ b/source/Irrlicht/CSceneManager.cpp @@ -34,9 +34,8 @@ namespace scene //! constructor CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, - gui::ICursorControl* cursorControl, IMeshCache* cache, - gui::IGUIEnvironment* gui) -: ISceneNode(0, 0), Driver(driver), FileSystem(fs), GUIEnvironment(gui), + gui::ICursorControl* cursorControl, IMeshCache* cache) +: ISceneNode(0, 0), Driver(driver), FileSystem(fs), CursorControl(cursorControl), ActiveCamera(0), ShadowColor(150,0,0,0), AmbientLight(0,0,0,0), Parameters(0), MeshCache(cache), CurrentRenderPass(ESNRP_NONE) @@ -58,9 +57,6 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, if (CursorControl) CursorControl->grab(); - if (GUIEnvironment) - GUIEnvironment->grab(); - // create mesh cache if not there already if (!MeshCache) MeshCache = new CMeshCache(); @@ -105,9 +101,6 @@ CSceneManager::~CSceneManager() if (CollisionManager) CollisionManager->drop(); - if (GUIEnvironment) - GUIEnvironment->drop(); - u32 i; for (i=0; idrop(); @@ -209,12 +202,6 @@ video::IVideoDriver* CSceneManager::getVideoDriver() } -//! returns the GUI Environment -gui::IGUIEnvironment* CSceneManager::getGUIEnvironment() -{ - return GUIEnvironment; -} - //! Get the active FileSystem /** \return Pointer to the FileSystem This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ @@ -888,7 +875,7 @@ IMeshCache* CSceneManager::getMeshCache() //! Creates a new scene manager. ISceneManager* CSceneManager::createNewSceneManager(bool cloneContent) { - CSceneManager* manager = new CSceneManager(Driver, FileSystem, CursorControl, MeshCache, GUIEnvironment); + CSceneManager* manager = new CSceneManager(Driver, FileSystem, CursorControl, MeshCache); if (cloneContent) manager->cloneMembers(this, manager); @@ -926,10 +913,9 @@ IMeshWriter* CSceneManager::createMeshWriter(EMESH_WRITER_TYPE type) // creates a scenemanager ISceneManager* createSceneManager(video::IVideoDriver* driver, - io::IFileSystem* fs, gui::ICursorControl* cursorcontrol, - gui::IGUIEnvironment *guiEnvironment) + io::IFileSystem* fs, gui::ICursorControl* cursorcontrol) { - return new CSceneManager(driver, fs, cursorcontrol, 0, guiEnvironment ); + return new CSceneManager(driver, fs, cursorcontrol, nullptr); } diff --git a/source/Irrlicht/CSceneManager.h b/source/Irrlicht/CSceneManager.h index caf9dbe..1a74995 100644 --- a/source/Irrlicht/CSceneManager.h +++ b/source/Irrlicht/CSceneManager.h @@ -32,8 +32,7 @@ namespace scene //! constructor CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, - gui::ICursorControl* cursorControl, IMeshCache* cache = 0, - gui::IGUIEnvironment *guiEnvironment = 0); + gui::ICursorControl* cursorControl, IMeshCache* cache = nullptr); //! destructor virtual ~CSceneManager(); @@ -50,9 +49,6 @@ namespace scene //! returns the video driver video::IVideoDriver* getVideoDriver() override; - //! return the gui environment - gui::IGUIEnvironment* getGUIEnvironment() override; - //! return the filesystem io::IFileSystem* getFileSystem() override; @@ -285,9 +281,6 @@ namespace scene //! file system io::IFileSystem* FileSystem; - //! GUI Enviroment ( Debug Purpose ) - gui::IGUIEnvironment* GUIEnvironment; - //! cursor control gui::ICursorControl* CursorControl; -- 2.44.0