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