From 5a1565072abeecf9fc5a3ffc450d5ab8ff660021 Mon Sep 17 00:00:00 2001 From: numzero Date: Mon, 13 Mar 2023 22:28:09 +0300 Subject: [PATCH] Drop unused dependency on FileSystem in mesh loaders --- source/Irrlicht/COBJMeshFileLoader.cpp | 10 ++-------- source/Irrlicht/COBJMeshFileLoader.h | 4 +--- source/Irrlicht/CSceneManager.cpp | 4 ++-- source/Irrlicht/CXMeshFileLoader.cpp | 3 +-- source/Irrlicht/CXMeshFileLoader.h | 3 +-- 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/source/Irrlicht/COBJMeshFileLoader.cpp b/source/Irrlicht/COBJMeshFileLoader.cpp index c4be102d..740f8e5f 100644 --- a/source/Irrlicht/COBJMeshFileLoader.cpp +++ b/source/Irrlicht/COBJMeshFileLoader.cpp @@ -24,23 +24,18 @@ namespace scene #endif //! Constructor -COBJMeshFileLoader::COBJMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs) -: SceneManager(smgr), FileSystem(fs) +COBJMeshFileLoader::COBJMeshFileLoader(scene::ISceneManager* smgr) +: SceneManager(smgr) { #ifdef _DEBUG setDebugName("COBJMeshFileLoader"); #endif - - if (FileSystem) - FileSystem->grab(); } //! destructor COBJMeshFileLoader::~COBJMeshFileLoader() { - if (FileSystem) - FileSystem->drop(); } @@ -76,7 +71,6 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file) u32 smoothingGroup=0; const io::path fullName = file->getFileName(); - const io::path relPath = FileSystem->getFileDir(fullName)+"/"; c8* buf = new c8[filesize]; memset(buf, 0, filesize); diff --git a/source/Irrlicht/COBJMeshFileLoader.h b/source/Irrlicht/COBJMeshFileLoader.h index c03197a7..c706a5d6 100644 --- a/source/Irrlicht/COBJMeshFileLoader.h +++ b/source/Irrlicht/COBJMeshFileLoader.h @@ -7,7 +7,6 @@ #include #include "IMeshLoader.h" -#include "IFileSystem.h" #include "ISceneManager.h" #include "irrString.h" #include "SMeshBuffer.h" @@ -23,7 +22,7 @@ class COBJMeshFileLoader : public IMeshLoader public: //! Constructor - COBJMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs); + COBJMeshFileLoader(scene::ISceneManager* smgr); //! destructor virtual ~COBJMeshFileLoader(); @@ -104,7 +103,6 @@ private: void cleanUp(); scene::ISceneManager* SceneManager; - io::IFileSystem* FileSystem; core::array Materials; }; diff --git a/source/Irrlicht/CSceneManager.cpp b/source/Irrlicht/CSceneManager.cpp index e22ddd59..440a44dd 100644 --- a/source/Irrlicht/CSceneManager.cpp +++ b/source/Irrlicht/CSceneManager.cpp @@ -79,8 +79,8 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, // TODO: now that we have multiple scene managers, these should be // shallow copies from the previous manager if there is one. - MeshLoaderList.push_back(new CXMeshFileLoader(this, FileSystem)); - MeshLoaderList.push_back(new COBJMeshFileLoader(this, FileSystem)); + MeshLoaderList.push_back(new CXMeshFileLoader(this)); + MeshLoaderList.push_back(new COBJMeshFileLoader(this)); MeshLoaderList.push_back(new CB3DMeshFileLoader(this)); } diff --git a/source/Irrlicht/CXMeshFileLoader.cpp b/source/Irrlicht/CXMeshFileLoader.cpp index 7603ec58..2a365ac1 100644 --- a/source/Irrlicht/CXMeshFileLoader.cpp +++ b/source/Irrlicht/CXMeshFileLoader.cpp @@ -10,7 +10,6 @@ #include "coreutil.h" #include "ISceneManager.h" #include "IVideoDriver.h" -#include "IFileSystem.h" #include "IReadFile.h" #ifdef _DEBUG @@ -24,7 +23,7 @@ namespace scene { //! Constructor -CXMeshFileLoader::CXMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs) +CXMeshFileLoader::CXMeshFileLoader(scene::ISceneManager* smgr) : AnimatedMesh(0), Buffer(0), P(0), End(0), BinaryNumCount(0), Line(0), CurFrame(0), MajorVersion(0), MinorVersion(0), BinaryFormat(false), FloatSize(0) { diff --git a/source/Irrlicht/CXMeshFileLoader.h b/source/Irrlicht/CXMeshFileLoader.h index cfedfd04..ca934a88 100644 --- a/source/Irrlicht/CXMeshFileLoader.h +++ b/source/Irrlicht/CXMeshFileLoader.h @@ -14,7 +14,6 @@ namespace irr { namespace io { - class IFileSystem; class IReadFile; } // end namespace io namespace scene @@ -27,7 +26,7 @@ class CXMeshFileLoader : public IMeshLoader public: //! Constructor - CXMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs); + CXMeshFileLoader(scene::ISceneManager* smgr); //! returns true if the file maybe is able to be loaded by this class //! based on the file extension (e.g. ".cob")