diff options
author | David Walter Seikel | 2014-01-13 19:47:58 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-01-13 19:47:58 +1000 |
commit | f9158592e1478b2013afc7041d9ed041cf2d2f4a (patch) | |
tree | b16e389d7988700e21b4c9741044cefa536dcbae /libraries/irrlicht-1.8.1/source/Irrlicht/CIrrMeshFileLoader.h | |
parent | Libraries readme updated with change markers and more of the Irrlicht changes. (diff) | |
download | SledjHamr-f9158592e1478b2013afc7041d9ed041cf2d2f4a.zip SledjHamr-f9158592e1478b2013afc7041d9ed041cf2d2f4a.tar.gz SledjHamr-f9158592e1478b2013afc7041d9ed041cf2d2f4a.tar.bz2 SledjHamr-f9158592e1478b2013afc7041d9ed041cf2d2f4a.tar.xz |
Update Irrlicht to 1.8.1. Include actual change markers this time. lol
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8.1/source/Irrlicht/CIrrMeshFileLoader.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8.1/source/Irrlicht/CIrrMeshFileLoader.h b/libraries/irrlicht-1.8.1/source/Irrlicht/CIrrMeshFileLoader.h new file mode 100644 index 0000000..39b2332 --- /dev/null +++ b/libraries/irrlicht-1.8.1/source/Irrlicht/CIrrMeshFileLoader.h | |||
@@ -0,0 +1,90 @@ | |||
1 | // Copyright (C) 2002-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_IRR_MESH_FILE_LOADER_H_INCLUDED__ | ||
6 | #define __C_IRR_MESH_FILE_LOADER_H_INCLUDED__ | ||
7 | |||
8 | #include "IMeshLoader.h" | ||
9 | #include "IFileSystem.h" | ||
10 | #include "IVideoDriver.h" | ||
11 | #include "irrString.h" | ||
12 | #include "SMesh.h" | ||
13 | #include "SMeshBuffer.h" | ||
14 | #include "CDynamicMeshBuffer.h" | ||
15 | #include "ISceneManager.h" | ||
16 | |||
17 | namespace irr | ||
18 | { | ||
19 | namespace scene | ||
20 | { | ||
21 | |||
22 | |||
23 | //! Meshloader capable of loading .irrmesh meshes, the Irrlicht Engine mesh format for static meshes | ||
24 | class CIrrMeshFileLoader : public IMeshLoader | ||
25 | { | ||
26 | public: | ||
27 | |||
28 | //! Constructor | ||
29 | CIrrMeshFileLoader(scene::ISceneManager* smgr, io::IFileSystem* fs); | ||
30 | |||
31 | //! returns true if the file maybe is able to be loaded by this class | ||
32 | //! based on the file extension (e.g. ".cob") | ||
33 | virtual bool isALoadableFileExtension(const io::path& filename) const; | ||
34 | |||
35 | //! creates/loads an animated mesh from the file. | ||
36 | //! \return Pointer to the created mesh. Returns 0 if loading failed. | ||
37 | //! If you no longer need the mesh, you should call IAnimatedMesh::drop(). | ||
38 | //! See IReferenceCounted::drop() for more information. | ||
39 | virtual IAnimatedMesh* createMesh(io::IReadFile* file); | ||
40 | |||
41 | private: | ||
42 | |||
43 | //! reads a mesh sections and creates a mesh from it | ||
44 | IAnimatedMesh* readMesh(io::IXMLReader* reader); | ||
45 | |||
46 | //! reads a mesh sections and creates a mesh buffer from it | ||
47 | IMeshBuffer* readMeshBuffer(io::IXMLReader* reader); | ||
48 | |||
49 | //! skips an (unknown) section in the irrmesh file | ||
50 | void skipSection(io::IXMLReader* reader, bool reportSkipping); | ||
51 | |||
52 | //! reads a <material> element and stores it in the material section | ||
53 | void readMaterial(io::IXMLReader* reader); | ||
54 | |||
55 | //! parses a float from a char pointer and moves the pointer to | ||
56 | //! the end of the parsed float | ||
57 | inline f32 readFloat(const c8** p); | ||
58 | |||
59 | //! parses an int from a char pointer and moves the pointer to | ||
60 | //! the end of the parsed float | ||
61 | inline s32 readInt(const c8** p); | ||
62 | |||
63 | //! places pointer to next begin of a token | ||
64 | void findNextNoneWhiteSpace(const c8** p); | ||
65 | |||
66 | //! places pointer to next begin of a token | ||
67 | void skipCurrentNoneWhiteSpace(const c8** p); | ||
68 | |||
69 | //! reads floats from inside of xml element until end of xml element | ||
70 | void readFloatsInsideElement(io::IXMLReader* reader, f32* floats, u32 count); | ||
71 | |||
72 | //! read the mesh buffers | ||
73 | void readMeshBuffer(io::IXMLReader* reader, int vertexCount, CDynamicMeshBuffer* sbuffer); | ||
74 | |||
75 | //! read indices | ||
76 | void readIndices(io::IXMLReader* reader, int indexCount, IIndexBuffer& indices); | ||
77 | |||
78 | |||
79 | // member variables | ||
80 | |||
81 | scene::ISceneManager* SceneManager; | ||
82 | io::IFileSystem* FileSystem; | ||
83 | }; | ||
84 | |||
85 | |||
86 | } // end namespace scene | ||
87 | } // end namespace irr | ||
88 | |||
89 | #endif | ||
90 | |||