aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/source/Irrlicht/COCTLoader.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2013-01-13 18:54:10 +1000
committerDavid Walter Seikel2013-01-13 18:54:10 +1000
commit959831f4ef5a3e797f576c3de08cd65032c997ad (patch)
treee7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/source/Irrlicht/COCTLoader.h
parentAdd info about changes to Irrlicht. (diff)
downloadSledjHamr-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/COCTLoader.h282
1 files changed, 141 insertions, 141 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/COCTLoader.h b/libraries/irrlicht-1.8/source/Irrlicht/COCTLoader.h
index 57eef61..9a184c4 100644
--- a/libraries/irrlicht-1.8/source/Irrlicht/COCTLoader.h
+++ b/libraries/irrlicht-1.8/source/Irrlicht/COCTLoader.h
@@ -1,141 +1,141 @@
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// Because I (Nikolaus Gebhardt) did some changes to Murphy McCauley's loader, 5// Because I (Nikolaus Gebhardt) did some changes to Murphy McCauley's loader,
6// I'm writing this down here: 6// I'm writing this down here:
7// - Replaced all dependencies to STL and stdio with irr:: methods/constructs 7// - Replaced all dependencies to STL and stdio with irr:: methods/constructs
8// - Disabled logging define 8// - Disabled logging define
9// - Changed some minor things (Don't remember what exactly.) 9// - Changed some minor things (Don't remember what exactly.)
10// Thanks a lot to Murphy McCauley for writing this loader. 10// Thanks a lot to Murphy McCauley for writing this loader.
11 11
12// 12//
13// COCTLoader by Murphy McCauley (February 2005) 13// COCTLoader by Murphy McCauley (February 2005)
14// An Irrlicht loader for OCT files 14// An Irrlicht loader for OCT files
15// 15//
16// OCT file format information comes from the sourcecode of the Fluid Studios 16// OCT file format information comes from the sourcecode of the Fluid Studios
17// Radiosity Processor by Paul Nettle. You can get that sourcecode from 17// Radiosity Processor by Paul Nettle. You can get that sourcecode from
18// http://www.fluidstudios.com . 18// http://www.fluidstudios.com .
19// 19//
20// Parts of this code are from Irrlicht's CQ3LevelMesh and C3DSMeshFileLoader, 20// Parts of this code are from Irrlicht's CQ3LevelMesh and C3DSMeshFileLoader,
21// and are Copyright (C) 2002-2004 Nikolaus Gebhardt. 21// and are Copyright (C) 2002-2004 Nikolaus Gebhardt.
22// 22//
23// Use of this code is subject to the following: 23// Use of this code is subject to the following:
24// 24//
25// This software is provided 'as-is', without any express or implied 25// This software is provided 'as-is', without any express or implied
26// warranty. In no event will the authors be held liable for any damages 26// warranty. In no event will the authors be held liable for any damages
27// arising from the use of this software. 27// arising from the use of this software.
28// 28//
29// Permission is granted to anyone to use this software for any purpose, 29// Permission is granted to anyone to use this software for any purpose,
30// including commercial applications, and to alter it and redistribute it 30// including commercial applications, and to alter it and redistribute it
31// freely, subject to the following restrictions: 31// freely, subject to the following restrictions:
32// 32//
33// 1. The origin of this software must not be misrepresented; you must not 33// 1. The origin of this software must not be misrepresented; you must not
34// claim that you wrote the original software. If you use this software 34// claim that you wrote the original software. If you use this software
35// in a product, an acknowledgment in the product documentation would be 35// in a product, an acknowledgment in the product documentation would be
36// appreciated but is not required. 36// appreciated but is not required.
37// 2. Altered source versions must be plainly marked as such, and must not be 37// 2. Altered source versions must be plainly marked as such, and must not be
38// misrepresented as being the original software. 38// misrepresented as being the original software.
39// 3. This notice may not be removed or altered from any source distribution. 39// 3. This notice may not be removed or altered from any source distribution.
40// 4. You may not use this software to directly or indirectly cause harm to others. 40// 4. You may not use this software to directly or indirectly cause harm to others.
41 41
42 42
43#ifndef __C_OCT_LOADER_H_INCLUDED__ 43#ifndef __C_OCT_LOADER_H_INCLUDED__
44#define __C_OCT_LOADER_H_INCLUDED__ 44#define __C_OCT_LOADER_H_INCLUDED__
45 45
46#include "IMeshLoader.h" 46#include "IMeshLoader.h"
47#include "IReadFile.h" 47#include "IReadFile.h"
48#include "SMesh.h" 48#include "SMesh.h"
49#include "irrString.h" 49#include "irrString.h"
50 50
51namespace irr 51namespace irr
52{ 52{
53namespace io 53namespace io
54{ 54{
55 class IFileSystem; 55 class IFileSystem;
56} // end namespace io 56} // end namespace io
57namespace scene 57namespace scene
58{ 58{
59 class ISceneManager; 59 class ISceneManager;
60 class ISceneNode; 60 class ISceneNode;
61 61
62 class COCTLoader : public IMeshLoader 62 class COCTLoader : public IMeshLoader
63 { 63 {
64 public: 64 public:
65 //! constructor 65 //! constructor
66 COCTLoader(ISceneManager* smgr, io::IFileSystem* fs); 66 COCTLoader(ISceneManager* smgr, io::IFileSystem* fs);
67 67
68 //! destructor 68 //! destructor
69 virtual ~COCTLoader(); 69 virtual ~COCTLoader();
70 70
71 //! returns true if the file maybe is able to be loaded by this class 71 //! returns true if the file maybe is able to be loaded by this class
72 //! based on the file extension (e.g. ".cob") 72 //! based on the file extension (e.g. ".cob")
73 virtual bool isALoadableFileExtension(const io::path& filename) const; 73 virtual bool isALoadableFileExtension(const io::path& filename) const;
74 74
75 //! creates/loads an animated mesh from the file. 75 //! creates/loads an animated mesh from the file.
76 //! \return Pointer to the created mesh. Returns 0 if loading failed. 76 //! \return Pointer to the created mesh. Returns 0 if loading failed.
77 //! If you no longer need the mesh, you should call IAnimatedMesh::drop(). 77 //! If you no longer need the mesh, you should call IAnimatedMesh::drop().
78 //! See IReferenceCounted::drop() for more information. 78 //! See IReferenceCounted::drop() for more information.
79 virtual IAnimatedMesh* createMesh(io::IReadFile* file); 79 virtual IAnimatedMesh* createMesh(io::IReadFile* file);
80 80
81 void OCTLoadLights(io::IReadFile* file, 81 void OCTLoadLights(io::IReadFile* file,
82 ISceneNode * parent = 0, f32 radius = 500.0f, 82 ISceneNode * parent = 0, f32 radius = 500.0f,
83 f32 intensityScale = 0.0000001f*2.5, 83 f32 intensityScale = 0.0000001f*2.5,
84 bool rewind = true); 84 bool rewind = true);
85 85
86 private: 86 private:
87 struct octHeader { 87 struct octHeader {
88 u32 numVerts; 88 u32 numVerts;
89 u32 numFaces; 89 u32 numFaces;
90 u32 numTextures; 90 u32 numTextures;
91 u32 numLightmaps; 91 u32 numLightmaps;
92 u32 numLights; 92 u32 numLights;
93 }; 93 };
94 94
95 struct octHeaderEx { 95 struct octHeaderEx {
96 u32 magic; // 'OCTX' - 0x4F435458L 96 u32 magic; // 'OCTX' - 0x4F435458L
97 u32 numLightmaps; 97 u32 numLightmaps;
98 u32 lightmapWidth; 98 u32 lightmapWidth;
99 u32 lightmapHeight; 99 u32 lightmapHeight;
100 u32 containsVertexNormals; 100 u32 containsVertexNormals;
101 }; 101 };
102 102
103 struct octFace { 103 struct octFace {
104 u32 firstVert; 104 u32 firstVert;
105 u32 numVerts; 105 u32 numVerts;
106 u32 textureID; 106 u32 textureID;
107 u32 lightmapID; 107 u32 lightmapID;
108 f32 plane[4]; 108 f32 plane[4];
109 }; 109 };
110 110
111 struct octVert { 111 struct octVert {
112 f32 tc[2]; 112 f32 tc[2];
113 f32 lc[2]; 113 f32 lc[2];
114 f32 pos[3]; 114 f32 pos[3];
115 }; 115 };
116 116
117 struct octTexture { 117 struct octTexture {
118 u32 id; 118 u32 id;
119 char fileName[64]; 119 char fileName[64];
120 }; 120 };
121 121
122 struct octLightmap { 122 struct octLightmap {
123 u32 id; 123 u32 id;
124 u8 data[128][128][3]; 124 u8 data[128][128][3];
125 }; 125 };
126 126
127 struct octLight { 127 struct octLight {
128 f32 pos[3]; 128 f32 pos[3];
129 f32 color[3]; 129 f32 color[3];
130 u32 intensity; 130 u32 intensity;
131 }; 131 };
132 132
133 ISceneManager* SceneManager; 133 ISceneManager* SceneManager;
134 io::IFileSystem* FileSystem; 134 io::IFileSystem* FileSystem;
135 }; 135 };
136 136
137} // end namespace scene 137} // end namespace scene
138} // end namespace irr 138} // end namespace irr
139 139
140#endif 140#endif
141 141