]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/CCSMLoader.h
Merging r5975 through r6036 from trunk to ogl-es branch.
[irrlicht.git] / source / Irrlicht / CCSMLoader.h
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
4 //\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
20 //\r
21 // The original readme of this file looks like this:\r
22 //\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
27 //\r
28 // Features\r
29 //\r
30 // The IrrCSM library features the following capabilities\r
31 //\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
35 //\r
36 // For more information go to http://www.geocities.com/standard_template/irrcsm/downloads.html\r
37 \r
38 #ifndef __CSM_LOADER_H_INCLUDED__\r
39 #define __CSM_LOADER_H_INCLUDED__\r
40 \r
41 #include "irrArray.h"\r
42 #include "IMesh.h"\r
43 #include "irrString.h"\r
44 #include "IFileSystem.h"\r
45 #include "IMeshLoader.h"\r
46 \r
47 namespace irr\r
48 {\r
49 namespace scene\r
50 {\r
51         class CSMFile;\r
52         class ISceneManager;\r
53 \r
54         class CCSMLoader : public scene::IMeshLoader\r
55         {\r
56         public:\r
57 \r
58                 CCSMLoader(ISceneManager* manager, io::IFileSystem* fs);\r
59 \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
63 \r
64                 //! creates/loads an animated mesh from the file.\r
65                 virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_;\r
66 \r
67         private:\r
68 \r
69                 scene::IMesh* createCSMMesh(io::IReadFile* file);\r
70 \r
71                 scene::IMesh* createIrrlichtMesh(const CSMFile* csmFile, const io::path& lmprefix);\r
72 \r
73                 io::IFileSystem* FileSystem;\r
74                 scene::ISceneManager* SceneManager;\r
75         };\r
76 \r
77 } // end namespace\r
78 } // end namespace\r
79 \r
80 #endif\r
81 \r