Drop unused dependency on FileSystem in mesh loaders

This commit is contained in:
numzero 2023-03-13 22:28:09 +03:00 committed by sfan5
parent 25a7074c9a
commit 5a1565072a
5 changed files with 7 additions and 17 deletions

@ -24,23 +24,18 @@ namespace scene
#endif #endif
//! Constructor //! Constructor
COBJMeshFileLoader::COBJMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs) COBJMeshFileLoader::COBJMeshFileLoader(scene::ISceneManager* smgr)
: SceneManager(smgr), FileSystem(fs) : SceneManager(smgr)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("COBJMeshFileLoader"); setDebugName("COBJMeshFileLoader");
#endif #endif
if (FileSystem)
FileSystem->grab();
} }
//! destructor //! destructor
COBJMeshFileLoader::~COBJMeshFileLoader() COBJMeshFileLoader::~COBJMeshFileLoader()
{ {
if (FileSystem)
FileSystem->drop();
} }
@ -76,7 +71,6 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
u32 smoothingGroup=0; u32 smoothingGroup=0;
const io::path fullName = file->getFileName(); const io::path fullName = file->getFileName();
const io::path relPath = FileSystem->getFileDir(fullName)+"/";
c8* buf = new c8[filesize]; c8* buf = new c8[filesize];
memset(buf, 0, filesize); memset(buf, 0, filesize);

@ -7,7 +7,6 @@
#include <map> #include <map>
#include "IMeshLoader.h" #include "IMeshLoader.h"
#include "IFileSystem.h"
#include "ISceneManager.h" #include "ISceneManager.h"
#include "irrString.h" #include "irrString.h"
#include "SMeshBuffer.h" #include "SMeshBuffer.h"
@ -23,7 +22,7 @@ class COBJMeshFileLoader : public IMeshLoader
public: public:
//! Constructor //! Constructor
COBJMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs); COBJMeshFileLoader(scene::ISceneManager* smgr);
//! destructor //! destructor
virtual ~COBJMeshFileLoader(); virtual ~COBJMeshFileLoader();
@ -104,7 +103,6 @@ private:
void cleanUp(); void cleanUp();
scene::ISceneManager* SceneManager; scene::ISceneManager* SceneManager;
io::IFileSystem* FileSystem;
core::array<SObjMtl*> Materials; core::array<SObjMtl*> Materials;
}; };

@ -79,8 +79,8 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
// TODO: now that we have multiple scene managers, these should be // TODO: now that we have multiple scene managers, these should be
// shallow copies from the previous manager if there is one. // shallow copies from the previous manager if there is one.
MeshLoaderList.push_back(new CXMeshFileLoader(this, FileSystem)); MeshLoaderList.push_back(new CXMeshFileLoader(this));
MeshLoaderList.push_back(new COBJMeshFileLoader(this, FileSystem)); MeshLoaderList.push_back(new COBJMeshFileLoader(this));
MeshLoaderList.push_back(new CB3DMeshFileLoader(this)); MeshLoaderList.push_back(new CB3DMeshFileLoader(this));
} }

@ -10,7 +10,6 @@
#include "coreutil.h" #include "coreutil.h"
#include "ISceneManager.h" #include "ISceneManager.h"
#include "IVideoDriver.h" #include "IVideoDriver.h"
#include "IFileSystem.h"
#include "IReadFile.h" #include "IReadFile.h"
#ifdef _DEBUG #ifdef _DEBUG
@ -24,7 +23,7 @@ namespace scene
{ {
//! Constructor //! 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), : AnimatedMesh(0), Buffer(0), P(0), End(0), BinaryNumCount(0), Line(0),
CurFrame(0), MajorVersion(0), MinorVersion(0), BinaryFormat(false), FloatSize(0) CurFrame(0), MajorVersion(0), MinorVersion(0), BinaryFormat(false), FloatSize(0)
{ {

@ -14,7 +14,6 @@ namespace irr
{ {
namespace io namespace io
{ {
class IFileSystem;
class IReadFile; class IReadFile;
} // end namespace io } // end namespace io
namespace scene namespace scene
@ -27,7 +26,7 @@ class CXMeshFileLoader : public IMeshLoader
public: public:
//! Constructor //! 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 //! returns true if the file maybe is able to be loaded by this class
//! based on the file extension (e.g. ".cob") //! based on the file extension (e.g. ".cob")