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