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/CB3DMeshFileLoader.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 '')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CB3DMeshFileLoader.h | 280 |
1 files changed, 140 insertions, 140 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CB3DMeshFileLoader.h b/libraries/irrlicht-1.8/source/Irrlicht/CB3DMeshFileLoader.h index 6b3d4b8..aa86e8d 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CB3DMeshFileLoader.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CB3DMeshFileLoader.h | |||
@@ -1,140 +1,140 @@ | |||
1 | // Copyright (C) 2006-2012 Luke Hoschke | 1 | // Copyright (C) 2006-2012 Luke Hoschke |
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 | // B3D Mesh loader | 5 | // B3D Mesh loader |
6 | // File format designed by Mark Sibly for the Blitz3D engine and has been | 6 | // File format designed by Mark Sibly for the Blitz3D engine and has been |
7 | // declared public domain | 7 | // declared public domain |
8 | 8 | ||
9 | #include "IrrCompileConfig.h" | 9 | #include "IrrCompileConfig.h" |
10 | 10 | ||
11 | #ifndef __C_B3D_MESH_LOADER_H_INCLUDED__ | 11 | #ifndef __C_B3D_MESH_LOADER_H_INCLUDED__ |
12 | #define __C_B3D_MESH_LOADER_H_INCLUDED__ | 12 | #define __C_B3D_MESH_LOADER_H_INCLUDED__ |
13 | 13 | ||
14 | #include "IMeshLoader.h" | 14 | #include "IMeshLoader.h" |
15 | #include "ISceneManager.h" | 15 | #include "ISceneManager.h" |
16 | #include "CSkinnedMesh.h" | 16 | #include "CSkinnedMesh.h" |
17 | #include "IReadFile.h" | 17 | #include "IReadFile.h" |
18 | 18 | ||
19 | namespace irr | 19 | namespace irr |
20 | { | 20 | { |
21 | 21 | ||
22 | namespace scene | 22 | namespace scene |
23 | { | 23 | { |
24 | 24 | ||
25 | //! Meshloader for B3D format | 25 | //! Meshloader for B3D format |
26 | class CB3DMeshFileLoader : public IMeshLoader | 26 | class CB3DMeshFileLoader : public IMeshLoader |
27 | { | 27 | { |
28 | public: | 28 | public: |
29 | 29 | ||
30 | //! Constructor | 30 | //! Constructor |
31 | CB3DMeshFileLoader(scene::ISceneManager* smgr); | 31 | CB3DMeshFileLoader(scene::ISceneManager* smgr); |
32 | 32 | ||
33 | //! returns true if the file maybe is able to be loaded by this class | 33 | //! returns true if the file maybe is able to be loaded by this class |
34 | //! based on the file extension (e.g. ".bsp") | 34 | //! based on the file extension (e.g. ".bsp") |
35 | virtual bool isALoadableFileExtension(const io::path& filename) const; | 35 | virtual bool isALoadableFileExtension(const io::path& filename) const; |
36 | 36 | ||
37 | //! creates/loads an animated mesh from the file. | 37 | //! creates/loads an animated mesh from the file. |
38 | //! \return Pointer to the created mesh. Returns 0 if loading failed. | 38 | //! \return Pointer to the created mesh. Returns 0 if loading failed. |
39 | //! If you no longer need the mesh, you should call IAnimatedMesh::drop(). | 39 | //! If you no longer need the mesh, you should call IAnimatedMesh::drop(). |
40 | //! See IReferenceCounted::drop() for more information. | 40 | //! See IReferenceCounted::drop() for more information. |
41 | virtual IAnimatedMesh* createMesh(io::IReadFile* file); | 41 | virtual IAnimatedMesh* createMesh(io::IReadFile* file); |
42 | 42 | ||
43 | private: | 43 | private: |
44 | 44 | ||
45 | struct SB3dChunkHeader | 45 | struct SB3dChunkHeader |
46 | { | 46 | { |
47 | c8 name[4]; | 47 | c8 name[4]; |
48 | s32 size; | 48 | s32 size; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | struct SB3dChunk | 51 | struct SB3dChunk |
52 | { | 52 | { |
53 | SB3dChunk(const SB3dChunkHeader& header, long sp) | 53 | SB3dChunk(const SB3dChunkHeader& header, long sp) |
54 | : length(header.size+8), startposition(sp) | 54 | : length(header.size+8), startposition(sp) |
55 | { | 55 | { |
56 | name[0]=header.name[0]; | 56 | name[0]=header.name[0]; |
57 | name[1]=header.name[1]; | 57 | name[1]=header.name[1]; |
58 | name[2]=header.name[2]; | 58 | name[2]=header.name[2]; |
59 | name[3]=header.name[3]; | 59 | name[3]=header.name[3]; |
60 | } | 60 | } |
61 | 61 | ||
62 | c8 name[4]; | 62 | c8 name[4]; |
63 | s32 length; | 63 | s32 length; |
64 | long startposition; | 64 | long startposition; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | struct SB3dTexture | 67 | struct SB3dTexture |
68 | { | 68 | { |
69 | core::stringc TextureName; | 69 | core::stringc TextureName; |
70 | s32 Flags; | 70 | s32 Flags; |
71 | s32 Blend; | 71 | s32 Blend; |
72 | f32 Xpos; | 72 | f32 Xpos; |
73 | f32 Ypos; | 73 | f32 Ypos; |
74 | f32 Xscale; | 74 | f32 Xscale; |
75 | f32 Yscale; | 75 | f32 Yscale; |
76 | f32 Angle; | 76 | f32 Angle; |
77 | }; | 77 | }; |
78 | 78 | ||
79 | struct SB3dMaterial | 79 | struct SB3dMaterial |
80 | { | 80 | { |
81 | SB3dMaterial() : red(1.0f), green(1.0f), | 81 | SB3dMaterial() : red(1.0f), green(1.0f), |
82 | blue(1.0f), alpha(1.0f), shininess(0.0f), blend(1), | 82 | blue(1.0f), alpha(1.0f), shininess(0.0f), blend(1), |
83 | fx(0) | 83 | fx(0) |
84 | { | 84 | { |
85 | for (u32 i=0; i<video::MATERIAL_MAX_TEXTURES; ++i) | 85 | for (u32 i=0; i<video::MATERIAL_MAX_TEXTURES; ++i) |
86 | Textures[i]=0; | 86 | Textures[i]=0; |
87 | } | 87 | } |
88 | video::SMaterial Material; | 88 | video::SMaterial Material; |
89 | f32 red, green, blue, alpha; | 89 | f32 red, green, blue, alpha; |
90 | f32 shininess; | 90 | f32 shininess; |
91 | s32 blend,fx; | 91 | s32 blend,fx; |
92 | SB3dTexture *Textures[video::MATERIAL_MAX_TEXTURES]; | 92 | SB3dTexture *Textures[video::MATERIAL_MAX_TEXTURES]; |
93 | }; | 93 | }; |
94 | 94 | ||
95 | bool load(); | 95 | bool load(); |
96 | bool readChunkNODE(CSkinnedMesh::SJoint* InJoint); | 96 | bool readChunkNODE(CSkinnedMesh::SJoint* InJoint); |
97 | bool readChunkMESH(CSkinnedMesh::SJoint* InJoint); | 97 | bool readChunkMESH(CSkinnedMesh::SJoint* InJoint); |
98 | bool readChunkVRTS(CSkinnedMesh::SJoint* InJoint); | 98 | bool readChunkVRTS(CSkinnedMesh::SJoint* InJoint); |
99 | bool readChunkTRIS(scene::SSkinMeshBuffer *MeshBuffer, u32 MeshBufferID, s32 Vertices_Start); | 99 | bool readChunkTRIS(scene::SSkinMeshBuffer *MeshBuffer, u32 MeshBufferID, s32 Vertices_Start); |
100 | bool readChunkBONE(CSkinnedMesh::SJoint* InJoint); | 100 | bool readChunkBONE(CSkinnedMesh::SJoint* InJoint); |
101 | bool readChunkKEYS(CSkinnedMesh::SJoint* InJoint); | 101 | bool readChunkKEYS(CSkinnedMesh::SJoint* InJoint); |
102 | bool readChunkANIM(); | 102 | bool readChunkANIM(); |
103 | bool readChunkTEXS(); | 103 | bool readChunkTEXS(); |
104 | bool readChunkBRUS(); | 104 | bool readChunkBRUS(); |
105 | 105 | ||
106 | void loadTextures(SB3dMaterial& material) const; | 106 | void loadTextures(SB3dMaterial& material) const; |
107 | 107 | ||
108 | void readString(core::stringc& newstring); | 108 | void readString(core::stringc& newstring); |
109 | void readFloats(f32* vec, u32 count); | 109 | void readFloats(f32* vec, u32 count); |
110 | 110 | ||
111 | core::array<SB3dChunk> B3dStack; | 111 | core::array<SB3dChunk> B3dStack; |
112 | 112 | ||
113 | core::array<SB3dMaterial> Materials; | 113 | core::array<SB3dMaterial> Materials; |
114 | core::array<SB3dTexture> Textures; | 114 | core::array<SB3dTexture> Textures; |
115 | 115 | ||
116 | core::array<s32> AnimatedVertices_VertexID; | 116 | core::array<s32> AnimatedVertices_VertexID; |
117 | 117 | ||
118 | core::array<s32> AnimatedVertices_BufferID; | 118 | core::array<s32> AnimatedVertices_BufferID; |
119 | 119 | ||
120 | core::array<video::S3DVertex2TCoords> BaseVertices; | 120 | core::array<video::S3DVertex2TCoords> BaseVertices; |
121 | 121 | ||
122 | ISceneManager* SceneManager; | 122 | ISceneManager* SceneManager; |
123 | CSkinnedMesh* AnimatedMesh; | 123 | CSkinnedMesh* AnimatedMesh; |
124 | io::IReadFile* B3DFile; | 124 | io::IReadFile* B3DFile; |
125 | 125 | ||
126 | //B3Ds have Vertex ID's local within the mesh I don't want this | 126 | //B3Ds have Vertex ID's local within the mesh I don't want this |
127 | // Variable needs to be class member due to recursion in calls | 127 | // Variable needs to be class member due to recursion in calls |
128 | u32 VerticesStart; | 128 | u32 VerticesStart; |
129 | 129 | ||
130 | bool NormalsInFile; | 130 | bool NormalsInFile; |
131 | bool HasVertexColors; | 131 | bool HasVertexColors; |
132 | bool ShowWarning; | 132 | bool ShowWarning; |
133 | }; | 133 | }; |
134 | 134 | ||
135 | 135 | ||
136 | } // end namespace scene | 136 | } // end namespace scene |
137 | } // end namespace irr | 137 | } // end namespace irr |
138 | 138 | ||
139 | #endif // __C_B3D_MESH_LOADER_H_INCLUDED__ | 139 | #endif // __C_B3D_MESH_LOADER_H_INCLUDED__ |
140 | 140 | ||