diff options
author | numzero <numzer0@yandex.ru> | 2023-03-14 18:34:47 +0300 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-03-19 19:47:43 +0100 |
commit | 52a0b9d8e532569b0ac152636d28ab49f2688ce8 (patch) | |
tree | 8a50043e32590ea78e674f85c046e47bbe67ad43 /source | |
parent | 0160cdc51d020d590b7275178872ec93564dc857 (diff) | |
download | irrlicht-52a0b9d8e532569b0ac152636d28ab49f2688ce8.tar.xz |
Drop dependency on FileSystem from SceneManager
Diffstat (limited to 'source')
-rw-r--r-- | source/Irrlicht/CIrrDeviceStub.cpp | 2 | ||||
-rw-r--r-- | source/Irrlicht/CIrrDeviceStub.h | 2 | ||||
-rw-r--r-- | source/Irrlicht/CSceneManager.cpp | 49 | ||||
-rw-r--r-- | source/Irrlicht/CSceneManager.h | 12 |
4 files changed, 8 insertions, 57 deletions
diff --git a/source/Irrlicht/CIrrDeviceStub.cpp b/source/Irrlicht/CIrrDeviceStub.cpp index 6990673..3fde44a 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);
+ SceneManager = scene::createSceneManager(VideoDriver, CursorControl);
setEventReceiver(UserReceiver);
}
diff --git a/source/Irrlicht/CIrrDeviceStub.h b/source/Irrlicht/CIrrDeviceStub.h index fd069b1..10e5d72 100644 --- a/source/Irrlicht/CIrrDeviceStub.h +++ b/source/Irrlicht/CIrrDeviceStub.h @@ -24,7 +24,7 @@ namespace irr namespace scene
{
- ISceneManager* createSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, gui::ICursorControl* cc);
+ ISceneManager* createSceneManager(video::IVideoDriver* driver, gui::ICursorControl* cc);
}
namespace io
diff --git a/source/Irrlicht/CSceneManager.cpp b/source/Irrlicht/CSceneManager.cpp index 568c754..8a16dd2 100644 --- a/source/Irrlicht/CSceneManager.cpp +++ b/source/Irrlicht/CSceneManager.cpp @@ -33,9 +33,9 @@ namespace scene {
//! constructor
-CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
+CSceneManager::CSceneManager(video::IVideoDriver* driver,
gui::ICursorControl* cursorControl, IMeshCache* cache)
-: ISceneNode(0, 0), Driver(driver), FileSystem(fs),
+: ISceneNode(0, 0), Driver(driver),
CursorControl(cursorControl),
ActiveCamera(0), ShadowColor(150,0,0,0), AmbientLight(0,0,0,0), Parameters(0),
MeshCache(cache), CurrentRenderPass(ESNRP_NONE)
@@ -51,9 +51,6 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, if (Driver)
Driver->grab();
- if (FileSystem)
- FileSystem->grab();
-
if (CursorControl)
CursorControl->grab();
@@ -92,9 +89,6 @@ CSceneManager::~CSceneManager() if (Driver)
Driver->removeAllHardwareBuffers();
- if (FileSystem)
- FileSystem->drop();
-
if (CursorControl)
CursorControl->drop();
@@ -126,29 +120,6 @@ CSceneManager::~CSceneManager() //! gets an animateable mesh. loads it if needed. returned pointer must not be dropped.
-IAnimatedMesh* CSceneManager::getMesh(const io::path& filename, const io::path& alternativeCacheName)
-{
- io::path cacheName = alternativeCacheName.empty() ? filename : alternativeCacheName;
- IAnimatedMesh* msh = MeshCache->getMeshByName(cacheName);
- if (msh)
- return msh;
-
- io::IReadFile* file = FileSystem->createAndOpenFile(filename);
- if (!file)
- {
- os::Printer::log("Could not load mesh, because file could not be opened: ", filename, ELL_ERROR);
- return 0;
- }
-
- msh = getUncachedMesh(file, filename, cacheName);
-
- file->drop();
-
- return msh;
-}
-
-
-//! gets an animateable mesh. loads it if needed. returned pointer must not be dropped.
IAnimatedMesh* CSceneManager::getMesh(io::IReadFile* file)
{
if (!file)
@@ -202,15 +173,6 @@ video::IVideoDriver* CSceneManager::getVideoDriver() }
-//! Get the active FileSystem
-/** \return Pointer to the FileSystem
-This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
-io::IFileSystem* CSceneManager::getFileSystem()
-{
- return FileSystem;
-}
-
-
//! adds a scene node for rendering a static mesh
//! the returned pointer must not be dropped.
IMeshSceneNode* CSceneManager::addMeshSceneNode(IMesh* mesh, ISceneNode* parent, s32 id,
@@ -875,7 +837,7 @@ IMeshCache* CSceneManager::getMeshCache() //! Creates a new scene manager.
ISceneManager* CSceneManager::createNewSceneManager(bool cloneContent)
{
- CSceneManager* manager = new CSceneManager(Driver, FileSystem, CursorControl, MeshCache);
+ CSceneManager* manager = new CSceneManager(Driver, CursorControl, MeshCache);
if (cloneContent)
manager->cloneMembers(this, manager);
@@ -912,10 +874,9 @@ IMeshWriter* CSceneManager::createMeshWriter(EMESH_WRITER_TYPE type) // creates a scenemanager
-ISceneManager* createSceneManager(video::IVideoDriver* driver,
- io::IFileSystem* fs, gui::ICursorControl* cursorcontrol)
+ISceneManager* createSceneManager(video::IVideoDriver* driver, gui::ICursorControl* cursorcontrol)
{
- return new CSceneManager(driver, fs, cursorcontrol, nullptr);
+ return new CSceneManager(driver, cursorcontrol, nullptr);
}
diff --git a/source/Irrlicht/CSceneManager.h b/source/Irrlicht/CSceneManager.h index 1a74995..4b1beec 100644 --- a/source/Irrlicht/CSceneManager.h +++ b/source/Irrlicht/CSceneManager.h @@ -31,16 +31,12 @@ namespace scene public:
//! constructor
- CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
- gui::ICursorControl* cursorControl, IMeshCache* cache = nullptr);
+ CSceneManager(video::IVideoDriver* driver, gui::ICursorControl* cursorControl, IMeshCache* cache = 0);
//! destructor
virtual ~CSceneManager();
//! gets an animateable mesh. loads it if needed. returned pointer must not be dropped.
- IAnimatedMesh* getMesh(const io::path& filename, const io::path& alternativeCacheName) override;
-
- //! gets an animateable mesh. loads it if needed. returned pointer must not be dropped.
IAnimatedMesh* getMesh(io::IReadFile* file) override;
//! Returns an interface to the mesh cache which is shared between all existing scene managers.
@@ -49,9 +45,6 @@ namespace scene //! returns the video driver
video::IVideoDriver* getVideoDriver() override;
- //! return the filesystem
- io::IFileSystem* getFileSystem() override;
-
//! adds a scene node for rendering an animated mesh model
virtual IAnimatedMeshSceneNode* addAnimatedMeshSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0),
@@ -278,9 +271,6 @@ namespace scene //! video driver
video::IVideoDriver* Driver;
- //! file system
- io::IFileSystem* FileSystem;
-
//! cursor control
gui::ICursorControl* CursorControl;
|