1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 // This Loader has been originally written by Saurav Mohapatra. I (Nikolaus Gebhardt)
\r
6 // modified some minor things and integrated it into Irrlicht 0.9. Thanks a lot
\r
7 // to Saurav Mohapatra for his work on this and that he gave me his permission to
\r
8 // add it into Irrlicht.
\r
9 // I did some changes to Saurav Mohapatra's loader, so I'm writing this down here:
\r
10 // - Replaced all dependencies to STL and stdio with irr:: methods/constructs.
\r
11 // - Moved everything into namespace irr::scene
\r
12 // - Replaced logging with Irrlicht's internal logger.
\r
13 // - Removed dependency to IrrlichtDevice
\r
14 // - Moved all internal structures into CCSMLoader.cpp
\r
15 // - Made the texture root parameter dependent on a ISceneManager string parameter
\r
16 // - removed exceptions
\r
17 // - Implemented CCCSMLoader as IMeshLoader
\r
18 // - Fixed some problems with memory leaks
\r
19 // - Fixed bounding box calculation
\r
21 // The original readme of this file looks like this:
\r
23 // This component provides a loader for the Cartography shop 4.x .csm maps for Irrlicht Engine.
\r
24 // This is a part of the M_TRIX Project.
\r
25 // This is licensed under the ZLib/LibPNG license
\r
26 // The IrrCSM library is written by Saurav Mohapatra.
\r
30 // The IrrCSM library features the following capabilities
\r
32 // * Loads the .csm 4.0 and 4.1 files transparently
\r
33 // * Presents the loaded file as irr::scene::IAnimatedMesh for easy creation of IOctreeSceneNode
\r
34 // * Loads the textures given the correct texture root. hence map and textures can be in separate directories
\r
36 // For more information go to http://www.geocities.com/standard_template/irrcsm/downloads.html
\r
38 #ifndef __CSM_LOADER_H_INCLUDED__
\r
39 #define __CSM_LOADER_H_INCLUDED__
\r
41 #include "irrArray.h"
\r
43 #include "irrString.h"
\r
44 #include "IFileSystem.h"
\r
45 #include "IMeshLoader.h"
\r
52 class ISceneManager;
\r
54 class CCSMLoader : public scene::IMeshLoader
\r
58 CCSMLoader(ISceneManager* manager, io::IFileSystem* fs);
\r
60 //! returns true if the file maybe is able to be loaded by this class
\r
61 //! based on the file extension (e.g. ".bsp")
\r
62 virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
\r
64 //! creates/loads an animated mesh from the file.
\r
65 virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_;
\r
69 scene::IMesh* createCSMMesh(io::IReadFile* file);
\r
71 scene::IMesh* createIrrlichtMesh(const CSMFile* csmFile, const io::path& lmprefix);
\r
73 io::IFileSystem* FileSystem;
\r
74 scene::ISceneManager* SceneManager;
\r