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. */
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. */

@ -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);
}

@ -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

@ -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; i<MeshLoaderList.size(); ++i)
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
/** \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);
}

@ -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;