Drop unused dependency of SceneManager on GUIEnvironment

This commit is contained in:
numzero 2023-03-14 18:25:05 +03:00 committed by sfan5
parent 5a1565072a
commit 0160cdc51d
5 changed files with 8 additions and 35 deletions

@ -345,11 +345,6 @@ namespace scene
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual video::IVideoDriver* getVideoDriver() = 0; 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 //! Get the active FileSystem
/** \return Pointer to the FileSystem /** \return Pointer to the FileSystem
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */

@ -92,7 +92,7 @@ void CIrrDeviceStub::createGUIAndScene()
GUIEnvironment = gui::createGUIEnvironment(FileSystem, VideoDriver, Operator); GUIEnvironment = gui::createGUIEnvironment(FileSystem, VideoDriver, Operator);
// create Scene manager // create Scene manager
SceneManager = scene::createSceneManager(VideoDriver, FileSystem, CursorControl, GUIEnvironment); SceneManager = scene::createSceneManager(VideoDriver, FileSystem, CursorControl);
setEventReceiver(UserReceiver); setEventReceiver(UserReceiver);
} }

@ -24,8 +24,7 @@ namespace irr
namespace scene namespace scene
{ {
ISceneManager* createSceneManager(video::IVideoDriver* driver, ISceneManager* createSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, gui::ICursorControl* cc);
io::IFileSystem* fs, gui::ICursorControl* cc, gui::IGUIEnvironment *gui);
} }
namespace io namespace io

@ -34,9 +34,8 @@ namespace scene
//! constructor //! constructor
CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
gui::ICursorControl* cursorControl, IMeshCache* cache, gui::ICursorControl* cursorControl, IMeshCache* cache)
gui::IGUIEnvironment* gui) : ISceneNode(0, 0), Driver(driver), FileSystem(fs),
: ISceneNode(0, 0), Driver(driver), FileSystem(fs), GUIEnvironment(gui),
CursorControl(cursorControl), CursorControl(cursorControl),
ActiveCamera(0), ShadowColor(150,0,0,0), AmbientLight(0,0,0,0), Parameters(0), ActiveCamera(0), ShadowColor(150,0,0,0), AmbientLight(0,0,0,0), Parameters(0),
MeshCache(cache), CurrentRenderPass(ESNRP_NONE) MeshCache(cache), CurrentRenderPass(ESNRP_NONE)
@ -58,9 +57,6 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
if (CursorControl) if (CursorControl)
CursorControl->grab(); CursorControl->grab();
if (GUIEnvironment)
GUIEnvironment->grab();
// create mesh cache if not there already // create mesh cache if not there already
if (!MeshCache) if (!MeshCache)
MeshCache = new CMeshCache(); MeshCache = new CMeshCache();
@ -105,9 +101,6 @@ CSceneManager::~CSceneManager()
if (CollisionManager) if (CollisionManager)
CollisionManager->drop(); CollisionManager->drop();
if (GUIEnvironment)
GUIEnvironment->drop();
u32 i; u32 i;
for (i=0; i<MeshLoaderList.size(); ++i) for (i=0; i<MeshLoaderList.size(); ++i)
MeshLoaderList[i]->drop(); MeshLoaderList[i]->drop();
@ -209,12 +202,6 @@ video::IVideoDriver* CSceneManager::getVideoDriver()
} }
//! returns the GUI Environment
gui::IGUIEnvironment* CSceneManager::getGUIEnvironment()
{
return GUIEnvironment;
}
//! Get the active FileSystem //! Get the active FileSystem
/** \return Pointer to the FileSystem /** \return Pointer to the FileSystem
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
@ -888,7 +875,7 @@ IMeshCache* CSceneManager::getMeshCache()
//! Creates a new scene manager. //! Creates a new scene manager.
ISceneManager* CSceneManager::createNewSceneManager(bool cloneContent) ISceneManager* CSceneManager::createNewSceneManager(bool cloneContent)
{ {
CSceneManager* manager = new CSceneManager(Driver, FileSystem, CursorControl, MeshCache, GUIEnvironment); CSceneManager* manager = new CSceneManager(Driver, FileSystem, CursorControl, MeshCache);
if (cloneContent) if (cloneContent)
manager->cloneMembers(this, manager); manager->cloneMembers(this, manager);
@ -926,10 +913,9 @@ IMeshWriter* CSceneManager::createMeshWriter(EMESH_WRITER_TYPE type)
// creates a scenemanager // creates a scenemanager
ISceneManager* createSceneManager(video::IVideoDriver* driver, ISceneManager* createSceneManager(video::IVideoDriver* driver,
io::IFileSystem* fs, gui::ICursorControl* cursorcontrol, io::IFileSystem* fs, gui::ICursorControl* cursorcontrol)
gui::IGUIEnvironment *guiEnvironment)
{ {
return new CSceneManager(driver, fs, cursorcontrol, 0, guiEnvironment ); return new CSceneManager(driver, fs, cursorcontrol, nullptr);
} }

@ -32,8 +32,7 @@ namespace scene
//! constructor //! constructor
CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
gui::ICursorControl* cursorControl, IMeshCache* cache = 0, gui::ICursorControl* cursorControl, IMeshCache* cache = nullptr);
gui::IGUIEnvironment *guiEnvironment = 0);
//! destructor //! destructor
virtual ~CSceneManager(); virtual ~CSceneManager();
@ -50,9 +49,6 @@ namespace scene
//! returns the video driver //! returns the video driver
video::IVideoDriver* getVideoDriver() override; video::IVideoDriver* getVideoDriver() override;
//! return the gui environment
gui::IGUIEnvironment* getGUIEnvironment() override;
//! return the filesystem //! return the filesystem
io::IFileSystem* getFileSystem() override; io::IFileSystem* getFileSystem() override;
@ -285,9 +281,6 @@ namespace scene
//! file system //! file system
io::IFileSystem* FileSystem; io::IFileSystem* FileSystem;
//! GUI Enviroment ( Debug Purpose )
gui::IGUIEnvironment* GUIEnvironment;
//! cursor control //! cursor control
gui::ICursorControl* CursorControl; gui::ICursorControl* CursorControl;