diff options
author | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
commit | 959831f4ef5a3e797f576c3de08cd65032c997ad (patch) | |
tree | e7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/source/Irrlicht/CMY3DMeshFileLoader.h | |
parent | Add info about changes to Irrlicht. (diff) | |
download | SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2 SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz |
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CMY3DMeshFileLoader.h')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CMY3DMeshFileLoader.h | 262 |
1 files changed, 131 insertions, 131 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CMY3DMeshFileLoader.h b/libraries/irrlicht-1.8/source/Irrlicht/CMY3DMeshFileLoader.h index 716478d..caf1629 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CMY3DMeshFileLoader.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CMY3DMeshFileLoader.h | |||
@@ -1,131 +1,131 @@ | |||
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 | // This file was originally written by ZDimitor. | 5 | // This file was originally written by ZDimitor. |
6 | // I (Nikolaus Gebhardt) did some few changes to this: | 6 | // I (Nikolaus Gebhardt) did some few changes to this: |
7 | // - replaced logging calls to their os:: counterparts | 7 | // - replaced logging calls to their os:: counterparts |
8 | // - removed some logging calls | 8 | // - removed some logging calls |
9 | // - removed setTexture path and replaced it with the directory of the mesh | 9 | // - removed setTexture path and replaced it with the directory of the mesh |
10 | // - added EAMT_MY3D file type | 10 | // - added EAMT_MY3D file type |
11 | // - fixed a memory leak when decompressing RLE data. | 11 | // - fixed a memory leak when decompressing RLE data. |
12 | // - cleaned multi character constant problems with gcc | 12 | // - cleaned multi character constant problems with gcc |
13 | // - removed octree child scene node generation because irrlicht is now able to draw | 13 | // - removed octree child scene node generation because irrlicht is now able to draw |
14 | // scene nodes with transparent and sold materials in them at the same time. (see changes.txt) | 14 | // scene nodes with transparent and sold materials in them at the same time. (see changes.txt) |
15 | // Thanks a lot to ZDimitor for his work on this and that he gave me | 15 | // Thanks a lot to ZDimitor for his work on this and that he gave me |
16 | // his permission to add it into Irrlicht. | 16 | // his permission to add it into Irrlicht. |
17 | 17 | ||
18 | //-------------------------------------------------------------------------------- | 18 | //-------------------------------------------------------------------------------- |
19 | // This tool created by ZDimitor everyone can use it as wants | 19 | // This tool created by ZDimitor everyone can use it as wants |
20 | //-------------------------------------------------------------------------------- | 20 | //-------------------------------------------------------------------------------- |
21 | 21 | ||
22 | #ifndef __CMY3D_MESH_FILE_LOADER_H_INCLUDED__ | 22 | #ifndef __CMY3D_MESH_FILE_LOADER_H_INCLUDED__ |
23 | #define __CMY3D_MESH_FILE_LOADER_H_INCLUDED__ | 23 | #define __CMY3D_MESH_FILE_LOADER_H_INCLUDED__ |
24 | 24 | ||
25 | 25 | ||
26 | #ifdef _MSC_VER | 26 | #ifdef _MSC_VER |
27 | #if _MSC_VER > 1000 | 27 | #if _MSC_VER > 1000 |
28 | #pragma once | 28 | #pragma once |
29 | #endif // _MSC_VER > 1000 | 29 | #endif // _MSC_VER > 1000 |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | 32 | ||
33 | #include "IMeshLoader.h" | 33 | #include "IMeshLoader.h" |
34 | #include "SMesh.h" | 34 | #include "SMesh.h" |
35 | #include "SMeshBufferLightMap.h" | 35 | #include "SMeshBufferLightMap.h" |
36 | #include "IFileSystem.h" | 36 | #include "IFileSystem.h" |
37 | #include "IVideoDriver.h" | 37 | #include "IVideoDriver.h" |
38 | #include "irrString.h" | 38 | #include "irrString.h" |
39 | #include "ISceneManager.h" | 39 | #include "ISceneManager.h" |
40 | 40 | ||
41 | namespace irr | 41 | namespace irr |
42 | { | 42 | { |
43 | namespace scene | 43 | namespace scene |
44 | { | 44 | { |
45 | 45 | ||
46 | // byte-align structures | 46 | // byte-align structures |
47 | #include "irrpack.h" | 47 | #include "irrpack.h" |
48 | 48 | ||
49 | struct SMyColor | 49 | struct SMyColor |
50 | { SMyColor () {;} | 50 | { SMyColor () {;} |
51 | SMyColor (s32 __R, s32 __G, s32 __B, s32 __A) | 51 | SMyColor (s32 __R, s32 __G, s32 __B, s32 __A) |
52 | : R(__R), G(__G), B(__B), A(__A) {} | 52 | : R(__R), G(__G), B(__B), A(__A) {} |
53 | s32 R, G, B, A; | 53 | s32 R, G, B, A; |
54 | } PACK_STRUCT; | 54 | } PACK_STRUCT; |
55 | 55 | ||
56 | // material header | 56 | // material header |
57 | struct SMyMaterialHeader | 57 | struct SMyMaterialHeader |
58 | { c8 Name[256]; // material name | 58 | { c8 Name[256]; // material name |
59 | u32 Index; | 59 | u32 Index; |
60 | SMyColor AmbientColor; | 60 | SMyColor AmbientColor; |
61 | SMyColor DiffuseColor; | 61 | SMyColor DiffuseColor; |
62 | SMyColor EmissiveColor; | 62 | SMyColor EmissiveColor; |
63 | SMyColor SpecularColor; | 63 | SMyColor SpecularColor; |
64 | f32 Shininess; | 64 | f32 Shininess; |
65 | f32 Transparency; | 65 | f32 Transparency; |
66 | u32 TextureCount; // texture count | 66 | u32 TextureCount; // texture count |
67 | } PACK_STRUCT; | 67 | } PACK_STRUCT; |
68 | 68 | ||
69 | // Default alignment | 69 | // Default alignment |
70 | #include "irrunpack.h" | 70 | #include "irrunpack.h" |
71 | 71 | ||
72 | class CMY3DMeshFileLoader : public IMeshLoader | 72 | class CMY3DMeshFileLoader : public IMeshLoader |
73 | { | 73 | { |
74 | public: | 74 | public: |
75 | CMY3DMeshFileLoader(ISceneManager *scmgr, io::IFileSystem* fs); | 75 | CMY3DMeshFileLoader(ISceneManager *scmgr, io::IFileSystem* fs); |
76 | virtual ~CMY3DMeshFileLoader(); | 76 | virtual ~CMY3DMeshFileLoader(); |
77 | 77 | ||
78 | virtual bool isALoadableFileExtension(const io::path& filename) const; | 78 | virtual bool isALoadableFileExtension(const io::path& filename) const; |
79 | 79 | ||
80 | virtual IAnimatedMesh* createMesh(io::IReadFile* file); | 80 | virtual IAnimatedMesh* createMesh(io::IReadFile* file); |
81 | 81 | ||
82 | //! getting access to the nodes (with transparent material), creating | 82 | //! getting access to the nodes (with transparent material), creating |
83 | //! while loading .my3d file | 83 | //! while loading .my3d file |
84 | const core::array<ISceneNode*>& getChildNodes() const; | 84 | const core::array<ISceneNode*>& getChildNodes() const; |
85 | 85 | ||
86 | private: | 86 | private: |
87 | 87 | ||
88 | video::ITexture* readEmbeddedLightmap(io::IReadFile* file, char* namebuf); | 88 | video::ITexture* readEmbeddedLightmap(io::IReadFile* file, char* namebuf); |
89 | 89 | ||
90 | scene::ISceneManager* SceneManager; | 90 | scene::ISceneManager* SceneManager; |
91 | io::IFileSystem* FileSystem; | 91 | io::IFileSystem* FileSystem; |
92 | 92 | ||
93 | struct SMyMaterialEntry | 93 | struct SMyMaterialEntry |
94 | { | 94 | { |
95 | SMyMaterialEntry () | 95 | SMyMaterialEntry () |
96 | : Texture1FileName("null"), Texture2FileName("null"), | 96 | : Texture1FileName("null"), Texture2FileName("null"), |
97 | Texture1(0), Texture2(0), MaterialType(video::EMT_SOLID) {} | 97 | Texture1(0), Texture2(0), MaterialType(video::EMT_SOLID) {} |
98 | 98 | ||
99 | SMyMaterialHeader Header; | 99 | SMyMaterialHeader Header; |
100 | core::stringc Texture1FileName; | 100 | core::stringc Texture1FileName; |
101 | core::stringc Texture2FileName; | 101 | core::stringc Texture2FileName; |
102 | video::ITexture *Texture1; | 102 | video::ITexture *Texture1; |
103 | video::ITexture *Texture2; | 103 | video::ITexture *Texture2; |
104 | video::E_MATERIAL_TYPE MaterialType; | 104 | video::E_MATERIAL_TYPE MaterialType; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | struct SMyMeshBufferEntry | 107 | struct SMyMeshBufferEntry |
108 | { | 108 | { |
109 | SMyMeshBufferEntry() : MaterialIndex(-1), MeshBuffer(0) {} | 109 | SMyMeshBufferEntry() : MaterialIndex(-1), MeshBuffer(0) {} |
110 | SMyMeshBufferEntry(s32 mi, SMeshBufferLightMap* mb) | 110 | SMyMeshBufferEntry(s32 mi, SMeshBufferLightMap* mb) |
111 | : MaterialIndex(mi), MeshBuffer(mb) {} | 111 | : MaterialIndex(mi), MeshBuffer(mb) {} |
112 | 112 | ||
113 | s32 MaterialIndex; | 113 | s32 MaterialIndex; |
114 | SMeshBufferLightMap* MeshBuffer; | 114 | SMeshBufferLightMap* MeshBuffer; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | SMyMaterialEntry* getMaterialEntryByIndex (u32 matInd); | 117 | SMyMaterialEntry* getMaterialEntryByIndex (u32 matInd); |
118 | SMeshBufferLightMap* getMeshBufferByMaterialIndex(u32 matInd); | 118 | SMeshBufferLightMap* getMeshBufferByMaterialIndex(u32 matInd); |
119 | 119 | ||
120 | core::array<SMyMaterialEntry> MaterialEntry; | 120 | core::array<SMyMaterialEntry> MaterialEntry; |
121 | core::array<SMyMeshBufferEntry> MeshBufferEntry; | 121 | core::array<SMyMeshBufferEntry> MeshBufferEntry; |
122 | 122 | ||
123 | core::array<ISceneNode*> ChildNodes; | 123 | core::array<ISceneNode*> ChildNodes; |
124 | }; | 124 | }; |
125 | 125 | ||
126 | 126 | ||
127 | } // end namespace scene | 127 | } // end namespace scene |
128 | } // end namespace irr | 128 | } // end namespace irr |
129 | 129 | ||
130 | 130 | ||
131 | #endif // __CMY3D_MESH_FILE_LOADER_H_INCLUDED__ | 131 | #endif // __CMY3D_MESH_FILE_LOADER_H_INCLUDED__ |