diff options
Diffstat (limited to 'libraries/irrlicht-1.8.1/source/Irrlicht/CSceneLoaderIrr.h')
-rw-r--r-- | libraries/irrlicht-1.8.1/source/Irrlicht/CSceneLoaderIrr.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8.1/source/Irrlicht/CSceneLoaderIrr.h b/libraries/irrlicht-1.8.1/source/Irrlicht/CSceneLoaderIrr.h new file mode 100644 index 0000000..f8c9532 --- /dev/null +++ b/libraries/irrlicht-1.8.1/source/Irrlicht/CSceneLoaderIrr.h | |||
@@ -0,0 +1,82 @@ | |||
1 | // Copyright (C) 2010-2012 Nikolaus Gebhardt | ||
2 | // This file is part of the "Irrlicht Engine". | ||
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | ||
4 | |||
5 | #ifndef __C_SCENE_LOADER_IRR_H_INCLUDED__ | ||
6 | #define __C_SCENE_LOADER_IRR_H_INCLUDED__ | ||
7 | |||
8 | #include "ISceneLoader.h" | ||
9 | |||
10 | #include "IXMLReader.h" | ||
11 | |||
12 | namespace irr | ||
13 | { | ||
14 | |||
15 | namespace io | ||
16 | { | ||
17 | class IFileSystem; | ||
18 | } | ||
19 | |||
20 | namespace scene | ||
21 | { | ||
22 | |||
23 | class ISceneManager; | ||
24 | |||
25 | //! Class which can load a scene into the scene manager. | ||
26 | class CSceneLoaderIrr : public virtual ISceneLoader | ||
27 | { | ||
28 | public: | ||
29 | |||
30 | //! Constructor | ||
31 | CSceneLoaderIrr(ISceneManager *smgr, io::IFileSystem* fs); | ||
32 | |||
33 | //! Destructor | ||
34 | virtual ~CSceneLoaderIrr(); | ||
35 | |||
36 | //! Returns true if the class might be able to load this file. | ||
37 | virtual bool isALoadableFileExtension(const io::path& filename) const; | ||
38 | |||
39 | //! Returns true if the class might be able to load this file. | ||
40 | virtual bool isALoadableFileFormat(io::IReadFile *file) const; | ||
41 | |||
42 | //! Loads the scene into the scene manager. | ||
43 | virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0, | ||
44 | ISceneNode* rootNode=0); | ||
45 | |||
46 | private: | ||
47 | |||
48 | //! Recursively reads nodes from the xml file | ||
49 | void readSceneNode(io::IXMLReader* reader, ISceneNode* parent, | ||
50 | ISceneUserDataSerializer* userDataSerializer); | ||
51 | |||
52 | //! read a node's materials | ||
53 | void readMaterials(io::IXMLReader* reader, ISceneNode* node); | ||
54 | |||
55 | //! read a node's animators | ||
56 | void readAnimators(io::IXMLReader* reader, ISceneNode* node); | ||
57 | |||
58 | //! read any other data into the user serializer | ||
59 | void readUserData(io::IXMLReader* reader, ISceneNode* node, | ||
60 | ISceneUserDataSerializer* userDataSerializer); | ||
61 | |||
62 | ISceneManager *SceneManager; | ||
63 | io::IFileSystem *FileSystem; | ||
64 | |||
65 | //! constants for reading and writing XML. | ||
66 | //! Not made static due to portability problems. | ||
67 | // TODO: move to own header | ||
68 | const core::stringw IRR_XML_FORMAT_SCENE; | ||
69 | const core::stringw IRR_XML_FORMAT_NODE; | ||
70 | const core::stringw IRR_XML_FORMAT_NODE_ATTR_TYPE; | ||
71 | const core::stringw IRR_XML_FORMAT_ATTRIBUTES; | ||
72 | const core::stringw IRR_XML_FORMAT_MATERIALS; | ||
73 | const core::stringw IRR_XML_FORMAT_ANIMATORS; | ||
74 | const core::stringw IRR_XML_FORMAT_USERDATA; | ||
75 | }; | ||
76 | |||
77 | |||
78 | } // end namespace scene | ||
79 | } // end namespace irr | ||
80 | |||
81 | #endif | ||
82 | |||