diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CLMTSMeshFileLoader.h | 218 |
1 files changed, 109 insertions, 109 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CLMTSMeshFileLoader.h b/libraries/irrlicht-1.8/source/Irrlicht/CLMTSMeshFileLoader.h index 4e3bb09..6aea94f 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CLMTSMeshFileLoader.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CLMTSMeshFileLoader.h | |||
@@ -1,109 +1,109 @@ | |||
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 | // I (Nikolaus Gebhardt) did some few changes to Jonas Petersen's original loader: | 5 | // I (Nikolaus Gebhardt) did some few changes to Jonas Petersen's original loader: |
6 | // - removed setTexturePath() and replaced with the ISceneManager::getStringParameter()-stuff. | 6 | // - removed setTexturePath() and replaced with the ISceneManager::getStringParameter()-stuff. |
7 | // - added EAMT_LMTS enumeration value | 7 | // - added EAMT_LMTS enumeration value |
8 | // Thanks a lot to Jonas Petersen for his work | 8 | // Thanks a lot to Jonas Petersen for his work |
9 | // on this and that he gave me his permission to add it into Irrlicht. | 9 | // on this and that he gave me his permission to add it into Irrlicht. |
10 | /* | 10 | /* |
11 | 11 | ||
12 | CLMTSMeshFileLoader.h | 12 | CLMTSMeshFileLoader.h |
13 | 13 | ||
14 | LMTSMeshFileLoader | 14 | LMTSMeshFileLoader |
15 | Written by Jonas Petersen (a.k.a. jox) | 15 | Written by Jonas Petersen (a.k.a. jox) |
16 | 16 | ||
17 | Version 1.5 - 15 March 2005 | 17 | Version 1.5 - 15 March 2005 |
18 | 18 | ||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #if !defined(__C_LMTS_MESH_FILE_LOADER_H_INCLUDED__) | 21 | #if !defined(__C_LMTS_MESH_FILE_LOADER_H_INCLUDED__) |
22 | #define __C_LMTS_MESH_FILE_LOADER_H_INCLUDED__ | 22 | #define __C_LMTS_MESH_FILE_LOADER_H_INCLUDED__ |
23 | 23 | ||
24 | #include "IMeshLoader.h" | 24 | #include "IMeshLoader.h" |
25 | #include "SMesh.h" | 25 | #include "SMesh.h" |
26 | #include "IFileSystem.h" | 26 | #include "IFileSystem.h" |
27 | #include "IVideoDriver.h" | 27 | #include "IVideoDriver.h" |
28 | 28 | ||
29 | namespace irr | 29 | namespace irr |
30 | { | 30 | { |
31 | namespace scene | 31 | namespace scene |
32 | { | 32 | { |
33 | 33 | ||
34 | class CLMTSMeshFileLoader : public IMeshLoader | 34 | class CLMTSMeshFileLoader : public IMeshLoader |
35 | { | 35 | { |
36 | public: | 36 | public: |
37 | 37 | ||
38 | CLMTSMeshFileLoader(io::IFileSystem* fs, | 38 | CLMTSMeshFileLoader(io::IFileSystem* fs, |
39 | video::IVideoDriver* driver, io::IAttributes* parameters); | 39 | video::IVideoDriver* driver, io::IAttributes* parameters); |
40 | 40 | ||
41 | virtual ~CLMTSMeshFileLoader(); | 41 | virtual ~CLMTSMeshFileLoader(); |
42 | 42 | ||
43 | virtual bool isALoadableFileExtension(const io::path& filename) const; | 43 | virtual bool isALoadableFileExtension(const io::path& filename) const; |
44 | 44 | ||
45 | virtual IAnimatedMesh* createMesh(io::IReadFile* file); | 45 | virtual IAnimatedMesh* createMesh(io::IReadFile* file); |
46 | 46 | ||
47 | private: | 47 | private: |
48 | void constructMesh(SMesh* mesh); | 48 | void constructMesh(SMesh* mesh); |
49 | void loadTextures(SMesh* mesh); | 49 | void loadTextures(SMesh* mesh); |
50 | void cleanup(); | 50 | void cleanup(); |
51 | 51 | ||
52 | // byte-align structures | 52 | // byte-align structures |
53 | #include "irrpack.h" | 53 | #include "irrpack.h" |
54 | 54 | ||
55 | struct SLMTSHeader | 55 | struct SLMTSHeader |
56 | { | 56 | { |
57 | u32 MagicID; | 57 | u32 MagicID; |
58 | u32 Version; | 58 | u32 Version; |
59 | u32 HeaderSize; | 59 | u32 HeaderSize; |
60 | u16 TextureCount; | 60 | u16 TextureCount; |
61 | u16 SubsetCount; | 61 | u16 SubsetCount; |
62 | u32 TriangleCount; | 62 | u32 TriangleCount; |
63 | u16 SubsetSize; | 63 | u16 SubsetSize; |
64 | u16 VertexSize; | 64 | u16 VertexSize; |
65 | } PACK_STRUCT; | 65 | } PACK_STRUCT; |
66 | 66 | ||
67 | struct SLMTSTextureInfoEntry | 67 | struct SLMTSTextureInfoEntry |
68 | { | 68 | { |
69 | c8 Filename[256]; | 69 | c8 Filename[256]; |
70 | u16 Flags; | 70 | u16 Flags; |
71 | } PACK_STRUCT; | 71 | } PACK_STRUCT; |
72 | 72 | ||
73 | struct SLMTSSubsetInfoEntry | 73 | struct SLMTSSubsetInfoEntry |
74 | { | 74 | { |
75 | u32 Offset; | 75 | u32 Offset; |
76 | u32 Count; | 76 | u32 Count; |
77 | u16 TextID1; | 77 | u16 TextID1; |
78 | u16 TextID2; | 78 | u16 TextID2; |
79 | } PACK_STRUCT; | 79 | } PACK_STRUCT; |
80 | 80 | ||
81 | struct SLMTSTriangleDataEntry | 81 | struct SLMTSTriangleDataEntry |
82 | { | 82 | { |
83 | f32 X; | 83 | f32 X; |
84 | f32 Y; | 84 | f32 Y; |
85 | f32 Z; | 85 | f32 Z; |
86 | f32 U1; | 86 | f32 U1; |
87 | f32 V1; | 87 | f32 V1; |
88 | f32 U2; | 88 | f32 U2; |
89 | f32 V2; | 89 | f32 V2; |
90 | } PACK_STRUCT; | 90 | } PACK_STRUCT; |
91 | 91 | ||
92 | // Default alignment | 92 | // Default alignment |
93 | #include "irrunpack.h" | 93 | #include "irrunpack.h" |
94 | 94 | ||
95 | SLMTSHeader Header; | 95 | SLMTSHeader Header; |
96 | SLMTSTextureInfoEntry* Textures; | 96 | SLMTSTextureInfoEntry* Textures; |
97 | SLMTSSubsetInfoEntry* Subsets; | 97 | SLMTSSubsetInfoEntry* Subsets; |
98 | SLMTSTriangleDataEntry* Triangles; | 98 | SLMTSTriangleDataEntry* Triangles; |
99 | 99 | ||
100 | io::IAttributes* Parameters; | 100 | io::IAttributes* Parameters; |
101 | video::IVideoDriver* Driver; | 101 | video::IVideoDriver* Driver; |
102 | io::IFileSystem* FileSystem; | 102 | io::IFileSystem* FileSystem; |
103 | bool FlipEndianess; | 103 | bool FlipEndianess; |
104 | }; | 104 | }; |
105 | 105 | ||
106 | } // end namespace scene | 106 | } // end namespace scene |
107 | } // end namespace irr | 107 | } // end namespace irr |
108 | 108 | ||
109 | #endif // !defined(__C_LMTS_MESH_FILE_LOADER_H_INCLUDED__) | 109 | #endif // !defined(__C_LMTS_MESH_FILE_LOADER_H_INCLUDED__) |