aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/include
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/include
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 'libraries/irrlicht-1.8/include')
-rw-r--r--libraries/irrlicht-1.8/include/CDynamicMeshBuffer.h232
-rw-r--r--libraries/irrlicht-1.8/include/CIndexBuffer.h452
-rw-r--r--libraries/irrlicht-1.8/include/CMeshBuffer.h602
-rw-r--r--libraries/irrlicht-1.8/include/CVertexBuffer.h420
-rw-r--r--libraries/irrlicht-1.8/include/EAttributes.h202
-rw-r--r--libraries/irrlicht-1.8/include/ECullingTypes.h82
-rw-r--r--libraries/irrlicht-1.8/include/EDebugSceneTypes.h100
-rw-r--r--libraries/irrlicht-1.8/include/EDeviceTypes.h120
-rw-r--r--libraries/irrlicht-1.8/include/EDriverFeatures.h266
-rw-r--r--libraries/irrlicht-1.8/include/EDriverTypes.h128
-rw-r--r--libraries/irrlicht-1.8/include/EGUIAlignment.h76
-rw-r--r--libraries/irrlicht-1.8/include/EGUIElementTypes.h280
-rw-r--r--libraries/irrlicht-1.8/include/EHardwareBufferFlags.h88
-rw-r--r--libraries/irrlicht-1.8/include/EMaterialFlags.h190
-rw-r--r--libraries/irrlicht-1.8/include/EMaterialTypes.h468
-rw-r--r--libraries/irrlicht-1.8/include/EMeshWriterEnums.h118
-rw-r--r--libraries/irrlicht-1.8/include/EMessageBoxFlags.h72
-rw-r--r--libraries/irrlicht-1.8/include/EPrimitiveTypes.h112
-rw-r--r--libraries/irrlicht-1.8/include/ESceneNodeAnimatorTypes.h116
-rw-r--r--libraries/irrlicht-1.8/include/ESceneNodeTypes.h212
-rw-r--r--libraries/irrlicht-1.8/include/EShaderTypes.h180
-rw-r--r--libraries/irrlicht-1.8/include/ETerrainElements.h72
-rw-r--r--libraries/irrlicht-1.8/include/IAnimatedMesh.h230
-rw-r--r--libraries/irrlicht-1.8/include/IAnimatedMeshMD2.h158
-rw-r--r--libraries/irrlicht-1.8/include/IAnimatedMeshMD3.h608
-rw-r--r--libraries/irrlicht-1.8/include/IAnimatedMeshSceneNode.h456
-rw-r--r--libraries/irrlicht-1.8/include/IAttributeExchangingObject.h142
-rw-r--r--libraries/irrlicht-1.8/include/IAttributes.h1476
-rw-r--r--libraries/irrlicht-1.8/include/IBillboardSceneNode.h150
-rw-r--r--libraries/irrlicht-1.8/include/IBillboardTextSceneNode.h124
-rw-r--r--libraries/irrlicht-1.8/include/IBoneSceneNode.h216
-rw-r--r--libraries/irrlicht-1.8/include/ICameraSceneNode.h414
-rw-r--r--libraries/irrlicht-1.8/include/IColladaMeshWriter.h808
-rw-r--r--libraries/irrlicht-1.8/include/ICursorControl.h384
-rw-r--r--libraries/irrlicht-1.8/include/IDummyTransformationSceneNode.h84
-rw-r--r--libraries/irrlicht-1.8/include/IDynamicMeshBuffer.h422
-rw-r--r--libraries/irrlicht-1.8/include/IEventReceiver.h980
-rw-r--r--libraries/irrlicht-1.8/include/IFileArchive.h264
-rw-r--r--libraries/irrlicht-1.8/include/IFileList.h188
-rw-r--r--libraries/irrlicht-1.8/include/IFileSystem.h770
-rw-r--r--libraries/irrlicht-1.8/include/IGPUProgrammingServices.h948
-rw-r--r--libraries/irrlicht-1.8/include/IGUIButton.h302
-rw-r--r--libraries/irrlicht-1.8/include/IGUICheckBox.h76
-rw-r--r--libraries/irrlicht-1.8/include/IGUIColorSelectDialog.h60
-rw-r--r--libraries/irrlicht-1.8/include/IGUIComboBox.h148
-rw-r--r--libraries/irrlicht-1.8/include/IGUIContextMenu.h324
-rw-r--r--libraries/irrlicht-1.8/include/IGUIEditBox.h270
-rw-r--r--libraries/irrlicht-1.8/include/IGUIElement.h2074
-rw-r--r--libraries/irrlicht-1.8/include/IGUIElementFactory.h132
-rw-r--r--libraries/irrlicht-1.8/include/IGUIEnvironment.h1240
-rw-r--r--libraries/irrlicht-1.8/include/IGUIFileOpenDialog.h88
-rw-r--r--libraries/irrlicht-1.8/include/IGUIFont.h208
-rw-r--r--libraries/irrlicht-1.8/include/IGUIFontBitmap.h92
-rw-r--r--libraries/irrlicht-1.8/include/IGUIImage.h116
-rw-r--r--libraries/irrlicht-1.8/include/IGUIImageList.h90
-rw-r--r--libraries/irrlicht-1.8/include/IGUIInOutFader.h134
-rw-r--r--libraries/irrlicht-1.8/include/IGUIListBox.h276
-rw-r--r--libraries/irrlicht-1.8/include/IGUIMeshViewer.h106
-rw-r--r--libraries/irrlicht-1.8/include/IGUIScrollBar.h130
-rw-r--r--libraries/irrlicht-1.8/include/IGUISkin.h1148
-rw-r--r--libraries/irrlicht-1.8/include/IGUISpinBox.h138
-rw-r--r--libraries/irrlicht-1.8/include/IGUISpriteBank.h190
-rw-r--r--libraries/irrlicht-1.8/include/IGUIStaticText.h270
-rw-r--r--libraries/irrlicht-1.8/include/IGUITabControl.h272
-rw-r--r--libraries/irrlicht-1.8/include/IGUITable.h410
-rw-r--r--libraries/irrlicht-1.8/include/IGUIToolbar.h80
-rw-r--r--libraries/irrlicht-1.8/include/IGUITreeView.h556
-rw-r--r--libraries/irrlicht-1.8/include/IGUIWindow.h148
-rw-r--r--libraries/irrlicht-1.8/include/IGeometryCreator.h354
-rw-r--r--libraries/irrlicht-1.8/include/IImage.h310
-rw-r--r--libraries/irrlicht-1.8/include/IImageLoader.h106
-rw-r--r--libraries/irrlicht-1.8/include/IImageWriter.h90
-rw-r--r--libraries/irrlicht-1.8/include/IIndexBuffer.h130
-rw-r--r--libraries/irrlicht-1.8/include/ILightManager.h124
-rw-r--r--libraries/irrlicht-1.8/include/ILightSceneNode.h172
-rw-r--r--libraries/irrlicht-1.8/include/ILogger.h204
-rw-r--r--libraries/irrlicht-1.8/include/IMaterialRenderer.h202
-rw-r--r--libraries/irrlicht-1.8/include/IMaterialRendererServices.h230
-rw-r--r--libraries/irrlicht-1.8/include/IMesh.h150
-rw-r--r--libraries/irrlicht-1.8/include/IMeshBuffer.h308
-rw-r--r--libraries/irrlicht-1.8/include/IMeshCache.h354
-rw-r--r--libraries/irrlicht-1.8/include/IMeshLoader.h106
-rw-r--r--libraries/irrlicht-1.8/include/IMeshManipulator.h786
-rw-r--r--libraries/irrlicht-1.8/include/IMeshSceneNode.h158
-rw-r--r--libraries/irrlicht-1.8/include/IMeshWriter.h116
-rw-r--r--libraries/irrlicht-1.8/include/IMetaTriangleSelector.h86
-rw-r--r--libraries/irrlicht-1.8/include/IOSOperator.h100
-rw-r--r--libraries/irrlicht-1.8/include/IParticleAffector.h144
-rw-r--r--libraries/irrlicht-1.8/include/IParticleAnimatedMeshSceneNodeEmitter.h108
-rw-r--r--libraries/irrlicht-1.8/include/IParticleAttractionAffector.h118
-rw-r--r--libraries/irrlicht-1.8/include/IParticleBoxEmitter.h72
-rw-r--r--libraries/irrlicht-1.8/include/IParticleCylinderEmitter.h118
-rw-r--r--libraries/irrlicht-1.8/include/IParticleEmitter.h258
-rw-r--r--libraries/irrlicht-1.8/include/IParticleFadeOutAffector.h82
-rw-r--r--libraries/irrlicht-1.8/include/IParticleGravityAffector.h84
-rw-r--r--libraries/irrlicht-1.8/include/IParticleMeshEmitter.h108
-rw-r--r--libraries/irrlicht-1.8/include/IParticleRingEmitter.h94
-rw-r--r--libraries/irrlicht-1.8/include/IParticleRotationAffector.h82
-rw-r--r--libraries/irrlicht-1.8/include/IParticleSphereEmitter.h82
-rw-r--r--libraries/irrlicht-1.8/include/IParticleSystemSceneNode.h1024
-rw-r--r--libraries/irrlicht-1.8/include/IQ3LevelMesh.h92
-rw-r--r--libraries/irrlicht-1.8/include/IQ3Shader.h1768
-rw-r--r--libraries/irrlicht-1.8/include/IRandomizer.h66
-rw-r--r--libraries/irrlicht-1.8/include/IReadFile.h116
-rw-r--r--libraries/irrlicht-1.8/include/IReferenceCounted.h340
-rw-r--r--libraries/irrlicht-1.8/include/ISceneCollisionManager.h410
-rw-r--r--libraries/irrlicht-1.8/include/ISceneLoader.h124
-rw-r--r--libraries/irrlicht-1.8/include/ISceneManager.h3326
-rw-r--r--libraries/irrlicht-1.8/include/ISceneNode.h1716
-rw-r--r--libraries/irrlicht-1.8/include/ISceneNodeAnimator.h156
-rw-r--r--libraries/irrlicht-1.8/include/ISceneNodeAnimatorCameraFPS.h138
-rw-r--r--libraries/irrlicht-1.8/include/ISceneNodeAnimatorCameraMaya.h116
-rw-r--r--libraries/irrlicht-1.8/include/ISceneNodeAnimatorCollisionResponse.h342
-rw-r--r--libraries/irrlicht-1.8/include/ISceneNodeAnimatorFactory.h138
-rw-r--r--libraries/irrlicht-1.8/include/ISceneNodeFactory.h136
-rw-r--r--libraries/irrlicht-1.8/include/ISceneUserDataSerializer.h102
-rw-r--r--libraries/irrlicht-1.8/include/IShaderConstantSetCallBack.h170
-rw-r--r--libraries/irrlicht-1.8/include/IShadowVolumeSceneNode.h76
-rw-r--r--libraries/irrlicht-1.8/include/ISkinnedMesh.h438
-rw-r--r--libraries/irrlicht-1.8/include/ITerrainSceneNode.h364
-rw-r--r--libraries/irrlicht-1.8/include/ITextSceneNode.h74
-rw-r--r--libraries/irrlicht-1.8/include/ITexture.h438
-rw-r--r--libraries/irrlicht-1.8/include/ITimer.h206
-rw-r--r--libraries/irrlicht-1.8/include/ITriangleSelector.h262
-rw-r--r--libraries/irrlicht-1.8/include/IVertexBuffer.h104
-rw-r--r--libraries/irrlicht-1.8/include/IVideoDriver.h2942
-rw-r--r--libraries/irrlicht-1.8/include/IVideoModeList.h124
-rw-r--r--libraries/irrlicht-1.8/include/IVolumeLightSceneNode.h120
-rw-r--r--libraries/irrlicht-1.8/include/IWriteFile.h100
-rw-r--r--libraries/irrlicht-1.8/include/IXMLReader.h62
-rw-r--r--libraries/irrlicht-1.8/include/IXMLWriter.h154
-rw-r--r--libraries/irrlicht-1.8/include/IrrCompileConfig.h1592
-rw-r--r--libraries/irrlicht-1.8/include/IrrlichtDevice.h644
-rw-r--r--libraries/irrlicht-1.8/include/Keycodes.h346
-rw-r--r--libraries/irrlicht-1.8/include/S3DVertex.h548
-rw-r--r--libraries/irrlicht-1.8/include/SAnimatedMesh.h378
-rw-r--r--libraries/irrlicht-1.8/include/SColor.h1394
-rw-r--r--libraries/irrlicht-1.8/include/SExposedVideoData.h180
-rw-r--r--libraries/irrlicht-1.8/include/SIrrCreationParameters.h602
-rw-r--r--libraries/irrlicht-1.8/include/SKeyMap.h82
-rw-r--r--libraries/irrlicht-1.8/include/SLight.h196
-rw-r--r--libraries/irrlicht-1.8/include/SMaterial.h1370
-rw-r--r--libraries/irrlicht-1.8/include/SMaterialLayer.h456
-rw-r--r--libraries/irrlicht-1.8/include/SMesh.h280
-rw-r--r--libraries/irrlicht-1.8/include/SMeshBuffer.h14
-rw-r--r--libraries/irrlicht-1.8/include/SMeshBufferLightMap.h14
-rw-r--r--libraries/irrlicht-1.8/include/SMeshBufferTangents.h14
-rw-r--r--libraries/irrlicht-1.8/include/SParticle.h112
-rw-r--r--libraries/irrlicht-1.8/include/SSharedMeshBuffer.h484
-rw-r--r--libraries/irrlicht-1.8/include/SSkinMeshBuffer.h808
-rw-r--r--libraries/irrlicht-1.8/include/SVertexIndex.h158
-rw-r--r--libraries/irrlicht-1.8/include/SVertexManipulator.h584
-rw-r--r--libraries/irrlicht-1.8/include/SViewFrustum.h740
-rw-r--r--libraries/irrlicht-1.8/include/SceneParameters.h364
-rw-r--r--libraries/irrlicht-1.8/include/aabbox3d.h664
-rw-r--r--libraries/irrlicht-1.8/include/coreutil.h376
-rw-r--r--libraries/irrlicht-1.8/include/dimension2d.h448
-rw-r--r--libraries/irrlicht-1.8/include/driverChoice.h90
-rw-r--r--libraries/irrlicht-1.8/include/fast_atof.h728
-rw-r--r--libraries/irrlicht-1.8/include/heapsort.h140
-rw-r--r--libraries/irrlicht-1.8/include/irrAllocator.h248
-rw-r--r--libraries/irrlicht-1.8/include/irrArray.h1254
-rw-r--r--libraries/irrlicht-1.8/include/irrList.h832
-rw-r--r--libraries/irrlicht-1.8/include/irrMap.h2254
-rw-r--r--libraries/irrlicht-1.8/include/irrMath.h1462
-rw-r--r--libraries/irrlicht-1.8/include/irrString.h2736
-rw-r--r--libraries/irrlicht-1.8/include/irrTypes.h500
-rw-r--r--libraries/irrlicht-1.8/include/irrXML.h1132
-rw-r--r--libraries/irrlicht-1.8/include/irrlicht.h788
-rw-r--r--libraries/irrlicht-1.8/include/irrpack.h78
-rw-r--r--libraries/irrlicht-1.8/include/irrunpack.h40
-rw-r--r--libraries/irrlicht-1.8/include/line2d.h548
-rw-r--r--libraries/irrlicht-1.8/include/line3d.h288
-rw-r--r--libraries/irrlicht-1.8/include/matrix4.h4484
-rw-r--r--libraries/irrlicht-1.8/include/path.h176
-rw-r--r--libraries/irrlicht-1.8/include/plane3d.h490
-rw-r--r--libraries/irrlicht-1.8/include/position2d.h64
-rw-r--r--libraries/irrlicht-1.8/include/quaternion.h1392
-rw-r--r--libraries/irrlicht-1.8/include/rect.h558
-rw-r--r--libraries/irrlicht-1.8/include/triangle3d.h558
-rw-r--r--libraries/irrlicht-1.8/include/vector2d.h684
-rw-r--r--libraries/irrlicht-1.8/include/vector3d.h916
182 files changed, 39478 insertions, 39478 deletions
diff --git a/libraries/irrlicht-1.8/include/CDynamicMeshBuffer.h b/libraries/irrlicht-1.8/include/CDynamicMeshBuffer.h
index 9b08f36..016af9c 100644
--- a/libraries/irrlicht-1.8/include/CDynamicMeshBuffer.h
+++ b/libraries/irrlicht-1.8/include/CDynamicMeshBuffer.h
@@ -1,116 +1,116 @@
1// Copyright (C) 2008-2012 Nikolaus Gebhardt 1// Copyright (C) 2008-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#ifndef __C_DYNAMIC_MESHBUFFER_H_INCLUDED__ 5#ifndef __C_DYNAMIC_MESHBUFFER_H_INCLUDED__
6#define __C_DYNAMIC_MESHBUFFER_H_INCLUDED__ 6#define __C_DYNAMIC_MESHBUFFER_H_INCLUDED__
7 7
8#include "IDynamicMeshBuffer.h" 8#include "IDynamicMeshBuffer.h"
9 9
10#include "CVertexBuffer.h" 10#include "CVertexBuffer.h"
11#include "CIndexBuffer.h" 11#include "CIndexBuffer.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace scene 15namespace scene
16{ 16{
17 17
18 class CDynamicMeshBuffer: public IDynamicMeshBuffer 18 class CDynamicMeshBuffer: public IDynamicMeshBuffer
19 { 19 {
20 public: 20 public:
21 //! constructor 21 //! constructor
22 CDynamicMeshBuffer(video::E_VERTEX_TYPE vertexType, video::E_INDEX_TYPE indexType) 22 CDynamicMeshBuffer(video::E_VERTEX_TYPE vertexType, video::E_INDEX_TYPE indexType)
23 { 23 {
24 VertexBuffer=new CVertexBuffer(vertexType); 24 VertexBuffer=new CVertexBuffer(vertexType);
25 IndexBuffer=new CIndexBuffer(indexType); 25 IndexBuffer=new CIndexBuffer(indexType);
26 } 26 }
27 27
28 //! destructor 28 //! destructor
29 virtual ~CDynamicMeshBuffer() 29 virtual ~CDynamicMeshBuffer()
30 { 30 {
31 if (VertexBuffer) 31 if (VertexBuffer)
32 VertexBuffer->drop(); 32 VertexBuffer->drop();
33 if (IndexBuffer) 33 if (IndexBuffer)
34 IndexBuffer->drop(); 34 IndexBuffer->drop();
35 } 35 }
36 36
37 virtual IVertexBuffer& getVertexBuffer() const 37 virtual IVertexBuffer& getVertexBuffer() const
38 { 38 {
39 return *VertexBuffer; 39 return *VertexBuffer;
40 } 40 }
41 41
42 virtual IIndexBuffer& getIndexBuffer() const 42 virtual IIndexBuffer& getIndexBuffer() const
43 { 43 {
44 return *IndexBuffer; 44 return *IndexBuffer;
45 } 45 }
46 46
47 virtual void setVertexBuffer(IVertexBuffer *newVertexBuffer) 47 virtual void setVertexBuffer(IVertexBuffer *newVertexBuffer)
48 { 48 {
49 if (newVertexBuffer) 49 if (newVertexBuffer)
50 newVertexBuffer->grab(); 50 newVertexBuffer->grab();
51 if (VertexBuffer) 51 if (VertexBuffer)
52 VertexBuffer->drop(); 52 VertexBuffer->drop();
53 53
54 VertexBuffer=newVertexBuffer; 54 VertexBuffer=newVertexBuffer;
55 } 55 }
56 56
57 virtual void setIndexBuffer(IIndexBuffer *newIndexBuffer) 57 virtual void setIndexBuffer(IIndexBuffer *newIndexBuffer)
58 { 58 {
59 if (newIndexBuffer) 59 if (newIndexBuffer)
60 newIndexBuffer->grab(); 60 newIndexBuffer->grab();
61 if (IndexBuffer) 61 if (IndexBuffer)
62 IndexBuffer->drop(); 62 IndexBuffer->drop();
63 63
64 IndexBuffer=newIndexBuffer; 64 IndexBuffer=newIndexBuffer;
65 } 65 }
66 66
67 //! Get Material of this buffer. 67 //! Get Material of this buffer.
68 virtual const video::SMaterial& getMaterial() const 68 virtual const video::SMaterial& getMaterial() const
69 { 69 {
70 return Material; 70 return Material;
71 } 71 }
72 72
73 //! Get Material of this buffer. 73 //! Get Material of this buffer.
74 virtual video::SMaterial& getMaterial() 74 virtual video::SMaterial& getMaterial()
75 { 75 {
76 return Material; 76 return Material;
77 } 77 }
78 78
79 //! Get bounding box 79 //! Get bounding box
80 virtual const core::aabbox3d<f32>& getBoundingBox() const 80 virtual const core::aabbox3d<f32>& getBoundingBox() const
81 { 81 {
82 return BoundingBox; 82 return BoundingBox;
83 } 83 }
84 84
85 //! Set bounding box 85 //! Set bounding box
86 virtual void setBoundingBox( const core::aabbox3df& box) 86 virtual void setBoundingBox( const core::aabbox3df& box)
87 { 87 {
88 BoundingBox = box; 88 BoundingBox = box;
89 } 89 }
90 90
91 //! Recalculate bounding box 91 //! Recalculate bounding box
92 virtual void recalculateBoundingBox() 92 virtual void recalculateBoundingBox()
93 { 93 {
94 if (!getVertexBuffer().size()) 94 if (!getVertexBuffer().size())
95 BoundingBox.reset(0,0,0); 95 BoundingBox.reset(0,0,0);
96 else 96 else
97 { 97 {
98 BoundingBox.reset(getVertexBuffer()[0].Pos); 98 BoundingBox.reset(getVertexBuffer()[0].Pos);
99 for (u32 i=1; i<getVertexBuffer().size(); ++i) 99 for (u32 i=1; i<getVertexBuffer().size(); ++i)
100 BoundingBox.addInternalPoint(getVertexBuffer()[i].Pos); 100 BoundingBox.addInternalPoint(getVertexBuffer()[i].Pos);
101 } 101 }
102 } 102 }
103 103
104 video::SMaterial Material; 104 video::SMaterial Material;
105 core::aabbox3d<f32> BoundingBox; 105 core::aabbox3d<f32> BoundingBox;
106 private: 106 private:
107 IVertexBuffer *VertexBuffer; 107 IVertexBuffer *VertexBuffer;
108 IIndexBuffer *IndexBuffer; 108 IIndexBuffer *IndexBuffer;
109 }; 109 };
110 110
111 111
112} // end namespace scene 112} // end namespace scene
113} // end namespace irr 113} // end namespace irr
114 114
115#endif 115#endif
116 116
diff --git a/libraries/irrlicht-1.8/include/CIndexBuffer.h b/libraries/irrlicht-1.8/include/CIndexBuffer.h
index b0bb436..4ecadb7 100644
--- a/libraries/irrlicht-1.8/include/CIndexBuffer.h
+++ b/libraries/irrlicht-1.8/include/CIndexBuffer.h
@@ -1,226 +1,226 @@
1// Copyright (C) 2008-2012 Nikolaus Gebhardt 1// Copyright (C) 2008-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#ifndef __C_INDEX_BUFFER_H_INCLUDED__ 5#ifndef __C_INDEX_BUFFER_H_INCLUDED__
6#define __C_INDEX_BUFFER_H_INCLUDED__ 6#define __C_INDEX_BUFFER_H_INCLUDED__
7 7
8#include "IIndexBuffer.h" 8#include "IIndexBuffer.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15 class CIndexBuffer : public IIndexBuffer 15 class CIndexBuffer : public IIndexBuffer
16 { 16 {
17 17
18 class IIndexList 18 class IIndexList
19 { 19 {
20 public: 20 public:
21 virtual ~IIndexList(){}; 21 virtual ~IIndexList(){};
22 22
23 virtual u32 stride() const =0; 23 virtual u32 stride() const =0;
24 virtual u32 size() const =0; 24 virtual u32 size() const =0;
25 virtual void push_back(const u32 &element) =0; 25 virtual void push_back(const u32 &element) =0;
26 virtual u32 operator [](u32 index) const =0; 26 virtual u32 operator [](u32 index) const =0;
27 virtual u32 getLast() =0; 27 virtual u32 getLast() =0;
28 virtual void setValue(u32 index, u32 value) =0; 28 virtual void setValue(u32 index, u32 value) =0;
29 virtual void set_used(u32 usedNow) =0; 29 virtual void set_used(u32 usedNow) =0;
30 virtual void reallocate(u32 new_size) =0; 30 virtual void reallocate(u32 new_size) =0;
31 virtual u32 allocated_size() const =0; 31 virtual u32 allocated_size() const =0;
32 virtual void* pointer() =0; 32 virtual void* pointer() =0;
33 virtual video::E_INDEX_TYPE getType() const =0; 33 virtual video::E_INDEX_TYPE getType() const =0;
34 }; 34 };
35 35
36 template <class T> 36 template <class T>
37 class CSpecificIndexList : public IIndexList 37 class CSpecificIndexList : public IIndexList
38 { 38 {
39 public: 39 public:
40 core::array<T> Indices; 40 core::array<T> Indices;
41 41
42 virtual u32 stride() const {return sizeof(T);} 42 virtual u32 stride() const {return sizeof(T);}
43 43
44 virtual u32 size() const {return Indices.size();} 44 virtual u32 size() const {return Indices.size();}
45 45
46 virtual void push_back(const u32 &element) 46 virtual void push_back(const u32 &element)
47 { 47 {
48 // push const ref due to compiler problem with gcc 4.6, big endian 48 // push const ref due to compiler problem with gcc 4.6, big endian
49 Indices.push_back((const T&)element); 49 Indices.push_back((const T&)element);
50 } 50 }
51 51
52 virtual u32 operator [](u32 index) const 52 virtual u32 operator [](u32 index) const
53 { 53 {
54 return (u32)(Indices[index]); 54 return (u32)(Indices[index]);
55 } 55 }
56 56
57 virtual u32 getLast() {return (u32)Indices.getLast();} 57 virtual u32 getLast() {return (u32)Indices.getLast();}
58 58
59 virtual void setValue(u32 index, u32 value) 59 virtual void setValue(u32 index, u32 value)
60 { 60 {
61 Indices[index]=(T)value; 61 Indices[index]=(T)value;
62 } 62 }
63 63
64 virtual void set_used(u32 usedNow) 64 virtual void set_used(u32 usedNow)
65 { 65 {
66 Indices.set_used(usedNow); 66 Indices.set_used(usedNow);
67 } 67 }
68 68
69 virtual void reallocate(u32 new_size) 69 virtual void reallocate(u32 new_size)
70 { 70 {
71 Indices.reallocate(new_size); 71 Indices.reallocate(new_size);
72 } 72 }
73 73
74 virtual u32 allocated_size() const 74 virtual u32 allocated_size() const
75 { 75 {
76 return Indices.allocated_size(); 76 return Indices.allocated_size();
77 } 77 }
78 78
79 virtual void* pointer() {return Indices.pointer();} 79 virtual void* pointer() {return Indices.pointer();}
80 80
81 virtual video::E_INDEX_TYPE getType() const 81 virtual video::E_INDEX_TYPE getType() const
82 { 82 {
83 if (sizeof(T)==sizeof(u16)) 83 if (sizeof(T)==sizeof(u16))
84 return video::EIT_16BIT; 84 return video::EIT_16BIT;
85 else 85 else
86 return video::EIT_32BIT; 86 return video::EIT_32BIT;
87 } 87 }
88 }; 88 };
89 89
90 public: 90 public:
91 IIndexList *Indices; 91 IIndexList *Indices;
92 92
93 CIndexBuffer(video::E_INDEX_TYPE IndexType) :Indices(0), MappingHint(EHM_NEVER), ChangedID(1) 93 CIndexBuffer(video::E_INDEX_TYPE IndexType) :Indices(0), MappingHint(EHM_NEVER), ChangedID(1)
94 { 94 {
95 setType(IndexType); 95 setType(IndexType);
96 } 96 }
97 97
98 CIndexBuffer(const IIndexBuffer &IndexBufferCopy) :Indices(0), MappingHint(EHM_NEVER), ChangedID(1) 98 CIndexBuffer(const IIndexBuffer &IndexBufferCopy) :Indices(0), MappingHint(EHM_NEVER), ChangedID(1)
99 { 99 {
100 setType(IndexBufferCopy.getType()); 100 setType(IndexBufferCopy.getType());
101 reallocate(IndexBufferCopy.size()); 101 reallocate(IndexBufferCopy.size());
102 102
103 for (u32 n=0;n<IndexBufferCopy.size();++n) 103 for (u32 n=0;n<IndexBufferCopy.size();++n)
104 push_back(IndexBufferCopy[n]); 104 push_back(IndexBufferCopy[n]);
105 } 105 }
106 106
107 virtual ~CIndexBuffer() 107 virtual ~CIndexBuffer()
108 { 108 {
109 delete Indices; 109 delete Indices;
110 } 110 }
111 111
112 //virtual void setType(video::E_INDEX_TYPE IndexType); 112 //virtual void setType(video::E_INDEX_TYPE IndexType);
113 virtual void setType(video::E_INDEX_TYPE IndexType) 113 virtual void setType(video::E_INDEX_TYPE IndexType)
114 { 114 {
115 IIndexList *NewIndices=0; 115 IIndexList *NewIndices=0;
116 116
117 switch (IndexType) 117 switch (IndexType)
118 { 118 {
119 case video::EIT_16BIT: 119 case video::EIT_16BIT:
120 { 120 {
121 NewIndices=new CSpecificIndexList<u16>; 121 NewIndices=new CSpecificIndexList<u16>;
122 break; 122 break;
123 } 123 }
124 case video::EIT_32BIT: 124 case video::EIT_32BIT:
125 { 125 {
126 NewIndices=new CSpecificIndexList<u32>; 126 NewIndices=new CSpecificIndexList<u32>;
127 break; 127 break;
128 } 128 }
129 } 129 }
130 130
131 if (Indices) 131 if (Indices)
132 { 132 {
133 NewIndices->reallocate( Indices->size() ); 133 NewIndices->reallocate( Indices->size() );
134 134
135 for(u32 n=0;n<Indices->size();++n) 135 for(u32 n=0;n<Indices->size();++n)
136 NewIndices->push_back((*Indices)[n]); 136 NewIndices->push_back((*Indices)[n]);
137 137
138 delete Indices; 138 delete Indices;
139 } 139 }
140 140
141 Indices=NewIndices; 141 Indices=NewIndices;
142 } 142 }
143 143
144 virtual void* getData() {return Indices->pointer();} 144 virtual void* getData() {return Indices->pointer();}
145 145
146 virtual video::E_INDEX_TYPE getType() const {return Indices->getType();} 146 virtual video::E_INDEX_TYPE getType() const {return Indices->getType();}
147 147
148 virtual u32 stride() const {return Indices->stride();} 148 virtual u32 stride() const {return Indices->stride();}
149 149
150 virtual u32 size() const 150 virtual u32 size() const
151 { 151 {
152 return Indices->size(); 152 return Indices->size();
153 } 153 }
154 154
155 virtual void push_back(const u32 &element) 155 virtual void push_back(const u32 &element)
156 { 156 {
157 Indices->push_back(element); 157 Indices->push_back(element);
158 } 158 }
159 159
160 virtual u32 operator [](u32 index) const 160 virtual u32 operator [](u32 index) const
161 { 161 {
162 return (*Indices)[index]; 162 return (*Indices)[index];
163 } 163 }
164 164
165 virtual u32 getLast() 165 virtual u32 getLast()
166 { 166 {
167 return Indices->getLast(); 167 return Indices->getLast();
168 } 168 }
169 169
170 virtual void setValue(u32 index, u32 value) 170 virtual void setValue(u32 index, u32 value)
171 { 171 {
172 Indices->setValue(index, value); 172 Indices->setValue(index, value);
173 } 173 }
174 174
175 virtual void set_used(u32 usedNow) 175 virtual void set_used(u32 usedNow)
176 { 176 {
177 Indices->set_used(usedNow); 177 Indices->set_used(usedNow);
178 } 178 }
179 179
180 virtual void reallocate(u32 new_size) 180 virtual void reallocate(u32 new_size)
181 { 181 {
182 Indices->reallocate(new_size); 182 Indices->reallocate(new_size);
183 } 183 }
184 184
185 virtual u32 allocated_size() const 185 virtual u32 allocated_size() const
186 { 186 {
187 return Indices->allocated_size(); 187 return Indices->allocated_size();
188 } 188 }
189 189
190 virtual void* pointer() 190 virtual void* pointer()
191 { 191 {
192 return Indices->pointer(); 192 return Indices->pointer();
193 } 193 }
194 194
195 //! get the current hardware mapping hint 195 //! get the current hardware mapping hint
196 virtual E_HARDWARE_MAPPING getHardwareMappingHint() const 196 virtual E_HARDWARE_MAPPING getHardwareMappingHint() const
197 { 197 {
198 return MappingHint; 198 return MappingHint;
199 } 199 }
200 200
201 //! set the hardware mapping hint, for driver 201 //! set the hardware mapping hint, for driver
202 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) 202 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint )
203 { 203 {
204 MappingHint=NewMappingHint; 204 MappingHint=NewMappingHint;
205 } 205 }
206 206
207 //! flags the mesh as changed, reloads hardware buffers 207 //! flags the mesh as changed, reloads hardware buffers
208 virtual void setDirty() 208 virtual void setDirty()
209 { 209 {
210 ++ChangedID; 210 ++ChangedID;
211 } 211 }
212 212
213 //! Get the currently used ID for identification of changes. 213 //! Get the currently used ID for identification of changes.
214 /** This shouldn't be used for anything outside the VideoDriver. */ 214 /** This shouldn't be used for anything outside the VideoDriver. */
215 virtual u32 getChangedID() const {return ChangedID;} 215 virtual u32 getChangedID() const {return ChangedID;}
216 216
217 E_HARDWARE_MAPPING MappingHint; 217 E_HARDWARE_MAPPING MappingHint;
218 u32 ChangedID; 218 u32 ChangedID;
219 }; 219 };
220 220
221 221
222} // end namespace scene 222} // end namespace scene
223} // end namespace irr 223} // end namespace irr
224 224
225#endif 225#endif
226 226
diff --git a/libraries/irrlicht-1.8/include/CMeshBuffer.h b/libraries/irrlicht-1.8/include/CMeshBuffer.h
index 7512a38..24a95e2 100644
--- a/libraries/irrlicht-1.8/include/CMeshBuffer.h
+++ b/libraries/irrlicht-1.8/include/CMeshBuffer.h
@@ -1,301 +1,301 @@
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#ifndef __T_MESH_BUFFER_H_INCLUDED__ 5#ifndef __T_MESH_BUFFER_H_INCLUDED__
6#define __T_MESH_BUFFER_H_INCLUDED__ 6#define __T_MESH_BUFFER_H_INCLUDED__
7 7
8#include "irrArray.h" 8#include "irrArray.h"
9#include "IMeshBuffer.h" 9#include "IMeshBuffer.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 //! Template implementation of the IMeshBuffer interface 15 //! Template implementation of the IMeshBuffer interface
16 template <class T> 16 template <class T>
17 class CMeshBuffer : public IMeshBuffer 17 class CMeshBuffer : public IMeshBuffer
18 { 18 {
19 public: 19 public:
20 //! Default constructor for empty meshbuffer 20 //! Default constructor for empty meshbuffer
21 CMeshBuffer():ChangedID_Vertex(1),ChangedID_Index(1),MappingHint_Vertex(EHM_NEVER), MappingHint_Index(EHM_NEVER) 21 CMeshBuffer():ChangedID_Vertex(1),ChangedID_Index(1),MappingHint_Vertex(EHM_NEVER), MappingHint_Index(EHM_NEVER)
22 { 22 {
23 #ifdef _DEBUG 23 #ifdef _DEBUG
24 setDebugName("SMeshBuffer"); 24 setDebugName("SMeshBuffer");
25 #endif 25 #endif
26 } 26 }
27 27
28 28
29 //! Get material of this meshbuffer 29 //! Get material of this meshbuffer
30 /** \return Material of this buffer */ 30 /** \return Material of this buffer */
31 virtual const video::SMaterial& getMaterial() const 31 virtual const video::SMaterial& getMaterial() const
32 { 32 {
33 return Material; 33 return Material;
34 } 34 }
35 35
36 36
37 //! Get material of this meshbuffer 37 //! Get material of this meshbuffer
38 /** \return Material of this buffer */ 38 /** \return Material of this buffer */
39 virtual video::SMaterial& getMaterial() 39 virtual video::SMaterial& getMaterial()
40 { 40 {
41 return Material; 41 return Material;
42 } 42 }
43 43
44 44
45 //! Get pointer to vertices 45 //! Get pointer to vertices
46 /** \return Pointer to vertices. */ 46 /** \return Pointer to vertices. */
47 virtual const void* getVertices() const 47 virtual const void* getVertices() const
48 { 48 {
49 return Vertices.const_pointer(); 49 return Vertices.const_pointer();
50 } 50 }
51 51
52 52
53 //! Get pointer to vertices 53 //! Get pointer to vertices
54 /** \return Pointer to vertices. */ 54 /** \return Pointer to vertices. */
55 virtual void* getVertices() 55 virtual void* getVertices()
56 { 56 {
57 return Vertices.pointer(); 57 return Vertices.pointer();
58 } 58 }
59 59
60 60
61 //! Get number of vertices 61 //! Get number of vertices
62 /** \return Number of vertices. */ 62 /** \return Number of vertices. */
63 virtual u32 getVertexCount() const 63 virtual u32 getVertexCount() const
64 { 64 {
65 return Vertices.size(); 65 return Vertices.size();
66 } 66 }
67 67
68 //! Get type of index data which is stored in this meshbuffer. 68 //! Get type of index data which is stored in this meshbuffer.
69 /** \return Index type of this buffer. */ 69 /** \return Index type of this buffer. */
70 virtual video::E_INDEX_TYPE getIndexType() const 70 virtual video::E_INDEX_TYPE getIndexType() const
71 { 71 {
72 return video::EIT_16BIT; 72 return video::EIT_16BIT;
73 } 73 }
74 74
75 //! Get pointer to indices 75 //! Get pointer to indices
76 /** \return Pointer to indices. */ 76 /** \return Pointer to indices. */
77 virtual const u16* getIndices() const 77 virtual const u16* getIndices() const
78 { 78 {
79 return Indices.const_pointer(); 79 return Indices.const_pointer();
80 } 80 }
81 81
82 82
83 //! Get pointer to indices 83 //! Get pointer to indices
84 /** \return Pointer to indices. */ 84 /** \return Pointer to indices. */
85 virtual u16* getIndices() 85 virtual u16* getIndices()
86 { 86 {
87 return Indices.pointer(); 87 return Indices.pointer();
88 } 88 }
89 89
90 90
91 //! Get number of indices 91 //! Get number of indices
92 /** \return Number of indices. */ 92 /** \return Number of indices. */
93 virtual u32 getIndexCount() const 93 virtual u32 getIndexCount() const
94 { 94 {
95 return Indices.size(); 95 return Indices.size();
96 } 96 }
97 97
98 98
99 //! Get the axis aligned bounding box 99 //! Get the axis aligned bounding box
100 /** \return Axis aligned bounding box of this buffer. */ 100 /** \return Axis aligned bounding box of this buffer. */
101 virtual const core::aabbox3d<f32>& getBoundingBox() const 101 virtual const core::aabbox3d<f32>& getBoundingBox() const
102 { 102 {
103 return BoundingBox; 103 return BoundingBox;
104 } 104 }
105 105
106 106
107 //! Set the axis aligned bounding box 107 //! Set the axis aligned bounding box
108 /** \param box New axis aligned bounding box for this buffer. */ 108 /** \param box New axis aligned bounding box for this buffer. */
109 //! set user axis aligned bounding box 109 //! set user axis aligned bounding box
110 virtual void setBoundingBox(const core::aabbox3df& box) 110 virtual void setBoundingBox(const core::aabbox3df& box)
111 { 111 {
112 BoundingBox = box; 112 BoundingBox = box;
113 } 113 }
114 114
115 115
116 //! Recalculate the bounding box. 116 //! Recalculate the bounding box.
117 /** should be called if the mesh changed. */ 117 /** should be called if the mesh changed. */
118 virtual void recalculateBoundingBox() 118 virtual void recalculateBoundingBox()
119 { 119 {
120 if (Vertices.empty()) 120 if (Vertices.empty())
121 BoundingBox.reset(0,0,0); 121 BoundingBox.reset(0,0,0);
122 else 122 else
123 { 123 {
124 BoundingBox.reset(Vertices[0].Pos); 124 BoundingBox.reset(Vertices[0].Pos);
125 for (u32 i=1; i<Vertices.size(); ++i) 125 for (u32 i=1; i<Vertices.size(); ++i)
126 BoundingBox.addInternalPoint(Vertices[i].Pos); 126 BoundingBox.addInternalPoint(Vertices[i].Pos);
127 } 127 }
128 } 128 }
129 129
130 130
131 //! Get type of vertex data stored in this buffer. 131 //! Get type of vertex data stored in this buffer.
132 /** \return Type of vertex data. */ 132 /** \return Type of vertex data. */
133 virtual video::E_VERTEX_TYPE getVertexType() const 133 virtual video::E_VERTEX_TYPE getVertexType() const
134 { 134 {
135 return T().getType(); 135 return T().getType();
136 } 136 }
137 137
138 //! returns position of vertex i 138 //! returns position of vertex i
139 virtual const core::vector3df& getPosition(u32 i) const 139 virtual const core::vector3df& getPosition(u32 i) const
140 { 140 {
141 return Vertices[i].Pos; 141 return Vertices[i].Pos;
142 } 142 }
143 143
144 //! returns position of vertex i 144 //! returns position of vertex i
145 virtual core::vector3df& getPosition(u32 i) 145 virtual core::vector3df& getPosition(u32 i)
146 { 146 {
147 return Vertices[i].Pos; 147 return Vertices[i].Pos;
148 } 148 }
149 149
150 //! returns normal of vertex i 150 //! returns normal of vertex i
151 virtual const core::vector3df& getNormal(u32 i) const 151 virtual const core::vector3df& getNormal(u32 i) const
152 { 152 {
153 return Vertices[i].Normal; 153 return Vertices[i].Normal;
154 } 154 }
155 155
156 //! returns normal of vertex i 156 //! returns normal of vertex i
157 virtual core::vector3df& getNormal(u32 i) 157 virtual core::vector3df& getNormal(u32 i)
158 { 158 {
159 return Vertices[i].Normal; 159 return Vertices[i].Normal;
160 } 160 }
161 161
162 //! returns texture coord of vertex i 162 //! returns texture coord of vertex i
163 virtual const core::vector2df& getTCoords(u32 i) const 163 virtual const core::vector2df& getTCoords(u32 i) const
164 { 164 {
165 return Vertices[i].TCoords; 165 return Vertices[i].TCoords;
166 } 166 }
167 167
168 //! returns texture coord of vertex i 168 //! returns texture coord of vertex i
169 virtual core::vector2df& getTCoords(u32 i) 169 virtual core::vector2df& getTCoords(u32 i)
170 { 170 {
171 return Vertices[i].TCoords; 171 return Vertices[i].TCoords;
172 } 172 }
173 173
174 174
175 //! Append the vertices and indices to the current buffer 175 //! Append the vertices and indices to the current buffer
176 /** Only works for compatible types, i.e. either the same type 176 /** Only works for compatible types, i.e. either the same type
177 or the main buffer is of standard type. Otherwise, behavior is 177 or the main buffer is of standard type. Otherwise, behavior is
178 undefined. 178 undefined.
179 */ 179 */
180 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) 180 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices)
181 { 181 {
182 if (vertices == getVertices()) 182 if (vertices == getVertices())
183 return; 183 return;
184 184
185 const u32 vertexCount = getVertexCount(); 185 const u32 vertexCount = getVertexCount();
186 u32 i; 186 u32 i;
187 187
188 Vertices.reallocate(vertexCount+numVertices); 188 Vertices.reallocate(vertexCount+numVertices);
189 for (i=0; i<numVertices; ++i) 189 for (i=0; i<numVertices; ++i)
190 { 190 {
191 Vertices.push_back(reinterpret_cast<const T*>(vertices)[i]); 191 Vertices.push_back(reinterpret_cast<const T*>(vertices)[i]);
192 BoundingBox.addInternalPoint(reinterpret_cast<const T*>(vertices)[i].Pos); 192 BoundingBox.addInternalPoint(reinterpret_cast<const T*>(vertices)[i].Pos);
193 } 193 }
194 194
195 Indices.reallocate(getIndexCount()+numIndices); 195 Indices.reallocate(getIndexCount()+numIndices);
196 for (i=0; i<numIndices; ++i) 196 for (i=0; i<numIndices; ++i)
197 { 197 {
198 Indices.push_back(indices[i]+vertexCount); 198 Indices.push_back(indices[i]+vertexCount);
199 } 199 }
200 } 200 }
201 201
202 202
203 //! Append the meshbuffer to the current buffer 203 //! Append the meshbuffer to the current buffer
204 /** Only works for compatible types, i.e. either the same type 204 /** Only works for compatible types, i.e. either the same type
205 or the main buffer is of standard type. Otherwise, behavior is 205 or the main buffer is of standard type. Otherwise, behavior is
206 undefined. 206 undefined.
207 \param other Meshbuffer to be appended to this one. 207 \param other Meshbuffer to be appended to this one.
208 */ 208 */
209 virtual void append(const IMeshBuffer* const other) 209 virtual void append(const IMeshBuffer* const other)
210 { 210 {
211 /* 211 /*
212 if (this==other) 212 if (this==other)
213 return; 213 return;
214 214
215 const u32 vertexCount = getVertexCount(); 215 const u32 vertexCount = getVertexCount();
216 u32 i; 216 u32 i;
217 217
218 Vertices.reallocate(vertexCount+other->getVertexCount()); 218 Vertices.reallocate(vertexCount+other->getVertexCount());
219 for (i=0; i<other->getVertexCount(); ++i) 219 for (i=0; i<other->getVertexCount(); ++i)
220 { 220 {
221 Vertices.push_back(reinterpret_cast<const T*>(other->getVertices())[i]); 221 Vertices.push_back(reinterpret_cast<const T*>(other->getVertices())[i]);
222 } 222 }
223 223
224 Indices.reallocate(getIndexCount()+other->getIndexCount()); 224 Indices.reallocate(getIndexCount()+other->getIndexCount());
225 for (i=0; i<other->getIndexCount(); ++i) 225 for (i=0; i<other->getIndexCount(); ++i)
226 { 226 {
227 Indices.push_back(other->getIndices()[i]+vertexCount); 227 Indices.push_back(other->getIndices()[i]+vertexCount);
228 } 228 }
229 BoundingBox.addInternalBox(other->getBoundingBox()); 229 BoundingBox.addInternalBox(other->getBoundingBox());
230 */ 230 */
231 } 231 }
232 232
233 233
234 //! get the current hardware mapping hint 234 //! get the current hardware mapping hint
235 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const 235 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const
236 { 236 {
237 return MappingHint_Vertex; 237 return MappingHint_Vertex;
238 } 238 }
239 239
240 //! get the current hardware mapping hint 240 //! get the current hardware mapping hint
241 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const 241 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const
242 { 242 {
243 return MappingHint_Index; 243 return MappingHint_Index;
244 } 244 }
245 245
246 //! set the hardware mapping hint, for driver 246 //! set the hardware mapping hint, for driver
247 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) 247 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX )
248 { 248 {
249 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX) 249 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
250 MappingHint_Vertex=NewMappingHint; 250 MappingHint_Vertex=NewMappingHint;
251 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX) 251 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
252 MappingHint_Index=NewMappingHint; 252 MappingHint_Index=NewMappingHint;
253 } 253 }
254 254
255 255
256 //! flags the mesh as changed, reloads hardware buffers 256 //! flags the mesh as changed, reloads hardware buffers
257 virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) 257 virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
258 { 258 {
259 if (Buffer==EBT_VERTEX_AND_INDEX ||Buffer==EBT_VERTEX) 259 if (Buffer==EBT_VERTEX_AND_INDEX ||Buffer==EBT_VERTEX)
260 ++ChangedID_Vertex; 260 ++ChangedID_Vertex;
261 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX) 261 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
262 ++ChangedID_Index; 262 ++ChangedID_Index;
263 } 263 }
264 264
265 //! Get the currently used ID for identification of changes. 265 //! Get the currently used ID for identification of changes.
266 /** This shouldn't be used for anything outside the VideoDriver. */ 266 /** This shouldn't be used for anything outside the VideoDriver. */
267 virtual u32 getChangedID_Vertex() const {return ChangedID_Vertex;} 267 virtual u32 getChangedID_Vertex() const {return ChangedID_Vertex;}
268 268
269 //! Get the currently used ID for identification of changes. 269 //! Get the currently used ID for identification of changes.
270 /** This shouldn't be used for anything outside the VideoDriver. */ 270 /** This shouldn't be used for anything outside the VideoDriver. */
271 virtual u32 getChangedID_Index() const {return ChangedID_Index;} 271 virtual u32 getChangedID_Index() const {return ChangedID_Index;}
272 272
273 u32 ChangedID_Vertex; 273 u32 ChangedID_Vertex;
274 u32 ChangedID_Index; 274 u32 ChangedID_Index;
275 275
276 //! hardware mapping hint 276 //! hardware mapping hint
277 E_HARDWARE_MAPPING MappingHint_Vertex; 277 E_HARDWARE_MAPPING MappingHint_Vertex;
278 E_HARDWARE_MAPPING MappingHint_Index; 278 E_HARDWARE_MAPPING MappingHint_Index;
279 279
280 //! Material for this meshbuffer. 280 //! Material for this meshbuffer.
281 video::SMaterial Material; 281 video::SMaterial Material;
282 //! Vertices of this buffer 282 //! Vertices of this buffer
283 core::array<T> Vertices; 283 core::array<T> Vertices;
284 //! Indices into the vertices of this buffer. 284 //! Indices into the vertices of this buffer.
285 core::array<u16> Indices; 285 core::array<u16> Indices;
286 //! Bounding box of this meshbuffer. 286 //! Bounding box of this meshbuffer.
287 core::aabbox3d<f32> BoundingBox; 287 core::aabbox3d<f32> BoundingBox;
288 }; 288 };
289 289
290 //! Standard meshbuffer 290 //! Standard meshbuffer
291 typedef CMeshBuffer<video::S3DVertex> SMeshBuffer; 291 typedef CMeshBuffer<video::S3DVertex> SMeshBuffer;
292 //! Meshbuffer with two texture coords per vertex, e.g. for lightmaps 292 //! Meshbuffer with two texture coords per vertex, e.g. for lightmaps
293 typedef CMeshBuffer<video::S3DVertex2TCoords> SMeshBufferLightMap; 293 typedef CMeshBuffer<video::S3DVertex2TCoords> SMeshBufferLightMap;
294 //! Meshbuffer with vertices having tangents stored, e.g. for normal mapping 294 //! Meshbuffer with vertices having tangents stored, e.g. for normal mapping
295 typedef CMeshBuffer<video::S3DVertexTangents> SMeshBufferTangents; 295 typedef CMeshBuffer<video::S3DVertexTangents> SMeshBufferTangents;
296} // end namespace scene 296} // end namespace scene
297} // end namespace irr 297} // end namespace irr
298 298
299#endif 299#endif
300 300
301 301
diff --git a/libraries/irrlicht-1.8/include/CVertexBuffer.h b/libraries/irrlicht-1.8/include/CVertexBuffer.h
index c721419..975b0e7 100644
--- a/libraries/irrlicht-1.8/include/CVertexBuffer.h
+++ b/libraries/irrlicht-1.8/include/CVertexBuffer.h
@@ -1,210 +1,210 @@
1// Copyright (C) 2008-2012 Nikolaus Gebhardt 1// Copyright (C) 2008-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#ifndef __C_VERTEX_BUFFER_H_INCLUDED__ 5#ifndef __C_VERTEX_BUFFER_H_INCLUDED__
6#define __C_VERTEX_BUFFER_H_INCLUDED__ 6#define __C_VERTEX_BUFFER_H_INCLUDED__
7 7
8#include "IVertexBuffer.h" 8#include "IVertexBuffer.h"
9 9
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 15
16 class CVertexBuffer : public IVertexBuffer 16 class CVertexBuffer : public IVertexBuffer
17 { 17 {
18 class IVertexList 18 class IVertexList
19 { 19 {
20 public: 20 public:
21 virtual ~IVertexList(){}; 21 virtual ~IVertexList(){};
22 22
23 virtual u32 stride() const =0; 23 virtual u32 stride() const =0;
24 24
25 virtual u32 size() const =0; 25 virtual u32 size() const =0;
26 26
27 virtual void push_back (const video::S3DVertex &element) =0; 27 virtual void push_back (const video::S3DVertex &element) =0;
28 virtual video::S3DVertex& operator [](const u32 index) const =0; 28 virtual video::S3DVertex& operator [](const u32 index) const =0;
29 virtual video::S3DVertex& getLast() =0; 29 virtual video::S3DVertex& getLast() =0;
30 virtual void set_used(u32 usedNow) =0; 30 virtual void set_used(u32 usedNow) =0;
31 virtual void reallocate(u32 new_size) =0; 31 virtual void reallocate(u32 new_size) =0;
32 virtual u32 allocated_size() const =0; 32 virtual u32 allocated_size() const =0;
33 virtual video::S3DVertex* pointer() =0; 33 virtual video::S3DVertex* pointer() =0;
34 virtual video::E_VERTEX_TYPE getType() const =0; 34 virtual video::E_VERTEX_TYPE getType() const =0;
35 }; 35 };
36 36
37 template <class T> 37 template <class T>
38 class CSpecificVertexList : public IVertexList 38 class CSpecificVertexList : public IVertexList
39 { 39 {
40 public: 40 public:
41 core::array<T> Vertices; 41 core::array<T> Vertices;
42 42
43 virtual u32 stride() const {return sizeof(T);} 43 virtual u32 stride() const {return sizeof(T);}
44 44
45 virtual u32 size() const {return Vertices.size();} 45 virtual u32 size() const {return Vertices.size();}
46 46
47 virtual void push_back (const video::S3DVertex &element) 47 virtual void push_back (const video::S3DVertex &element)
48 {Vertices.push_back((T&)element);} 48 {Vertices.push_back((T&)element);}
49 49
50 virtual video::S3DVertex& operator [](const u32 index) const 50 virtual video::S3DVertex& operator [](const u32 index) const
51 {return (video::S3DVertex&)Vertices[index];} 51 {return (video::S3DVertex&)Vertices[index];}
52 52
53 virtual video::S3DVertex& getLast() 53 virtual video::S3DVertex& getLast()
54 {return (video::S3DVertex&)Vertices.getLast();} 54 {return (video::S3DVertex&)Vertices.getLast();}
55 55
56 virtual void set_used(u32 usedNow) 56 virtual void set_used(u32 usedNow)
57 {Vertices.set_used(usedNow);} 57 {Vertices.set_used(usedNow);}
58 58
59 virtual void reallocate(u32 new_size) 59 virtual void reallocate(u32 new_size)
60 {Vertices.reallocate(new_size);} 60 {Vertices.reallocate(new_size);}
61 61
62 virtual u32 allocated_size() const 62 virtual u32 allocated_size() const
63 { 63 {
64 return Vertices.allocated_size(); 64 return Vertices.allocated_size();
65 } 65 }
66 66
67 virtual video::S3DVertex* pointer() {return Vertices.pointer();} 67 virtual video::S3DVertex* pointer() {return Vertices.pointer();}
68 68
69 virtual video::E_VERTEX_TYPE getType() const {return T().getType();} 69 virtual video::E_VERTEX_TYPE getType() const {return T().getType();}
70 }; 70 };
71 71
72 public: 72 public:
73 IVertexList *Vertices; 73 IVertexList *Vertices;
74 74
75 CVertexBuffer(video::E_VERTEX_TYPE vertexType) : Vertices(0), 75 CVertexBuffer(video::E_VERTEX_TYPE vertexType) : Vertices(0),
76 MappingHint(EHM_NEVER), ChangedID(1) 76 MappingHint(EHM_NEVER), ChangedID(1)
77 { 77 {
78 setType(vertexType); 78 setType(vertexType);
79 } 79 }
80 80
81 CVertexBuffer(const IVertexBuffer &VertexBufferCopy) : 81 CVertexBuffer(const IVertexBuffer &VertexBufferCopy) :
82 Vertices(0), MappingHint(EHM_NEVER), 82 Vertices(0), MappingHint(EHM_NEVER),
83 ChangedID(1) 83 ChangedID(1)
84 { 84 {
85 setType(VertexBufferCopy.getType()); 85 setType(VertexBufferCopy.getType());
86 reallocate(VertexBufferCopy.size()); 86 reallocate(VertexBufferCopy.size());
87 87
88 for (u32 n=0;n<VertexBufferCopy.size();++n) 88 for (u32 n=0;n<VertexBufferCopy.size();++n)
89 push_back(VertexBufferCopy[n]); 89 push_back(VertexBufferCopy[n]);
90 } 90 }
91 91
92 virtual ~CVertexBuffer() 92 virtual ~CVertexBuffer()
93 { 93 {
94 delete Vertices; 94 delete Vertices;
95 } 95 }
96 96
97 97
98 virtual void setType(video::E_VERTEX_TYPE vertexType) 98 virtual void setType(video::E_VERTEX_TYPE vertexType)
99 { 99 {
100 IVertexList *NewVertices=0; 100 IVertexList *NewVertices=0;
101 101
102 switch (vertexType) 102 switch (vertexType)
103 { 103 {
104 case video::EVT_STANDARD: 104 case video::EVT_STANDARD:
105 { 105 {
106 NewVertices=new CSpecificVertexList<video::S3DVertex>; 106 NewVertices=new CSpecificVertexList<video::S3DVertex>;
107 break; 107 break;
108 } 108 }
109 case video::EVT_2TCOORDS: 109 case video::EVT_2TCOORDS:
110 { 110 {
111 NewVertices=new CSpecificVertexList<video::S3DVertex2TCoords>; 111 NewVertices=new CSpecificVertexList<video::S3DVertex2TCoords>;
112 break; 112 break;
113 } 113 }
114 case video::EVT_TANGENTS: 114 case video::EVT_TANGENTS:
115 { 115 {
116 NewVertices=new CSpecificVertexList<video::S3DVertexTangents>; 116 NewVertices=new CSpecificVertexList<video::S3DVertexTangents>;
117 break; 117 break;
118 } 118 }
119 } 119 }
120 if (Vertices) 120 if (Vertices)
121 { 121 {
122 NewVertices->reallocate( Vertices->size() ); 122 NewVertices->reallocate( Vertices->size() );
123 123
124 for(u32 n=0;n<Vertices->size();++n) 124 for(u32 n=0;n<Vertices->size();++n)
125 NewVertices->push_back((*Vertices)[n]); 125 NewVertices->push_back((*Vertices)[n]);
126 126
127 delete Vertices; 127 delete Vertices;
128 } 128 }
129 129
130 Vertices=NewVertices; 130 Vertices=NewVertices;
131 } 131 }
132 132
133 virtual void* getData() {return Vertices->pointer();} 133 virtual void* getData() {return Vertices->pointer();}
134 134
135 virtual video::E_VERTEX_TYPE getType() const {return Vertices->getType();} 135 virtual video::E_VERTEX_TYPE getType() const {return Vertices->getType();}
136 136
137 virtual u32 stride() const {return Vertices->stride();} 137 virtual u32 stride() const {return Vertices->stride();}
138 138
139 virtual u32 size() const 139 virtual u32 size() const
140 { 140 {
141 return Vertices->size(); 141 return Vertices->size();
142 } 142 }
143 143
144 virtual void push_back (const video::S3DVertex &element) 144 virtual void push_back (const video::S3DVertex &element)
145 { 145 {
146 Vertices->push_back(element); 146 Vertices->push_back(element);
147 } 147 }
148 148
149 virtual video::S3DVertex& operator [](const u32 index) const 149 virtual video::S3DVertex& operator [](const u32 index) const
150 { 150 {
151 return (*Vertices)[index]; 151 return (*Vertices)[index];
152 } 152 }
153 153
154 virtual video::S3DVertex& getLast() 154 virtual video::S3DVertex& getLast()
155 { 155 {
156 return Vertices->getLast(); 156 return Vertices->getLast();
157 } 157 }
158 158
159 virtual void set_used(u32 usedNow) 159 virtual void set_used(u32 usedNow)
160 { 160 {
161 Vertices->set_used(usedNow); 161 Vertices->set_used(usedNow);
162 } 162 }
163 163
164 virtual void reallocate(u32 new_size) 164 virtual void reallocate(u32 new_size)
165 { 165 {
166 Vertices->reallocate(new_size); 166 Vertices->reallocate(new_size);
167 } 167 }
168 168
169 virtual u32 allocated_size() const 169 virtual u32 allocated_size() const
170 { 170 {
171 return Vertices->allocated_size(); 171 return Vertices->allocated_size();
172 } 172 }
173 173
174 virtual video::S3DVertex* pointer() 174 virtual video::S3DVertex* pointer()
175 { 175 {
176 return Vertices->pointer(); 176 return Vertices->pointer();
177 } 177 }
178 178
179 //! get the current hardware mapping hint 179 //! get the current hardware mapping hint
180 virtual E_HARDWARE_MAPPING getHardwareMappingHint() const 180 virtual E_HARDWARE_MAPPING getHardwareMappingHint() const
181 { 181 {
182 return MappingHint; 182 return MappingHint;
183 } 183 }
184 184
185 //! set the hardware mapping hint, for driver 185 //! set the hardware mapping hint, for driver
186 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) 186 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint )
187 { 187 {
188 MappingHint=NewMappingHint; 188 MappingHint=NewMappingHint;
189 } 189 }
190 190
191 //! flags the mesh as changed, reloads hardware buffers 191 //! flags the mesh as changed, reloads hardware buffers
192 virtual void setDirty() 192 virtual void setDirty()
193 { 193 {
194 ++ChangedID; 194 ++ChangedID;
195 } 195 }
196 196
197 //! Get the currently used ID for identification of changes. 197 //! Get the currently used ID for identification of changes.
198 /** This shouldn't be used for anything outside the VideoDriver. */ 198 /** This shouldn't be used for anything outside the VideoDriver. */
199 virtual u32 getChangedID() const {return ChangedID;} 199 virtual u32 getChangedID() const {return ChangedID;}
200 200
201 E_HARDWARE_MAPPING MappingHint; 201 E_HARDWARE_MAPPING MappingHint;
202 u32 ChangedID; 202 u32 ChangedID;
203 }; 203 };
204 204
205 205
206} // end namespace scene 206} // end namespace scene
207} // end namespace irr 207} // end namespace irr
208 208
209#endif 209#endif
210 210
diff --git a/libraries/irrlicht-1.8/include/EAttributes.h b/libraries/irrlicht-1.8/include/EAttributes.h
index 51f102b..121b6b3 100644
--- a/libraries/irrlicht-1.8/include/EAttributes.h
+++ b/libraries/irrlicht-1.8/include/EAttributes.h
@@ -1,101 +1,101 @@
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#ifndef __E_ATTRIBUTES_H_INCLUDED__ 5#ifndef __E_ATTRIBUTES_H_INCLUDED__
6#define __E_ATTRIBUTES_H_INCLUDED__ 6#define __E_ATTRIBUTES_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace io 10namespace io
11{ 11{
12 12
13//! Types of attributes available for IAttributes 13//! Types of attributes available for IAttributes
14enum E_ATTRIBUTE_TYPE 14enum E_ATTRIBUTE_TYPE
15{ 15{
16 // integer attribute 16 // integer attribute
17 EAT_INT = 0, 17 EAT_INT = 0,
18 18
19 // float attribute 19 // float attribute
20 EAT_FLOAT, 20 EAT_FLOAT,
21 21
22 // string attribute 22 // string attribute
23 EAT_STRING, 23 EAT_STRING,
24 24
25 // boolean attribute 25 // boolean attribute
26 EAT_BOOL, 26 EAT_BOOL,
27 27
28 // enumeration attribute 28 // enumeration attribute
29 EAT_ENUM, 29 EAT_ENUM,
30 30
31 // color attribute 31 // color attribute
32 EAT_COLOR, 32 EAT_COLOR,
33 33
34 // floating point color attribute 34 // floating point color attribute
35 EAT_COLORF, 35 EAT_COLORF,
36 36
37 // 3d vector attribute 37 // 3d vector attribute
38 EAT_VECTOR3D, 38 EAT_VECTOR3D,
39 39
40 // 2d position attribute 40 // 2d position attribute
41 EAT_POSITION2D, 41 EAT_POSITION2D,
42 42
43 // vector 2d attribute 43 // vector 2d attribute
44 EAT_VECTOR2D, 44 EAT_VECTOR2D,
45 45
46 // rectangle attribute 46 // rectangle attribute
47 EAT_RECT, 47 EAT_RECT,
48 48
49 // matrix attribute 49 // matrix attribute
50 EAT_MATRIX, 50 EAT_MATRIX,
51 51
52 // quaternion attribute 52 // quaternion attribute
53 EAT_QUATERNION, 53 EAT_QUATERNION,
54 54
55 // 3d bounding box 55 // 3d bounding box
56 EAT_BBOX, 56 EAT_BBOX,
57 57
58 // plane 58 // plane
59 EAT_PLANE, 59 EAT_PLANE,
60 60
61 // 3d triangle 61 // 3d triangle
62 EAT_TRIANGLE3D, 62 EAT_TRIANGLE3D,
63 63
64 // line 2d 64 // line 2d
65 EAT_LINE2D, 65 EAT_LINE2D,
66 66
67 // line 3d 67 // line 3d
68 EAT_LINE3D, 68 EAT_LINE3D,
69 69
70 // array of stringws attribute 70 // array of stringws attribute
71 EAT_STRINGWARRAY, 71 EAT_STRINGWARRAY,
72 72
73 // array of float 73 // array of float
74 EAT_FLOATARRAY, 74 EAT_FLOATARRAY,
75 75
76 // array of int 76 // array of int
77 EAT_INTARRAY, 77 EAT_INTARRAY,
78 78
79 // binary data attribute 79 // binary data attribute
80 EAT_BINARY, 80 EAT_BINARY,
81 81
82 // texture reference attribute 82 // texture reference attribute
83 EAT_TEXTURE, 83 EAT_TEXTURE,
84 84
85 // user pointer void* 85 // user pointer void*
86 EAT_USER_POINTER, 86 EAT_USER_POINTER,
87 87
88 // dimension attribute 88 // dimension attribute
89 EAT_DIMENSION2D, 89 EAT_DIMENSION2D,
90 90
91 // known attribute type count 91 // known attribute type count
92 EAT_COUNT, 92 EAT_COUNT,
93 93
94 // unknown attribute 94 // unknown attribute
95 EAT_UNKNOWN 95 EAT_UNKNOWN
96}; 96};
97 97
98} // end namespace io 98} // end namespace io
99} // end namespace irr 99} // end namespace irr
100 100
101#endif 101#endif
diff --git a/libraries/irrlicht-1.8/include/ECullingTypes.h b/libraries/irrlicht-1.8/include/ECullingTypes.h
index 4a562a4..7178c05 100644
--- a/libraries/irrlicht-1.8/include/ECullingTypes.h
+++ b/libraries/irrlicht-1.8/include/ECullingTypes.h
@@ -1,41 +1,41 @@
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#ifndef __E_CULLING_TYPES_H_INCLUDED__ 5#ifndef __E_CULLING_TYPES_H_INCLUDED__
6#define __E_CULLING_TYPES_H_INCLUDED__ 6#define __E_CULLING_TYPES_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15 //! An enumeration for all types of automatic culling for built-in scene nodes 15 //! An enumeration for all types of automatic culling for built-in scene nodes
16 enum E_CULLING_TYPE 16 enum E_CULLING_TYPE
17 { 17 {
18 EAC_OFF = 0, 18 EAC_OFF = 0,
19 EAC_BOX = 1, 19 EAC_BOX = 1,
20 EAC_FRUSTUM_BOX = 2, 20 EAC_FRUSTUM_BOX = 2,
21 EAC_FRUSTUM_SPHERE = 4, 21 EAC_FRUSTUM_SPHERE = 4,
22 EAC_OCC_QUERY = 8 22 EAC_OCC_QUERY = 8
23 }; 23 };
24 24
25 //! Names for culling type 25 //! Names for culling type
26 const c8* const AutomaticCullingNames[] = 26 const c8* const AutomaticCullingNames[] =
27 { 27 {
28 "false", 28 "false",
29 "box", // camera box against node box 29 "box", // camera box against node box
30 "frustum_box", // camera frustum against node box 30 "frustum_box", // camera frustum against node box
31 "frustum_sphere", // camera frustum against node sphere 31 "frustum_sphere", // camera frustum against node sphere
32 "occ_query", // occlusion query 32 "occ_query", // occlusion query
33 0 33 0
34 }; 34 };
35 35
36} // end namespace scene 36} // end namespace scene
37} // end namespace irr 37} // end namespace irr
38 38
39 39
40#endif // __E_CULLING_TYPES_H_INCLUDED__ 40#endif // __E_CULLING_TYPES_H_INCLUDED__
41 41
diff --git a/libraries/irrlicht-1.8/include/EDebugSceneTypes.h b/libraries/irrlicht-1.8/include/EDebugSceneTypes.h
index 987b790..64ebcaa 100644
--- a/libraries/irrlicht-1.8/include/EDebugSceneTypes.h
+++ b/libraries/irrlicht-1.8/include/EDebugSceneTypes.h
@@ -1,50 +1,50 @@
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#ifndef __E_DEBUG_SCENE_TYPES_H_INCLUDED__ 5#ifndef __E_DEBUG_SCENE_TYPES_H_INCLUDED__
6#define __E_DEBUG_SCENE_TYPES_H_INCLUDED__ 6#define __E_DEBUG_SCENE_TYPES_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace scene 10namespace scene
11{ 11{
12 12
13 //! An enumeration for all types of debug data for built-in scene nodes (flags) 13 //! An enumeration for all types of debug data for built-in scene nodes (flags)
14 enum E_DEBUG_SCENE_TYPE 14 enum E_DEBUG_SCENE_TYPE
15 { 15 {
16 //! No Debug Data ( Default ) 16 //! No Debug Data ( Default )
17 EDS_OFF = 0, 17 EDS_OFF = 0,
18 18
19 //! Show Bounding Boxes of SceneNode 19 //! Show Bounding Boxes of SceneNode
20 EDS_BBOX = 1, 20 EDS_BBOX = 1,
21 21
22 //! Show Vertex Normals 22 //! Show Vertex Normals
23 EDS_NORMALS = 2, 23 EDS_NORMALS = 2,
24 24
25 //! Shows Skeleton/Tags 25 //! Shows Skeleton/Tags
26 EDS_SKELETON = 4, 26 EDS_SKELETON = 4,
27 27
28 //! Overlays Mesh Wireframe 28 //! Overlays Mesh Wireframe
29 EDS_MESH_WIRE_OVERLAY = 8, 29 EDS_MESH_WIRE_OVERLAY = 8,
30 30
31 //! Temporary use transparency Material Type 31 //! Temporary use transparency Material Type
32 EDS_HALF_TRANSPARENCY = 16, 32 EDS_HALF_TRANSPARENCY = 16,
33 33
34 //! Show Bounding Boxes of all MeshBuffers 34 //! Show Bounding Boxes of all MeshBuffers
35 EDS_BBOX_BUFFERS = 32, 35 EDS_BBOX_BUFFERS = 32,
36 36
37 //! EDS_BBOX | EDS_BBOX_BUFFERS 37 //! EDS_BBOX | EDS_BBOX_BUFFERS
38 EDS_BBOX_ALL = EDS_BBOX | EDS_BBOX_BUFFERS, 38 EDS_BBOX_ALL = EDS_BBOX | EDS_BBOX_BUFFERS,
39 39
40 //! Show all debug infos 40 //! Show all debug infos
41 EDS_FULL = 0xffffffff 41 EDS_FULL = 0xffffffff
42 }; 42 };
43 43
44 44
45} // end namespace scene 45} // end namespace scene
46} // end namespace irr 46} // end namespace irr
47 47
48 48
49#endif // __E_DEBUG_SCENE_TYPES_H_INCLUDED__ 49#endif // __E_DEBUG_SCENE_TYPES_H_INCLUDED__
50 50
diff --git a/libraries/irrlicht-1.8/include/EDeviceTypes.h b/libraries/irrlicht-1.8/include/EDeviceTypes.h
index 44b0094..d7e9627 100644
--- a/libraries/irrlicht-1.8/include/EDeviceTypes.h
+++ b/libraries/irrlicht-1.8/include/EDeviceTypes.h
@@ -1,60 +1,60 @@
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#ifndef __E_DEVICE_TYPES_H_INCLUDED__ 5#ifndef __E_DEVICE_TYPES_H_INCLUDED__
6#define __E_DEVICE_TYPES_H_INCLUDED__ 6#define __E_DEVICE_TYPES_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10 10
11 //! An enum for the different device types supported by the Irrlicht Engine. 11 //! An enum for the different device types supported by the Irrlicht Engine.
12 enum E_DEVICE_TYPE 12 enum E_DEVICE_TYPE
13 { 13 {
14 14
15 //! A device native to Microsoft Windows 15 //! A device native to Microsoft Windows
16 /** This device uses the Win32 API and works in all versions of Windows. */ 16 /** This device uses the Win32 API and works in all versions of Windows. */
17 EIDT_WIN32, 17 EIDT_WIN32,
18 18
19 //! A device native to Windows CE devices 19 //! A device native to Windows CE devices
20 /** This device works on Windows Mobile, Pocket PC and Microsoft SmartPhone devices */ 20 /** This device works on Windows Mobile, Pocket PC and Microsoft SmartPhone devices */
21 EIDT_WINCE, 21 EIDT_WINCE,
22 22
23 //! A device native to Unix style operating systems. 23 //! A device native to Unix style operating systems.
24 /** This device uses the X11 windowing system and works in Linux, Solaris, FreeBSD, OSX and 24 /** This device uses the X11 windowing system and works in Linux, Solaris, FreeBSD, OSX and
25 other operating systems which support X11. */ 25 other operating systems which support X11. */
26 EIDT_X11, 26 EIDT_X11,
27 27
28 //! A device native to Mac OSX 28 //! A device native to Mac OSX
29 /** This device uses Apple's Cocoa API and works in Mac OSX 10.2 and above. */ 29 /** This device uses Apple's Cocoa API and works in Mac OSX 10.2 and above. */
30 EIDT_OSX, 30 EIDT_OSX,
31 31
32 //! A device which uses Simple DirectMedia Layer 32 //! A device which uses Simple DirectMedia Layer
33 /** The SDL device works under all platforms supported by SDL but first must be compiled 33 /** The SDL device works under all platforms supported by SDL but first must be compiled
34 in by defining the IRR_USE_SDL_DEVICE macro in IrrCompileConfig.h */ 34 in by defining the IRR_USE_SDL_DEVICE macro in IrrCompileConfig.h */
35 EIDT_SDL, 35 EIDT_SDL,
36 36
37 //! A device for raw framebuffer access 37 //! A device for raw framebuffer access
38 /** Best used with embedded devices and mobile systems. 38 /** Best used with embedded devices and mobile systems.
39 Does not need X11 or other graphical subsystems. 39 Does not need X11 or other graphical subsystems.
40 May support hw-acceleration via OpenGL-ES for FBDirect */ 40 May support hw-acceleration via OpenGL-ES for FBDirect */
41 EIDT_FRAMEBUFFER, 41 EIDT_FRAMEBUFFER,
42 42
43 //! A simple text only device supported by all platforms. 43 //! A simple text only device supported by all platforms.
44 /** This device allows applications to run from the command line without opening a window. 44 /** This device allows applications to run from the command line without opening a window.
45 It can render the output of the software drivers to the console as ASCII. It only supports 45 It can render the output of the software drivers to the console as ASCII. It only supports
46 mouse and keyboard in Windows operating systems. */ 46 mouse and keyboard in Windows operating systems. */
47 EIDT_CONSOLE, 47 EIDT_CONSOLE,
48 48
49 //! This selection allows Irrlicht to choose the best device from the ones available. 49 //! This selection allows Irrlicht to choose the best device from the ones available.
50 /** If this selection is chosen then Irrlicht will try to use the IrrlichtDevice native 50 /** If this selection is chosen then Irrlicht will try to use the IrrlichtDevice native
51 to your operating system. If this is unavailable then the X11, SDL and then console device 51 to your operating system. If this is unavailable then the X11, SDL and then console device
52 will be tried. This ensures that Irrlicht will run even if your platform is unsupported, 52 will be tried. This ensures that Irrlicht will run even if your platform is unsupported,
53 although it may not be able to render anything. */ 53 although it may not be able to render anything. */
54 EIDT_BEST 54 EIDT_BEST
55 }; 55 };
56 56
57} // end namespace irr 57} // end namespace irr
58 58
59#endif // __E_DEVICE_TYPES_H_INCLUDED__ 59#endif // __E_DEVICE_TYPES_H_INCLUDED__
60 60
diff --git a/libraries/irrlicht-1.8/include/EDriverFeatures.h b/libraries/irrlicht-1.8/include/EDriverFeatures.h
index a0bf307..931314e 100644
--- a/libraries/irrlicht-1.8/include/EDriverFeatures.h
+++ b/libraries/irrlicht-1.8/include/EDriverFeatures.h
@@ -1,133 +1,133 @@
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#ifndef __E_DRIVER_FEATURES_H_INCLUDED__ 5#ifndef __E_DRIVER_FEATURES_H_INCLUDED__
6#define __E_DRIVER_FEATURES_H_INCLUDED__ 6#define __E_DRIVER_FEATURES_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace video 10namespace video
11{ 11{
12 12
13 //! enumeration for querying features of the video driver. 13 //! enumeration for querying features of the video driver.
14 enum E_VIDEO_DRIVER_FEATURE 14 enum E_VIDEO_DRIVER_FEATURE
15 { 15 {
16 //! Is driver able to render to a surface? 16 //! Is driver able to render to a surface?
17 EVDF_RENDER_TO_TARGET = 0, 17 EVDF_RENDER_TO_TARGET = 0,
18 18
19 //! Is hardeware transform and lighting supported? 19 //! Is hardeware transform and lighting supported?
20 EVDF_HARDWARE_TL, 20 EVDF_HARDWARE_TL,
21 21
22 //! Are multiple textures per material possible? 22 //! Are multiple textures per material possible?
23 EVDF_MULTITEXTURE, 23 EVDF_MULTITEXTURE,
24 24
25 //! Is driver able to render with a bilinear filter applied? 25 //! Is driver able to render with a bilinear filter applied?
26 EVDF_BILINEAR_FILTER, 26 EVDF_BILINEAR_FILTER,
27 27
28 //! Can the driver handle mip maps? 28 //! Can the driver handle mip maps?
29 EVDF_MIP_MAP, 29 EVDF_MIP_MAP,
30 30
31 //! Can the driver update mip maps automatically? 31 //! Can the driver update mip maps automatically?
32 EVDF_MIP_MAP_AUTO_UPDATE, 32 EVDF_MIP_MAP_AUTO_UPDATE,
33 33
34 //! Are stencilbuffers switched on and does the device support stencil buffers? 34 //! Are stencilbuffers switched on and does the device support stencil buffers?
35 EVDF_STENCIL_BUFFER, 35 EVDF_STENCIL_BUFFER,
36 36
37 //! Is Vertex Shader 1.1 supported? 37 //! Is Vertex Shader 1.1 supported?
38 EVDF_VERTEX_SHADER_1_1, 38 EVDF_VERTEX_SHADER_1_1,
39 39
40 //! Is Vertex Shader 2.0 supported? 40 //! Is Vertex Shader 2.0 supported?
41 EVDF_VERTEX_SHADER_2_0, 41 EVDF_VERTEX_SHADER_2_0,
42 42
43 //! Is Vertex Shader 3.0 supported? 43 //! Is Vertex Shader 3.0 supported?
44 EVDF_VERTEX_SHADER_3_0, 44 EVDF_VERTEX_SHADER_3_0,
45 45
46 //! Is Pixel Shader 1.1 supported? 46 //! Is Pixel Shader 1.1 supported?
47 EVDF_PIXEL_SHADER_1_1, 47 EVDF_PIXEL_SHADER_1_1,
48 48
49 //! Is Pixel Shader 1.2 supported? 49 //! Is Pixel Shader 1.2 supported?
50 EVDF_PIXEL_SHADER_1_2, 50 EVDF_PIXEL_SHADER_1_2,
51 51
52 //! Is Pixel Shader 1.3 supported? 52 //! Is Pixel Shader 1.3 supported?
53 EVDF_PIXEL_SHADER_1_3, 53 EVDF_PIXEL_SHADER_1_3,
54 54
55 //! Is Pixel Shader 1.4 supported? 55 //! Is Pixel Shader 1.4 supported?
56 EVDF_PIXEL_SHADER_1_4, 56 EVDF_PIXEL_SHADER_1_4,
57 57
58 //! Is Pixel Shader 2.0 supported? 58 //! Is Pixel Shader 2.0 supported?
59 EVDF_PIXEL_SHADER_2_0, 59 EVDF_PIXEL_SHADER_2_0,
60 60
61 //! Is Pixel Shader 3.0 supported? 61 //! Is Pixel Shader 3.0 supported?
62 EVDF_PIXEL_SHADER_3_0, 62 EVDF_PIXEL_SHADER_3_0,
63 63
64 //! Are ARB vertex programs v1.0 supported? 64 //! Are ARB vertex programs v1.0 supported?
65 EVDF_ARB_VERTEX_PROGRAM_1, 65 EVDF_ARB_VERTEX_PROGRAM_1,
66 66
67 //! Are ARB fragment programs v1.0 supported? 67 //! Are ARB fragment programs v1.0 supported?
68 EVDF_ARB_FRAGMENT_PROGRAM_1, 68 EVDF_ARB_FRAGMENT_PROGRAM_1,
69 69
70 //! Is GLSL supported? 70 //! Is GLSL supported?
71 EVDF_ARB_GLSL, 71 EVDF_ARB_GLSL,
72 72
73 //! Is HLSL supported? 73 //! Is HLSL supported?
74 EVDF_HLSL, 74 EVDF_HLSL,
75 75
76 //! Are non-square textures supported? 76 //! Are non-square textures supported?
77 EVDF_TEXTURE_NSQUARE, 77 EVDF_TEXTURE_NSQUARE,
78 78
79 //! Are non-power-of-two textures supported? 79 //! Are non-power-of-two textures supported?
80 EVDF_TEXTURE_NPOT, 80 EVDF_TEXTURE_NPOT,
81 81
82 //! Are framebuffer objects supported? 82 //! Are framebuffer objects supported?
83 EVDF_FRAMEBUFFER_OBJECT, 83 EVDF_FRAMEBUFFER_OBJECT,
84 84
85 //! Are vertex buffer objects supported? 85 //! Are vertex buffer objects supported?
86 EVDF_VERTEX_BUFFER_OBJECT, 86 EVDF_VERTEX_BUFFER_OBJECT,
87 87
88 //! Supports Alpha To Coverage 88 //! Supports Alpha To Coverage
89 EVDF_ALPHA_TO_COVERAGE, 89 EVDF_ALPHA_TO_COVERAGE,
90 90
91 //! Supports Color masks (disabling color planes in output) 91 //! Supports Color masks (disabling color planes in output)
92 EVDF_COLOR_MASK, 92 EVDF_COLOR_MASK,
93 93
94 //! Supports multiple render targets at once 94 //! Supports multiple render targets at once
95 EVDF_MULTIPLE_RENDER_TARGETS, 95 EVDF_MULTIPLE_RENDER_TARGETS,
96 96
97 //! Supports separate blend settings for multiple render targets 97 //! Supports separate blend settings for multiple render targets
98 EVDF_MRT_BLEND, 98 EVDF_MRT_BLEND,
99 99
100 //! Supports separate color masks for multiple render targets 100 //! Supports separate color masks for multiple render targets
101 EVDF_MRT_COLOR_MASK, 101 EVDF_MRT_COLOR_MASK,
102 102
103 //! Supports separate blend functions for multiple render targets 103 //! Supports separate blend functions for multiple render targets
104 EVDF_MRT_BLEND_FUNC, 104 EVDF_MRT_BLEND_FUNC,
105 105
106 //! Supports geometry shaders 106 //! Supports geometry shaders
107 EVDF_GEOMETRY_SHADER, 107 EVDF_GEOMETRY_SHADER,
108 108
109 //! Supports occlusion queries 109 //! Supports occlusion queries
110 EVDF_OCCLUSION_QUERY, 110 EVDF_OCCLUSION_QUERY,
111 111
112 //! Supports polygon offset/depth bias for avoiding z-fighting 112 //! Supports polygon offset/depth bias for avoiding z-fighting
113 EVDF_POLYGON_OFFSET, 113 EVDF_POLYGON_OFFSET,
114 114
115 //! Support for different blend functions. Without, only ADD is available 115 //! Support for different blend functions. Without, only ADD is available
116 EVDF_BLEND_OPERATIONS, 116 EVDF_BLEND_OPERATIONS,
117 117
118 //! Support for texture coord transformation via texture matrix 118 //! Support for texture coord transformation via texture matrix
119 EVDF_TEXTURE_MATRIX, 119 EVDF_TEXTURE_MATRIX,
120 120
121 //! Support for NVidia's CG shader language 121 //! Support for NVidia's CG shader language
122 EVDF_CG, 122 EVDF_CG,
123 123
124 //! Only used for counting the elements of this enum 124 //! Only used for counting the elements of this enum
125 EVDF_COUNT 125 EVDF_COUNT
126 }; 126 };
127 127
128} // end namespace video 128} // end namespace video
129} // end namespace irr 129} // end namespace irr
130 130
131 131
132#endif 132#endif
133 133
diff --git a/libraries/irrlicht-1.8/include/EDriverTypes.h b/libraries/irrlicht-1.8/include/EDriverTypes.h
index 25237b9..609e261 100644
--- a/libraries/irrlicht-1.8/include/EDriverTypes.h
+++ b/libraries/irrlicht-1.8/include/EDriverTypes.h
@@ -1,64 +1,64 @@
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#ifndef __E_DRIVER_TYPES_H_INCLUDED__ 5#ifndef __E_DRIVER_TYPES_H_INCLUDED__
6#define __E_DRIVER_TYPES_H_INCLUDED__ 6#define __E_DRIVER_TYPES_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace video 10namespace video
11{ 11{
12 12
13 //! An enum for all types of drivers the Irrlicht Engine supports. 13 //! An enum for all types of drivers the Irrlicht Engine supports.
14 enum E_DRIVER_TYPE 14 enum E_DRIVER_TYPE
15 { 15 {
16 //! Null driver, useful for applications to run the engine without visualisation. 16 //! Null driver, useful for applications to run the engine without visualisation.
17 /** The null device is able to load textures, but does not 17 /** The null device is able to load textures, but does not
18 render and display any graphics. */ 18 render and display any graphics. */
19 EDT_NULL, 19 EDT_NULL,
20 20
21 //! The Irrlicht Engine Software renderer. 21 //! The Irrlicht Engine Software renderer.
22 /** Runs on all platforms, with every hardware. It should only 22 /** Runs on all platforms, with every hardware. It should only
23 be used for 2d graphics, but it can also perform some primitive 23 be used for 2d graphics, but it can also perform some primitive
24 3d functions. These 3d drawing functions are quite fast, but 24 3d functions. These 3d drawing functions are quite fast, but
25 very inaccurate, and don't even support clipping in 3D mode. */ 25 very inaccurate, and don't even support clipping in 3D mode. */
26 EDT_SOFTWARE, 26 EDT_SOFTWARE,
27 27
28 //! The Burning's Software Renderer, an alternative software renderer 28 //! The Burning's Software Renderer, an alternative software renderer
29 /** Basically it can be described as the Irrlicht Software 29 /** Basically it can be described as the Irrlicht Software
30 renderer on steroids. It rasterizes 3D geometry perfectly: It 30 renderer on steroids. It rasterizes 3D geometry perfectly: It
31 is able to perform correct 3d clipping, perspective correct 31 is able to perform correct 3d clipping, perspective correct
32 texture mapping, perspective correct color mapping, and renders 32 texture mapping, perspective correct color mapping, and renders
33 sub pixel correct, sub texel correct primitives. In addition, 33 sub pixel correct, sub texel correct primitives. In addition,
34 it does bilinear texel filtering and supports more materials 34 it does bilinear texel filtering and supports more materials
35 than the EDT_SOFTWARE driver. This renderer has been written 35 than the EDT_SOFTWARE driver. This renderer has been written
36 entirely by Thomas Alten, thanks a lot for this huge 36 entirely by Thomas Alten, thanks a lot for this huge
37 contribution. */ 37 contribution. */
38 EDT_BURNINGSVIDEO, 38 EDT_BURNINGSVIDEO,
39 39
40 //! Direct3D8 device, only available on Win32 platforms. 40 //! Direct3D8 device, only available on Win32 platforms.
41 /** Performs hardware accelerated rendering of 3D and 2D 41 /** Performs hardware accelerated rendering of 3D and 2D
42 primitives. */ 42 primitives. */
43 EDT_DIRECT3D8, 43 EDT_DIRECT3D8,
44 44
45 //! Direct3D 9 device, only available on Win32 platforms. 45 //! Direct3D 9 device, only available on Win32 platforms.
46 /** Performs hardware accelerated rendering of 3D and 2D 46 /** Performs hardware accelerated rendering of 3D and 2D
47 primitives. */ 47 primitives. */
48 EDT_DIRECT3D9, 48 EDT_DIRECT3D9,
49 49
50 //! OpenGL device, available on most platforms. 50 //! OpenGL device, available on most platforms.
51 /** Performs hardware accelerated rendering of 3D and 2D 51 /** Performs hardware accelerated rendering of 3D and 2D
52 primitives. */ 52 primitives. */
53 EDT_OPENGL, 53 EDT_OPENGL,
54 54
55 //! No driver, just for counting the elements 55 //! No driver, just for counting the elements
56 EDT_COUNT 56 EDT_COUNT
57 }; 57 };
58 58
59} // end namespace video 59} // end namespace video
60} // end namespace irr 60} // end namespace irr
61 61
62 62
63#endif 63#endif
64 64
diff --git a/libraries/irrlicht-1.8/include/EGUIAlignment.h b/libraries/irrlicht-1.8/include/EGUIAlignment.h
index 85f81b4..d4caeea 100644
--- a/libraries/irrlicht-1.8/include/EGUIAlignment.h
+++ b/libraries/irrlicht-1.8/include/EGUIAlignment.h
@@ -1,38 +1,38 @@
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#ifndef __E_GUI_ALIGNMENT_H_INCLUDED__ 5#ifndef __E_GUI_ALIGNMENT_H_INCLUDED__
6#define __E_GUI_ALIGNMENT_H_INCLUDED__ 6#define __E_GUI_ALIGNMENT_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace gui 10namespace gui
11{ 11{
12enum EGUI_ALIGNMENT 12enum EGUI_ALIGNMENT
13{ 13{
14 //! Aligned to parent's top or left side (default) 14 //! Aligned to parent's top or left side (default)
15 EGUIA_UPPERLEFT=0, 15 EGUIA_UPPERLEFT=0,
16 //! Aligned to parent's bottom or right side 16 //! Aligned to parent's bottom or right side
17 EGUIA_LOWERRIGHT, 17 EGUIA_LOWERRIGHT,
18 //! Aligned to the center of parent 18 //! Aligned to the center of parent
19 EGUIA_CENTER, 19 EGUIA_CENTER,
20 //! Stretched to fit parent 20 //! Stretched to fit parent
21 EGUIA_SCALE 21 EGUIA_SCALE
22}; 22};
23 23
24//! Names for alignments 24//! Names for alignments
25const c8* const GUIAlignmentNames[] = 25const c8* const GUIAlignmentNames[] =
26{ 26{
27 "upperLeft", 27 "upperLeft",
28 "lowerRight", 28 "lowerRight",
29 "center", 29 "center",
30 "scale", 30 "scale",
31 0 31 0
32}; 32};
33 33
34} // namespace gui 34} // namespace gui
35} // namespace irr 35} // namespace irr
36 36
37#endif // __E_GUI_ALIGNMENT_H_INCLUDED__ 37#endif // __E_GUI_ALIGNMENT_H_INCLUDED__
38 38
diff --git a/libraries/irrlicht-1.8/include/EGUIElementTypes.h b/libraries/irrlicht-1.8/include/EGUIElementTypes.h
index a02afad..aace9e1 100644
--- a/libraries/irrlicht-1.8/include/EGUIElementTypes.h
+++ b/libraries/irrlicht-1.8/include/EGUIElementTypes.h
@@ -1,140 +1,140 @@
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#ifndef __E_GUI_ELEMENT_TYPES_H_INCLUDED__ 5#ifndef __E_GUI_ELEMENT_TYPES_H_INCLUDED__
6#define __E_GUI_ELEMENT_TYPES_H_INCLUDED__ 6#define __E_GUI_ELEMENT_TYPES_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace gui 12namespace gui
13{ 13{
14 14
15//! List of all basic Irrlicht GUI elements. 15//! List of all basic Irrlicht GUI elements.
16/** An IGUIElement returns this when calling IGUIElement::getType(); */ 16/** An IGUIElement returns this when calling IGUIElement::getType(); */
17enum EGUI_ELEMENT_TYPE 17enum EGUI_ELEMENT_TYPE
18{ 18{
19 //! A button (IGUIButton) 19 //! A button (IGUIButton)
20 EGUIET_BUTTON = 0, 20 EGUIET_BUTTON = 0,
21 21
22 //! A check box (IGUICheckBox) 22 //! A check box (IGUICheckBox)
23 EGUIET_CHECK_BOX, 23 EGUIET_CHECK_BOX,
24 24
25 //! A combo box (IGUIComboBox) 25 //! A combo box (IGUIComboBox)
26 EGUIET_COMBO_BOX, 26 EGUIET_COMBO_BOX,
27 27
28 //! A context menu (IGUIContextMenu) 28 //! A context menu (IGUIContextMenu)
29 EGUIET_CONTEXT_MENU, 29 EGUIET_CONTEXT_MENU,
30 30
31 //! A menu (IGUIMenu) 31 //! A menu (IGUIMenu)
32 EGUIET_MENU, 32 EGUIET_MENU,
33 33
34 //! An edit box (IGUIEditBox) 34 //! An edit box (IGUIEditBox)
35 EGUIET_EDIT_BOX, 35 EGUIET_EDIT_BOX,
36 36
37 //! A file open dialog (IGUIFileOpenDialog) 37 //! A file open dialog (IGUIFileOpenDialog)
38 EGUIET_FILE_OPEN_DIALOG, 38 EGUIET_FILE_OPEN_DIALOG,
39 39
40 //! A color select open dialog (IGUIColorSelectDialog) 40 //! A color select open dialog (IGUIColorSelectDialog)
41 EGUIET_COLOR_SELECT_DIALOG, 41 EGUIET_COLOR_SELECT_DIALOG,
42 42
43 //! A in/out fader (IGUIInOutFader) 43 //! A in/out fader (IGUIInOutFader)
44 EGUIET_IN_OUT_FADER, 44 EGUIET_IN_OUT_FADER,
45 45
46 //! An image (IGUIImage) 46 //! An image (IGUIImage)
47 EGUIET_IMAGE, 47 EGUIET_IMAGE,
48 48
49 //! A list box (IGUIListBox) 49 //! A list box (IGUIListBox)
50 EGUIET_LIST_BOX, 50 EGUIET_LIST_BOX,
51 51
52 //! A mesh viewer (IGUIMeshViewer) 52 //! A mesh viewer (IGUIMeshViewer)
53 EGUIET_MESH_VIEWER, 53 EGUIET_MESH_VIEWER,
54 54
55 //! A message box (IGUIWindow) 55 //! A message box (IGUIWindow)
56 EGUIET_MESSAGE_BOX, 56 EGUIET_MESSAGE_BOX,
57 57
58 //! A modal screen 58 //! A modal screen
59 EGUIET_MODAL_SCREEN, 59 EGUIET_MODAL_SCREEN,
60 60
61 //! A scroll bar (IGUIScrollBar) 61 //! A scroll bar (IGUIScrollBar)
62 EGUIET_SCROLL_BAR, 62 EGUIET_SCROLL_BAR,
63 63
64 //! A spin box (IGUISpinBox) 64 //! A spin box (IGUISpinBox)
65 EGUIET_SPIN_BOX, 65 EGUIET_SPIN_BOX,
66 66
67 //! A static text (IGUIStaticText) 67 //! A static text (IGUIStaticText)
68 EGUIET_STATIC_TEXT, 68 EGUIET_STATIC_TEXT,
69 69
70 //! A tab (IGUITab) 70 //! A tab (IGUITab)
71 EGUIET_TAB, 71 EGUIET_TAB,
72 72
73 //! A tab control 73 //! A tab control
74 EGUIET_TAB_CONTROL, 74 EGUIET_TAB_CONTROL,
75 75
76 //! A Table 76 //! A Table
77 EGUIET_TABLE, 77 EGUIET_TABLE,
78 78
79 //! A tool bar (IGUIToolBar) 79 //! A tool bar (IGUIToolBar)
80 EGUIET_TOOL_BAR, 80 EGUIET_TOOL_BAR,
81 81
82 //! A Tree View 82 //! A Tree View
83 EGUIET_TREE_VIEW, 83 EGUIET_TREE_VIEW,
84 84
85 //! A window 85 //! A window
86 EGUIET_WINDOW, 86 EGUIET_WINDOW,
87 87
88 //! Unknown type. 88 //! Unknown type.
89 EGUIET_ELEMENT, 89 EGUIET_ELEMENT,
90 90
91 //! The root of the GUI 91 //! The root of the GUI
92 EGUIET_ROOT, 92 EGUIET_ROOT,
93 93
94 //! Not an element, amount of elements in there 94 //! Not an element, amount of elements in there
95 EGUIET_COUNT, 95 EGUIET_COUNT,
96 96
97 //! This enum is never used, it only forces the compiler to compile this enumeration to 32 bit. 97 //! This enum is never used, it only forces the compiler to compile this enumeration to 32 bit.
98 EGUIET_FORCE_32_BIT = 0x7fffffff 98 EGUIET_FORCE_32_BIT = 0x7fffffff
99 99
100}; 100};
101 101
102//! Names for built-in element types 102//! Names for built-in element types
103const c8* const GUIElementTypeNames[] = 103const c8* const GUIElementTypeNames[] =
104{ 104{
105 "button", 105 "button",
106 "checkBox", 106 "checkBox",
107 "comboBox", 107 "comboBox",
108 "contextMenu", 108 "contextMenu",
109 "menu", 109 "menu",
110 "editBox", 110 "editBox",
111 "fileOpenDialog", 111 "fileOpenDialog",
112 "colorSelectDialog", 112 "colorSelectDialog",
113 "inOutFader", 113 "inOutFader",
114 "image", 114 "image",
115 "listBox", 115 "listBox",
116 "meshViewer", 116 "meshViewer",
117 "messageBox", 117 "messageBox",
118 "modalScreen", 118 "modalScreen",
119 "scrollBar", 119 "scrollBar",
120 "spinBox", 120 "spinBox",
121 "staticText", 121 "staticText",
122 "tab", 122 "tab",
123 "tabControl", 123 "tabControl",
124 "table", 124 "table",
125 "toolBar", 125 "toolBar",
126 "treeview", 126 "treeview",
127 "window", 127 "window",
128 "element", 128 "element",
129 "root", 129 "root",
130 0 130 0
131}; 131};
132 132
133} // end namespace gui 133} // end namespace gui
134} // end namespace irr 134} // end namespace irr
135 135
136#endif 136#endif
137 137
138 138
139 139
140 140
diff --git a/libraries/irrlicht-1.8/include/EHardwareBufferFlags.h b/libraries/irrlicht-1.8/include/EHardwareBufferFlags.h
index d759455..27d5610 100644
--- a/libraries/irrlicht-1.8/include/EHardwareBufferFlags.h
+++ b/libraries/irrlicht-1.8/include/EHardwareBufferFlags.h
@@ -1,44 +1,44 @@
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#ifndef __E_HARDWARE_BUFFER_FLAGS_INCLUDED__ 5#ifndef __E_HARDWARE_BUFFER_FLAGS_INCLUDED__
6#define __E_HARDWARE_BUFFER_FLAGS_INCLUDED__ 6#define __E_HARDWARE_BUFFER_FLAGS_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace scene 10namespace scene
11{ 11{
12 12
13 enum E_HARDWARE_MAPPING 13 enum E_HARDWARE_MAPPING
14 { 14 {
15 //! Don't store on the hardware 15 //! Don't store on the hardware
16 EHM_NEVER=0, 16 EHM_NEVER=0,
17 17
18 //! Rarely changed, usually stored completely on the hardware 18 //! Rarely changed, usually stored completely on the hardware
19 EHM_STATIC, 19 EHM_STATIC,
20 20
21 //! Sometimes changed, driver optimized placement 21 //! Sometimes changed, driver optimized placement
22 EHM_DYNAMIC, 22 EHM_DYNAMIC,
23 23
24 //! Always changed, cache optimizing on the GPU 24 //! Always changed, cache optimizing on the GPU
25 EHM_STREAM 25 EHM_STREAM
26 }; 26 };
27 27
28 enum E_BUFFER_TYPE 28 enum E_BUFFER_TYPE
29 { 29 {
30 //! Does not change anything 30 //! Does not change anything
31 EBT_NONE=0, 31 EBT_NONE=0,
32 //! Change the vertex mapping 32 //! Change the vertex mapping
33 EBT_VERTEX, 33 EBT_VERTEX,
34 //! Change the index mapping 34 //! Change the index mapping
35 EBT_INDEX, 35 EBT_INDEX,
36 //! Change both vertex and index mapping to the same value 36 //! Change both vertex and index mapping to the same value
37 EBT_VERTEX_AND_INDEX 37 EBT_VERTEX_AND_INDEX
38 }; 38 };
39 39
40} // end namespace scene 40} // end namespace scene
41} // end namespace irr 41} // end namespace irr
42 42
43#endif 43#endif
44 44
diff --git a/libraries/irrlicht-1.8/include/EMaterialFlags.h b/libraries/irrlicht-1.8/include/EMaterialFlags.h
index 0adc702..e336adc 100644
--- a/libraries/irrlicht-1.8/include/EMaterialFlags.h
+++ b/libraries/irrlicht-1.8/include/EMaterialFlags.h
@@ -1,95 +1,95 @@
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#ifndef __E_MATERIAL_FLAGS_H_INCLUDED__ 5#ifndef __E_MATERIAL_FLAGS_H_INCLUDED__
6#define __E_MATERIAL_FLAGS_H_INCLUDED__ 6#define __E_MATERIAL_FLAGS_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace video 10namespace video
11{ 11{
12 12
13 //! Material flags 13 //! Material flags
14 enum E_MATERIAL_FLAG 14 enum E_MATERIAL_FLAG
15 { 15 {
16 //! Draw as wireframe or filled triangles? Default: false 16 //! Draw as wireframe or filled triangles? Default: false
17 EMF_WIREFRAME = 0x1, 17 EMF_WIREFRAME = 0x1,
18 18
19 //! Draw as point cloud or filled triangles? Default: false 19 //! Draw as point cloud or filled triangles? Default: false
20 EMF_POINTCLOUD = 0x2, 20 EMF_POINTCLOUD = 0x2,
21 21
22 //! Flat or Gouraud shading? Default: true 22 //! Flat or Gouraud shading? Default: true
23 EMF_GOURAUD_SHADING = 0x4, 23 EMF_GOURAUD_SHADING = 0x4,
24 24
25 //! Will this material be lighted? Default: true 25 //! Will this material be lighted? Default: true
26 EMF_LIGHTING = 0x8, 26 EMF_LIGHTING = 0x8,
27 27
28 //! Is the ZBuffer enabled? Default: true 28 //! Is the ZBuffer enabled? Default: true
29 EMF_ZBUFFER = 0x10, 29 EMF_ZBUFFER = 0x10,
30 30
31 //! May be written to the zbuffer or is it readonly. Default: true 31 //! May be written to the zbuffer or is it readonly. Default: true
32 /** This flag is ignored, if the material type is a transparent type. */ 32 /** This flag is ignored, if the material type is a transparent type. */
33 EMF_ZWRITE_ENABLE = 0x20, 33 EMF_ZWRITE_ENABLE = 0x20,
34 34
35 //! Is backface culling enabled? Default: true 35 //! Is backface culling enabled? Default: true
36 EMF_BACK_FACE_CULLING = 0x40, 36 EMF_BACK_FACE_CULLING = 0x40,
37 37
38 //! Is frontface culling enabled? Default: false 38 //! Is frontface culling enabled? Default: false
39 /** Overrides EMF_BACK_FACE_CULLING if both are enabled. */ 39 /** Overrides EMF_BACK_FACE_CULLING if both are enabled. */
40 EMF_FRONT_FACE_CULLING = 0x80, 40 EMF_FRONT_FACE_CULLING = 0x80,
41 41
42 //! Is bilinear filtering enabled? Default: true 42 //! Is bilinear filtering enabled? Default: true
43 EMF_BILINEAR_FILTER = 0x100, 43 EMF_BILINEAR_FILTER = 0x100,
44 44
45 //! Is trilinear filtering enabled? Default: false 45 //! Is trilinear filtering enabled? Default: false
46 /** If the trilinear filter flag is enabled, 46 /** If the trilinear filter flag is enabled,
47 the bilinear filtering flag is ignored. */ 47 the bilinear filtering flag is ignored. */
48 EMF_TRILINEAR_FILTER = 0x200, 48 EMF_TRILINEAR_FILTER = 0x200,
49 49
50 //! Is anisotropic filtering? Default: false 50 //! Is anisotropic filtering? Default: false
51 /** In Irrlicht you can use anisotropic texture filtering in 51 /** In Irrlicht you can use anisotropic texture filtering in
52 conjunction with bilinear or trilinear texture filtering 52 conjunction with bilinear or trilinear texture filtering
53 to improve rendering results. Primitives will look less 53 to improve rendering results. Primitives will look less
54 blurry with this flag switched on. */ 54 blurry with this flag switched on. */
55 EMF_ANISOTROPIC_FILTER = 0x400, 55 EMF_ANISOTROPIC_FILTER = 0x400,
56 56
57 //! Is fog enabled? Default: false 57 //! Is fog enabled? Default: false
58 EMF_FOG_ENABLE = 0x800, 58 EMF_FOG_ENABLE = 0x800,
59 59
60 //! Normalizes normals. Default: false 60 //! Normalizes normals. Default: false
61 /** You can enable this if you need to scale a dynamic lighted 61 /** You can enable this if you need to scale a dynamic lighted
62 model. Usually, its normals will get scaled too then and it 62 model. Usually, its normals will get scaled too then and it
63 will get darker. If you enable the EMF_NORMALIZE_NORMALS flag, 63 will get darker. If you enable the EMF_NORMALIZE_NORMALS flag,
64 the normals will be normalized again, and the model will look 64 the normals will be normalized again, and the model will look
65 as bright as it should. */ 65 as bright as it should. */
66 EMF_NORMALIZE_NORMALS = 0x1000, 66 EMF_NORMALIZE_NORMALS = 0x1000,
67 67
68 //! Access to all layers texture wrap settings. Overwrites separate layer settings. 68 //! Access to all layers texture wrap settings. Overwrites separate layer settings.
69 EMF_TEXTURE_WRAP = 0x2000, 69 EMF_TEXTURE_WRAP = 0x2000,
70 70
71 //! AntiAliasing mode 71 //! AntiAliasing mode
72 EMF_ANTI_ALIASING = 0x4000, 72 EMF_ANTI_ALIASING = 0x4000,
73 73
74 //! ColorMask bits, for enabling the color planes 74 //! ColorMask bits, for enabling the color planes
75 EMF_COLOR_MASK = 0x8000, 75 EMF_COLOR_MASK = 0x8000,
76 76
77 //! ColorMaterial enum for vertex color interpretation 77 //! ColorMaterial enum for vertex color interpretation
78 EMF_COLOR_MATERIAL = 0x10000, 78 EMF_COLOR_MATERIAL = 0x10000,
79 79
80 //! Flag for enabling/disabling mipmap usage 80 //! Flag for enabling/disabling mipmap usage
81 EMF_USE_MIP_MAPS = 0x20000, 81 EMF_USE_MIP_MAPS = 0x20000,
82 82
83 //! Flag for blend operation 83 //! Flag for blend operation
84 EMF_BLEND_OPERATION = 0x40000, 84 EMF_BLEND_OPERATION = 0x40000,
85 85
86 //! Flag for polygon offset 86 //! Flag for polygon offset
87 EMF_POLYGON_OFFSET = 0x80000 87 EMF_POLYGON_OFFSET = 0x80000
88 }; 88 };
89 89
90} // end namespace video 90} // end namespace video
91} // end namespace irr 91} // end namespace irr
92 92
93 93
94#endif // __E_MATERIAL_FLAGS_H_INCLUDED__ 94#endif // __E_MATERIAL_FLAGS_H_INCLUDED__
95 95
diff --git a/libraries/irrlicht-1.8/include/EMaterialTypes.h b/libraries/irrlicht-1.8/include/EMaterialTypes.h
index 086ca34..5e5e075 100644
--- a/libraries/irrlicht-1.8/include/EMaterialTypes.h
+++ b/libraries/irrlicht-1.8/include/EMaterialTypes.h
@@ -1,234 +1,234 @@
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#ifndef __E_MATERIAL_TYPES_H_INCLUDED__ 5#ifndef __E_MATERIAL_TYPES_H_INCLUDED__
6#define __E_MATERIAL_TYPES_H_INCLUDED__ 6#define __E_MATERIAL_TYPES_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace video 10namespace video
11{ 11{
12 12
13 //! Abstracted and easy to use fixed function/programmable pipeline material modes. 13 //! Abstracted and easy to use fixed function/programmable pipeline material modes.
14 enum E_MATERIAL_TYPE 14 enum E_MATERIAL_TYPE
15 { 15 {
16 //! Standard solid material. 16 //! Standard solid material.
17 /** Only first texture is used, which is supposed to be the 17 /** Only first texture is used, which is supposed to be the
18 diffuse material. */ 18 diffuse material. */
19 EMT_SOLID = 0, 19 EMT_SOLID = 0,
20 20
21 //! Solid material with 2 texture layers. 21 //! Solid material with 2 texture layers.
22 /** The second is blended onto the first using the alpha value 22 /** The second is blended onto the first using the alpha value
23 of the vertex colors. This material is currently not implemented in OpenGL. 23 of the vertex colors. This material is currently not implemented in OpenGL.
24 */ 24 */
25 EMT_SOLID_2_LAYER, 25 EMT_SOLID_2_LAYER,
26 26
27 //! Material type with standard lightmap technique 27 //! Material type with standard lightmap technique
28 /** There should be 2 textures: The first texture layer is a 28 /** There should be 2 textures: The first texture layer is a
29 diffuse map, the second is a light map. Dynamic light is 29 diffuse map, the second is a light map. Dynamic light is
30 ignored. */ 30 ignored. */
31 EMT_LIGHTMAP, 31 EMT_LIGHTMAP,
32 32
33 //! Material type with lightmap technique like EMT_LIGHTMAP. 33 //! Material type with lightmap technique like EMT_LIGHTMAP.
34 /** But lightmap and diffuse texture are added instead of modulated. */ 34 /** But lightmap and diffuse texture are added instead of modulated. */
35 EMT_LIGHTMAP_ADD, 35 EMT_LIGHTMAP_ADD,
36 36
37 //! Material type with standard lightmap technique 37 //! Material type with standard lightmap technique
38 /** There should be 2 textures: The first texture layer is a 38 /** There should be 2 textures: The first texture layer is a
39 diffuse map, the second is a light map. Dynamic light is 39 diffuse map, the second is a light map. Dynamic light is
40 ignored. The texture colors are effectively multiplied by 2 40 ignored. The texture colors are effectively multiplied by 2
41 for brightening. Like known in DirectX as D3DTOP_MODULATE2X. */ 41 for brightening. Like known in DirectX as D3DTOP_MODULATE2X. */
42 EMT_LIGHTMAP_M2, 42 EMT_LIGHTMAP_M2,
43 43
44 //! Material type with standard lightmap technique 44 //! Material type with standard lightmap technique
45 /** There should be 2 textures: The first texture layer is a 45 /** There should be 2 textures: The first texture layer is a
46 diffuse map, the second is a light map. Dynamic light is 46 diffuse map, the second is a light map. Dynamic light is
47 ignored. The texture colors are effectively multiplyied by 4 47 ignored. The texture colors are effectively multiplyied by 4
48 for brightening. Like known in DirectX as D3DTOP_MODULATE4X. */ 48 for brightening. Like known in DirectX as D3DTOP_MODULATE4X. */
49 EMT_LIGHTMAP_M4, 49 EMT_LIGHTMAP_M4,
50 50
51 //! Like EMT_LIGHTMAP, but also supports dynamic lighting. 51 //! Like EMT_LIGHTMAP, but also supports dynamic lighting.
52 EMT_LIGHTMAP_LIGHTING, 52 EMT_LIGHTMAP_LIGHTING,
53 53
54 //! Like EMT_LIGHTMAP_M2, but also supports dynamic lighting. 54 //! Like EMT_LIGHTMAP_M2, but also supports dynamic lighting.
55 EMT_LIGHTMAP_LIGHTING_M2, 55 EMT_LIGHTMAP_LIGHTING_M2,
56 56
57 //! Like EMT_LIGHTMAP_4, but also supports dynamic lighting. 57 //! Like EMT_LIGHTMAP_4, but also supports dynamic lighting.
58 EMT_LIGHTMAP_LIGHTING_M4, 58 EMT_LIGHTMAP_LIGHTING_M4,
59 59
60 //! Detail mapped material. 60 //! Detail mapped material.
61 /** The first texture is diffuse color map, the second is added 61 /** The first texture is diffuse color map, the second is added
62 to this and usually displayed with a bigger scale value so that 62 to this and usually displayed with a bigger scale value so that
63 it adds more detail. The detail map is added to the diffuse map 63 it adds more detail. The detail map is added to the diffuse map
64 using ADD_SIGNED, so that it is possible to add and substract 64 using ADD_SIGNED, so that it is possible to add and substract
65 color from the diffuse map. For example a value of 65 color from the diffuse map. For example a value of
66 (127,127,127) will not change the appearance of the diffuse map 66 (127,127,127) will not change the appearance of the diffuse map
67 at all. Often used for terrain rendering. */ 67 at all. Often used for terrain rendering. */
68 EMT_DETAIL_MAP, 68 EMT_DETAIL_MAP,
69 69
70 //! Look like a reflection of the environment around it. 70 //! Look like a reflection of the environment around it.
71 /** To make this possible, a texture called 'sphere map' is 71 /** To make this possible, a texture called 'sphere map' is
72 used, which must be set as the first texture. */ 72 used, which must be set as the first texture. */
73 EMT_SPHERE_MAP, 73 EMT_SPHERE_MAP,
74 74
75 //! A reflecting material with an optional non reflecting texture layer. 75 //! A reflecting material with an optional non reflecting texture layer.
76 /** The reflection map should be set as first texture. */ 76 /** The reflection map should be set as first texture. */
77 EMT_REFLECTION_2_LAYER, 77 EMT_REFLECTION_2_LAYER,
78 78
79 //! A transparent material. 79 //! A transparent material.
80 /** Only the first texture is used. The new color is calculated 80 /** Only the first texture is used. The new color is calculated
81 by simply adding the source color and the dest color. This 81 by simply adding the source color and the dest color. This
82 means if for example a billboard using a texture with black 82 means if for example a billboard using a texture with black
83 background and a red circle on it is drawn with this material, 83 background and a red circle on it is drawn with this material,
84 the result is that only the red circle will be drawn a little 84 the result is that only the red circle will be drawn a little
85 bit transparent, and everything which was black is 100% 85 bit transparent, and everything which was black is 100%
86 transparent and not visible. This material type is useful for 86 transparent and not visible. This material type is useful for
87 particle effects. */ 87 particle effects. */
88 EMT_TRANSPARENT_ADD_COLOR, 88 EMT_TRANSPARENT_ADD_COLOR,
89 89
90 //! Makes the material transparent based on the texture alpha channel. 90 //! Makes the material transparent based on the texture alpha channel.
91 /** The final color is blended together from the destination 91 /** The final color is blended together from the destination
92 color and the texture color, using the alpha channel value as 92 color and the texture color, using the alpha channel value as
93 blend factor. Only first texture is used. If you are using 93 blend factor. Only first texture is used. If you are using
94 this material with small textures, it is a good idea to load 94 this material with small textures, it is a good idea to load
95 the texture in 32 bit mode 95 the texture in 32 bit mode
96 (video::IVideoDriver::setTextureCreationFlag()). Also, an alpha 96 (video::IVideoDriver::setTextureCreationFlag()). Also, an alpha
97 ref is used, which can be manipulated using 97 ref is used, which can be manipulated using
98 SMaterial::MaterialTypeParam. This value controls how sharp the 98 SMaterial::MaterialTypeParam. This value controls how sharp the
99 edges become when going from a transparent to a solid spot on 99 edges become when going from a transparent to a solid spot on
100 the texture. */ 100 the texture. */
101 EMT_TRANSPARENT_ALPHA_CHANNEL, 101 EMT_TRANSPARENT_ALPHA_CHANNEL,
102 102
103 //! Makes the material transparent based on the texture alpha channel. 103 //! Makes the material transparent based on the texture alpha channel.
104 /** If the alpha channel value is greater than 127, a 104 /** If the alpha channel value is greater than 127, a
105 pixel is written to the target, otherwise not. This 105 pixel is written to the target, otherwise not. This
106 material does not use alpha blending and is a lot faster 106 material does not use alpha blending and is a lot faster
107 than EMT_TRANSPARENT_ALPHA_CHANNEL. It is ideal for drawing 107 than EMT_TRANSPARENT_ALPHA_CHANNEL. It is ideal for drawing
108 stuff like leafes of plants, because the borders are not 108 stuff like leafes of plants, because the borders are not
109 blurry but sharp. Only first texture is used. If you are 109 blurry but sharp. Only first texture is used. If you are
110 using this material with small textures and 3d object, it 110 using this material with small textures and 3d object, it
111 is a good idea to load the texture in 32 bit mode 111 is a good idea to load the texture in 32 bit mode
112 (video::IVideoDriver::setTextureCreationFlag()). */ 112 (video::IVideoDriver::setTextureCreationFlag()). */
113 EMT_TRANSPARENT_ALPHA_CHANNEL_REF, 113 EMT_TRANSPARENT_ALPHA_CHANNEL_REF,
114 114
115 //! Makes the material transparent based on the vertex alpha value. 115 //! Makes the material transparent based on the vertex alpha value.
116 EMT_TRANSPARENT_VERTEX_ALPHA, 116 EMT_TRANSPARENT_VERTEX_ALPHA,
117 117
118 //! A transparent reflecting material with an optional additional non reflecting texture layer. 118 //! A transparent reflecting material with an optional additional non reflecting texture layer.
119 /** The reflection map should be set as first texture. The 119 /** The reflection map should be set as first texture. The
120 transparency depends on the alpha value in the vertex colors. A 120 transparency depends on the alpha value in the vertex colors. A
121 texture which will not reflect can be set as second texture. 121 texture which will not reflect can be set as second texture.
122 Please note that this material type is currently not 100% 122 Please note that this material type is currently not 100%
123 implemented in OpenGL. */ 123 implemented in OpenGL. */
124 EMT_TRANSPARENT_REFLECTION_2_LAYER, 124 EMT_TRANSPARENT_REFLECTION_2_LAYER,
125 125
126 //! A solid normal map renderer. 126 //! A solid normal map renderer.
127 /** First texture is the color map, the second should be the 127 /** First texture is the color map, the second should be the
128 normal map. Note that you should use this material only when 128 normal map. Note that you should use this material only when
129 drawing geometry consisting of vertices of type 129 drawing geometry consisting of vertices of type
130 S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into 130 S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into
131 this format using IMeshManipulator::createMeshWithTangents() 131 this format using IMeshManipulator::createMeshWithTangents()
132 (See SpecialFX2 Tutorial). This shader runs on vertex shader 132 (See SpecialFX2 Tutorial). This shader runs on vertex shader
133 1.1 and pixel shader 1.1 capable hardware and falls back to a 133 1.1 and pixel shader 1.1 capable hardware and falls back to a
134 fixed function lighted material if this hardware is not 134 fixed function lighted material if this hardware is not
135 available. Only two lights are supported by this shader, if 135 available. Only two lights are supported by this shader, if
136 there are more, the nearest two are chosen. */ 136 there are more, the nearest two are chosen. */
137 EMT_NORMAL_MAP_SOLID, 137 EMT_NORMAL_MAP_SOLID,
138 138
139 //! A transparent normal map renderer. 139 //! A transparent normal map renderer.
140 /** First texture is the color map, the second should be the 140 /** First texture is the color map, the second should be the
141 normal map. Note that you should use this material only when 141 normal map. Note that you should use this material only when
142 drawing geometry consisting of vertices of type 142 drawing geometry consisting of vertices of type
143 S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into 143 S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into
144 this format using IMeshManipulator::createMeshWithTangents() 144 this format using IMeshManipulator::createMeshWithTangents()
145 (See SpecialFX2 Tutorial). This shader runs on vertex shader 145 (See SpecialFX2 Tutorial). This shader runs on vertex shader
146 1.1 and pixel shader 1.1 capable hardware and falls back to a 146 1.1 and pixel shader 1.1 capable hardware and falls back to a
147 fixed function lighted material if this hardware is not 147 fixed function lighted material if this hardware is not
148 available. Only two lights are supported by this shader, if 148 available. Only two lights are supported by this shader, if
149 there are more, the nearest two are chosen. */ 149 there are more, the nearest two are chosen. */
150 EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR, 150 EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR,
151 151
152 //! A transparent (based on the vertex alpha value) normal map renderer. 152 //! A transparent (based on the vertex alpha value) normal map renderer.
153 /** First texture is the color map, the second should be the 153 /** First texture is the color map, the second should be the
154 normal map. Note that you should use this material only when 154 normal map. Note that you should use this material only when
155 drawing geometry consisting of vertices of type 155 drawing geometry consisting of vertices of type
156 S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into 156 S3DVertexTangents (EVT_TANGENTS). You can convert any mesh into
157 this format using IMeshManipulator::createMeshWithTangents() 157 this format using IMeshManipulator::createMeshWithTangents()
158 (See SpecialFX2 Tutorial). This shader runs on vertex shader 158 (See SpecialFX2 Tutorial). This shader runs on vertex shader
159 1.1 and pixel shader 1.1 capable hardware and falls back to a 159 1.1 and pixel shader 1.1 capable hardware and falls back to a
160 fixed function lighted material if this hardware is not 160 fixed function lighted material if this hardware is not
161 available. Only two lights are supported by this shader, if 161 available. Only two lights are supported by this shader, if
162 there are more, the nearest two are chosen. */ 162 there are more, the nearest two are chosen. */
163 EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA, 163 EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA,
164 164
165 //! Just like EMT_NORMAL_MAP_SOLID, but uses parallax mapping. 165 //! Just like EMT_NORMAL_MAP_SOLID, but uses parallax mapping.
166 /** Looks a lot more realistic. This only works when the 166 /** Looks a lot more realistic. This only works when the
167 hardware supports at least vertex shader 1.1 and pixel shader 167 hardware supports at least vertex shader 1.1 and pixel shader
168 1.4. First texture is the color map, the second should be the 168 1.4. First texture is the color map, the second should be the
169 normal map. The normal map texture should contain the height 169 normal map. The normal map texture should contain the height
170 value in the alpha component. The 170 value in the alpha component. The
171 IVideoDriver::makeNormalMapTexture() method writes this value 171 IVideoDriver::makeNormalMapTexture() method writes this value
172 automatically when creating normal maps from a heightmap when 172 automatically when creating normal maps from a heightmap when
173 using a 32 bit texture. The height scale of the material 173 using a 32 bit texture. The height scale of the material
174 (affecting the bumpiness) is being controlled by the 174 (affecting the bumpiness) is being controlled by the
175 SMaterial::MaterialTypeParam member. If set to zero, the 175 SMaterial::MaterialTypeParam member. If set to zero, the
176 default value (0.02f) will be applied. Otherwise the value set 176 default value (0.02f) will be applied. Otherwise the value set
177 in SMaterial::MaterialTypeParam is taken. This value depends on 177 in SMaterial::MaterialTypeParam is taken. This value depends on
178 with which scale the texture is mapped on the material. Too 178 with which scale the texture is mapped on the material. Too
179 high or low values of MaterialTypeParam can result in strange 179 high or low values of MaterialTypeParam can result in strange
180 artifacts. */ 180 artifacts. */
181 EMT_PARALLAX_MAP_SOLID, 181 EMT_PARALLAX_MAP_SOLID,
182 182
183 //! A material like EMT_PARALLAX_MAP_SOLID, but transparent. 183 //! A material like EMT_PARALLAX_MAP_SOLID, but transparent.
184 /** Using EMT_TRANSPARENT_ADD_COLOR as base material. */ 184 /** Using EMT_TRANSPARENT_ADD_COLOR as base material. */
185 EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR, 185 EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR,
186 186
187 //! A material like EMT_PARALLAX_MAP_SOLID, but transparent. 187 //! A material like EMT_PARALLAX_MAP_SOLID, but transparent.
188 /** Using EMT_TRANSPARENT_VERTEX_ALPHA as base material. */ 188 /** Using EMT_TRANSPARENT_VERTEX_ALPHA as base material. */
189 EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA, 189 EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA,
190 190
191 //! BlendFunc = source * sourceFactor + dest * destFactor ( E_BLEND_FUNC ) 191 //! BlendFunc = source * sourceFactor + dest * destFactor ( E_BLEND_FUNC )
192 /** Using only first texture. Generic blending method. */ 192 /** Using only first texture. Generic blending method. */
193 EMT_ONETEXTURE_BLEND, 193 EMT_ONETEXTURE_BLEND,
194 194
195 //! This value is not used. It only forces this enumeration to compile to 32 bit. 195 //! This value is not used. It only forces this enumeration to compile to 32 bit.
196 EMT_FORCE_32BIT = 0x7fffffff 196 EMT_FORCE_32BIT = 0x7fffffff
197 }; 197 };
198 198
199 //! Array holding the built in material type names 199 //! Array holding the built in material type names
200 const char* const sBuiltInMaterialTypeNames[] = 200 const char* const sBuiltInMaterialTypeNames[] =
201 { 201 {
202 "solid", 202 "solid",
203 "solid_2layer", 203 "solid_2layer",
204 "lightmap", 204 "lightmap",
205 "lightmap_add", 205 "lightmap_add",
206 "lightmap_m2", 206 "lightmap_m2",
207 "lightmap_m4", 207 "lightmap_m4",
208 "lightmap_light", 208 "lightmap_light",
209 "lightmap_light_m2", 209 "lightmap_light_m2",
210 "lightmap_light_m4", 210 "lightmap_light_m4",
211 "detail_map", 211 "detail_map",
212 "sphere_map", 212 "sphere_map",
213 "reflection_2layer", 213 "reflection_2layer",
214 "trans_add", 214 "trans_add",
215 "trans_alphach", 215 "trans_alphach",
216 "trans_alphach_ref", 216 "trans_alphach_ref",
217 "trans_vertex_alpha", 217 "trans_vertex_alpha",
218 "trans_reflection_2layer", 218 "trans_reflection_2layer",
219 "normalmap_solid", 219 "normalmap_solid",
220 "normalmap_trans_add", 220 "normalmap_trans_add",
221 "normalmap_trans_vertexalpha", 221 "normalmap_trans_vertexalpha",
222 "parallaxmap_solid", 222 "parallaxmap_solid",
223 "parallaxmap_trans_add", 223 "parallaxmap_trans_add",
224 "parallaxmap_trans_vertexalpha", 224 "parallaxmap_trans_vertexalpha",
225 "onetexture_blend", 225 "onetexture_blend",
226 0 226 0
227 }; 227 };
228 228
229} // end namespace video 229} // end namespace video
230} // end namespace irr 230} // end namespace irr
231 231
232 232
233#endif // __E_MATERIAL_TYPES_H_INCLUDED__ 233#endif // __E_MATERIAL_TYPES_H_INCLUDED__
234 234
diff --git a/libraries/irrlicht-1.8/include/EMeshWriterEnums.h b/libraries/irrlicht-1.8/include/EMeshWriterEnums.h
index fb2cfa4..ceeaa7a 100644
--- a/libraries/irrlicht-1.8/include/EMeshWriterEnums.h
+++ b/libraries/irrlicht-1.8/include/EMeshWriterEnums.h
@@ -1,59 +1,59 @@
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#ifndef __E_MESH_WRITER_ENUMS_H_INCLUDED__ 5#ifndef __E_MESH_WRITER_ENUMS_H_INCLUDED__
6#define __E_MESH_WRITER_ENUMS_H_INCLUDED__ 6#define __E_MESH_WRITER_ENUMS_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15 //! An enumeration for all supported types of built-in mesh writers 15 //! An enumeration for all supported types of built-in mesh writers
16 /** A scene mesh writers is represented by a four character code 16 /** A scene mesh writers is represented by a four character code
17 such as 'irrm' or 'coll' instead of simple numbers, to avoid 17 such as 'irrm' or 'coll' instead of simple numbers, to avoid
18 name clashes with external mesh writers.*/ 18 name clashes with external mesh writers.*/
19 enum EMESH_WRITER_TYPE 19 enum EMESH_WRITER_TYPE
20 { 20 {
21 //! Irrlicht native mesh writer, for static .irrmesh files. 21 //! Irrlicht native mesh writer, for static .irrmesh files.
22 EMWT_IRR_MESH = MAKE_IRR_ID('i','r','r','m'), 22 EMWT_IRR_MESH = MAKE_IRR_ID('i','r','r','m'),
23 23
24 //! COLLADA mesh writer for .dae and .xml files 24 //! COLLADA mesh writer for .dae and .xml files
25 EMWT_COLLADA = MAKE_IRR_ID('c','o','l','l'), 25 EMWT_COLLADA = MAKE_IRR_ID('c','o','l','l'),
26 26
27 //! STL mesh writer for .stl files 27 //! STL mesh writer for .stl files
28 EMWT_STL = MAKE_IRR_ID('s','t','l',0), 28 EMWT_STL = MAKE_IRR_ID('s','t','l',0),
29 29
30 //! OBJ mesh writer for .obj files 30 //! OBJ mesh writer for .obj files
31 EMWT_OBJ = MAKE_IRR_ID('o','b','j',0), 31 EMWT_OBJ = MAKE_IRR_ID('o','b','j',0),
32 32
33 //! PLY mesh writer for .ply files 33 //! PLY mesh writer for .ply files
34 EMWT_PLY = MAKE_IRR_ID('p','l','y',0) 34 EMWT_PLY = MAKE_IRR_ID('p','l','y',0)
35 }; 35 };
36 36
37 37
38 //! flags configuring mesh writing 38 //! flags configuring mesh writing
39 enum E_MESH_WRITER_FLAGS 39 enum E_MESH_WRITER_FLAGS
40 { 40 {
41 //! no writer flags 41 //! no writer flags
42 EMWF_NONE = 0, 42 EMWF_NONE = 0,
43 43
44 //! write lightmap textures out if possible 44 //! write lightmap textures out if possible
45 EMWF_WRITE_LIGHTMAPS = 0x1, 45 EMWF_WRITE_LIGHTMAPS = 0x1,
46 46
47 //! write in a way that consumes less disk space 47 //! write in a way that consumes less disk space
48 EMWF_WRITE_COMPRESSED = 0x2, 48 EMWF_WRITE_COMPRESSED = 0x2,
49 49
50 //! write in binary format rather than text 50 //! write in binary format rather than text
51 EMWF_WRITE_BINARY = 0x4 51 EMWF_WRITE_BINARY = 0x4
52 }; 52 };
53 53
54} // end namespace scene 54} // end namespace scene
55} // end namespace irr 55} // end namespace irr
56 56
57 57
58#endif // __E_MESH_WRITER_ENUMS_H_INCLUDED__ 58#endif // __E_MESH_WRITER_ENUMS_H_INCLUDED__
59 59
diff --git a/libraries/irrlicht-1.8/include/EMessageBoxFlags.h b/libraries/irrlicht-1.8/include/EMessageBoxFlags.h
index 878db7f..ed2d766 100644
--- a/libraries/irrlicht-1.8/include/EMessageBoxFlags.h
+++ b/libraries/irrlicht-1.8/include/EMessageBoxFlags.h
@@ -1,36 +1,36 @@
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#ifndef __E_MESSAGE_BOX_FLAGS_H_INCLUDED__ 5#ifndef __E_MESSAGE_BOX_FLAGS_H_INCLUDED__
6#define __E_MESSAGE_BOX_FLAGS_H_INCLUDED__ 6#define __E_MESSAGE_BOX_FLAGS_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace gui 10namespace gui
11{ 11{
12 12
13//! enumeration for message box layout flags 13//! enumeration for message box layout flags
14enum EMESSAGE_BOX_FLAG 14enum EMESSAGE_BOX_FLAG
15{ 15{
16 //! Flag for the ok button 16 //! Flag for the ok button
17 EMBF_OK = 0x1, 17 EMBF_OK = 0x1,
18 18
19 //! Flag for the cancel button 19 //! Flag for the cancel button
20 EMBF_CANCEL = 0x2, 20 EMBF_CANCEL = 0x2,
21 21
22 //! Flag for the yes button 22 //! Flag for the yes button
23 EMBF_YES = 0x4, 23 EMBF_YES = 0x4,
24 24
25 //! Flag for the no button 25 //! Flag for the no button
26 EMBF_NO = 0x8, 26 EMBF_NO = 0x8,
27 27
28 //! This value is not used. It only forces this enumeration to compile in 32 bit. 28 //! This value is not used. It only forces this enumeration to compile in 32 bit.
29 EMBF_FORCE_32BIT = 0x7fffffff 29 EMBF_FORCE_32BIT = 0x7fffffff
30}; 30};
31 31
32} // namespace gui 32} // namespace gui
33} // namespace irr 33} // namespace irr
34 34
35#endif 35#endif
36 36
diff --git a/libraries/irrlicht-1.8/include/EPrimitiveTypes.h b/libraries/irrlicht-1.8/include/EPrimitiveTypes.h
index 6b082c1..7c61d42 100644
--- a/libraries/irrlicht-1.8/include/EPrimitiveTypes.h
+++ b/libraries/irrlicht-1.8/include/EPrimitiveTypes.h
@@ -1,56 +1,56 @@
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#ifndef __E_PRIMITIVE_TYPES_H_INCLUDED__ 5#ifndef __E_PRIMITIVE_TYPES_H_INCLUDED__
6#define __E_PRIMITIVE_TYPES_H_INCLUDED__ 6#define __E_PRIMITIVE_TYPES_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace scene 10namespace scene
11{ 11{
12 12
13 //! Enumeration for all primitive types there are. 13 //! Enumeration for all primitive types there are.
14 enum E_PRIMITIVE_TYPE 14 enum E_PRIMITIVE_TYPE
15 { 15 {
16 //! All vertices are non-connected points. 16 //! All vertices are non-connected points.
17 EPT_POINTS=0, 17 EPT_POINTS=0,
18 18
19 //! All vertices form a single connected line. 19 //! All vertices form a single connected line.
20 EPT_LINE_STRIP, 20 EPT_LINE_STRIP,
21 21
22 //! Just as LINE_STRIP, but the last and the first vertex is also connected. 22 //! Just as LINE_STRIP, but the last and the first vertex is also connected.
23 EPT_LINE_LOOP, 23 EPT_LINE_LOOP,
24 24
25 //! Every two vertices are connected creating n/2 lines. 25 //! Every two vertices are connected creating n/2 lines.
26 EPT_LINES, 26 EPT_LINES,
27 27
28 //! After the first two vertices each vertex defines a new triangle. 28 //! After the first two vertices each vertex defines a new triangle.
29 //! Always the two last and the new one form a new triangle. 29 //! Always the two last and the new one form a new triangle.
30 EPT_TRIANGLE_STRIP, 30 EPT_TRIANGLE_STRIP,
31 31
32 //! After the first two vertices each vertex defines a new triangle. 32 //! After the first two vertices each vertex defines a new triangle.
33 //! All around the common first vertex. 33 //! All around the common first vertex.
34 EPT_TRIANGLE_FAN, 34 EPT_TRIANGLE_FAN,
35 35
36 //! Explicitly set all vertices for each triangle. 36 //! Explicitly set all vertices for each triangle.
37 EPT_TRIANGLES, 37 EPT_TRIANGLES,
38 38
39 //! After the first two vertices each further tw vetices create a quad with the preceding two. 39 //! After the first two vertices each further tw vetices create a quad with the preceding two.
40 EPT_QUAD_STRIP, 40 EPT_QUAD_STRIP,
41 41
42 //! Every four vertices create a quad. 42 //! Every four vertices create a quad.
43 EPT_QUADS, 43 EPT_QUADS,
44 44
45 //! Just as LINE_LOOP, but filled. 45 //! Just as LINE_LOOP, but filled.
46 EPT_POLYGON, 46 EPT_POLYGON,
47 47
48 //! The single vertices are expanded to quad billboards on the GPU. 48 //! The single vertices are expanded to quad billboards on the GPU.
49 EPT_POINT_SPRITES 49 EPT_POINT_SPRITES
50 }; 50 };
51 51
52} // end namespace scene 52} // end namespace scene
53} // end namespace irr 53} // end namespace irr
54 54
55#endif 55#endif
56 56
diff --git a/libraries/irrlicht-1.8/include/ESceneNodeAnimatorTypes.h b/libraries/irrlicht-1.8/include/ESceneNodeAnimatorTypes.h
index d3e0936..078739d 100644
--- a/libraries/irrlicht-1.8/include/ESceneNodeAnimatorTypes.h
+++ b/libraries/irrlicht-1.8/include/ESceneNodeAnimatorTypes.h
@@ -1,58 +1,58 @@
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#ifndef __E_SCENE_NODE_ANIMATOR_TYPES_H_INCLUDED__ 5#ifndef __E_SCENE_NODE_ANIMATOR_TYPES_H_INCLUDED__
6#define __E_SCENE_NODE_ANIMATOR_TYPES_H_INCLUDED__ 6#define __E_SCENE_NODE_ANIMATOR_TYPES_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace scene 10namespace scene
11{ 11{
12 12
13 //! An enumeration for all types of built-in scene node animators 13 //! An enumeration for all types of built-in scene node animators
14 enum ESCENE_NODE_ANIMATOR_TYPE 14 enum ESCENE_NODE_ANIMATOR_TYPE
15 { 15 {
16 //! Fly circle scene node animator 16 //! Fly circle scene node animator
17 ESNAT_FLY_CIRCLE = 0, 17 ESNAT_FLY_CIRCLE = 0,
18 18
19 //! Fly straight scene node animator 19 //! Fly straight scene node animator
20 ESNAT_FLY_STRAIGHT, 20 ESNAT_FLY_STRAIGHT,
21 21
22 //! Follow spline scene node animator 22 //! Follow spline scene node animator
23 ESNAT_FOLLOW_SPLINE, 23 ESNAT_FOLLOW_SPLINE,
24 24
25 //! Rotation scene node animator 25 //! Rotation scene node animator
26 ESNAT_ROTATION, 26 ESNAT_ROTATION,
27 27
28 //! Texture scene node animator 28 //! Texture scene node animator
29 ESNAT_TEXTURE, 29 ESNAT_TEXTURE,
30 30
31 //! Deletion scene node animator 31 //! Deletion scene node animator
32 ESNAT_DELETION, 32 ESNAT_DELETION,
33 33
34 //! Collision respose scene node animator 34 //! Collision respose scene node animator
35 ESNAT_COLLISION_RESPONSE, 35 ESNAT_COLLISION_RESPONSE,
36 36
37 //! FPS camera animator 37 //! FPS camera animator
38 ESNAT_CAMERA_FPS, 38 ESNAT_CAMERA_FPS,
39 39
40 //! Maya camera animator 40 //! Maya camera animator
41 ESNAT_CAMERA_MAYA, 41 ESNAT_CAMERA_MAYA,
42 42
43 //! Amount of built-in scene node animators 43 //! Amount of built-in scene node animators
44 ESNAT_COUNT, 44 ESNAT_COUNT,
45 45
46 //! Unknown scene node animator 46 //! Unknown scene node animator
47 ESNAT_UNKNOWN, 47 ESNAT_UNKNOWN,
48 48
49 //! This enum is never used, it only forces the compiler to compile this enumeration to 32 bit. 49 //! This enum is never used, it only forces the compiler to compile this enumeration to 32 bit.
50 ESNAT_FORCE_32_BIT = 0x7fffffff 50 ESNAT_FORCE_32_BIT = 0x7fffffff
51 }; 51 };
52 52
53} // end namespace scene 53} // end namespace scene
54} // end namespace irr 54} // end namespace irr
55 55
56 56
57#endif 57#endif
58 58
diff --git a/libraries/irrlicht-1.8/include/ESceneNodeTypes.h b/libraries/irrlicht-1.8/include/ESceneNodeTypes.h
index a0d5aa4..3d43105 100644
--- a/libraries/irrlicht-1.8/include/ESceneNodeTypes.h
+++ b/libraries/irrlicht-1.8/include/ESceneNodeTypes.h
@@ -1,106 +1,106 @@
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#ifndef __E_SCENE_NODE_TYPES_H_INCLUDED__ 5#ifndef __E_SCENE_NODE_TYPES_H_INCLUDED__
6#define __E_SCENE_NODE_TYPES_H_INCLUDED__ 6#define __E_SCENE_NODE_TYPES_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15 //! An enumeration for all types of built-in scene nodes 15 //! An enumeration for all types of built-in scene nodes
16 /** A scene node type is represented by a four character code 16 /** A scene node type is represented by a four character code
17 such as 'cube' or 'mesh' instead of simple numbers, to avoid 17 such as 'cube' or 'mesh' instead of simple numbers, to avoid
18 name clashes with external scene nodes.*/ 18 name clashes with external scene nodes.*/
19 enum ESCENE_NODE_TYPE 19 enum ESCENE_NODE_TYPE
20 { 20 {
21 //! of type CSceneManager (note that ISceneManager is not(!) an ISceneNode) 21 //! of type CSceneManager (note that ISceneManager is not(!) an ISceneNode)
22 ESNT_SCENE_MANAGER = MAKE_IRR_ID('s','m','n','g'), 22 ESNT_SCENE_MANAGER = MAKE_IRR_ID('s','m','n','g'),
23 23
24 //! simple cube scene node 24 //! simple cube scene node
25 ESNT_CUBE = MAKE_IRR_ID('c','u','b','e'), 25 ESNT_CUBE = MAKE_IRR_ID('c','u','b','e'),
26 26
27 //! Sphere scene node 27 //! Sphere scene node
28 ESNT_SPHERE = MAKE_IRR_ID('s','p','h','r'), 28 ESNT_SPHERE = MAKE_IRR_ID('s','p','h','r'),
29 29
30 //! Text Scene Node 30 //! Text Scene Node
31 ESNT_TEXT = MAKE_IRR_ID('t','e','x','t'), 31 ESNT_TEXT = MAKE_IRR_ID('t','e','x','t'),
32 32
33 //! Water Surface Scene Node 33 //! Water Surface Scene Node
34 ESNT_WATER_SURFACE = MAKE_IRR_ID('w','a','t','r'), 34 ESNT_WATER_SURFACE = MAKE_IRR_ID('w','a','t','r'),
35 35
36 //! Terrain Scene Node 36 //! Terrain Scene Node
37 ESNT_TERRAIN = MAKE_IRR_ID('t','e','r','r'), 37 ESNT_TERRAIN = MAKE_IRR_ID('t','e','r','r'),
38 38
39 //! Sky Box Scene Node 39 //! Sky Box Scene Node
40 ESNT_SKY_BOX = MAKE_IRR_ID('s','k','y','_'), 40 ESNT_SKY_BOX = MAKE_IRR_ID('s','k','y','_'),
41 41
42 //! Sky Dome Scene Node 42 //! Sky Dome Scene Node
43 ESNT_SKY_DOME = MAKE_IRR_ID('s','k','y','d'), 43 ESNT_SKY_DOME = MAKE_IRR_ID('s','k','y','d'),
44 44
45 //! Shadow Volume Scene Node 45 //! Shadow Volume Scene Node
46 ESNT_SHADOW_VOLUME = MAKE_IRR_ID('s','h','d','w'), 46 ESNT_SHADOW_VOLUME = MAKE_IRR_ID('s','h','d','w'),
47 47
48 //! Octree Scene Node 48 //! Octree Scene Node
49 ESNT_OCTREE = MAKE_IRR_ID('o','c','t','r'), 49 ESNT_OCTREE = MAKE_IRR_ID('o','c','t','r'),
50 50
51 //! Mesh Scene Node 51 //! Mesh Scene Node
52 ESNT_MESH = MAKE_IRR_ID('m','e','s','h'), 52 ESNT_MESH = MAKE_IRR_ID('m','e','s','h'),
53 53
54 //! Light Scene Node 54 //! Light Scene Node
55 ESNT_LIGHT = MAKE_IRR_ID('l','g','h','t'), 55 ESNT_LIGHT = MAKE_IRR_ID('l','g','h','t'),
56 56
57 //! Empty Scene Node 57 //! Empty Scene Node
58 ESNT_EMPTY = MAKE_IRR_ID('e','m','t','y'), 58 ESNT_EMPTY = MAKE_IRR_ID('e','m','t','y'),
59 59
60 //! Dummy Transformation Scene Node 60 //! Dummy Transformation Scene Node
61 ESNT_DUMMY_TRANSFORMATION = MAKE_IRR_ID('d','m','m','y'), 61 ESNT_DUMMY_TRANSFORMATION = MAKE_IRR_ID('d','m','m','y'),
62 62
63 //! Camera Scene Node 63 //! Camera Scene Node
64 ESNT_CAMERA = MAKE_IRR_ID('c','a','m','_'), 64 ESNT_CAMERA = MAKE_IRR_ID('c','a','m','_'),
65 65
66 //! Billboard Scene Node 66 //! Billboard Scene Node
67 ESNT_BILLBOARD = MAKE_IRR_ID('b','i','l','l'), 67 ESNT_BILLBOARD = MAKE_IRR_ID('b','i','l','l'),
68 68
69 //! Animated Mesh Scene Node 69 //! Animated Mesh Scene Node
70 ESNT_ANIMATED_MESH = MAKE_IRR_ID('a','m','s','h'), 70 ESNT_ANIMATED_MESH = MAKE_IRR_ID('a','m','s','h'),
71 71
72 //! Particle System Scene Node 72 //! Particle System Scene Node
73 ESNT_PARTICLE_SYSTEM = MAKE_IRR_ID('p','t','c','l'), 73 ESNT_PARTICLE_SYSTEM = MAKE_IRR_ID('p','t','c','l'),
74 74
75 //! Quake3 Shader Scene Node 75 //! Quake3 Shader Scene Node
76 ESNT_Q3SHADER_SCENE_NODE = MAKE_IRR_ID('q','3','s','h'), 76 ESNT_Q3SHADER_SCENE_NODE = MAKE_IRR_ID('q','3','s','h'),
77 77
78 //! Quake3 Model Scene Node ( has tag to link to ) 78 //! Quake3 Model Scene Node ( has tag to link to )
79 ESNT_MD3_SCENE_NODE = MAKE_IRR_ID('m','d','3','_'), 79 ESNT_MD3_SCENE_NODE = MAKE_IRR_ID('m','d','3','_'),
80 80
81 //! Volume Light Scene Node 81 //! Volume Light Scene Node
82 ESNT_VOLUME_LIGHT = MAKE_IRR_ID('v','o','l','l'), 82 ESNT_VOLUME_LIGHT = MAKE_IRR_ID('v','o','l','l'),
83 83
84 //! Maya Camera Scene Node 84 //! Maya Camera Scene Node
85 /** Legacy, for loading version <= 1.4.x .irr files */ 85 /** Legacy, for loading version <= 1.4.x .irr files */
86 ESNT_CAMERA_MAYA = MAKE_IRR_ID('c','a','m','M'), 86 ESNT_CAMERA_MAYA = MAKE_IRR_ID('c','a','m','M'),
87 87
88 //! First Person Shooter Camera 88 //! First Person Shooter Camera
89 /** Legacy, for loading version <= 1.4.x .irr files */ 89 /** Legacy, for loading version <= 1.4.x .irr files */
90 ESNT_CAMERA_FPS = MAKE_IRR_ID('c','a','m','F'), 90 ESNT_CAMERA_FPS = MAKE_IRR_ID('c','a','m','F'),
91 91
92 //! Unknown scene node 92 //! Unknown scene node
93 ESNT_UNKNOWN = MAKE_IRR_ID('u','n','k','n'), 93 ESNT_UNKNOWN = MAKE_IRR_ID('u','n','k','n'),
94 94
95 //! Will match with any scene node when checking types 95 //! Will match with any scene node when checking types
96 ESNT_ANY = MAKE_IRR_ID('a','n','y','_') 96 ESNT_ANY = MAKE_IRR_ID('a','n','y','_')
97 }; 97 };
98 98
99 99
100 100
101} // end namespace scene 101} // end namespace scene
102} // end namespace irr 102} // end namespace irr
103 103
104 104
105#endif 105#endif
106 106
diff --git a/libraries/irrlicht-1.8/include/EShaderTypes.h b/libraries/irrlicht-1.8/include/EShaderTypes.h
index 29eef56..691930c 100644
--- a/libraries/irrlicht-1.8/include/EShaderTypes.h
+++ b/libraries/irrlicht-1.8/include/EShaderTypes.h
@@ -1,90 +1,90 @@
1#ifndef __E_SHADER_TYPES_H_INCLUDED__ 1#ifndef __E_SHADER_TYPES_H_INCLUDED__
2#define __E_SHADER_TYPES_H_INCLUDED__ 2#define __E_SHADER_TYPES_H_INCLUDED__
3 3
4#include "irrTypes.h" 4#include "irrTypes.h"
5 5
6namespace irr 6namespace irr
7{ 7{
8namespace video 8namespace video
9{ 9{
10 10
11//! Compile target enumeration for the addHighLevelShaderMaterial() method. 11//! Compile target enumeration for the addHighLevelShaderMaterial() method.
12enum E_VERTEX_SHADER_TYPE 12enum E_VERTEX_SHADER_TYPE
13{ 13{
14 EVST_VS_1_1 = 0, 14 EVST_VS_1_1 = 0,
15 EVST_VS_2_0, 15 EVST_VS_2_0,
16 EVST_VS_2_a, 16 EVST_VS_2_a,
17 EVST_VS_3_0, 17 EVST_VS_3_0,
18 EVST_VS_4_0, 18 EVST_VS_4_0,
19 EVST_VS_4_1, 19 EVST_VS_4_1,
20 EVST_VS_5_0, 20 EVST_VS_5_0,
21 21
22 //! This is not a type, but a value indicating how much types there are. 22 //! This is not a type, but a value indicating how much types there are.
23 EVST_COUNT 23 EVST_COUNT
24}; 24};
25 25
26//! Names for all vertex shader types, each entry corresponds to a E_VERTEX_SHADER_TYPE entry. 26//! Names for all vertex shader types, each entry corresponds to a E_VERTEX_SHADER_TYPE entry.
27const c8* const VERTEX_SHADER_TYPE_NAMES[] = { 27const c8* const VERTEX_SHADER_TYPE_NAMES[] = {
28 "vs_1_1", 28 "vs_1_1",
29 "vs_2_0", 29 "vs_2_0",
30 "vs_2_a", 30 "vs_2_a",
31 "vs_3_0", 31 "vs_3_0",
32 "vs_4_0", 32 "vs_4_0",
33 "vs_4_1", 33 "vs_4_1",
34 "vs_5_0", 34 "vs_5_0",
35 0 }; 35 0 };
36 36
37//! Compile target enumeration for the addHighLevelShaderMaterial() method. 37//! Compile target enumeration for the addHighLevelShaderMaterial() method.
38enum E_PIXEL_SHADER_TYPE 38enum E_PIXEL_SHADER_TYPE
39{ 39{
40 EPST_PS_1_1 = 0, 40 EPST_PS_1_1 = 0,
41 EPST_PS_1_2, 41 EPST_PS_1_2,
42 EPST_PS_1_3, 42 EPST_PS_1_3,
43 EPST_PS_1_4, 43 EPST_PS_1_4,
44 EPST_PS_2_0, 44 EPST_PS_2_0,
45 EPST_PS_2_a, 45 EPST_PS_2_a,
46 EPST_PS_2_b, 46 EPST_PS_2_b,
47 EPST_PS_3_0, 47 EPST_PS_3_0,
48 EPST_PS_4_0, 48 EPST_PS_4_0,
49 EPST_PS_4_1, 49 EPST_PS_4_1,
50 EPST_PS_5_0, 50 EPST_PS_5_0,
51 51
52 //! This is not a type, but a value indicating how much types there are. 52 //! This is not a type, but a value indicating how much types there are.
53 EPST_COUNT 53 EPST_COUNT
54}; 54};
55 55
56//! Names for all pixel shader types, each entry corresponds to a E_PIXEL_SHADER_TYPE entry. 56//! Names for all pixel shader types, each entry corresponds to a E_PIXEL_SHADER_TYPE entry.
57const c8* const PIXEL_SHADER_TYPE_NAMES[] = { 57const c8* const PIXEL_SHADER_TYPE_NAMES[] = {
58 "ps_1_1", 58 "ps_1_1",
59 "ps_1_2", 59 "ps_1_2",
60 "ps_1_3", 60 "ps_1_3",
61 "ps_1_4", 61 "ps_1_4",
62 "ps_2_0", 62 "ps_2_0",
63 "ps_2_a", 63 "ps_2_a",
64 "ps_2_b", 64 "ps_2_b",
65 "ps_3_0", 65 "ps_3_0",
66 "ps_4_0", 66 "ps_4_0",
67 "ps_4_1", 67 "ps_4_1",
68 "ps_5_0", 68 "ps_5_0",
69 0 }; 69 0 };
70 70
71//! Enum for supported geometry shader types 71//! Enum for supported geometry shader types
72enum E_GEOMETRY_SHADER_TYPE 72enum E_GEOMETRY_SHADER_TYPE
73{ 73{
74 EGST_GS_4_0 = 0, 74 EGST_GS_4_0 = 0,
75 75
76 //! This is not a type, but a value indicating how much types there are. 76 //! This is not a type, but a value indicating how much types there are.
77 EGST_COUNT 77 EGST_COUNT
78}; 78};
79 79
80//! String names for supported geometry shader types 80//! String names for supported geometry shader types
81const c8* const GEOMETRY_SHADER_TYPE_NAMES[] = { 81const c8* const GEOMETRY_SHADER_TYPE_NAMES[] = {
82 "gs_4_0", 82 "gs_4_0",
83 0 }; 83 0 };
84 84
85 85
86} // end namespace video 86} // end namespace video
87} // end namespace irr 87} // end namespace irr
88 88
89#endif // __E_SHADER_TYPES_H_INCLUDED__ 89#endif // __E_SHADER_TYPES_H_INCLUDED__
90 90
diff --git a/libraries/irrlicht-1.8/include/ETerrainElements.h b/libraries/irrlicht-1.8/include/ETerrainElements.h
index 5bb48c0..b09ac39 100644
--- a/libraries/irrlicht-1.8/include/ETerrainElements.h
+++ b/libraries/irrlicht-1.8/include/ETerrainElements.h
@@ -1,36 +1,36 @@
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#ifndef __E_TERRAIN_ELEMENTS_H__ 5#ifndef __E_TERRAIN_ELEMENTS_H__
6#define __E_TERRAIN_ELEMENTS_H__ 6#define __E_TERRAIN_ELEMENTS_H__
7 7
8namespace irr 8namespace irr
9{ 9{
10namespace scene 10namespace scene
11{ 11{
12 12
13 //! enumeration for patch sizes specifying the size of patches in the TerrainSceneNode 13 //! enumeration for patch sizes specifying the size of patches in the TerrainSceneNode
14 enum E_TERRAIN_PATCH_SIZE 14 enum E_TERRAIN_PATCH_SIZE
15 { 15 {
16 //! patch size of 9, at most, use 4 levels of detail with this patch size. 16 //! patch size of 9, at most, use 4 levels of detail with this patch size.
17 ETPS_9 = 9, 17 ETPS_9 = 9,
18 18
19 //! patch size of 17, at most, use 5 levels of detail with this patch size. 19 //! patch size of 17, at most, use 5 levels of detail with this patch size.
20 ETPS_17 = 17, 20 ETPS_17 = 17,
21 21
22 //! patch size of 33, at most, use 6 levels of detail with this patch size. 22 //! patch size of 33, at most, use 6 levels of detail with this patch size.
23 ETPS_33 = 33, 23 ETPS_33 = 33,
24 24
25 //! patch size of 65, at most, use 7 levels of detail with this patch size. 25 //! patch size of 65, at most, use 7 levels of detail with this patch size.
26 ETPS_65 = 65, 26 ETPS_65 = 65,
27 27
28 //! patch size of 129, at most, use 8 levels of detail with this patch size. 28 //! patch size of 129, at most, use 8 levels of detail with this patch size.
29 ETPS_129 = 129 29 ETPS_129 = 129
30 }; 30 };
31 31
32} // end namespace scene 32} // end namespace scene
33} // end namespace irr 33} // end namespace irr
34 34
35#endif 35#endif
36 36
diff --git a/libraries/irrlicht-1.8/include/IAnimatedMesh.h b/libraries/irrlicht-1.8/include/IAnimatedMesh.h
index 3e08528..ec6eee0 100644
--- a/libraries/irrlicht-1.8/include/IAnimatedMesh.h
+++ b/libraries/irrlicht-1.8/include/IAnimatedMesh.h
@@ -1,115 +1,115 @@
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#ifndef __I_ANIMATED_MESH_H_INCLUDED__ 5#ifndef __I_ANIMATED_MESH_H_INCLUDED__
6#define __I_ANIMATED_MESH_H_INCLUDED__ 6#define __I_ANIMATED_MESH_H_INCLUDED__
7 7
8#include "aabbox3d.h" 8#include "aabbox3d.h"
9#include "IMesh.h" 9#include "IMesh.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 //! Possible types of (animated) meshes. 15 //! Possible types of (animated) meshes.
16 enum E_ANIMATED_MESH_TYPE 16 enum E_ANIMATED_MESH_TYPE
17 { 17 {
18 //! Unknown animated mesh type. 18 //! Unknown animated mesh type.
19 EAMT_UNKNOWN = 0, 19 EAMT_UNKNOWN = 0,
20 20
21 //! Quake 2 MD2 model file 21 //! Quake 2 MD2 model file
22 EAMT_MD2, 22 EAMT_MD2,
23 23
24 //! Quake 3 MD3 model file 24 //! Quake 3 MD3 model file
25 EAMT_MD3, 25 EAMT_MD3,
26 26
27 //! Maya .obj static model 27 //! Maya .obj static model
28 EAMT_OBJ, 28 EAMT_OBJ,
29 29
30 //! Quake 3 .bsp static Map 30 //! Quake 3 .bsp static Map
31 EAMT_BSP, 31 EAMT_BSP,
32 32
33 //! 3D Studio .3ds file 33 //! 3D Studio .3ds file
34 EAMT_3DS, 34 EAMT_3DS,
35 35
36 //! My3D Mesh, the file format by Zhuck Dimitry 36 //! My3D Mesh, the file format by Zhuck Dimitry
37 EAMT_MY3D, 37 EAMT_MY3D,
38 38
39 //! Pulsar LMTools .lmts file. This Irrlicht loader was written by Jonas Petersen 39 //! Pulsar LMTools .lmts file. This Irrlicht loader was written by Jonas Petersen
40 EAMT_LMTS, 40 EAMT_LMTS,
41 41
42 //! Cartography Shop .csm file. This loader was created by Saurav Mohapatra. 42 //! Cartography Shop .csm file. This loader was created by Saurav Mohapatra.
43 EAMT_CSM, 43 EAMT_CSM,
44 44
45 //! .oct file for Paul Nette's FSRad or from Murphy McCauley's Blender .oct exporter. 45 //! .oct file for Paul Nette's FSRad or from Murphy McCauley's Blender .oct exporter.
46 /** The oct file format contains 3D geometry and lightmaps and 46 /** The oct file format contains 3D geometry and lightmaps and
47 can be loaded directly by Irrlicht */ 47 can be loaded directly by Irrlicht */
48 EAMT_OCT, 48 EAMT_OCT,
49 49
50 //! Halflife MDL model file 50 //! Halflife MDL model file
51 EAMT_MDL_HALFLIFE, 51 EAMT_MDL_HALFLIFE,
52 52
53 //! generic skinned mesh 53 //! generic skinned mesh
54 EAMT_SKINNED 54 EAMT_SKINNED
55 }; 55 };
56 56
57 //! Interface for an animated mesh. 57 //! Interface for an animated mesh.
58 /** There are already simple implementations of this interface available so 58 /** There are already simple implementations of this interface available so
59 you don't have to implement this interface on your own if you need to: 59 you don't have to implement this interface on your own if you need to:
60 You might want to use irr::scene::SAnimatedMesh, irr::scene::SMesh, 60 You might want to use irr::scene::SAnimatedMesh, irr::scene::SMesh,
61 irr::scene::SMeshBuffer etc. */ 61 irr::scene::SMeshBuffer etc. */
62 class IAnimatedMesh : public IMesh 62 class IAnimatedMesh : public IMesh
63 { 63 {
64 public: 64 public:
65 65
66 //! Gets the frame count of the animated mesh. 66 //! Gets the frame count of the animated mesh.
67 /** \return The amount of frames. If the amount is 1, 67 /** \return The amount of frames. If the amount is 1,
68 it is a static, non animated mesh. */ 68 it is a static, non animated mesh. */
69 virtual u32 getFrameCount() const = 0; 69 virtual u32 getFrameCount() const = 0;
70 70
71 //! Gets the animation speed of the animated mesh. 71 //! Gets the animation speed of the animated mesh.
72 /** \return The number of frames per second to play the 72 /** \return The number of frames per second to play the
73 animation with by default. If the amount is 0, 73 animation with by default. If the amount is 0,
74 it is a static, non animated mesh. */ 74 it is a static, non animated mesh. */
75 virtual f32 getAnimationSpeed() const = 0; 75 virtual f32 getAnimationSpeed() const = 0;
76 76
77 //! Sets the animation speed of the animated mesh. 77 //! Sets the animation speed of the animated mesh.
78 /** \param fps Number of frames per second to play the 78 /** \param fps Number of frames per second to play the
79 animation with by default. If the amount is 0, 79 animation with by default. If the amount is 0,
80 it is not animated. The actual speed is set in the 80 it is not animated. The actual speed is set in the
81 scene node the mesh is instantiated in.*/ 81 scene node the mesh is instantiated in.*/
82 virtual void setAnimationSpeed(f32 fps) =0; 82 virtual void setAnimationSpeed(f32 fps) =0;
83 83
84 //! Returns the IMesh interface for a frame. 84 //! Returns the IMesh interface for a frame.
85 /** \param frame: Frame number as zero based index. The maximum 85 /** \param frame: Frame number as zero based index. The maximum
86 frame number is getFrameCount() - 1; 86 frame number is getFrameCount() - 1;
87 \param detailLevel: Level of detail. 0 is the lowest, 255 the 87 \param detailLevel: Level of detail. 0 is the lowest, 255 the
88 highest level of detail. Most meshes will ignore the detail level. 88 highest level of detail. Most meshes will ignore the detail level.
89 \param startFrameLoop: Because some animated meshes (.MD2) are 89 \param startFrameLoop: Because some animated meshes (.MD2) are
90 blended between 2 static frames, and maybe animated in a loop, 90 blended between 2 static frames, and maybe animated in a loop,
91 the startFrameLoop and the endFrameLoop have to be defined, to 91 the startFrameLoop and the endFrameLoop have to be defined, to
92 prevent the animation to be blended between frames which are 92 prevent the animation to be blended between frames which are
93 outside of this loop. 93 outside of this loop.
94 If startFrameLoop and endFrameLoop are both -1, they are ignored. 94 If startFrameLoop and endFrameLoop are both -1, they are ignored.
95 \param endFrameLoop: see startFrameLoop. 95 \param endFrameLoop: see startFrameLoop.
96 \return Returns the animated mesh based on a detail level. */ 96 \return Returns the animated mesh based on a detail level. */
97 virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) = 0; 97 virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) = 0;
98 98
99 //! Returns the type of the animated mesh. 99 //! Returns the type of the animated mesh.
100 /** In most cases it is not neccessary to use this method. 100 /** In most cases it is not neccessary to use this method.
101 This is useful for making a safe downcast. For example, 101 This is useful for making a safe downcast. For example,
102 if getMeshType() returns EAMT_MD2 it's safe to cast the 102 if getMeshType() returns EAMT_MD2 it's safe to cast the
103 IAnimatedMesh to IAnimatedMeshMD2. 103 IAnimatedMesh to IAnimatedMeshMD2.
104 \returns Type of the mesh. */ 104 \returns Type of the mesh. */
105 virtual E_ANIMATED_MESH_TYPE getMeshType() const 105 virtual E_ANIMATED_MESH_TYPE getMeshType() const
106 { 106 {
107 return EAMT_UNKNOWN; 107 return EAMT_UNKNOWN;
108 } 108 }
109 }; 109 };
110 110
111} // end namespace scene 111} // end namespace scene
112} // end namespace irr 112} // end namespace irr
113 113
114#endif 114#endif
115 115
diff --git a/libraries/irrlicht-1.8/include/IAnimatedMeshMD2.h b/libraries/irrlicht-1.8/include/IAnimatedMeshMD2.h
index 6830f37..333394e 100644
--- a/libraries/irrlicht-1.8/include/IAnimatedMeshMD2.h
+++ b/libraries/irrlicht-1.8/include/IAnimatedMeshMD2.h
@@ -1,79 +1,79 @@
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#ifndef __I_ANIMATED_MESH_MD2_H_INCLUDED__ 5#ifndef __I_ANIMATED_MESH_MD2_H_INCLUDED__
6#define __I_ANIMATED_MESH_MD2_H_INCLUDED__ 6#define __I_ANIMATED_MESH_MD2_H_INCLUDED__
7 7
8#include "IAnimatedMesh.h" 8#include "IAnimatedMesh.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15 //! Types of standard md2 animations 15 //! Types of standard md2 animations
16 enum EMD2_ANIMATION_TYPE 16 enum EMD2_ANIMATION_TYPE
17 { 17 {
18 EMAT_STAND = 0, 18 EMAT_STAND = 0,
19 EMAT_RUN, 19 EMAT_RUN,
20 EMAT_ATTACK, 20 EMAT_ATTACK,
21 EMAT_PAIN_A, 21 EMAT_PAIN_A,
22 EMAT_PAIN_B, 22 EMAT_PAIN_B,
23 EMAT_PAIN_C, 23 EMAT_PAIN_C,
24 EMAT_JUMP, 24 EMAT_JUMP,
25 EMAT_FLIP, 25 EMAT_FLIP,
26 EMAT_SALUTE, 26 EMAT_SALUTE,
27 EMAT_FALLBACK, 27 EMAT_FALLBACK,
28 EMAT_WAVE, 28 EMAT_WAVE,
29 EMAT_POINT, 29 EMAT_POINT,
30 EMAT_CROUCH_STAND, 30 EMAT_CROUCH_STAND,
31 EMAT_CROUCH_WALK, 31 EMAT_CROUCH_WALK,
32 EMAT_CROUCH_ATTACK, 32 EMAT_CROUCH_ATTACK,
33 EMAT_CROUCH_PAIN, 33 EMAT_CROUCH_PAIN,
34 EMAT_CROUCH_DEATH, 34 EMAT_CROUCH_DEATH,
35 EMAT_DEATH_FALLBACK, 35 EMAT_DEATH_FALLBACK,
36 EMAT_DEATH_FALLFORWARD, 36 EMAT_DEATH_FALLFORWARD,
37 EMAT_DEATH_FALLBACKSLOW, 37 EMAT_DEATH_FALLBACKSLOW,
38 EMAT_BOOM, 38 EMAT_BOOM,
39 39
40 //! Not an animation, but amount of animation types. 40 //! Not an animation, but amount of animation types.
41 EMAT_COUNT 41 EMAT_COUNT
42 }; 42 };
43 43
44 //! Interface for using some special functions of MD2 meshes 44 //! Interface for using some special functions of MD2 meshes
45 class IAnimatedMeshMD2 : public IAnimatedMesh 45 class IAnimatedMeshMD2 : public IAnimatedMesh
46 { 46 {
47 public: 47 public:
48 48
49 //! Get frame loop data for a default MD2 animation type. 49 //! Get frame loop data for a default MD2 animation type.
50 /** \param l The EMD2_ANIMATION_TYPE to get the frames for. 50 /** \param l The EMD2_ANIMATION_TYPE to get the frames for.
51 \param outBegin The returned beginning frame for animation type specified. 51 \param outBegin The returned beginning frame for animation type specified.
52 \param outEnd The returned ending frame for the animation type specified. 52 \param outEnd The returned ending frame for the animation type specified.
53 \param outFPS The number of frames per second, this animation should be played at. 53 \param outFPS The number of frames per second, this animation should be played at.
54 \return beginframe, endframe and frames per second for a default MD2 animation type. */ 54 \return beginframe, endframe and frames per second for a default MD2 animation type. */
55 virtual void getFrameLoop(EMD2_ANIMATION_TYPE l, s32& outBegin, 55 virtual void getFrameLoop(EMD2_ANIMATION_TYPE l, s32& outBegin,
56 s32& outEnd, s32& outFPS) const = 0; 56 s32& outEnd, s32& outFPS) const = 0;
57 57
58 //! Get frame loop data for a special MD2 animation type, identified by name. 58 //! Get frame loop data for a special MD2 animation type, identified by name.
59 /** \param name Name of the animation. 59 /** \param name Name of the animation.
60 \param outBegin The returned beginning frame for animation type specified. 60 \param outBegin The returned beginning frame for animation type specified.
61 \param outEnd The returned ending frame for the animation type specified. 61 \param outEnd The returned ending frame for the animation type specified.
62 \param outFPS The number of frames per second, this animation should be played at. 62 \param outFPS The number of frames per second, this animation should be played at.
63 \return beginframe, endframe and frames per second for a special MD2 animation type. */ 63 \return beginframe, endframe and frames per second for a special MD2 animation type. */
64 virtual bool getFrameLoop(const c8* name, 64 virtual bool getFrameLoop(const c8* name,
65 s32& outBegin, s32& outEnd, s32& outFPS) const = 0; 65 s32& outBegin, s32& outEnd, s32& outFPS) const = 0;
66 66
67 //! Get amount of md2 animations in this file. 67 //! Get amount of md2 animations in this file.
68 virtual s32 getAnimationCount() const = 0; 68 virtual s32 getAnimationCount() const = 0;
69 69
70 //! Get name of md2 animation. 70 //! Get name of md2 animation.
71 /** \param nr: Zero based index of animation. */ 71 /** \param nr: Zero based index of animation. */
72 virtual const c8* getAnimationName(s32 nr) const = 0; 72 virtual const c8* getAnimationName(s32 nr) const = 0;
73 }; 73 };
74 74
75} // end namespace scene 75} // end namespace scene
76} // end namespace irr 76} // end namespace irr
77 77
78#endif 78#endif
79 79
diff --git a/libraries/irrlicht-1.8/include/IAnimatedMeshMD3.h b/libraries/irrlicht-1.8/include/IAnimatedMeshMD3.h
index 35c1c97..93b24c1 100644
--- a/libraries/irrlicht-1.8/include/IAnimatedMeshMD3.h
+++ b/libraries/irrlicht-1.8/include/IAnimatedMeshMD3.h
@@ -1,304 +1,304 @@
1// Copyright (C) 2007-2012 Nikolaus Gebhardt / Thomas Alten 1// Copyright (C) 2007-2012 Nikolaus Gebhardt / Thomas Alten
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#ifndef __I_ANIMATED_MESH_MD3_H_INCLUDED__ 5#ifndef __I_ANIMATED_MESH_MD3_H_INCLUDED__
6#define __I_ANIMATED_MESH_MD3_H_INCLUDED__ 6#define __I_ANIMATED_MESH_MD3_H_INCLUDED__
7 7
8#include "IAnimatedMesh.h" 8#include "IAnimatedMesh.h"
9#include "IQ3Shader.h" 9#include "IQ3Shader.h"
10#include "quaternion.h" 10#include "quaternion.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace scene 14namespace scene
15{ 15{
16 16
17 enum eMD3Models 17 enum eMD3Models
18 { 18 {
19 EMD3_HEAD = 0, 19 EMD3_HEAD = 0,
20 EMD3_UPPER, 20 EMD3_UPPER,
21 EMD3_LOWER, 21 EMD3_LOWER,
22 EMD3_WEAPON, 22 EMD3_WEAPON,
23 EMD3_NUMMODELS 23 EMD3_NUMMODELS
24 }; 24 };
25 25
26 //! Animation list 26 //! Animation list
27 enum EMD3_ANIMATION_TYPE 27 enum EMD3_ANIMATION_TYPE
28 { 28 {
29 // Animations for both lower and upper parts of the player 29 // Animations for both lower and upper parts of the player
30 EMD3_BOTH_DEATH_1 = 0, 30 EMD3_BOTH_DEATH_1 = 0,
31 EMD3_BOTH_DEAD_1, 31 EMD3_BOTH_DEAD_1,
32 EMD3_BOTH_DEATH_2, 32 EMD3_BOTH_DEATH_2,
33 EMD3_BOTH_DEAD_2, 33 EMD3_BOTH_DEAD_2,
34 EMD3_BOTH_DEATH_3, 34 EMD3_BOTH_DEATH_3,
35 EMD3_BOTH_DEAD_3, 35 EMD3_BOTH_DEAD_3,
36 36
37 // Animations for the upper part 37 // Animations for the upper part
38 EMD3_TORSO_GESTURE, 38 EMD3_TORSO_GESTURE,
39 EMD3_TORSO_ATTACK_1, 39 EMD3_TORSO_ATTACK_1,
40 EMD3_TORSO_ATTACK_2, 40 EMD3_TORSO_ATTACK_2,
41 EMD3_TORSO_DROP, 41 EMD3_TORSO_DROP,
42 EMD3_TORSO_RAISE, 42 EMD3_TORSO_RAISE,
43 EMD3_TORSO_STAND_1, 43 EMD3_TORSO_STAND_1,
44 EMD3_TORSO_STAND_2, 44 EMD3_TORSO_STAND_2,
45 45
46 // Animations for the lower part 46 // Animations for the lower part
47 EMD3_LEGS_WALK_CROUCH, 47 EMD3_LEGS_WALK_CROUCH,
48 EMD3_LEGS_WALK, 48 EMD3_LEGS_WALK,
49 EMD3_LEGS_RUN, 49 EMD3_LEGS_RUN,
50 EMD3_LEGS_BACK, 50 EMD3_LEGS_BACK,
51 EMD3_LEGS_SWIM, 51 EMD3_LEGS_SWIM,
52 EMD3_LEGS_JUMP_1, 52 EMD3_LEGS_JUMP_1,
53 EMD3_LEGS_LAND_1, 53 EMD3_LEGS_LAND_1,
54 EMD3_LEGS_JUMP_2, 54 EMD3_LEGS_JUMP_2,
55 EMD3_LEGS_LAND_2, 55 EMD3_LEGS_LAND_2,
56 EMD3_LEGS_IDLE, 56 EMD3_LEGS_IDLE,
57 EMD3_LEGS_IDLE_CROUCH, 57 EMD3_LEGS_IDLE_CROUCH,
58 EMD3_LEGS_TURN, 58 EMD3_LEGS_TURN,
59 59
60 //! Not an animation, but amount of animation types. 60 //! Not an animation, but amount of animation types.
61 EMD3_ANIMATION_COUNT 61 EMD3_ANIMATION_COUNT
62 }; 62 };
63 63
64 struct SMD3AnimationInfo 64 struct SMD3AnimationInfo
65 { 65 {
66 //! First frame 66 //! First frame
67 s32 first; 67 s32 first;
68 //! Last frame 68 //! Last frame
69 s32 num; 69 s32 num;
70 //! Looping frames 70 //! Looping frames
71 s32 looping; 71 s32 looping;
72 //! Frames per second 72 //! Frames per second
73 s32 fps; 73 s32 fps;
74 }; 74 };
75 75
76 76
77// byte-align structures 77// byte-align structures
78#include "irrpack.h" 78#include "irrpack.h"
79 79
80 //! this holds the header info of the MD3 file 80 //! this holds the header info of the MD3 file
81 struct SMD3Header 81 struct SMD3Header
82 { 82 {
83 c8 headerID[4]; //id of file, always "IDP3" 83 c8 headerID[4]; //id of file, always "IDP3"
84 s32 Version; //this is a version number, always 15 84 s32 Version; //this is a version number, always 15
85 s8 fileName[68]; //sometimes left Blank... 65 chars, 32bit aligned == 68 chars 85 s8 fileName[68]; //sometimes left Blank... 65 chars, 32bit aligned == 68 chars
86 s32 numFrames; //number of KeyFrames 86 s32 numFrames; //number of KeyFrames
87 s32 numTags; //number of 'tags' per frame 87 s32 numTags; //number of 'tags' per frame
88 s32 numMeshes; //number of meshes/skins 88 s32 numMeshes; //number of meshes/skins
89 s32 numMaxSkins; //maximum number of unique skins used in md3 file. artefact md2 89 s32 numMaxSkins; //maximum number of unique skins used in md3 file. artefact md2
90 s32 frameStart; //starting position of frame-structur 90 s32 frameStart; //starting position of frame-structur
91 s32 tagStart; //starting position of tag-structures 91 s32 tagStart; //starting position of tag-structures
92 s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures 92 s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures
93 s32 fileSize; 93 s32 fileSize;
94 } PACK_STRUCT; 94 } PACK_STRUCT;
95 95
96 //! this holds the header info of an MD3 mesh section 96 //! this holds the header info of an MD3 mesh section
97 struct SMD3MeshHeader 97 struct SMD3MeshHeader
98 { 98 {
99 c8 meshID[4]; //id, must be IDP3 99 c8 meshID[4]; //id, must be IDP3
100 c8 meshName[68]; //name of mesh 65 chars, 32 bit aligned == 68 chars 100 c8 meshName[68]; //name of mesh 65 chars, 32 bit aligned == 68 chars
101 101
102 s32 numFrames; //number of meshframes in mesh 102 s32 numFrames; //number of meshframes in mesh
103 s32 numShader; //number of skins in mesh 103 s32 numShader; //number of skins in mesh
104 s32 numVertices; //number of vertices 104 s32 numVertices; //number of vertices
105 s32 numTriangles; //number of Triangles 105 s32 numTriangles; //number of Triangles
106 106
107 s32 offset_triangles; //starting position of Triangle data, relative to start of Mesh_Header 107 s32 offset_triangles; //starting position of Triangle data, relative to start of Mesh_Header
108 s32 offset_shaders; //size of header 108 s32 offset_shaders; //size of header
109 s32 offset_st; //starting position of texvector data, relative to start of Mesh_Header 109 s32 offset_st; //starting position of texvector data, relative to start of Mesh_Header
110 s32 vertexStart; //starting position of vertex data,relative to start of Mesh_Header 110 s32 vertexStart; //starting position of vertex data,relative to start of Mesh_Header
111 s32 offset_end; 111 s32 offset_end;
112 } PACK_STRUCT; 112 } PACK_STRUCT;
113 113
114 114
115 //! Compressed Vertex Data 115 //! Compressed Vertex Data
116 struct SMD3Vertex 116 struct SMD3Vertex
117 { 117 {
118 s16 position[3]; 118 s16 position[3];
119 u8 normal[2]; 119 u8 normal[2];
120 } PACK_STRUCT; 120 } PACK_STRUCT;
121 121
122 //! Texture Coordinate 122 //! Texture Coordinate
123 struct SMD3TexCoord 123 struct SMD3TexCoord
124 { 124 {
125 f32 u; 125 f32 u;
126 f32 v; 126 f32 v;
127 } PACK_STRUCT; 127 } PACK_STRUCT;
128 128
129 //! Triangle Index 129 //! Triangle Index
130 struct SMD3Face 130 struct SMD3Face
131 { 131 {
132 s32 Index[3]; 132 s32 Index[3];
133 } PACK_STRUCT; 133 } PACK_STRUCT;
134 134
135 135
136// Default alignment 136// Default alignment
137#include "irrunpack.h" 137#include "irrunpack.h"
138 138
139 //! Holding Frame Data for a Mesh 139 //! Holding Frame Data for a Mesh
140 struct SMD3MeshBuffer : public IReferenceCounted 140 struct SMD3MeshBuffer : public IReferenceCounted
141 { 141 {
142 SMD3MeshHeader MeshHeader; 142 SMD3MeshHeader MeshHeader;
143 143
144 core::stringc Shader; 144 core::stringc Shader;
145 core::array < s32 > Indices; 145 core::array < s32 > Indices;
146 core::array < SMD3Vertex > Vertices; 146 core::array < SMD3Vertex > Vertices;
147 core::array < SMD3TexCoord > Tex; 147 core::array < SMD3TexCoord > Tex;
148 }; 148 };
149 149
150 //! hold a tag info for connecting meshes 150 //! hold a tag info for connecting meshes
151 /** Basically its an alternate way to describe a transformation. */ 151 /** Basically its an alternate way to describe a transformation. */
152 struct SMD3QuaternionTag 152 struct SMD3QuaternionTag
153 { 153 {
154 virtual ~SMD3QuaternionTag() 154 virtual ~SMD3QuaternionTag()
155 { 155 {
156 position.X = 0.f; 156 position.X = 0.f;
157 } 157 }
158 158
159 // construct copy constructor 159 // construct copy constructor
160 SMD3QuaternionTag( const SMD3QuaternionTag & copyMe ) 160 SMD3QuaternionTag( const SMD3QuaternionTag & copyMe )
161 { 161 {
162 *this = copyMe; 162 *this = copyMe;
163 } 163 }
164 164
165 // construct for searching 165 // construct for searching
166 SMD3QuaternionTag( const core::stringc& name ) 166 SMD3QuaternionTag( const core::stringc& name )
167 : Name ( name ) {} 167 : Name ( name ) {}
168 168
169 // construct from a position and euler angles in degrees 169 // construct from a position and euler angles in degrees
170 SMD3QuaternionTag ( const core::vector3df &pos, const core::vector3df &angle ) 170 SMD3QuaternionTag ( const core::vector3df &pos, const core::vector3df &angle )
171 : position(pos), rotation(angle * core::DEGTORAD) {} 171 : position(pos), rotation(angle * core::DEGTORAD) {}
172 172
173 // set to matrix 173 // set to matrix
174 void setto ( core::matrix4 &m ) 174 void setto ( core::matrix4 &m )
175 { 175 {
176 rotation.getMatrix ( m, position ); 176 rotation.getMatrix ( m, position );
177 } 177 }
178 178
179 bool operator == ( const SMD3QuaternionTag &other ) const 179 bool operator == ( const SMD3QuaternionTag &other ) const
180 { 180 {
181 return Name == other.Name; 181 return Name == other.Name;
182 } 182 }
183 183
184 SMD3QuaternionTag & operator=( const SMD3QuaternionTag & copyMe ) 184 SMD3QuaternionTag & operator=( const SMD3QuaternionTag & copyMe )
185 { 185 {
186 Name = copyMe.Name; 186 Name = copyMe.Name;
187 position = copyMe.position; 187 position = copyMe.position;
188 rotation = copyMe.rotation; 188 rotation = copyMe.rotation;
189 return *this; 189 return *this;
190 } 190 }
191 191
192 core::stringc Name; 192 core::stringc Name;
193 core::vector3df position; 193 core::vector3df position;
194 core::quaternion rotation; 194 core::quaternion rotation;
195 }; 195 };
196 196
197 //! holds a associative list of named quaternions 197 //! holds a associative list of named quaternions
198 struct SMD3QuaternionTagList 198 struct SMD3QuaternionTagList
199 { 199 {
200 SMD3QuaternionTagList() 200 SMD3QuaternionTagList()
201 { 201 {
202 Container.setAllocStrategy(core::ALLOC_STRATEGY_SAFE); 202 Container.setAllocStrategy(core::ALLOC_STRATEGY_SAFE);
203 } 203 }
204 204
205 // construct copy constructor 205 // construct copy constructor
206 SMD3QuaternionTagList(const SMD3QuaternionTagList& copyMe) 206 SMD3QuaternionTagList(const SMD3QuaternionTagList& copyMe)
207 { 207 {
208 *this = copyMe; 208 *this = copyMe;
209 } 209 }
210 210
211 virtual ~SMD3QuaternionTagList() {} 211 virtual ~SMD3QuaternionTagList() {}
212 212
213 SMD3QuaternionTag* get(const core::stringc& name) 213 SMD3QuaternionTag* get(const core::stringc& name)
214 { 214 {
215 SMD3QuaternionTag search ( name ); 215 SMD3QuaternionTag search ( name );
216 s32 index = Container.linear_search ( search ); 216 s32 index = Container.linear_search ( search );
217 if ( index >= 0 ) 217 if ( index >= 0 )
218 return &Container[index]; 218 return &Container[index];
219 return 0; 219 return 0;
220 } 220 }
221 221
222 u32 size () const 222 u32 size () const
223 { 223 {
224 return Container.size(); 224 return Container.size();
225 } 225 }
226 226
227 void set_used(u32 new_size) 227 void set_used(u32 new_size)
228 { 228 {
229 s32 diff = (s32) new_size - (s32) Container.allocated_size(); 229 s32 diff = (s32) new_size - (s32) Container.allocated_size();
230 if ( diff > 0 ) 230 if ( diff > 0 )
231 { 231 {
232 SMD3QuaternionTag e(""); 232 SMD3QuaternionTag e("");
233 for ( s32 i = 0; i < diff; ++i ) 233 for ( s32 i = 0; i < diff; ++i )
234 Container.push_back(e); 234 Container.push_back(e);
235 } 235 }
236 } 236 }
237 237
238 const SMD3QuaternionTag& operator[](u32 index) const 238 const SMD3QuaternionTag& operator[](u32 index) const
239 { 239 {
240 return Container[index]; 240 return Container[index];
241 } 241 }
242 242
243 SMD3QuaternionTag& operator[](u32 index) 243 SMD3QuaternionTag& operator[](u32 index)
244 { 244 {
245 return Container[index]; 245 return Container[index];
246 } 246 }
247 247
248 void push_back(const SMD3QuaternionTag& other) 248 void push_back(const SMD3QuaternionTag& other)
249 { 249 {
250 Container.push_back(other); 250 Container.push_back(other);
251 } 251 }
252 252
253 SMD3QuaternionTagList& operator = (const SMD3QuaternionTagList & copyMe) 253 SMD3QuaternionTagList& operator = (const SMD3QuaternionTagList & copyMe)
254 { 254 {
255 Container = copyMe.Container; 255 Container = copyMe.Container;
256 return *this; 256 return *this;
257 } 257 }
258 258
259 private: 259 private:
260 core::array < SMD3QuaternionTag > Container; 260 core::array < SMD3QuaternionTag > Container;
261 }; 261 };
262 262
263 263
264 //! Holding Frames Buffers and Tag Infos 264 //! Holding Frames Buffers and Tag Infos
265 struct SMD3Mesh: public IReferenceCounted 265 struct SMD3Mesh: public IReferenceCounted
266 { 266 {
267 SMD3Mesh () 267 SMD3Mesh ()
268 { 268 {
269 MD3Header.numFrames = 0; 269 MD3Header.numFrames = 0;
270 } 270 }
271 271
272 virtual ~SMD3Mesh() 272 virtual ~SMD3Mesh()
273 { 273 {
274 for (u32 i=0; i<Buffer.size(); ++i) 274 for (u32 i=0; i<Buffer.size(); ++i)
275 Buffer[i]->drop(); 275 Buffer[i]->drop();
276 } 276 }
277 277
278 core::stringc Name; 278 core::stringc Name;
279 core::array<SMD3MeshBuffer*> Buffer; 279 core::array<SMD3MeshBuffer*> Buffer;
280 SMD3QuaternionTagList TagList; 280 SMD3QuaternionTagList TagList;
281 SMD3Header MD3Header; 281 SMD3Header MD3Header;
282 }; 282 };
283 283
284 284
285 //! Interface for using some special functions of MD3 meshes 285 //! Interface for using some special functions of MD3 meshes
286 class IAnimatedMeshMD3 : public IAnimatedMesh 286 class IAnimatedMeshMD3 : public IAnimatedMesh
287 { 287 {
288 public: 288 public:
289 289
290 //! tune how many frames you want to render inbetween. 290 //! tune how many frames you want to render inbetween.
291 virtual void setInterpolationShift(u32 shift, u32 loopMode) =0; 291 virtual void setInterpolationShift(u32 shift, u32 loopMode) =0;
292 292
293 //! get the tag list of the mesh. 293 //! get the tag list of the mesh.
294 virtual SMD3QuaternionTagList* getTagList(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) =0; 294 virtual SMD3QuaternionTagList* getTagList(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) =0;
295 295
296 //! get the original md3 mesh. 296 //! get the original md3 mesh.
297 virtual SMD3Mesh* getOriginalMesh() =0; 297 virtual SMD3Mesh* getOriginalMesh() =0;
298 }; 298 };
299 299
300} // end namespace scene 300} // end namespace scene
301} // end namespace irr 301} // end namespace irr
302 302
303#endif 303#endif
304 304
diff --git a/libraries/irrlicht-1.8/include/IAnimatedMeshSceneNode.h b/libraries/irrlicht-1.8/include/IAnimatedMeshSceneNode.h
index 84d25a2..f34161e 100644
--- a/libraries/irrlicht-1.8/include/IAnimatedMeshSceneNode.h
+++ b/libraries/irrlicht-1.8/include/IAnimatedMeshSceneNode.h
@@ -1,228 +1,228 @@
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#ifndef __I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__
6#define __I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__ 6#define __I_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9#include "IBoneSceneNode.h" 9#include "IBoneSceneNode.h"
10#include "IAnimatedMeshMD2.h" 10#include "IAnimatedMeshMD2.h"
11#include "IAnimatedMeshMD3.h" 11#include "IAnimatedMeshMD3.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace scene 15namespace scene
16{ 16{
17 class IShadowVolumeSceneNode; 17 class IShadowVolumeSceneNode;
18 18
19 enum E_JOINT_UPDATE_ON_RENDER 19 enum E_JOINT_UPDATE_ON_RENDER
20 { 20 {
21 //! do nothing 21 //! do nothing
22 EJUOR_NONE = 0, 22 EJUOR_NONE = 0,
23 23
24 //! get joints positions from the mesh (for attached nodes, etc) 24 //! get joints positions from the mesh (for attached nodes, etc)
25 EJUOR_READ, 25 EJUOR_READ,
26 26
27 //! control joint positions in the mesh (eg. ragdolls, or set the animation from animateJoints() ) 27 //! control joint positions in the mesh (eg. ragdolls, or set the animation from animateJoints() )
28 EJUOR_CONTROL 28 EJUOR_CONTROL
29 }; 29 };
30 30
31 31
32 class IAnimatedMeshSceneNode; 32 class IAnimatedMeshSceneNode;
33 33
34 //! Callback interface for catching events of ended animations. 34 //! Callback interface for catching events of ended animations.
35 /** Implement this interface and use 35 /** Implement this interface and use
36 IAnimatedMeshSceneNode::setAnimationEndCallback to be able to 36 IAnimatedMeshSceneNode::setAnimationEndCallback to be able to
37 be notified if an animation playback has ended. 37 be notified if an animation playback has ended.
38 **/ 38 **/
39 class IAnimationEndCallBack : public virtual IReferenceCounted 39 class IAnimationEndCallBack : public virtual IReferenceCounted
40 { 40 {
41 public: 41 public:
42 42
43 //! Will be called when the animation playback has ended. 43 //! Will be called when the animation playback has ended.
44 /** See IAnimatedMeshSceneNode::setAnimationEndCallback for 44 /** See IAnimatedMeshSceneNode::setAnimationEndCallback for
45 more informations. 45 more informations.
46 \param node: Node of which the animation has ended. */ 46 \param node: Node of which the animation has ended. */
47 virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node) = 0; 47 virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node) = 0;
48 }; 48 };
49 49
50 //! Scene node capable of displaying an animated mesh and its shadow. 50 //! Scene node capable of displaying an animated mesh and its shadow.
51 /** The shadow is optional: If a shadow should be displayed too, just 51 /** The shadow is optional: If a shadow should be displayed too, just
52 invoke the IAnimatedMeshSceneNode::createShadowVolumeSceneNode().*/ 52 invoke the IAnimatedMeshSceneNode::createShadowVolumeSceneNode().*/
53 class IAnimatedMeshSceneNode : public ISceneNode 53 class IAnimatedMeshSceneNode : public ISceneNode
54 { 54 {
55 public: 55 public:
56 56
57 //! Constructor 57 //! Constructor
58 IAnimatedMeshSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 58 IAnimatedMeshSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
59 const core::vector3df& position = core::vector3df(0,0,0), 59 const core::vector3df& position = core::vector3df(0,0,0),
60 const core::vector3df& rotation = core::vector3df(0,0,0), 60 const core::vector3df& rotation = core::vector3df(0,0,0),
61 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) 61 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
62 : ISceneNode(parent, mgr, id, position, rotation, scale) {} 62 : ISceneNode(parent, mgr, id, position, rotation, scale) {}
63 63
64 //! Destructor 64 //! Destructor
65 virtual ~IAnimatedMeshSceneNode() {} 65 virtual ~IAnimatedMeshSceneNode() {}
66 66
67 //! Sets the current frame number. 67 //! Sets the current frame number.
68 /** From now on the animation is played from this frame. 68 /** From now on the animation is played from this frame.
69 \param frame: Number of the frame to let the animation be started from. 69 \param frame: Number of the frame to let the animation be started from.
70 The frame number must be a valid frame number of the IMesh used by this 70 The frame number must be a valid frame number of the IMesh used by this
71 scene node. Set IAnimatedMesh::getMesh() for details. */ 71 scene node. Set IAnimatedMesh::getMesh() for details. */
72 virtual void setCurrentFrame(f32 frame) = 0; 72 virtual void setCurrentFrame(f32 frame) = 0;
73 73
74 //! Sets the frame numbers between the animation is looped. 74 //! Sets the frame numbers between the animation is looped.
75 /** The default is 0 - MaximalFrameCount of the mesh. 75 /** The default is 0 - MaximalFrameCount of the mesh.
76 \param begin: Start frame number of the loop. 76 \param begin: Start frame number of the loop.
77 \param end: End frame number of the loop. 77 \param end: End frame number of the loop.
78 \return True if successful, false if not. */ 78 \return True if successful, false if not. */
79 virtual bool setFrameLoop(s32 begin, s32 end) = 0; 79 virtual bool setFrameLoop(s32 begin, s32 end) = 0;
80 80
81 //! Sets the speed with which the animation is played. 81 //! Sets the speed with which the animation is played.
82 /** \param framesPerSecond: Frames per second played. */ 82 /** \param framesPerSecond: Frames per second played. */
83 virtual void setAnimationSpeed(f32 framesPerSecond) = 0; 83 virtual void setAnimationSpeed(f32 framesPerSecond) = 0;
84 84
85 //! Gets the speed with which the animation is played. 85 //! Gets the speed with which the animation is played.
86 /** \return Frames per second played. */ 86 /** \return Frames per second played. */
87 virtual f32 getAnimationSpeed() const =0; 87 virtual f32 getAnimationSpeed() const =0;
88 88
89 //! Creates shadow volume scene node as child of this node. 89 //! Creates shadow volume scene node as child of this node.
90 /** The shadow can be rendered using the ZPass or the zfail 90 /** The shadow can be rendered using the ZPass or the zfail
91 method. ZPass is a little bit faster because the shadow volume 91 method. ZPass is a little bit faster because the shadow volume
92 creation is easier, but with this method there occur ugly 92 creation is easier, but with this method there occur ugly
93 looking artifacs when the camera is inside the shadow volume. 93 looking artifacs when the camera is inside the shadow volume.
94 These error do not occur with the ZFail method. 94 These error do not occur with the ZFail method.
95 \param shadowMesh: Optional custom mesh for shadow volume. 95 \param shadowMesh: Optional custom mesh for shadow volume.
96 \param id: Id of the shadow scene node. This id can be used to 96 \param id: Id of the shadow scene node. This id can be used to
97 identify the node later. 97 identify the node later.
98 \param zfailmethod: If set to true, the shadow will use the 98 \param zfailmethod: If set to true, the shadow will use the
99 zfail method, if not, zpass is used. 99 zfail method, if not, zpass is used.
100 \param infinity: Value used by the shadow volume algorithm to 100 \param infinity: Value used by the shadow volume algorithm to
101 scale the shadow volume (for zfail shadow volume we support only 101 scale the shadow volume (for zfail shadow volume we support only
102 finite shadows, so camera zfar must be larger than shadow back cap, 102 finite shadows, so camera zfar must be larger than shadow back cap,
103 which is depend on infinity parameter). 103 which is depend on infinity parameter).
104 \return Pointer to the created shadow scene node. This pointer 104 \return Pointer to the created shadow scene node. This pointer
105 should not be dropped. See IReferenceCounted::drop() for more 105 should not be dropped. See IReferenceCounted::drop() for more
106 information. */ 106 information. */
107 virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0, 107 virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0,
108 s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f) = 0; 108 s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f) = 0;
109 109
110 110
111 //! Get a pointer to a joint in the mesh (if the mesh is a bone based mesh). 111 //! Get a pointer to a joint in the mesh (if the mesh is a bone based mesh).
112 /** With this method it is possible to attach scene nodes to 112 /** With this method it is possible to attach scene nodes to
113 joints for example possible to attach a weapon to the left hand 113 joints for example possible to attach a weapon to the left hand
114 of an animated model. This example shows how: 114 of an animated model. This example shows how:
115 \code 115 \code
116 ISceneNode* hand = 116 ISceneNode* hand =
117 yourAnimatedMeshSceneNode->getJointNode("LeftHand"); 117 yourAnimatedMeshSceneNode->getJointNode("LeftHand");
118 hand->addChild(weaponSceneNode); 118 hand->addChild(weaponSceneNode);
119 \endcode 119 \endcode
120 Please note that the joint returned by this method may not exist 120 Please note that the joint returned by this method may not exist
121 before this call and the joints in the node were created by it. 121 before this call and the joints in the node were created by it.
122 \param jointName: Name of the joint. 122 \param jointName: Name of the joint.
123 \return Pointer to the scene node which represents the joint 123 \return Pointer to the scene node which represents the joint
124 with the specified name. Returns 0 if the contained mesh is not 124 with the specified name. Returns 0 if the contained mesh is not
125 an skinned mesh or the name of the joint could not be found. */ 125 an skinned mesh or the name of the joint could not be found. */
126 virtual IBoneSceneNode* getJointNode(const c8* jointName)=0; 126 virtual IBoneSceneNode* getJointNode(const c8* jointName)=0;
127 127
128 //! same as getJointNode(const c8* jointName), but based on id 128 //! same as getJointNode(const c8* jointName), but based on id
129 virtual IBoneSceneNode* getJointNode(u32 jointID) = 0; 129 virtual IBoneSceneNode* getJointNode(u32 jointID) = 0;
130 130
131 //! Gets joint count. 131 //! Gets joint count.
132 /** \return Amount of joints in the mesh. */ 132 /** \return Amount of joints in the mesh. */
133 virtual u32 getJointCount() const = 0; 133 virtual u32 getJointCount() const = 0;
134 134
135 //! Starts a default MD2 animation. 135 //! Starts a default MD2 animation.
136 /** With this method it is easily possible to start a Run, 136 /** With this method it is easily possible to start a Run,
137 Attack, Die or whatever animation, if the mesh contained in 137 Attack, Die or whatever animation, if the mesh contained in
138 this scene node is an md2 mesh. Otherwise, nothing happens. 138 this scene node is an md2 mesh. Otherwise, nothing happens.
139 \param anim: An MD2 animation type, which should be played, for 139 \param anim: An MD2 animation type, which should be played, for
140 example EMAT_STAND for the standing animation. 140 example EMAT_STAND for the standing animation.
141 \return True if successful, and false if not, for example if 141 \return True if successful, and false if not, for example if
142 the mesh in the scene node is not a md2 mesh. */ 142 the mesh in the scene node is not a md2 mesh. */
143 virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) = 0; 143 virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) = 0;
144 144
145 //! Starts a special MD2 animation. 145 //! Starts a special MD2 animation.
146 /** With this method it is easily possible to start a Run, 146 /** With this method it is easily possible to start a Run,
147 Attack, Die or whatever animation, if the mesh contained in 147 Attack, Die or whatever animation, if the mesh contained in
148 this scene node is an md2 mesh. Otherwise, nothing happens. 148 this scene node is an md2 mesh. Otherwise, nothing happens.
149 This method uses a character string to identify the animation. 149 This method uses a character string to identify the animation.
150 If the animation is a standard md2 animation, you might want to 150 If the animation is a standard md2 animation, you might want to
151 start this animation with the EMD2_ANIMATION_TYPE enumeration 151 start this animation with the EMD2_ANIMATION_TYPE enumeration
152 instead. 152 instead.
153 \param animationName: Name of the animation which should be 153 \param animationName: Name of the animation which should be
154 played. 154 played.
155 \return Returns true if successful, and false if not, for 155 \return Returns true if successful, and false if not, for
156 example if the mesh in the scene node is not an md2 mesh, or no 156 example if the mesh in the scene node is not an md2 mesh, or no
157 animation with this name could be found. */ 157 animation with this name could be found. */
158 virtual bool setMD2Animation(const c8* animationName) = 0; 158 virtual bool setMD2Animation(const c8* animationName) = 0;
159 159
160 //! Returns the currently displayed frame number. 160 //! Returns the currently displayed frame number.
161 virtual f32 getFrameNr() const = 0; 161 virtual f32 getFrameNr() const = 0;
162 //! Returns the current start frame number. 162 //! Returns the current start frame number.
163 virtual s32 getStartFrame() const = 0; 163 virtual s32 getStartFrame() const = 0;
164 //! Returns the current end frame number. 164 //! Returns the current end frame number.
165 virtual s32 getEndFrame() const = 0; 165 virtual s32 getEndFrame() const = 0;
166 166
167 //! Sets looping mode which is on by default. 167 //! Sets looping mode which is on by default.
168 /** If set to false, animations will not be played looped. */ 168 /** If set to false, animations will not be played looped. */
169 virtual void setLoopMode(bool playAnimationLooped) = 0; 169 virtual void setLoopMode(bool playAnimationLooped) = 0;
170 170
171 //! returns the current loop mode 171 //! returns the current loop mode
172 /** When true the animations are played looped */ 172 /** When true the animations are played looped */
173 virtual bool getLoopMode() const = 0; 173 virtual bool getLoopMode() const = 0;
174 174
175 //! Sets a callback interface which will be called if an animation playback has ended. 175 //! Sets a callback interface which will be called if an animation playback has ended.
176 /** Set this to 0 to disable the callback again. 176 /** Set this to 0 to disable the callback again.
177 Please note that this will only be called when in non looped 177 Please note that this will only be called when in non looped
178 mode, see IAnimatedMeshSceneNode::setLoopMode(). */ 178 mode, see IAnimatedMeshSceneNode::setLoopMode(). */
179 virtual void setAnimationEndCallback(IAnimationEndCallBack* callback=0) = 0; 179 virtual void setAnimationEndCallback(IAnimationEndCallBack* callback=0) = 0;
180 180
181 //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style. 181 //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
182 /** In this way it is possible to change the materials a mesh 182 /** In this way it is possible to change the materials a mesh
183 causing all mesh scene nodes referencing this mesh to change 183 causing all mesh scene nodes referencing this mesh to change
184 too. */ 184 too. */
185 virtual void setReadOnlyMaterials(bool readonly) = 0; 185 virtual void setReadOnlyMaterials(bool readonly) = 0;
186 186
187 //! Returns if the scene node should not copy the materials of the mesh but use them in a read only style 187 //! Returns if the scene node should not copy the materials of the mesh but use them in a read only style
188 virtual bool isReadOnlyMaterials() const = 0; 188 virtual bool isReadOnlyMaterials() const = 0;
189 189
190 //! Sets a new mesh 190 //! Sets a new mesh
191 virtual void setMesh(IAnimatedMesh* mesh) = 0; 191 virtual void setMesh(IAnimatedMesh* mesh) = 0;
192 192
193 //! Returns the current mesh 193 //! Returns the current mesh
194 virtual IAnimatedMesh* getMesh(void) = 0; 194 virtual IAnimatedMesh* getMesh(void) = 0;
195 195
196 //! Get the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh, or the absolutetransformation if it's a normal scenenode 196 //! Get the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh, or the absolutetransformation if it's a normal scenenode
197 virtual const SMD3QuaternionTag* getMD3TagTransformation( const core::stringc & tagname) = 0; 197 virtual const SMD3QuaternionTag* getMD3TagTransformation( const core::stringc & tagname) = 0;
198 198
199 //! Set how the joints should be updated on render 199 //! Set how the joints should be updated on render
200 virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode)=0; 200 virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode)=0;
201 201
202 //! Sets the transition time in seconds 202 //! Sets the transition time in seconds
203 /** Note: This needs to enable joints, and setJointmode set to 203 /** Note: This needs to enable joints, and setJointmode set to
204 EJUOR_CONTROL. You must call animateJoints(), or the mesh will 204 EJUOR_CONTROL. You must call animateJoints(), or the mesh will
205 not animate. */ 205 not animate. */
206 virtual void setTransitionTime(f32 Time) =0; 206 virtual void setTransitionTime(f32 Time) =0;
207 207
208 //! animates the joints in the mesh based on the current frame. 208 //! animates the joints in the mesh based on the current frame.
209 /** Also takes in to account transitions. */ 209 /** Also takes in to account transitions. */
210 virtual void animateJoints(bool CalculateAbsolutePositions=true) = 0; 210 virtual void animateJoints(bool CalculateAbsolutePositions=true) = 0;
211 211
212 //! render mesh ignoring its transformation. 212 //! render mesh ignoring its transformation.
213 /** Culling is unaffected. */ 213 /** Culling is unaffected. */
214 virtual void setRenderFromIdentity( bool On )=0; 214 virtual void setRenderFromIdentity( bool On )=0;
215 215
216 //! Creates a clone of this scene node and its children. 216 //! Creates a clone of this scene node and its children.
217 /** \param newParent An optional new parent. 217 /** \param newParent An optional new parent.
218 \param newManager An optional new scene manager. 218 \param newManager An optional new scene manager.
219 \return The newly created clone of this node. */ 219 \return The newly created clone of this node. */
220 virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) = 0; 220 virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) = 0;
221 221
222 }; 222 };
223 223
224} // end namespace scene 224} // end namespace scene
225} // end namespace irr 225} // end namespace irr
226 226
227#endif 227#endif
228 228
diff --git a/libraries/irrlicht-1.8/include/IAttributeExchangingObject.h b/libraries/irrlicht-1.8/include/IAttributeExchangingObject.h
index 5b13cdb..9c64b7d 100644
--- a/libraries/irrlicht-1.8/include/IAttributeExchangingObject.h
+++ b/libraries/irrlicht-1.8/include/IAttributeExchangingObject.h
@@ -1,71 +1,71 @@
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#ifndef __I_ATTRIBUTE_EXCHANGING_OBJECT_H_INCLUDED__ 5#ifndef __I_ATTRIBUTE_EXCHANGING_OBJECT_H_INCLUDED__
6#define __I_ATTRIBUTE_EXCHANGING_OBJECT_H_INCLUDED__ 6#define __I_ATTRIBUTE_EXCHANGING_OBJECT_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9 9
10 10
11namespace irr 11namespace irr
12{ 12{
13 13
14namespace io 14namespace io
15{ 15{
16 16
17class IAttributes; 17class IAttributes;
18 18
19//! Enumeration flags passed through SAttributeReadWriteOptions to the IAttributeExchangingObject object 19//! Enumeration flags passed through SAttributeReadWriteOptions to the IAttributeExchangingObject object
20enum E_ATTRIBUTE_READ_WRITE_FLAGS 20enum E_ATTRIBUTE_READ_WRITE_FLAGS
21{ 21{
22 //! Serialization/Deserializion is done for an xml file 22 //! Serialization/Deserializion is done for an xml file
23 EARWF_FOR_FILE = 0x00000001, 23 EARWF_FOR_FILE = 0x00000001,
24 24
25 //! Serialization/Deserializion is done for an editor property box 25 //! Serialization/Deserializion is done for an editor property box
26 EARWF_FOR_EDITOR = 0x00000002, 26 EARWF_FOR_EDITOR = 0x00000002,
27 27
28 //! When writing filenames, relative paths should be used 28 //! When writing filenames, relative paths should be used
29 EARWF_USE_RELATIVE_PATHS = 0x00000004 29 EARWF_USE_RELATIVE_PATHS = 0x00000004
30}; 30};
31 31
32 32
33//! struct holding data describing options 33//! struct holding data describing options
34struct SAttributeReadWriteOptions 34struct SAttributeReadWriteOptions
35{ 35{
36 //! Constructor 36 //! Constructor
37 SAttributeReadWriteOptions() 37 SAttributeReadWriteOptions()
38 : Flags(0), Filename(0) 38 : Flags(0), Filename(0)
39 { 39 {
40 } 40 }
41 41
42 //! Combination of E_ATTRIBUTE_READ_WRITE_FLAGS or other, custom ones 42 //! Combination of E_ATTRIBUTE_READ_WRITE_FLAGS or other, custom ones
43 s32 Flags; 43 s32 Flags;
44 44
45 //! Optional filename 45 //! Optional filename
46 const fschar_t* Filename; 46 const fschar_t* Filename;
47}; 47};
48 48
49 49
50//! An object which is able to serialize and deserialize its attributes into an attributes object 50//! An object which is able to serialize and deserialize its attributes into an attributes object
51class IAttributeExchangingObject : virtual public IReferenceCounted 51class IAttributeExchangingObject : virtual public IReferenceCounted
52{ 52{
53public: 53public:
54 54
55 //! Writes attributes of the object. 55 //! Writes attributes of the object.
56 /** Implement this to expose the attributes of your scene node animator for 56 /** Implement this to expose the attributes of your scene node animator for
57 scripting languages, editors, debuggers or xml serialization purposes. */ 57 scripting languages, editors, debuggers or xml serialization purposes. */
58 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const {} 58 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const {}
59 59
60 //! Reads attributes of the object. 60 //! Reads attributes of the object.
61 /** Implement this to set the attributes of your scene node animator for 61 /** Implement this to set the attributes of your scene node animator for
62 scripting languages, editors, debuggers or xml deserialization purposes. */ 62 scripting languages, editors, debuggers or xml deserialization purposes. */
63 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) {} 63 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) {}
64 64
65}; 65};
66 66
67} // end namespace io 67} // end namespace io
68} // end namespace irr 68} // end namespace irr
69 69
70#endif 70#endif
71 71
diff --git a/libraries/irrlicht-1.8/include/IAttributes.h b/libraries/irrlicht-1.8/include/IAttributes.h
index f137635..bc77180 100644
--- a/libraries/irrlicht-1.8/include/IAttributes.h
+++ b/libraries/irrlicht-1.8/include/IAttributes.h
@@ -1,738 +1,738 @@
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#ifndef __I_ATTRIBUTES_H_INCLUDED__ 5#ifndef __I_ATTRIBUTES_H_INCLUDED__
6#define __I_ATTRIBUTES_H_INCLUDED__ 6#define __I_ATTRIBUTES_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "SColor.h" 9#include "SColor.h"
10#include "vector3d.h" 10#include "vector3d.h"
11#include "vector2d.h" 11#include "vector2d.h"
12#include "line2d.h" 12#include "line2d.h"
13#include "line3d.h" 13#include "line3d.h"
14#include "triangle3d.h" 14#include "triangle3d.h"
15#include "position2d.h" 15#include "position2d.h"
16#include "rect.h" 16#include "rect.h"
17#include "dimension2d.h" 17#include "dimension2d.h"
18#include "matrix4.h" 18#include "matrix4.h"
19#include "quaternion.h" 19#include "quaternion.h"
20#include "plane3d.h" 20#include "plane3d.h"
21#include "triangle3d.h" 21#include "triangle3d.h"
22#include "line2d.h" 22#include "line2d.h"
23#include "line3d.h" 23#include "line3d.h"
24#include "irrString.h" 24#include "irrString.h"
25#include "irrArray.h" 25#include "irrArray.h"
26#include "IXMLReader.h" 26#include "IXMLReader.h"
27#include "EAttributes.h" 27#include "EAttributes.h"
28#include "path.h" 28#include "path.h"
29 29
30namespace irr 30namespace irr
31{ 31{
32namespace video 32namespace video
33{ 33{
34 class ITexture; 34 class ITexture;
35} // end namespace video 35} // end namespace video
36namespace io 36namespace io
37{ 37{
38 class IXMLWriter; 38 class IXMLWriter;
39 39
40//! Provides a generic interface for attributes and their values and the possiblity to serialize them 40//! Provides a generic interface for attributes and their values and the possiblity to serialize them
41class IAttributes : public virtual IReferenceCounted 41class IAttributes : public virtual IReferenceCounted
42{ 42{
43public: 43public:
44 44
45 //! Returns amount of attributes in this collection of attributes. 45 //! Returns amount of attributes in this collection of attributes.
46 virtual u32 getAttributeCount() const = 0; 46 virtual u32 getAttributeCount() const = 0;
47 47
48 //! Returns attribute name by index. 48 //! Returns attribute name by index.
49 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 49 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
50 virtual const c8* getAttributeName(s32 index) = 0; 50 virtual const c8* getAttributeName(s32 index) = 0;
51 51
52 //! Returns the type of an attribute 52 //! Returns the type of an attribute
53 //! \param attributeName: Name for the attribute 53 //! \param attributeName: Name for the attribute
54 virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) = 0; 54 virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) = 0;
55 55
56 //! Returns attribute type by index. 56 //! Returns attribute type by index.
57 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 57 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
58 virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) = 0; 58 virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) = 0;
59 59
60 //! Returns the type string of the attribute 60 //! Returns the type string of the attribute
61 //! \param attributeName: String for the attribute type 61 //! \param attributeName: String for the attribute type
62 virtual const wchar_t* getAttributeTypeString(const c8* attributeName) = 0; 62 virtual const wchar_t* getAttributeTypeString(const c8* attributeName) = 0;
63 63
64 //! Returns the type string of the attribute by index. 64 //! Returns the type string of the attribute by index.
65 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 65 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
66 virtual const wchar_t* getAttributeTypeString(s32 index) = 0; 66 virtual const wchar_t* getAttributeTypeString(s32 index) = 0;
67 67
68 //! Returns if an attribute with a name exists 68 //! Returns if an attribute with a name exists
69 virtual bool existsAttribute(const c8* attributeName) = 0; 69 virtual bool existsAttribute(const c8* attributeName) = 0;
70 70
71 //! Returns attribute index from name, -1 if not found 71 //! Returns attribute index from name, -1 if not found
72 virtual s32 findAttribute(const c8* attributeName) const =0; 72 virtual s32 findAttribute(const c8* attributeName) const =0;
73 73
74 //! Removes all attributes 74 //! Removes all attributes
75 virtual void clear() = 0; 75 virtual void clear() = 0;
76 76
77 //! Reads attributes from a xml file. 77 //! Reads attributes from a xml file.
78 //! \param reader The XML reader to read from 78 //! \param reader The XML reader to read from
79 //! \param readCurrentElementOnly If set to true, reading only works if current element has the name 'attributes' or 79 //! \param readCurrentElementOnly If set to true, reading only works if current element has the name 'attributes' or
80 //! the name specified using elementName. 80 //! the name specified using elementName.
81 //! \param elementName The surrounding element name. If it is null, the default one, "attributes" will be taken. 81 //! \param elementName The surrounding element name. If it is null, the default one, "attributes" will be taken.
82 //! If set to false, the first appearing list of attributes are read. 82 //! If set to false, the first appearing list of attributes are read.
83 virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false, const wchar_t* elementName=0) = 0; 83 virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false, const wchar_t* elementName=0) = 0;
84 84
85 //! Write these attributes into a xml file 85 //! Write these attributes into a xml file
86 //! \param writer: The XML writer to write to 86 //! \param writer: The XML writer to write to
87 //! \param writeXMLHeader: Writes a header to the XML file, required if at the beginning of the file 87 //! \param writeXMLHeader: Writes a header to the XML file, required if at the beginning of the file
88 //! \param elementName: The surrounding element name. If it is null, the default one, "attributes" will be taken. 88 //! \param elementName: The surrounding element name. If it is null, the default one, "attributes" will be taken.
89 virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false, const wchar_t* elementName=0) = 0; 89 virtual bool write(io::IXMLWriter* writer, bool writeXMLHeader=false, const wchar_t* elementName=0) = 0;
90 90
91 91
92 /* 92 /*
93 93
94 Integer Attribute 94 Integer Attribute
95 95
96 */ 96 */
97 97
98 //! Adds an attribute as integer 98 //! Adds an attribute as integer
99 virtual void addInt(const c8* attributeName, s32 value) = 0; 99 virtual void addInt(const c8* attributeName, s32 value) = 0;
100 100
101 //! Sets an attribute as integer value 101 //! Sets an attribute as integer value
102 virtual void setAttribute(const c8* attributeName, s32 value) = 0; 102 virtual void setAttribute(const c8* attributeName, s32 value) = 0;
103 103
104 //! Gets an attribute as integer value 104 //! Gets an attribute as integer value
105 //! \param attributeName: Name of the attribute to get. 105 //! \param attributeName: Name of the attribute to get.
106 //! \return Returns value of the attribute previously set by setAttribute() 106 //! \return Returns value of the attribute previously set by setAttribute()
107 virtual s32 getAttributeAsInt(const c8* attributeName) const =0; 107 virtual s32 getAttributeAsInt(const c8* attributeName) const =0;
108 108
109 //! Gets an attribute as integer value 109 //! Gets an attribute as integer value
110 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 110 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
111 virtual s32 getAttributeAsInt(s32 index) const =0; 111 virtual s32 getAttributeAsInt(s32 index) const =0;
112 112
113 //! Sets an attribute as integer value 113 //! Sets an attribute as integer value
114 virtual void setAttribute(s32 index, s32 value) = 0; 114 virtual void setAttribute(s32 index, s32 value) = 0;
115 115
116 /* 116 /*
117 117
118 Float Attribute 118 Float Attribute
119 119
120 */ 120 */
121 121
122 //! Adds an attribute as float 122 //! Adds an attribute as float
123 virtual void addFloat(const c8* attributeName, f32 value) = 0; 123 virtual void addFloat(const c8* attributeName, f32 value) = 0;
124 124
125 //! Sets a attribute as float value 125 //! Sets a attribute as float value
126 virtual void setAttribute(const c8* attributeName, f32 value) = 0; 126 virtual void setAttribute(const c8* attributeName, f32 value) = 0;
127 127
128 //! Gets an attribute as float value 128 //! Gets an attribute as float value
129 //! \param attributeName: Name of the attribute to get. 129 //! \param attributeName: Name of the attribute to get.
130 //! \return Returns value of the attribute previously set by setAttribute() 130 //! \return Returns value of the attribute previously set by setAttribute()
131 virtual f32 getAttributeAsFloat(const c8* attributeName) = 0; 131 virtual f32 getAttributeAsFloat(const c8* attributeName) = 0;
132 132
133 //! Gets an attribute as float value 133 //! Gets an attribute as float value
134 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 134 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
135 virtual f32 getAttributeAsFloat(s32 index) = 0; 135 virtual f32 getAttributeAsFloat(s32 index) = 0;
136 136
137 //! Sets an attribute as float value 137 //! Sets an attribute as float value
138 virtual void setAttribute(s32 index, f32 value) = 0; 138 virtual void setAttribute(s32 index, f32 value) = 0;
139 139
140 /* 140 /*
141 141
142 String Attribute 142 String Attribute
143 143
144 */ 144 */
145 145
146 //! Adds an attribute as string 146 //! Adds an attribute as string
147 virtual void addString(const c8* attributeName, const c8* value) = 0; 147 virtual void addString(const c8* attributeName, const c8* value) = 0;
148 148
149 //! Sets an attribute value as string. 149 //! Sets an attribute value as string.
150 //! \param attributeName: Name for the attribute 150 //! \param attributeName: Name for the attribute
151 //! \param value: Value for the attribute. Set this to 0 to delete the attribute 151 //! \param value: Value for the attribute. Set this to 0 to delete the attribute
152 virtual void setAttribute(const c8* attributeName, const c8* value) = 0; 152 virtual void setAttribute(const c8* attributeName, const c8* value) = 0;
153 153
154 //! Gets an attribute as string. 154 //! Gets an attribute as string.
155 //! \param attributeName: Name of the attribute to get. 155 //! \param attributeName: Name of the attribute to get.
156 //! \return Returns value of the attribute previously set by setAttribute() 156 //! \return Returns value of the attribute previously set by setAttribute()
157 //! or 0 if attribute is not set. 157 //! or 0 if attribute is not set.
158 virtual core::stringc getAttributeAsString(const c8* attributeName) = 0; 158 virtual core::stringc getAttributeAsString(const c8* attributeName) = 0;
159 159
160 //! Gets an attribute as string. 160 //! Gets an attribute as string.
161 //! \param attributeName Name of the attribute to get. 161 //! \param attributeName Name of the attribute to get.
162 //! \param target Buffer where the string is copied to. 162 //! \param target Buffer where the string is copied to.
163 virtual void getAttributeAsString(const c8* attributeName, c8* target) = 0; 163 virtual void getAttributeAsString(const c8* attributeName, c8* target) = 0;
164 164
165 //! Returns attribute value as string by index. 165 //! Returns attribute value as string by index.
166 //! \param index Index value, must be between 0 and getAttributeCount()-1. 166 //! \param index Index value, must be between 0 and getAttributeCount()-1.
167 virtual core::stringc getAttributeAsString(s32 index) = 0; 167 virtual core::stringc getAttributeAsString(s32 index) = 0;
168 168
169 //! Sets an attribute value as string. 169 //! Sets an attribute value as string.
170 //! \param index Index value, must be between 0 and getAttributeCount()-1. 170 //! \param index Index value, must be between 0 and getAttributeCount()-1.
171 //! \param value String to which the attribute is set. 171 //! \param value String to which the attribute is set.
172 virtual void setAttribute(s32 index, const c8* value) = 0; 172 virtual void setAttribute(s32 index, const c8* value) = 0;
173 173
174 // wide strings 174 // wide strings
175 175
176 //! Adds an attribute as string 176 //! Adds an attribute as string
177 virtual void addString(const c8* attributeName, const wchar_t* value) = 0; 177 virtual void addString(const c8* attributeName, const wchar_t* value) = 0;
178 178
179 //! Sets an attribute value as string. 179 //! Sets an attribute value as string.
180 //! \param attributeName: Name for the attribute 180 //! \param attributeName: Name for the attribute
181 //! \param value: Value for the attribute. Set this to 0 to delete the attribute 181 //! \param value: Value for the attribute. Set this to 0 to delete the attribute
182 virtual void setAttribute(const c8* attributeName, const wchar_t* value) = 0; 182 virtual void setAttribute(const c8* attributeName, const wchar_t* value) = 0;
183 183
184 //! Gets an attribute as string. 184 //! Gets an attribute as string.
185 //! \param attributeName: Name of the attribute to get. 185 //! \param attributeName: Name of the attribute to get.
186 //! \return Returns value of the attribute previously set by setAttribute() 186 //! \return Returns value of the attribute previously set by setAttribute()
187 //! or 0 if attribute is not set. 187 //! or 0 if attribute is not set.
188 virtual core::stringw getAttributeAsStringW(const c8* attributeName) = 0; 188 virtual core::stringw getAttributeAsStringW(const c8* attributeName) = 0;
189 189
190 //! Gets an attribute as string. 190 //! Gets an attribute as string.
191 //! \param attributeName: Name of the attribute to get. 191 //! \param attributeName: Name of the attribute to get.
192 //! \param target: Buffer where the string is copied to. 192 //! \param target: Buffer where the string is copied to.
193 virtual void getAttributeAsStringW(const c8* attributeName, wchar_t* target) = 0; 193 virtual void getAttributeAsStringW(const c8* attributeName, wchar_t* target) = 0;
194 194
195 //! Returns attribute value as string by index. 195 //! Returns attribute value as string by index.
196 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 196 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
197 virtual core::stringw getAttributeAsStringW(s32 index) = 0; 197 virtual core::stringw getAttributeAsStringW(s32 index) = 0;
198 198
199 //! Sets an attribute value as string. 199 //! Sets an attribute value as string.
200 //! \param index Index value, must be between 0 and getAttributeCount()-1. 200 //! \param index Index value, must be between 0 and getAttributeCount()-1.
201 //! \param value String to which the attribute is set. 201 //! \param value String to which the attribute is set.
202 virtual void setAttribute(s32 index, const wchar_t* value) = 0; 202 virtual void setAttribute(s32 index, const wchar_t* value) = 0;
203 203
204 /* 204 /*
205 205
206 Binary Data Attribute 206 Binary Data Attribute
207 207
208 */ 208 */
209 209
210 //! Adds an attribute as binary data 210 //! Adds an attribute as binary data
211 virtual void addBinary(const c8* attributeName, void* data, s32 dataSizeInBytes) = 0; 211 virtual void addBinary(const c8* attributeName, void* data, s32 dataSizeInBytes) = 0;
212 212
213 //! Sets an attribute as binary data 213 //! Sets an attribute as binary data
214 virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes ) = 0; 214 virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes ) = 0;
215 215
216 //! Gets an attribute as binary data 216 //! Gets an attribute as binary data
217 /** \param attributeName: Name of the attribute to get. 217 /** \param attributeName: Name of the attribute to get.
218 \param outData Pointer to buffer where data shall be stored. 218 \param outData Pointer to buffer where data shall be stored.
219 \param maxSizeInBytes Maximum number of bytes to write into outData. 219 \param maxSizeInBytes Maximum number of bytes to write into outData.
220 */ 220 */
221 virtual void getAttributeAsBinaryData(const c8* attributeName, void* outData, s32 maxSizeInBytes) = 0; 221 virtual void getAttributeAsBinaryData(const c8* attributeName, void* outData, s32 maxSizeInBytes) = 0;
222 222
223 //! Gets an attribute as binary data 223 //! Gets an attribute as binary data
224 /** \param index: Index value, must be between 0 and getAttributeCount()-1. 224 /** \param index: Index value, must be between 0 and getAttributeCount()-1.
225 \param outData Pointer to buffer where data shall be stored. 225 \param outData Pointer to buffer where data shall be stored.
226 \param maxSizeInBytes Maximum number of bytes to write into outData. 226 \param maxSizeInBytes Maximum number of bytes to write into outData.
227 */ 227 */
228 virtual void getAttributeAsBinaryData(s32 index, void* outData, s32 maxSizeInBytes) = 0; 228 virtual void getAttributeAsBinaryData(s32 index, void* outData, s32 maxSizeInBytes) = 0;
229 229
230 //! Sets an attribute as binary data 230 //! Sets an attribute as binary data
231 virtual void setAttribute(s32 index, void* data, s32 dataSizeInBytes ) = 0; 231 virtual void setAttribute(s32 index, void* data, s32 dataSizeInBytes ) = 0;
232 232
233 233
234 /* 234 /*
235 Array Attribute 235 Array Attribute
236 */ 236 */
237 237
238 //! Adds an attribute as wide string array 238 //! Adds an attribute as wide string array
239 virtual void addArray(const c8* attributeName, const core::array<core::stringw>& value) = 0; 239 virtual void addArray(const c8* attributeName, const core::array<core::stringw>& value) = 0;
240 240
241 //! Sets an attribute value as a wide string array. 241 //! Sets an attribute value as a wide string array.
242 //! \param attributeName: Name for the attribute 242 //! \param attributeName: Name for the attribute
243 //! \param value: Value for the attribute. Set this to 0 to delete the attribute 243 //! \param value: Value for the attribute. Set this to 0 to delete the attribute
244 virtual void setAttribute(const c8* attributeName, const core::array<core::stringw>& value) = 0; 244 virtual void setAttribute(const c8* attributeName, const core::array<core::stringw>& value) = 0;
245 245
246 //! Gets an attribute as an array of wide strings. 246 //! Gets an attribute as an array of wide strings.
247 //! \param attributeName: Name of the attribute to get. 247 //! \param attributeName: Name of the attribute to get.
248 //! \return Returns value of the attribute previously set by setAttribute() 248 //! \return Returns value of the attribute previously set by setAttribute()
249 //! or 0 if attribute is not set. 249 //! or 0 if attribute is not set.
250 virtual core::array<core::stringw> getAttributeAsArray(const c8* attributeName) = 0; 250 virtual core::array<core::stringw> getAttributeAsArray(const c8* attributeName) = 0;
251 251
252 //! Returns attribute value as an array of wide strings by index. 252 //! Returns attribute value as an array of wide strings by index.
253 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 253 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
254 virtual core::array<core::stringw> getAttributeAsArray(s32 index) = 0; 254 virtual core::array<core::stringw> getAttributeAsArray(s32 index) = 0;
255 255
256 //! Sets an attribute as an array of wide strings 256 //! Sets an attribute as an array of wide strings
257 virtual void setAttribute(s32 index, const core::array<core::stringw>& value) = 0; 257 virtual void setAttribute(s32 index, const core::array<core::stringw>& value) = 0;
258 258
259 259
260 /* 260 /*
261 261
262 Bool Attribute 262 Bool Attribute
263 263
264 */ 264 */
265 265
266 //! Adds an attribute as bool 266 //! Adds an attribute as bool
267 virtual void addBool(const c8* attributeName, bool value) = 0; 267 virtual void addBool(const c8* attributeName, bool value) = 0;
268 268
269 //! Sets an attribute as boolean value 269 //! Sets an attribute as boolean value
270 virtual void setAttribute(const c8* attributeName, bool value) = 0; 270 virtual void setAttribute(const c8* attributeName, bool value) = 0;
271 271
272 //! Gets an attribute as boolean value 272 //! Gets an attribute as boolean value
273 //! \param attributeName: Name of the attribute to get. 273 //! \param attributeName: Name of the attribute to get.
274 //! \return Returns value of the attribute previously set by setAttribute() 274 //! \return Returns value of the attribute previously set by setAttribute()
275 virtual bool getAttributeAsBool(const c8* attributeName) = 0; 275 virtual bool getAttributeAsBool(const c8* attributeName) = 0;
276 276
277 //! Gets an attribute as boolean value 277 //! Gets an attribute as boolean value
278 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 278 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
279 virtual bool getAttributeAsBool(s32 index) = 0; 279 virtual bool getAttributeAsBool(s32 index) = 0;
280 280
281 //! Sets an attribute as boolean value 281 //! Sets an attribute as boolean value
282 virtual void setAttribute(s32 index, bool value) = 0; 282 virtual void setAttribute(s32 index, bool value) = 0;
283 283
284 /* 284 /*
285 285
286 Enumeration Attribute 286 Enumeration Attribute
287 287
288 */ 288 */
289 289
290 //! Adds an attribute as enum 290 //! Adds an attribute as enum
291 virtual void addEnum(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0; 291 virtual void addEnum(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
292 292
293 //! Adds an attribute as enum 293 //! Adds an attribute as enum
294 virtual void addEnum(const c8* attributeName, s32 enumValue, const c8* const* enumerationLiterals) = 0; 294 virtual void addEnum(const c8* attributeName, s32 enumValue, const c8* const* enumerationLiterals) = 0;
295 295
296 //! Sets an attribute as enumeration 296 //! Sets an attribute as enumeration
297 virtual void setAttribute(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0; 297 virtual void setAttribute(const c8* attributeName, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
298 298
299 //! Gets an attribute as enumeration 299 //! Gets an attribute as enumeration
300 //! \param attributeName: Name of the attribute to get. 300 //! \param attributeName: Name of the attribute to get.
301 //! \return Returns value of the attribute previously set by setAttribute() 301 //! \return Returns value of the attribute previously set by setAttribute()
302 virtual const c8* getAttributeAsEnumeration(const c8* attributeName) = 0; 302 virtual const c8* getAttributeAsEnumeration(const c8* attributeName) = 0;
303 303
304 //! Gets an attribute as enumeration 304 //! Gets an attribute as enumeration
305 /** \param attributeName: Name of the attribute to get. 305 /** \param attributeName: Name of the attribute to get.
306 \param enumerationLiteralsToUse: Use these enumeration literals to get 306 \param enumerationLiteralsToUse: Use these enumeration literals to get
307 the index value instead of the set ones. This is useful when the 307 the index value instead of the set ones. This is useful when the
308 attribute list maybe was read from an xml file, and only contains the 308 attribute list maybe was read from an xml file, and only contains the
309 enumeration string, but no information about its index. 309 enumeration string, but no information about its index.
310 \return Returns value of the attribute previously set by setAttribute() 310 \return Returns value of the attribute previously set by setAttribute()
311 */ 311 */
312 virtual s32 getAttributeAsEnumeration(const c8* attributeName, const c8* const* enumerationLiteralsToUse) = 0; 312 virtual s32 getAttributeAsEnumeration(const c8* attributeName, const c8* const* enumerationLiteralsToUse) = 0;
313 313
314 //! Gets an attribute as enumeration 314 //! Gets an attribute as enumeration
315 /** \param index: Index value, must be between 0 and getAttributeCount()-1. 315 /** \param index: Index value, must be between 0 and getAttributeCount()-1.
316 \param enumerationLiteralsToUse: Use these enumeration literals to get 316 \param enumerationLiteralsToUse: Use these enumeration literals to get
317 the index value instead of the set ones. This is useful when the 317 the index value instead of the set ones. This is useful when the
318 attribute list maybe was read from an xml file, and only contains the 318 attribute list maybe was read from an xml file, and only contains the
319 enumeration string, but no information about its index. 319 enumeration string, but no information about its index.
320 \return Returns value of the attribute previously set by setAttribute() 320 \return Returns value of the attribute previously set by setAttribute()
321 */ 321 */
322 virtual s32 getAttributeAsEnumeration(s32 index, const c8* const* enumerationLiteralsToUse) = 0; 322 virtual s32 getAttributeAsEnumeration(s32 index, const c8* const* enumerationLiteralsToUse) = 0;
323 323
324 //! Gets an attribute as enumeration 324 //! Gets an attribute as enumeration
325 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 325 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
326 virtual const c8* getAttributeAsEnumeration(s32 index) = 0; 326 virtual const c8* getAttributeAsEnumeration(s32 index) = 0;
327 327
328 //! Gets the list of enumeration literals of an enumeration attribute 328 //! Gets the list of enumeration literals of an enumeration attribute
329 //! \param attributeName Name of the attribute to get. 329 //! \param attributeName Name of the attribute to get.
330 //! \param outLiterals Set of strings to choose the enum name from. 330 //! \param outLiterals Set of strings to choose the enum name from.
331 virtual void getAttributeEnumerationLiteralsOfEnumeration(const c8* attributeName, core::array<core::stringc>& outLiterals) = 0; 331 virtual void getAttributeEnumerationLiteralsOfEnumeration(const c8* attributeName, core::array<core::stringc>& outLiterals) = 0;
332 332
333 //! Gets the list of enumeration literals of an enumeration attribute 333 //! Gets the list of enumeration literals of an enumeration attribute
334 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 334 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
335 //! \param outLiterals Set of strings to choose the enum name from. 335 //! \param outLiterals Set of strings to choose the enum name from.
336 virtual void getAttributeEnumerationLiteralsOfEnumeration(s32 index, core::array<core::stringc>& outLiterals) = 0; 336 virtual void getAttributeEnumerationLiteralsOfEnumeration(s32 index, core::array<core::stringc>& outLiterals) = 0;
337 337
338 //! Sets an attribute as enumeration 338 //! Sets an attribute as enumeration
339 virtual void setAttribute(s32 index, const c8* enumValue, const c8* const* enumerationLiterals) = 0; 339 virtual void setAttribute(s32 index, const c8* enumValue, const c8* const* enumerationLiterals) = 0;
340 340
341 341
342 /* 342 /*
343 343
344 SColor Attribute 344 SColor Attribute
345 345
346 */ 346 */
347 347
348 //! Adds an attribute as color 348 //! Adds an attribute as color
349 virtual void addColor(const c8* attributeName, video::SColor value) = 0; 349 virtual void addColor(const c8* attributeName, video::SColor value) = 0;
350 350
351 351
352 //! Sets a attribute as color 352 //! Sets a attribute as color
353 virtual void setAttribute(const c8* attributeName, video::SColor color) = 0; 353 virtual void setAttribute(const c8* attributeName, video::SColor color) = 0;
354 354
355 //! Gets an attribute as color 355 //! Gets an attribute as color
356 //! \param attributeName: Name of the attribute to get. 356 //! \param attributeName: Name of the attribute to get.
357 //! \return Returns value of the attribute previously set by setAttribute() 357 //! \return Returns value of the attribute previously set by setAttribute()
358 virtual video::SColor getAttributeAsColor(const c8* attributeName) = 0; 358 virtual video::SColor getAttributeAsColor(const c8* attributeName) = 0;
359 359
360 //! Gets an attribute as color 360 //! Gets an attribute as color
361 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 361 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
362 virtual video::SColor getAttributeAsColor(s32 index) = 0; 362 virtual video::SColor getAttributeAsColor(s32 index) = 0;
363 363
364 //! Sets an attribute as color 364 //! Sets an attribute as color
365 virtual void setAttribute(s32 index, video::SColor color) = 0; 365 virtual void setAttribute(s32 index, video::SColor color) = 0;
366 366
367 /* 367 /*
368 368
369 SColorf Attribute 369 SColorf Attribute
370 370
371 */ 371 */
372 372
373 //! Adds an attribute as floating point color 373 //! Adds an attribute as floating point color
374 virtual void addColorf(const c8* attributeName, video::SColorf value) = 0; 374 virtual void addColorf(const c8* attributeName, video::SColorf value) = 0;
375 375
376 //! Sets a attribute as floating point color 376 //! Sets a attribute as floating point color
377 virtual void setAttribute(const c8* attributeName, video::SColorf color) = 0; 377 virtual void setAttribute(const c8* attributeName, video::SColorf color) = 0;
378 378
379 //! Gets an attribute as floating point color 379 //! Gets an attribute as floating point color
380 //! \param attributeName: Name of the attribute to get. 380 //! \param attributeName: Name of the attribute to get.
381 //! \return Returns value of the attribute previously set by setAttribute() 381 //! \return Returns value of the attribute previously set by setAttribute()
382 virtual video::SColorf getAttributeAsColorf(const c8* attributeName) = 0; 382 virtual video::SColorf getAttributeAsColorf(const c8* attributeName) = 0;
383 383
384 //! Gets an attribute as floating point color 384 //! Gets an attribute as floating point color
385 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 385 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
386 virtual video::SColorf getAttributeAsColorf(s32 index) = 0; 386 virtual video::SColorf getAttributeAsColorf(s32 index) = 0;
387 387
388 //! Sets an attribute as floating point color 388 //! Sets an attribute as floating point color
389 virtual void setAttribute(s32 index, video::SColorf color) = 0; 389 virtual void setAttribute(s32 index, video::SColorf color) = 0;
390 390
391 391
392 /* 392 /*
393 393
394 Vector3d Attribute 394 Vector3d Attribute
395 395
396 */ 396 */
397 397
398 //! Adds an attribute as 3d vector 398 //! Adds an attribute as 3d vector
399 virtual void addVector3d(const c8* attributeName, core::vector3df value) = 0; 399 virtual void addVector3d(const c8* attributeName, core::vector3df value) = 0;
400 400
401 //! Sets a attribute as 3d vector 401 //! Sets a attribute as 3d vector
402 virtual void setAttribute(const c8* attributeName, core::vector3df v) = 0; 402 virtual void setAttribute(const c8* attributeName, core::vector3df v) = 0;
403 403
404 //! Gets an attribute as 3d vector 404 //! Gets an attribute as 3d vector
405 //! \param attributeName: Name of the attribute to get. 405 //! \param attributeName: Name of the attribute to get.
406 //! \return Returns value of the attribute previously set by setAttribute() 406 //! \return Returns value of the attribute previously set by setAttribute()
407 virtual core::vector3df getAttributeAsVector3d(const c8* attributeName) = 0; 407 virtual core::vector3df getAttributeAsVector3d(const c8* attributeName) = 0;
408 408
409 //! Gets an attribute as 3d vector 409 //! Gets an attribute as 3d vector
410 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 410 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
411 virtual core::vector3df getAttributeAsVector3d(s32 index) = 0; 411 virtual core::vector3df getAttributeAsVector3d(s32 index) = 0;
412 412
413 //! Sets an attribute as vector 413 //! Sets an attribute as vector
414 virtual void setAttribute(s32 index, core::vector3df v) = 0; 414 virtual void setAttribute(s32 index, core::vector3df v) = 0;
415 415
416 /* 416 /*
417 417
418 Vector2d Attribute 418 Vector2d Attribute
419 419
420 */ 420 */
421 421
422 //! Adds an attribute as 2d vector 422 //! Adds an attribute as 2d vector
423 virtual void addVector2d(const c8* attributeName, core::vector2df value) = 0; 423 virtual void addVector2d(const c8* attributeName, core::vector2df value) = 0;
424 424
425 //! Sets a attribute as 2d vector 425 //! Sets a attribute as 2d vector
426 virtual void setAttribute(const c8* attributeName, core::vector2df v) = 0; 426 virtual void setAttribute(const c8* attributeName, core::vector2df v) = 0;
427 427
428 //! Gets an attribute as vector 428 //! Gets an attribute as vector
429 //! \param attributeName: Name of the attribute to get. 429 //! \param attributeName: Name of the attribute to get.
430 //! \return Returns value of the attribute previously set by setAttribute() 430 //! \return Returns value of the attribute previously set by setAttribute()
431 virtual core::vector2df getAttributeAsVector2d(const c8* attributeName) = 0; 431 virtual core::vector2df getAttributeAsVector2d(const c8* attributeName) = 0;
432 432
433 //! Gets an attribute as position 433 //! Gets an attribute as position
434 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 434 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
435 virtual core::vector2df getAttributeAsVector2d(s32 index) = 0; 435 virtual core::vector2df getAttributeAsVector2d(s32 index) = 0;
436 436
437 //! Sets an attribute as 2d vector 437 //! Sets an attribute as 2d vector
438 virtual void setAttribute(s32 index, core::vector2df v) = 0; 438 virtual void setAttribute(s32 index, core::vector2df v) = 0;
439 439
440 /* 440 /*
441 441
442 Position2d Attribute 442 Position2d Attribute
443 443
444 */ 444 */
445 445
446 //! Adds an attribute as 2d position 446 //! Adds an attribute as 2d position
447 virtual void addPosition2d(const c8* attributeName, core::position2di value) = 0; 447 virtual void addPosition2d(const c8* attributeName, core::position2di value) = 0;
448 448
449 //! Sets a attribute as 2d position 449 //! Sets a attribute as 2d position
450 virtual void setAttribute(const c8* attributeName, core::position2di v) = 0; 450 virtual void setAttribute(const c8* attributeName, core::position2di v) = 0;
451 451
452 //! Gets an attribute as position 452 //! Gets an attribute as position
453 //! \param attributeName: Name of the attribute to get. 453 //! \param attributeName: Name of the attribute to get.
454 //! \return Returns value of the attribute previously set by setAttribute() 454 //! \return Returns value of the attribute previously set by setAttribute()
455 virtual core::position2di getAttributeAsPosition2d(const c8* attributeName) = 0; 455 virtual core::position2di getAttributeAsPosition2d(const c8* attributeName) = 0;
456 456
457 //! Gets an attribute as position 457 //! Gets an attribute as position
458 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 458 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
459 virtual core::position2di getAttributeAsPosition2d(s32 index) = 0; 459 virtual core::position2di getAttributeAsPosition2d(s32 index) = 0;
460 460
461 //! Sets an attribute as 2d position 461 //! Sets an attribute as 2d position
462 virtual void setAttribute(s32 index, core::position2di v) = 0; 462 virtual void setAttribute(s32 index, core::position2di v) = 0;
463 463
464 /* 464 /*
465 465
466 Rectangle Attribute 466 Rectangle Attribute
467 467
468 */ 468 */
469 469
470 //! Adds an attribute as rectangle 470 //! Adds an attribute as rectangle
471 virtual void addRect(const c8* attributeName, core::rect<s32> value) = 0; 471 virtual void addRect(const c8* attributeName, core::rect<s32> value) = 0;
472 472
473 //! Sets an attribute as rectangle 473 //! Sets an attribute as rectangle
474 virtual void setAttribute(const c8* attributeName, core::rect<s32> v) = 0; 474 virtual void setAttribute(const c8* attributeName, core::rect<s32> v) = 0;
475 475
476 //! Gets an attribute as rectangle 476 //! Gets an attribute as rectangle
477 //! \param attributeName: Name of the attribute to get. 477 //! \param attributeName: Name of the attribute to get.
478 //! \return Returns value of the attribute previously set by setAttribute() 478 //! \return Returns value of the attribute previously set by setAttribute()
479 virtual core::rect<s32> getAttributeAsRect(const c8* attributeName) = 0; 479 virtual core::rect<s32> getAttributeAsRect(const c8* attributeName) = 0;
480 480
481 //! Gets an attribute as rectangle 481 //! Gets an attribute as rectangle
482 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 482 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
483 virtual core::rect<s32> getAttributeAsRect(s32 index) = 0; 483 virtual core::rect<s32> getAttributeAsRect(s32 index) = 0;
484 484
485 //! Sets an attribute as rectangle 485 //! Sets an attribute as rectangle
486 virtual void setAttribute(s32 index, core::rect<s32> v) = 0; 486 virtual void setAttribute(s32 index, core::rect<s32> v) = 0;
487 487
488 488
489 /* 489 /*
490 490
491 Dimension2d Attribute 491 Dimension2d Attribute
492 492
493 */ 493 */
494 494
495 //! Adds an attribute as dimension2d 495 //! Adds an attribute as dimension2d
496 virtual void addDimension2d(const c8* attributeName, core::dimension2d<u32> value) = 0; 496 virtual void addDimension2d(const c8* attributeName, core::dimension2d<u32> value) = 0;
497 497
498 //! Sets an attribute as dimension2d 498 //! Sets an attribute as dimension2d
499 virtual void setAttribute(const c8* attributeName, core::dimension2d<u32> v) = 0; 499 virtual void setAttribute(const c8* attributeName, core::dimension2d<u32> v) = 0;
500 500
501 //! Gets an attribute as dimension2d 501 //! Gets an attribute as dimension2d
502 //! \param attributeName: Name of the attribute to get. 502 //! \param attributeName: Name of the attribute to get.
503 //! \return Returns value of the attribute previously set by setAttribute() 503 //! \return Returns value of the attribute previously set by setAttribute()
504 virtual core::dimension2d<u32> getAttributeAsDimension2d(const c8* attributeName) = 0; 504 virtual core::dimension2d<u32> getAttributeAsDimension2d(const c8* attributeName) = 0;
505 505
506 //! Gets an attribute as dimension2d 506 //! Gets an attribute as dimension2d
507 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 507 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
508 virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) = 0; 508 virtual core::dimension2d<u32> getAttributeAsDimension2d(s32 index) = 0;
509 509
510 //! Sets an attribute as dimension2d 510 //! Sets an attribute as dimension2d
511 virtual void setAttribute(s32 index, core::dimension2d<u32> v) = 0; 511 virtual void setAttribute(s32 index, core::dimension2d<u32> v) = 0;
512 512
513 513
514 /* 514 /*
515 matrix attribute 515 matrix attribute
516 */ 516 */
517 517
518 //! Adds an attribute as matrix 518 //! Adds an attribute as matrix
519 virtual void addMatrix(const c8* attributeName, const core::matrix4& v) = 0; 519 virtual void addMatrix(const c8* attributeName, const core::matrix4& v) = 0;
520 520
521 //! Sets an attribute as matrix 521 //! Sets an attribute as matrix
522 virtual void setAttribute(const c8* attributeName, const core::matrix4& v) = 0; 522 virtual void setAttribute(const c8* attributeName, const core::matrix4& v) = 0;
523 523
524 //! Gets an attribute as a matrix4 524 //! Gets an attribute as a matrix4
525 //! \param attributeName: Name of the attribute to get. 525 //! \param attributeName: Name of the attribute to get.
526 //! \return Returns value of the attribute previously set by setAttribute() 526 //! \return Returns value of the attribute previously set by setAttribute()
527 virtual core::matrix4 getAttributeAsMatrix(const c8* attributeName) = 0; 527 virtual core::matrix4 getAttributeAsMatrix(const c8* attributeName) = 0;
528 528
529 //! Gets an attribute as matrix 529 //! Gets an attribute as matrix
530 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 530 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
531 virtual core::matrix4 getAttributeAsMatrix(s32 index) = 0; 531 virtual core::matrix4 getAttributeAsMatrix(s32 index) = 0;
532 532
533 //! Sets an attribute as matrix 533 //! Sets an attribute as matrix
534 virtual void setAttribute(s32 index, const core::matrix4& v) = 0; 534 virtual void setAttribute(s32 index, const core::matrix4& v) = 0;
535 535
536 /* 536 /*
537 quaternion attribute 537 quaternion attribute
538 538
539 */ 539 */
540 540
541 //! Adds an attribute as quaternion 541 //! Adds an attribute as quaternion
542 virtual void addQuaternion(const c8* attributeName, core::quaternion v) = 0; 542 virtual void addQuaternion(const c8* attributeName, core::quaternion v) = 0;
543 543
544 //! Sets an attribute as quaternion 544 //! Sets an attribute as quaternion
545 virtual void setAttribute(const c8* attributeName, core::quaternion v) = 0; 545 virtual void setAttribute(const c8* attributeName, core::quaternion v) = 0;
546 546
547 //! Gets an attribute as a quaternion 547 //! Gets an attribute as a quaternion
548 //! \param attributeName: Name of the attribute to get. 548 //! \param attributeName: Name of the attribute to get.
549 //! \return Returns value of the attribute previously set by setAttribute() 549 //! \return Returns value of the attribute previously set by setAttribute()
550 virtual core::quaternion getAttributeAsQuaternion(const c8* attributeName) = 0; 550 virtual core::quaternion getAttributeAsQuaternion(const c8* attributeName) = 0;
551 551
552 //! Gets an attribute as quaternion 552 //! Gets an attribute as quaternion
553 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 553 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
554 virtual core::quaternion getAttributeAsQuaternion(s32 index) = 0; 554 virtual core::quaternion getAttributeAsQuaternion(s32 index) = 0;
555 555
556 //! Sets an attribute as quaternion 556 //! Sets an attribute as quaternion
557 virtual void setAttribute(s32 index, core::quaternion v) = 0; 557 virtual void setAttribute(s32 index, core::quaternion v) = 0;
558 558
559 /* 559 /*
560 560
561 3d bounding box 561 3d bounding box
562 562
563 */ 563 */
564 564
565 //! Adds an attribute as axis aligned bounding box 565 //! Adds an attribute as axis aligned bounding box
566 virtual void addBox3d(const c8* attributeName, core::aabbox3df v) = 0; 566 virtual void addBox3d(const c8* attributeName, core::aabbox3df v) = 0;
567 567
568 //! Sets an attribute as axis aligned bounding box 568 //! Sets an attribute as axis aligned bounding box
569 virtual void setAttribute(const c8* attributeName, core::aabbox3df v) = 0; 569 virtual void setAttribute(const c8* attributeName, core::aabbox3df v) = 0;
570 570
571 //! Gets an attribute as a axis aligned bounding box 571 //! Gets an attribute as a axis aligned bounding box
572 //! \param attributeName: Name of the attribute to get. 572 //! \param attributeName: Name of the attribute to get.
573 //! \return Returns value of the attribute previously set by setAttribute() 573 //! \return Returns value of the attribute previously set by setAttribute()
574 virtual core::aabbox3df getAttributeAsBox3d(const c8* attributeName) = 0; 574 virtual core::aabbox3df getAttributeAsBox3d(const c8* attributeName) = 0;
575 575
576 //! Gets an attribute as axis aligned bounding box 576 //! Gets an attribute as axis aligned bounding box
577 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 577 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
578 virtual core::aabbox3df getAttributeAsBox3d(s32 index) = 0; 578 virtual core::aabbox3df getAttributeAsBox3d(s32 index) = 0;
579 579
580 //! Sets an attribute as axis aligned bounding box 580 //! Sets an attribute as axis aligned bounding box
581 virtual void setAttribute(s32 index, core::aabbox3df v) = 0; 581 virtual void setAttribute(s32 index, core::aabbox3df v) = 0;
582 582
583 /* 583 /*
584 584
585 plane 585 plane
586 586
587 */ 587 */
588 588
589 //! Adds an attribute as 3d plane 589 //! Adds an attribute as 3d plane
590 virtual void addPlane3d(const c8* attributeName, core::plane3df v) = 0; 590 virtual void addPlane3d(const c8* attributeName, core::plane3df v) = 0;
591 591
592 //! Sets an attribute as 3d plane 592 //! Sets an attribute as 3d plane
593 virtual void setAttribute(const c8* attributeName, core::plane3df v) = 0; 593 virtual void setAttribute(const c8* attributeName, core::plane3df v) = 0;
594 594
595 //! Gets an attribute as a 3d plane 595 //! Gets an attribute as a 3d plane
596 //! \param attributeName: Name of the attribute to get. 596 //! \param attributeName: Name of the attribute to get.
597 //! \return Returns value of the attribute previously set by setAttribute() 597 //! \return Returns value of the attribute previously set by setAttribute()
598 virtual core::plane3df getAttributeAsPlane3d(const c8* attributeName) = 0; 598 virtual core::plane3df getAttributeAsPlane3d(const c8* attributeName) = 0;
599 599
600 //! Gets an attribute as 3d plane 600 //! Gets an attribute as 3d plane
601 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 601 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
602 virtual core::plane3df getAttributeAsPlane3d(s32 index) = 0; 602 virtual core::plane3df getAttributeAsPlane3d(s32 index) = 0;
603 603
604 //! Sets an attribute as 3d plane 604 //! Sets an attribute as 3d plane
605 virtual void setAttribute(s32 index, core::plane3df v) = 0; 605 virtual void setAttribute(s32 index, core::plane3df v) = 0;
606 606
607 607
608 /* 608 /*
609 609
610 3d triangle 610 3d triangle
611 611
612 */ 612 */
613 613
614 //! Adds an attribute as 3d triangle 614 //! Adds an attribute as 3d triangle
615 virtual void addTriangle3d(const c8* attributeName, core::triangle3df v) = 0; 615 virtual void addTriangle3d(const c8* attributeName, core::triangle3df v) = 0;
616 616
617 //! Sets an attribute as 3d trianle 617 //! Sets an attribute as 3d trianle
618 virtual void setAttribute(const c8* attributeName, core::triangle3df v) = 0; 618 virtual void setAttribute(const c8* attributeName, core::triangle3df v) = 0;
619 619
620 //! Gets an attribute as a 3d triangle 620 //! Gets an attribute as a 3d triangle
621 //! \param attributeName: Name of the attribute to get. 621 //! \param attributeName: Name of the attribute to get.
622 //! \return Returns value of the attribute previously set by setAttribute() 622 //! \return Returns value of the attribute previously set by setAttribute()
623 virtual core::triangle3df getAttributeAsTriangle3d(const c8* attributeName) = 0; 623 virtual core::triangle3df getAttributeAsTriangle3d(const c8* attributeName) = 0;
624 624
625 //! Gets an attribute as 3d triangle 625 //! Gets an attribute as 3d triangle
626 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 626 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
627 virtual core::triangle3df getAttributeAsTriangle3d(s32 index) = 0; 627 virtual core::triangle3df getAttributeAsTriangle3d(s32 index) = 0;
628 628
629 //! Sets an attribute as 3d triangle 629 //! Sets an attribute as 3d triangle
630 virtual void setAttribute(s32 index, core::triangle3df v) = 0; 630 virtual void setAttribute(s32 index, core::triangle3df v) = 0;
631 631
632 632
633 /* 633 /*
634 634
635 line 2d 635 line 2d
636 636
637 */ 637 */
638 638
639 //! Adds an attribute as a 2d line 639 //! Adds an attribute as a 2d line
640 virtual void addLine2d(const c8* attributeName, core::line2df v) = 0; 640 virtual void addLine2d(const c8* attributeName, core::line2df v) = 0;
641 641
642 //! Sets an attribute as a 2d line 642 //! Sets an attribute as a 2d line
643 virtual void setAttribute(const c8* attributeName, core::line2df v) = 0; 643 virtual void setAttribute(const c8* attributeName, core::line2df v) = 0;
644 644
645 //! Gets an attribute as a 2d line 645 //! Gets an attribute as a 2d line
646 //! \param attributeName: Name of the attribute to get. 646 //! \param attributeName: Name of the attribute to get.
647 //! \return Returns value of the attribute previously set by setAttribute() 647 //! \return Returns value of the attribute previously set by setAttribute()
648 virtual core::line2df getAttributeAsLine2d(const c8* attributeName) = 0; 648 virtual core::line2df getAttributeAsLine2d(const c8* attributeName) = 0;
649 649
650 //! Gets an attribute as a 2d line 650 //! Gets an attribute as a 2d line
651 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 651 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
652 virtual core::line2df getAttributeAsLine2d(s32 index) = 0; 652 virtual core::line2df getAttributeAsLine2d(s32 index) = 0;
653 653
654 //! Sets an attribute as a 2d line 654 //! Sets an attribute as a 2d line
655 virtual void setAttribute(s32 index, core::line2df v) = 0; 655 virtual void setAttribute(s32 index, core::line2df v) = 0;
656 656
657 657
658 /* 658 /*
659 659
660 line 3d 660 line 3d
661 661
662 */ 662 */
663 663
664 //! Adds an attribute as a 3d line 664 //! Adds an attribute as a 3d line
665 virtual void addLine3d(const c8* attributeName, core::line3df v) = 0; 665 virtual void addLine3d(const c8* attributeName, core::line3df v) = 0;
666 666
667 //! Sets an attribute as a 3d line 667 //! Sets an attribute as a 3d line
668 virtual void setAttribute(const c8* attributeName, core::line3df v) = 0; 668 virtual void setAttribute(const c8* attributeName, core::line3df v) = 0;
669 669
670 //! Gets an attribute as a 3d line 670 //! Gets an attribute as a 3d line
671 //! \param attributeName: Name of the attribute to get. 671 //! \param attributeName: Name of the attribute to get.
672 //! \return Returns value of the attribute previously set by setAttribute() 672 //! \return Returns value of the attribute previously set by setAttribute()
673 virtual core::line3df getAttributeAsLine3d(const c8* attributeName) = 0; 673 virtual core::line3df getAttributeAsLine3d(const c8* attributeName) = 0;
674 674
675 //! Gets an attribute as a 3d line 675 //! Gets an attribute as a 3d line
676 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 676 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
677 virtual core::line3df getAttributeAsLine3d(s32 index) = 0; 677 virtual core::line3df getAttributeAsLine3d(s32 index) = 0;
678 678
679 //! Sets an attribute as a 3d line 679 //! Sets an attribute as a 3d line
680 virtual void setAttribute(s32 index, core::line3df v) = 0; 680 virtual void setAttribute(s32 index, core::line3df v) = 0;
681 681
682 682
683 /* 683 /*
684 684
685 Texture Attribute 685 Texture Attribute
686 686
687 */ 687 */
688 688
689 //! Adds an attribute as texture reference 689 //! Adds an attribute as texture reference
690 virtual void addTexture(const c8* attributeName, video::ITexture* texture, const io::path& filename = "") = 0; 690 virtual void addTexture(const c8* attributeName, video::ITexture* texture, const io::path& filename = "") = 0;
691 691
692 //! Sets an attribute as texture reference 692 //! Sets an attribute as texture reference
693 virtual void setAttribute(const c8* attributeName, video::ITexture* texture, const io::path& filename = "") = 0; 693 virtual void setAttribute(const c8* attributeName, video::ITexture* texture, const io::path& filename = "") = 0;
694 694
695 //! Gets an attribute as texture reference 695 //! Gets an attribute as texture reference
696 //! \param attributeName: Name of the attribute to get. 696 //! \param attributeName: Name of the attribute to get.
697 virtual video::ITexture* getAttributeAsTexture(const c8* attributeName) = 0; 697 virtual video::ITexture* getAttributeAsTexture(const c8* attributeName) = 0;
698 698
699 //! Gets an attribute as texture reference 699 //! Gets an attribute as texture reference
700 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 700 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
701 virtual video::ITexture* getAttributeAsTexture(s32 index) = 0; 701 virtual video::ITexture* getAttributeAsTexture(s32 index) = 0;
702 702
703 //! Sets an attribute as texture reference 703 //! Sets an attribute as texture reference
704 virtual void setAttribute(s32 index, video::ITexture* texture, const io::path& filename = "") = 0; 704 virtual void setAttribute(s32 index, video::ITexture* texture, const io::path& filename = "") = 0;
705 705
706 706
707 /* 707 /*
708 708
709 User Pointer Attribute 709 User Pointer Attribute
710 710
711 */ 711 */
712 712
713 //! Adds an attribute as user pointner 713 //! Adds an attribute as user pointner
714 virtual void addUserPointer(const c8* attributeName, void* userPointer) = 0; 714 virtual void addUserPointer(const c8* attributeName, void* userPointer) = 0;
715 715
716 //! Sets an attribute as user pointer 716 //! Sets an attribute as user pointer
717 virtual void setAttribute(const c8* attributeName, void* userPointer) = 0; 717 virtual void setAttribute(const c8* attributeName, void* userPointer) = 0;
718 718
719 //! Gets an attribute as user pointer 719 //! Gets an attribute as user pointer
720 //! \param attributeName: Name of the attribute to get. 720 //! \param attributeName: Name of the attribute to get.
721 virtual void* getAttributeAsUserPointer(const c8* attributeName) = 0; 721 virtual void* getAttributeAsUserPointer(const c8* attributeName) = 0;
722 722
723 //! Gets an attribute as user pointer 723 //! Gets an attribute as user pointer
724 //! \param index: Index value, must be between 0 and getAttributeCount()-1. 724 //! \param index: Index value, must be between 0 and getAttributeCount()-1.
725 virtual void* getAttributeAsUserPointer(s32 index) = 0; 725 virtual void* getAttributeAsUserPointer(s32 index) = 0;
726 726
727 //! Sets an attribute as user pointer 727 //! Sets an attribute as user pointer
728 virtual void setAttribute(s32 index, void* userPointer) = 0; 728 virtual void setAttribute(s32 index, void* userPointer) = 0;
729 729
730}; 730};
731 731
732} // end namespace io 732} // end namespace io
733} // end namespace irr 733} // end namespace irr
734 734
735#endif 735#endif
736 736
737 737
738 738
diff --git a/libraries/irrlicht-1.8/include/IBillboardSceneNode.h b/libraries/irrlicht-1.8/include/IBillboardSceneNode.h
index 7776532..1c931d7 100644
--- a/libraries/irrlicht-1.8/include/IBillboardSceneNode.h
+++ b/libraries/irrlicht-1.8/include/IBillboardSceneNode.h
@@ -1,75 +1,75 @@
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#ifndef __I_BILLBOARD_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_BILLBOARD_SCENE_NODE_H_INCLUDED__
6#define __I_BILLBOARD_SCENE_NODE_H_INCLUDED__ 6#define __I_BILLBOARD_SCENE_NODE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! A billboard scene node. 15//! A billboard scene node.
16/** A billboard is like a 3d sprite: A 2d element, 16/** A billboard is like a 3d sprite: A 2d element,
17which always looks to the camera. It is usually used for explosions, fire, 17which always looks to the camera. It is usually used for explosions, fire,
18lensflares, particles and things like that. 18lensflares, particles and things like that.
19*/ 19*/
20class IBillboardSceneNode : public ISceneNode 20class IBillboardSceneNode : public ISceneNode
21{ 21{
22public: 22public:
23 23
24 //! Constructor 24 //! Constructor
25 IBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 25 IBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
26 const core::vector3df& position = core::vector3df(0,0,0)) 26 const core::vector3df& position = core::vector3df(0,0,0))
27 : ISceneNode(parent, mgr, id, position) {} 27 : ISceneNode(parent, mgr, id, position) {}
28 28
29 //! Sets the size of the billboard, making it rectangular. 29 //! Sets the size of the billboard, making it rectangular.
30 virtual void setSize(const core::dimension2d<f32>& size) = 0; 30 virtual void setSize(const core::dimension2d<f32>& size) = 0;
31 31
32 //! Sets the size of the billboard with independent widths of the bottom and top edges. 32 //! Sets the size of the billboard with independent widths of the bottom and top edges.
33 /** \param[in] height The height of the billboard. 33 /** \param[in] height The height of the billboard.
34 \param[in] bottomEdgeWidth The width of the bottom edge of the billboard. 34 \param[in] bottomEdgeWidth The width of the bottom edge of the billboard.
35 \param[in] topEdgeWidth The width of the top edge of the billboard. 35 \param[in] topEdgeWidth The width of the top edge of the billboard.
36 */ 36 */
37 virtual void setSize(f32 height, f32 bottomEdgeWidth, f32 topEdgeWidth) = 0; 37 virtual void setSize(f32 height, f32 bottomEdgeWidth, f32 topEdgeWidth) = 0;
38 38
39 //! Returns the size of the billboard. 39 //! Returns the size of the billboard.
40 /** This will return the width of the bottom edge of the billboard. 40 /** This will return the width of the bottom edge of the billboard.
41 Use getWidths() to retrieve the bottom and top edges independently. 41 Use getWidths() to retrieve the bottom and top edges independently.
42 \return Size of the billboard. 42 \return Size of the billboard.
43 */ 43 */
44 virtual const core::dimension2d<f32>& getSize() const = 0; 44 virtual const core::dimension2d<f32>& getSize() const = 0;
45 45
46 //! Gets the size of the the billboard and handles independent top and bottom edge widths correctly. 46 //! Gets the size of the the billboard and handles independent top and bottom edge widths correctly.
47 /** \param[out] height The height of the billboard. 47 /** \param[out] height The height of the billboard.
48 \param[out] bottomEdgeWidth The width of the bottom edge of the billboard. 48 \param[out] bottomEdgeWidth The width of the bottom edge of the billboard.
49 \param[out] topEdgeWidth The width of the top edge of the billboard. 49 \param[out] topEdgeWidth The width of the top edge of the billboard.
50 */ 50 */
51 virtual void getSize(f32& height, f32& bottomEdgeWidth, f32& topEdgeWidth) const =0; 51 virtual void getSize(f32& height, f32& bottomEdgeWidth, f32& topEdgeWidth) const =0;
52 52
53 //! Set the color of all vertices of the billboard 53 //! Set the color of all vertices of the billboard
54 /** \param[in] overallColor Color to set */ 54 /** \param[in] overallColor Color to set */
55 virtual void setColor(const video::SColor& overallColor) = 0; 55 virtual void setColor(const video::SColor& overallColor) = 0;
56 56
57 //! Set the color of the top and bottom vertices of the billboard 57 //! Set the color of the top and bottom vertices of the billboard
58 /** \param[in] topColor Color to set the top vertices 58 /** \param[in] topColor Color to set the top vertices
59 \param[in] bottomColor Color to set the bottom vertices */ 59 \param[in] bottomColor Color to set the bottom vertices */
60 virtual void setColor(const video::SColor& topColor, 60 virtual void setColor(const video::SColor& topColor,
61 const video::SColor& bottomColor) = 0; 61 const video::SColor& bottomColor) = 0;
62 62
63 //! Gets the color of the top and bottom vertices of the billboard 63 //! Gets the color of the top and bottom vertices of the billboard
64 /** \param[out] topColor Stores the color of the top vertices 64 /** \param[out] topColor Stores the color of the top vertices
65 \param[out] bottomColor Stores the color of the bottom vertices */ 65 \param[out] bottomColor Stores the color of the bottom vertices */
66 virtual void getColor(video::SColor& topColor, 66 virtual void getColor(video::SColor& topColor,
67 video::SColor& bottomColor) const = 0; 67 video::SColor& bottomColor) const = 0;
68}; 68};
69 69
70} // end namespace scene 70} // end namespace scene
71} // end namespace irr 71} // end namespace irr
72 72
73 73
74#endif 74#endif
75 75
diff --git a/libraries/irrlicht-1.8/include/IBillboardTextSceneNode.h b/libraries/irrlicht-1.8/include/IBillboardTextSceneNode.h
index b7f2359..30925da 100644
--- a/libraries/irrlicht-1.8/include/IBillboardTextSceneNode.h
+++ b/libraries/irrlicht-1.8/include/IBillboardTextSceneNode.h
@@ -1,62 +1,62 @@
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#ifndef __I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED__
6#define __I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED__ 6#define __I_BILLBOARD_TEXT_SCENE_NODE_H_INCLUDED__
7 7
8#include "IBillboardSceneNode.h" 8#include "IBillboardSceneNode.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! A billboard text scene node. 15//! A billboard text scene node.
16/** Acts like a billboard which displays the currently set text. 16/** Acts like a billboard which displays the currently set text.
17 Due to the exclusion of RTTI in Irrlicht we have to avoid multiple 17 Due to the exclusion of RTTI in Irrlicht we have to avoid multiple
18 inheritance. Hence, changes to the ITextSceneNode interface have 18 inheritance. Hence, changes to the ITextSceneNode interface have
19 to be copied here manually. 19 to be copied here manually.
20*/ 20*/
21class IBillboardTextSceneNode : public IBillboardSceneNode 21class IBillboardTextSceneNode : public IBillboardSceneNode
22{ 22{
23public: 23public:
24 24
25 //! Constructor 25 //! Constructor
26 IBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 26 IBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
27 const core::vector3df& position = core::vector3df(0,0,0)) 27 const core::vector3df& position = core::vector3df(0,0,0))
28 : IBillboardSceneNode(parent, mgr, id, position) {} 28 : IBillboardSceneNode(parent, mgr, id, position) {}
29 29
30 //! Sets the size of the billboard. 30 //! Sets the size of the billboard.
31 virtual void setSize(const core::dimension2d<f32>& size) = 0; 31 virtual void setSize(const core::dimension2d<f32>& size) = 0;
32 32
33 //! Returns the size of the billboard. 33 //! Returns the size of the billboard.
34 virtual const core::dimension2d<f32>& getSize() const = 0; 34 virtual const core::dimension2d<f32>& getSize() const = 0;
35 35
36 //! Set the color of all vertices of the billboard 36 //! Set the color of all vertices of the billboard
37 /** \param overallColor: the color to set */ 37 /** \param overallColor: the color to set */
38 virtual void setColor(const video::SColor & overallColor) = 0; 38 virtual void setColor(const video::SColor & overallColor) = 0;
39 39
40 //! Set the color of the top and bottom vertices of the billboard 40 //! Set the color of the top and bottom vertices of the billboard
41 /** \param topColor: the color to set the top vertices 41 /** \param topColor: the color to set the top vertices
42 \param bottomColor: the color to set the bottom vertices */ 42 \param bottomColor: the color to set the bottom vertices */
43 virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor) = 0; 43 virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor) = 0;
44 44
45 //! Gets the color of the top and bottom vertices of the billboard 45 //! Gets the color of the top and bottom vertices of the billboard
46 /** \param topColor: stores the color of the top vertices 46 /** \param topColor: stores the color of the top vertices
47 \param bottomColor: stores the color of the bottom vertices */ 47 \param bottomColor: stores the color of the bottom vertices */
48 virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) const = 0; 48 virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) const = 0;
49 49
50 //! sets the text string 50 //! sets the text string
51 virtual void setText(const wchar_t* text) = 0; 51 virtual void setText(const wchar_t* text) = 0;
52 52
53 //! sets the color of the text 53 //! sets the color of the text
54 virtual void setTextColor(video::SColor color) = 0; 54 virtual void setTextColor(video::SColor color) = 0;
55}; 55};
56 56
57} // end namespace scene 57} // end namespace scene
58} // end namespace irr 58} // end namespace irr
59 59
60 60
61#endif 61#endif
62 62
diff --git a/libraries/irrlicht-1.8/include/IBoneSceneNode.h b/libraries/irrlicht-1.8/include/IBoneSceneNode.h
index 6342668..d0063b4 100644
--- a/libraries/irrlicht-1.8/include/IBoneSceneNode.h
+++ b/libraries/irrlicht-1.8/include/IBoneSceneNode.h
@@ -1,108 +1,108 @@
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#ifndef __I_BONE_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_BONE_SCENE_NODE_H_INCLUDED__
6#define __I_BONE_SCENE_NODE_H_INCLUDED__ 6#define __I_BONE_SCENE_NODE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15 //! Enumeration for different bone animation modes 15 //! Enumeration for different bone animation modes
16 enum E_BONE_ANIMATION_MODE 16 enum E_BONE_ANIMATION_MODE
17 { 17 {
18 //! The bone is usually animated, unless it's parent is not animated 18 //! The bone is usually animated, unless it's parent is not animated
19 EBAM_AUTOMATIC=0, 19 EBAM_AUTOMATIC=0,
20 20
21 //! The bone is animated by the skin, if it's parent is not animated then animation will resume from this bone onward 21 //! The bone is animated by the skin, if it's parent is not animated then animation will resume from this bone onward
22 EBAM_ANIMATED, 22 EBAM_ANIMATED,
23 23
24 //! The bone is not animated by the skin 24 //! The bone is not animated by the skin
25 EBAM_UNANIMATED, 25 EBAM_UNANIMATED,
26 26
27 //! Not an animation mode, just here to count the available modes 27 //! Not an animation mode, just here to count the available modes
28 EBAM_COUNT 28 EBAM_COUNT
29 29
30 }; 30 };
31 31
32 enum E_BONE_SKINNING_SPACE 32 enum E_BONE_SKINNING_SPACE
33 { 33 {
34 //! local skinning, standard 34 //! local skinning, standard
35 EBSS_LOCAL=0, 35 EBSS_LOCAL=0,
36 36
37 //! global skinning 37 //! global skinning
38 EBSS_GLOBAL, 38 EBSS_GLOBAL,
39 39
40 EBSS_COUNT 40 EBSS_COUNT
41 }; 41 };
42 42
43 //! Names for bone animation modes 43 //! Names for bone animation modes
44 const c8* const BoneAnimationModeNames[] = 44 const c8* const BoneAnimationModeNames[] =
45 { 45 {
46 "automatic", 46 "automatic",
47 "animated", 47 "animated",
48 "unanimated", 48 "unanimated",
49 0, 49 0,
50 }; 50 };
51 51
52 52
53 //! Interface for bones used for skeletal animation. 53 //! Interface for bones used for skeletal animation.
54 /** Used with ISkinnedMesh and IAnimatedMeshSceneNode. */ 54 /** Used with ISkinnedMesh and IAnimatedMeshSceneNode. */
55 class IBoneSceneNode : public ISceneNode 55 class IBoneSceneNode : public ISceneNode
56 { 56 {
57 public: 57 public:
58 58
59 IBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id=-1) : 59 IBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id=-1) :
60 ISceneNode(parent, mgr, id),positionHint(-1),scaleHint(-1),rotationHint(-1) { } 60 ISceneNode(parent, mgr, id),positionHint(-1),scaleHint(-1),rotationHint(-1) { }
61 61
62 //! Get the name of the bone 62 //! Get the name of the bone
63 /** \deprecated Use getName instead. This method may be removed by Irrlicht 1.9 */ 63 /** \deprecated Use getName instead. This method may be removed by Irrlicht 1.9 */
64 _IRR_DEPRECATED_ virtual const c8* getBoneName() const { return getName(); } 64 _IRR_DEPRECATED_ virtual const c8* getBoneName() const { return getName(); }
65 65
66 //! Get the index of the bone 66 //! Get the index of the bone
67 virtual u32 getBoneIndex() const = 0; 67 virtual u32 getBoneIndex() const = 0;
68 68
69 //! Sets the animation mode of the bone. 69 //! Sets the animation mode of the bone.
70 /** \return True if successful. (Unused) */ 70 /** \return True if successful. (Unused) */
71 virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode) = 0; 71 virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode) = 0;
72 72
73 //! Gets the current animation mode of the bone 73 //! Gets the current animation mode of the bone
74 virtual E_BONE_ANIMATION_MODE getAnimationMode() const = 0; 74 virtual E_BONE_ANIMATION_MODE getAnimationMode() const = 0;
75 75
76 //! Get the axis aligned bounding box of this node 76 //! Get the axis aligned bounding box of this node
77 virtual const core::aabbox3d<f32>& getBoundingBox() const = 0; 77 virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
78 78
79 //! Returns the relative transformation of the scene node. 79 //! Returns the relative transformation of the scene node.
80 //virtual core::matrix4 getRelativeTransformation() const = 0; 80 //virtual core::matrix4 getRelativeTransformation() const = 0;
81 81
82 //! The animation method. 82 //! The animation method.
83 virtual void OnAnimate(u32 timeMs) =0; 83 virtual void OnAnimate(u32 timeMs) =0;
84 84
85 //! The render method. 85 //! The render method.
86 /** Does nothing as bones are not visible. */ 86 /** Does nothing as bones are not visible. */
87 virtual void render() { } 87 virtual void render() { }
88 88
89 //! How the relative transformation of the bone is used 89 //! How the relative transformation of the bone is used
90 virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space ) =0; 90 virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space ) =0;
91 91
92 //! How the relative transformation of the bone is used 92 //! How the relative transformation of the bone is used
93 virtual E_BONE_SKINNING_SPACE getSkinningSpace() const =0; 93 virtual E_BONE_SKINNING_SPACE getSkinningSpace() const =0;
94 94
95 //! Updates the absolute position based on the relative and the parents position 95 //! Updates the absolute position based on the relative and the parents position
96 virtual void updateAbsolutePositionOfAllChildren()=0; 96 virtual void updateAbsolutePositionOfAllChildren()=0;
97 97
98 s32 positionHint; 98 s32 positionHint;
99 s32 scaleHint; 99 s32 scaleHint;
100 s32 rotationHint; 100 s32 rotationHint;
101 }; 101 };
102 102
103 103
104} // end namespace scene 104} // end namespace scene
105} // end namespace irr 105} // end namespace irr
106 106
107#endif 107#endif
108 108
diff --git a/libraries/irrlicht-1.8/include/ICameraSceneNode.h b/libraries/irrlicht-1.8/include/ICameraSceneNode.h
index a71eb95..dfc1b7a 100644
--- a/libraries/irrlicht-1.8/include/ICameraSceneNode.h
+++ b/libraries/irrlicht-1.8/include/ICameraSceneNode.h
@@ -1,207 +1,207 @@
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#ifndef __I_CAMERA_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_CAMERA_SCENE_NODE_H_INCLUDED__
6#define __I_CAMERA_SCENE_NODE_H_INCLUDED__ 6#define __I_CAMERA_SCENE_NODE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9#include "IEventReceiver.h" 9#include "IEventReceiver.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 struct SViewFrustum; 15 struct SViewFrustum;
16 16
17 //! Scene Node which is a (controlable) camera. 17 //! Scene Node which is a (controlable) camera.
18 /** The whole scene will be rendered from the cameras point of view. 18 /** The whole scene will be rendered from the cameras point of view.
19 Because the ICameraScenNode is a SceneNode, it can be attached to any 19 Because the ICameraScenNode is a SceneNode, it can be attached to any
20 other scene node, and will follow its parents movement, rotation and so 20 other scene node, and will follow its parents movement, rotation and so
21 on. 21 on.
22 */ 22 */
23 class ICameraSceneNode : public ISceneNode, public IEventReceiver 23 class ICameraSceneNode : public ISceneNode, public IEventReceiver
24 { 24 {
25 public: 25 public:
26 26
27 //! Constructor 27 //! Constructor
28 ICameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 28 ICameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
29 const core::vector3df& position = core::vector3df(0,0,0), 29 const core::vector3df& position = core::vector3df(0,0,0),
30 const core::vector3df& rotation = core::vector3df(0,0,0), 30 const core::vector3df& rotation = core::vector3df(0,0,0),
31 const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f)) 31 const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f))
32 : ISceneNode(parent, mgr, id, position, rotation, scale), IsOrthogonal(false) {} 32 : ISceneNode(parent, mgr, id, position, rotation, scale), IsOrthogonal(false) {}
33 33
34 //! Sets the projection matrix of the camera. 34 //! Sets the projection matrix of the camera.
35 /** The core::matrix4 class has some methods to build a 35 /** The core::matrix4 class has some methods to build a
36 projection matrix. e.g: 36 projection matrix. e.g:
37 core::matrix4::buildProjectionMatrixPerspectiveFovLH. 37 core::matrix4::buildProjectionMatrixPerspectiveFovLH.
38 Note that the matrix will only stay as set by this method until 38 Note that the matrix will only stay as set by this method until
39 one of the following Methods are called: setNearValue, 39 one of the following Methods are called: setNearValue,
40 setFarValue, setAspectRatio, setFOV. 40 setFarValue, setAspectRatio, setFOV.
41 \param projection The new projection matrix of the camera. 41 \param projection The new projection matrix of the camera.
42 \param isOrthogonal Set this to true if the matrix is an 42 \param isOrthogonal Set this to true if the matrix is an
43 orthogonal one (e.g. from matrix4::buildProjectionMatrixOrtho). 43 orthogonal one (e.g. from matrix4::buildProjectionMatrixOrtho).
44 */ 44 */
45 virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal=false) =0; 45 virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal=false) =0;
46 46
47 //! Gets the current projection matrix of the camera. 47 //! Gets the current projection matrix of the camera.
48 /** \return The current projection matrix of the camera. */ 48 /** \return The current projection matrix of the camera. */
49 virtual const core::matrix4& getProjectionMatrix() const =0; 49 virtual const core::matrix4& getProjectionMatrix() const =0;
50 50
51 //! Gets the current view matrix of the camera. 51 //! Gets the current view matrix of the camera.
52 /** \return The current view matrix of the camera. */ 52 /** \return The current view matrix of the camera. */
53 virtual const core::matrix4& getViewMatrix() const =0; 53 virtual const core::matrix4& getViewMatrix() const =0;
54 54
55 //! Sets a custom view matrix affector. 55 //! Sets a custom view matrix affector.
56 /** The matrix passed here, will be multiplied with the view 56 /** The matrix passed here, will be multiplied with the view
57 matrix when it gets updated. This allows for custom camera 57 matrix when it gets updated. This allows for custom camera
58 setups like, for example, a reflection camera. 58 setups like, for example, a reflection camera.
59 \param affector The affector matrix. */ 59 \param affector The affector matrix. */
60 virtual void setViewMatrixAffector(const core::matrix4& affector) =0; 60 virtual void setViewMatrixAffector(const core::matrix4& affector) =0;
61 61
62 //! Get the custom view matrix affector. 62 //! Get the custom view matrix affector.
63 /** \return The affector matrix. */ 63 /** \return The affector matrix. */
64 virtual const core::matrix4& getViewMatrixAffector() const =0; 64 virtual const core::matrix4& getViewMatrixAffector() const =0;
65 65
66 //! It is possible to send mouse and key events to the camera. 66 //! It is possible to send mouse and key events to the camera.
67 /** Most cameras may ignore this input, but camera scene nodes 67 /** Most cameras may ignore this input, but camera scene nodes
68 which are created for example with 68 which are created for example with
69 ISceneManager::addCameraSceneNodeMaya or 69 ISceneManager::addCameraSceneNodeMaya or
70 ISceneManager::addCameraSceneNodeFPS, may want to get 70 ISceneManager::addCameraSceneNodeFPS, may want to get
71 this input for changing their position, look at target or 71 this input for changing their position, look at target or
72 whatever. */ 72 whatever. */
73 virtual bool OnEvent(const SEvent& event) =0; 73 virtual bool OnEvent(const SEvent& event) =0;
74 74
75 //! Sets the look at target of the camera 75 //! Sets the look at target of the camera
76 /** If the camera's target and rotation are bound ( @see 76 /** If the camera's target and rotation are bound ( @see
77 bindTargetAndRotation() ) then calling this will also change 77 bindTargetAndRotation() ) then calling this will also change
78 the camera's scene node rotation to match the target. 78 the camera's scene node rotation to match the target.
79 Note that setTarget uses the current absolute position 79 Note that setTarget uses the current absolute position
80 internally, so if you changed setPosition since last rendering you must 80 internally, so if you changed setPosition since last rendering you must
81 call updateAbsolutePosition before using this function. 81 call updateAbsolutePosition before using this function.
82 \param pos Look at target of the camera, in world co-ordinates. */ 82 \param pos Look at target of the camera, in world co-ordinates. */
83 virtual void setTarget(const core::vector3df& pos) =0; 83 virtual void setTarget(const core::vector3df& pos) =0;
84 84
85 //! Sets the rotation of the node. 85 //! Sets the rotation of the node.
86 /** This only modifies the relative rotation of the node. 86 /** This only modifies the relative rotation of the node.
87 If the camera's target and rotation are bound ( @see 87 If the camera's target and rotation are bound ( @see
88 bindTargetAndRotation() ) then calling this will also change 88 bindTargetAndRotation() ) then calling this will also change
89 the camera's target to match the rotation. 89 the camera's target to match the rotation.
90 \param rotation New rotation of the node in degrees. */ 90 \param rotation New rotation of the node in degrees. */
91 virtual void setRotation(const core::vector3df& rotation) =0; 91 virtual void setRotation(const core::vector3df& rotation) =0;
92 92
93 //! Gets the current look at target of the camera 93 //! Gets the current look at target of the camera
94 /** \return The current look at target of the camera, in world co-ordinates */ 94 /** \return The current look at target of the camera, in world co-ordinates */
95 virtual const core::vector3df& getTarget() const =0; 95 virtual const core::vector3df& getTarget() const =0;
96 96
97 //! Sets the up vector of the camera. 97 //! Sets the up vector of the camera.
98 /** \param pos: New upvector of the camera. */ 98 /** \param pos: New upvector of the camera. */
99 virtual void setUpVector(const core::vector3df& pos) =0; 99 virtual void setUpVector(const core::vector3df& pos) =0;
100 100
101 //! Gets the up vector of the camera. 101 //! Gets the up vector of the camera.
102 /** \return The up vector of the camera, in world space. */ 102 /** \return The up vector of the camera, in world space. */
103 virtual const core::vector3df& getUpVector() const =0; 103 virtual const core::vector3df& getUpVector() const =0;
104 104
105 //! Gets the value of the near plane of the camera. 105 //! Gets the value of the near plane of the camera.
106 /** \return The value of the near plane of the camera. */ 106 /** \return The value of the near plane of the camera. */
107 virtual f32 getNearValue() const =0; 107 virtual f32 getNearValue() const =0;
108 108
109 //! Gets the value of the far plane of the camera. 109 //! Gets the value of the far plane of the camera.
110 /** \return The value of the far plane of the camera. */ 110 /** \return The value of the far plane of the camera. */
111 virtual f32 getFarValue() const =0; 111 virtual f32 getFarValue() const =0;
112 112
113 //! Gets the aspect ratio of the camera. 113 //! Gets the aspect ratio of the camera.
114 /** \return The aspect ratio of the camera. */ 114 /** \return The aspect ratio of the camera. */
115 virtual f32 getAspectRatio() const =0; 115 virtual f32 getAspectRatio() const =0;
116 116
117 //! Gets the field of view of the camera. 117 //! Gets the field of view of the camera.
118 /** \return The field of view of the camera in radians. */ 118 /** \return The field of view of the camera in radians. */
119 virtual f32 getFOV() const =0; 119 virtual f32 getFOV() const =0;
120 120
121 //! Sets the value of the near clipping plane. (default: 1.0f) 121 //! Sets the value of the near clipping plane. (default: 1.0f)
122 /** \param zn: New z near value. */ 122 /** \param zn: New z near value. */
123 virtual void setNearValue(f32 zn) =0; 123 virtual void setNearValue(f32 zn) =0;
124 124
125 //! Sets the value of the far clipping plane (default: 2000.0f) 125 //! Sets the value of the far clipping plane (default: 2000.0f)
126 /** \param zf: New z far value. */ 126 /** \param zf: New z far value. */
127 virtual void setFarValue(f32 zf) =0; 127 virtual void setFarValue(f32 zf) =0;
128 128
129 //! Sets the aspect ratio (default: 4.0f / 3.0f) 129 //! Sets the aspect ratio (default: 4.0f / 3.0f)
130 /** \param aspect: New aspect ratio. */ 130 /** \param aspect: New aspect ratio. */
131 virtual void setAspectRatio(f32 aspect) =0; 131 virtual void setAspectRatio(f32 aspect) =0;
132 132
133 //! Sets the field of view (Default: PI / 2.5f) 133 //! Sets the field of view (Default: PI / 2.5f)
134 /** \param fovy: New field of view in radians. */ 134 /** \param fovy: New field of view in radians. */
135 virtual void setFOV(f32 fovy) =0; 135 virtual void setFOV(f32 fovy) =0;
136 136
137 //! Get the view frustum. 137 //! Get the view frustum.
138 /** Needed sometimes by bspTree or LOD render nodes. 138 /** Needed sometimes by bspTree or LOD render nodes.
139 \return The current view frustum. */ 139 \return The current view frustum. */
140 virtual const SViewFrustum* getViewFrustum() const =0; 140 virtual const SViewFrustum* getViewFrustum() const =0;
141 141
142 //! Disables or enables the camera to get key or mouse inputs. 142 //! Disables or enables the camera to get key or mouse inputs.
143 /** If this is set to true, the camera will respond to key 143 /** If this is set to true, the camera will respond to key
144 inputs otherwise not. */ 144 inputs otherwise not. */
145 virtual void setInputReceiverEnabled(bool enabled) =0; 145 virtual void setInputReceiverEnabled(bool enabled) =0;
146 146
147 //! Checks if the input receiver of the camera is currently enabled. 147 //! Checks if the input receiver of the camera is currently enabled.
148 virtual bool isInputReceiverEnabled() const =0; 148 virtual bool isInputReceiverEnabled() const =0;
149 149
150 //! Checks if a camera is orthogonal. 150 //! Checks if a camera is orthogonal.
151 virtual bool isOrthogonal() const 151 virtual bool isOrthogonal() const
152 { 152 {
153 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 153 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
154 return IsOrthogonal; 154 return IsOrthogonal;
155 } 155 }
156 156
157 //! Binds the camera scene node's rotation to its target position and vice vera, or unbinds them. 157 //! Binds the camera scene node's rotation to its target position and vice vera, or unbinds them.
158 /** When bound, calling setRotation() will update the camera's 158 /** When bound, calling setRotation() will update the camera's
159 target position to be along its +Z axis, and likewise calling 159 target position to be along its +Z axis, and likewise calling
160 setTarget() will update its rotation so that its +Z axis will 160 setTarget() will update its rotation so that its +Z axis will
161 point at the target point. FPS camera use this binding by 161 point at the target point. FPS camera use this binding by
162 default; other cameras do not. 162 default; other cameras do not.
163 \param bound True to bind the camera's scene node rotation 163 \param bound True to bind the camera's scene node rotation
164 and targetting, false to unbind them. 164 and targetting, false to unbind them.
165 @see getTargetAndRotationBinding() */ 165 @see getTargetAndRotationBinding() */
166 virtual void bindTargetAndRotation(bool bound) =0; 166 virtual void bindTargetAndRotation(bool bound) =0;
167 167
168 //! Queries if the camera scene node's rotation and its target position are bound together. 168 //! Queries if the camera scene node's rotation and its target position are bound together.
169 /** @see bindTargetAndRotation() */ 169 /** @see bindTargetAndRotation() */
170 virtual bool getTargetAndRotationBinding(void) const =0; 170 virtual bool getTargetAndRotationBinding(void) const =0;
171 171
172 //! Writes attributes of the camera node 172 //! Writes attributes of the camera node
173 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const 173 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
174 { 174 {
175 ISceneNode::serializeAttributes(out, options); 175 ISceneNode::serializeAttributes(out, options);
176 176
177 if (!out) 177 if (!out)
178 return; 178 return;
179 out->addBool ("IsOrthogonal", IsOrthogonal ); 179 out->addBool ("IsOrthogonal", IsOrthogonal );
180 } 180 }
181 181
182 //! Reads attributes of the camera node 182 //! Reads attributes of the camera node
183 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) 183 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
184 { 184 {
185 ISceneNode::deserializeAttributes(in, options); 185 ISceneNode::deserializeAttributes(in, options);
186 if (!in) 186 if (!in)
187 return; 187 return;
188 188
189 if ( in->findAttribute("IsOrthogonal") ) 189 if ( in->findAttribute("IsOrthogonal") )
190 IsOrthogonal = in->getAttributeAsBool("IsOrthogonal"); 190 IsOrthogonal = in->getAttributeAsBool("IsOrthogonal");
191 } 191 }
192 192
193 protected: 193 protected:
194 194
195 void cloneMembers(ICameraSceneNode* toCopyFrom) 195 void cloneMembers(ICameraSceneNode* toCopyFrom)
196 { 196 {
197 IsOrthogonal = toCopyFrom->IsOrthogonal; 197 IsOrthogonal = toCopyFrom->IsOrthogonal;
198 } 198 }
199 199
200 bool IsOrthogonal; 200 bool IsOrthogonal;
201 }; 201 };
202 202
203} // end namespace scene 203} // end namespace scene
204} // end namespace irr 204} // end namespace irr
205 205
206#endif 206#endif
207 207
diff --git a/libraries/irrlicht-1.8/include/IColladaMeshWriter.h b/libraries/irrlicht-1.8/include/IColladaMeshWriter.h
index 90691f5..dc2afed 100644
--- a/libraries/irrlicht-1.8/include/IColladaMeshWriter.h
+++ b/libraries/irrlicht-1.8/include/IColladaMeshWriter.h
@@ -1,404 +1,404 @@
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#ifndef __IRR_I_COLLADA_MESH_WRITER_H_INCLUDED__ 5#ifndef __IRR_I_COLLADA_MESH_WRITER_H_INCLUDED__
6#define __IRR_I_COLLADA_MESH_WRITER_H_INCLUDED__ 6#define __IRR_I_COLLADA_MESH_WRITER_H_INCLUDED__
7 7
8#include "IMeshWriter.h" 8#include "IMeshWriter.h"
9#include "ISceneNode.h" 9#include "ISceneNode.h"
10#include "IAnimatedMesh.h" 10#include "IAnimatedMesh.h"
11#include "SMaterial.h" 11#include "SMaterial.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace io 15namespace io
16{ 16{
17 class IWriteFile; 17 class IWriteFile;
18} // end namespace io 18} // end namespace io
19 19
20namespace scene 20namespace scene
21{ 21{
22 //! Lighting models - more or less the way Collada categorizes materials 22 //! Lighting models - more or less the way Collada categorizes materials
23 enum E_COLLADA_TECHNIQUE_FX 23 enum E_COLLADA_TECHNIQUE_FX
24 { 24 {
25 //! Blinn-phong which is default for opengl and dx fixed function pipelines. 25 //! Blinn-phong which is default for opengl and dx fixed function pipelines.
26 //! But several well-known renderers don't support it and prefer phong. 26 //! But several well-known renderers don't support it and prefer phong.
27 ECTF_BLINN, 27 ECTF_BLINN,
28 //! Phong shading, default in many external renderers. 28 //! Phong shading, default in many external renderers.
29 ECTF_PHONG, 29 ECTF_PHONG,
30 //! diffuse shaded surface that is independent of lighting. 30 //! diffuse shaded surface that is independent of lighting.
31 ECTF_LAMBERT, 31 ECTF_LAMBERT,
32 // constantly shaded surface that is independent of lighting. 32 // constantly shaded surface that is independent of lighting.
33 ECTF_CONSTANT 33 ECTF_CONSTANT
34 }; 34 };
35 35
36 //! How to interpret the opacity in collada 36 //! How to interpret the opacity in collada
37 enum E_COLLADA_TRANSPARENT_FX 37 enum E_COLLADA_TRANSPARENT_FX
38 { 38 {
39 //! default - only alpha channel of color or texture is used. 39 //! default - only alpha channel of color or texture is used.
40 ECOF_A_ONE = 0, 40 ECOF_A_ONE = 0,
41 41
42 //! Alpha values for each RGB channel of color or texture are used. 42 //! Alpha values for each RGB channel of color or texture are used.
43 ECOF_RGB_ZERO = 1 43 ECOF_RGB_ZERO = 1
44 }; 44 };
45 45
46 //! Color names collada uses in it's color samplers 46 //! Color names collada uses in it's color samplers
47 enum E_COLLADA_COLOR_SAMPLER 47 enum E_COLLADA_COLOR_SAMPLER
48 { 48 {
49 ECCS_DIFFUSE, 49 ECCS_DIFFUSE,
50 ECCS_AMBIENT, 50 ECCS_AMBIENT,
51 ECCS_EMISSIVE, 51 ECCS_EMISSIVE,
52 ECCS_SPECULAR, 52 ECCS_SPECULAR,
53 ECCS_TRANSPARENT, 53 ECCS_TRANSPARENT,
54 ECCS_REFLECTIVE 54 ECCS_REFLECTIVE
55 }; 55 };
56 56
57 //! Irrlicht colors which can be mapped to E_COLLADA_COLOR_SAMPLER values 57 //! Irrlicht colors which can be mapped to E_COLLADA_COLOR_SAMPLER values
58 enum E_COLLADA_IRR_COLOR 58 enum E_COLLADA_IRR_COLOR
59 { 59 {
60 //! Don't write this element at all 60 //! Don't write this element at all
61 ECIC_NONE, 61 ECIC_NONE,
62 62
63 //! Check IColladaMeshWriterProperties for custom color 63 //! Check IColladaMeshWriterProperties for custom color
64 ECIC_CUSTOM, 64 ECIC_CUSTOM,
65 65
66 //! Use SMaterial::DiffuseColor 66 //! Use SMaterial::DiffuseColor
67 ECIC_DIFFUSE, 67 ECIC_DIFFUSE,
68 68
69 //! Use SMaterial::AmbientColor 69 //! Use SMaterial::AmbientColor
70 ECIC_AMBIENT, 70 ECIC_AMBIENT,
71 71
72 //! Use SMaterial::EmissiveColor 72 //! Use SMaterial::EmissiveColor
73 ECIC_EMISSIVE, 73 ECIC_EMISSIVE,
74 74
75 //! Use SMaterial::SpecularColor 75 //! Use SMaterial::SpecularColor
76 ECIC_SPECULAR 76 ECIC_SPECULAR
77 }; 77 };
78 78
79 //! Control when geometry elements are created 79 //! Control when geometry elements are created
80 enum E_COLLADA_GEOMETRY_WRITING 80 enum E_COLLADA_GEOMETRY_WRITING
81 { 81 {
82 //! Default - write each mesh exactly once to collada. Optimal but will not work with many tools. 82 //! Default - write each mesh exactly once to collada. Optimal but will not work with many tools.
83 ECGI_PER_MESH, 83 ECGI_PER_MESH,
84 84
85 //! Write each mesh as often as it's used with different materials-names in the scene. 85 //! Write each mesh as often as it's used with different materials-names in the scene.
86 //! Material names which are used here are created on export, so using the IColladaMeshWriterNames 86 //! Material names which are used here are created on export, so using the IColladaMeshWriterNames
87 //! interface you have some control over how many geometries are written. 87 //! interface you have some control over how many geometries are written.
88 ECGI_PER_MESH_AND_MATERIAL 88 ECGI_PER_MESH_AND_MATERIAL
89 }; 89 };
90 90
91 //! Callback interface for properties which can be used to influence collada writing 91 //! Callback interface for properties which can be used to influence collada writing
92 class IColladaMeshWriterProperties : public virtual IReferenceCounted 92 class IColladaMeshWriterProperties : public virtual IReferenceCounted
93 { 93 {
94 public: 94 public:
95 virtual ~IColladaMeshWriterProperties () {} 95 virtual ~IColladaMeshWriterProperties () {}
96 96
97 //! Which lighting model should be used in the technique (FX) section when exporting effects (materials) 97 //! Which lighting model should be used in the technique (FX) section when exporting effects (materials)
98 virtual E_COLLADA_TECHNIQUE_FX getTechniqueFx(const video::SMaterial& material) const = 0; 98 virtual E_COLLADA_TECHNIQUE_FX getTechniqueFx(const video::SMaterial& material) const = 0;
99 99
100 //! Which texture index should be used when writing the texture of the given sampler color. 100 //! Which texture index should be used when writing the texture of the given sampler color.
101 /** \return the index to the texture-layer or -1 if that texture should never be exported 101 /** \return the index to the texture-layer or -1 if that texture should never be exported
102 Note: for ECCS_TRANSPARENT by default the alpha channel is used, if you want to use RGB you have to set 102 Note: for ECCS_TRANSPARENT by default the alpha channel is used, if you want to use RGB you have to set
103 also the ECOF_RGB_ZERO flag in getTransparentFx. */ 103 also the ECOF_RGB_ZERO flag in getTransparentFx. */
104 virtual s32 getTextureIdx(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0; 104 virtual s32 getTextureIdx(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
105 105
106 //! Return which color from Irrlicht should be used for the color requested by collada 106 //! Return which color from Irrlicht should be used for the color requested by collada
107 /** Note that collada allows exporting either texture or color, not both. 107 /** Note that collada allows exporting either texture or color, not both.
108 So color mapping is only checked if we have no valid texture already. 108 So color mapping is only checked if we have no valid texture already.
109 By default we try to return best fits when possible. For example ECCS_DIFFUSE is mapped to ECIC_DIFFUSE. 109 By default we try to return best fits when possible. For example ECCS_DIFFUSE is mapped to ECIC_DIFFUSE.
110 When ECIC_CUSTOM is returned then the result of getCustomColor will be used. */ 110 When ECIC_CUSTOM is returned then the result of getCustomColor will be used. */
111 virtual E_COLLADA_IRR_COLOR getColorMapping(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0; 111 virtual E_COLLADA_IRR_COLOR getColorMapping(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
112 112
113 //! Return custom colors for certain color types requested by collada. 113 //! Return custom colors for certain color types requested by collada.
114 /** Only used when getColorMapping returns ECIC_CUSTOM for the same paramters. */ 114 /** Only used when getColorMapping returns ECIC_CUSTOM for the same paramters. */
115 virtual video::SColor getCustomColor(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0; 115 virtual video::SColor getCustomColor(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
116 116
117 //! Return the transparence color interpretation. 117 //! Return the transparence color interpretation.
118 /** Not this is only about ECCS_TRANSPARENT and does not affect getTransparency. */ 118 /** Not this is only about ECCS_TRANSPARENT and does not affect getTransparency. */
119 virtual E_COLLADA_TRANSPARENT_FX getTransparentFx(const video::SMaterial& material) const = 0; 119 virtual E_COLLADA_TRANSPARENT_FX getTransparentFx(const video::SMaterial& material) const = 0;
120 120
121 //! Transparency value for that material. 121 //! Transparency value for that material.
122 /** This value is additional to transparent settings, if both are set they will be multiplicated. 122 /** This value is additional to transparent settings, if both are set they will be multiplicated.
123 \return 1.0 for fully transparent, 0.0 for not transparent and not written at all when < 0.f */ 123 \return 1.0 for fully transparent, 0.0 for not transparent and not written at all when < 0.f */
124 virtual f32 getTransparency(const video::SMaterial& material) const = 0; 124 virtual f32 getTransparency(const video::SMaterial& material) const = 0;
125 125
126 //! Reflectivity value for that material 126 //! Reflectivity value for that material
127 /** The amount of perfect mirror reflection to be added to the reflected light 127 /** The amount of perfect mirror reflection to be added to the reflected light
128 \return 0.0 - 1.0 for reflectivity and element is not written at all when < 0.f */ 128 \return 0.0 - 1.0 for reflectivity and element is not written at all when < 0.f */
129 virtual f32 getReflectivity(const video::SMaterial& material) const = 0; 129 virtual f32 getReflectivity(const video::SMaterial& material) const = 0;
130 130
131 //! Return index of refraction for that material 131 //! Return index of refraction for that material
132 /** By default we don't write that. 132 /** By default we don't write that.
133 \return a value greater equal 0.f to write \<index_of_refraction\> when it is lesser than 0 nothing will be written */ 133 \return a value greater equal 0.f to write \<index_of_refraction\> when it is lesser than 0 nothing will be written */
134 virtual f32 getIndexOfRefraction(const video::SMaterial& material) const = 0; 134 virtual f32 getIndexOfRefraction(const video::SMaterial& material) const = 0;
135 135
136 //! Should node be used in scene export? (only needed for scene-writing, ignored in mesh-writing) 136 //! Should node be used in scene export? (only needed for scene-writing, ignored in mesh-writing)
137 //! By default all visible nodes are exported. 137 //! By default all visible nodes are exported.
138 virtual bool isExportable(const irr::scene::ISceneNode * node) const = 0; 138 virtual bool isExportable(const irr::scene::ISceneNode * node) const = 0;
139 139
140 //! Return the mesh for the given node. If it has no mesh or shouldn't export it's mesh 140 //! Return the mesh for the given node. If it has no mesh or shouldn't export it's mesh
141 //! you can return 0 in which case only the transformation matrix of the node will be used. 141 //! you can return 0 in which case only the transformation matrix of the node will be used.
142 // Note: Function is not const because there is no const getMesh() function. 142 // Note: Function is not const because there is no const getMesh() function.
143 virtual IMesh* getMesh(irr::scene::ISceneNode * node) = 0; 143 virtual IMesh* getMesh(irr::scene::ISceneNode * node) = 0;
144 144
145 //! Return if the node has it's own material overwriting the mesh-materials 145 //! Return if the node has it's own material overwriting the mesh-materials
146 /** Usually true except for mesh-nodes which have isReadOnlyMaterials set. 146 /** Usually true except for mesh-nodes which have isReadOnlyMaterials set.
147 This is mostly important for naming (as ISceneNode::getMaterial() already returns the correct material). 147 This is mostly important for naming (as ISceneNode::getMaterial() already returns the correct material).
148 You have to override it when exporting custom scenenodes with own materials. 148 You have to override it when exporting custom scenenodes with own materials.
149 \return true => The node's own material is used, false => ignore node material and use the one from the mesh */ 149 \return true => The node's own material is used, false => ignore node material and use the one from the mesh */
150 virtual bool useNodeMaterial(const scene::ISceneNode* node) const = 0; 150 virtual bool useNodeMaterial(const scene::ISceneNode* node) const = 0;
151 151
152 }; 152 };
153 153
154 //! Callback interface to use custom names on collada writing. 154 //! Callback interface to use custom names on collada writing.
155 /** You can either modify names and id's written to collada or you can use 155 /** You can either modify names and id's written to collada or you can use
156 this interface to just find out which names are used on writing. 156 this interface to just find out which names are used on writing.
157 */ 157 */
158 class IColladaMeshWriterNames : public virtual IReferenceCounted 158 class IColladaMeshWriterNames : public virtual IReferenceCounted
159 { 159 {
160 public: 160 public:
161 161
162 virtual ~IColladaMeshWriterNames () {} 162 virtual ~IColladaMeshWriterNames () {}
163 163
164 //! Return a unique name for the given mesh 164 //! Return a unique name for the given mesh
165 /** Note that names really must be unique here per mesh-pointer, so 165 /** Note that names really must be unique here per mesh-pointer, so
166 mostly it's a good idea to return the nameForMesh from 166 mostly it's a good idea to return the nameForMesh from
167 IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow 167 IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow
168 the xs::NCName standard to be valid, you can run them through 168 the xs::NCName standard to be valid, you can run them through
169 IColladaMeshWriter::toNCName to ensure that. 169 IColladaMeshWriter::toNCName to ensure that.
170 \param mesh Pointer to the mesh which needs a name 170 \param mesh Pointer to the mesh which needs a name
171 \param instance When E_COLLADA_GEOMETRY_WRITING is not ECGI_PER_MESH then 171 \param instance When E_COLLADA_GEOMETRY_WRITING is not ECGI_PER_MESH then
172 several instances of the same mesh can be written and this counts them. 172 several instances of the same mesh can be written and this counts them.
173 */ 173 */
174 virtual irr::core::stringw nameForMesh(const scene::IMesh* mesh, int instance) = 0; 174 virtual irr::core::stringw nameForMesh(const scene::IMesh* mesh, int instance) = 0;
175 175
176 //! Return a unique name for the given node 176 //! Return a unique name for the given node
177 /** Note that names really must be unique here per node-pointer, so 177 /** Note that names really must be unique here per node-pointer, so
178 mostly it's a good idea to return the nameForNode from 178 mostly it's a good idea to return the nameForNode from
179 IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow 179 IColladaMeshWriter::getDefaultNameGenerator(). Also names must follow
180 the xs::NCName standard to be valid, you can run them through 180 the xs::NCName standard to be valid, you can run them through
181 IColladaMeshWriter::toNCName to ensure that. 181 IColladaMeshWriter::toNCName to ensure that.
182 */ 182 */
183 virtual irr::core::stringw nameForNode(const scene::ISceneNode* node) = 0; 183 virtual irr::core::stringw nameForNode(const scene::ISceneNode* node) = 0;
184 184
185 //! Return a name for the material 185 //! Return a name for the material
186 /** There is one material created in the writer for each unique name. 186 /** There is one material created in the writer for each unique name.
187 So you can use this to control the number of materials which get written. 187 So you can use this to control the number of materials which get written.
188 For example Irrlicht does by default write one material for each material 188 For example Irrlicht does by default write one material for each material
189 instanced by a node. So if you know that in your application material 189 instanced by a node. So if you know that in your application material
190 instances per node are identical between different nodes you can reduce 190 instances per node are identical between different nodes you can reduce
191 the number of exported materials using that knowledge by using identical 191 the number of exported materials using that knowledge by using identical
192 names for such shared materials. 192 names for such shared materials.
193 Names must follow the xs::NCName standard to be valid, you can run them 193 Names must follow the xs::NCName standard to be valid, you can run them
194 through IColladaMeshWriter::toNCName to ensure that. 194 through IColladaMeshWriter::toNCName to ensure that.
195 */ 195 */
196 virtual irr::core::stringw nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node) = 0; 196 virtual irr::core::stringw nameForMaterial(const video::SMaterial & material, int materialId, const scene::IMesh* mesh, const scene::ISceneNode* node) = 0;
197 }; 197 };
198 198
199 199
200 //! Interface for writing meshes 200 //! Interface for writing meshes
201 class IColladaMeshWriter : public IMeshWriter 201 class IColladaMeshWriter : public IMeshWriter
202 { 202 {
203 public: 203 public:
204 204
205 IColladaMeshWriter() 205 IColladaMeshWriter()
206 : Properties(0), DefaultProperties(0), NameGenerator(0), DefaultNameGenerator(0) 206 : Properties(0), DefaultProperties(0), NameGenerator(0), DefaultNameGenerator(0)
207 , WriteTextures(true), WriteDefaultScene(true), ExportSMaterialOnce(true) 207 , WriteTextures(true), WriteDefaultScene(true), ExportSMaterialOnce(true)
208 , AmbientLight(0.f, 0.f, 0.f, 1.f) 208 , AmbientLight(0.f, 0.f, 0.f, 1.f)
209 { 209 {
210 } 210 }
211 211
212 //! Destructor 212 //! Destructor
213 virtual ~IColladaMeshWriter() 213 virtual ~IColladaMeshWriter()
214 { 214 {
215 if ( Properties ) 215 if ( Properties )
216 Properties->drop(); 216 Properties->drop();
217 if ( DefaultProperties ) 217 if ( DefaultProperties )
218 DefaultProperties->drop(); 218 DefaultProperties->drop();
219 if ( NameGenerator ) 219 if ( NameGenerator )
220 NameGenerator->drop(); 220 NameGenerator->drop();
221 if ( DefaultNameGenerator ) 221 if ( DefaultNameGenerator )
222 DefaultNameGenerator->drop(); 222 DefaultNameGenerator->drop();
223 } 223 }
224 224
225 //! writes a scene starting with the given node 225 //! writes a scene starting with the given node
226 virtual bool writeScene(io::IWriteFile* file, scene::ISceneNode* root) = 0; 226 virtual bool writeScene(io::IWriteFile* file, scene::ISceneNode* root) = 0;
227 227
228 228
229 //! Set if texture information should be written 229 //! Set if texture information should be written
230 virtual void setWriteTextures(bool write) 230 virtual void setWriteTextures(bool write)
231 { 231 {
232 WriteTextures = write; 232 WriteTextures = write;
233 } 233 }
234 234
235 //! Get if texture information should be written 235 //! Get if texture information should be written
236 virtual bool getWriteTextures() const 236 virtual bool getWriteTextures() const
237 { 237 {
238 return WriteTextures; 238 return WriteTextures;
239 } 239 }
240 240
241 //! Set if a default scene should be written when writing meshes. 241 //! Set if a default scene should be written when writing meshes.
242 /** Many collada readers fail to read a mesh if the collada files doesn't contain a scene as well. 242 /** Many collada readers fail to read a mesh if the collada files doesn't contain a scene as well.
243 The scene is doing an instantiation of the mesh. 243 The scene is doing an instantiation of the mesh.
244 When using writeScene this flag is ignored (as we have scene there already) 244 When using writeScene this flag is ignored (as we have scene there already)
245 */ 245 */
246 virtual void setWriteDefaultScene(bool write) 246 virtual void setWriteDefaultScene(bool write)
247 { 247 {
248 WriteDefaultScene = write; 248 WriteDefaultScene = write;
249 } 249 }
250 250
251 //! Get if a default scene should be written 251 //! Get if a default scene should be written
252 virtual bool getWriteDefaultScene() const 252 virtual bool getWriteDefaultScene() const
253 { 253 {
254 return WriteDefaultScene; 254 return WriteDefaultScene;
255 } 255 }
256 256
257 //! Sets ambient color of the scene to write 257 //! Sets ambient color of the scene to write
258 virtual void setAmbientLight(const video::SColorf &ambientColor) 258 virtual void setAmbientLight(const video::SColorf &ambientColor)
259 { 259 {
260 AmbientLight = ambientColor; 260 AmbientLight = ambientColor;
261 } 261 }
262 262
263 //! Return ambient light of the scene which is written 263 //! Return ambient light of the scene which is written
264 virtual video::SColorf getAmbientLight() const 264 virtual video::SColorf getAmbientLight() const
265 { 265 {
266 return AmbientLight; 266 return AmbientLight;
267 } 267 }
268 268
269 //! Control when and how often a mesh is written 269 //! Control when and how often a mesh is written
270 /** Optimally ECGI_PER_MESH would be always sufficent - writing geometry once per mesh. 270 /** Optimally ECGI_PER_MESH would be always sufficent - writing geometry once per mesh.
271 Unfortunately many tools (at the time of writing this nearly all of them) have trouble 271 Unfortunately many tools (at the time of writing this nearly all of them) have trouble
272 on import when different materials are used per node. So when you override materials 272 on import when different materials are used per node. So when you override materials
273 per node and importing the resuling collada has materials problems in other tools try 273 per node and importing the resuling collada has materials problems in other tools try
274 using other values here. 274 using other values here.
275 \param writeStyle One of the E_COLLADA_GEOMETRY_WRITING settings. 275 \param writeStyle One of the E_COLLADA_GEOMETRY_WRITING settings.
276 */ 276 */
277 virtual void setGeometryWriting(E_COLLADA_GEOMETRY_WRITING writeStyle) 277 virtual void setGeometryWriting(E_COLLADA_GEOMETRY_WRITING writeStyle)
278 { 278 {
279 GeometryWriting = writeStyle; 279 GeometryWriting = writeStyle;
280 } 280 }
281 281
282 //! Get the current style of geometry writing. 282 //! Get the current style of geometry writing.
283 virtual E_COLLADA_GEOMETRY_WRITING getGeometryWriting() const 283 virtual E_COLLADA_GEOMETRY_WRITING getGeometryWriting() const
284 { 284 {
285 return GeometryWriting; 285 return GeometryWriting;
286 } 286 }
287 287
288 //! Make certain there is only one collada material generated per Irrlicht material 288 //! Make certain there is only one collada material generated per Irrlicht material
289 /** Checks before creating a collada material-name if an identical 289 /** Checks before creating a collada material-name if an identical
290 irr:::video::SMaterial has been exported already. If so don't export it with 290 irr:::video::SMaterial has been exported already. If so don't export it with
291 another name. This is set by default and leads to way smaller .dae files. 291 another name. This is set by default and leads to way smaller .dae files.
292 Note that if you need to disable this flag for some reason you can still 292 Note that if you need to disable this flag for some reason you can still
293 get a similar effect using the IColladaMeshWriterNames::nameForMaterial 293 get a similar effect using the IColladaMeshWriterNames::nameForMaterial
294 by returning identical names for identical materials there. 294 by returning identical names for identical materials there.
295 */ 295 */
296 virtual void setExportSMaterialsOnlyOnce(bool exportOnce) 296 virtual void setExportSMaterialsOnlyOnce(bool exportOnce)
297 { 297 {
298 ExportSMaterialOnce = exportOnce; 298 ExportSMaterialOnce = exportOnce;
299 } 299 }
300 300
301 virtual bool getExportSMaterialsOnlyOnce() const 301 virtual bool getExportSMaterialsOnlyOnce() const
302 { 302 {
303 return ExportSMaterialOnce; 303 return ExportSMaterialOnce;
304 } 304 }
305 305
306 //! Set properties to use by the meshwriter instead of it's default properties. 306 //! Set properties to use by the meshwriter instead of it's default properties.
307 /** Overloading properties with an own class allows modifying the writing process in certain ways. 307 /** Overloading properties with an own class allows modifying the writing process in certain ways.
308 By default properties are set to the DefaultProperties. */ 308 By default properties are set to the DefaultProperties. */
309 virtual void setProperties(IColladaMeshWriterProperties * p) 309 virtual void setProperties(IColladaMeshWriterProperties * p)
310 { 310 {
311 if ( p == Properties ) 311 if ( p == Properties )
312 return; 312 return;
313 if ( p ) 313 if ( p )
314 p->grab(); 314 p->grab();
315 if ( Properties ) 315 if ( Properties )
316 Properties->drop(); 316 Properties->drop();
317 Properties = p; 317 Properties = p;
318 } 318 }
319 319
320 //! Get properties which are currently used. 320 //! Get properties which are currently used.
321 virtual IColladaMeshWriterProperties * getProperties() const 321 virtual IColladaMeshWriterProperties * getProperties() const
322 { 322 {
323 return Properties; 323 return Properties;
324 } 324 }
325 325
326 //! Return the original default properties of the writer. 326 //! Return the original default properties of the writer.
327 /** You can use this pointer in your own properties to access and return default values. */ 327 /** You can use this pointer in your own properties to access and return default values. */
328 IColladaMeshWriterProperties * getDefaultProperties() const 328 IColladaMeshWriterProperties * getDefaultProperties() const
329 { 329 {
330 return DefaultProperties; 330 return DefaultProperties;
331 } 331 }
332 332
333 //! Install a generator to create custom names on export. 333 //! Install a generator to create custom names on export.
334 virtual void setNameGenerator(IColladaMeshWriterNames * nameGenerator) 334 virtual void setNameGenerator(IColladaMeshWriterNames * nameGenerator)
335 { 335 {
336 if ( nameGenerator == NameGenerator ) 336 if ( nameGenerator == NameGenerator )
337 return; 337 return;
338 if ( nameGenerator ) 338 if ( nameGenerator )
339 nameGenerator->grab(); 339 nameGenerator->grab();
340 if ( NameGenerator ) 340 if ( NameGenerator )
341 NameGenerator->drop(); 341 NameGenerator->drop();
342 NameGenerator = nameGenerator; 342 NameGenerator = nameGenerator;
343 } 343 }
344 344
345 //! Get currently used name generator 345 //! Get currently used name generator
346 virtual IColladaMeshWriterNames * getNameGenerator() const 346 virtual IColladaMeshWriterNames * getNameGenerator() const
347 { 347 {
348 return NameGenerator; 348 return NameGenerator;
349 } 349 }
350 350
351 //! Return the original default name generator of the writer. 351 //! Return the original default name generator of the writer.
352 /** You can use this pointer in your own generator to access and return default values. */ 352 /** You can use this pointer in your own generator to access and return default values. */
353 IColladaMeshWriterNames * getDefaultNameGenerator() const 353 IColladaMeshWriterNames * getDefaultNameGenerator() const
354 { 354 {
355 return DefaultNameGenerator; 355 return DefaultNameGenerator;
356 } 356 }
357 357
358 //! Restrict the characters of oldString a set of allowed characters in xs::NCName and add the prefix. 358 //! Restrict the characters of oldString a set of allowed characters in xs::NCName and add the prefix.
359 /** A tool function to help when using a custom name generator to generative valid names for collada names and id's. */ 359 /** A tool function to help when using a custom name generator to generative valid names for collada names and id's. */
360 virtual irr::core::stringw toNCName(const irr::core::stringw& oldString, const irr::core::stringw& prefix=irr::core::stringw(L"_NC_")) const = 0; 360 virtual irr::core::stringw toNCName(const irr::core::stringw& oldString, const irr::core::stringw& prefix=irr::core::stringw(L"_NC_")) const = 0;
361 361
362 362
363 protected: 363 protected:
364 // NOTE: You usually should also call setProperties with the same paraemter when using setDefaultProperties 364 // NOTE: You usually should also call setProperties with the same paraemter when using setDefaultProperties
365 virtual void setDefaultProperties(IColladaMeshWriterProperties * p) 365 virtual void setDefaultProperties(IColladaMeshWriterProperties * p)
366 { 366 {
367 if ( p == DefaultProperties ) 367 if ( p == DefaultProperties )
368 return; 368 return;
369 if ( p ) 369 if ( p )
370 p->grab(); 370 p->grab();
371 if ( DefaultProperties ) 371 if ( DefaultProperties )
372 DefaultProperties->drop(); 372 DefaultProperties->drop();
373 DefaultProperties = p; 373 DefaultProperties = p;
374 } 374 }
375 375
376 // NOTE: You usually should also call setNameGenerator with the same paraemter when using setDefaultProperties 376 // NOTE: You usually should also call setNameGenerator with the same paraemter when using setDefaultProperties
377 virtual void setDefaultNameGenerator(IColladaMeshWriterNames * p) 377 virtual void setDefaultNameGenerator(IColladaMeshWriterNames * p)
378 { 378 {
379 if ( p == DefaultNameGenerator ) 379 if ( p == DefaultNameGenerator )
380 return; 380 return;
381 if ( p ) 381 if ( p )
382 p->grab(); 382 p->grab();
383 if ( DefaultNameGenerator ) 383 if ( DefaultNameGenerator )
384 DefaultNameGenerator->drop(); 384 DefaultNameGenerator->drop();
385 DefaultNameGenerator = p; 385 DefaultNameGenerator = p;
386 } 386 }
387 387
388 private: 388 private:
389 IColladaMeshWriterProperties * Properties; 389 IColladaMeshWriterProperties * Properties;
390 IColladaMeshWriterProperties * DefaultProperties; 390 IColladaMeshWriterProperties * DefaultProperties;
391 IColladaMeshWriterNames * NameGenerator; 391 IColladaMeshWriterNames * NameGenerator;
392 IColladaMeshWriterNames * DefaultNameGenerator; 392 IColladaMeshWriterNames * DefaultNameGenerator;
393 bool WriteTextures; 393 bool WriteTextures;
394 bool WriteDefaultScene; 394 bool WriteDefaultScene;
395 bool ExportSMaterialOnce; 395 bool ExportSMaterialOnce;
396 video::SColorf AmbientLight; 396 video::SColorf AmbientLight;
397 E_COLLADA_GEOMETRY_WRITING GeometryWriting; 397 E_COLLADA_GEOMETRY_WRITING GeometryWriting;
398 }; 398 };
399 399
400 400
401} // end namespace 401} // end namespace
402} // end namespace 402} // end namespace
403 403
404#endif 404#endif
diff --git a/libraries/irrlicht-1.8/include/ICursorControl.h b/libraries/irrlicht-1.8/include/ICursorControl.h
index 83c6245..c52f81f 100644
--- a/libraries/irrlicht-1.8/include/ICursorControl.h
+++ b/libraries/irrlicht-1.8/include/ICursorControl.h
@@ -1,192 +1,192 @@
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#ifndef __I_CURSOR_CONTROL_H_INCLUDED__ 5#ifndef __I_CURSOR_CONTROL_H_INCLUDED__
6#define __I_CURSOR_CONTROL_H_INCLUDED__ 6#define __I_CURSOR_CONTROL_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "position2d.h" 9#include "position2d.h"
10#include "rect.h" 10#include "rect.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace gui 14namespace gui
15{ 15{
16 16
17 class IGUISpriteBank; 17 class IGUISpriteBank;
18 18
19 //! Default icons for cursors 19 //! Default icons for cursors
20 enum ECURSOR_ICON 20 enum ECURSOR_ICON
21 { 21 {
22 // Following cursors might be system specific, or might use an Irrlicht icon-set. No guarantees so far. 22 // Following cursors might be system specific, or might use an Irrlicht icon-set. No guarantees so far.
23 ECI_NORMAL, // arrow 23 ECI_NORMAL, // arrow
24 ECI_CROSS, // Crosshair 24 ECI_CROSS, // Crosshair
25 ECI_HAND, // Hand 25 ECI_HAND, // Hand
26 ECI_HELP, // Arrow and question mark 26 ECI_HELP, // Arrow and question mark
27 ECI_IBEAM, // typical text-selection cursor 27 ECI_IBEAM, // typical text-selection cursor
28 ECI_NO, // should not click icon 28 ECI_NO, // should not click icon
29 ECI_WAIT, // hourclass 29 ECI_WAIT, // hourclass
30 ECI_SIZEALL, // arrow in all directions 30 ECI_SIZEALL, // arrow in all directions
31 ECI_SIZENESW, // resizes in direction north-east or south-west 31 ECI_SIZENESW, // resizes in direction north-east or south-west
32 ECI_SIZENWSE, // resizes in direction north-west or south-east 32 ECI_SIZENWSE, // resizes in direction north-west or south-east
33 ECI_SIZENS, // resizes in direction north or south 33 ECI_SIZENS, // resizes in direction north or south
34 ECI_SIZEWE, // resizes in direction west or east 34 ECI_SIZEWE, // resizes in direction west or east
35 ECI_UP, // up-arrow 35 ECI_UP, // up-arrow
36 36
37 // Implementer note: Should we add system specific cursors, which use guaranteed the system icons, 37 // Implementer note: Should we add system specific cursors, which use guaranteed the system icons,
38 // then I would recommend using a naming scheme like ECI_W32_CROSS, ECI_X11_CROSSHAIR and adding those 38 // then I would recommend using a naming scheme like ECI_W32_CROSS, ECI_X11_CROSSHAIR and adding those
39 // additionally. 39 // additionally.
40 40
41 ECI_COUNT // maximal of defined cursors. Note that higher values can be created at runtime 41 ECI_COUNT // maximal of defined cursors. Note that higher values can be created at runtime
42 }; 42 };
43 43
44 //! Names for ECURSOR_ICON 44 //! Names for ECURSOR_ICON
45 const c8* const GUICursorIconNames[ECI_COUNT+1] = 45 const c8* const GUICursorIconNames[ECI_COUNT+1] =
46 { 46 {
47 "normal", 47 "normal",
48 "cross", 48 "cross",
49 "hand", 49 "hand",
50 "help", 50 "help",
51 "ibeam", 51 "ibeam",
52 "no", 52 "no",
53 "wait", 53 "wait",
54 "sizeall", 54 "sizeall",
55 "sizenesw", 55 "sizenesw",
56 "sizenwse", 56 "sizenwse",
57 "sizens", 57 "sizens",
58 "sizewe", 58 "sizewe",
59 "sizeup", 59 "sizeup",
60 0 60 0
61 }; 61 };
62 62
63 //! structure used to set sprites as cursors. 63 //! structure used to set sprites as cursors.
64 struct SCursorSprite 64 struct SCursorSprite
65 { 65 {
66 SCursorSprite() 66 SCursorSprite()
67 : SpriteBank(0), SpriteId(-1) 67 : SpriteBank(0), SpriteId(-1)
68 { 68 {
69 } 69 }
70 70
71 SCursorSprite( gui::IGUISpriteBank * spriteBank, s32 spriteId, const core::position2d<s32> &hotspot=core::position2d<s32>(0,0) ) 71 SCursorSprite( gui::IGUISpriteBank * spriteBank, s32 spriteId, const core::position2d<s32> &hotspot=core::position2d<s32>(0,0) )
72 : SpriteBank(spriteBank), SpriteId(spriteId), HotSpot(hotspot) 72 : SpriteBank(spriteBank), SpriteId(spriteId), HotSpot(hotspot)
73 { 73 {
74 } 74 }
75 75
76 gui::IGUISpriteBank * SpriteBank; 76 gui::IGUISpriteBank * SpriteBank;
77 s32 SpriteId; 77 s32 SpriteId;
78 core::position2d<s32> HotSpot; 78 core::position2d<s32> HotSpot;
79 }; 79 };
80 80
81 //! platform specific behavior flags for the cursor 81 //! platform specific behavior flags for the cursor
82 enum ECURSOR_PLATFORM_BEHAVIOR 82 enum ECURSOR_PLATFORM_BEHAVIOR
83 { 83 {
84 //! default - no platform specific behavior 84 //! default - no platform specific behavior
85 ECPB_NONE = 0, 85 ECPB_NONE = 0,
86 86
87 //! On X11 try caching cursor updates as XQueryPointer calls can be expensive. 87 //! On X11 try caching cursor updates as XQueryPointer calls can be expensive.
88 /** Update cursor positions only when the irrlicht timer has been updated or the timer is stopped. 88 /** Update cursor positions only when the irrlicht timer has been updated or the timer is stopped.
89 This means you usually get one cursor update per device->run() which will be fine in most cases. 89 This means you usually get one cursor update per device->run() which will be fine in most cases.
90 See this forum-thread for a more detailed explanation: 90 See this forum-thread for a more detailed explanation:
91 http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=45525 91 http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=45525
92 */ 92 */
93 ECPB_X11_CACHE_UPDATES = 1 93 ECPB_X11_CACHE_UPDATES = 1
94 }; 94 };
95 95
96 //! Interface to manipulate the mouse cursor. 96 //! Interface to manipulate the mouse cursor.
97 class ICursorControl : public virtual IReferenceCounted 97 class ICursorControl : public virtual IReferenceCounted
98 { 98 {
99 public: 99 public:
100 100
101 //! Changes the visible state of the mouse cursor. 101 //! Changes the visible state of the mouse cursor.
102 /** \param visible: The new visible state. If true, the cursor will be visible, 102 /** \param visible: The new visible state. If true, the cursor will be visible,
103 if false, it will be invisible. */ 103 if false, it will be invisible. */
104 virtual void setVisible(bool visible) = 0; 104 virtual void setVisible(bool visible) = 0;
105 105
106 //! Returns if the cursor is currently visible. 106 //! Returns if the cursor is currently visible.
107 /** \return True if the cursor is visible, false if not. */ 107 /** \return True if the cursor is visible, false if not. */
108 virtual bool isVisible() const = 0; 108 virtual bool isVisible() const = 0;
109 109
110 //! Sets the new position of the cursor. 110 //! Sets the new position of the cursor.
111 /** The position must be 111 /** The position must be
112 between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is 112 between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
113 the top left corner and (1.0f, 1.0f) is the bottom right corner of the 113 the top left corner and (1.0f, 1.0f) is the bottom right corner of the
114 render window. 114 render window.
115 \param pos New position of the cursor. */ 115 \param pos New position of the cursor. */
116 virtual void setPosition(const core::position2d<f32> &pos) = 0; 116 virtual void setPosition(const core::position2d<f32> &pos) = 0;
117 117
118 //! Sets the new position of the cursor. 118 //! Sets the new position of the cursor.
119 /** The position must be 119 /** The position must be
120 between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is 120 between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
121 the top left corner and (1.0f, 1.0f) is the bottom right corner of the 121 the top left corner and (1.0f, 1.0f) is the bottom right corner of the
122 render window. 122 render window.
123 \param x New x-coord of the cursor. 123 \param x New x-coord of the cursor.
124 \param y New x-coord of the cursor. */ 124 \param y New x-coord of the cursor. */
125 virtual void setPosition(f32 x, f32 y) = 0; 125 virtual void setPosition(f32 x, f32 y) = 0;
126 126
127 //! Sets the new position of the cursor. 127 //! Sets the new position of the cursor.
128 /** \param pos: New position of the cursor. The coordinates are pixel units. */ 128 /** \param pos: New position of the cursor. The coordinates are pixel units. */
129 virtual void setPosition(const core::position2d<s32> &pos) = 0; 129 virtual void setPosition(const core::position2d<s32> &pos) = 0;
130 130
131 //! Sets the new position of the cursor. 131 //! Sets the new position of the cursor.
132 /** \param x New x-coord of the cursor. The coordinates are pixel units. 132 /** \param x New x-coord of the cursor. The coordinates are pixel units.
133 \param y New y-coord of the cursor. The coordinates are pixel units. */ 133 \param y New y-coord of the cursor. The coordinates are pixel units. */
134 virtual void setPosition(s32 x, s32 y) = 0; 134 virtual void setPosition(s32 x, s32 y) = 0;
135 135
136 //! Returns the current position of the mouse cursor. 136 //! Returns the current position of the mouse cursor.
137 /** \return Returns the current position of the cursor. The returned position 137 /** \return Returns the current position of the cursor. The returned position
138 is the position of the mouse cursor in pixel units. */ 138 is the position of the mouse cursor in pixel units. */
139 virtual const core::position2d<s32>& getPosition() = 0; 139 virtual const core::position2d<s32>& getPosition() = 0;
140 140
141 //! Returns the current position of the mouse cursor. 141 //! Returns the current position of the mouse cursor.
142 /** \return Returns the current position of the cursor. The returned position 142 /** \return Returns the current position of the cursor. The returned position
143 is a value between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is 143 is a value between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
144 the top left corner and (1.0f, 1.0f) is the bottom right corner of the 144 the top left corner and (1.0f, 1.0f) is the bottom right corner of the
145 render window. */ 145 render window. */
146 virtual core::position2d<f32> getRelativePosition() = 0; 146 virtual core::position2d<f32> getRelativePosition() = 0;
147 147
148 //! Sets an absolute reference rect for setting and retrieving the cursor position. 148 //! Sets an absolute reference rect for setting and retrieving the cursor position.
149 /** If this rect is set, the cursor position is not being calculated relative to 149 /** If this rect is set, the cursor position is not being calculated relative to
150 the rendering window but to this rect. You can set the rect pointer to 0 to disable 150 the rendering window but to this rect. You can set the rect pointer to 0 to disable
151 this feature again. This feature is useful when rendering into parts of foreign windows 151 this feature again. This feature is useful when rendering into parts of foreign windows
152 for example in an editor. 152 for example in an editor.
153 \param rect: A pointer to an reference rectangle or 0 to disable the reference rectangle.*/ 153 \param rect: A pointer to an reference rectangle or 0 to disable the reference rectangle.*/
154 virtual void setReferenceRect(core::rect<s32>* rect=0) = 0; 154 virtual void setReferenceRect(core::rect<s32>* rect=0) = 0;
155 155
156 156
157 //! Sets the active cursor icon 157 //! Sets the active cursor icon
158 /** Setting cursor icons is so far only supported on Win32 and Linux */ 158 /** Setting cursor icons is so far only supported on Win32 and Linux */
159 virtual void setActiveIcon(ECURSOR_ICON iconId) {} 159 virtual void setActiveIcon(ECURSOR_ICON iconId) {}
160 160
161 //! Gets the currently active icon 161 //! Gets the currently active icon
162 virtual ECURSOR_ICON getActiveIcon() const { return gui::ECI_NORMAL; } 162 virtual ECURSOR_ICON getActiveIcon() const { return gui::ECI_NORMAL; }
163 163
164 //! Add a custom sprite as cursor icon. 164 //! Add a custom sprite as cursor icon.
165 /** \return Identification for the icon */ 165 /** \return Identification for the icon */
166 virtual ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) { return gui::ECI_NORMAL; } 166 virtual ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) { return gui::ECI_NORMAL; }
167 167
168 //! replace a cursor icon. 168 //! replace a cursor icon.
169 /** Changing cursor icons is so far only supported on Win32 and Linux 169 /** Changing cursor icons is so far only supported on Win32 and Linux
170 Note that this only changes the icons within your application, system cursors outside your 170 Note that this only changes the icons within your application, system cursors outside your
171 application will not be affected. 171 application will not be affected.
172 */ 172 */
173 virtual void changeIcon(ECURSOR_ICON iconId, const gui::SCursorSprite& sprite) {} 173 virtual void changeIcon(ECURSOR_ICON iconId, const gui::SCursorSprite& sprite) {}
174 174
175 //! Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work. 175 //! Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work.
176 virtual core::dimension2di getSupportedIconSize() const { return core::dimension2di(0,0); } 176 virtual core::dimension2di getSupportedIconSize() const { return core::dimension2di(0,0); }
177 177
178 //! Set platform specific behavior flags. 178 //! Set platform specific behavior flags.
179 virtual void setPlatformBehavior(ECURSOR_PLATFORM_BEHAVIOR behavior) {} 179 virtual void setPlatformBehavior(ECURSOR_PLATFORM_BEHAVIOR behavior) {}
180 180
181 //! Return platform specific behavior. 181 //! Return platform specific behavior.
182 /** \return Behavior set by setPlatformBehavior or ECPB_NONE for platforms not implementing specific behaviors. 182 /** \return Behavior set by setPlatformBehavior or ECPB_NONE for platforms not implementing specific behaviors.
183 */ 183 */
184 virtual ECURSOR_PLATFORM_BEHAVIOR getPlatformBehavior() const { return ECPB_NONE; } 184 virtual ECURSOR_PLATFORM_BEHAVIOR getPlatformBehavior() const { return ECPB_NONE; }
185 }; 185 };
186 186
187 187
188} // end namespace gui 188} // end namespace gui
189} // end namespace irr 189} // end namespace irr
190 190
191#endif 191#endif
192 192
diff --git a/libraries/irrlicht-1.8/include/IDummyTransformationSceneNode.h b/libraries/irrlicht-1.8/include/IDummyTransformationSceneNode.h
index 60dfe20..d5e7f00 100644
--- a/libraries/irrlicht-1.8/include/IDummyTransformationSceneNode.h
+++ b/libraries/irrlicht-1.8/include/IDummyTransformationSceneNode.h
@@ -1,42 +1,42 @@
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#ifndef __I_DUMMY_TRANSFORMATION_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_DUMMY_TRANSFORMATION_SCENE_NODE_H_INCLUDED__
6#define __I_DUMMY_TRANSFORMATION_SCENE_NODE_H_INCLUDED__ 6#define __I_DUMMY_TRANSFORMATION_SCENE_NODE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! Dummy scene node for adding additional transformations to the scene graph. 15//! Dummy scene node for adding additional transformations to the scene graph.
16/** This scene node does not render itself, and does not respond to set/getPosition, 16/** This scene node does not render itself, and does not respond to set/getPosition,
17set/getRotation and set/getScale. Its just a simple scene node that takes a 17set/getRotation and set/getScale. Its just a simple scene node that takes a
18matrix as relative transformation, making it possible to insert any transformation 18matrix as relative transformation, making it possible to insert any transformation
19anywhere into the scene graph. 19anywhere into the scene graph.
20This scene node is for example used by the IAnimatedMeshSceneNode for emulating 20This scene node is for example used by the IAnimatedMeshSceneNode for emulating
21joint scene nodes when playing skeletal animations. 21joint scene nodes when playing skeletal animations.
22*/ 22*/
23class IDummyTransformationSceneNode : public ISceneNode 23class IDummyTransformationSceneNode : public ISceneNode
24{ 24{
25public: 25public:
26 26
27 //! Constructor 27 //! Constructor
28 IDummyTransformationSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id) 28 IDummyTransformationSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id)
29 : ISceneNode(parent, mgr, id) {} 29 : ISceneNode(parent, mgr, id) {}
30 30
31 //! Returns a reference to the current relative transformation matrix. 31 //! Returns a reference to the current relative transformation matrix.
32 /** This is the matrix, this scene node uses instead of scale, translation 32 /** This is the matrix, this scene node uses instead of scale, translation
33 and rotation. */ 33 and rotation. */
34 virtual core::matrix4& getRelativeTransformationMatrix() = 0; 34 virtual core::matrix4& getRelativeTransformationMatrix() = 0;
35}; 35};
36 36
37} // end namespace scene 37} // end namespace scene
38} // end namespace irr 38} // end namespace irr
39 39
40 40
41#endif 41#endif
42 42
diff --git a/libraries/irrlicht-1.8/include/IDynamicMeshBuffer.h b/libraries/irrlicht-1.8/include/IDynamicMeshBuffer.h
index 72f2036..24434df 100644
--- a/libraries/irrlicht-1.8/include/IDynamicMeshBuffer.h
+++ b/libraries/irrlicht-1.8/include/IDynamicMeshBuffer.h
@@ -1,211 +1,211 @@
1// Copyright (C) 2008-2012 Nikolaus Gebhardt 1// Copyright (C) 2008-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#ifndef __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__ 5#ifndef __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__
6#define __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__ 6#define __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__
7 7
8#include "IMeshBuffer.h" 8#include "IMeshBuffer.h"
9#include "IVertexBuffer.h" 9#include "IVertexBuffer.h"
10#include "IIndexBuffer.h" 10#include "IIndexBuffer.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace scene 14namespace scene
15{ 15{
16 16
17 /** a dynamic meshBuffer */ 17 /** a dynamic meshBuffer */
18 class IDynamicMeshBuffer : public IMeshBuffer 18 class IDynamicMeshBuffer : public IMeshBuffer
19 { 19 {
20 public: 20 public:
21 virtual IVertexBuffer &getVertexBuffer() const =0; 21 virtual IVertexBuffer &getVertexBuffer() const =0;
22 virtual IIndexBuffer &getIndexBuffer() const =0; 22 virtual IIndexBuffer &getIndexBuffer() const =0;
23 23
24 virtual void setVertexBuffer(IVertexBuffer *vertexBuffer) =0; 24 virtual void setVertexBuffer(IVertexBuffer *vertexBuffer) =0;
25 virtual void setIndexBuffer(IIndexBuffer *indexBuffer) =0; 25 virtual void setIndexBuffer(IIndexBuffer *indexBuffer) =0;
26 26
27 //! Get the material of this meshbuffer 27 //! Get the material of this meshbuffer
28 /** \return Material of this buffer. */ 28 /** \return Material of this buffer. */
29 virtual video::SMaterial& getMaterial() =0; 29 virtual video::SMaterial& getMaterial() =0;
30 30
31 //! Get the material of this meshbuffer 31 //! Get the material of this meshbuffer
32 /** \return Material of this buffer. */ 32 /** \return Material of this buffer. */
33 virtual const video::SMaterial& getMaterial() const =0; 33 virtual const video::SMaterial& getMaterial() const =0;
34 34
35 //! Get the axis aligned bounding box of this meshbuffer. 35 //! Get the axis aligned bounding box of this meshbuffer.
36 /** \return Axis aligned bounding box of this buffer. */ 36 /** \return Axis aligned bounding box of this buffer. */
37 virtual const core::aabbox3df& getBoundingBox() const =0; 37 virtual const core::aabbox3df& getBoundingBox() const =0;
38 38
39 //! Set axis aligned bounding box 39 //! Set axis aligned bounding box
40 /** \param box User defined axis aligned bounding box to use 40 /** \param box User defined axis aligned bounding box to use
41 for this buffer. */ 41 for this buffer. */
42 virtual void setBoundingBox(const core::aabbox3df& box) =0; 42 virtual void setBoundingBox(const core::aabbox3df& box) =0;
43 43
44 //! Recalculates the bounding box. Should be called if the mesh changed. 44 //! Recalculates the bounding box. Should be called if the mesh changed.
45 virtual void recalculateBoundingBox() =0; 45 virtual void recalculateBoundingBox() =0;
46 46
47 //! Append the vertices and indices to the current buffer 47 //! Append the vertices and indices to the current buffer
48 /** Only works for compatible vertex types. 48 /** Only works for compatible vertex types.
49 \param vertices Pointer to a vertex array. 49 \param vertices Pointer to a vertex array.
50 \param numVertices Number of vertices in the array. 50 \param numVertices Number of vertices in the array.
51 \param indices Pointer to index array. 51 \param indices Pointer to index array.
52 \param numIndices Number of indices in array. */ 52 \param numIndices Number of indices in array. */
53 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) 53 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices)
54 { 54 {
55 55
56 } 56 }
57 57
58 //! Append the meshbuffer to the current buffer 58 //! Append the meshbuffer to the current buffer
59 /** Only works for compatible vertex types 59 /** Only works for compatible vertex types
60 \param other Buffer to append to this one. */ 60 \param other Buffer to append to this one. */
61 virtual void append(const IMeshBuffer* const other) 61 virtual void append(const IMeshBuffer* const other)
62 { 62 {
63 63
64 } 64 }
65 65
66 // ------------------- To be removed? ------------------- // 66 // ------------------- To be removed? ------------------- //
67 67
68 //! get the current hardware mapping hint 68 //! get the current hardware mapping hint
69 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const 69 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const
70 { 70 {
71 return getVertexBuffer().getHardwareMappingHint(); 71 return getVertexBuffer().getHardwareMappingHint();
72 } 72 }
73 73
74 //! get the current hardware mapping hint 74 //! get the current hardware mapping hint
75 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const 75 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const
76 { 76 {
77 return getIndexBuffer().getHardwareMappingHint(); 77 return getIndexBuffer().getHardwareMappingHint();
78 } 78 }
79 79
80 //! set the hardware mapping hint, for driver 80 //! set the hardware mapping hint, for driver
81 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) 81 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX )
82 { 82 {
83 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX) 83 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
84 getVertexBuffer().setHardwareMappingHint(NewMappingHint); 84 getVertexBuffer().setHardwareMappingHint(NewMappingHint);
85 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX) 85 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
86 getIndexBuffer().setHardwareMappingHint(NewMappingHint); 86 getIndexBuffer().setHardwareMappingHint(NewMappingHint);
87 } 87 }
88 88
89 //! flags the mesh as changed, reloads hardware buffers 89 //! flags the mesh as changed, reloads hardware buffers
90 virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) 90 virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
91 { 91 {
92 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX) 92 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
93 getVertexBuffer().setDirty(); 93 getVertexBuffer().setDirty();
94 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX) 94 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
95 getIndexBuffer().setDirty(); 95 getIndexBuffer().setDirty();
96 } 96 }
97 97
98 virtual u32 getChangedID_Vertex() const 98 virtual u32 getChangedID_Vertex() const
99 { 99 {
100 return getVertexBuffer().getChangedID(); 100 return getVertexBuffer().getChangedID();
101 } 101 }
102 102
103 virtual u32 getChangedID_Index() const 103 virtual u32 getChangedID_Index() const
104 { 104 {
105 return getIndexBuffer().getChangedID(); 105 return getIndexBuffer().getChangedID();
106 } 106 }
107 107
108 // ------------------- Old interface ------------------- // 108 // ------------------- Old interface ------------------- //
109 109
110 //! Get type of vertex data which is stored in this meshbuffer. 110 //! Get type of vertex data which is stored in this meshbuffer.
111 /** \return Vertex type of this buffer. */ 111 /** \return Vertex type of this buffer. */
112 virtual video::E_VERTEX_TYPE getVertexType() const 112 virtual video::E_VERTEX_TYPE getVertexType() const
113 { 113 {
114 return getVertexBuffer().getType(); 114 return getVertexBuffer().getType();
115 } 115 }
116 116
117 //! Get access to vertex data. The data is an array of vertices. 117 //! Get access to vertex data. The data is an array of vertices.
118 /** Which vertex type is used can be determined by getVertexType(). 118 /** Which vertex type is used can be determined by getVertexType().
119 \return Pointer to array of vertices. */ 119 \return Pointer to array of vertices. */
120 virtual const void* getVertices() const 120 virtual const void* getVertices() const
121 { 121 {
122 return getVertexBuffer().getData(); 122 return getVertexBuffer().getData();
123 } 123 }
124 124
125 //! Get access to vertex data. The data is an array of vertices. 125 //! Get access to vertex data. The data is an array of vertices.
126 /** Which vertex type is used can be determined by getVertexType(). 126 /** Which vertex type is used can be determined by getVertexType().
127 \return Pointer to array of vertices. */ 127 \return Pointer to array of vertices. */
128 virtual void* getVertices() 128 virtual void* getVertices()
129 { 129 {
130 return getVertexBuffer().getData(); 130 return getVertexBuffer().getData();
131 } 131 }
132 132
133 //! Get amount of vertices in meshbuffer. 133 //! Get amount of vertices in meshbuffer.
134 /** \return Number of vertices in this buffer. */ 134 /** \return Number of vertices in this buffer. */
135 virtual u32 getVertexCount() const 135 virtual u32 getVertexCount() const
136 { 136 {
137 return getVertexBuffer().size(); 137 return getVertexBuffer().size();
138 } 138 }
139 139
140 //! Get type of index data which is stored in this meshbuffer. 140 //! Get type of index data which is stored in this meshbuffer.
141 /** \return Index type of this buffer. */ 141 /** \return Index type of this buffer. */
142 virtual video::E_INDEX_TYPE getIndexType() const 142 virtual video::E_INDEX_TYPE getIndexType() const
143 { 143 {
144 return getIndexBuffer().getType(); 144 return getIndexBuffer().getType();
145 } 145 }
146 146
147 //! Get access to Indices. 147 //! Get access to Indices.
148 /** \return Pointer to indices array. */ 148 /** \return Pointer to indices array. */
149 virtual const u16* getIndices() const 149 virtual const u16* getIndices() const
150 { 150 {
151 return (u16*)getIndexBuffer().getData(); 151 return (u16*)getIndexBuffer().getData();
152 } 152 }
153 153
154 //! Get access to Indices. 154 //! Get access to Indices.
155 /** \return Pointer to indices array. */ 155 /** \return Pointer to indices array. */
156 virtual u16* getIndices() 156 virtual u16* getIndices()
157 { 157 {
158 return (u16*)getIndexBuffer().getData(); 158 return (u16*)getIndexBuffer().getData();
159 } 159 }
160 160
161 //! Get amount of indices in this meshbuffer. 161 //! Get amount of indices in this meshbuffer.
162 /** \return Number of indices in this buffer. */ 162 /** \return Number of indices in this buffer. */
163 virtual u32 getIndexCount() const 163 virtual u32 getIndexCount() const
164 { 164 {
165 return getIndexBuffer().size(); 165 return getIndexBuffer().size();
166 } 166 }
167 167
168 //! returns position of vertex i 168 //! returns position of vertex i
169 virtual const core::vector3df& getPosition(u32 i) const 169 virtual const core::vector3df& getPosition(u32 i) const
170 { 170 {
171 return getVertexBuffer()[i].Pos; 171 return getVertexBuffer()[i].Pos;
172 } 172 }
173 173
174 //! returns position of vertex i 174 //! returns position of vertex i
175 virtual core::vector3df& getPosition(u32 i) 175 virtual core::vector3df& getPosition(u32 i)
176 { 176 {
177 return getVertexBuffer()[i].Pos; 177 return getVertexBuffer()[i].Pos;
178 } 178 }
179 179
180 //! returns texture coords of vertex i 180 //! returns texture coords of vertex i
181 virtual const core::vector2df& getTCoords(u32 i) const 181 virtual const core::vector2df& getTCoords(u32 i) const
182 { 182 {
183 return getVertexBuffer()[i].TCoords; 183 return getVertexBuffer()[i].TCoords;
184 } 184 }
185 185
186 //! returns texture coords of vertex i 186 //! returns texture coords of vertex i
187 virtual core::vector2df& getTCoords(u32 i) 187 virtual core::vector2df& getTCoords(u32 i)
188 { 188 {
189 return getVertexBuffer()[i].TCoords; 189 return getVertexBuffer()[i].TCoords;
190 } 190 }
191 191
192 //! returns normal of vertex i 192 //! returns normal of vertex i
193 virtual const core::vector3df& getNormal(u32 i) const 193 virtual const core::vector3df& getNormal(u32 i) const
194 { 194 {
195 return getVertexBuffer()[i].Normal; 195 return getVertexBuffer()[i].Normal;
196 } 196 }
197 197
198 //! returns normal of vertex i 198 //! returns normal of vertex i
199 virtual core::vector3df& getNormal(u32 i) 199 virtual core::vector3df& getNormal(u32 i)
200 { 200 {
201 return getVertexBuffer()[i].Normal; 201 return getVertexBuffer()[i].Normal;
202 } 202 }
203 }; 203 };
204 204
205 205
206} // end namespace scene 206} // end namespace scene
207} // end namespace irr 207} // end namespace irr
208 208
209#endif 209#endif
210 210
211 211
diff --git a/libraries/irrlicht-1.8/include/IEventReceiver.h b/libraries/irrlicht-1.8/include/IEventReceiver.h
index 419ded7..9c7813f 100644
--- a/libraries/irrlicht-1.8/include/IEventReceiver.h
+++ b/libraries/irrlicht-1.8/include/IEventReceiver.h
@@ -1,490 +1,490 @@
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#ifndef __I_EVENT_RECEIVER_H_INCLUDED__ 5#ifndef __I_EVENT_RECEIVER_H_INCLUDED__
6#define __I_EVENT_RECEIVER_H_INCLUDED__ 6#define __I_EVENT_RECEIVER_H_INCLUDED__
7 7
8#include "ILogger.h" 8#include "ILogger.h"
9#include "Keycodes.h" 9#include "Keycodes.h"
10#include "irrString.h" 10#include "irrString.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14 //! Enumeration for all event types there are. 14 //! Enumeration for all event types there are.
15 enum EEVENT_TYPE 15 enum EEVENT_TYPE
16 { 16 {
17 //! An event of the graphical user interface. 17 //! An event of the graphical user interface.
18 /** GUI events are created by the GUI environment or the GUI elements in response 18 /** GUI events are created by the GUI environment or the GUI elements in response
19 to mouse or keyboard events. When a GUI element receives an event it will either 19 to mouse or keyboard events. When a GUI element receives an event it will either
20 process it and return true, or pass the event to its parent. If an event is not absorbed 20 process it and return true, or pass the event to its parent. If an event is not absorbed
21 before it reaches the root element then it will then be passed to the user receiver. */ 21 before it reaches the root element then it will then be passed to the user receiver. */
22 EET_GUI_EVENT = 0, 22 EET_GUI_EVENT = 0,
23 23
24 //! A mouse input event. 24 //! A mouse input event.
25 /** Mouse events are created by the device and passed to IrrlichtDevice::postEventFromUser 25 /** Mouse events are created by the device and passed to IrrlichtDevice::postEventFromUser
26 in response to mouse input received from the operating system. 26 in response to mouse input received from the operating system.
27 Mouse events are first passed to the user receiver, then to the GUI environment and its elements, 27 Mouse events are first passed to the user receiver, then to the GUI environment and its elements,
28 then finally the input receiving scene manager where it is passed to the active camera. 28 then finally the input receiving scene manager where it is passed to the active camera.
29 */ 29 */
30 EET_MOUSE_INPUT_EVENT, 30 EET_MOUSE_INPUT_EVENT,
31 31
32 //! A key input event. 32 //! A key input event.
33 /** Like mouse events, keyboard events are created by the device and passed to 33 /** Like mouse events, keyboard events are created by the device and passed to
34 IrrlichtDevice::postEventFromUser. They take the same path as mouse events. */ 34 IrrlichtDevice::postEventFromUser. They take the same path as mouse events. */
35 EET_KEY_INPUT_EVENT, 35 EET_KEY_INPUT_EVENT,
36 36
37 //! A joystick (joypad, gamepad) input event. 37 //! A joystick (joypad, gamepad) input event.
38 /** Joystick events are created by polling all connected joysticks once per 38 /** Joystick events are created by polling all connected joysticks once per
39 device run() and then passing the events to IrrlichtDevice::postEventFromUser. 39 device run() and then passing the events to IrrlichtDevice::postEventFromUser.
40 They take the same path as mouse events. 40 They take the same path as mouse events.
41 Windows, SDL: Implemented. 41 Windows, SDL: Implemented.
42 Linux: Implemented, with POV hat issues. 42 Linux: Implemented, with POV hat issues.
43 MacOS / Other: Not yet implemented. 43 MacOS / Other: Not yet implemented.
44 */ 44 */
45 EET_JOYSTICK_INPUT_EVENT, 45 EET_JOYSTICK_INPUT_EVENT,
46 46
47 //! A log event 47 //! A log event
48 /** Log events are only passed to the user receiver if there is one. If they are absorbed by the 48 /** Log events are only passed to the user receiver if there is one. If they are absorbed by the
49 user receiver then no text will be sent to the console. */ 49 user receiver then no text will be sent to the console. */
50 EET_LOG_TEXT_EVENT, 50 EET_LOG_TEXT_EVENT,
51 51
52 //! A user event with user data. 52 //! A user event with user data.
53 /** This is not used by Irrlicht and can be used to send user 53 /** This is not used by Irrlicht and can be used to send user
54 specific data though the system. The Irrlicht 'window handle' 54 specific data though the system. The Irrlicht 'window handle'
55 can be obtained from IrrlichtDevice::getExposedVideoData() 55 can be obtained from IrrlichtDevice::getExposedVideoData()
56 The usage and behavior depends on the operating system: 56 The usage and behavior depends on the operating system:
57 Windows: send a WM_USER message to the Irrlicht Window; the 57 Windows: send a WM_USER message to the Irrlicht Window; the
58 wParam and lParam will be used to populate the 58 wParam and lParam will be used to populate the
59 UserData1 and UserData2 members of the SUserEvent. 59 UserData1 and UserData2 members of the SUserEvent.
60 Linux: send a ClientMessage via XSendEvent to the Irrlicht 60 Linux: send a ClientMessage via XSendEvent to the Irrlicht
61 Window; the data.l[0] and data.l[1] members will be 61 Window; the data.l[0] and data.l[1] members will be
62 casted to s32 and used as UserData1 and UserData2. 62 casted to s32 and used as UserData1 and UserData2.
63 MacOS: Not yet implemented 63 MacOS: Not yet implemented
64 */ 64 */
65 EET_USER_EVENT, 65 EET_USER_EVENT,
66 66
67 //! This enum is never used, it only forces the compiler to 67 //! This enum is never used, it only forces the compiler to
68 //! compile these enumeration values to 32 bit. 68 //! compile these enumeration values to 32 bit.
69 EGUIET_FORCE_32_BIT = 0x7fffffff 69 EGUIET_FORCE_32_BIT = 0x7fffffff
70 70
71 }; 71 };
72 72
73 //! Enumeration for all mouse input events 73 //! Enumeration for all mouse input events
74 enum EMOUSE_INPUT_EVENT 74 enum EMOUSE_INPUT_EVENT
75 { 75 {
76 //! Left mouse button was pressed down. 76 //! Left mouse button was pressed down.
77 EMIE_LMOUSE_PRESSED_DOWN = 0, 77 EMIE_LMOUSE_PRESSED_DOWN = 0,
78 78
79 //! Right mouse button was pressed down. 79 //! Right mouse button was pressed down.
80 EMIE_RMOUSE_PRESSED_DOWN, 80 EMIE_RMOUSE_PRESSED_DOWN,
81 81
82 //! Middle mouse button was pressed down. 82 //! Middle mouse button was pressed down.
83 EMIE_MMOUSE_PRESSED_DOWN, 83 EMIE_MMOUSE_PRESSED_DOWN,
84 84
85 //! Left mouse button was left up. 85 //! Left mouse button was left up.
86 EMIE_LMOUSE_LEFT_UP, 86 EMIE_LMOUSE_LEFT_UP,
87 87
88 //! Right mouse button was left up. 88 //! Right mouse button was left up.
89 EMIE_RMOUSE_LEFT_UP, 89 EMIE_RMOUSE_LEFT_UP,
90 90
91 //! Middle mouse button was left up. 91 //! Middle mouse button was left up.
92 EMIE_MMOUSE_LEFT_UP, 92 EMIE_MMOUSE_LEFT_UP,
93 93
94 //! The mouse cursor changed its position. 94 //! The mouse cursor changed its position.
95 EMIE_MOUSE_MOVED, 95 EMIE_MOUSE_MOVED,
96 96
97 //! The mouse wheel was moved. Use Wheel value in event data to find out 97 //! The mouse wheel was moved. Use Wheel value in event data to find out
98 //! in what direction and how fast. 98 //! in what direction and how fast.
99 EMIE_MOUSE_WHEEL, 99 EMIE_MOUSE_WHEEL,
100 100
101 //! Left mouse button double click. 101 //! Left mouse button double click.
102 //! This event is generated after the second EMIE_LMOUSE_PRESSED_DOWN event. 102 //! This event is generated after the second EMIE_LMOUSE_PRESSED_DOWN event.
103 EMIE_LMOUSE_DOUBLE_CLICK, 103 EMIE_LMOUSE_DOUBLE_CLICK,
104 104
105 //! Right mouse button double click. 105 //! Right mouse button double click.
106 //! This event is generated after the second EMIE_RMOUSE_PRESSED_DOWN event. 106 //! This event is generated after the second EMIE_RMOUSE_PRESSED_DOWN event.
107 EMIE_RMOUSE_DOUBLE_CLICK, 107 EMIE_RMOUSE_DOUBLE_CLICK,
108 108
109 //! Middle mouse button double click. 109 //! Middle mouse button double click.
110 //! This event is generated after the second EMIE_MMOUSE_PRESSED_DOWN event. 110 //! This event is generated after the second EMIE_MMOUSE_PRESSED_DOWN event.
111 EMIE_MMOUSE_DOUBLE_CLICK, 111 EMIE_MMOUSE_DOUBLE_CLICK,
112 112
113 //! Left mouse button triple click. 113 //! Left mouse button triple click.
114 //! This event is generated after the third EMIE_LMOUSE_PRESSED_DOWN event. 114 //! This event is generated after the third EMIE_LMOUSE_PRESSED_DOWN event.
115 EMIE_LMOUSE_TRIPLE_CLICK, 115 EMIE_LMOUSE_TRIPLE_CLICK,
116 116
117 //! Right mouse button triple click. 117 //! Right mouse button triple click.
118 //! This event is generated after the third EMIE_RMOUSE_PRESSED_DOWN event. 118 //! This event is generated after the third EMIE_RMOUSE_PRESSED_DOWN event.
119 EMIE_RMOUSE_TRIPLE_CLICK, 119 EMIE_RMOUSE_TRIPLE_CLICK,
120 120
121 //! Middle mouse button triple click. 121 //! Middle mouse button triple click.
122 //! This event is generated after the third EMIE_MMOUSE_PRESSED_DOWN event. 122 //! This event is generated after the third EMIE_MMOUSE_PRESSED_DOWN event.
123 EMIE_MMOUSE_TRIPLE_CLICK, 123 EMIE_MMOUSE_TRIPLE_CLICK,
124 124
125 //! No real event. Just for convenience to get number of events 125 //! No real event. Just for convenience to get number of events
126 EMIE_COUNT 126 EMIE_COUNT
127 }; 127 };
128 128
129 //! Masks for mouse button states 129 //! Masks for mouse button states
130 enum E_MOUSE_BUTTON_STATE_MASK 130 enum E_MOUSE_BUTTON_STATE_MASK
131 { 131 {
132 EMBSM_LEFT = 0x01, 132 EMBSM_LEFT = 0x01,
133 EMBSM_RIGHT = 0x02, 133 EMBSM_RIGHT = 0x02,
134 EMBSM_MIDDLE = 0x04, 134 EMBSM_MIDDLE = 0x04,
135 135
136 //! currently only on windows 136 //! currently only on windows
137 EMBSM_EXTRA1 = 0x08, 137 EMBSM_EXTRA1 = 0x08,
138 138
139 //! currently only on windows 139 //! currently only on windows
140 EMBSM_EXTRA2 = 0x10, 140 EMBSM_EXTRA2 = 0x10,
141 141
142 EMBSM_FORCE_32_BIT = 0x7fffffff 142 EMBSM_FORCE_32_BIT = 0x7fffffff
143 }; 143 };
144 144
145 namespace gui 145 namespace gui
146 { 146 {
147 147
148 class IGUIElement; 148 class IGUIElement;
149 149
150 //! Enumeration for all events which are sendable by the gui system 150 //! Enumeration for all events which are sendable by the gui system
151 enum EGUI_EVENT_TYPE 151 enum EGUI_EVENT_TYPE
152 { 152 {
153 //! A gui element has lost its focus. 153 //! A gui element has lost its focus.
154 /** GUIEvent.Caller is losing the focus to GUIEvent.Element. 154 /** GUIEvent.Caller is losing the focus to GUIEvent.Element.
155 If the event is absorbed then the focus will not be changed. */ 155 If the event is absorbed then the focus will not be changed. */
156 EGET_ELEMENT_FOCUS_LOST = 0, 156 EGET_ELEMENT_FOCUS_LOST = 0,
157 157
158 //! A gui element has got the focus. 158 //! A gui element has got the focus.
159 /** If the event is absorbed then the focus will not be changed. */ 159 /** If the event is absorbed then the focus will not be changed. */
160 EGET_ELEMENT_FOCUSED, 160 EGET_ELEMENT_FOCUSED,
161 161
162 //! The mouse cursor hovered over a gui element. 162 //! The mouse cursor hovered over a gui element.
163 /** If an element has sub-elements you also get this message for the subelements */ 163 /** If an element has sub-elements you also get this message for the subelements */
164 EGET_ELEMENT_HOVERED, 164 EGET_ELEMENT_HOVERED,
165 165
166 //! The mouse cursor left the hovered element. 166 //! The mouse cursor left the hovered element.
167 /** If an element has sub-elements you also get this message for the subelements */ 167 /** If an element has sub-elements you also get this message for the subelements */
168 EGET_ELEMENT_LEFT, 168 EGET_ELEMENT_LEFT,
169 169
170 //! An element would like to close. 170 //! An element would like to close.
171 /** Windows and context menus use this event when they would like to close, 171 /** Windows and context menus use this event when they would like to close,
172 this can be cancelled by absorbing the event. */ 172 this can be cancelled by absorbing the event. */
173 EGET_ELEMENT_CLOSED, 173 EGET_ELEMENT_CLOSED,
174 174
175 //! A button was clicked. 175 //! A button was clicked.
176 EGET_BUTTON_CLICKED, 176 EGET_BUTTON_CLICKED,
177 177
178 //! A scrollbar has changed its position. 178 //! A scrollbar has changed its position.
179 EGET_SCROLL_BAR_CHANGED, 179 EGET_SCROLL_BAR_CHANGED,
180 180
181 //! A checkbox has changed its check state. 181 //! A checkbox has changed its check state.
182 EGET_CHECKBOX_CHANGED, 182 EGET_CHECKBOX_CHANGED,
183 183
184 //! A new item in a listbox was selected. 184 //! A new item in a listbox was selected.
185 /** NOTE: You also get this event currently when the same item was clicked again after more than 500 ms. */ 185 /** NOTE: You also get this event currently when the same item was clicked again after more than 500 ms. */
186 EGET_LISTBOX_CHANGED, 186 EGET_LISTBOX_CHANGED,
187 187
188 //! An item in the listbox was selected, which was already selected. 188 //! An item in the listbox was selected, which was already selected.
189 /** NOTE: You get the event currently only if the item was clicked again within 500 ms or selected by "enter" or "space". */ 189 /** NOTE: You get the event currently only if the item was clicked again within 500 ms or selected by "enter" or "space". */
190 EGET_LISTBOX_SELECTED_AGAIN, 190 EGET_LISTBOX_SELECTED_AGAIN,
191 191
192 //! A file has been selected in the file dialog 192 //! A file has been selected in the file dialog
193 EGET_FILE_SELECTED, 193 EGET_FILE_SELECTED,
194 194
195 //! A directory has been selected in the file dialog 195 //! A directory has been selected in the file dialog
196 EGET_DIRECTORY_SELECTED, 196 EGET_DIRECTORY_SELECTED,
197 197
198 //! A file open dialog has been closed without choosing a file 198 //! A file open dialog has been closed without choosing a file
199 EGET_FILE_CHOOSE_DIALOG_CANCELLED, 199 EGET_FILE_CHOOSE_DIALOG_CANCELLED,
200 200
201 //! 'Yes' was clicked on a messagebox 201 //! 'Yes' was clicked on a messagebox
202 EGET_MESSAGEBOX_YES, 202 EGET_MESSAGEBOX_YES,
203 203
204 //! 'No' was clicked on a messagebox 204 //! 'No' was clicked on a messagebox
205 EGET_MESSAGEBOX_NO, 205 EGET_MESSAGEBOX_NO,
206 206
207 //! 'OK' was clicked on a messagebox 207 //! 'OK' was clicked on a messagebox
208 EGET_MESSAGEBOX_OK, 208 EGET_MESSAGEBOX_OK,
209 209
210 //! 'Cancel' was clicked on a messagebox 210 //! 'Cancel' was clicked on a messagebox
211 EGET_MESSAGEBOX_CANCEL, 211 EGET_MESSAGEBOX_CANCEL,
212 212
213 //! In an editbox 'ENTER' was pressed 213 //! In an editbox 'ENTER' was pressed
214 EGET_EDITBOX_ENTER, 214 EGET_EDITBOX_ENTER,
215 215
216 //! The text in an editbox was changed. This does not include automatic changes in text-breaking. 216 //! The text in an editbox was changed. This does not include automatic changes in text-breaking.
217 EGET_EDITBOX_CHANGED, 217 EGET_EDITBOX_CHANGED,
218 218
219 //! The marked area in an editbox was changed. 219 //! The marked area in an editbox was changed.
220 EGET_EDITBOX_MARKING_CHANGED, 220 EGET_EDITBOX_MARKING_CHANGED,
221 221
222 //! The tab was changed in an tab control 222 //! The tab was changed in an tab control
223 EGET_TAB_CHANGED, 223 EGET_TAB_CHANGED,
224 224
225 //! A menu item was selected in a (context) menu 225 //! A menu item was selected in a (context) menu
226 EGET_MENU_ITEM_SELECTED, 226 EGET_MENU_ITEM_SELECTED,
227 227
228 //! The selection in a combo box has been changed 228 //! The selection in a combo box has been changed
229 EGET_COMBO_BOX_CHANGED, 229 EGET_COMBO_BOX_CHANGED,
230 230
231 //! The value of a spin box has changed 231 //! The value of a spin box has changed
232 EGET_SPINBOX_CHANGED, 232 EGET_SPINBOX_CHANGED,
233 233
234 //! A table has changed 234 //! A table has changed
235 EGET_TABLE_CHANGED, 235 EGET_TABLE_CHANGED,
236 EGET_TABLE_HEADER_CHANGED, 236 EGET_TABLE_HEADER_CHANGED,
237 EGET_TABLE_SELECTED_AGAIN, 237 EGET_TABLE_SELECTED_AGAIN,
238 238
239 //! A tree view node lost selection. See IGUITreeView::getLastEventNode(). 239 //! A tree view node lost selection. See IGUITreeView::getLastEventNode().
240 EGET_TREEVIEW_NODE_DESELECT, 240 EGET_TREEVIEW_NODE_DESELECT,
241 241
242 //! A tree view node was selected. See IGUITreeView::getLastEventNode(). 242 //! A tree view node was selected. See IGUITreeView::getLastEventNode().
243 EGET_TREEVIEW_NODE_SELECT, 243 EGET_TREEVIEW_NODE_SELECT,
244 244
245 //! A tree view node was expanded. See IGUITreeView::getLastEventNode(). 245 //! A tree view node was expanded. See IGUITreeView::getLastEventNode().
246 EGET_TREEVIEW_NODE_EXPAND, 246 EGET_TREEVIEW_NODE_EXPAND,
247 247
248 //! A tree view node was collapsed. See IGUITreeView::getLastEventNode(). 248 //! A tree view node was collapsed. See IGUITreeView::getLastEventNode().
249 EGET_TREEVIEW_NODE_COLLAPSE, 249 EGET_TREEVIEW_NODE_COLLAPSE,
250 250
251 //! deprecated - use EGET_TREEVIEW_NODE_COLLAPSE instead. This 251 //! deprecated - use EGET_TREEVIEW_NODE_COLLAPSE instead. This
252 //! may be removed by Irrlicht 1.9 252 //! may be removed by Irrlicht 1.9
253 EGET_TREEVIEW_NODE_COLLAPS = EGET_TREEVIEW_NODE_COLLAPSE, 253 EGET_TREEVIEW_NODE_COLLAPS = EGET_TREEVIEW_NODE_COLLAPSE,
254 254
255 //! No real event. Just for convenience to get number of events 255 //! No real event. Just for convenience to get number of events
256 EGET_COUNT 256 EGET_COUNT
257 }; 257 };
258 } // end namespace gui 258 } // end namespace gui
259 259
260 260
261//! SEvents hold information about an event. See irr::IEventReceiver for details on event handling. 261//! SEvents hold information about an event. See irr::IEventReceiver for details on event handling.
262struct SEvent 262struct SEvent
263{ 263{
264 //! Any kind of GUI event. 264 //! Any kind of GUI event.
265 struct SGUIEvent 265 struct SGUIEvent
266 { 266 {
267 //! IGUIElement who called the event 267 //! IGUIElement who called the event
268 gui::IGUIElement* Caller; 268 gui::IGUIElement* Caller;
269 269
270 //! If the event has something to do with another element, it will be held here. 270 //! If the event has something to do with another element, it will be held here.
271 gui::IGUIElement* Element; 271 gui::IGUIElement* Element;
272 272
273 //! Type of GUI Event 273 //! Type of GUI Event
274 gui::EGUI_EVENT_TYPE EventType; 274 gui::EGUI_EVENT_TYPE EventType;
275 275
276 }; 276 };
277 277
278 //! Any kind of mouse event. 278 //! Any kind of mouse event.
279 struct SMouseInput 279 struct SMouseInput
280 { 280 {
281 //! X position of mouse cursor 281 //! X position of mouse cursor
282 s32 X; 282 s32 X;
283 283
284 //! Y position of mouse cursor 284 //! Y position of mouse cursor
285 s32 Y; 285 s32 Y;
286 286
287 //! mouse wheel delta, often 1.0 or -1.0, but can have other values < 0.f or > 0.f; 287 //! mouse wheel delta, often 1.0 or -1.0, but can have other values < 0.f or > 0.f;
288 /** Only valid if event was EMIE_MOUSE_WHEEL */ 288 /** Only valid if event was EMIE_MOUSE_WHEEL */
289 f32 Wheel; 289 f32 Wheel;
290 290
291 //! True if shift was also pressed 291 //! True if shift was also pressed
292 bool Shift:1; 292 bool Shift:1;
293 293
294 //! True if ctrl was also pressed 294 //! True if ctrl was also pressed
295 bool Control:1; 295 bool Control:1;
296 296
297 //! A bitmap of button states. You can use isButtonPressed() to determine 297 //! A bitmap of button states. You can use isButtonPressed() to determine
298 //! if a button is pressed or not. 298 //! if a button is pressed or not.
299 //! Currently only valid if the event was EMIE_MOUSE_MOVED 299 //! Currently only valid if the event was EMIE_MOUSE_MOVED
300 u32 ButtonStates; 300 u32 ButtonStates;
301 301
302 //! Is the left button pressed down? 302 //! Is the left button pressed down?
303 bool isLeftPressed() const { return 0 != ( ButtonStates & EMBSM_LEFT ); } 303 bool isLeftPressed() const { return 0 != ( ButtonStates & EMBSM_LEFT ); }
304 304
305 //! Is the right button pressed down? 305 //! Is the right button pressed down?
306 bool isRightPressed() const { return 0 != ( ButtonStates & EMBSM_RIGHT ); } 306 bool isRightPressed() const { return 0 != ( ButtonStates & EMBSM_RIGHT ); }
307 307
308 //! Is the middle button pressed down? 308 //! Is the middle button pressed down?
309 bool isMiddlePressed() const { return 0 != ( ButtonStates & EMBSM_MIDDLE ); } 309 bool isMiddlePressed() const { return 0 != ( ButtonStates & EMBSM_MIDDLE ); }
310 310
311 //! Type of mouse event 311 //! Type of mouse event
312 EMOUSE_INPUT_EVENT Event; 312 EMOUSE_INPUT_EVENT Event;
313 }; 313 };
314 314
315 //! Any kind of keyboard event. 315 //! Any kind of keyboard event.
316 struct SKeyInput 316 struct SKeyInput
317 { 317 {
318 //! Character corresponding to the key (0, if not a character) 318 //! Character corresponding to the key (0, if not a character)
319 wchar_t Char; 319 wchar_t Char;
320 320
321 //! Key which has been pressed or released 321 //! Key which has been pressed or released
322 EKEY_CODE Key; 322 EKEY_CODE Key;
323 323
324 //! If not true, then the key was left up 324 //! If not true, then the key was left up
325 bool PressedDown:1; 325 bool PressedDown:1;
326 326
327 //! True if shift was also pressed 327 //! True if shift was also pressed
328 bool Shift:1; 328 bool Shift:1;
329 329
330 //! True if ctrl was also pressed 330 //! True if ctrl was also pressed
331 bool Control:1; 331 bool Control:1;
332 }; 332 };
333 333
334 //! A joystick event. 334 //! A joystick event.
335 /** Unlike other events, joystick events represent the result of polling 335 /** Unlike other events, joystick events represent the result of polling
336 * each connected joystick once per run() of the device. Joystick events will 336 * each connected joystick once per run() of the device. Joystick events will
337 * not be generated by default. If joystick support is available for the 337 * not be generated by default. If joystick support is available for the
338 * active device, _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ is defined, and 338 * active device, _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ is defined, and
339 * @ref irr::IrrlichtDevice::activateJoysticks() has been called, an event of 339 * @ref irr::IrrlichtDevice::activateJoysticks() has been called, an event of
340 * this type will be generated once per joystick per @ref IrrlichtDevice::run() 340 * this type will be generated once per joystick per @ref IrrlichtDevice::run()
341 * regardless of whether the state of the joystick has actually changed. */ 341 * regardless of whether the state of the joystick has actually changed. */
342 struct SJoystickEvent 342 struct SJoystickEvent
343 { 343 {
344 enum 344 enum
345 { 345 {
346 NUMBER_OF_BUTTONS = 32, 346 NUMBER_OF_BUTTONS = 32,
347 347
348 AXIS_X = 0, // e.g. analog stick 1 left to right 348 AXIS_X = 0, // e.g. analog stick 1 left to right
349 AXIS_Y, // e.g. analog stick 1 top to bottom 349 AXIS_Y, // e.g. analog stick 1 top to bottom
350 AXIS_Z, // e.g. throttle, or analog 2 stick 2 left to right 350 AXIS_Z, // e.g. throttle, or analog 2 stick 2 left to right
351 AXIS_R, // e.g. rudder, or analog 2 stick 2 top to bottom 351 AXIS_R, // e.g. rudder, or analog 2 stick 2 top to bottom
352 AXIS_U, 352 AXIS_U,
353 AXIS_V, 353 AXIS_V,
354 NUMBER_OF_AXES 354 NUMBER_OF_AXES
355 }; 355 };
356 356
357 /** A bitmap of button states. You can use IsButtonPressed() to 357 /** A bitmap of button states. You can use IsButtonPressed() to
358 ( check the state of each button from 0 to (NUMBER_OF_BUTTONS - 1) */ 358 ( check the state of each button from 0 to (NUMBER_OF_BUTTONS - 1) */
359 u32 ButtonStates; 359 u32 ButtonStates;
360 360
361 /** For AXIS_X, AXIS_Y, AXIS_Z, AXIS_R, AXIS_U and AXIS_V 361 /** For AXIS_X, AXIS_Y, AXIS_Z, AXIS_R, AXIS_U and AXIS_V
362 * Values are in the range -32768 to 32767, with 0 representing 362 * Values are in the range -32768 to 32767, with 0 representing
363 * the center position. You will receive the raw value from the 363 * the center position. You will receive the raw value from the
364 * joystick, and so will usually want to implement a dead zone around 364 * joystick, and so will usually want to implement a dead zone around
365 * the center of the range. Axes not supported by this joystick will 365 * the center of the range. Axes not supported by this joystick will
366 * always have a value of 0. On Linux, POV hats are represented as axes, 366 * always have a value of 0. On Linux, POV hats are represented as axes,
367 * usually the last two active axis. 367 * usually the last two active axis.
368 */ 368 */
369 s16 Axis[NUMBER_OF_AXES]; 369 s16 Axis[NUMBER_OF_AXES];
370 370
371 /** The POV represents the angle of the POV hat in degrees * 100, 371 /** The POV represents the angle of the POV hat in degrees * 100,
372 * from 0 to 35,900. A value of 65535 indicates that the POV hat 372 * from 0 to 35,900. A value of 65535 indicates that the POV hat
373 * is centered (or not present). 373 * is centered (or not present).
374 * This value is only supported on Windows. On Linux, the POV hat 374 * This value is only supported on Windows. On Linux, the POV hat
375 * will be sent as 2 axes instead. */ 375 * will be sent as 2 axes instead. */
376 u16 POV; 376 u16 POV;
377 377
378 //! The ID of the joystick which generated this event. 378 //! The ID of the joystick which generated this event.
379 /** This is an internal Irrlicht index; it does not map directly 379 /** This is an internal Irrlicht index; it does not map directly
380 * to any particular hardware joystick. */ 380 * to any particular hardware joystick. */
381 u8 Joystick; 381 u8 Joystick;
382 382
383 //! A helper function to check if a button is pressed. 383 //! A helper function to check if a button is pressed.
384 bool IsButtonPressed(u32 button) const 384 bool IsButtonPressed(u32 button) const
385 { 385 {
386 if(button >= (u32)NUMBER_OF_BUTTONS) 386 if(button >= (u32)NUMBER_OF_BUTTONS)
387 return false; 387 return false;
388 388
389 return (ButtonStates & (1 << button)) ? true : false; 389 return (ButtonStates & (1 << button)) ? true : false;
390 } 390 }
391 }; 391 };
392 392
393 393
394 //! Any kind of log event. 394 //! Any kind of log event.
395 struct SLogEvent 395 struct SLogEvent
396 { 396 {
397 //! Pointer to text which has been logged 397 //! Pointer to text which has been logged
398 const c8* Text; 398 const c8* Text;
399 399
400 //! Log level in which the text has been logged 400 //! Log level in which the text has been logged
401 ELOG_LEVEL Level; 401 ELOG_LEVEL Level;
402 }; 402 };
403 403
404 //! Any kind of user event. 404 //! Any kind of user event.
405 struct SUserEvent 405 struct SUserEvent
406 { 406 {
407 //! Some user specified data as int 407 //! Some user specified data as int
408 s32 UserData1; 408 s32 UserData1;
409 409
410 //! Another user specified data as int 410 //! Another user specified data as int
411 s32 UserData2; 411 s32 UserData2;
412 }; 412 };
413 413
414 EEVENT_TYPE EventType; 414 EEVENT_TYPE EventType;
415 union 415 union
416 { 416 {
417 struct SGUIEvent GUIEvent; 417 struct SGUIEvent GUIEvent;
418 struct SMouseInput MouseInput; 418 struct SMouseInput MouseInput;
419 struct SKeyInput KeyInput; 419 struct SKeyInput KeyInput;
420 struct SJoystickEvent JoystickEvent; 420 struct SJoystickEvent JoystickEvent;
421 struct SLogEvent LogEvent; 421 struct SLogEvent LogEvent;
422 struct SUserEvent UserEvent; 422 struct SUserEvent UserEvent;
423 }; 423 };
424 424
425}; 425};
426 426
427//! Interface of an object which can receive events. 427//! Interface of an object which can receive events.
428/** Many of the engine's classes inherit IEventReceiver so they are able to 428/** Many of the engine's classes inherit IEventReceiver so they are able to
429process events. Events usually start at a postEventFromUser function and are 429process events. Events usually start at a postEventFromUser function and are
430passed down through a chain of event receivers until OnEvent returns true. See 430passed down through a chain of event receivers until OnEvent returns true. See
431irr::EEVENT_TYPE for a description of where each type of event starts, and the 431irr::EEVENT_TYPE for a description of where each type of event starts, and the
432path it takes through the system. */ 432path it takes through the system. */
433class IEventReceiver 433class IEventReceiver
434{ 434{
435public: 435public:
436 436
437 //! Destructor 437 //! Destructor
438 virtual ~IEventReceiver() {} 438 virtual ~IEventReceiver() {}
439 439
440 //! Called if an event happened. 440 //! Called if an event happened.
441 /** Please take care that you should only return 'true' when you want to _prevent_ Irrlicht 441 /** Please take care that you should only return 'true' when you want to _prevent_ Irrlicht
442 * from processing the event any further. So 'true' does mean that an event is completely done. 442 * from processing the event any further. So 'true' does mean that an event is completely done.
443 * Therefore your return value for all unprocessed events should be 'false'. 443 * Therefore your return value for all unprocessed events should be 'false'.
444 \return True if the event was processed. 444 \return True if the event was processed.
445 */ 445 */
446 virtual bool OnEvent(const SEvent& event) = 0; 446 virtual bool OnEvent(const SEvent& event) = 0;
447}; 447};
448 448
449 449
450//! Information on a joystick, returned from @ref irr::IrrlichtDevice::activateJoysticks() 450//! Information on a joystick, returned from @ref irr::IrrlichtDevice::activateJoysticks()
451struct SJoystickInfo 451struct SJoystickInfo
452{ 452{
453 //! The ID of the joystick 453 //! The ID of the joystick
454 /** This is an internal Irrlicht index; it does not map directly 454 /** This is an internal Irrlicht index; it does not map directly
455 * to any particular hardware joystick. It corresponds to the 455 * to any particular hardware joystick. It corresponds to the
456 * irr::SJoystickEvent Joystick ID. */ 456 * irr::SJoystickEvent Joystick ID. */
457 u8 Joystick; 457 u8 Joystick;
458 458
459 //! The name that the joystick uses to identify itself. 459 //! The name that the joystick uses to identify itself.
460 core::stringc Name; 460 core::stringc Name;
461 461
462 //! The number of buttons that the joystick has. 462 //! The number of buttons that the joystick has.
463 u32 Buttons; 463 u32 Buttons;
464 464
465 //! The number of axes that the joystick has, i.e. X, Y, Z, R, U, V. 465 //! The number of axes that the joystick has, i.e. X, Y, Z, R, U, V.
466 /** Note: with a Linux device, the POV hat (if any) will use two axes. These 466 /** Note: with a Linux device, the POV hat (if any) will use two axes. These
467 * will be included in this count. */ 467 * will be included in this count. */
468 u32 Axes; 468 u32 Axes;
469 469
470 //! An indication of whether the joystick has a POV hat. 470 //! An indication of whether the joystick has a POV hat.
471 /** A Windows device will identify the presence or absence or the POV hat. A 471 /** A Windows device will identify the presence or absence or the POV hat. A
472 * Linux device cannot, and will always return POV_HAT_UNKNOWN. */ 472 * Linux device cannot, and will always return POV_HAT_UNKNOWN. */
473 enum 473 enum
474 { 474 {
475 //! A hat is definitely present. 475 //! A hat is definitely present.
476 POV_HAT_PRESENT, 476 POV_HAT_PRESENT,
477 477
478 //! A hat is definitely not present. 478 //! A hat is definitely not present.
479 POV_HAT_ABSENT, 479 POV_HAT_ABSENT,
480 480
481 //! The presence or absence of a hat cannot be determined. 481 //! The presence or absence of a hat cannot be determined.
482 POV_HAT_UNKNOWN 482 POV_HAT_UNKNOWN
483 } PovHat; 483 } PovHat;
484}; // struct SJoystickInfo 484}; // struct SJoystickInfo
485 485
486 486
487} // end namespace irr 487} // end namespace irr
488 488
489#endif 489#endif
490 490
diff --git a/libraries/irrlicht-1.8/include/IFileArchive.h b/libraries/irrlicht-1.8/include/IFileArchive.h
index a2e02a8..8bf8cad 100644
--- a/libraries/irrlicht-1.8/include/IFileArchive.h
+++ b/libraries/irrlicht-1.8/include/IFileArchive.h
@@ -1,132 +1,132 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt/ Thomas Alten 1// Copyright (C) 2002-2012 Nikolaus Gebhardt/ Thomas Alten
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#ifndef __I_FILE_ARCHIVE_H_INCLUDED__ 5#ifndef __I_FILE_ARCHIVE_H_INCLUDED__
6#define __I_FILE_ARCHIVE_H_INCLUDED__ 6#define __I_FILE_ARCHIVE_H_INCLUDED__
7 7
8#include "IReadFile.h" 8#include "IReadFile.h"
9#include "IFileList.h" 9#include "IFileList.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13 13
14namespace io 14namespace io
15{ 15{
16 16
17//! FileSystemType: which Filesystem should be used for e.g. browsing 17//! FileSystemType: which Filesystem should be used for e.g. browsing
18enum EFileSystemType 18enum EFileSystemType
19{ 19{
20 FILESYSTEM_NATIVE = 0, // Native OS FileSystem 20 FILESYSTEM_NATIVE = 0, // Native OS FileSystem
21 FILESYSTEM_VIRTUAL // Virtual FileSystem 21 FILESYSTEM_VIRTUAL // Virtual FileSystem
22}; 22};
23 23
24//! Contains the different types of archives 24//! Contains the different types of archives
25enum E_FILE_ARCHIVE_TYPE 25enum E_FILE_ARCHIVE_TYPE
26{ 26{
27 //! A PKZIP archive 27 //! A PKZIP archive
28 EFAT_ZIP = MAKE_IRR_ID('Z','I','P', 0), 28 EFAT_ZIP = MAKE_IRR_ID('Z','I','P', 0),
29 29
30 //! A gzip archive 30 //! A gzip archive
31 EFAT_GZIP = MAKE_IRR_ID('g','z','i','p'), 31 EFAT_GZIP = MAKE_IRR_ID('g','z','i','p'),
32 32
33 //! A virtual directory 33 //! A virtual directory
34 EFAT_FOLDER = MAKE_IRR_ID('f','l','d','r'), 34 EFAT_FOLDER = MAKE_IRR_ID('f','l','d','r'),
35 35
36 //! An ID Software PAK archive 36 //! An ID Software PAK archive
37 EFAT_PAK = MAKE_IRR_ID('P','A','K', 0), 37 EFAT_PAK = MAKE_IRR_ID('P','A','K', 0),
38 38
39 //! A Nebula Device archive 39 //! A Nebula Device archive
40 EFAT_NPK = MAKE_IRR_ID('N','P','K', 0), 40 EFAT_NPK = MAKE_IRR_ID('N','P','K', 0),
41 41
42 //! A Tape ARchive 42 //! A Tape ARchive
43 EFAT_TAR = MAKE_IRR_ID('T','A','R', 0), 43 EFAT_TAR = MAKE_IRR_ID('T','A','R', 0),
44 44
45 //! A wad Archive, Quake2, Halflife 45 //! A wad Archive, Quake2, Halflife
46 EFAT_WAD = MAKE_IRR_ID('W','A','D', 0), 46 EFAT_WAD = MAKE_IRR_ID('W','A','D', 0),
47 47
48 //! The type of this archive is unknown 48 //! The type of this archive is unknown
49 EFAT_UNKNOWN = MAKE_IRR_ID('u','n','k','n') 49 EFAT_UNKNOWN = MAKE_IRR_ID('u','n','k','n')
50}; 50};
51 51
52//! The FileArchive manages archives and provides access to files inside them. 52//! The FileArchive manages archives and provides access to files inside them.
53class IFileArchive : public virtual IReferenceCounted 53class IFileArchive : public virtual IReferenceCounted
54{ 54{
55public: 55public:
56 56
57 //! Opens a file based on its name 57 //! Opens a file based on its name
58 /** Creates and returns a new IReadFile for a file in the archive. 58 /** Creates and returns a new IReadFile for a file in the archive.
59 \param filename The file to open 59 \param filename The file to open
60 \return Returns A pointer to the created file on success, 60 \return Returns A pointer to the created file on success,
61 or 0 on failure. */ 61 or 0 on failure. */
62 virtual IReadFile* createAndOpenFile(const path& filename) =0; 62 virtual IReadFile* createAndOpenFile(const path& filename) =0;
63 63
64 //! Opens a file based on its position in the file list. 64 //! Opens a file based on its position in the file list.
65 /** Creates and returns 65 /** Creates and returns
66 \param index The zero based index of the file. 66 \param index The zero based index of the file.
67 \return Returns a pointer to the created file on success, or 0 on failure. */ 67 \return Returns a pointer to the created file on success, or 0 on failure. */
68 virtual IReadFile* createAndOpenFile(u32 index) =0; 68 virtual IReadFile* createAndOpenFile(u32 index) =0;
69 69
70 //! Returns the complete file tree 70 //! Returns the complete file tree
71 /** \return Returns the complete directory tree for the archive, 71 /** \return Returns the complete directory tree for the archive,
72 including all files and folders */ 72 including all files and folders */
73 virtual const IFileList* getFileList() const =0; 73 virtual const IFileList* getFileList() const =0;
74 74
75 //! get the archive type 75 //! get the archive type
76 virtual E_FILE_ARCHIVE_TYPE getType() const { return EFAT_UNKNOWN; } 76 virtual E_FILE_ARCHIVE_TYPE getType() const { return EFAT_UNKNOWN; }
77 77
78 //! An optionally used password string 78 //! An optionally used password string
79 /** This variable is publicly accessible from the interface in order to 79 /** This variable is publicly accessible from the interface in order to
80 avoid single access patterns to this place, and hence allow some more 80 avoid single access patterns to this place, and hence allow some more
81 obscurity. 81 obscurity.
82 */ 82 */
83 core::stringc Password; 83 core::stringc Password;
84}; 84};
85 85
86//! Class which is able to create an archive from a file. 86//! Class which is able to create an archive from a file.
87/** If you want the Irrlicht Engine be able to load archives of 87/** If you want the Irrlicht Engine be able to load archives of
88currently unsupported file formats (e.g .wad), then implement 88currently unsupported file formats (e.g .wad), then implement
89this and add your new Archive loader with 89this and add your new Archive loader with
90IFileSystem::addArchiveLoader() to the engine. */ 90IFileSystem::addArchiveLoader() to the engine. */
91class IArchiveLoader : public virtual IReferenceCounted 91class IArchiveLoader : public virtual IReferenceCounted
92{ 92{
93public: 93public:
94 //! Check if the file might be loaded by this class 94 //! Check if the file might be loaded by this class
95 /** Check based on the file extension (e.g. ".zip") 95 /** Check based on the file extension (e.g. ".zip")
96 \param filename Name of file to check. 96 \param filename Name of file to check.
97 \return True if file seems to be loadable. */ 97 \return True if file seems to be loadable. */
98 virtual bool isALoadableFileFormat(const path& filename) const =0; 98 virtual bool isALoadableFileFormat(const path& filename) const =0;
99 99
100 //! Check if the file might be loaded by this class 100 //! Check if the file might be loaded by this class
101 /** This check may look into the file. 101 /** This check may look into the file.
102 \param file File handle to check. 102 \param file File handle to check.
103 \return True if file seems to be loadable. */ 103 \return True if file seems to be loadable. */
104 virtual bool isALoadableFileFormat(io::IReadFile* file) const =0; 104 virtual bool isALoadableFileFormat(io::IReadFile* file) const =0;
105 105
106 //! Check to see if the loader can create archives of this type. 106 //! Check to see if the loader can create archives of this type.
107 /** Check based on the archive type. 107 /** Check based on the archive type.
108 \param fileType The archive type to check. 108 \param fileType The archive type to check.
109 \return True if the archile loader supports this type, false if not */ 109 \return True if the archile loader supports this type, false if not */
110 virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0; 110 virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0;
111 111
112 //! Creates an archive from the filename 112 //! Creates an archive from the filename
113 /** \param filename File to use. 113 /** \param filename File to use.
114 \param ignoreCase Searching is performed without regarding the case 114 \param ignoreCase Searching is performed without regarding the case
115 \param ignorePaths Files are searched for without checking for the directories 115 \param ignorePaths Files are searched for without checking for the directories
116 \return Pointer to newly created archive, or 0 upon error. */ 116 \return Pointer to newly created archive, or 0 upon error. */
117 virtual IFileArchive* createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const =0; 117 virtual IFileArchive* createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const =0;
118 118
119 //! Creates an archive from the file 119 //! Creates an archive from the file
120 /** \param file File handle to use. 120 /** \param file File handle to use.
121 \param ignoreCase Searching is performed without regarding the case 121 \param ignoreCase Searching is performed without regarding the case
122 \param ignorePaths Files are searched for without checking for the directories 122 \param ignorePaths Files are searched for without checking for the directories
123 \return Pointer to newly created archive, or 0 upon error. */ 123 \return Pointer to newly created archive, or 0 upon error. */
124 virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const =0; 124 virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const =0;
125}; 125};
126 126
127 127
128} // end namespace io 128} // end namespace io
129} // end namespace irr 129} // end namespace irr
130 130
131#endif 131#endif
132 132
diff --git a/libraries/irrlicht-1.8/include/IFileList.h b/libraries/irrlicht-1.8/include/IFileList.h
index 4c2f8ea..2eabd7c 100644
--- a/libraries/irrlicht-1.8/include/IFileList.h
+++ b/libraries/irrlicht-1.8/include/IFileList.h
@@ -1,94 +1,94 @@
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#ifndef __I_FILE_LIST_H_INCLUDED__ 5#ifndef __I_FILE_LIST_H_INCLUDED__
6#define __I_FILE_LIST_H_INCLUDED__ 6#define __I_FILE_LIST_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "path.h" 9#include "path.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace io 13namespace io
14{ 14{
15 15
16//! Provides a list of files and folders. 16//! Provides a list of files and folders.
17/** File lists usually contain a list of all files in a given folder, 17/** File lists usually contain a list of all files in a given folder,
18but can also contain a complete directory structure. */ 18but can also contain a complete directory structure. */
19class IFileList : public virtual IReferenceCounted 19class IFileList : public virtual IReferenceCounted
20{ 20{
21public: 21public:
22 //! Get the number of files in the filelist. 22 //! Get the number of files in the filelist.
23 /** \return Amount of files and directories in the file list. */ 23 /** \return Amount of files and directories in the file list. */
24 virtual u32 getFileCount() const = 0; 24 virtual u32 getFileCount() const = 0;
25 25
26 //! Gets the name of a file in the list, based on an index. 26 //! Gets the name of a file in the list, based on an index.
27 /** The path is not included in this name. Use getFullFileName for this. 27 /** The path is not included in this name. Use getFullFileName for this.
28 \param index is the zero based index of the file which name should 28 \param index is the zero based index of the file which name should
29 be returned. The index must be less than the amount getFileCount() returns. 29 be returned. The index must be less than the amount getFileCount() returns.
30 \return File name of the file. Returns 0, if an error occured. */ 30 \return File name of the file. Returns 0, if an error occured. */
31 virtual const io::path& getFileName(u32 index) const = 0; 31 virtual const io::path& getFileName(u32 index) const = 0;
32 32
33 //! Gets the full name of a file in the list including the path, based on an index. 33 //! Gets the full name of a file in the list including the path, based on an index.
34 /** \param index is the zero based index of the file which name should 34 /** \param index is the zero based index of the file which name should
35 be returned. The index must be less than the amount getFileCount() returns. 35 be returned. The index must be less than the amount getFileCount() returns.
36 \return File name of the file. Returns 0 if an error occured. */ 36 \return File name of the file. Returns 0 if an error occured. */
37 virtual const io::path& getFullFileName(u32 index) const = 0; 37 virtual const io::path& getFullFileName(u32 index) const = 0;
38 38
39 //! Returns the size of a file in the file list, based on an index. 39 //! Returns the size of a file in the file list, based on an index.
40 /** \param index is the zero based index of the file which should be returned. 40 /** \param index is the zero based index of the file which should be returned.
41 The index must be less than the amount getFileCount() returns. 41 The index must be less than the amount getFileCount() returns.
42 \return The size of the file in bytes. */ 42 \return The size of the file in bytes. */
43 virtual u32 getFileSize(u32 index) const = 0; 43 virtual u32 getFileSize(u32 index) const = 0;
44 44
45 //! Returns the file offset of a file in the file list, based on an index. 45 //! Returns the file offset of a file in the file list, based on an index.
46 /** \param index is the zero based index of the file which should be returned. 46 /** \param index is the zero based index of the file which should be returned.
47 The index must be less than the amount getFileCount() returns. 47 The index must be less than the amount getFileCount() returns.
48 \return The offset of the file in bytes. */ 48 \return The offset of the file in bytes. */
49 virtual u32 getFileOffset(u32 index) const = 0; 49 virtual u32 getFileOffset(u32 index) const = 0;
50 50
51 //! Returns the ID of a file in the file list, based on an index. 51 //! Returns the ID of a file in the file list, based on an index.
52 /** This optional ID can be used to link the file list entry to information held 52 /** This optional ID can be used to link the file list entry to information held
53 elsewhere. For example this could be an index in an IFileArchive, linking the entry 53 elsewhere. For example this could be an index in an IFileArchive, linking the entry
54 to its data offset, uncompressed size and CRC. 54 to its data offset, uncompressed size and CRC.
55 \param index is the zero based index of the file which should be returned. 55 \param index is the zero based index of the file which should be returned.
56 The index must be less than the amount getFileCount() returns. 56 The index must be less than the amount getFileCount() returns.
57 \return The ID of the file. */ 57 \return The ID of the file. */
58 virtual u32 getID(u32 index) const = 0; 58 virtual u32 getID(u32 index) const = 0;
59 59
60 //! Check if the file is a directory 60 //! Check if the file is a directory
61 /** \param index The zero based index which will be checked. The index 61 /** \param index The zero based index which will be checked. The index
62 must be less than the amount getFileCount() returns. 62 must be less than the amount getFileCount() returns.
63 \return True if the file is a directory, else false. */ 63 \return True if the file is a directory, else false. */
64 virtual bool isDirectory(u32 index) const = 0; 64 virtual bool isDirectory(u32 index) const = 0;
65 65
66 //! Searches for a file or folder in the list 66 //! Searches for a file or folder in the list
67 /** Searches for a file by name 67 /** Searches for a file by name
68 \param filename The name of the file to search for. 68 \param filename The name of the file to search for.
69 \param isFolder True if you are searching for a directory path, false if you are searching for a file 69 \param isFolder True if you are searching for a directory path, false if you are searching for a file
70 \return Returns the index of the file in the file list, or -1 if 70 \return Returns the index of the file in the file list, or -1 if
71 no matching name name was found. */ 71 no matching name name was found. */
72 virtual s32 findFile(const io::path& filename, bool isFolder=false) const = 0; 72 virtual s32 findFile(const io::path& filename, bool isFolder=false) const = 0;
73 73
74 //! Returns the base path of the file list 74 //! Returns the base path of the file list
75 virtual const io::path& getPath() const = 0; 75 virtual const io::path& getPath() const = 0;
76 76
77 //! Add as a file or folder to the list 77 //! Add as a file or folder to the list
78 /** \param fullPath The file name including path, from the root of the file list. 78 /** \param fullPath The file name including path, from the root of the file list.
79 \param isDirectory True if this is a directory rather than a file. 79 \param isDirectory True if this is a directory rather than a file.
80 \param offset The file offset inside an archive 80 \param offset The file offset inside an archive
81 \param size The size of the file in bytes. 81 \param size The size of the file in bytes.
82 \param id The ID of the file in the archive which owns it */ 82 \param id The ID of the file in the archive which owns it */
83 virtual u32 addItem(const io::path& fullPath, u32 offset, u32 size, bool isDirectory, u32 id=0) = 0; 83 virtual u32 addItem(const io::path& fullPath, u32 offset, u32 size, bool isDirectory, u32 id=0) = 0;
84 84
85 //! Sorts the file list. You should call this after adding any items to the file list 85 //! Sorts the file list. You should call this after adding any items to the file list
86 virtual void sort() = 0; 86 virtual void sort() = 0;
87}; 87};
88 88
89} // end namespace irr 89} // end namespace irr
90} // end namespace io 90} // end namespace io
91 91
92 92
93#endif 93#endif
94 94
diff --git a/libraries/irrlicht-1.8/include/IFileSystem.h b/libraries/irrlicht-1.8/include/IFileSystem.h
index f158363..0c5244d 100644
--- a/libraries/irrlicht-1.8/include/IFileSystem.h
+++ b/libraries/irrlicht-1.8/include/IFileSystem.h
@@ -1,385 +1,385 @@
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#ifndef __I_FILE_SYSTEM_H_INCLUDED__ 5#ifndef __I_FILE_SYSTEM_H_INCLUDED__
6#define __I_FILE_SYSTEM_H_INCLUDED__ 6#define __I_FILE_SYSTEM_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "IXMLReader.h" 9#include "IXMLReader.h"
10#include "IFileArchive.h" 10#include "IFileArchive.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace video 14namespace video
15{ 15{
16 class IVideoDriver; 16 class IVideoDriver;
17} // end namespace video 17} // end namespace video
18namespace io 18namespace io
19{ 19{
20 20
21class IReadFile; 21class IReadFile;
22class IWriteFile; 22class IWriteFile;
23class IFileList; 23class IFileList;
24class IXMLWriter; 24class IXMLWriter;
25class IAttributes; 25class IAttributes;
26 26
27 27
28//! The FileSystem manages files and archives and provides access to them. 28//! The FileSystem manages files and archives and provides access to them.
29/** It manages where files are, so that modules which use the the IO do not 29/** It manages where files are, so that modules which use the the IO do not
30need to know where every file is located. A file could be in a .zip-Archive or 30need to know where every file is located. A file could be in a .zip-Archive or
31as file on disk, using the IFileSystem makes no difference to this. */ 31as file on disk, using the IFileSystem makes no difference to this. */
32class IFileSystem : public virtual IReferenceCounted 32class IFileSystem : public virtual IReferenceCounted
33{ 33{
34public: 34public:
35 35
36 //! Opens a file for read access. 36 //! Opens a file for read access.
37 /** \param filename: Name of file to open. 37 /** \param filename: Name of file to open.
38 \return Pointer to the created file interface. 38 \return Pointer to the created file interface.
39 The returned pointer should be dropped when no longer needed. 39 The returned pointer should be dropped when no longer needed.
40 See IReferenceCounted::drop() for more information. */ 40 See IReferenceCounted::drop() for more information. */
41 virtual IReadFile* createAndOpenFile(const path& filename) =0; 41 virtual IReadFile* createAndOpenFile(const path& filename) =0;
42 42
43 //! Creates an IReadFile interface for accessing memory like a file. 43 //! Creates an IReadFile interface for accessing memory like a file.
44 /** This allows you to use a pointer to memory where an IReadFile is requested. 44 /** This allows you to use a pointer to memory where an IReadFile is requested.
45 \param memory: A pointer to the start of the file in memory 45 \param memory: A pointer to the start of the file in memory
46 \param len: The length of the memory in bytes 46 \param len: The length of the memory in bytes
47 \param fileName: The name given to this file 47 \param fileName: The name given to this file
48 \param deleteMemoryWhenDropped: True if the memory should be deleted 48 \param deleteMemoryWhenDropped: True if the memory should be deleted
49 along with the IReadFile when it is dropped. 49 along with the IReadFile when it is dropped.
50 \return Pointer to the created file interface. 50 \return Pointer to the created file interface.
51 The returned pointer should be dropped when no longer needed. 51 The returned pointer should be dropped when no longer needed.
52 See IReferenceCounted::drop() for more information. 52 See IReferenceCounted::drop() for more information.
53 */ 53 */
54 virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0; 54 virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
55 55
56 //! Creates an IReadFile interface for accessing files inside files. 56 //! Creates an IReadFile interface for accessing files inside files.
57 /** This is useful e.g. for archives. 57 /** This is useful e.g. for archives.
58 \param fileName: The name given to this file 58 \param fileName: The name given to this file
59 \param alreadyOpenedFile: Pointer to the enclosing file 59 \param alreadyOpenedFile: Pointer to the enclosing file
60 \param pos: Start of the file inside alreadyOpenedFile 60 \param pos: Start of the file inside alreadyOpenedFile
61 \param areaSize: The length of the file 61 \param areaSize: The length of the file
62 \return A pointer to the created file interface. 62 \return A pointer to the created file interface.
63 The returned pointer should be dropped when no longer needed. 63 The returned pointer should be dropped when no longer needed.
64 See IReferenceCounted::drop() for more information. 64 See IReferenceCounted::drop() for more information.
65 */ 65 */
66 virtual IReadFile* createLimitReadFile(const path& fileName, 66 virtual IReadFile* createLimitReadFile(const path& fileName,
67 IReadFile* alreadyOpenedFile, long pos, long areaSize) =0; 67 IReadFile* alreadyOpenedFile, long pos, long areaSize) =0;
68 68
69 //! Creates an IWriteFile interface for accessing memory like a file. 69 //! Creates an IWriteFile interface for accessing memory like a file.
70 /** This allows you to use a pointer to memory where an IWriteFile is requested. 70 /** This allows you to use a pointer to memory where an IWriteFile is requested.
71 You are responsible for allocating enough memory. 71 You are responsible for allocating enough memory.
72 \param memory: A pointer to the start of the file in memory (allocated by you) 72 \param memory: A pointer to the start of the file in memory (allocated by you)
73 \param len: The length of the memory in bytes 73 \param len: The length of the memory in bytes
74 \param fileName: The name given to this file 74 \param fileName: The name given to this file
75 \param deleteMemoryWhenDropped: True if the memory should be deleted 75 \param deleteMemoryWhenDropped: True if the memory should be deleted
76 along with the IWriteFile when it is dropped. 76 along with the IWriteFile when it is dropped.
77 \return Pointer to the created file interface. 77 \return Pointer to the created file interface.
78 The returned pointer should be dropped when no longer needed. 78 The returned pointer should be dropped when no longer needed.
79 See IReferenceCounted::drop() for more information. 79 See IReferenceCounted::drop() for more information.
80 */ 80 */
81 virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0; 81 virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
82 82
83 83
84 //! Opens a file for write access. 84 //! Opens a file for write access.
85 /** \param filename: Name of file to open. 85 /** \param filename: Name of file to open.
86 \param append: If the file already exist, all write operations are 86 \param append: If the file already exist, all write operations are
87 appended to the file. 87 appended to the file.
88 \return Pointer to the created file interface. 0 is returned, if the 88 \return Pointer to the created file interface. 0 is returned, if the
89 file could not created or opened for writing. 89 file could not created or opened for writing.
90 The returned pointer should be dropped when no longer needed. 90 The returned pointer should be dropped when no longer needed.
91 See IReferenceCounted::drop() for more information. */ 91 See IReferenceCounted::drop() for more information. */
92 virtual IWriteFile* createAndWriteFile(const path& filename, bool append=false) =0; 92 virtual IWriteFile* createAndWriteFile(const path& filename, bool append=false) =0;
93 93
94 //! Adds an archive to the file system. 94 //! Adds an archive to the file system.
95 /** After calling this, the Irrlicht Engine will also search and open 95 /** After calling this, the Irrlicht Engine will also search and open
96 files directly from this archive. This is useful for hiding data from 96 files directly from this archive. This is useful for hiding data from
97 the end user, speeding up file access and making it possible to access 97 the end user, speeding up file access and making it possible to access
98 for example Quake3 .pk3 files, which are just renamed .zip files. By 98 for example Quake3 .pk3 files, which are just renamed .zip files. By
99 default Irrlicht supports ZIP, PAK, TAR, PNK, and directories as 99 default Irrlicht supports ZIP, PAK, TAR, PNK, and directories as
100 archives. You can provide your own archive types by implementing 100 archives. You can provide your own archive types by implementing
101 IArchiveLoader and passing an instance to addArchiveLoader. 101 IArchiveLoader and passing an instance to addArchiveLoader.
102 Irrlicht supports AES-encrypted zip files, and the advanced compression 102 Irrlicht supports AES-encrypted zip files, and the advanced compression
103 techniques lzma and bzip2. 103 techniques lzma and bzip2.
104 \param filename: Filename of the archive to add to the file system. 104 \param filename: Filename of the archive to add to the file system.
105 \param ignoreCase: If set to true, files in the archive can be accessed without 105 \param ignoreCase: If set to true, files in the archive can be accessed without
106 writing all letters in the right case. 106 writing all letters in the right case.
107 \param ignorePaths: If set to true, files in the added archive can be accessed 107 \param ignorePaths: If set to true, files in the added archive can be accessed
108 without its complete path. 108 without its complete path.
109 \param archiveType: If no specific E_FILE_ARCHIVE_TYPE is selected then 109 \param archiveType: If no specific E_FILE_ARCHIVE_TYPE is selected then
110 the type of archive will depend on the extension of the file name. If 110 the type of archive will depend on the extension of the file name. If
111 you use a different extension then you can use this parameter to force 111 you use a different extension then you can use this parameter to force
112 a specific type of archive. 112 a specific type of archive.
113 \param password An optional password, which is used in case of encrypted archives. 113 \param password An optional password, which is used in case of encrypted archives.
114 \param retArchive A pointer that will be set to the archive that is added. 114 \param retArchive A pointer that will be set to the archive that is added.
115 \return True if the archive was added successfully, false if not. */ 115 \return True if the archive was added successfully, false if not. */
116 virtual bool addFileArchive(const path& filename, bool ignoreCase=true, 116 virtual bool addFileArchive(const path& filename, bool ignoreCase=true,
117 bool ignorePaths=true, 117 bool ignorePaths=true,
118 E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN, 118 E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN,
119 const core::stringc& password="", 119 const core::stringc& password="",
120 IFileArchive** retArchive=0) =0; 120 IFileArchive** retArchive=0) =0;
121 121
122 //! Adds an archive to the file system. 122 //! Adds an archive to the file system.
123 /** After calling this, the Irrlicht Engine will also search and open 123 /** After calling this, the Irrlicht Engine will also search and open
124 files directly from this archive. This is useful for hiding data from 124 files directly from this archive. This is useful for hiding data from
125 the end user, speeding up file access and making it possible to access 125 the end user, speeding up file access and making it possible to access
126 for example Quake3 .pk3 files, which are just renamed .zip files. By 126 for example Quake3 .pk3 files, which are just renamed .zip files. By
127 default Irrlicht supports ZIP, PAK, TAR, PNK, and directories as 127 default Irrlicht supports ZIP, PAK, TAR, PNK, and directories as
128 archives. You can provide your own archive types by implementing 128 archives. You can provide your own archive types by implementing
129 IArchiveLoader and passing an instance to addArchiveLoader. 129 IArchiveLoader and passing an instance to addArchiveLoader.
130 Irrlicht supports AES-encrypted zip files, and the advanced compression 130 Irrlicht supports AES-encrypted zip files, and the advanced compression
131 techniques lzma and bzip2. 131 techniques lzma and bzip2.
132 If you want to add a directory as an archive, prefix its name with a 132 If you want to add a directory as an archive, prefix its name with a
133 slash in order to let Irrlicht recognize it as a folder mount (mypath/). 133 slash in order to let Irrlicht recognize it as a folder mount (mypath/).
134 Using this technique one can build up a search order, because archives 134 Using this technique one can build up a search order, because archives
135 are read first, and can be used more easily with relative filenames. 135 are read first, and can be used more easily with relative filenames.
136 \param file: Archive to add to the file system. 136 \param file: Archive to add to the file system.
137 \param ignoreCase: If set to true, files in the archive can be accessed without 137 \param ignoreCase: If set to true, files in the archive can be accessed without
138 writing all letters in the right case. 138 writing all letters in the right case.
139 \param ignorePaths: If set to true, files in the added archive can be accessed 139 \param ignorePaths: If set to true, files in the added archive can be accessed
140 without its complete path. 140 without its complete path.
141 \param archiveType: If no specific E_FILE_ARCHIVE_TYPE is selected then 141 \param archiveType: If no specific E_FILE_ARCHIVE_TYPE is selected then
142 the type of archive will depend on the extension of the file name. If 142 the type of archive will depend on the extension of the file name. If
143 you use a different extension then you can use this parameter to force 143 you use a different extension then you can use this parameter to force
144 a specific type of archive. 144 a specific type of archive.
145 \param password An optional password, which is used in case of encrypted archives. 145 \param password An optional password, which is used in case of encrypted archives.
146 \param retArchive A pointer that will be set to the archive that is added. 146 \param retArchive A pointer that will be set to the archive that is added.
147 \return True if the archive was added successfully, false if not. */ 147 \return True if the archive was added successfully, false if not. */
148 virtual bool addFileArchive(IReadFile* file, bool ignoreCase=true, 148 virtual bool addFileArchive(IReadFile* file, bool ignoreCase=true,
149 bool ignorePaths=true, 149 bool ignorePaths=true,
150 E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN, 150 E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN,
151 const core::stringc& password="", 151 const core::stringc& password="",
152 IFileArchive** retArchive=0) =0; 152 IFileArchive** retArchive=0) =0;
153 153
154 //! Adds an archive to the file system. 154 //! Adds an archive to the file system.
155 /** \param archive: The archive to add to the file system. 155 /** \param archive: The archive to add to the file system.
156 \return True if the archive was added successfully, false if not. */ 156 \return True if the archive was added successfully, false if not. */
157 virtual bool addFileArchive(IFileArchive* archive) =0; 157 virtual bool addFileArchive(IFileArchive* archive) =0;
158 158
159 //! Get the number of archives currently attached to the file system 159 //! Get the number of archives currently attached to the file system
160 virtual u32 getFileArchiveCount() const =0; 160 virtual u32 getFileArchiveCount() const =0;
161 161
162 //! Removes an archive from the file system. 162 //! Removes an archive from the file system.
163 /** This will close the archive and free any file handles, but will not 163 /** This will close the archive and free any file handles, but will not
164 close resources which have already been loaded and are now cached, for 164 close resources which have already been loaded and are now cached, for
165 example textures and meshes. 165 example textures and meshes.
166 \param index: The index of the archive to remove 166 \param index: The index of the archive to remove
167 \return True on success, false on failure */ 167 \return True on success, false on failure */
168 virtual bool removeFileArchive(u32 index) =0; 168 virtual bool removeFileArchive(u32 index) =0;
169 169
170 //! Removes an archive from the file system. 170 //! Removes an archive from the file system.
171 /** This will close the archive and free any file handles, but will not 171 /** This will close the archive and free any file handles, but will not
172 close resources which have already been loaded and are now cached, for 172 close resources which have already been loaded and are now cached, for
173 example textures and meshes. Note that a relative filename might be 173 example textures and meshes. Note that a relative filename might be
174 interpreted differently on each call, depending on the current working 174 interpreted differently on each call, depending on the current working
175 directory. In case you want to remove an archive that was added using 175 directory. In case you want to remove an archive that was added using
176 a relative path name, you have to change to the same working directory 176 a relative path name, you have to change to the same working directory
177 again. This means, that the filename given on creation is not an 177 again. This means, that the filename given on creation is not an
178 identifier for the archive, but just a usual filename that is used for 178 identifier for the archive, but just a usual filename that is used for
179 locating the archive to work with. 179 locating the archive to work with.
180 \param filename The archive pointed to by the name will be removed 180 \param filename The archive pointed to by the name will be removed
181 \return True on success, false on failure */ 181 \return True on success, false on failure */
182 virtual bool removeFileArchive(const path& filename) =0; 182 virtual bool removeFileArchive(const path& filename) =0;
183 183
184 //! Removes an archive from the file system. 184 //! Removes an archive from the file system.
185 /** This will close the archive and free any file handles, but will not 185 /** This will close the archive and free any file handles, but will not
186 close resources which have already been loaded and are now cached, for 186 close resources which have already been loaded and are now cached, for
187 example textures and meshes. 187 example textures and meshes.
188 \param archive The archive to remove. 188 \param archive The archive to remove.
189 \return True on success, false on failure */ 189 \return True on success, false on failure */
190 virtual bool removeFileArchive(const IFileArchive* archive) =0; 190 virtual bool removeFileArchive(const IFileArchive* archive) =0;
191 191
192 //! Changes the search order of attached archives. 192 //! Changes the search order of attached archives.
193 /** 193 /**
194 \param sourceIndex: The index of the archive to change 194 \param sourceIndex: The index of the archive to change
195 \param relative: The relative change in position, archives with a lower index are searched first */ 195 \param relative: The relative change in position, archives with a lower index are searched first */
196 virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0; 196 virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0;
197 197
198 //! Get the archive at a given index. 198 //! Get the archive at a given index.
199 virtual IFileArchive* getFileArchive(u32 index) =0; 199 virtual IFileArchive* getFileArchive(u32 index) =0;
200 200
201 //! Adds an external archive loader to the engine. 201 //! Adds an external archive loader to the engine.
202 /** Use this function to add support for new archive types to the 202 /** Use this function to add support for new archive types to the
203 engine, for example proprietary or encrypted file storage. */ 203 engine, for example proprietary or encrypted file storage. */
204 virtual void addArchiveLoader(IArchiveLoader* loader) =0; 204 virtual void addArchiveLoader(IArchiveLoader* loader) =0;
205 205
206 //! Gets the number of archive loaders currently added 206 //! Gets the number of archive loaders currently added
207 virtual u32 getArchiveLoaderCount() const = 0; 207 virtual u32 getArchiveLoaderCount() const = 0;
208 208
209 //! Retrieve the given archive loader 209 //! Retrieve the given archive loader
210 /** \param index The index of the loader to retrieve. This parameter is an 0-based 210 /** \param index The index of the loader to retrieve. This parameter is an 0-based
211 array index. 211 array index.
212 \return A pointer to the specified loader, 0 if the index is incorrect. */ 212 \return A pointer to the specified loader, 0 if the index is incorrect. */
213 virtual IArchiveLoader* getArchiveLoader(u32 index) const = 0; 213 virtual IArchiveLoader* getArchiveLoader(u32 index) const = 0;
214 214
215 //! Adds a zip archive to the file system. 215 //! Adds a zip archive to the file system.
216 /** \deprecated This function is provided for compatibility 216 /** \deprecated This function is provided for compatibility
217 with older versions of Irrlicht and may be removed in Irrlicht 1.9, 217 with older versions of Irrlicht and may be removed in Irrlicht 1.9,
218 you should use addFileArchive instead. 218 you should use addFileArchive instead.
219 After calling this, the Irrlicht Engine will search and open files directly from this archive too. 219 After calling this, the Irrlicht Engine will search and open files directly from this archive too.
220 This is useful for hiding data from the end user, speeding up file access and making it possible to 220 This is useful for hiding data from the end user, speeding up file access and making it possible to
221 access for example Quake3 .pk3 files, which are no different than .zip files. 221 access for example Quake3 .pk3 files, which are no different than .zip files.
222 \param filename: Filename of the zip archive to add to the file system. 222 \param filename: Filename of the zip archive to add to the file system.
223 \param ignoreCase: If set to true, files in the archive can be accessed without 223 \param ignoreCase: If set to true, files in the archive can be accessed without
224 writing all letters in the right case. 224 writing all letters in the right case.
225 \param ignorePaths: If set to true, files in the added archive can be accessed 225 \param ignorePaths: If set to true, files in the added archive can be accessed
226 without its complete path. 226 without its complete path.
227 \return True if the archive was added successfully, false if not. */ 227 \return True if the archive was added successfully, false if not. */
228 _IRR_DEPRECATED_ virtual bool addZipFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true) 228 _IRR_DEPRECATED_ virtual bool addZipFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
229 { 229 {
230 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_ZIP); 230 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_ZIP);
231 } 231 }
232 232
233 //! Adds an unzipped archive (or basedirectory with subdirectories..) to the file system. 233 //! Adds an unzipped archive (or basedirectory with subdirectories..) to the file system.
234 /** \deprecated This function is provided for compatibility 234 /** \deprecated This function is provided for compatibility
235 with older versions of Irrlicht and may be removed in Irrlicht 1.9, 235 with older versions of Irrlicht and may be removed in Irrlicht 1.9,
236 you should use addFileArchive instead. 236 you should use addFileArchive instead.
237 Useful for handling data which will be in a zip file 237 Useful for handling data which will be in a zip file
238 \param filename: Filename of the unzipped zip archive base directory to add to the file system. 238 \param filename: Filename of the unzipped zip archive base directory to add to the file system.
239 \param ignoreCase: If set to true, files in the archive can be accessed without 239 \param ignoreCase: If set to true, files in the archive can be accessed without
240 writing all letters in the right case. 240 writing all letters in the right case.
241 \param ignorePaths: If set to true, files in the added archive can be accessed 241 \param ignorePaths: If set to true, files in the added archive can be accessed
242 without its complete path. 242 without its complete path.
243 \return True if the archive was added successful, false if not. */ 243 \return True if the archive was added successful, false if not. */
244 _IRR_DEPRECATED_ virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true) 244 _IRR_DEPRECATED_ virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
245 { 245 {
246 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_FOLDER); 246 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_FOLDER);
247 } 247 }
248 248
249 //! Adds a pak archive to the file system. 249 //! Adds a pak archive to the file system.
250 /** \deprecated This function is provided for compatibility 250 /** \deprecated This function is provided for compatibility
251 with older versions of Irrlicht and may be removed in Irrlicht 1.9, 251 with older versions of Irrlicht and may be removed in Irrlicht 1.9,
252 you should use addFileArchive instead. 252 you should use addFileArchive instead.
253 After calling this, the Irrlicht Engine will search and open files directly from this archive too. 253 After calling this, the Irrlicht Engine will search and open files directly from this archive too.
254 This is useful for hiding data from the end user, speeding up file access and making it possible to 254 This is useful for hiding data from the end user, speeding up file access and making it possible to
255 access for example Quake2/KingPin/Hexen2 .pak files 255 access for example Quake2/KingPin/Hexen2 .pak files
256 \param filename: Filename of the pak archive to add to the file system. 256 \param filename: Filename of the pak archive to add to the file system.
257 \param ignoreCase: If set to true, files in the archive can be accessed without 257 \param ignoreCase: If set to true, files in the archive can be accessed without
258 writing all letters in the right case. 258 writing all letters in the right case.
259 \param ignorePaths: If set to true, files in the added archive can be accessed 259 \param ignorePaths: If set to true, files in the added archive can be accessed
260 without its complete path.(should not use with Quake2 paks 260 without its complete path.(should not use with Quake2 paks
261 \return True if the archive was added successful, false if not. */ 261 \return True if the archive was added successful, false if not. */
262 _IRR_DEPRECATED_ virtual bool addPakFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true) 262 _IRR_DEPRECATED_ virtual bool addPakFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
263 { 263 {
264 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_PAK); 264 return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_PAK);
265 } 265 }
266 266
267 //! Get the current working directory. 267 //! Get the current working directory.
268 /** \return Current working directory as a string. */ 268 /** \return Current working directory as a string. */
269 virtual const path& getWorkingDirectory() =0; 269 virtual const path& getWorkingDirectory() =0;
270 270
271 //! Changes the current working directory. 271 //! Changes the current working directory.
272 /** \param newDirectory: A string specifying the new working directory. 272 /** \param newDirectory: A string specifying the new working directory.
273 The string is operating system dependent. Under Windows it has 273 The string is operating system dependent. Under Windows it has
274 the form "<drive>:\<directory>\<sudirectory>\<..>". An example would be: "C:\Windows\" 274 the form "<drive>:\<directory>\<sudirectory>\<..>". An example would be: "C:\Windows\"
275 \return True if successful, otherwise false. */ 275 \return True if successful, otherwise false. */
276 virtual bool changeWorkingDirectoryTo(const path& newDirectory) =0; 276 virtual bool changeWorkingDirectoryTo(const path& newDirectory) =0;
277 277
278 //! Converts a relative path to an absolute (unique) path, resolving symbolic links if required 278 //! Converts a relative path to an absolute (unique) path, resolving symbolic links if required
279 /** \param filename Possibly relative file or directory name to query. 279 /** \param filename Possibly relative file or directory name to query.
280 \result Absolute filename which points to the same file. */ 280 \result Absolute filename which points to the same file. */
281 virtual path getAbsolutePath(const path& filename) const =0; 281 virtual path getAbsolutePath(const path& filename) const =0;
282 282
283 //! Get the directory a file is located in. 283 //! Get the directory a file is located in.
284 /** \param filename: The file to get the directory from. 284 /** \param filename: The file to get the directory from.
285 \return String containing the directory of the file. */ 285 \return String containing the directory of the file. */
286 virtual path getFileDir(const path& filename) const =0; 286 virtual path getFileDir(const path& filename) const =0;
287 287
288 //! Get the base part of a filename, i.e. the name without the directory part. 288 //! Get the base part of a filename, i.e. the name without the directory part.
289 /** If no directory is prefixed, the full name is returned. 289 /** If no directory is prefixed, the full name is returned.
290 \param filename: The file to get the basename from 290 \param filename: The file to get the basename from
291 \param keepExtension True if filename with extension is returned otherwise everything 291 \param keepExtension True if filename with extension is returned otherwise everything
292 after the final '.' is removed as well. */ 292 after the final '.' is removed as well. */
293 virtual path getFileBasename(const path& filename, bool keepExtension=true) const =0; 293 virtual path getFileBasename(const path& filename, bool keepExtension=true) const =0;
294 294
295 //! flatten a path and file name for example: "/you/me/../." becomes "/you" 295 //! flatten a path and file name for example: "/you/me/../." becomes "/you"
296 virtual path& flattenFilename(path& directory, const path& root="/") const =0; 296 virtual path& flattenFilename(path& directory, const path& root="/") const =0;
297 297
298 //! Get the relative filename, relative to the given directory 298 //! Get the relative filename, relative to the given directory
299 virtual path getRelativeFilename(const path& filename, const path& directory) const =0; 299 virtual path getRelativeFilename(const path& filename, const path& directory) const =0;
300 300
301 //! Creates a list of files and directories in the current working directory and returns it. 301 //! Creates a list of files and directories in the current working directory and returns it.
302 /** \return a Pointer to the created IFileList is returned. After the list has been used 302 /** \return a Pointer to the created IFileList is returned. After the list has been used
303 it has to be deleted using its IFileList::drop() method. 303 it has to be deleted using its IFileList::drop() method.
304 See IReferenceCounted::drop() for more information. */ 304 See IReferenceCounted::drop() for more information. */
305 virtual IFileList* createFileList() =0; 305 virtual IFileList* createFileList() =0;
306 306
307 //! Creates an empty filelist 307 //! Creates an empty filelist
308 /** \return a Pointer to the created IFileList is returned. After the list has been used 308 /** \return a Pointer to the created IFileList is returned. After the list has been used
309 it has to be deleted using its IFileList::drop() method. 309 it has to be deleted using its IFileList::drop() method.
310 See IReferenceCounted::drop() for more information. */ 310 See IReferenceCounted::drop() for more information. */
311 virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) =0; 311 virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) =0;
312 312
313 //! Set the active type of file system. 313 //! Set the active type of file system.
314 virtual EFileSystemType setFileListSystem(EFileSystemType listType) =0; 314 virtual EFileSystemType setFileListSystem(EFileSystemType listType) =0;
315 315
316 //! Determines if a file exists and could be opened. 316 //! Determines if a file exists and could be opened.
317 /** \param filename is the string identifying the file which should be tested for existence. 317 /** \param filename is the string identifying the file which should be tested for existence.
318 \return True if file exists, and false if it does not exist or an error occured. */ 318 \return True if file exists, and false if it does not exist or an error occured. */
319 virtual bool existFile(const path& filename) const =0; 319 virtual bool existFile(const path& filename) const =0;
320 320
321 //! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*). 321 //! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
322 /** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for 322 /** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
323 more information on how to use the parser. 323 more information on how to use the parser.
324 \return 0, if file could not be opened, otherwise a pointer to the created 324 \return 0, if file could not be opened, otherwise a pointer to the created
325 IXMLReader is returned. After use, the reader 325 IXMLReader is returned. After use, the reader
326 has to be deleted using its IXMLReader::drop() method. 326 has to be deleted using its IXMLReader::drop() method.
327 See IReferenceCounted::drop() for more information. */ 327 See IReferenceCounted::drop() for more information. */
328 virtual IXMLReader* createXMLReader(const path& filename) =0; 328 virtual IXMLReader* createXMLReader(const path& filename) =0;
329 329
330 //! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*). 330 //! Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
331 /** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for 331 /** Use createXMLReaderUTF8() if you prefer char* instead of wchar_t*. See IIrrXMLReader for
332 more information on how to use the parser. 332 more information on how to use the parser.
333 \return 0, if file could not be opened, otherwise a pointer to the created 333 \return 0, if file could not be opened, otherwise a pointer to the created
334 IXMLReader is returned. After use, the reader 334 IXMLReader is returned. After use, the reader
335 has to be deleted using its IXMLReader::drop() method. 335 has to be deleted using its IXMLReader::drop() method.
336 See IReferenceCounted::drop() for more information. */ 336 See IReferenceCounted::drop() for more information. */
337 virtual IXMLReader* createXMLReader(IReadFile* file) =0; 337 virtual IXMLReader* createXMLReader(IReadFile* file) =0;
338 338
339 //! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*). 339 //! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
340 /** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for 340 /** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for
341 more information on how to use the parser. 341 more information on how to use the parser.
342 \return 0, if file could not be opened, otherwise a pointer to the created 342 \return 0, if file could not be opened, otherwise a pointer to the created
343 IXMLReader is returned. After use, the reader 343 IXMLReader is returned. After use, the reader
344 has to be deleted using its IXMLReaderUTF8::drop() method. 344 has to be deleted using its IXMLReaderUTF8::drop() method.
345 See IReferenceCounted::drop() for more information. */ 345 See IReferenceCounted::drop() for more information. */
346 virtual IXMLReaderUTF8* createXMLReaderUTF8(const path& filename) =0; 346 virtual IXMLReaderUTF8* createXMLReaderUTF8(const path& filename) =0;
347 347
348 //! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*). 348 //! Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
349 /** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for 349 /** Use createXMLReader() if you prefer wchar_t* instead of char*. See IIrrXMLReader for
350 more information on how to use the parser. 350 more information on how to use the parser.
351 \return 0, if file could not be opened, otherwise a pointer to the created 351 \return 0, if file could not be opened, otherwise a pointer to the created
352 IXMLReader is returned. After use, the reader 352 IXMLReader is returned. After use, the reader
353 has to be deleted using its IXMLReaderUTF8::drop() method. 353 has to be deleted using its IXMLReaderUTF8::drop() method.
354 See IReferenceCounted::drop() for more information. */ 354 See IReferenceCounted::drop() for more information. */
355 virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) =0; 355 virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) =0;
356 356
357 //! Creates a XML Writer from a file. 357 //! Creates a XML Writer from a file.
358 /** \return 0, if file could not be opened, otherwise a pointer to the created 358 /** \return 0, if file could not be opened, otherwise a pointer to the created
359 IXMLWriter is returned. After use, the reader 359 IXMLWriter is returned. After use, the reader
360 has to be deleted using its IXMLWriter::drop() method. 360 has to be deleted using its IXMLWriter::drop() method.
361 See IReferenceCounted::drop() for more information. */ 361 See IReferenceCounted::drop() for more information. */
362 virtual IXMLWriter* createXMLWriter(const path& filename) =0; 362 virtual IXMLWriter* createXMLWriter(const path& filename) =0;
363 363
364 //! Creates a XML Writer from a file. 364 //! Creates a XML Writer from a file.
365 /** \return 0, if file could not be opened, otherwise a pointer to the created 365 /** \return 0, if file could not be opened, otherwise a pointer to the created
366 IXMLWriter is returned. After use, the reader 366 IXMLWriter is returned. After use, the reader
367 has to be deleted using its IXMLWriter::drop() method. 367 has to be deleted using its IXMLWriter::drop() method.
368 See IReferenceCounted::drop() for more information. */ 368 See IReferenceCounted::drop() for more information. */
369 virtual IXMLWriter* createXMLWriter(IWriteFile* file) =0; 369 virtual IXMLWriter* createXMLWriter(IWriteFile* file) =0;
370 370
371 //! Creates a new empty collection of attributes, usable for serialization and more. 371 //! Creates a new empty collection of attributes, usable for serialization and more.
372 /** \param driver: Video driver to be used to load textures when specified as attribute values. 372 /** \param driver: Video driver to be used to load textures when specified as attribute values.
373 Can be null to prevent automatic texture loading by attributes. 373 Can be null to prevent automatic texture loading by attributes.
374 \return Pointer to the created object. 374 \return Pointer to the created object.
375 If you no longer need the object, you should call IAttributes::drop(). 375 If you no longer need the object, you should call IAttributes::drop().
376 See IReferenceCounted::drop() for more information. */ 376 See IReferenceCounted::drop() for more information. */
377 virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) =0; 377 virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) =0;
378}; 378};
379 379
380 380
381} // end namespace io 381} // end namespace io
382} // end namespace irr 382} // end namespace irr
383 383
384#endif 384#endif
385 385
diff --git a/libraries/irrlicht-1.8/include/IGPUProgrammingServices.h b/libraries/irrlicht-1.8/include/IGPUProgrammingServices.h
index 596f094..28717d5 100644
--- a/libraries/irrlicht-1.8/include/IGPUProgrammingServices.h
+++ b/libraries/irrlicht-1.8/include/IGPUProgrammingServices.h
@@ -1,474 +1,474 @@
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#ifndef __I_GPU_PROGRAMMING_SERVICES_H_INCLUDED__ 5#ifndef __I_GPU_PROGRAMMING_SERVICES_H_INCLUDED__
6#define __I_GPU_PROGRAMMING_SERVICES_H_INCLUDED__ 6#define __I_GPU_PROGRAMMING_SERVICES_H_INCLUDED__
7 7
8#include "EShaderTypes.h" 8#include "EShaderTypes.h"
9#include "EMaterialTypes.h" 9#include "EMaterialTypes.h"
10#include "EPrimitiveTypes.h" 10#include "EPrimitiveTypes.h"
11#include "path.h" 11#include "path.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15 15
16namespace io 16namespace io
17{ 17{
18 class IReadFile; 18 class IReadFile;
19} // end namespace io 19} // end namespace io
20 20
21namespace video 21namespace video
22{ 22{
23 23
24class IVideoDriver; 24class IVideoDriver;
25class IShaderConstantSetCallBack; 25class IShaderConstantSetCallBack;
26 26
27//! Enumeration for different types of shading languages 27//! Enumeration for different types of shading languages
28enum E_GPU_SHADING_LANGUAGE 28enum E_GPU_SHADING_LANGUAGE
29{ 29{
30 //! The default language, so HLSL for Direct3D and GLSL for OpenGL. 30 //! The default language, so HLSL for Direct3D and GLSL for OpenGL.
31 EGSL_DEFAULT = 0, 31 EGSL_DEFAULT = 0,
32 32
33 //! Cg shading language.*/ 33 //! Cg shading language.*/
34 EGSL_CG 34 EGSL_CG
35}; 35};
36 36
37//! Interface making it possible to create and use programs running on the GPU. 37//! Interface making it possible to create and use programs running on the GPU.
38class IGPUProgrammingServices 38class IGPUProgrammingServices
39{ 39{
40public: 40public:
41 41
42 //! Destructor 42 //! Destructor
43 virtual ~IGPUProgrammingServices() {} 43 virtual ~IGPUProgrammingServices() {}
44 44
45 //! Adds a new high-level shading material renderer to the VideoDriver. 45 //! Adds a new high-level shading material renderer to the VideoDriver.
46 /** Currently only HLSL/D3D9 and GLSL/OpenGL are supported. 46 /** Currently only HLSL/D3D9 and GLSL/OpenGL are supported.
47 \param vertexShaderProgram String containing the source of the vertex 47 \param vertexShaderProgram String containing the source of the vertex
48 shader program. This can be 0 if no vertex program shall be used. 48 shader program. This can be 0 if no vertex program shall be used.
49 \param vertexShaderEntryPointName Name of the entry function of the 49 \param vertexShaderEntryPointName Name of the entry function of the
50 vertexShaderProgram (p.e. "main") 50 vertexShaderProgram (p.e. "main")
51 \param vsCompileTarget Vertex shader version the high level shader 51 \param vsCompileTarget Vertex shader version the high level shader
52 shall be compiled to. 52 shall be compiled to.
53 \param pixelShaderProgram String containing the source of the pixel 53 \param pixelShaderProgram String containing the source of the pixel
54 shader program. This can be 0 if no pixel shader shall be used. 54 shader program. This can be 0 if no pixel shader shall be used.
55 \param pixelShaderEntryPointName Entry name of the function of the 55 \param pixelShaderEntryPointName Entry name of the function of the
56 pixelShaderProgram (p.e. "main") 56 pixelShaderProgram (p.e. "main")
57 \param psCompileTarget Pixel shader version the high level shader 57 \param psCompileTarget Pixel shader version the high level shader
58 shall be compiled to. 58 shall be compiled to.
59 \param geometryShaderProgram String containing the source of the 59 \param geometryShaderProgram String containing the source of the
60 geometry shader program. This can be 0 if no geometry shader shall be 60 geometry shader program. This can be 0 if no geometry shader shall be
61 used. 61 used.
62 \param geometryShaderEntryPointName Entry name of the function of the 62 \param geometryShaderEntryPointName Entry name of the function of the
63 geometryShaderProgram (p.e. "main") 63 geometryShaderProgram (p.e. "main")
64 \param gsCompileTarget Geometry shader version the high level shader 64 \param gsCompileTarget Geometry shader version the high level shader
65 shall be compiled to. 65 shall be compiled to.
66 \param inType Type of vertices passed to geometry shader 66 \param inType Type of vertices passed to geometry shader
67 \param outType Type of vertices created by geometry shader 67 \param outType Type of vertices created by geometry shader
68 \param verticesOut Maximal number of vertices created by geometry 68 \param verticesOut Maximal number of vertices created by geometry
69 shader. If 0, maximal number supported is assumed. 69 shader. If 0, maximal number supported is assumed.
70 \param callback Pointer to an implementation of 70 \param callback Pointer to an implementation of
71 IShaderConstantSetCallBack in which you can set the needed vertex, 71 IShaderConstantSetCallBack in which you can set the needed vertex,
72 pixel, and geometry shader program constants. Set this to 0 if you 72 pixel, and geometry shader program constants. Set this to 0 if you
73 don't need this. 73 don't need this.
74 \param baseMaterial Base material which renderstates will be used to 74 \param baseMaterial Base material which renderstates will be used to
75 shade the material. 75 shade the material.
76 \param userData a user data int. This int can be set to any value and 76 \param userData a user data int. This int can be set to any value and
77 will be set as parameter in the callback method when calling 77 will be set as parameter in the callback method when calling
78 OnSetConstants(). In this way it is easily possible to use the same 78 OnSetConstants(). In this way it is easily possible to use the same
79 callback method for multiple materials and distinguish between them 79 callback method for multiple materials and distinguish between them
80 during the call. 80 during the call.
81 \param shaderLang a type of shading language used in current shader. 81 \param shaderLang a type of shading language used in current shader.
82 \return Number of the material type which can be set in 82 \return Number of the material type which can be set in
83 SMaterial::MaterialType to use the renderer. -1 is returned if an error 83 SMaterial::MaterialType to use the renderer. -1 is returned if an error
84 occured, e.g. if a shader program could not be compiled or a compile 84 occured, e.g. if a shader program could not be compiled or a compile
85 target is not reachable. The error strings are then printed to the 85 target is not reachable. The error strings are then printed to the
86 error log and can be catched with a custom event receiver. */ 86 error log and can be catched with a custom event receiver. */
87 virtual s32 addHighLevelShaderMaterial( 87 virtual s32 addHighLevelShaderMaterial(
88 const c8* vertexShaderProgram, 88 const c8* vertexShaderProgram,
89 const c8* vertexShaderEntryPointName, 89 const c8* vertexShaderEntryPointName,
90 E_VERTEX_SHADER_TYPE vsCompileTarget, 90 E_VERTEX_SHADER_TYPE vsCompileTarget,
91 const c8* pixelShaderProgram, 91 const c8* pixelShaderProgram,
92 const c8* pixelShaderEntryPointName, 92 const c8* pixelShaderEntryPointName,
93 E_PIXEL_SHADER_TYPE psCompileTarget, 93 E_PIXEL_SHADER_TYPE psCompileTarget,
94 const c8* geometryShaderProgram, 94 const c8* geometryShaderProgram,
95 const c8* geometryShaderEntryPointName = "main", 95 const c8* geometryShaderEntryPointName = "main",
96 E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0, 96 E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0,
97 scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, 97 scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES,
98 scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, 98 scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP,
99 u32 verticesOut = 0, 99 u32 verticesOut = 0,
100 IShaderConstantSetCallBack* callback = 0, 100 IShaderConstantSetCallBack* callback = 0,
101 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 101 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
102 s32 userData = 0, 102 s32 userData = 0,
103 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) = 0; 103 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) = 0;
104 104
105 //! convenience function for use without geometry shaders 105 //! convenience function for use without geometry shaders
106 s32 addHighLevelShaderMaterial( 106 s32 addHighLevelShaderMaterial(
107 const c8* vertexShaderProgram, 107 const c8* vertexShaderProgram,
108 const c8* vertexShaderEntryPointName="main", 108 const c8* vertexShaderEntryPointName="main",
109 E_VERTEX_SHADER_TYPE vsCompileTarget=EVST_VS_1_1, 109 E_VERTEX_SHADER_TYPE vsCompileTarget=EVST_VS_1_1,
110 const c8* pixelShaderProgram=0, 110 const c8* pixelShaderProgram=0,
111 const c8* pixelShaderEntryPointName="main", 111 const c8* pixelShaderEntryPointName="main",
112 E_PIXEL_SHADER_TYPE psCompileTarget=EPST_PS_1_1, 112 E_PIXEL_SHADER_TYPE psCompileTarget=EPST_PS_1_1,
113 IShaderConstantSetCallBack* callback=0, 113 IShaderConstantSetCallBack* callback=0,
114 E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID, 114 E_MATERIAL_TYPE baseMaterial=video::EMT_SOLID,
115 s32 userData=0, 115 s32 userData=0,
116 E_GPU_SHADING_LANGUAGE shadingLang=EGSL_DEFAULT) 116 E_GPU_SHADING_LANGUAGE shadingLang=EGSL_DEFAULT)
117 { 117 {
118 return addHighLevelShaderMaterial( 118 return addHighLevelShaderMaterial(
119 vertexShaderProgram, vertexShaderEntryPointName, 119 vertexShaderProgram, vertexShaderEntryPointName,
120 vsCompileTarget, pixelShaderProgram, 120 vsCompileTarget, pixelShaderProgram,
121 pixelShaderEntryPointName, psCompileTarget, 121 pixelShaderEntryPointName, psCompileTarget,
122 0, "main", EGST_GS_4_0, 122 0, "main", EGST_GS_4_0,
123 scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0, 123 scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0,
124 callback, baseMaterial, userData, shadingLang); 124 callback, baseMaterial, userData, shadingLang);
125 } 125 }
126 126
127 //! convenience function for use with many defaults, without geometry shader 127 //! convenience function for use with many defaults, without geometry shader
128 /** All shader names are set to "main" and compile targets are shader 128 /** All shader names are set to "main" and compile targets are shader
129 type 1.1. 129 type 1.1.
130 */ 130 */
131 s32 addHighLevelShaderMaterial( 131 s32 addHighLevelShaderMaterial(
132 const c8* vertexShaderProgram, 132 const c8* vertexShaderProgram,
133 const c8* pixelShaderProgram=0, 133 const c8* pixelShaderProgram=0,
134 IShaderConstantSetCallBack* callback=0, 134 IShaderConstantSetCallBack* callback=0,
135 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 135 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
136 s32 userData=0) 136 s32 userData=0)
137 { 137 {
138 return addHighLevelShaderMaterial( 138 return addHighLevelShaderMaterial(
139 vertexShaderProgram, "main", 139 vertexShaderProgram, "main",
140 EVST_VS_1_1, pixelShaderProgram, 140 EVST_VS_1_1, pixelShaderProgram,
141 "main", EPST_PS_1_1, 141 "main", EPST_PS_1_1,
142 0, "main", EGST_GS_4_0, 142 0, "main", EGST_GS_4_0,
143 scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0, 143 scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0,
144 callback, baseMaterial, userData); 144 callback, baseMaterial, userData);
145 } 145 }
146 146
147 //! convenience function for use with many defaults, with geometry shader 147 //! convenience function for use with many defaults, with geometry shader
148 /** All shader names are set to "main" and compile targets are shader 148 /** All shader names are set to "main" and compile targets are shader
149 type 1.1 and geometry shader 4.0. 149 type 1.1 and geometry shader 4.0.
150 */ 150 */
151 s32 addHighLevelShaderMaterial( 151 s32 addHighLevelShaderMaterial(
152 const c8* vertexShaderProgram, 152 const c8* vertexShaderProgram,
153 const c8* pixelShaderProgram = 0, 153 const c8* pixelShaderProgram = 0,
154 const c8* geometryShaderProgram = 0, 154 const c8* geometryShaderProgram = 0,
155 scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, 155 scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES,
156 scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, 156 scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP,
157 u32 verticesOut = 0, 157 u32 verticesOut = 0,
158 IShaderConstantSetCallBack* callback = 0, 158 IShaderConstantSetCallBack* callback = 0,
159 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 159 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
160 s32 userData = 0 ) 160 s32 userData = 0 )
161 { 161 {
162 return addHighLevelShaderMaterial( 162 return addHighLevelShaderMaterial(
163 vertexShaderProgram, "main", 163 vertexShaderProgram, "main",
164 EVST_VS_1_1, pixelShaderProgram, 164 EVST_VS_1_1, pixelShaderProgram,
165 "main", EPST_PS_1_1, 165 "main", EPST_PS_1_1,
166 geometryShaderProgram, "main", EGST_GS_4_0, 166 geometryShaderProgram, "main", EGST_GS_4_0,
167 inType, outType, verticesOut, 167 inType, outType, verticesOut,
168 callback, baseMaterial, userData); 168 callback, baseMaterial, userData);
169 } 169 }
170 170
171 //! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files. 171 //! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
172 /** \param vertexShaderProgramFileName Text file containing the source 172 /** \param vertexShaderProgramFileName Text file containing the source
173 of the vertex shader program. Set to empty string if no vertex shader 173 of the vertex shader program. Set to empty string if no vertex shader
174 shall be created. 174 shall be created.
175 \param vertexShaderEntryPointName Name of the entry function of the 175 \param vertexShaderEntryPointName Name of the entry function of the
176 vertexShaderProgram (p.e. "main") 176 vertexShaderProgram (p.e. "main")
177 \param vsCompileTarget Vertex shader version the high level shader 177 \param vsCompileTarget Vertex shader version the high level shader
178 shall be compiled to. 178 shall be compiled to.
179 \param pixelShaderProgramFileName Text file containing the source of 179 \param pixelShaderProgramFileName Text file containing the source of
180 the pixel shader program. Set to empty string if no pixel shader shall 180 the pixel shader program. Set to empty string if no pixel shader shall
181 be created. 181 be created.
182 \param pixelShaderEntryPointName Entry name of the function of the 182 \param pixelShaderEntryPointName Entry name of the function of the
183 pixelShaderProgram (p.e. "main") 183 pixelShaderProgram (p.e. "main")
184 \param psCompileTarget Pixel shader version the high level shader 184 \param psCompileTarget Pixel shader version the high level shader
185 shall be compiled to. 185 shall be compiled to.
186 \param geometryShaderProgramFileName Name of the source of 186 \param geometryShaderProgramFileName Name of the source of
187 the geometry shader program. Set to empty string if no geometry shader 187 the geometry shader program. Set to empty string if no geometry shader
188 shall be created. 188 shall be created.
189 \param geometryShaderEntryPointName Entry name of the function of the 189 \param geometryShaderEntryPointName Entry name of the function of the
190 geometryShaderProgram (p.e. "main") 190 geometryShaderProgram (p.e. "main")
191 \param gsCompileTarget Geometry shader version the high level shader 191 \param gsCompileTarget Geometry shader version the high level shader
192 shall be compiled to. 192 shall be compiled to.
193 \param inType Type of vertices passed to geometry shader 193 \param inType Type of vertices passed to geometry shader
194 \param outType Type of vertices created by geometry shader 194 \param outType Type of vertices created by geometry shader
195 \param verticesOut Maximal number of vertices created by geometry 195 \param verticesOut Maximal number of vertices created by geometry
196 shader. If 0, maximal number supported is assumed. 196 shader. If 0, maximal number supported is assumed.
197 \param callback Pointer to an implementation of 197 \param callback Pointer to an implementation of
198 IShaderConstantSetCallBack in which you can set the needed vertex, 198 IShaderConstantSetCallBack in which you can set the needed vertex,
199 pixel, and geometry shader program constants. Set this to 0 if you 199 pixel, and geometry shader program constants. Set this to 0 if you
200 don't need this. 200 don't need this.
201 \param baseMaterial Base material which renderstates will be used to 201 \param baseMaterial Base material which renderstates will be used to
202 shade the material. 202 shade the material.
203 \param userData a user data int. This int can be set to any value and 203 \param userData a user data int. This int can be set to any value and
204 will be set as parameter in the callback method when calling 204 will be set as parameter in the callback method when calling
205 OnSetConstants(). In this way it is easily possible to use the same 205 OnSetConstants(). In this way it is easily possible to use the same
206 callback method for multiple materials and distinguish between them 206 callback method for multiple materials and distinguish between them
207 during the call. 207 during the call.
208 \param shaderLang a type of shading language used in current shader. 208 \param shaderLang a type of shading language used in current shader.
209 \return Number of the material type which can be set in 209 \return Number of the material type which can be set in
210 SMaterial::MaterialType to use the renderer. -1 is returned if an error 210 SMaterial::MaterialType to use the renderer. -1 is returned if an error
211 occured, e.g. if a shader program could not be compiled or a compile 211 occured, e.g. if a shader program could not be compiled or a compile
212 target is not reachable. The error strings are then printed to the 212 target is not reachable. The error strings are then printed to the
213 error log and can be catched with a custom event receiver. */ 213 error log and can be catched with a custom event receiver. */
214 virtual s32 addHighLevelShaderMaterialFromFiles( 214 virtual s32 addHighLevelShaderMaterialFromFiles(
215 const io::path& vertexShaderProgramFileName, 215 const io::path& vertexShaderProgramFileName,
216 const c8* vertexShaderEntryPointName, 216 const c8* vertexShaderEntryPointName,
217 E_VERTEX_SHADER_TYPE vsCompileTarget, 217 E_VERTEX_SHADER_TYPE vsCompileTarget,
218 const io::path& pixelShaderProgramFileName, 218 const io::path& pixelShaderProgramFileName,
219 const c8* pixelShaderEntryPointName, 219 const c8* pixelShaderEntryPointName,
220 E_PIXEL_SHADER_TYPE psCompileTarget, 220 E_PIXEL_SHADER_TYPE psCompileTarget,
221 const io::path& geometryShaderProgramFileName, 221 const io::path& geometryShaderProgramFileName,
222 const c8* geometryShaderEntryPointName = "main", 222 const c8* geometryShaderEntryPointName = "main",
223 E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0, 223 E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0,
224 scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, 224 scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES,
225 scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, 225 scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP,
226 u32 verticesOut = 0, 226 u32 verticesOut = 0,
227 IShaderConstantSetCallBack* callback = 0, 227 IShaderConstantSetCallBack* callback = 0,
228 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 228 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
229 s32 userData = 0, 229 s32 userData = 0,
230 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) = 0; 230 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) = 0;
231 231
232 //! convenience function for use without geometry shaders 232 //! convenience function for use without geometry shaders
233 s32 addHighLevelShaderMaterialFromFiles( 233 s32 addHighLevelShaderMaterialFromFiles(
234 const io::path& vertexShaderProgramFileName, 234 const io::path& vertexShaderProgramFileName,
235 const c8* vertexShaderEntryPointName = "main", 235 const c8* vertexShaderEntryPointName = "main",
236 E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1, 236 E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
237 const io::path& pixelShaderProgramFileName = "", 237 const io::path& pixelShaderProgramFileName = "",
238 const c8* pixelShaderEntryPointName = "main", 238 const c8* pixelShaderEntryPointName = "main",
239 E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1, 239 E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
240 IShaderConstantSetCallBack* callback = 0, 240 IShaderConstantSetCallBack* callback = 0,
241 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 241 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
242 s32 userData = 0, 242 s32 userData = 0,
243 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) 243 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT)
244 { 244 {
245 return addHighLevelShaderMaterialFromFiles( 245 return addHighLevelShaderMaterialFromFiles(
246 vertexShaderProgramFileName, vertexShaderEntryPointName, 246 vertexShaderProgramFileName, vertexShaderEntryPointName,
247 vsCompileTarget, pixelShaderProgramFileName, 247 vsCompileTarget, pixelShaderProgramFileName,
248 pixelShaderEntryPointName, psCompileTarget, 248 pixelShaderEntryPointName, psCompileTarget,
249 "", "main", EGST_GS_4_0, 249 "", "main", EGST_GS_4_0,
250 scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0, 250 scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0,
251 callback, baseMaterial, userData, shadingLang); 251 callback, baseMaterial, userData, shadingLang);
252 } 252 }
253 253
254 //! convenience function for use with many defaults, without geometry shader 254 //! convenience function for use with many defaults, without geometry shader
255 /** All shader names are set to "main" and compile targets are shader 255 /** All shader names are set to "main" and compile targets are shader
256 type 1.1. 256 type 1.1.
257 */ 257 */
258 s32 addHighLevelShaderMaterialFromFiles( 258 s32 addHighLevelShaderMaterialFromFiles(
259 const io::path& vertexShaderProgramFileName, 259 const io::path& vertexShaderProgramFileName,
260 const io::path& pixelShaderProgramFileName = "", 260 const io::path& pixelShaderProgramFileName = "",
261 IShaderConstantSetCallBack* callback = 0, 261 IShaderConstantSetCallBack* callback = 0,
262 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 262 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
263 s32 userData = 0 ) 263 s32 userData = 0 )
264 { 264 {
265 return addHighLevelShaderMaterialFromFiles( 265 return addHighLevelShaderMaterialFromFiles(
266 vertexShaderProgramFileName, "main", 266 vertexShaderProgramFileName, "main",
267 EVST_VS_1_1, pixelShaderProgramFileName, 267 EVST_VS_1_1, pixelShaderProgramFileName,
268 "main", EPST_PS_1_1, 268 "main", EPST_PS_1_1,
269 "", "main", EGST_GS_4_0, 269 "", "main", EGST_GS_4_0,
270 scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0, 270 scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0,
271 callback, baseMaterial, userData); 271 callback, baseMaterial, userData);
272 } 272 }
273 273
274 //! convenience function for use with many defaults, with geometry shader 274 //! convenience function for use with many defaults, with geometry shader
275 /** All shader names are set to "main" and compile targets are shader 275 /** All shader names are set to "main" and compile targets are shader
276 type 1.1 and geometry shader 4.0. 276 type 1.1 and geometry shader 4.0.
277 */ 277 */
278 s32 addHighLevelShaderMaterialFromFiles( 278 s32 addHighLevelShaderMaterialFromFiles(
279 const io::path& vertexShaderProgramFileName, 279 const io::path& vertexShaderProgramFileName,
280 const io::path& pixelShaderProgramFileName = "", 280 const io::path& pixelShaderProgramFileName = "",
281 const io::path& geometryShaderProgramFileName = "", 281 const io::path& geometryShaderProgramFileName = "",
282 scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, 282 scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES,
283 scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, 283 scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP,
284 u32 verticesOut = 0, 284 u32 verticesOut = 0,
285 IShaderConstantSetCallBack* callback = 0, 285 IShaderConstantSetCallBack* callback = 0,
286 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 286 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
287 s32 userData = 0 ) 287 s32 userData = 0 )
288 { 288 {
289 return addHighLevelShaderMaterialFromFiles( 289 return addHighLevelShaderMaterialFromFiles(
290 vertexShaderProgramFileName, "main", 290 vertexShaderProgramFileName, "main",
291 EVST_VS_1_1, pixelShaderProgramFileName, 291 EVST_VS_1_1, pixelShaderProgramFileName,
292 "main", EPST_PS_1_1, 292 "main", EPST_PS_1_1,
293 geometryShaderProgramFileName, "main", EGST_GS_4_0, 293 geometryShaderProgramFileName, "main", EGST_GS_4_0,
294 inType, outType, verticesOut, 294 inType, outType, verticesOut,
295 callback, baseMaterial, userData); 295 callback, baseMaterial, userData);
296 } 296 }
297 297
298 //! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files. 298 //! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
299 /** \param vertexShaderProgram Text file handle containing the source 299 /** \param vertexShaderProgram Text file handle containing the source
300 of the vertex shader program. Set to 0 if no vertex shader shall be 300 of the vertex shader program. Set to 0 if no vertex shader shall be
301 created. 301 created.
302 \param vertexShaderEntryPointName Name of the entry function of the 302 \param vertexShaderEntryPointName Name of the entry function of the
303 vertexShaderProgram 303 vertexShaderProgram
304 \param vsCompileTarget Vertex shader version the high level shader 304 \param vsCompileTarget Vertex shader version the high level shader
305 shall be compiled to. 305 shall be compiled to.
306 \param pixelShaderProgram Text file handle containing the source of 306 \param pixelShaderProgram Text file handle containing the source of
307 the pixel shader program. Set to 0 if no pixel shader shall be created. 307 the pixel shader program. Set to 0 if no pixel shader shall be created.
308 \param pixelShaderEntryPointName Entry name of the function of the 308 \param pixelShaderEntryPointName Entry name of the function of the
309 pixelShaderProgram (p.e. "main") 309 pixelShaderProgram (p.e. "main")
310 \param psCompileTarget Pixel shader version the high level shader 310 \param psCompileTarget Pixel shader version the high level shader
311 shall be compiled to. 311 shall be compiled to.
312 \param geometryShaderProgram Text file handle containing the source of 312 \param geometryShaderProgram Text file handle containing the source of
313 the geometry shader program. Set to 0 if no geometry shader shall be 313 the geometry shader program. Set to 0 if no geometry shader shall be
314 created. 314 created.
315 \param geometryShaderEntryPointName Entry name of the function of the 315 \param geometryShaderEntryPointName Entry name of the function of the
316 geometryShaderProgram (p.e. "main") 316 geometryShaderProgram (p.e. "main")
317 \param gsCompileTarget Geometry shader version the high level shader 317 \param gsCompileTarget Geometry shader version the high level shader
318 shall be compiled to. 318 shall be compiled to.
319 \param inType Type of vertices passed to geometry shader 319 \param inType Type of vertices passed to geometry shader
320 \param outType Type of vertices created by geometry shader 320 \param outType Type of vertices created by geometry shader
321 \param verticesOut Maximal number of vertices created by geometry 321 \param verticesOut Maximal number of vertices created by geometry
322 shader. If 0, maximal number supported is assumed. 322 shader. If 0, maximal number supported is assumed.
323 \param callback Pointer to an implementation of 323 \param callback Pointer to an implementation of
324 IShaderConstantSetCallBack in which you can set the needed vertex and 324 IShaderConstantSetCallBack in which you can set the needed vertex and
325 pixel shader program constants. Set this to 0 if you don't need this. 325 pixel shader program constants. Set this to 0 if you don't need this.
326 \param baseMaterial Base material which renderstates will be used to 326 \param baseMaterial Base material which renderstates will be used to
327 shade the material. 327 shade the material.
328 \param userData a user data int. This int can be set to any value and 328 \param userData a user data int. This int can be set to any value and
329 will be set as parameter in the callback method when calling 329 will be set as parameter in the callback method when calling
330 OnSetConstants(). In this way it is easily possible to use the same 330 OnSetConstants(). In this way it is easily possible to use the same
331 callback method for multiple materials and distinguish between them 331 callback method for multiple materials and distinguish between them
332 during the call. 332 during the call.
333 \param shaderLang a type of shading language used in current shader. 333 \param shaderLang a type of shading language used in current shader.
334 \return Number of the material type which can be set in 334 \return Number of the material type which can be set in
335 SMaterial::MaterialType to use the renderer. -1 is returned if an 335 SMaterial::MaterialType to use the renderer. -1 is returned if an
336 error occured, e.g. if a shader program could not be compiled or a 336 error occured, e.g. if a shader program could not be compiled or a
337 compile target is not reachable. The error strings are then printed to 337 compile target is not reachable. The error strings are then printed to
338 the error log and can be catched with a custom event receiver. */ 338 the error log and can be catched with a custom event receiver. */
339 virtual s32 addHighLevelShaderMaterialFromFiles( 339 virtual s32 addHighLevelShaderMaterialFromFiles(
340 io::IReadFile* vertexShaderProgram, 340 io::IReadFile* vertexShaderProgram,
341 const c8* vertexShaderEntryPointName, 341 const c8* vertexShaderEntryPointName,
342 E_VERTEX_SHADER_TYPE vsCompileTarget, 342 E_VERTEX_SHADER_TYPE vsCompileTarget,
343 io::IReadFile* pixelShaderProgram, 343 io::IReadFile* pixelShaderProgram,
344 const c8* pixelShaderEntryPointName, 344 const c8* pixelShaderEntryPointName,
345 E_PIXEL_SHADER_TYPE psCompileTarget, 345 E_PIXEL_SHADER_TYPE psCompileTarget,
346 io::IReadFile* geometryShaderProgram, 346 io::IReadFile* geometryShaderProgram,
347 const c8* geometryShaderEntryPointName = "main", 347 const c8* geometryShaderEntryPointName = "main",
348 E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0, 348 E_GEOMETRY_SHADER_TYPE gsCompileTarget = EGST_GS_4_0,
349 scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, 349 scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES,
350 scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, 350 scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP,
351 u32 verticesOut = 0, 351 u32 verticesOut = 0,
352 IShaderConstantSetCallBack* callback = 0, 352 IShaderConstantSetCallBack* callback = 0,
353 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 353 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
354 s32 userData = 0, 354 s32 userData = 0,
355 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) = 0; 355 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) = 0;
356 356
357 //! convenience function for use without geometry shaders 357 //! convenience function for use without geometry shaders
358 s32 addHighLevelShaderMaterialFromFiles( 358 s32 addHighLevelShaderMaterialFromFiles(
359 io::IReadFile* vertexShaderProgram, 359 io::IReadFile* vertexShaderProgram,
360 const c8* vertexShaderEntryPointName = "main", 360 const c8* vertexShaderEntryPointName = "main",
361 E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1, 361 E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
362 io::IReadFile* pixelShaderProgram = 0, 362 io::IReadFile* pixelShaderProgram = 0,
363 const c8* pixelShaderEntryPointName = "main", 363 const c8* pixelShaderEntryPointName = "main",
364 E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1, 364 E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
365 IShaderConstantSetCallBack* callback = 0, 365 IShaderConstantSetCallBack* callback = 0,
366 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 366 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
367 s32 userData = 0, 367 s32 userData = 0,
368 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT) 368 E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT)
369 { 369 {
370 return addHighLevelShaderMaterialFromFiles( 370 return addHighLevelShaderMaterialFromFiles(
371 vertexShaderProgram, vertexShaderEntryPointName, 371 vertexShaderProgram, vertexShaderEntryPointName,
372 vsCompileTarget, pixelShaderProgram, 372 vsCompileTarget, pixelShaderProgram,
373 pixelShaderEntryPointName, psCompileTarget, 373 pixelShaderEntryPointName, psCompileTarget,
374 0, "main", EGST_GS_4_0, 374 0, "main", EGST_GS_4_0,
375 scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0, 375 scene::EPT_TRIANGLES, scene::EPT_TRIANGLE_STRIP, 0,
376 callback, baseMaterial, userData, shadingLang); 376 callback, baseMaterial, userData, shadingLang);
377 } 377 }
378 378
379 //! Adds a new ASM shader material renderer to the VideoDriver 379 //! Adds a new ASM shader material renderer to the VideoDriver
380 /** Note that it is a good idea to call IVideoDriver::queryFeature() in 380 /** Note that it is a good idea to call IVideoDriver::queryFeature() in
381 advance to check if the IVideoDriver supports the vertex and/or pixel 381 advance to check if the IVideoDriver supports the vertex and/or pixel
382 shader version your are using. 382 shader version your are using.
383 383
384 The material is added to the VideoDriver like with 384 The material is added to the VideoDriver like with
385 IVideoDriver::addMaterialRenderer() and can be used like it had been 385 IVideoDriver::addMaterialRenderer() and can be used like it had been
386 added with that method. 386 added with that method.
387 \param vertexShaderProgram String containing the source of the vertex 387 \param vertexShaderProgram String containing the source of the vertex
388 shader program. This can be 0 if no vertex program shall be used. 388 shader program. This can be 0 if no vertex program shall be used.
389 389
390 For DX8 programs, the will always input registers look like this: v0: 390 For DX8 programs, the will always input registers look like this: v0:
391 position, v1: normal, v2: color, v3: texture cooridnates, v4: texture 391 position, v1: normal, v2: color, v3: texture cooridnates, v4: texture
392 coordinates 2 if available. 392 coordinates 2 if available.
393 393
394 For DX9 programs, you can manually set the registers using the dcl_ 394 For DX9 programs, you can manually set the registers using the dcl_
395 statements. 395 statements.
396 \param pixelShaderProgram String containing the source of the pixel 396 \param pixelShaderProgram String containing the source of the pixel
397 shader program. This can be 0 if you don't want to use a pixel shader. 397 shader program. This can be 0 if you don't want to use a pixel shader.
398 \param callback Pointer to an implementation of 398 \param callback Pointer to an implementation of
399 IShaderConstantSetCallBack in which you can set the needed vertex and 399 IShaderConstantSetCallBack in which you can set the needed vertex and
400 pixel shader program constants. Set this to 0 if you don't need this. 400 pixel shader program constants. Set this to 0 if you don't need this.
401 \param baseMaterial Base material which renderstates will be used to 401 \param baseMaterial Base material which renderstates will be used to
402 shade the material. 402 shade the material.
403 \param userData a user data int. This int can be set to any value and 403 \param userData a user data int. This int can be set to any value and
404 will be set as parameter in the callback method when calling 404 will be set as parameter in the callback method when calling
405 OnSetConstants(). In this way it is easily possible to use the same 405 OnSetConstants(). In this way it is easily possible to use the same
406 callback method for multiple materials and distinguish between them 406 callback method for multiple materials and distinguish between them
407 during the call. 407 during the call.
408 \return Returns the number of the material type which can be set in 408 \return Returns the number of the material type which can be set in
409 SMaterial::MaterialType to use the renderer. -1 is returned if an 409 SMaterial::MaterialType to use the renderer. -1 is returned if an
410 error occured. -1 is returned for example if a vertex or pixel shader 410 error occured. -1 is returned for example if a vertex or pixel shader
411 program could not be compiled, the error strings are then printed out 411 program could not be compiled, the error strings are then printed out
412 into the error log, and can be catched with a custom event receiver. */ 412 into the error log, and can be catched with a custom event receiver. */
413 virtual s32 addShaderMaterial(const c8* vertexShaderProgram = 0, 413 virtual s32 addShaderMaterial(const c8* vertexShaderProgram = 0,
414 const c8* pixelShaderProgram = 0, 414 const c8* pixelShaderProgram = 0,
415 IShaderConstantSetCallBack* callback = 0, 415 IShaderConstantSetCallBack* callback = 0,
416 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 416 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
417 s32 userData = 0) = 0; 417 s32 userData = 0) = 0;
418 418
419 //! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files. 419 //! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
420 /** \param vertexShaderProgram Text file containing the source of the 420 /** \param vertexShaderProgram Text file containing the source of the
421 vertex shader program. Set to 0 if no shader shall be created. 421 vertex shader program. Set to 0 if no shader shall be created.
422 \param pixelShaderProgram Text file containing the source of the pixel 422 \param pixelShaderProgram Text file containing the source of the pixel
423 shader program. Set to 0 if no shader shall be created. 423 shader program. Set to 0 if no shader shall be created.
424 \param callback Pointer to an IShaderConstantSetCallback object to 424 \param callback Pointer to an IShaderConstantSetCallback object to
425 which the OnSetConstants function is called. 425 which the OnSetConstants function is called.
426 \param baseMaterial baseMaterial 426 \param baseMaterial baseMaterial
427 \param userData a user data int. This int can be set to any value and 427 \param userData a user data int. This int can be set to any value and
428 will be set as parameter in the callback method when calling 428 will be set as parameter in the callback method when calling
429 OnSetConstants(). In this way it is easily possible to use the same 429 OnSetConstants(). In this way it is easily possible to use the same
430 callback method for multiple materials and distinguish between them 430 callback method for multiple materials and distinguish between them
431 during the call. 431 during the call.
432 \return Returns the number of the material type which can be set in 432 \return Returns the number of the material type which can be set in
433 SMaterial::MaterialType to use the renderer. -1 is returned if an 433 SMaterial::MaterialType to use the renderer. -1 is returned if an
434 error occured. -1 is returned for example if a vertex or pixel shader 434 error occured. -1 is returned for example if a vertex or pixel shader
435 program could not be compiled, the error strings are then printed out 435 program could not be compiled, the error strings are then printed out
436 into the error log, and can be catched with a custom event receiver. */ 436 into the error log, and can be catched with a custom event receiver. */
437 virtual s32 addShaderMaterialFromFiles(io::IReadFile* vertexShaderProgram, 437 virtual s32 addShaderMaterialFromFiles(io::IReadFile* vertexShaderProgram,
438 io::IReadFile* pixelShaderProgram, 438 io::IReadFile* pixelShaderProgram,
439 IShaderConstantSetCallBack* callback = 0, 439 IShaderConstantSetCallBack* callback = 0,
440 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 440 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
441 s32 userData = 0) = 0; 441 s32 userData = 0) = 0;
442 442
443 //! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files. 443 //! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
444 /** \param vertexShaderProgramFileName Text file name containing the 444 /** \param vertexShaderProgramFileName Text file name containing the
445 source of the vertex shader program. Set to 0 if no shader shall be 445 source of the vertex shader program. Set to 0 if no shader shall be
446 created. 446 created.
447 \param pixelShaderProgramFileName Text file name containing the source 447 \param pixelShaderProgramFileName Text file name containing the source
448 of the pixel shader program. Set to 0 if no shader shall be created. 448 of the pixel shader program. Set to 0 if no shader shall be created.
449 \param callback Pointer to an IShaderConstantSetCallback object on 449 \param callback Pointer to an IShaderConstantSetCallback object on
450 which the OnSetConstants function is called. 450 which the OnSetConstants function is called.
451 \param baseMaterial baseMaterial 451 \param baseMaterial baseMaterial
452 \param userData a user data int. This int can be set to any value and 452 \param userData a user data int. This int can be set to any value and
453 will be set as parameter in the callback method when calling 453 will be set as parameter in the callback method when calling
454 OnSetConstants(). In this way it is easily possible to use the same 454 OnSetConstants(). In this way it is easily possible to use the same
455 callback method for multiple materials and distinguish between them 455 callback method for multiple materials and distinguish between them
456 during the call. 456 during the call.
457 \return Returns the number of the material type which can be set in 457 \return Returns the number of the material type which can be set in
458 SMaterial::MaterialType to use the renderer. -1 is returned if an 458 SMaterial::MaterialType to use the renderer. -1 is returned if an
459 error occured. -1 is returned for example if a vertex or pixel shader 459 error occured. -1 is returned for example if a vertex or pixel shader
460 program could not be compiled, the error strings are then printed out 460 program could not be compiled, the error strings are then printed out
461 into the error log, and can be catched with a custom event receiver. */ 461 into the error log, and can be catched with a custom event receiver. */
462 virtual s32 addShaderMaterialFromFiles(const io::path& vertexShaderProgramFileName, 462 virtual s32 addShaderMaterialFromFiles(const io::path& vertexShaderProgramFileName,
463 const io::path& pixelShaderProgramFileName, 463 const io::path& pixelShaderProgramFileName,
464 IShaderConstantSetCallBack* callback = 0, 464 IShaderConstantSetCallBack* callback = 0,
465 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, 465 E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
466 s32 userData = 0) = 0; 466 s32 userData = 0) = 0;
467}; 467};
468 468
469 469
470} // end namespace video 470} // end namespace video
471} // end namespace irr 471} // end namespace irr
472 472
473#endif 473#endif
474 474
diff --git a/libraries/irrlicht-1.8/include/IGUIButton.h b/libraries/irrlicht-1.8/include/IGUIButton.h
index 1da880e..cc0ada1 100644
--- a/libraries/irrlicht-1.8/include/IGUIButton.h
+++ b/libraries/irrlicht-1.8/include/IGUIButton.h
@@ -1,151 +1,151 @@
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#ifndef __I_GUI_BUTTON_H_INCLUDED__ 5#ifndef __I_GUI_BUTTON_H_INCLUDED__
6#define __I_GUI_BUTTON_H_INCLUDED__ 6#define __I_GUI_BUTTON_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12 12
13namespace video 13namespace video
14{ 14{
15 class ITexture; 15 class ITexture;
16} // end namespace video 16} // end namespace video
17 17
18namespace gui 18namespace gui
19{ 19{
20 class IGUIFont; 20 class IGUIFont;
21 class IGUISpriteBank; 21 class IGUISpriteBank;
22 22
23 enum EGUI_BUTTON_STATE 23 enum EGUI_BUTTON_STATE
24 { 24 {
25 //! The button is not pressed 25 //! The button is not pressed
26 EGBS_BUTTON_UP=0, 26 EGBS_BUTTON_UP=0,
27 //! The button is currently pressed down 27 //! The button is currently pressed down
28 EGBS_BUTTON_DOWN, 28 EGBS_BUTTON_DOWN,
29 //! The mouse cursor is over the button 29 //! The mouse cursor is over the button
30 EGBS_BUTTON_MOUSE_OVER, 30 EGBS_BUTTON_MOUSE_OVER,
31 //! The mouse cursor is not over the button 31 //! The mouse cursor is not over the button
32 EGBS_BUTTON_MOUSE_OFF, 32 EGBS_BUTTON_MOUSE_OFF,
33 //! The button has the focus 33 //! The button has the focus
34 EGBS_BUTTON_FOCUSED, 34 EGBS_BUTTON_FOCUSED,
35 //! The button doesn't have the focus 35 //! The button doesn't have the focus
36 EGBS_BUTTON_NOT_FOCUSED, 36 EGBS_BUTTON_NOT_FOCUSED,
37 //! not used, counts the number of enumerated items 37 //! not used, counts the number of enumerated items
38 EGBS_COUNT 38 EGBS_COUNT
39 }; 39 };
40 40
41 //! Names for gui button state icons 41 //! Names for gui button state icons
42 const c8* const GUIButtonStateNames[] = 42 const c8* const GUIButtonStateNames[] =
43 { 43 {
44 "buttonUp", 44 "buttonUp",
45 "buttonDown", 45 "buttonDown",
46 "buttonMouseOver", 46 "buttonMouseOver",
47 "buttonMouseOff", 47 "buttonMouseOff",
48 "buttonFocused", 48 "buttonFocused",
49 "buttonNotFocused", 49 "buttonNotFocused",
50 0, 50 0,
51 0, 51 0,
52 }; 52 };
53 53
54 //! GUI Button interface. 54 //! GUI Button interface.
55 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 55 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
56 \li EGET_BUTTON_CLICKED 56 \li EGET_BUTTON_CLICKED
57 */ 57 */
58 class IGUIButton : public IGUIElement 58 class IGUIButton : public IGUIElement
59 { 59 {
60 public: 60 public:
61 61
62 //! constructor 62 //! constructor
63 IGUIButton(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 63 IGUIButton(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
64 : IGUIElement(EGUIET_BUTTON, environment, parent, id, rectangle) {} 64 : IGUIElement(EGUIET_BUTTON, environment, parent, id, rectangle) {}
65 65
66 //! Sets another skin independent font. 66 //! Sets another skin independent font.
67 /** If this is set to zero, the button uses the font of the skin. 67 /** If this is set to zero, the button uses the font of the skin.
68 \param font: New font to set. */ 68 \param font: New font to set. */
69 virtual void setOverrideFont(IGUIFont* font=0) = 0; 69 virtual void setOverrideFont(IGUIFont* font=0) = 0;
70 70
71 //! Gets the override font (if any) 71 //! Gets the override font (if any)
72 /** \return The override font (may be 0) */ 72 /** \return The override font (may be 0) */
73 virtual IGUIFont* getOverrideFont(void) const = 0; 73 virtual IGUIFont* getOverrideFont(void) const = 0;
74 74
75 //! Get the font which is used right now for drawing 75 //! Get the font which is used right now for drawing
76 /** Currently this is the override font when one is set and the 76 /** Currently this is the override font when one is set and the
77 font of the active skin otherwise */ 77 font of the active skin otherwise */
78 virtual IGUIFont* getActiveFont() const = 0; 78 virtual IGUIFont* getActiveFont() const = 0;
79 79
80 //! Sets an image which should be displayed on the button when it is in normal state. 80 //! Sets an image which should be displayed on the button when it is in normal state.
81 /** \param image: Image to be displayed */ 81 /** \param image: Image to be displayed */
82 virtual void setImage(video::ITexture* image=0) = 0; 82 virtual void setImage(video::ITexture* image=0) = 0;
83 83
84 //! Sets a background image for the button when it is in normal state. 84 //! Sets a background image for the button when it is in normal state.
85 /** \param image: Texture containing the image to be displayed 85 /** \param image: Texture containing the image to be displayed
86 \param pos: Position in the texture, where the image is located */ 86 \param pos: Position in the texture, where the image is located */
87 virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0; 87 virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
88 88
89 //! Sets a background image for the button when it is in pressed state. 89 //! Sets a background image for the button when it is in pressed state.
90 /** If no images is specified for the pressed state via 90 /** If no images is specified for the pressed state via
91 setPressedImage(), this image is also drawn in pressed state. 91 setPressedImage(), this image is also drawn in pressed state.
92 \param image: Image to be displayed */ 92 \param image: Image to be displayed */
93 virtual void setPressedImage(video::ITexture* image=0) = 0; 93 virtual void setPressedImage(video::ITexture* image=0) = 0;
94 94
95 //! Sets an image which should be displayed on the button when it is in pressed state. 95 //! Sets an image which should be displayed on the button when it is in pressed state.
96 /** \param image: Texture containing the image to be displayed 96 /** \param image: Texture containing the image to be displayed
97 \param pos: Position in the texture, where the image is located */ 97 \param pos: Position in the texture, where the image is located */
98 virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0; 98 virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
99 99
100 //! Sets the sprite bank used by the button 100 //! Sets the sprite bank used by the button
101 virtual void setSpriteBank(IGUISpriteBank* bank=0) = 0; 101 virtual void setSpriteBank(IGUISpriteBank* bank=0) = 0;
102 102
103 //! Sets the animated sprite for a specific button state 103 //! Sets the animated sprite for a specific button state
104 /** \param index: Number of the sprite within the sprite bank, use -1 for no sprite 104 /** \param index: Number of the sprite within the sprite bank, use -1 for no sprite
105 \param state: State of the button to set the sprite for 105 \param state: State of the button to set the sprite for
106 \param index: The sprite number from the current sprite bank 106 \param index: The sprite number from the current sprite bank
107 \param color: The color of the sprite 107 \param color: The color of the sprite
108 \param loop: True if the animation should loop, false if not 108 \param loop: True if the animation should loop, false if not
109 */ 109 */
110 virtual void setSprite(EGUI_BUTTON_STATE state, s32 index, 110 virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
111 video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0; 111 video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0;
112 112
113 //! Sets if the button should behave like a push button. 113 //! Sets if the button should behave like a push button.
114 /** Which means it can be in two states: Normal or Pressed. With a click on the button, 114 /** Which means it can be in two states: Normal or Pressed. With a click on the button,
115 the user can change the state of the button. */ 115 the user can change the state of the button. */
116 virtual void setIsPushButton(bool isPushButton=true) = 0; 116 virtual void setIsPushButton(bool isPushButton=true) = 0;
117 117
118 //! Sets the pressed state of the button if this is a pushbutton 118 //! Sets the pressed state of the button if this is a pushbutton
119 virtual void setPressed(bool pressed=true) = 0; 119 virtual void setPressed(bool pressed=true) = 0;
120 120
121 //! Returns if the button is currently pressed 121 //! Returns if the button is currently pressed
122 virtual bool isPressed() const = 0; 122 virtual bool isPressed() const = 0;
123 123
124 //! Sets if the alpha channel should be used for drawing background images on the button (default is false) 124 //! Sets if the alpha channel should be used for drawing background images on the button (default is false)
125 virtual void setUseAlphaChannel(bool useAlphaChannel=true) = 0; 125 virtual void setUseAlphaChannel(bool useAlphaChannel=true) = 0;
126 126
127 //! Returns if the alpha channel should be used for drawing background images on the button 127 //! Returns if the alpha channel should be used for drawing background images on the button
128 virtual bool isAlphaChannelUsed() const = 0; 128 virtual bool isAlphaChannelUsed() const = 0;
129 129
130 //! Returns whether the button is a push button 130 //! Returns whether the button is a push button
131 virtual bool isPushButton() const = 0; 131 virtual bool isPushButton() const = 0;
132 132
133 //! Sets if the button should use the skin to draw its border and button face (default is true) 133 //! Sets if the button should use the skin to draw its border and button face (default is true)
134 virtual void setDrawBorder(bool border=true) = 0; 134 virtual void setDrawBorder(bool border=true) = 0;
135 135
136 //! Returns if the border and button face are being drawn using the skin 136 //! Returns if the border and button face are being drawn using the skin
137 virtual bool isDrawingBorder() const = 0; 137 virtual bool isDrawingBorder() const = 0;
138 138
139 //! Sets if the button should scale the button images to fit 139 //! Sets if the button should scale the button images to fit
140 virtual void setScaleImage(bool scaleImage=true) = 0; 140 virtual void setScaleImage(bool scaleImage=true) = 0;
141 141
142 //! Checks whether the button scales the used images 142 //! Checks whether the button scales the used images
143 virtual bool isScalingImage() const = 0; 143 virtual bool isScalingImage() const = 0;
144 }; 144 };
145 145
146 146
147} // end namespace gui 147} // end namespace gui
148} // end namespace irr 148} // end namespace irr
149 149
150#endif 150#endif
151 151
diff --git a/libraries/irrlicht-1.8/include/IGUICheckBox.h b/libraries/irrlicht-1.8/include/IGUICheckBox.h
index 5dec952..d965ef6 100644
--- a/libraries/irrlicht-1.8/include/IGUICheckBox.h
+++ b/libraries/irrlicht-1.8/include/IGUICheckBox.h
@@ -1,38 +1,38 @@
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#ifndef __I_GUI_CHECKBOX_H_INCLUDED__ 5#ifndef __I_GUI_CHECKBOX_H_INCLUDED__
6#define __I_GUI_CHECKBOX_H_INCLUDED__ 6#define __I_GUI_CHECKBOX_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace gui 12namespace gui
13{ 13{
14 14
15 //! GUI Check box interface. 15 //! GUI Check box interface.
16 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 16 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
17 \li EGET_CHECKBOX_CHANGED 17 \li EGET_CHECKBOX_CHANGED
18 */ 18 */
19 class IGUICheckBox : public IGUIElement 19 class IGUICheckBox : public IGUIElement
20 { 20 {
21 public: 21 public:
22 22
23 //! constructor 23 //! constructor
24 IGUICheckBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 24 IGUICheckBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
25 : IGUIElement(EGUIET_CHECK_BOX, environment, parent, id, rectangle) {} 25 : IGUIElement(EGUIET_CHECK_BOX, environment, parent, id, rectangle) {}
26 26
27 //! Set if box is checked. 27 //! Set if box is checked.
28 virtual void setChecked(bool checked) = 0; 28 virtual void setChecked(bool checked) = 0;
29 29
30 //! Returns true if box is checked. 30 //! Returns true if box is checked.
31 virtual bool isChecked() const = 0; 31 virtual bool isChecked() const = 0;
32 }; 32 };
33 33
34} // end namespace gui 34} // end namespace gui
35} // end namespace irr 35} // end namespace irr
36 36
37#endif 37#endif
38 38
diff --git a/libraries/irrlicht-1.8/include/IGUIColorSelectDialog.h b/libraries/irrlicht-1.8/include/IGUIColorSelectDialog.h
index 3d0357b..0788dbc 100644
--- a/libraries/irrlicht-1.8/include/IGUIColorSelectDialog.h
+++ b/libraries/irrlicht-1.8/include/IGUIColorSelectDialog.h
@@ -1,30 +1,30 @@
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#ifndef __I_GUI_COLOR_SELECT_DIALOG_H_INCLUDED__ 5#ifndef __I_GUI_COLOR_SELECT_DIALOG_H_INCLUDED__
6#define __I_GUI_COLOR_SELECT_DIALOG_H_INCLUDED__ 6#define __I_GUI_COLOR_SELECT_DIALOG_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace gui 12namespace gui
13{ 13{
14 14
15 //! Standard color chooser dialog. 15 //! Standard color chooser dialog.
16 class IGUIColorSelectDialog : public IGUIElement 16 class IGUIColorSelectDialog : public IGUIElement
17 { 17 {
18 public: 18 public:
19 19
20 //! constructor 20 //! constructor
21 IGUIColorSelectDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 21 IGUIColorSelectDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
22 : IGUIElement(EGUIET_COLOR_SELECT_DIALOG, environment, parent, id, rectangle) {} 22 : IGUIElement(EGUIET_COLOR_SELECT_DIALOG, environment, parent, id, rectangle) {}
23 }; 23 };
24 24
25 25
26} // end namespace gui 26} // end namespace gui
27} // end namespace irr 27} // end namespace irr
28 28
29#endif 29#endif
30 30
diff --git a/libraries/irrlicht-1.8/include/IGUIComboBox.h b/libraries/irrlicht-1.8/include/IGUIComboBox.h
index 72c4187..ebee1ec 100644
--- a/libraries/irrlicht-1.8/include/IGUIComboBox.h
+++ b/libraries/irrlicht-1.8/include/IGUIComboBox.h
@@ -1,74 +1,74 @@
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#ifndef __I_GUI_COMBO_BOX_H_INCLUDED__ 5#ifndef __I_GUI_COMBO_BOX_H_INCLUDED__
6#define __I_GUI_COMBO_BOX_H_INCLUDED__ 6#define __I_GUI_COMBO_BOX_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace gui 12namespace gui
13{ 13{
14 14
15 //! Combobox widget 15 //! Combobox widget
16 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 16 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
17 \li EGET_COMBO_BOX_CHANGED 17 \li EGET_COMBO_BOX_CHANGED
18 */ 18 */
19 class IGUIComboBox : public IGUIElement 19 class IGUIComboBox : public IGUIElement
20 { 20 {
21 public: 21 public:
22 22
23 //! constructor 23 //! constructor
24 IGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 24 IGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
25 : IGUIElement(EGUIET_COMBO_BOX, environment, parent, id, rectangle) {} 25 : IGUIElement(EGUIET_COMBO_BOX, environment, parent, id, rectangle) {}
26 26
27 //! Returns amount of items in box 27 //! Returns amount of items in box
28 virtual u32 getItemCount() const = 0; 28 virtual u32 getItemCount() const = 0;
29 29
30 //! Returns string of an item. the idx may be a value from 0 to itemCount-1 30 //! Returns string of an item. the idx may be a value from 0 to itemCount-1
31 virtual const wchar_t* getItem(u32 idx) const = 0; 31 virtual const wchar_t* getItem(u32 idx) const = 0;
32 32
33 //! Returns item data of an item. the idx may be a value from 0 to itemCount-1 33 //! Returns item data of an item. the idx may be a value from 0 to itemCount-1
34 virtual u32 getItemData(u32 idx) const = 0; 34 virtual u32 getItemData(u32 idx) const = 0;
35 35
36 //! Returns index based on item data 36 //! Returns index based on item data
37 virtual s32 getIndexForItemData(u32 data ) const = 0; 37 virtual s32 getIndexForItemData(u32 data ) const = 0;
38 38
39 //! Adds an item and returns the index of it 39 //! Adds an item and returns the index of it
40 virtual u32 addItem(const wchar_t* text, u32 data = 0) = 0; 40 virtual u32 addItem(const wchar_t* text, u32 data = 0) = 0;
41 41
42 //! Removes an item from the combo box. 42 //! Removes an item from the combo box.
43 /** Warning. This will change the index of all following items */ 43 /** Warning. This will change the index of all following items */
44 virtual void removeItem(u32 idx) = 0; 44 virtual void removeItem(u32 idx) = 0;
45 45
46 //! Deletes all items in the combo box 46 //! Deletes all items in the combo box
47 virtual void clear() = 0; 47 virtual void clear() = 0;
48 48
49 //! Returns id of selected item. returns -1 if no item is selected. 49 //! Returns id of selected item. returns -1 if no item is selected.
50 virtual s32 getSelected() const = 0; 50 virtual s32 getSelected() const = 0;
51 51
52 //! Sets the selected item. Set this to -1 if no item should be selected 52 //! Sets the selected item. Set this to -1 if no item should be selected
53 virtual void setSelected(s32 idx) = 0; 53 virtual void setSelected(s32 idx) = 0;
54 54
55 //! Sets text justification of the text area 55 //! Sets text justification of the text area
56 /** \param horizontal: EGUIA_UPPERLEFT for left justified (default), 56 /** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
57 EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text. 57 EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
58 \param vertical: EGUIA_UPPERLEFT to align with top edge, 58 \param vertical: EGUIA_UPPERLEFT to align with top edge,
59 EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */ 59 EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
60 virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0; 60 virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
61 61
62 //! Set the maximal number of rows for the selection listbox 62 //! Set the maximal number of rows for the selection listbox
63 virtual void setMaxSelectionRows(u32 max) = 0; 63 virtual void setMaxSelectionRows(u32 max) = 0;
64 64
65 //! Get the maximimal number of rows for the selection listbox 65 //! Get the maximimal number of rows for the selection listbox
66 virtual u32 getMaxSelectionRows() const = 0; 66 virtual u32 getMaxSelectionRows() const = 0;
67 }; 67 };
68 68
69 69
70} // end namespace gui 70} // end namespace gui
71} // end namespace irr 71} // end namespace irr
72 72
73#endif 73#endif
74 74
diff --git a/libraries/irrlicht-1.8/include/IGUIContextMenu.h b/libraries/irrlicht-1.8/include/IGUIContextMenu.h
index c9a0659..9f5ea25 100644
--- a/libraries/irrlicht-1.8/include/IGUIContextMenu.h
+++ b/libraries/irrlicht-1.8/include/IGUIContextMenu.h
@@ -1,162 +1,162 @@
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#ifndef __I_GUI_CONTEXT_MENU_H_INCLUDED__ 5#ifndef __I_GUI_CONTEXT_MENU_H_INCLUDED__
6#define __I_GUI_CONTEXT_MENU_H_INCLUDED__ 6#define __I_GUI_CONTEXT_MENU_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace gui 12namespace gui
13{ 13{
14 //! Close behavior. 14 //! Close behavior.
15 //! Default is ECMC_REMOVE 15 //! Default is ECMC_REMOVE
16 enum ECONTEXT_MENU_CLOSE 16 enum ECONTEXT_MENU_CLOSE
17 { 17 {
18 //! do nothing - menu stays open 18 //! do nothing - menu stays open
19 ECMC_IGNORE = 0, 19 ECMC_IGNORE = 0,
20 20
21 //! remove the gui element 21 //! remove the gui element
22 ECMC_REMOVE = 1, 22 ECMC_REMOVE = 1,
23 23
24 //! call setVisible(false) 24 //! call setVisible(false)
25 ECMC_HIDE = 2 25 ECMC_HIDE = 2
26 26
27 // note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags. 27 // note to implementors - this is planned as bitset, so continue with 4 if you need to add further flags.
28 }; 28 };
29 29
30 //! GUI Context menu interface. 30 //! GUI Context menu interface.
31 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 31 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
32 \li EGET_ELEMENT_CLOSED 32 \li EGET_ELEMENT_CLOSED
33 \li EGET_MENU_ITEM_SELECTED 33 \li EGET_MENU_ITEM_SELECTED
34 */ 34 */
35 class IGUIContextMenu : public IGUIElement 35 class IGUIContextMenu : public IGUIElement
36 { 36 {
37 public: 37 public:
38 38
39 //! constructor 39 //! constructor
40 IGUIContextMenu(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 40 IGUIContextMenu(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
41 : IGUIElement(EGUIET_CONTEXT_MENU, environment, parent, id, rectangle) {} 41 : IGUIElement(EGUIET_CONTEXT_MENU, environment, parent, id, rectangle) {}
42 42
43 //! set behavior when menus are closed 43 //! set behavior when menus are closed
44 virtual void setCloseHandling(ECONTEXT_MENU_CLOSE onClose) = 0; 44 virtual void setCloseHandling(ECONTEXT_MENU_CLOSE onClose) = 0;
45 45
46 //! get current behavior when the menu will be closed 46 //! get current behavior when the menu will be closed
47 virtual ECONTEXT_MENU_CLOSE getCloseHandling() const = 0; 47 virtual ECONTEXT_MENU_CLOSE getCloseHandling() const = 0;
48 48
49 //! Get amount of menu items 49 //! Get amount of menu items
50 virtual u32 getItemCount() const = 0; 50 virtual u32 getItemCount() const = 0;
51 51
52 //! Adds a menu item. 52 //! Adds a menu item.
53 /** \param text: Text of menu item. Set this to 0 to create 53 /** \param text: Text of menu item. Set this to 0 to create
54 an separator instead of a real item, which is the same like 54 an separator instead of a real item, which is the same like
55 calling addSeparator(); 55 calling addSeparator();
56 \param commandId: Command id of menu item, a simple id you may 56 \param commandId: Command id of menu item, a simple id you may
57 set to whatever you want. 57 set to whatever you want.
58 \param enabled: Specifies if the menu item should be enabled. 58 \param enabled: Specifies if the menu item should be enabled.
59 \param hasSubMenu: Set this to true if there should be a submenu 59 \param hasSubMenu: Set this to true if there should be a submenu
60 at this item. You can access this submenu via getSubMenu(). 60 at this item. You can access this submenu via getSubMenu().
61 \param checked: Specifies if the menu item should be initially checked. 61 \param checked: Specifies if the menu item should be initially checked.
62 \param autoChecking: Specifies if the item should be checked by clicking 62 \param autoChecking: Specifies if the item should be checked by clicking
63 \return Returns the index of the new item */ 63 \return Returns the index of the new item */
64 virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true, 64 virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true,
65 bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0; 65 bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
66 66
67 //! Insert a menu item at specified position. 67 //! Insert a menu item at specified position.
68 /** \param idx: Position to insert the new element, 68 /** \param idx: Position to insert the new element,
69 should be smaller than itemcount otherwise the item is added to the end. 69 should be smaller than itemcount otherwise the item is added to the end.
70 \param text: Text of menu item. Set this to 0 to create 70 \param text: Text of menu item. Set this to 0 to create
71 an separator instead of a real item, which is the same like 71 an separator instead of a real item, which is the same like
72 calling addSeparator(); 72 calling addSeparator();
73 \param commandId: Command id of menu item, a simple id you may 73 \param commandId: Command id of menu item, a simple id you may
74 set to whatever you want. 74 set to whatever you want.
75 \param enabled: Specifies if the menu item should be enabled. 75 \param enabled: Specifies if the menu item should be enabled.
76 \param hasSubMenu: Set this to true if there should be a submenu 76 \param hasSubMenu: Set this to true if there should be a submenu
77 at this item. You can access this submenu via getSubMenu(). 77 at this item. You can access this submenu via getSubMenu().
78 \param checked: Specifies if the menu item should be initially checked. 78 \param checked: Specifies if the menu item should be initially checked.
79 \param autoChecking: Specifies if the item should be checked by clicking 79 \param autoChecking: Specifies if the item should be checked by clicking
80 \return Returns the index of the new item */ 80 \return Returns the index of the new item */
81 virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId=-1, bool enabled=true, 81 virtual u32 insertItem(u32 idx, const wchar_t* text, s32 commandId=-1, bool enabled=true,
82 bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0; 82 bool hasSubMenu=false, bool checked=false, bool autoChecking=false) = 0;
83 83
84 //! Find an item by it's CommandID 84 //! Find an item by it's CommandID
85 /** 85 /**
86 \param commandId: We are looking for the first item which has this commandID 86 \param commandId: We are looking for the first item which has this commandID
87 \param idxStartSearch: Start searching from this index. 87 \param idxStartSearch: Start searching from this index.
88 \return Returns the index of the item when found or otherwise -1. */ 88 \return Returns the index of the item when found or otherwise -1. */
89 virtual s32 findItemWithCommandId(s32 commandId, u32 idxStartSearch=0) const = 0; 89 virtual s32 findItemWithCommandId(s32 commandId, u32 idxStartSearch=0) const = 0;
90 90
91 //! Adds a separator item to the menu 91 //! Adds a separator item to the menu
92 virtual void addSeparator() = 0; 92 virtual void addSeparator() = 0;
93 93
94 //! Get text of the menu item. 94 //! Get text of the menu item.
95 /** \param idx: Zero based index of the menu item */ 95 /** \param idx: Zero based index of the menu item */
96 virtual const wchar_t* getItemText(u32 idx) const = 0; 96 virtual const wchar_t* getItemText(u32 idx) const = 0;
97 97
98 //! Sets text of the menu item. 98 //! Sets text of the menu item.
99 /** \param idx: Zero based index of the menu item 99 /** \param idx: Zero based index of the menu item
100 \param text: New text of the item. */ 100 \param text: New text of the item. */
101 virtual void setItemText(u32 idx, const wchar_t* text) = 0; 101 virtual void setItemText(u32 idx, const wchar_t* text) = 0;
102 102
103 //! Check if a menu item is enabled 103 //! Check if a menu item is enabled
104 /** \param idx: Zero based index of the menu item */ 104 /** \param idx: Zero based index of the menu item */
105 virtual bool isItemEnabled(u32 idx) const = 0; 105 virtual bool isItemEnabled(u32 idx) const = 0;
106 106
107 //! Sets if the menu item should be enabled. 107 //! Sets if the menu item should be enabled.
108 /** \param idx: Zero based index of the menu item 108 /** \param idx: Zero based index of the menu item
109 \param enabled: True if it is enabled, otherwise false. */ 109 \param enabled: True if it is enabled, otherwise false. */
110 virtual void setItemEnabled(u32 idx, bool enabled) = 0; 110 virtual void setItemEnabled(u32 idx, bool enabled) = 0;
111 111
112 //! Sets if the menu item should be checked. 112 //! Sets if the menu item should be checked.
113 /** \param idx: Zero based index of the menu item 113 /** \param idx: Zero based index of the menu item
114 \param enabled: True if it is enabled, otherwise false. */ 114 \param enabled: True if it is enabled, otherwise false. */
115 virtual void setItemChecked(u32 idx, bool enabled) = 0; 115 virtual void setItemChecked(u32 idx, bool enabled) = 0;
116 116
117 //! Check if a menu item is checked 117 //! Check if a menu item is checked
118 /** \param idx: Zero based index of the menu item */ 118 /** \param idx: Zero based index of the menu item */
119 virtual bool isItemChecked(u32 idx) const = 0; 119 virtual bool isItemChecked(u32 idx) const = 0;
120 120
121 //! Removes a menu item 121 //! Removes a menu item
122 /** \param idx: Zero based index of the menu item */ 122 /** \param idx: Zero based index of the menu item */
123 virtual void removeItem(u32 idx) = 0; 123 virtual void removeItem(u32 idx) = 0;
124 124
125 //! Removes all menu items 125 //! Removes all menu items
126 virtual void removeAllItems() = 0; 126 virtual void removeAllItems() = 0;
127 127
128 //! Get the selected item in the menu 128 //! Get the selected item in the menu
129 /** \return Index of the selected item, -1 if none selected. */ 129 /** \return Index of the selected item, -1 if none selected. */
130 virtual s32 getSelectedItem() const = 0; 130 virtual s32 getSelectedItem() const = 0;
131 131
132 //! Get the command id of a menu item 132 //! Get the command id of a menu item
133 /** \param idx: Zero based index of the menu item */ 133 /** \param idx: Zero based index of the menu item */
134 virtual s32 getItemCommandId(u32 idx) const = 0; 134 virtual s32 getItemCommandId(u32 idx) const = 0;
135 135
136 //! Sets the command id of a menu item 136 //! Sets the command id of a menu item
137 /** \param idx: Zero based index of the menu item 137 /** \param idx: Zero based index of the menu item
138 \param id: Command id of menu item, a simple id you may 138 \param id: Command id of menu item, a simple id you may
139 set to whatever you want. */ 139 set to whatever you want. */
140 virtual void setItemCommandId(u32 idx, s32 id) = 0; 140 virtual void setItemCommandId(u32 idx, s32 id) = 0;
141 141
142 //! Get a pointer to the submenu of an item. 142 //! Get a pointer to the submenu of an item.
143 /** 0 is returned if there is no submenu 143 /** 0 is returned if there is no submenu
144 \param idx: Zero based index of the menu item 144 \param idx: Zero based index of the menu item
145 \return Returns a pointer to the submenu of an item. */ 145 \return Returns a pointer to the submenu of an item. */
146 virtual IGUIContextMenu* getSubMenu(u32 idx) const = 0; 146 virtual IGUIContextMenu* getSubMenu(u32 idx) const = 0;
147 147
148 //! should the element change the checked status on clicking 148 //! should the element change the checked status on clicking
149 virtual void setItemAutoChecking(u32 idx, bool autoChecking) = 0; 149 virtual void setItemAutoChecking(u32 idx, bool autoChecking) = 0;
150 150
151 //! does the element change the checked status on clicking 151 //! does the element change the checked status on clicking
152 virtual bool getItemAutoChecking(u32 idx) const = 0; 152 virtual bool getItemAutoChecking(u32 idx) const = 0;
153 153
154 //! When an eventparent is set it receives events instead of the usual parent element 154 //! When an eventparent is set it receives events instead of the usual parent element
155 virtual void setEventParent(IGUIElement *parent) = 0; 155 virtual void setEventParent(IGUIElement *parent) = 0;
156 }; 156 };
157 157
158} // end namespace gui 158} // end namespace gui
159} // end namespace irr 159} // end namespace irr
160 160
161#endif 161#endif
162 162
diff --git a/libraries/irrlicht-1.8/include/IGUIEditBox.h b/libraries/irrlicht-1.8/include/IGUIEditBox.h
index e7b637e..13a9501 100644
--- a/libraries/irrlicht-1.8/include/IGUIEditBox.h
+++ b/libraries/irrlicht-1.8/include/IGUIEditBox.h
@@ -1,135 +1,135 @@
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#ifndef __I_GUI_EDIT_BOX_H_INCLUDED__ 5#ifndef __I_GUI_EDIT_BOX_H_INCLUDED__
6#define __I_GUI_EDIT_BOX_H_INCLUDED__ 6#define __I_GUI_EDIT_BOX_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9#include "SColor.h" 9#include "SColor.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace gui 13namespace gui
14{ 14{
15 class IGUIFont; 15 class IGUIFont;
16 16
17 //! Single line edit box for editing simple text. 17 //! Single line edit box for editing simple text.
18 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 18 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
19 \li EGET_EDITBOX_ENTER 19 \li EGET_EDITBOX_ENTER
20 \li EGET_EDITBOX_CHANGED 20 \li EGET_EDITBOX_CHANGED
21 \li EGET_EDITBOX_MARKING_CHANGED 21 \li EGET_EDITBOX_MARKING_CHANGED
22 */ 22 */
23 class IGUIEditBox : public IGUIElement 23 class IGUIEditBox : public IGUIElement
24 { 24 {
25 public: 25 public:
26 26
27 //! constructor 27 //! constructor
28 IGUIEditBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 28 IGUIEditBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
29 : IGUIElement(EGUIET_EDIT_BOX, environment, parent, id, rectangle) {} 29 : IGUIElement(EGUIET_EDIT_BOX, environment, parent, id, rectangle) {}
30 30
31 //! Sets another skin independent font. 31 //! Sets another skin independent font.
32 /** If this is set to zero, the button uses the font of the skin. 32 /** If this is set to zero, the button uses the font of the skin.
33 \param font: New font to set. */ 33 \param font: New font to set. */
34 virtual void setOverrideFont(IGUIFont* font=0) = 0; 34 virtual void setOverrideFont(IGUIFont* font=0) = 0;
35 35
36 //! Gets the override font (if any) 36 //! Gets the override font (if any)
37 /** \return The override font (may be 0) */ 37 /** \return The override font (may be 0) */
38 virtual IGUIFont* getOverrideFont() const = 0; 38 virtual IGUIFont* getOverrideFont() const = 0;
39 39
40 //! Get the font which is used right now for drawing 40 //! Get the font which is used right now for drawing
41 /** Currently this is the override font when one is set and the 41 /** Currently this is the override font when one is set and the
42 font of the active skin otherwise */ 42 font of the active skin otherwise */
43 virtual IGUIFont* getActiveFont() const = 0; 43 virtual IGUIFont* getActiveFont() const = 0;
44 44
45 //! Sets another color for the text. 45 //! Sets another color for the text.
46 /** If set, the edit box does not use the EGDC_BUTTON_TEXT color defined 46 /** If set, the edit box does not use the EGDC_BUTTON_TEXT color defined
47 in the skin, but the set color instead. You don't need to call 47 in the skin, but the set color instead. You don't need to call
48 IGUIEditBox::enableOverrrideColor(true) after this, this is done 48 IGUIEditBox::enableOverrrideColor(true) after this, this is done
49 by this function. 49 by this function.
50 If you set a color, and you want the text displayed with the color 50 If you set a color, and you want the text displayed with the color
51 of the skin again, call IGUIEditBox::enableOverrideColor(false); 51 of the skin again, call IGUIEditBox::enableOverrideColor(false);
52 \param color: New color of the text. */ 52 \param color: New color of the text. */
53 virtual void setOverrideColor(video::SColor color) = 0; 53 virtual void setOverrideColor(video::SColor color) = 0;
54 54
55 //! Gets the override color 55 //! Gets the override color
56 virtual video::SColor getOverrideColor() const = 0; 56 virtual video::SColor getOverrideColor() const = 0;
57 57
58 //! Sets if the text should use the override color or the color in the gui skin. 58 //! Sets if the text should use the override color or the color in the gui skin.
59 /** \param enable: If set to true, the override color, which can be set 59 /** \param enable: If set to true, the override color, which can be set
60 with IGUIEditBox::setOverrideColor is used, otherwise the 60 with IGUIEditBox::setOverrideColor is used, otherwise the
61 EGDC_BUTTON_TEXT color of the skin. */ 61 EGDC_BUTTON_TEXT color of the skin. */
62 virtual void enableOverrideColor(bool enable) = 0; 62 virtual void enableOverrideColor(bool enable) = 0;
63 63
64 //! Checks if an override color is enabled 64 //! Checks if an override color is enabled
65 /** \return true if the override color is enabled, false otherwise */ 65 /** \return true if the override color is enabled, false otherwise */
66 virtual bool isOverrideColorEnabled(void) const = 0; 66 virtual bool isOverrideColorEnabled(void) const = 0;
67 67
68 //! Sets whether to draw the background 68 //! Sets whether to draw the background
69 virtual void setDrawBackground(bool draw) = 0; 69 virtual void setDrawBackground(bool draw) = 0;
70 70
71 //! Turns the border on or off 71 //! Turns the border on or off
72 /** \param border: true if you want the border to be drawn, false if not */ 72 /** \param border: true if you want the border to be drawn, false if not */
73 virtual void setDrawBorder(bool border) = 0; 73 virtual void setDrawBorder(bool border) = 0;
74 74
75 //! Sets text justification mode 75 //! Sets text justification mode
76 /** \param horizontal: EGUIA_UPPERLEFT for left justified (default), 76 /** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
77 EGUIA_LOWERRIGHT for right justified, or EGUIA_CENTER for centered text. 77 EGUIA_LOWERRIGHT for right justified, or EGUIA_CENTER for centered text.
78 \param vertical: EGUIA_UPPERLEFT to align with top edge, 78 \param vertical: EGUIA_UPPERLEFT to align with top edge,
79 EGUIA_LOWERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */ 79 EGUIA_LOWERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
80 virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0; 80 virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
81 81
82 //! Enables or disables word wrap. 82 //! Enables or disables word wrap.
83 /** \param enable: If set to true, words going over one line are 83 /** \param enable: If set to true, words going over one line are
84 broken to the next line. */ 84 broken to the next line. */
85 virtual void setWordWrap(bool enable) = 0; 85 virtual void setWordWrap(bool enable) = 0;
86 86
87 //! Checks if word wrap is enabled 87 //! Checks if word wrap is enabled
88 /** \return true if word wrap is enabled, false otherwise */ 88 /** \return true if word wrap is enabled, false otherwise */
89 virtual bool isWordWrapEnabled() const = 0; 89 virtual bool isWordWrapEnabled() const = 0;
90 90
91 //! Enables or disables newlines. 91 //! Enables or disables newlines.
92 /** \param enable: If set to true, the EGET_EDITBOX_ENTER event will not be fired, 92 /** \param enable: If set to true, the EGET_EDITBOX_ENTER event will not be fired,
93 instead a newline character will be inserted. */ 93 instead a newline character will be inserted. */
94 virtual void setMultiLine(bool enable) = 0; 94 virtual void setMultiLine(bool enable) = 0;
95 95
96 //! Checks if multi line editing is enabled 96 //! Checks if multi line editing is enabled
97 /** \return true if multi-line is enabled, false otherwise */ 97 /** \return true if multi-line is enabled, false otherwise */
98 virtual bool isMultiLineEnabled() const = 0; 98 virtual bool isMultiLineEnabled() const = 0;
99 99
100 //! Enables or disables automatic scrolling with cursor position 100 //! Enables or disables automatic scrolling with cursor position
101 /** \param enable: If set to true, the text will move around with the cursor position */ 101 /** \param enable: If set to true, the text will move around with the cursor position */
102 virtual void setAutoScroll(bool enable) = 0; 102 virtual void setAutoScroll(bool enable) = 0;
103 103
104 //! Checks to see if automatic scrolling is enabled 104 //! Checks to see if automatic scrolling is enabled
105 /** \return true if automatic scrolling is enabled, false if not */ 105 /** \return true if automatic scrolling is enabled, false if not */
106 virtual bool isAutoScrollEnabled() const = 0; 106 virtual bool isAutoScrollEnabled() const = 0;
107 107
108 //! Sets whether the edit box is a password box. Setting this to true will 108 //! Sets whether the edit box is a password box. Setting this to true will
109 /** disable MultiLine, WordWrap and the ability to copy with ctrl+c or ctrl+x 109 /** disable MultiLine, WordWrap and the ability to copy with ctrl+c or ctrl+x
110 \param passwordBox: true to enable password, false to disable 110 \param passwordBox: true to enable password, false to disable
111 \param passwordChar: the character that is displayed instead of letters */ 111 \param passwordChar: the character that is displayed instead of letters */
112 virtual void setPasswordBox(bool passwordBox, wchar_t passwordChar = L'*') = 0; 112 virtual void setPasswordBox(bool passwordBox, wchar_t passwordChar = L'*') = 0;
113 113
114 //! Returns true if the edit box is currently a password box. 114 //! Returns true if the edit box is currently a password box.
115 virtual bool isPasswordBox() const = 0; 115 virtual bool isPasswordBox() const = 0;
116 116
117 //! Gets the size area of the text in the edit box 117 //! Gets the size area of the text in the edit box
118 /** \return The size in pixels of the text */ 118 /** \return The size in pixels of the text */
119 virtual core::dimension2du getTextDimension() = 0; 119 virtual core::dimension2du getTextDimension() = 0;
120 120
121 //! Sets the maximum amount of characters which may be entered in the box. 121 //! Sets the maximum amount of characters which may be entered in the box.
122 /** \param max: Maximum amount of characters. If 0, the character amount is 122 /** \param max: Maximum amount of characters. If 0, the character amount is
123 infinity. */ 123 infinity. */
124 virtual void setMax(u32 max) = 0; 124 virtual void setMax(u32 max) = 0;
125 125
126 //! Returns maximum amount of characters, previously set by setMax(); 126 //! Returns maximum amount of characters, previously set by setMax();
127 virtual u32 getMax() const = 0; 127 virtual u32 getMax() const = 0;
128 }; 128 };
129 129
130 130
131} // end namespace gui 131} // end namespace gui
132} // end namespace irr 132} // end namespace irr
133 133
134#endif 134#endif
135 135
diff --git a/libraries/irrlicht-1.8/include/IGUIElement.h b/libraries/irrlicht-1.8/include/IGUIElement.h
index 40df446..098cd79 100644
--- a/libraries/irrlicht-1.8/include/IGUIElement.h
+++ b/libraries/irrlicht-1.8/include/IGUIElement.h
@@ -1,1037 +1,1037 @@
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#ifndef __I_GUI_ELEMENT_H_INCLUDED__ 5#ifndef __I_GUI_ELEMENT_H_INCLUDED__
6#define __I_GUI_ELEMENT_H_INCLUDED__ 6#define __I_GUI_ELEMENT_H_INCLUDED__
7 7
8#include "IAttributeExchangingObject.h" 8#include "IAttributeExchangingObject.h"
9#include "irrList.h" 9#include "irrList.h"
10#include "rect.h" 10#include "rect.h"
11#include "irrString.h" 11#include "irrString.h"
12#include "IEventReceiver.h" 12#include "IEventReceiver.h"
13#include "EGUIElementTypes.h" 13#include "EGUIElementTypes.h"
14#include "EGUIAlignment.h" 14#include "EGUIAlignment.h"
15#include "IAttributes.h" 15#include "IAttributes.h"
16 16
17namespace irr 17namespace irr
18{ 18{
19namespace gui 19namespace gui
20{ 20{
21 21
22class IGUIEnvironment; 22class IGUIEnvironment;
23 23
24//! Base class of all GUI elements. 24//! Base class of all GUI elements.
25class IGUIElement : public virtual io::IAttributeExchangingObject, public IEventReceiver 25class IGUIElement : public virtual io::IAttributeExchangingObject, public IEventReceiver
26{ 26{
27public: 27public:
28 28
29 //! Constructor 29 //! Constructor
30 IGUIElement(EGUI_ELEMENT_TYPE type, IGUIEnvironment* environment, IGUIElement* parent, 30 IGUIElement(EGUI_ELEMENT_TYPE type, IGUIEnvironment* environment, IGUIElement* parent,
31 s32 id, const core::rect<s32>& rectangle) 31 s32 id, const core::rect<s32>& rectangle)
32 : Parent(0), RelativeRect(rectangle), AbsoluteRect(rectangle), 32 : Parent(0), RelativeRect(rectangle), AbsoluteRect(rectangle),
33 AbsoluteClippingRect(rectangle), DesiredRect(rectangle), 33 AbsoluteClippingRect(rectangle), DesiredRect(rectangle),
34 MaxSize(0,0), MinSize(1,1), IsVisible(true), IsEnabled(true), 34 MaxSize(0,0), MinSize(1,1), IsVisible(true), IsEnabled(true),
35 IsSubElement(false), NoClip(false), ID(id), IsTabStop(false), TabOrder(-1), IsTabGroup(false), 35 IsSubElement(false), NoClip(false), ID(id), IsTabStop(false), TabOrder(-1), IsTabGroup(false),
36 AlignLeft(EGUIA_UPPERLEFT), AlignRight(EGUIA_UPPERLEFT), AlignTop(EGUIA_UPPERLEFT), AlignBottom(EGUIA_UPPERLEFT), 36 AlignLeft(EGUIA_UPPERLEFT), AlignRight(EGUIA_UPPERLEFT), AlignTop(EGUIA_UPPERLEFT), AlignBottom(EGUIA_UPPERLEFT),
37 Environment(environment), Type(type) 37 Environment(environment), Type(type)
38 { 38 {
39 #ifdef _DEBUG 39 #ifdef _DEBUG
40 setDebugName("IGUIElement"); 40 setDebugName("IGUIElement");
41 #endif 41 #endif
42 42
43 // if we were given a parent to attach to 43 // if we were given a parent to attach to
44 if (parent) 44 if (parent)
45 { 45 {
46 parent->addChildToEnd(this); 46 parent->addChildToEnd(this);
47 recalculateAbsolutePosition(true); 47 recalculateAbsolutePosition(true);
48 } 48 }
49 } 49 }
50 50
51 51
52 //! Destructor 52 //! Destructor
53 virtual ~IGUIElement() 53 virtual ~IGUIElement()
54 { 54 {
55 // delete all children 55 // delete all children
56 core::list<IGUIElement*>::Iterator it = Children.begin(); 56 core::list<IGUIElement*>::Iterator it = Children.begin();
57 for (; it != Children.end(); ++it) 57 for (; it != Children.end(); ++it)
58 { 58 {
59 (*it)->Parent = 0; 59 (*it)->Parent = 0;
60 (*it)->drop(); 60 (*it)->drop();
61 } 61 }
62 } 62 }
63 63
64 64
65 //! Returns parent of this element. 65 //! Returns parent of this element.
66 IGUIElement* getParent() const 66 IGUIElement* getParent() const
67 { 67 {
68 return Parent; 68 return Parent;
69 } 69 }
70 70
71 71
72 //! Returns the relative rectangle of this element. 72 //! Returns the relative rectangle of this element.
73 core::rect<s32> getRelativePosition() const 73 core::rect<s32> getRelativePosition() const
74 { 74 {
75 return RelativeRect; 75 return RelativeRect;
76 } 76 }
77 77
78 78
79 //! Sets the relative rectangle of this element. 79 //! Sets the relative rectangle of this element.
80 /** \param r The absolute position to set */ 80 /** \param r The absolute position to set */
81 void setRelativePosition(const core::rect<s32>& r) 81 void setRelativePosition(const core::rect<s32>& r)
82 { 82 {
83 if (Parent) 83 if (Parent)
84 { 84 {
85 const core::rect<s32>& r2 = Parent->getAbsolutePosition(); 85 const core::rect<s32>& r2 = Parent->getAbsolutePosition();
86 86
87 core::dimension2df d((f32)(r2.getSize().Width), (f32)(r2.getSize().Height)); 87 core::dimension2df d((f32)(r2.getSize().Width), (f32)(r2.getSize().Height));
88 88
89 if (AlignLeft == EGUIA_SCALE) 89 if (AlignLeft == EGUIA_SCALE)
90 ScaleRect.UpperLeftCorner.X = (f32)r.UpperLeftCorner.X / d.Width; 90 ScaleRect.UpperLeftCorner.X = (f32)r.UpperLeftCorner.X / d.Width;
91 if (AlignRight == EGUIA_SCALE) 91 if (AlignRight == EGUIA_SCALE)
92 ScaleRect.LowerRightCorner.X = (f32)r.LowerRightCorner.X / d.Width; 92 ScaleRect.LowerRightCorner.X = (f32)r.LowerRightCorner.X / d.Width;
93 if (AlignTop == EGUIA_SCALE) 93 if (AlignTop == EGUIA_SCALE)
94 ScaleRect.UpperLeftCorner.Y = (f32)r.UpperLeftCorner.Y / d.Height; 94 ScaleRect.UpperLeftCorner.Y = (f32)r.UpperLeftCorner.Y / d.Height;
95 if (AlignBottom == EGUIA_SCALE) 95 if (AlignBottom == EGUIA_SCALE)
96 ScaleRect.LowerRightCorner.Y = (f32)r.LowerRightCorner.Y / d.Height; 96 ScaleRect.LowerRightCorner.Y = (f32)r.LowerRightCorner.Y / d.Height;
97 } 97 }
98 98
99 DesiredRect = r; 99 DesiredRect = r;
100 updateAbsolutePosition(); 100 updateAbsolutePosition();
101 } 101 }
102 102
103 //! Sets the relative rectangle of this element, maintaining its current width and height 103 //! Sets the relative rectangle of this element, maintaining its current width and height
104 /** \param position The new relative position to set. Width and height will not be changed. */ 104 /** \param position The new relative position to set. Width and height will not be changed. */
105 void setRelativePosition(const core::position2di & position) 105 void setRelativePosition(const core::position2di & position)
106 { 106 {
107 const core::dimension2di mySize = RelativeRect.getSize(); 107 const core::dimension2di mySize = RelativeRect.getSize();
108 const core::rect<s32> rectangle(position.X, position.Y, 108 const core::rect<s32> rectangle(position.X, position.Y,
109 position.X + mySize.Width, position.Y + mySize.Height); 109 position.X + mySize.Width, position.Y + mySize.Height);
110 setRelativePosition(rectangle); 110 setRelativePosition(rectangle);
111 } 111 }
112 112
113 113
114 //! Sets the relative rectangle of this element as a proportion of its parent's area. 114 //! Sets the relative rectangle of this element as a proportion of its parent's area.
115 /** \note This method used to be 'void setRelativePosition(const core::rect<f32>& r)' 115 /** \note This method used to be 'void setRelativePosition(const core::rect<f32>& r)'
116 \param r The rectangle to set, interpreted as a proportion of the parent's area. 116 \param r The rectangle to set, interpreted as a proportion of the parent's area.
117 Meaningful values are in the range [0...1], unless you intend this element to spill 117 Meaningful values are in the range [0...1], unless you intend this element to spill
118 outside its parent. */ 118 outside its parent. */
119 void setRelativePositionProportional(const core::rect<f32>& r) 119 void setRelativePositionProportional(const core::rect<f32>& r)
120 { 120 {
121 if (!Parent) 121 if (!Parent)
122 return; 122 return;
123 123
124 const core::dimension2di& d = Parent->getAbsolutePosition().getSize(); 124 const core::dimension2di& d = Parent->getAbsolutePosition().getSize();
125 125
126 DesiredRect = core::rect<s32>( 126 DesiredRect = core::rect<s32>(
127 core::floor32((f32)d.Width * r.UpperLeftCorner.X), 127 core::floor32((f32)d.Width * r.UpperLeftCorner.X),
128 core::floor32((f32)d.Height * r.UpperLeftCorner.Y), 128 core::floor32((f32)d.Height * r.UpperLeftCorner.Y),
129 core::floor32((f32)d.Width * r.LowerRightCorner.X), 129 core::floor32((f32)d.Width * r.LowerRightCorner.X),
130 core::floor32((f32)d.Height * r.LowerRightCorner.Y)); 130 core::floor32((f32)d.Height * r.LowerRightCorner.Y));
131 131
132 ScaleRect = r; 132 ScaleRect = r;
133 133
134 updateAbsolutePosition(); 134 updateAbsolutePosition();
135 } 135 }
136 136
137 137
138 //! Gets the absolute rectangle of this element 138 //! Gets the absolute rectangle of this element
139 core::rect<s32> getAbsolutePosition() const 139 core::rect<s32> getAbsolutePosition() const
140 { 140 {
141 return AbsoluteRect; 141 return AbsoluteRect;
142 } 142 }
143 143
144 144
145 //! Returns the visible area of the element. 145 //! Returns the visible area of the element.
146 core::rect<s32> getAbsoluteClippingRect() const 146 core::rect<s32> getAbsoluteClippingRect() const
147 { 147 {
148 return AbsoluteClippingRect; 148 return AbsoluteClippingRect;
149 } 149 }
150 150
151 151
152 //! Sets whether the element will ignore its parent's clipping rectangle 152 //! Sets whether the element will ignore its parent's clipping rectangle
153 /** \param noClip If true, the element will not be clipped by its parent's clipping rectangle. */ 153 /** \param noClip If true, the element will not be clipped by its parent's clipping rectangle. */
154 void setNotClipped(bool noClip) 154 void setNotClipped(bool noClip)
155 { 155 {
156 NoClip = noClip; 156 NoClip = noClip;
157 updateAbsolutePosition(); 157 updateAbsolutePosition();
158 } 158 }
159 159
160 160
161 //! Gets whether the element will ignore its parent's clipping rectangle 161 //! Gets whether the element will ignore its parent's clipping rectangle
162 /** \return true if the element is not clipped by its parent's clipping rectangle. */ 162 /** \return true if the element is not clipped by its parent's clipping rectangle. */
163 bool isNotClipped() const 163 bool isNotClipped() const
164 { 164 {
165 return NoClip; 165 return NoClip;
166 } 166 }
167 167
168 168
169 //! Sets the maximum size allowed for this element 169 //! Sets the maximum size allowed for this element
170 /** If set to 0,0, there is no maximum size */ 170 /** If set to 0,0, there is no maximum size */
171 void setMaxSize(core::dimension2du size) 171 void setMaxSize(core::dimension2du size)
172 { 172 {
173 MaxSize = size; 173 MaxSize = size;
174 updateAbsolutePosition(); 174 updateAbsolutePosition();
175 } 175 }
176 176
177 177
178 //! Sets the minimum size allowed for this element 178 //! Sets the minimum size allowed for this element
179 void setMinSize(core::dimension2du size) 179 void setMinSize(core::dimension2du size)
180 { 180 {
181 MinSize = size; 181 MinSize = size;
182 if (MinSize.Width < 1) 182 if (MinSize.Width < 1)
183 MinSize.Width = 1; 183 MinSize.Width = 1;
184 if (MinSize.Height < 1) 184 if (MinSize.Height < 1)
185 MinSize.Height = 1; 185 MinSize.Height = 1;
186 updateAbsolutePosition(); 186 updateAbsolutePosition();
187 } 187 }
188 188
189 189
190 //! The alignment defines how the borders of this element will be positioned when the parent element is resized. 190 //! The alignment defines how the borders of this element will be positioned when the parent element is resized.
191 void setAlignment(EGUI_ALIGNMENT left, EGUI_ALIGNMENT right, EGUI_ALIGNMENT top, EGUI_ALIGNMENT bottom) 191 void setAlignment(EGUI_ALIGNMENT left, EGUI_ALIGNMENT right, EGUI_ALIGNMENT top, EGUI_ALIGNMENT bottom)
192 { 192 {
193 AlignLeft = left; 193 AlignLeft = left;
194 AlignRight = right; 194 AlignRight = right;
195 AlignTop = top; 195 AlignTop = top;
196 AlignBottom = bottom; 196 AlignBottom = bottom;
197 197
198 if (Parent) 198 if (Parent)
199 { 199 {
200 core::rect<s32> r(Parent->getAbsolutePosition()); 200 core::rect<s32> r(Parent->getAbsolutePosition());
201 201
202 core::dimension2df d((f32)r.getSize().Width, (f32)r.getSize().Height); 202 core::dimension2df d((f32)r.getSize().Width, (f32)r.getSize().Height);
203 203
204 if (AlignLeft == EGUIA_SCALE) 204 if (AlignLeft == EGUIA_SCALE)
205 ScaleRect.UpperLeftCorner.X = (f32)DesiredRect.UpperLeftCorner.X / d.Width; 205 ScaleRect.UpperLeftCorner.X = (f32)DesiredRect.UpperLeftCorner.X / d.Width;
206 if (AlignRight == EGUIA_SCALE) 206 if (AlignRight == EGUIA_SCALE)
207 ScaleRect.LowerRightCorner.X = (f32)DesiredRect.LowerRightCorner.X / d.Width; 207 ScaleRect.LowerRightCorner.X = (f32)DesiredRect.LowerRightCorner.X / d.Width;
208 if (AlignTop == EGUIA_SCALE) 208 if (AlignTop == EGUIA_SCALE)
209 ScaleRect.UpperLeftCorner.Y = (f32)DesiredRect.UpperLeftCorner.Y / d.Height; 209 ScaleRect.UpperLeftCorner.Y = (f32)DesiredRect.UpperLeftCorner.Y / d.Height;
210 if (AlignBottom == EGUIA_SCALE) 210 if (AlignBottom == EGUIA_SCALE)
211 ScaleRect.LowerRightCorner.Y = (f32)DesiredRect.LowerRightCorner.Y / d.Height; 211 ScaleRect.LowerRightCorner.Y = (f32)DesiredRect.LowerRightCorner.Y / d.Height;
212 } 212 }
213 } 213 }
214 214
215 215
216 //! Updates the absolute position. 216 //! Updates the absolute position.
217 virtual void updateAbsolutePosition() 217 virtual void updateAbsolutePosition()
218 { 218 {
219 recalculateAbsolutePosition(false); 219 recalculateAbsolutePosition(false);
220 220
221 // update all children 221 // update all children
222 core::list<IGUIElement*>::Iterator it = Children.begin(); 222 core::list<IGUIElement*>::Iterator it = Children.begin();
223 for (; it != Children.end(); ++it) 223 for (; it != Children.end(); ++it)
224 { 224 {
225 (*it)->updateAbsolutePosition(); 225 (*it)->updateAbsolutePosition();
226 } 226 }
227 } 227 }
228 228
229 229
230 //! Returns the topmost GUI element at the specific position. 230 //! Returns the topmost GUI element at the specific position.
231 /** 231 /**
232 This will check this GUI element and all of its descendants, so it 232 This will check this GUI element and all of its descendants, so it
233 may return this GUI element. To check all GUI elements, call this 233 may return this GUI element. To check all GUI elements, call this
234 function on device->getGUIEnvironment()->getRootGUIElement(). Note 234 function on device->getGUIEnvironment()->getRootGUIElement(). Note
235 that the root element is the size of the screen, so doing so (with 235 that the root element is the size of the screen, so doing so (with
236 an on-screen point) will always return the root element if no other 236 an on-screen point) will always return the root element if no other
237 element is above it at that point. 237 element is above it at that point.
238 \param point: The point at which to find a GUI element. 238 \param point: The point at which to find a GUI element.
239 \return The topmost GUI element at that point, or 0 if there are 239 \return The topmost GUI element at that point, or 0 if there are
240 no candidate elements at this point. 240 no candidate elements at this point.
241 */ 241 */
242 IGUIElement* getElementFromPoint(const core::position2d<s32>& point) 242 IGUIElement* getElementFromPoint(const core::position2d<s32>& point)
243 { 243 {
244 IGUIElement* target = 0; 244 IGUIElement* target = 0;
245 245
246 // we have to search from back to front, because later children 246 // we have to search from back to front, because later children
247 // might be drawn over the top of earlier ones. 247 // might be drawn over the top of earlier ones.
248 248
249 core::list<IGUIElement*>::Iterator it = Children.getLast(); 249 core::list<IGUIElement*>::Iterator it = Children.getLast();
250 250
251 if (isVisible()) 251 if (isVisible())
252 { 252 {
253 while(it != Children.end()) 253 while(it != Children.end())
254 { 254 {
255 target = (*it)->getElementFromPoint(point); 255 target = (*it)->getElementFromPoint(point);
256 if (target) 256 if (target)
257 return target; 257 return target;
258 258
259 --it; 259 --it;
260 } 260 }
261 } 261 }
262 262
263 if (isVisible() && isPointInside(point)) 263 if (isVisible() && isPointInside(point))
264 target = this; 264 target = this;
265 265
266 return target; 266 return target;
267 } 267 }
268 268
269 269
270 //! Returns true if a point is within this element. 270 //! Returns true if a point is within this element.
271 /** Elements with a shape other than a rectangle should override this method */ 271 /** Elements with a shape other than a rectangle should override this method */
272 virtual bool isPointInside(const core::position2d<s32>& point) const 272 virtual bool isPointInside(const core::position2d<s32>& point) const
273 { 273 {
274 return AbsoluteClippingRect.isPointInside(point); 274 return AbsoluteClippingRect.isPointInside(point);
275 } 275 }
276 276
277 277
278 //! Adds a GUI element as new child of this element. 278 //! Adds a GUI element as new child of this element.
279 virtual void addChild(IGUIElement* child) 279 virtual void addChild(IGUIElement* child)
280 { 280 {
281 addChildToEnd(child); 281 addChildToEnd(child);
282 if (child) 282 if (child)
283 { 283 {
284 child->updateAbsolutePosition(); 284 child->updateAbsolutePosition();
285 } 285 }
286 } 286 }
287 287
288 //! Removes a child. 288 //! Removes a child.
289 virtual void removeChild(IGUIElement* child) 289 virtual void removeChild(IGUIElement* child)
290 { 290 {
291 core::list<IGUIElement*>::Iterator it = Children.begin(); 291 core::list<IGUIElement*>::Iterator it = Children.begin();
292 for (; it != Children.end(); ++it) 292 for (; it != Children.end(); ++it)
293 if ((*it) == child) 293 if ((*it) == child)
294 { 294 {
295 (*it)->Parent = 0; 295 (*it)->Parent = 0;
296 (*it)->drop(); 296 (*it)->drop();
297 Children.erase(it); 297 Children.erase(it);
298 return; 298 return;
299 } 299 }
300 } 300 }
301 301
302 302
303 //! Removes this element from its parent. 303 //! Removes this element from its parent.
304 virtual void remove() 304 virtual void remove()
305 { 305 {
306 if (Parent) 306 if (Parent)
307 Parent->removeChild(this); 307 Parent->removeChild(this);
308 } 308 }
309 309
310 310
311 //! Draws the element and its children. 311 //! Draws the element and its children.
312 virtual void draw() 312 virtual void draw()
313 { 313 {
314 if ( isVisible() ) 314 if ( isVisible() )
315 { 315 {
316 core::list<IGUIElement*>::Iterator it = Children.begin(); 316 core::list<IGUIElement*>::Iterator it = Children.begin();
317 for (; it != Children.end(); ++it) 317 for (; it != Children.end(); ++it)
318 (*it)->draw(); 318 (*it)->draw();
319 } 319 }
320 } 320 }
321 321
322 322
323 //! animate the element and its children. 323 //! animate the element and its children.
324 virtual void OnPostRender(u32 timeMs) 324 virtual void OnPostRender(u32 timeMs)
325 { 325 {
326 if ( isVisible() ) 326 if ( isVisible() )
327 { 327 {
328 core::list<IGUIElement*>::Iterator it = Children.begin(); 328 core::list<IGUIElement*>::Iterator it = Children.begin();
329 for (; it != Children.end(); ++it) 329 for (; it != Children.end(); ++it)
330 (*it)->OnPostRender( timeMs ); 330 (*it)->OnPostRender( timeMs );
331 } 331 }
332 } 332 }
333 333
334 334
335 //! Moves this element. 335 //! Moves this element.
336 virtual void move(core::position2d<s32> absoluteMovement) 336 virtual void move(core::position2d<s32> absoluteMovement)
337 { 337 {
338 setRelativePosition(DesiredRect + absoluteMovement); 338 setRelativePosition(DesiredRect + absoluteMovement);
339 } 339 }
340 340
341 341
342 //! Returns true if element is visible. 342 //! Returns true if element is visible.
343 virtual bool isVisible() const 343 virtual bool isVisible() const
344 { 344 {
345 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 345 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
346 return IsVisible; 346 return IsVisible;
347 } 347 }
348 348
349 349
350 //! Sets the visible state of this element. 350 //! Sets the visible state of this element.
351 virtual void setVisible(bool visible) 351 virtual void setVisible(bool visible)
352 { 352 {
353 IsVisible = visible; 353 IsVisible = visible;
354 } 354 }
355 355
356 356
357 //! Returns true if this element was created as part of its parent control 357 //! Returns true if this element was created as part of its parent control
358 virtual bool isSubElement() const 358 virtual bool isSubElement() const
359 { 359 {
360 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 360 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
361 return IsSubElement; 361 return IsSubElement;
362 } 362 }
363 363
364 364
365 //! Sets whether this control was created as part of its parent. 365 //! Sets whether this control was created as part of its parent.
366 /** For example, it is true when a scrollbar is part of a listbox. 366 /** For example, it is true when a scrollbar is part of a listbox.
367 SubElements are not saved to disk when calling guiEnvironment->saveGUI() */ 367 SubElements are not saved to disk when calling guiEnvironment->saveGUI() */
368 virtual void setSubElement(bool subElement) 368 virtual void setSubElement(bool subElement)
369 { 369 {
370 IsSubElement = subElement; 370 IsSubElement = subElement;
371 } 371 }
372 372
373 373
374 //! If set to true, the focus will visit this element when using the tab key to cycle through elements. 374 //! If set to true, the focus will visit this element when using the tab key to cycle through elements.
375 /** If this element is a tab group (see isTabGroup/setTabGroup) then 375 /** If this element is a tab group (see isTabGroup/setTabGroup) then
376 ctrl+tab will be used instead. */ 376 ctrl+tab will be used instead. */
377 void setTabStop(bool enable) 377 void setTabStop(bool enable)
378 { 378 {
379 IsTabStop = enable; 379 IsTabStop = enable;
380 } 380 }
381 381
382 382
383 //! Returns true if this element can be focused by navigating with the tab key 383 //! Returns true if this element can be focused by navigating with the tab key
384 bool isTabStop() const 384 bool isTabStop() const
385 { 385 {
386 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 386 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
387 return IsTabStop; 387 return IsTabStop;
388 } 388 }
389 389
390 390
391 //! Sets the priority of focus when using the tab key to navigate between a group of elements. 391 //! Sets the priority of focus when using the tab key to navigate between a group of elements.
392 /** See setTabGroup, isTabGroup and getTabGroup for information on tab groups. 392 /** See setTabGroup, isTabGroup and getTabGroup for information on tab groups.
393 Elements with a lower number are focused first */ 393 Elements with a lower number are focused first */
394 void setTabOrder(s32 index) 394 void setTabOrder(s32 index)
395 { 395 {
396 // negative = autonumber 396 // negative = autonumber
397 if (index < 0) 397 if (index < 0)
398 { 398 {
399 TabOrder = 0; 399 TabOrder = 0;
400 IGUIElement *el = getTabGroup(); 400 IGUIElement *el = getTabGroup();
401 while (IsTabGroup && el && el->Parent) 401 while (IsTabGroup && el && el->Parent)
402 el = el->Parent; 402 el = el->Parent;
403 403
404 IGUIElement *first=0, *closest=0; 404 IGUIElement *first=0, *closest=0;
405 if (el) 405 if (el)
406 { 406 {
407 // find the highest element number 407 // find the highest element number
408 el->getNextElement(-1, true, IsTabGroup, first, closest, true); 408 el->getNextElement(-1, true, IsTabGroup, first, closest, true);
409 if (first) 409 if (first)
410 { 410 {
411 TabOrder = first->getTabOrder() + 1; 411 TabOrder = first->getTabOrder() + 1;
412 } 412 }
413 } 413 }
414 414
415 } 415 }
416 else 416 else
417 TabOrder = index; 417 TabOrder = index;
418 } 418 }
419 419
420 420
421 //! Returns the number in the tab order sequence 421 //! Returns the number in the tab order sequence
422 s32 getTabOrder() const 422 s32 getTabOrder() const
423 { 423 {
424 return TabOrder; 424 return TabOrder;
425 } 425 }
426 426
427 427
428 //! Sets whether this element is a container for a group of elements which can be navigated using the tab key. 428 //! Sets whether this element is a container for a group of elements which can be navigated using the tab key.
429 /** For example, windows are tab groups. 429 /** For example, windows are tab groups.
430 Groups can be navigated using ctrl+tab, providing isTabStop is true. */ 430 Groups can be navigated using ctrl+tab, providing isTabStop is true. */
431 void setTabGroup(bool isGroup) 431 void setTabGroup(bool isGroup)
432 { 432 {
433 IsTabGroup = isGroup; 433 IsTabGroup = isGroup;
434 } 434 }
435 435
436 436
437 //! Returns true if this element is a tab group. 437 //! Returns true if this element is a tab group.
438 bool isTabGroup() const 438 bool isTabGroup() const
439 { 439 {
440 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 440 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
441 return IsTabGroup; 441 return IsTabGroup;
442 } 442 }
443 443
444 444
445 //! Returns the container element which holds all elements in this element's tab group. 445 //! Returns the container element which holds all elements in this element's tab group.
446 IGUIElement* getTabGroup() 446 IGUIElement* getTabGroup()
447 { 447 {
448 IGUIElement *ret=this; 448 IGUIElement *ret=this;
449 449
450 while (ret && !ret->isTabGroup()) 450 while (ret && !ret->isTabGroup())
451 ret = ret->getParent(); 451 ret = ret->getParent();
452 452
453 return ret; 453 return ret;
454 } 454 }
455 455
456 456
457 //! Returns true if element is enabled 457 //! Returns true if element is enabled
458 /** Currently elements do _not_ care about parent-states. 458 /** Currently elements do _not_ care about parent-states.
459 So if you want to affect childs you have to enable/disable them all. 459 So if you want to affect childs you have to enable/disable them all.
460 The only exception to this are sub-elements which also check their parent. 460 The only exception to this are sub-elements which also check their parent.
461 */ 461 */
462 virtual bool isEnabled() const 462 virtual bool isEnabled() const
463 { 463 {
464 if ( isSubElement() && IsEnabled && getParent() ) 464 if ( isSubElement() && IsEnabled && getParent() )
465 return getParent()->isEnabled(); 465 return getParent()->isEnabled();
466 466
467 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 467 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
468 return IsEnabled; 468 return IsEnabled;
469 } 469 }
470 470
471 471
472 //! Sets the enabled state of this element. 472 //! Sets the enabled state of this element.
473 virtual void setEnabled(bool enabled) 473 virtual void setEnabled(bool enabled)
474 { 474 {
475 IsEnabled = enabled; 475 IsEnabled = enabled;
476 } 476 }
477 477
478 478
479 //! Sets the new caption of this element. 479 //! Sets the new caption of this element.
480 virtual void setText(const wchar_t* text) 480 virtual void setText(const wchar_t* text)
481 { 481 {
482 Text = text; 482 Text = text;
483 } 483 }
484 484
485 485
486 //! Returns caption of this element. 486 //! Returns caption of this element.
487 virtual const wchar_t* getText() const 487 virtual const wchar_t* getText() const
488 { 488 {
489 return Text.c_str(); 489 return Text.c_str();
490 } 490 }
491 491
492 492
493 //! Sets the new caption of this element. 493 //! Sets the new caption of this element.
494 virtual void setToolTipText(const wchar_t* text) 494 virtual void setToolTipText(const wchar_t* text)
495 { 495 {
496 ToolTipText = text; 496 ToolTipText = text;
497 } 497 }
498 498
499 499
500 //! Returns caption of this element. 500 //! Returns caption of this element.
501 virtual const core::stringw& getToolTipText() const 501 virtual const core::stringw& getToolTipText() const
502 { 502 {
503 return ToolTipText; 503 return ToolTipText;
504 } 504 }
505 505
506 506
507 //! Returns id. Can be used to identify the element. 507 //! Returns id. Can be used to identify the element.
508 virtual s32 getID() const 508 virtual s32 getID() const
509 { 509 {
510 return ID; 510 return ID;
511 } 511 }
512 512
513 513
514 //! Sets the id of this element 514 //! Sets the id of this element
515 virtual void setID(s32 id) 515 virtual void setID(s32 id)
516 { 516 {
517 ID = id; 517 ID = id;
518 } 518 }
519 519
520 520
521 //! Called if an event happened. 521 //! Called if an event happened.
522 virtual bool OnEvent(const SEvent& event) 522 virtual bool OnEvent(const SEvent& event)
523 { 523 {
524 return Parent ? Parent->OnEvent(event) : false; 524 return Parent ? Parent->OnEvent(event) : false;
525 } 525 }
526 526
527 527
528 //! Brings a child to front 528 //! Brings a child to front
529 /** \return True if successful, false if not. */ 529 /** \return True if successful, false if not. */
530 virtual bool bringToFront(IGUIElement* element) 530 virtual bool bringToFront(IGUIElement* element)
531 { 531 {
532 core::list<IGUIElement*>::Iterator it = Children.begin(); 532 core::list<IGUIElement*>::Iterator it = Children.begin();
533 for (; it != Children.end(); ++it) 533 for (; it != Children.end(); ++it)
534 { 534 {
535 if (element == (*it)) 535 if (element == (*it))
536 { 536 {
537 Children.erase(it); 537 Children.erase(it);
538 Children.push_back(element); 538 Children.push_back(element);
539 return true; 539 return true;
540 } 540 }
541 } 541 }
542 542
543 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 543 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
544 return false; 544 return false;
545 } 545 }
546 546
547 547
548 //! Moves a child to the back, so it's siblings are drawn on top of it 548 //! Moves a child to the back, so it's siblings are drawn on top of it
549 /** \return True if successful, false if not. */ 549 /** \return True if successful, false if not. */
550 virtual bool sendToBack(IGUIElement* child) 550 virtual bool sendToBack(IGUIElement* child)
551 { 551 {
552 core::list<IGUIElement*>::Iterator it = Children.begin(); 552 core::list<IGUIElement*>::Iterator it = Children.begin();
553 if (child == (*it)) // already there 553 if (child == (*it)) // already there
554 return true; 554 return true;
555 for (; it != Children.end(); ++it) 555 for (; it != Children.end(); ++it)
556 { 556 {
557 if (child == (*it)) 557 if (child == (*it))
558 { 558 {
559 Children.erase(it); 559 Children.erase(it);
560 Children.push_front(child); 560 Children.push_front(child);
561 return true; 561 return true;
562 } 562 }
563 } 563 }
564 564
565 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 565 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
566 return false; 566 return false;
567 } 567 }
568 568
569 //! Returns list with children of this element 569 //! Returns list with children of this element
570 virtual const core::list<IGUIElement*>& getChildren() const 570 virtual const core::list<IGUIElement*>& getChildren() const
571 { 571 {
572 return Children; 572 return Children;
573 } 573 }
574 574
575 575
576 //! Finds the first element with the given id. 576 //! Finds the first element with the given id.
577 /** \param id: Id to search for. 577 /** \param id: Id to search for.
578 \param searchchildren: Set this to true, if also children of this 578 \param searchchildren: Set this to true, if also children of this
579 element may contain the element with the searched id and they 579 element may contain the element with the searched id and they
580 should be searched too. 580 should be searched too.
581 \return Returns the first element with the given id. If no element 581 \return Returns the first element with the given id. If no element
582 with this id was found, 0 is returned. */ 582 with this id was found, 0 is returned. */
583 virtual IGUIElement* getElementFromId(s32 id, bool searchchildren=false) const 583 virtual IGUIElement* getElementFromId(s32 id, bool searchchildren=false) const
584 { 584 {
585 IGUIElement* e = 0; 585 IGUIElement* e = 0;
586 586
587 core::list<IGUIElement*>::ConstIterator it = Children.begin(); 587 core::list<IGUIElement*>::ConstIterator it = Children.begin();
588 for (; it != Children.end(); ++it) 588 for (; it != Children.end(); ++it)
589 { 589 {
590 if ((*it)->getID() == id) 590 if ((*it)->getID() == id)
591 return (*it); 591 return (*it);
592 592
593 if (searchchildren) 593 if (searchchildren)
594 e = (*it)->getElementFromId(id, true); 594 e = (*it)->getElementFromId(id, true);
595 595
596 if (e) 596 if (e)
597 return e; 597 return e;
598 } 598 }
599 599
600 return e; 600 return e;
601 } 601 }
602 602
603 603
604 //! returns true if the given element is a child of this one. 604 //! returns true if the given element is a child of this one.
605 //! \param child: The child element to check 605 //! \param child: The child element to check
606 bool isMyChild(IGUIElement* child) const 606 bool isMyChild(IGUIElement* child) const
607 { 607 {
608 if (!child) 608 if (!child)
609 return false; 609 return false;
610 do 610 do
611 { 611 {
612 if (child->Parent) 612 if (child->Parent)
613 child = child->Parent; 613 child = child->Parent;
614 614
615 } while (child->Parent && child != this); 615 } while (child->Parent && child != this);
616 616
617 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 617 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
618 return child == this; 618 return child == this;
619 } 619 }
620 620
621 621
622 //! searches elements to find the closest next element to tab to 622 //! searches elements to find the closest next element to tab to
623 /** \param startOrder: The TabOrder of the current element, -1 if none 623 /** \param startOrder: The TabOrder of the current element, -1 if none
624 \param reverse: true if searching for a lower number 624 \param reverse: true if searching for a lower number
625 \param group: true if searching for a higher one 625 \param group: true if searching for a higher one
626 \param first: element with the highest/lowest known tab order depending on search direction 626 \param first: element with the highest/lowest known tab order depending on search direction
627 \param closest: the closest match, depending on tab order and direction 627 \param closest: the closest match, depending on tab order and direction
628 \param includeInvisible: includes invisible elements in the search (default=false) 628 \param includeInvisible: includes invisible elements in the search (default=false)
629 \return true if successfully found an element, false to continue searching/fail */ 629 \return true if successfully found an element, false to continue searching/fail */
630 bool getNextElement(s32 startOrder, bool reverse, bool group, 630 bool getNextElement(s32 startOrder, bool reverse, bool group,
631 IGUIElement*& first, IGUIElement*& closest, bool includeInvisible=false) const 631 IGUIElement*& first, IGUIElement*& closest, bool includeInvisible=false) const
632 { 632 {
633 // we'll stop searching if we find this number 633 // we'll stop searching if we find this number
634 s32 wanted = startOrder + ( reverse ? -1 : 1 ); 634 s32 wanted = startOrder + ( reverse ? -1 : 1 );
635 if (wanted==-2) 635 if (wanted==-2)
636 wanted = 1073741824; // maximum s32 636 wanted = 1073741824; // maximum s32
637 637
638 core::list<IGUIElement*>::ConstIterator it = Children.begin(); 638 core::list<IGUIElement*>::ConstIterator it = Children.begin();
639 639
640 s32 closestOrder, currentOrder; 640 s32 closestOrder, currentOrder;
641 641
642 while(it != Children.end()) 642 while(it != Children.end())
643 { 643 {
644 // ignore invisible elements and their children 644 // ignore invisible elements and their children
645 if ( ( (*it)->isVisible() || includeInvisible ) && 645 if ( ( (*it)->isVisible() || includeInvisible ) &&
646 (group == true || (*it)->isTabGroup() == false) ) 646 (group == true || (*it)->isTabGroup() == false) )
647 { 647 {
648 // only check tab stops and those with the same group status 648 // only check tab stops and those with the same group status
649 if ((*it)->isTabStop() && ((*it)->isTabGroup() == group)) 649 if ((*it)->isTabStop() && ((*it)->isTabGroup() == group))
650 { 650 {
651 currentOrder = (*it)->getTabOrder(); 651 currentOrder = (*it)->getTabOrder();
652 652
653 // is this what we're looking for? 653 // is this what we're looking for?
654 if (currentOrder == wanted) 654 if (currentOrder == wanted)
655 { 655 {
656 closest = *it; 656 closest = *it;
657 return true; 657 return true;
658 } 658 }
659 659
660 // is it closer than the current closest? 660 // is it closer than the current closest?
661 if (closest) 661 if (closest)
662 { 662 {
663 closestOrder = closest->getTabOrder(); 663 closestOrder = closest->getTabOrder();
664 if ( ( reverse && currentOrder > closestOrder && currentOrder < startOrder) 664 if ( ( reverse && currentOrder > closestOrder && currentOrder < startOrder)
665 ||(!reverse && currentOrder < closestOrder && currentOrder > startOrder)) 665 ||(!reverse && currentOrder < closestOrder && currentOrder > startOrder))
666 { 666 {
667 closest = *it; 667 closest = *it;
668 } 668 }
669 } 669 }
670 else 670 else
671 if ( (reverse && currentOrder < startOrder) || (!reverse && currentOrder > startOrder) ) 671 if ( (reverse && currentOrder < startOrder) || (!reverse && currentOrder > startOrder) )
672 { 672 {
673 closest = *it; 673 closest = *it;
674 } 674 }
675 675
676 // is it before the current first? 676 // is it before the current first?
677 if (first) 677 if (first)
678 { 678 {
679 closestOrder = first->getTabOrder(); 679 closestOrder = first->getTabOrder();
680 680
681 if ( (reverse && closestOrder < currentOrder) || (!reverse && closestOrder > currentOrder) ) 681 if ( (reverse && closestOrder < currentOrder) || (!reverse && closestOrder > currentOrder) )
682 { 682 {
683 first = *it; 683 first = *it;
684 } 684 }
685 } 685 }
686 else 686 else
687 { 687 {
688 first = *it; 688 first = *it;
689 } 689 }
690 } 690 }
691 // search within children 691 // search within children
692 if ((*it)->getNextElement(startOrder, reverse, group, first, closest)) 692 if ((*it)->getNextElement(startOrder, reverse, group, first, closest))
693 { 693 {
694 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 694 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
695 return true; 695 return true;
696 } 696 }
697 } 697 }
698 ++it; 698 ++it;
699 } 699 }
700 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 700 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
701 return false; 701 return false;
702 } 702 }
703 703
704 704
705 //! Returns the type of the gui element. 705 //! Returns the type of the gui element.
706 /** This is needed for the .NET wrapper but will be used 706 /** This is needed for the .NET wrapper but will be used
707 later for serializing and deserializing. 707 later for serializing and deserializing.
708 If you wrote your own GUIElements, you need to set the type for your element as first parameter 708 If you wrote your own GUIElements, you need to set the type for your element as first parameter
709 in the constructor of IGUIElement. For own (=unknown) elements, simply use EGUIET_ELEMENT as type */ 709 in the constructor of IGUIElement. For own (=unknown) elements, simply use EGUIET_ELEMENT as type */
710 EGUI_ELEMENT_TYPE getType() const 710 EGUI_ELEMENT_TYPE getType() const
711 { 711 {
712 return Type; 712 return Type;
713 } 713 }
714 714
715 //! Returns true if the gui element supports the given type. 715 //! Returns true if the gui element supports the given type.
716 /** This is mostly used to check if you can cast a gui element to the class that goes with the type. 716 /** This is mostly used to check if you can cast a gui element to the class that goes with the type.
717 Most gui elements will only support their own type, but if you derive your own classes from interfaces 717 Most gui elements will only support their own type, but if you derive your own classes from interfaces
718 you can overload this function and add a check for the type of the base-class additionally. 718 you can overload this function and add a check for the type of the base-class additionally.
719 This allows for checks comparable to the dynamic_cast of c++ with enabled rtti. 719 This allows for checks comparable to the dynamic_cast of c++ with enabled rtti.
720 Note that you can't do that by calling BaseClass::hasType(type), but you have to do an explicit 720 Note that you can't do that by calling BaseClass::hasType(type), but you have to do an explicit
721 comparison check, because otherwise the base class usually just checks for the membervariable 721 comparison check, because otherwise the base class usually just checks for the membervariable
722 Type which contains the type of your derived class. 722 Type which contains the type of your derived class.
723 */ 723 */
724 virtual bool hasType(EGUI_ELEMENT_TYPE type) const 724 virtual bool hasType(EGUI_ELEMENT_TYPE type) const
725 { 725 {
726 return type == Type; 726 return type == Type;
727 } 727 }
728 728
729 729
730 //! Returns the type name of the gui element. 730 //! Returns the type name of the gui element.
731 /** This is needed serializing elements. For serializing your own elements, override this function 731 /** This is needed serializing elements. For serializing your own elements, override this function
732 and return your own type name which is created by your IGUIElementFactory */ 732 and return your own type name which is created by your IGUIElementFactory */
733 virtual const c8* getTypeName() const 733 virtual const c8* getTypeName() const
734 { 734 {
735 return GUIElementTypeNames[Type]; 735 return GUIElementTypeNames[Type];
736 } 736 }
737 737
738 //! Returns the name of the element. 738 //! Returns the name of the element.
739 /** \return Name as character string. */ 739 /** \return Name as character string. */
740 virtual const c8* getName() const 740 virtual const c8* getName() const
741 { 741 {
742 return Name.c_str(); 742 return Name.c_str();
743 } 743 }
744 744
745 745
746 //! Sets the name of the element. 746 //! Sets the name of the element.
747 /** \param name New name of the gui element. */ 747 /** \param name New name of the gui element. */
748 virtual void setName(const c8* name) 748 virtual void setName(const c8* name)
749 { 749 {
750 Name = name; 750 Name = name;
751 } 751 }
752 752
753 753
754 //! Sets the name of the element. 754 //! Sets the name of the element.
755 /** \param name New name of the gui element. */ 755 /** \param name New name of the gui element. */
756 virtual void setName(const core::stringc& name) 756 virtual void setName(const core::stringc& name)
757 { 757 {
758 Name = name; 758 Name = name;
759 } 759 }
760 760
761 761
762 //! Writes attributes of the scene node. 762 //! Writes attributes of the scene node.
763 /** Implement this to expose the attributes of your scene node for 763 /** Implement this to expose the attributes of your scene node for
764 scripting languages, editors, debuggers or xml serialization purposes. */ 764 scripting languages, editors, debuggers or xml serialization purposes. */
765 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const 765 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
766 { 766 {
767 out->addString("Name", Name.c_str()); 767 out->addString("Name", Name.c_str());
768 out->addInt("Id", ID ); 768 out->addInt("Id", ID );
769 out->addString("Caption", getText()); 769 out->addString("Caption", getText());
770 out->addRect("Rect", DesiredRect); 770 out->addRect("Rect", DesiredRect);
771 out->addPosition2d("MinSize", core::position2di(MinSize.Width, MinSize.Height)); 771 out->addPosition2d("MinSize", core::position2di(MinSize.Width, MinSize.Height));
772 out->addPosition2d("MaxSize", core::position2di(MaxSize.Width, MaxSize.Height)); 772 out->addPosition2d("MaxSize", core::position2di(MaxSize.Width, MaxSize.Height));
773 out->addEnum("LeftAlign", AlignLeft, GUIAlignmentNames); 773 out->addEnum("LeftAlign", AlignLeft, GUIAlignmentNames);
774 out->addEnum("RightAlign", AlignRight, GUIAlignmentNames); 774 out->addEnum("RightAlign", AlignRight, GUIAlignmentNames);
775 out->addEnum("TopAlign", AlignTop, GUIAlignmentNames); 775 out->addEnum("TopAlign", AlignTop, GUIAlignmentNames);
776 out->addEnum("BottomAlign", AlignBottom, GUIAlignmentNames); 776 out->addEnum("BottomAlign", AlignBottom, GUIAlignmentNames);
777 out->addBool("Visible", IsVisible); 777 out->addBool("Visible", IsVisible);
778 out->addBool("Enabled", IsEnabled); 778 out->addBool("Enabled", IsEnabled);
779 out->addBool("TabStop", IsTabStop); 779 out->addBool("TabStop", IsTabStop);
780 out->addBool("TabGroup", IsTabGroup); 780 out->addBool("TabGroup", IsTabGroup);
781 out->addInt("TabOrder", TabOrder); 781 out->addInt("TabOrder", TabOrder);
782 out->addBool("NoClip", NoClip); 782 out->addBool("NoClip", NoClip);
783 } 783 }
784 784
785 785
786 //! Reads attributes of the scene node. 786 //! Reads attributes of the scene node.
787 /** Implement this to set the attributes of your scene node for 787 /** Implement this to set the attributes of your scene node for
788 scripting languages, editors, debuggers or xml deserialization purposes. */ 788 scripting languages, editors, debuggers or xml deserialization purposes. */
789 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) 789 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
790 { 790 {
791 setName(in->getAttributeAsString("Name")); 791 setName(in->getAttributeAsString("Name"));
792 setID(in->getAttributeAsInt("Id")); 792 setID(in->getAttributeAsInt("Id"));
793 setText(in->getAttributeAsStringW("Caption").c_str()); 793 setText(in->getAttributeAsStringW("Caption").c_str());
794 setVisible(in->getAttributeAsBool("Visible")); 794 setVisible(in->getAttributeAsBool("Visible"));
795 setEnabled(in->getAttributeAsBool("Enabled")); 795 setEnabled(in->getAttributeAsBool("Enabled"));
796 IsTabStop = in->getAttributeAsBool("TabStop"); 796 IsTabStop = in->getAttributeAsBool("TabStop");
797 IsTabGroup = in->getAttributeAsBool("TabGroup"); 797 IsTabGroup = in->getAttributeAsBool("TabGroup");
798 TabOrder = in->getAttributeAsInt("TabOrder"); 798 TabOrder = in->getAttributeAsInt("TabOrder");
799 799
800 core::position2di p = in->getAttributeAsPosition2d("MaxSize"); 800 core::position2di p = in->getAttributeAsPosition2d("MaxSize");
801 setMaxSize(core::dimension2du(p.X,p.Y)); 801 setMaxSize(core::dimension2du(p.X,p.Y));
802 802
803 p = in->getAttributeAsPosition2d("MinSize"); 803 p = in->getAttributeAsPosition2d("MinSize");
804 setMinSize(core::dimension2du(p.X,p.Y)); 804 setMinSize(core::dimension2du(p.X,p.Y));
805 805
806 setAlignment((EGUI_ALIGNMENT) in->getAttributeAsEnumeration("LeftAlign", GUIAlignmentNames), 806 setAlignment((EGUI_ALIGNMENT) in->getAttributeAsEnumeration("LeftAlign", GUIAlignmentNames),
807 (EGUI_ALIGNMENT)in->getAttributeAsEnumeration("RightAlign", GUIAlignmentNames), 807 (EGUI_ALIGNMENT)in->getAttributeAsEnumeration("RightAlign", GUIAlignmentNames),
808 (EGUI_ALIGNMENT)in->getAttributeAsEnumeration("TopAlign", GUIAlignmentNames), 808 (EGUI_ALIGNMENT)in->getAttributeAsEnumeration("TopAlign", GUIAlignmentNames),
809 (EGUI_ALIGNMENT)in->getAttributeAsEnumeration("BottomAlign", GUIAlignmentNames)); 809 (EGUI_ALIGNMENT)in->getAttributeAsEnumeration("BottomAlign", GUIAlignmentNames));
810 810
811 setRelativePosition(in->getAttributeAsRect("Rect")); 811 setRelativePosition(in->getAttributeAsRect("Rect"));
812 812
813 setNotClipped(in->getAttributeAsBool("NoClip")); 813 setNotClipped(in->getAttributeAsBool("NoClip"));
814 } 814 }
815 815
816protected: 816protected:
817 // not virtual because needed in constructor 817 // not virtual because needed in constructor
818 void addChildToEnd(IGUIElement* child) 818 void addChildToEnd(IGUIElement* child)
819 { 819 {
820 if (child) 820 if (child)
821 { 821 {
822 child->grab(); // prevent destruction when removed 822 child->grab(); // prevent destruction when removed
823 child->remove(); // remove from old parent 823 child->remove(); // remove from old parent
824 child->LastParentRect = getAbsolutePosition(); 824 child->LastParentRect = getAbsolutePosition();
825 child->Parent = this; 825 child->Parent = this;
826 Children.push_back(child); 826 Children.push_back(child);
827 } 827 }
828 } 828 }
829 829
830 // not virtual because needed in constructor 830 // not virtual because needed in constructor
831 void recalculateAbsolutePosition(bool recursive) 831 void recalculateAbsolutePosition(bool recursive)
832 { 832 {
833 core::rect<s32> parentAbsolute(0,0,0,0); 833 core::rect<s32> parentAbsolute(0,0,0,0);
834 core::rect<s32> parentAbsoluteClip; 834 core::rect<s32> parentAbsoluteClip;
835 f32 fw=0.f, fh=0.f; 835 f32 fw=0.f, fh=0.f;
836 836
837 if (Parent) 837 if (Parent)
838 { 838 {
839 parentAbsolute = Parent->AbsoluteRect; 839 parentAbsolute = Parent->AbsoluteRect;
840 840
841 if (NoClip) 841 if (NoClip)
842 { 842 {
843 IGUIElement* p=this; 843 IGUIElement* p=this;
844 while (p && p->Parent) 844 while (p && p->Parent)
845 p = p->Parent; 845 p = p->Parent;
846 parentAbsoluteClip = p->AbsoluteClippingRect; 846 parentAbsoluteClip = p->AbsoluteClippingRect;
847 } 847 }
848 else 848 else
849 parentAbsoluteClip = Parent->AbsoluteClippingRect; 849 parentAbsoluteClip = Parent->AbsoluteClippingRect;
850 } 850 }
851 851
852 const s32 diffx = parentAbsolute.getWidth() - LastParentRect.getWidth(); 852 const s32 diffx = parentAbsolute.getWidth() - LastParentRect.getWidth();
853 const s32 diffy = parentAbsolute.getHeight() - LastParentRect.getHeight(); 853 const s32 diffy = parentAbsolute.getHeight() - LastParentRect.getHeight();
854 854
855 if (AlignLeft == EGUIA_SCALE || AlignRight == EGUIA_SCALE) 855 if (AlignLeft == EGUIA_SCALE || AlignRight == EGUIA_SCALE)
856 fw = (f32)parentAbsolute.getWidth(); 856 fw = (f32)parentAbsolute.getWidth();
857 857
858 if (AlignTop == EGUIA_SCALE || AlignBottom == EGUIA_SCALE) 858 if (AlignTop == EGUIA_SCALE || AlignBottom == EGUIA_SCALE)
859 fh = (f32)parentAbsolute.getHeight(); 859 fh = (f32)parentAbsolute.getHeight();
860 860
861 switch (AlignLeft) 861 switch (AlignLeft)
862 { 862 {
863 case EGUIA_UPPERLEFT: 863 case EGUIA_UPPERLEFT:
864 break; 864 break;
865 case EGUIA_LOWERRIGHT: 865 case EGUIA_LOWERRIGHT:
866 DesiredRect.UpperLeftCorner.X += diffx; 866 DesiredRect.UpperLeftCorner.X += diffx;
867 break; 867 break;
868 case EGUIA_CENTER: 868 case EGUIA_CENTER:
869 DesiredRect.UpperLeftCorner.X += diffx/2; 869 DesiredRect.UpperLeftCorner.X += diffx/2;
870 break; 870 break;
871 case EGUIA_SCALE: 871 case EGUIA_SCALE:
872 DesiredRect.UpperLeftCorner.X = core::round32(ScaleRect.UpperLeftCorner.X * fw); 872 DesiredRect.UpperLeftCorner.X = core::round32(ScaleRect.UpperLeftCorner.X * fw);
873 break; 873 break;
874 } 874 }
875 875
876 switch (AlignRight) 876 switch (AlignRight)
877 { 877 {
878 case EGUIA_UPPERLEFT: 878 case EGUIA_UPPERLEFT:
879 break; 879 break;
880 case EGUIA_LOWERRIGHT: 880 case EGUIA_LOWERRIGHT:
881 DesiredRect.LowerRightCorner.X += diffx; 881 DesiredRect.LowerRightCorner.X += diffx;
882 break; 882 break;
883 case EGUIA_CENTER: 883 case EGUIA_CENTER:
884 DesiredRect.LowerRightCorner.X += diffx/2; 884 DesiredRect.LowerRightCorner.X += diffx/2;
885 break; 885 break;
886 case EGUIA_SCALE: 886 case EGUIA_SCALE:
887 DesiredRect.LowerRightCorner.X = core::round32(ScaleRect.LowerRightCorner.X * fw); 887 DesiredRect.LowerRightCorner.X = core::round32(ScaleRect.LowerRightCorner.X * fw);
888 break; 888 break;
889 } 889 }
890 890
891 switch (AlignTop) 891 switch (AlignTop)
892 { 892 {
893 case EGUIA_UPPERLEFT: 893 case EGUIA_UPPERLEFT:
894 break; 894 break;
895 case EGUIA_LOWERRIGHT: 895 case EGUIA_LOWERRIGHT:
896 DesiredRect.UpperLeftCorner.Y += diffy; 896 DesiredRect.UpperLeftCorner.Y += diffy;
897 break; 897 break;
898 case EGUIA_CENTER: 898 case EGUIA_CENTER:
899 DesiredRect.UpperLeftCorner.Y += diffy/2; 899 DesiredRect.UpperLeftCorner.Y += diffy/2;
900 break; 900 break;
901 case EGUIA_SCALE: 901 case EGUIA_SCALE:
902 DesiredRect.UpperLeftCorner.Y = core::round32(ScaleRect.UpperLeftCorner.Y * fh); 902 DesiredRect.UpperLeftCorner.Y = core::round32(ScaleRect.UpperLeftCorner.Y * fh);
903 break; 903 break;
904 } 904 }
905 905
906 switch (AlignBottom) 906 switch (AlignBottom)
907 { 907 {
908 case EGUIA_UPPERLEFT: 908 case EGUIA_UPPERLEFT:
909 break; 909 break;
910 case EGUIA_LOWERRIGHT: 910 case EGUIA_LOWERRIGHT:
911 DesiredRect.LowerRightCorner.Y += diffy; 911 DesiredRect.LowerRightCorner.Y += diffy;
912 break; 912 break;
913 case EGUIA_CENTER: 913 case EGUIA_CENTER:
914 DesiredRect.LowerRightCorner.Y += diffy/2; 914 DesiredRect.LowerRightCorner.Y += diffy/2;
915 break; 915 break;
916 case EGUIA_SCALE: 916 case EGUIA_SCALE:
917 DesiredRect.LowerRightCorner.Y = core::round32(ScaleRect.LowerRightCorner.Y * fh); 917 DesiredRect.LowerRightCorner.Y = core::round32(ScaleRect.LowerRightCorner.Y * fh);
918 break; 918 break;
919 } 919 }
920 920
921 RelativeRect = DesiredRect; 921 RelativeRect = DesiredRect;
922 922
923 const s32 w = RelativeRect.getWidth(); 923 const s32 w = RelativeRect.getWidth();
924 const s32 h = RelativeRect.getHeight(); 924 const s32 h = RelativeRect.getHeight();
925 925
926 // make sure the desired rectangle is allowed 926 // make sure the desired rectangle is allowed
927 if (w < (s32)MinSize.Width) 927 if (w < (s32)MinSize.Width)
928 RelativeRect.LowerRightCorner.X = RelativeRect.UpperLeftCorner.X + MinSize.Width; 928 RelativeRect.LowerRightCorner.X = RelativeRect.UpperLeftCorner.X + MinSize.Width;
929 if (h < (s32)MinSize.Height) 929 if (h < (s32)MinSize.Height)
930 RelativeRect.LowerRightCorner.Y = RelativeRect.UpperLeftCorner.Y + MinSize.Height; 930 RelativeRect.LowerRightCorner.Y = RelativeRect.UpperLeftCorner.Y + MinSize.Height;
931 if (MaxSize.Width && w > (s32)MaxSize.Width) 931 if (MaxSize.Width && w > (s32)MaxSize.Width)
932 RelativeRect.LowerRightCorner.X = RelativeRect.UpperLeftCorner.X + MaxSize.Width; 932 RelativeRect.LowerRightCorner.X = RelativeRect.UpperLeftCorner.X + MaxSize.Width;
933 if (MaxSize.Height && h > (s32)MaxSize.Height) 933 if (MaxSize.Height && h > (s32)MaxSize.Height)
934 RelativeRect.LowerRightCorner.Y = RelativeRect.UpperLeftCorner.Y + MaxSize.Height; 934 RelativeRect.LowerRightCorner.Y = RelativeRect.UpperLeftCorner.Y + MaxSize.Height;
935 935
936 RelativeRect.repair(); 936 RelativeRect.repair();
937 937
938 AbsoluteRect = RelativeRect + parentAbsolute.UpperLeftCorner; 938 AbsoluteRect = RelativeRect + parentAbsolute.UpperLeftCorner;
939 939
940 if (!Parent) 940 if (!Parent)
941 parentAbsoluteClip = AbsoluteRect; 941 parentAbsoluteClip = AbsoluteRect;
942 942
943 AbsoluteClippingRect = AbsoluteRect; 943 AbsoluteClippingRect = AbsoluteRect;
944 AbsoluteClippingRect.clipAgainst(parentAbsoluteClip); 944 AbsoluteClippingRect.clipAgainst(parentAbsoluteClip);
945 945
946 LastParentRect = parentAbsolute; 946 LastParentRect = parentAbsolute;
947 947
948 if ( recursive ) 948 if ( recursive )
949 { 949 {
950 // update all children 950 // update all children
951 core::list<IGUIElement*>::Iterator it = Children.begin(); 951 core::list<IGUIElement*>::Iterator it = Children.begin();
952 for (; it != Children.end(); ++it) 952 for (; it != Children.end(); ++it)
953 { 953 {
954 (*it)->recalculateAbsolutePosition(recursive); 954 (*it)->recalculateAbsolutePosition(recursive);
955 } 955 }
956 } 956 }
957 } 957 }
958 958
959protected: 959protected:
960 960
961 //! List of all children of this element 961 //! List of all children of this element
962 core::list<IGUIElement*> Children; 962 core::list<IGUIElement*> Children;
963 963
964 //! Pointer to the parent 964 //! Pointer to the parent
965 IGUIElement* Parent; 965 IGUIElement* Parent;
966 966
967 //! relative rect of element 967 //! relative rect of element
968 core::rect<s32> RelativeRect; 968 core::rect<s32> RelativeRect;
969 969
970 //! absolute rect of element 970 //! absolute rect of element
971 core::rect<s32> AbsoluteRect; 971 core::rect<s32> AbsoluteRect;
972 972
973 //! absolute clipping rect of element 973 //! absolute clipping rect of element
974 core::rect<s32> AbsoluteClippingRect; 974 core::rect<s32> AbsoluteClippingRect;
975 975
976 //! the rectangle the element would prefer to be, 976 //! the rectangle the element would prefer to be,
977 //! if it was not constrained by parent or max/min size 977 //! if it was not constrained by parent or max/min size
978 core::rect<s32> DesiredRect; 978 core::rect<s32> DesiredRect;
979 979
980 //! for calculating the difference when resizing parent 980 //! for calculating the difference when resizing parent
981 core::rect<s32> LastParentRect; 981 core::rect<s32> LastParentRect;
982 982
983 //! relative scale of the element inside its parent 983 //! relative scale of the element inside its parent
984 core::rect<f32> ScaleRect; 984 core::rect<f32> ScaleRect;
985 985
986 //! maximum and minimum size of the element 986 //! maximum and minimum size of the element
987 core::dimension2du MaxSize, MinSize; 987 core::dimension2du MaxSize, MinSize;
988 988
989 //! is visible? 989 //! is visible?
990 bool IsVisible; 990 bool IsVisible;
991 991
992 //! is enabled? 992 //! is enabled?
993 bool IsEnabled; 993 bool IsEnabled;
994 994
995 //! is a part of a larger whole and should not be serialized? 995 //! is a part of a larger whole and should not be serialized?
996 bool IsSubElement; 996 bool IsSubElement;
997 997
998 //! does this element ignore its parent's clipping rectangle? 998 //! does this element ignore its parent's clipping rectangle?
999 bool NoClip; 999 bool NoClip;
1000 1000
1001 //! caption 1001 //! caption
1002 core::stringw Text; 1002 core::stringw Text;
1003 1003
1004 //! tooltip 1004 //! tooltip
1005 core::stringw ToolTipText; 1005 core::stringw ToolTipText;
1006 1006
1007 //! users can set this for identificating the element by string 1007 //! users can set this for identificating the element by string
1008 core::stringc Name; 1008 core::stringc Name;
1009 1009
1010 //! users can set this for identificating the element by integer 1010 //! users can set this for identificating the element by integer
1011 s32 ID; 1011 s32 ID;
1012 1012
1013 //! tab stop like in windows 1013 //! tab stop like in windows
1014 bool IsTabStop; 1014 bool IsTabStop;
1015 1015
1016 //! tab order 1016 //! tab order
1017 s32 TabOrder; 1017 s32 TabOrder;
1018 1018
1019 //! tab groups are containers like windows, use ctrl+tab to navigate 1019 //! tab groups are containers like windows, use ctrl+tab to navigate
1020 bool IsTabGroup; 1020 bool IsTabGroup;
1021 1021
1022 //! tells the element how to act when its parent is resized 1022 //! tells the element how to act when its parent is resized
1023 EGUI_ALIGNMENT AlignLeft, AlignRight, AlignTop, AlignBottom; 1023 EGUI_ALIGNMENT AlignLeft, AlignRight, AlignTop, AlignBottom;
1024 1024
1025 //! GUI Environment 1025 //! GUI Environment
1026 IGUIEnvironment* Environment; 1026 IGUIEnvironment* Environment;
1027 1027
1028 //! type of element 1028 //! type of element
1029 EGUI_ELEMENT_TYPE Type; 1029 EGUI_ELEMENT_TYPE Type;
1030}; 1030};
1031 1031
1032 1032
1033} // end namespace gui 1033} // end namespace gui
1034} // end namespace irr 1034} // end namespace irr
1035 1035
1036#endif 1036#endif
1037 1037
diff --git a/libraries/irrlicht-1.8/include/IGUIElementFactory.h b/libraries/irrlicht-1.8/include/IGUIElementFactory.h
index 348038a..ca2df8b 100644
--- a/libraries/irrlicht-1.8/include/IGUIElementFactory.h
+++ b/libraries/irrlicht-1.8/include/IGUIElementFactory.h
@@ -1,66 +1,66 @@
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#ifndef __I_GUI_ELEMENT_FACTORY_H_INCLUDED__ 5#ifndef __I_GUI_ELEMENT_FACTORY_H_INCLUDED__
6#define __I_GUI_ELEMENT_FACTORY_H_INCLUDED__ 6#define __I_GUI_ELEMENT_FACTORY_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "EGUIElementTypes.h" 9#include "EGUIElementTypes.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13 13
14namespace gui 14namespace gui
15{ 15{
16 class IGUIElement; 16 class IGUIElement;
17 17
18 //! Interface making it possible to dynamically create GUI elements 18 //! Interface making it possible to dynamically create GUI elements
19 /** To be able to add custom elements to Irrlicht and to make it possible for the 19 /** To be able to add custom elements to Irrlicht and to make it possible for the
20 scene manager to save and load them, simply implement this interface and register it 20 scene manager to save and load them, simply implement this interface and register it
21 in your gui environment via IGUIEnvironment::registerGUIElementFactory. 21 in your gui environment via IGUIEnvironment::registerGUIElementFactory.
22 Note: When implementing your own element factory, don't call IGUIEnvironment::grab() to 22 Note: When implementing your own element factory, don't call IGUIEnvironment::grab() to
23 increase the reference counter of the environment. This is not necessary because the 23 increase the reference counter of the environment. This is not necessary because the
24 it will grab() the factory anyway, and otherwise cyclic references will be created. 24 it will grab() the factory anyway, and otherwise cyclic references will be created.
25 */ 25 */
26 class IGUIElementFactory : public virtual IReferenceCounted 26 class IGUIElementFactory : public virtual IReferenceCounted
27 { 27 {
28 public: 28 public:
29 29
30 //! adds an element to the gui environment based on its type id 30 //! adds an element to the gui environment based on its type id
31 /** \param type: Type of the element to add. 31 /** \param type: Type of the element to add.
32 \param parent: Parent scene node of the new element, can be null to add to the root. 32 \param parent: Parent scene node of the new element, can be null to add to the root.
33 \return Pointer to the new element or null if not successful. */ 33 \return Pointer to the new element or null if not successful. */
34 virtual IGUIElement* addGUIElement(EGUI_ELEMENT_TYPE type, IGUIElement* parent=0) = 0; 34 virtual IGUIElement* addGUIElement(EGUI_ELEMENT_TYPE type, IGUIElement* parent=0) = 0;
35 35
36 //! adds a GUI element to the GUI Environment based on its type name 36 //! adds a GUI element to the GUI Environment based on its type name
37 /** \param typeName: Type name of the element to add. 37 /** \param typeName: Type name of the element to add.
38 \param parent: Parent scene node of the new element, can be null to add it to the root. 38 \param parent: Parent scene node of the new element, can be null to add it to the root.
39 \return Pointer to the new element or null if not successful. */ 39 \return Pointer to the new element or null if not successful. */
40 virtual IGUIElement* addGUIElement(const c8* typeName, IGUIElement* parent=0) = 0; 40 virtual IGUIElement* addGUIElement(const c8* typeName, IGUIElement* parent=0) = 0;
41 41
42 //! Get amount of GUI element types this factory is able to create 42 //! Get amount of GUI element types this factory is able to create
43 virtual s32 getCreatableGUIElementTypeCount() const = 0; 43 virtual s32 getCreatableGUIElementTypeCount() const = 0;
44 44
45 //! Get type of a createable element type 45 //! Get type of a createable element type
46 /** \param idx: Index of the element type in this factory. Must be a value between 0 and 46 /** \param idx: Index of the element type in this factory. Must be a value between 0 and
47 getCreatableGUIElementTypeCount() */ 47 getCreatableGUIElementTypeCount() */
48 virtual EGUI_ELEMENT_TYPE getCreateableGUIElementType(s32 idx) const = 0; 48 virtual EGUI_ELEMENT_TYPE getCreateableGUIElementType(s32 idx) const = 0;
49 49
50 //! Get type name of a createable GUI element type by index 50 //! Get type name of a createable GUI element type by index
51 /** \param idx: Index of the type in this factory. Must be a value between 0 and 51 /** \param idx: Index of the type in this factory. Must be a value between 0 and
52 getCreatableGUIElementTypeCount() */ 52 getCreatableGUIElementTypeCount() */
53 virtual const c8* getCreateableGUIElementTypeName(s32 idx) const = 0; 53 virtual const c8* getCreateableGUIElementTypeName(s32 idx) const = 0;
54 54
55 //! returns type name of a createable GUI element 55 //! returns type name of a createable GUI element
56 /** \param type: Type of GUI element. 56 /** \param type: Type of GUI element.
57 \return Name of the type if this factory can create the type, otherwise 0. */ 57 \return Name of the type if this factory can create the type, otherwise 0. */
58 virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type) const = 0; 58 virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type) const = 0;
59 }; 59 };
60 60
61 61
62} // end namespace gui 62} // end namespace gui
63} // end namespace irr 63} // end namespace irr
64 64
65#endif // __I_GUI_ELEMENT_FACTORY_H_INCLUDED__ 65#endif // __I_GUI_ELEMENT_FACTORY_H_INCLUDED__
66 66
diff --git a/libraries/irrlicht-1.8/include/IGUIEnvironment.h b/libraries/irrlicht-1.8/include/IGUIEnvironment.h
index 0291107..219e419 100644
--- a/libraries/irrlicht-1.8/include/IGUIEnvironment.h
+++ b/libraries/irrlicht-1.8/include/IGUIEnvironment.h
@@ -1,620 +1,620 @@
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#ifndef __I_GUI_ENVIRONMENT_H_INCLUDED__ 5#ifndef __I_GUI_ENVIRONMENT_H_INCLUDED__
6#define __I_GUI_ENVIRONMENT_H_INCLUDED__ 6#define __I_GUI_ENVIRONMENT_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "IGUISkin.h" 9#include "IGUISkin.h"
10#include "rect.h" 10#include "rect.h"
11#include "EMessageBoxFlags.h" 11#include "EMessageBoxFlags.h"
12#include "IEventReceiver.h" 12#include "IEventReceiver.h"
13#include "IXMLReader.h" 13#include "IXMLReader.h"
14#include "path.h" 14#include "path.h"
15 15
16namespace irr 16namespace irr
17{ 17{
18 class IOSOperator; 18 class IOSOperator;
19 class IEventReceiver; 19 class IEventReceiver;
20 20
21 namespace io 21 namespace io
22 { 22 {
23 class IXMLWriter; 23 class IXMLWriter;
24 class IReadFile; 24 class IReadFile;
25 class IWriteFile; 25 class IWriteFile;
26 class IFileSystem; 26 class IFileSystem;
27 } // end namespace io 27 } // end namespace io
28 namespace video 28 namespace video
29 { 29 {
30 class IVideoDriver; 30 class IVideoDriver;
31 class ITexture; 31 class ITexture;
32 } // end namespace video 32 } // end namespace video
33 33
34namespace gui 34namespace gui
35{ 35{
36 36
37class IGUIElement; 37class IGUIElement;
38class IGUIFont; 38class IGUIFont;
39class IGUISpriteBank; 39class IGUISpriteBank;
40class IGUIScrollBar; 40class IGUIScrollBar;
41class IGUIImage; 41class IGUIImage;
42class IGUIMeshViewer; 42class IGUIMeshViewer;
43class IGUICheckBox; 43class IGUICheckBox;
44class IGUIListBox; 44class IGUIListBox;
45class IGUITreeView; 45class IGUITreeView;
46class IGUIImageList; 46class IGUIImageList;
47class IGUIFileOpenDialog; 47class IGUIFileOpenDialog;
48class IGUIColorSelectDialog; 48class IGUIColorSelectDialog;
49class IGUIInOutFader; 49class IGUIInOutFader;
50class IGUIStaticText; 50class IGUIStaticText;
51class IGUIEditBox; 51class IGUIEditBox;
52class IGUISpinBox; 52class IGUISpinBox;
53class IGUITabControl; 53class IGUITabControl;
54class IGUITab; 54class IGUITab;
55class IGUITable; 55class IGUITable;
56class IGUIContextMenu; 56class IGUIContextMenu;
57class IGUIComboBox; 57class IGUIComboBox;
58class IGUIToolBar; 58class IGUIToolBar;
59class IGUIButton; 59class IGUIButton;
60class IGUIWindow; 60class IGUIWindow;
61class IGUIElementFactory; 61class IGUIElementFactory;
62 62
63//! GUI Environment. Used as factory and manager of all other GUI elements. 63//! GUI Environment. Used as factory and manager of all other GUI elements.
64/** \par This element can create the following events of type EGUI_EVENT_TYPE (which are passed on to focused sub-elements): 64/** \par This element can create the following events of type EGUI_EVENT_TYPE (which are passed on to focused sub-elements):
65\li EGET_ELEMENT_FOCUS_LOST 65\li EGET_ELEMENT_FOCUS_LOST
66\li EGET_ELEMENT_FOCUSED 66\li EGET_ELEMENT_FOCUSED
67\li EGET_ELEMENT_LEFT 67\li EGET_ELEMENT_LEFT
68\li EGET_ELEMENT_HOVERED 68\li EGET_ELEMENT_HOVERED
69*/ 69*/
70class IGUIEnvironment : public virtual IReferenceCounted 70class IGUIEnvironment : public virtual IReferenceCounted
71{ 71{
72public: 72public:
73 73
74 //! Draws all gui elements by traversing the GUI environment starting at the root node. 74 //! Draws all gui elements by traversing the GUI environment starting at the root node.
75 virtual void drawAll() = 0; 75 virtual void drawAll() = 0;
76 76
77 //! Sets the focus to an element. 77 //! Sets the focus to an element.
78 /** Causes a EGET_ELEMENT_FOCUS_LOST event followed by a 78 /** Causes a EGET_ELEMENT_FOCUS_LOST event followed by a
79 EGET_ELEMENT_FOCUSED event. If someone absorbed either of the events, 79 EGET_ELEMENT_FOCUSED event. If someone absorbed either of the events,
80 then the focus will not be changed. 80 then the focus will not be changed.
81 \param element Pointer to the element which shall get the focus. 81 \param element Pointer to the element which shall get the focus.
82 \return True on success, false on failure */ 82 \return True on success, false on failure */
83 virtual bool setFocus(IGUIElement* element) = 0; 83 virtual bool setFocus(IGUIElement* element) = 0;
84 84
85 //! Returns the element which holds the focus. 85 //! Returns the element which holds the focus.
86 /** \return Pointer to the element with focus. */ 86 /** \return Pointer to the element with focus. */
87 virtual IGUIElement* getFocus() const = 0; 87 virtual IGUIElement* getFocus() const = 0;
88 88
89 //! Returns the element which was last under the mouse cursor 89 //! Returns the element which was last under the mouse cursor
90 /** NOTE: This information is updated _after_ the user-eventreceiver 90 /** NOTE: This information is updated _after_ the user-eventreceiver
91 received it's mouse-events. To find the hovered element while catching 91 received it's mouse-events. To find the hovered element while catching
92 mouse events you have to use instead: 92 mouse events you have to use instead:
93 IGUIEnvironment::getRootGUIElement()->getElementFromPoint(mousePos); 93 IGUIEnvironment::getRootGUIElement()->getElementFromPoint(mousePos);
94 \return Pointer to the element under the mouse. */ 94 \return Pointer to the element under the mouse. */
95 virtual IGUIElement* getHovered() const = 0; 95 virtual IGUIElement* getHovered() const = 0;
96 96
97 //! Removes the focus from an element. 97 //! Removes the focus from an element.
98 /** Causes a EGET_ELEMENT_FOCUS_LOST event. If the event is absorbed 98 /** Causes a EGET_ELEMENT_FOCUS_LOST event. If the event is absorbed
99 then the focus will not be changed. 99 then the focus will not be changed.
100 \param element Pointer to the element which shall lose the focus. 100 \param element Pointer to the element which shall lose the focus.
101 \return True on success, false on failure */ 101 \return True on success, false on failure */
102 virtual bool removeFocus(IGUIElement* element) = 0; 102 virtual bool removeFocus(IGUIElement* element) = 0;
103 103
104 //! Returns whether the element has focus 104 //! Returns whether the element has focus
105 /** \param element Pointer to the element which is tested. 105 /** \param element Pointer to the element which is tested.
106 \return True if the element has focus, else false. */ 106 \return True if the element has focus, else false. */
107 virtual bool hasFocus(IGUIElement* element) const = 0; 107 virtual bool hasFocus(IGUIElement* element) const = 0;
108 108
109 //! Returns the current video driver. 109 //! Returns the current video driver.
110 /** \return Pointer to the video driver. */ 110 /** \return Pointer to the video driver. */
111 virtual video::IVideoDriver* getVideoDriver() const = 0; 111 virtual video::IVideoDriver* getVideoDriver() const = 0;
112 112
113 //! Returns the file system. 113 //! Returns the file system.
114 /** \return Pointer to the file system. */ 114 /** \return Pointer to the file system. */
115 virtual io::IFileSystem* getFileSystem() const = 0; 115 virtual io::IFileSystem* getFileSystem() const = 0;
116 116
117 //! returns a pointer to the OS operator 117 //! returns a pointer to the OS operator
118 /** \return Pointer to the OS operator. */ 118 /** \return Pointer to the OS operator. */
119 virtual IOSOperator* getOSOperator() const = 0; 119 virtual IOSOperator* getOSOperator() const = 0;
120 120
121 //! Removes all elements from the environment. 121 //! Removes all elements from the environment.
122 virtual void clear() = 0; 122 virtual void clear() = 0;
123 123
124 //! Posts an input event to the environment. 124 //! Posts an input event to the environment.
125 /** Usually you do not have to 125 /** Usually you do not have to
126 use this method, it is used by the engine internally. 126 use this method, it is used by the engine internally.
127 \param event The event to post. 127 \param event The event to post.
128 \return True if succeeded, else false. */ 128 \return True if succeeded, else false. */
129 virtual bool postEventFromUser(const SEvent& event) = 0; 129 virtual bool postEventFromUser(const SEvent& event) = 0;
130 130
131 //! This sets a new event receiver for gui events. 131 //! This sets a new event receiver for gui events.
132 /** Usually you do not have to 132 /** Usually you do not have to
133 use this method, it is used by the engine internally. 133 use this method, it is used by the engine internally.
134 \param evr Pointer to the new receiver. */ 134 \param evr Pointer to the new receiver. */
135 virtual void setUserEventReceiver(IEventReceiver* evr) = 0; 135 virtual void setUserEventReceiver(IEventReceiver* evr) = 0;
136 136
137 //! Returns pointer to the current gui skin. 137 //! Returns pointer to the current gui skin.
138 /** \return Pointer to the GUI skin. */ 138 /** \return Pointer to the GUI skin. */
139 virtual IGUISkin* getSkin() const = 0; 139 virtual IGUISkin* getSkin() const = 0;
140 140
141 //! Sets a new GUI Skin 141 //! Sets a new GUI Skin
142 /** You can use this to change the appearance of the whole GUI 142 /** You can use this to change the appearance of the whole GUI
143 Environment. You can set one of the built-in skins or implement your 143 Environment. You can set one of the built-in skins or implement your
144 own class derived from IGUISkin and enable it using this method. 144 own class derived from IGUISkin and enable it using this method.
145 To set for example the built-in Windows classic skin, use the following 145 To set for example the built-in Windows classic skin, use the following
146 code: 146 code:
147 \code 147 \code
148 gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC); 148 gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC);
149 environment->setSkin(newskin); 149 environment->setSkin(newskin);
150 newskin->drop(); 150 newskin->drop();
151 \endcode 151 \endcode
152 \param skin New skin to use. 152 \param skin New skin to use.
153 */ 153 */
154 virtual void setSkin(IGUISkin* skin) = 0; 154 virtual void setSkin(IGUISkin* skin) = 0;
155 155
156 //! Creates a new GUI Skin based on a template. 156 //! Creates a new GUI Skin based on a template.
157 /** Use setSkin() to set the created skin. 157 /** Use setSkin() to set the created skin.
158 \param type The type of the new skin. 158 \param type The type of the new skin.
159 \return Pointer to the created skin. 159 \return Pointer to the created skin.
160 If you no longer need it, you should call IGUISkin::drop(). 160 If you no longer need it, you should call IGUISkin::drop().
161 See IReferenceCounted::drop() for more information. */ 161 See IReferenceCounted::drop() for more information. */
162 virtual IGUISkin* createSkin(EGUI_SKIN_TYPE type) = 0; 162 virtual IGUISkin* createSkin(EGUI_SKIN_TYPE type) = 0;
163 163
164 164
165 //! Creates the image list from the given texture. 165 //! Creates the image list from the given texture.
166 /** \param texture Texture to split into images 166 /** \param texture Texture to split into images
167 \param imageSize Dimension of each image 167 \param imageSize Dimension of each image
168 \param useAlphaChannel Flag whether alpha channel of the texture should be honored. 168 \param useAlphaChannel Flag whether alpha channel of the texture should be honored.
169 \return Pointer to the font. Returns 0 if the font could not be loaded. 169 \return Pointer to the font. Returns 0 if the font could not be loaded.
170 This pointer should not be dropped. See IReferenceCounted::drop() for 170 This pointer should not be dropped. See IReferenceCounted::drop() for
171 more information. */ 171 more information. */
172 virtual IGUIImageList* createImageList( video::ITexture* texture, 172 virtual IGUIImageList* createImageList( video::ITexture* texture,
173 core::dimension2d<s32> imageSize, 173 core::dimension2d<s32> imageSize,
174 bool useAlphaChannel ) = 0; 174 bool useAlphaChannel ) = 0;
175 175
176 //! Returns pointer to the font with the specified filename. 176 //! Returns pointer to the font with the specified filename.
177 /** Loads the font if it was not loaded before. 177 /** Loads the font if it was not loaded before.
178 \param filename Filename of the Font. 178 \param filename Filename of the Font.
179 \return Pointer to the font. Returns 0 if the font could not be loaded. 179 \return Pointer to the font. Returns 0 if the font could not be loaded.
180 This pointer should not be dropped. See IReferenceCounted::drop() for 180 This pointer should not be dropped. See IReferenceCounted::drop() for
181 more information. */ 181 more information. */
182 virtual IGUIFont* getFont(const io::path& filename) = 0; 182 virtual IGUIFont* getFont(const io::path& filename) = 0;
183 183
184 //! Adds an externally loaded font to the font list. 184 //! Adds an externally loaded font to the font list.
185 /** This method allows to attach an already loaded font to the list of 185 /** This method allows to attach an already loaded font to the list of
186 existing fonts. The font is grabbed if non-null and adding was successful. 186 existing fonts. The font is grabbed if non-null and adding was successful.
187 \param name Name the font should be stored as. 187 \param name Name the font should be stored as.
188 \param font Pointer to font to add. 188 \param font Pointer to font to add.
189 \return Pointer to the font stored. This can differ from given parameter if the name previously existed. */ 189 \return Pointer to the font stored. This can differ from given parameter if the name previously existed. */
190 virtual IGUIFont* addFont(const io::path& name, IGUIFont* font) = 0; 190 virtual IGUIFont* addFont(const io::path& name, IGUIFont* font) = 0;
191 191
192 //! remove loaded font 192 //! remove loaded font
193 virtual void removeFont(IGUIFont* font) = 0; 193 virtual void removeFont(IGUIFont* font) = 0;
194 194
195 //! Returns the default built-in font. 195 //! Returns the default built-in font.
196 /** \return Pointer to the default built-in font. 196 /** \return Pointer to the default built-in font.
197 This pointer should not be dropped. See IReferenceCounted::drop() for 197 This pointer should not be dropped. See IReferenceCounted::drop() for
198 more information. */ 198 more information. */
199 virtual IGUIFont* getBuiltInFont() const = 0; 199 virtual IGUIFont* getBuiltInFont() const = 0;
200 200
201 //! Returns pointer to the sprite bank with the specified file name. 201 //! Returns pointer to the sprite bank with the specified file name.
202 /** Loads the bank if it was not loaded before. 202 /** Loads the bank if it was not loaded before.
203 \param filename Filename of the sprite bank's origin. 203 \param filename Filename of the sprite bank's origin.
204 \return Pointer to the sprite bank. Returns 0 if it could not be loaded. 204 \return Pointer to the sprite bank. Returns 0 if it could not be loaded.
205 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 205 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
206 virtual IGUISpriteBank* getSpriteBank(const io::path& filename) = 0; 206 virtual IGUISpriteBank* getSpriteBank(const io::path& filename) = 0;
207 207
208 //! Adds an empty sprite bank to the manager 208 //! Adds an empty sprite bank to the manager
209 /** \param name Name of the new sprite bank. 209 /** \param name Name of the new sprite bank.
210 \return Pointer to the sprite bank. 210 \return Pointer to the sprite bank.
211 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 211 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
212 virtual IGUISpriteBank* addEmptySpriteBank(const io::path& name) = 0; 212 virtual IGUISpriteBank* addEmptySpriteBank(const io::path& name) = 0;
213 213
214 //! Returns the root gui element. 214 //! Returns the root gui element.
215 /** This is the first gui element, the (direct or indirect) parent of all 215 /** This is the first gui element, the (direct or indirect) parent of all
216 other gui elements. It is a valid IGUIElement, with dimensions the same 216 other gui elements. It is a valid IGUIElement, with dimensions the same
217 size as the screen. 217 size as the screen.
218 \return Pointer to the root element of the GUI. The returned pointer 218 \return Pointer to the root element of the GUI. The returned pointer
219 should not be dropped. See IReferenceCounted::drop() for more 219 should not be dropped. See IReferenceCounted::drop() for more
220 information. */ 220 information. */
221 virtual IGUIElement* getRootGUIElement() = 0; 221 virtual IGUIElement* getRootGUIElement() = 0;
222 222
223 //! Adds a button element. 223 //! Adds a button element.
224 /** \param rectangle Rectangle specifying the borders of the button. 224 /** \param rectangle Rectangle specifying the borders of the button.
225 \param parent Parent gui element of the button. 225 \param parent Parent gui element of the button.
226 \param id Id with which the gui element can be identified. 226 \param id Id with which the gui element can be identified.
227 \param text Text displayed on the button. 227 \param text Text displayed on the button.
228 \param tooltiptext Text displayed in the tooltip. 228 \param tooltiptext Text displayed in the tooltip.
229 \return Pointer to the created button. Returns 0 if an error occurred. 229 \return Pointer to the created button. Returns 0 if an error occurred.
230 This pointer should not be dropped. See IReferenceCounted::drop() for 230 This pointer should not be dropped. See IReferenceCounted::drop() for
231 more information. */ 231 more information. */
232 virtual IGUIButton* addButton(const core::rect<s32>& rectangle, 232 virtual IGUIButton* addButton(const core::rect<s32>& rectangle,
233 IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, const wchar_t* tooltiptext = 0) = 0; 233 IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, const wchar_t* tooltiptext = 0) = 0;
234 234
235 //! Adds an empty window element. 235 //! Adds an empty window element.
236 /** \param rectangle Rectangle specifying the borders of the window. 236 /** \param rectangle Rectangle specifying the borders of the window.
237 \param modal Defines if the dialog is modal. This means, that all other 237 \param modal Defines if the dialog is modal. This means, that all other
238 gui elements which were created before the window cannot be used until 238 gui elements which were created before the window cannot be used until
239 it is removed. 239 it is removed.
240 \param text Text displayed as the window title. 240 \param text Text displayed as the window title.
241 \param parent Parent gui element of the window. 241 \param parent Parent gui element of the window.
242 \param id Id with which the gui element can be identified. 242 \param id Id with which the gui element can be identified.
243 \return Pointer to the created window. Returns 0 if an error occurred. 243 \return Pointer to the created window. Returns 0 if an error occurred.
244 This pointer should not be dropped. See IReferenceCounted::drop() for 244 This pointer should not be dropped. See IReferenceCounted::drop() for
245 more information. */ 245 more information. */
246 virtual IGUIWindow* addWindow(const core::rect<s32>& rectangle, bool modal = false, 246 virtual IGUIWindow* addWindow(const core::rect<s32>& rectangle, bool modal = false,
247 const wchar_t* text=0, IGUIElement* parent=0, s32 id=-1) = 0; 247 const wchar_t* text=0, IGUIElement* parent=0, s32 id=-1) = 0;
248 248
249 //! Adds a modal screen. 249 //! Adds a modal screen.
250 /** This control stops its parent's members from being able to receive 250 /** This control stops its parent's members from being able to receive
251 input until its last child is removed, it then deletes itself. 251 input until its last child is removed, it then deletes itself.
252 \param parent Parent gui element of the modal. 252 \param parent Parent gui element of the modal.
253 \return Pointer to the created modal. Returns 0 if an error occurred. 253 \return Pointer to the created modal. Returns 0 if an error occurred.
254 This pointer should not be dropped. See IReferenceCounted::drop() for 254 This pointer should not be dropped. See IReferenceCounted::drop() for
255 more information. */ 255 more information. */
256 virtual IGUIElement* addModalScreen(IGUIElement* parent) = 0; 256 virtual IGUIElement* addModalScreen(IGUIElement* parent) = 0;
257 257
258 //! Adds a message box. 258 //! Adds a message box.
259 /** \param caption Text to be displayed the title of the message box. 259 /** \param caption Text to be displayed the title of the message box.
260 \param text Text to be displayed in the body of the message box. 260 \param text Text to be displayed in the body of the message box.
261 \param modal Defines if the dialog is modal. This means, that all other 261 \param modal Defines if the dialog is modal. This means, that all other
262 gui elements which were created before the message box cannot be used 262 gui elements which were created before the message box cannot be used
263 until this messagebox is removed. 263 until this messagebox is removed.
264 \param flags Flags specifying the layout of the message box. For example 264 \param flags Flags specifying the layout of the message box. For example
265 to create a message box with an OK and a CANCEL button on it, set this 265 to create a message box with an OK and a CANCEL button on it, set this
266 to (EMBF_OK | EMBF_CANCEL). 266 to (EMBF_OK | EMBF_CANCEL).
267 \param parent Parent gui element of the message box. 267 \param parent Parent gui element of the message box.
268 \param id Id with which the gui element can be identified. 268 \param id Id with which the gui element can be identified.
269 \param image Optional texture which will be displayed beside the text as an image 269 \param image Optional texture which will be displayed beside the text as an image
270 \return Pointer to the created message box. Returns 0 if an error 270 \return Pointer to the created message box. Returns 0 if an error
271 occurred. This pointer should not be dropped. See 271 occurred. This pointer should not be dropped. See
272 IReferenceCounted::drop() for more information. */ 272 IReferenceCounted::drop() for more information. */
273 virtual IGUIWindow* addMessageBox(const wchar_t* caption, const wchar_t* text=0, 273 virtual IGUIWindow* addMessageBox(const wchar_t* caption, const wchar_t* text=0,
274 bool modal = true, s32 flags = EMBF_OK, IGUIElement* parent=0, s32 id=-1, video::ITexture* image=0) = 0; 274 bool modal = true, s32 flags = EMBF_OK, IGUIElement* parent=0, s32 id=-1, video::ITexture* image=0) = 0;
275 275
276 //! Adds a scrollbar. 276 //! Adds a scrollbar.
277 /** \param horizontal Specifies if the scroll bar is drawn horizontal 277 /** \param horizontal Specifies if the scroll bar is drawn horizontal
278 or vertical. 278 or vertical.
279 \param rectangle Rectangle specifying the borders of the scrollbar. 279 \param rectangle Rectangle specifying the borders of the scrollbar.
280 \param parent Parent gui element of the scroll bar. 280 \param parent Parent gui element of the scroll bar.
281 \param id Id to identify the gui element. 281 \param id Id to identify the gui element.
282 \return Pointer to the created scrollbar. Returns 0 if an error 282 \return Pointer to the created scrollbar. Returns 0 if an error
283 occurred. This pointer should not be dropped. See 283 occurred. This pointer should not be dropped. See
284 IReferenceCounted::drop() for more information. */ 284 IReferenceCounted::drop() for more information. */
285 virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle, 285 virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle,
286 IGUIElement* parent=0, s32 id=-1) = 0; 286 IGUIElement* parent=0, s32 id=-1) = 0;
287 287
288 //! Adds an image element. 288 //! Adds an image element.
289 /** \param image Image to be displayed. 289 /** \param image Image to be displayed.
290 \param pos Position of the image. The width and height of the image is 290 \param pos Position of the image. The width and height of the image is
291 taken from the image. 291 taken from the image.
292 \param useAlphaChannel Sets if the image should use the alpha channel 292 \param useAlphaChannel Sets if the image should use the alpha channel
293 of the texture to draw itself. 293 of the texture to draw itself.
294 \param parent Parent gui element of the image. 294 \param parent Parent gui element of the image.
295 \param id Id to identify the gui element. 295 \param id Id to identify the gui element.
296 \param text Title text of the image. 296 \param text Title text of the image.
297 \return Pointer to the created image element. Returns 0 if an error 297 \return Pointer to the created image element. Returns 0 if an error
298 occurred. This pointer should not be dropped. See 298 occurred. This pointer should not be dropped. See
299 IReferenceCounted::drop() for more information. */ 299 IReferenceCounted::drop() for more information. */
300 virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos, 300 virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos,
301 bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0; 301 bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
302 302
303 //! Adds an image element. 303 //! Adds an image element.
304 /** Use IGUIImage::setImage later to set the image to be displayed. 304 /** Use IGUIImage::setImage later to set the image to be displayed.
305 \param rectangle Rectangle specifying the borders of the image. 305 \param rectangle Rectangle specifying the borders of the image.
306 \param parent Parent gui element of the image. 306 \param parent Parent gui element of the image.
307 \param id Id to identify the gui element. 307 \param id Id to identify the gui element.
308 \param text Title text of the image. 308 \param text Title text of the image.
309 \param useAlphaChannel Sets if the image should use the alpha channel 309 \param useAlphaChannel Sets if the image should use the alpha channel
310 of the texture to draw itself. 310 of the texture to draw itself.
311 \return Pointer to the created image element. Returns 0 if an error 311 \return Pointer to the created image element. Returns 0 if an error
312 occurred. This pointer should not be dropped. See 312 occurred. This pointer should not be dropped. See
313 IReferenceCounted::drop() for more information. */ 313 IReferenceCounted::drop() for more information. */
314 virtual IGUIImage* addImage(const core::rect<s32>& rectangle, 314 virtual IGUIImage* addImage(const core::rect<s32>& rectangle,
315 IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true) = 0; 315 IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true) = 0;
316 316
317 //! Adds a checkbox element. 317 //! Adds a checkbox element.
318 /** \param checked Define the initial state of the check box. 318 /** \param checked Define the initial state of the check box.
319 \param rectangle Rectangle specifying the borders of the check box. 319 \param rectangle Rectangle specifying the borders of the check box.
320 \param parent Parent gui element of the check box. 320 \param parent Parent gui element of the check box.
321 \param id Id to identify the gui element. 321 \param id Id to identify the gui element.
322 \param text Title text of the check box. 322 \param text Title text of the check box.
323 \return Pointer to the created check box. Returns 0 if an error 323 \return Pointer to the created check box. Returns 0 if an error
324 occurred. This pointer should not be dropped. See 324 occurred. This pointer should not be dropped. See
325 IReferenceCounted::drop() for more information. */ 325 IReferenceCounted::drop() for more information. */
326 virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle, 326 virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle,
327 IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0; 327 IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
328 328
329 //! Adds a list box element. 329 //! Adds a list box element.
330 /** \param rectangle Rectangle specifying the borders of the list box. 330 /** \param rectangle Rectangle specifying the borders of the list box.
331 \param parent Parent gui element of the list box. 331 \param parent Parent gui element of the list box.
332 \param id Id to identify the gui element. 332 \param id Id to identify the gui element.
333 \param drawBackground Flag whether the background should be drawn. 333 \param drawBackground Flag whether the background should be drawn.
334 \return Pointer to the created list box. Returns 0 if an error occurred. 334 \return Pointer to the created list box. Returns 0 if an error occurred.
335 This pointer should not be dropped. See IReferenceCounted::drop() for 335 This pointer should not be dropped. See IReferenceCounted::drop() for
336 more information. */ 336 more information. */
337 virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle, 337 virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle,
338 IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) = 0; 338 IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) = 0;
339 339
340 //! Adds a tree view element. 340 //! Adds a tree view element.
341 /** \param rectangle Position and dimension of list box. 341 /** \param rectangle Position and dimension of list box.
342 \param parent Parent gui element of the list box. 342 \param parent Parent gui element of the list box.
343 \param id Id to identify the gui element. 343 \param id Id to identify the gui element.
344 \param drawBackground Flag whether the background should be drawn. 344 \param drawBackground Flag whether the background should be drawn.
345 \param scrollBarVertical Flag whether a vertical scrollbar should be used 345 \param scrollBarVertical Flag whether a vertical scrollbar should be used
346 \param scrollBarHorizontal Flag whether a horizontal scrollbar should be used 346 \param scrollBarHorizontal Flag whether a horizontal scrollbar should be used
347 \return Pointer to the created list box. Returns 0 if an error occurred. 347 \return Pointer to the created list box. Returns 0 if an error occurred.
348 This pointer should not be dropped. See IReferenceCounted::drop() for 348 This pointer should not be dropped. See IReferenceCounted::drop() for
349 more information. */ 349 more information. */
350 virtual IGUITreeView* addTreeView(const core::rect<s32>& rectangle, 350 virtual IGUITreeView* addTreeView(const core::rect<s32>& rectangle,
351 IGUIElement* parent=0, s32 id=-1, bool drawBackground=false, 351 IGUIElement* parent=0, s32 id=-1, bool drawBackground=false,
352 bool scrollBarVertical = true, bool scrollBarHorizontal = false) = 0; 352 bool scrollBarVertical = true, bool scrollBarHorizontal = false) = 0;
353 353
354 //! Adds a mesh viewer. Not 100% implemented yet. 354 //! Adds a mesh viewer. Not 100% implemented yet.
355 /** \param rectangle Rectangle specifying the borders of the mesh viewer. 355 /** \param rectangle Rectangle specifying the borders of the mesh viewer.
356 \param parent Parent gui element of the mesh viewer. 356 \param parent Parent gui element of the mesh viewer.
357 \param id Id to identify the gui element. 357 \param id Id to identify the gui element.
358 \param text Title text of the mesh viewer. 358 \param text Title text of the mesh viewer.
359 \return Pointer to the created mesh viewer. Returns 0 if an error 359 \return Pointer to the created mesh viewer. Returns 0 if an error
360 occurred. This pointer should not be dropped. See 360 occurred. This pointer should not be dropped. See
361 IReferenceCounted::drop() for more information. */ 361 IReferenceCounted::drop() for more information. */
362 virtual IGUIMeshViewer* addMeshViewer(const core::rect<s32>& rectangle, 362 virtual IGUIMeshViewer* addMeshViewer(const core::rect<s32>& rectangle,
363 IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0; 363 IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
364 364
365 //! Adds a file open dialog. 365 //! Adds a file open dialog.
366 /** \param title Text to be displayed as the title of the dialog. 366 /** \param title Text to be displayed as the title of the dialog.
367 \param modal Defines if the dialog is modal. This means, that all other 367 \param modal Defines if the dialog is modal. This means, that all other
368 gui elements which were created before the message box cannot be used 368 gui elements which were created before the message box cannot be used
369 until this messagebox is removed. 369 until this messagebox is removed.
370 \param parent Parent gui element of the dialog. 370 \param parent Parent gui element of the dialog.
371 \param id Id to identify the gui element. 371 \param id Id to identify the gui element.
372 \param restoreCWD If set to true, the current workingn directory will be 372 \param restoreCWD If set to true, the current workingn directory will be
373 restored after the dialog is closed in some way. Otherwise the working 373 restored after the dialog is closed in some way. Otherwise the working
374 directory will be the one that the file dialog was last showing. 374 directory will be the one that the file dialog was last showing.
375 \param startDir Optional path for which the file dialog will be opened. 375 \param startDir Optional path for which the file dialog will be opened.
376 \return Pointer to the created file open dialog. Returns 0 if an error 376 \return Pointer to the created file open dialog. Returns 0 if an error
377 occurred. This pointer should not be dropped. See 377 occurred. This pointer should not be dropped. See
378 IReferenceCounted::drop() for more information. */ 378 IReferenceCounted::drop() for more information. */
379 virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title=0, 379 virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title=0,
380 bool modal=true, IGUIElement* parent=0, s32 id=-1, 380 bool modal=true, IGUIElement* parent=0, s32 id=-1,
381 bool restoreCWD=false, io::path::char_type* startDir=0) = 0; 381 bool restoreCWD=false, io::path::char_type* startDir=0) = 0;
382 382
383 //! Adds a color select dialog. 383 //! Adds a color select dialog.
384 /** \param title The title of the dialog. 384 /** \param title The title of the dialog.
385 \param modal Defines if the dialog is modal. This means, that all other 385 \param modal Defines if the dialog is modal. This means, that all other
386 gui elements which were created before the dialog cannot be used 386 gui elements which were created before the dialog cannot be used
387 until it is removed. 387 until it is removed.
388 \param parent The parent of the dialog. 388 \param parent The parent of the dialog.
389 \param id The ID of the dialog. 389 \param id The ID of the dialog.
390 \return Pointer to the created file open dialog. Returns 0 if an error 390 \return Pointer to the created file open dialog. Returns 0 if an error
391 occurred. This pointer should not be dropped. See 391 occurred. This pointer should not be dropped. See
392 IReferenceCounted::drop() for more information. */ 392 IReferenceCounted::drop() for more information. */
393 virtual IGUIColorSelectDialog* addColorSelectDialog(const wchar_t* title = 0, 393 virtual IGUIColorSelectDialog* addColorSelectDialog(const wchar_t* title = 0,
394 bool modal=true, IGUIElement* parent=0, s32 id=-1) = 0; 394 bool modal=true, IGUIElement* parent=0, s32 id=-1) = 0;
395 395
396 //! Adds a static text. 396 //! Adds a static text.
397 /** \param text Text to be displayed. Can be altered after creation by SetText(). 397 /** \param text Text to be displayed. Can be altered after creation by SetText().
398 \param rectangle Rectangle specifying the borders of the static text 398 \param rectangle Rectangle specifying the borders of the static text
399 \param border Set to true if the static text should have a 3d border. 399 \param border Set to true if the static text should have a 3d border.
400 \param wordWrap Enable if the text should wrap into multiple lines. 400 \param wordWrap Enable if the text should wrap into multiple lines.
401 \param parent Parent item of the element, e.g. a window. 401 \param parent Parent item of the element, e.g. a window.
402 \param id The ID of the element. 402 \param id The ID of the element.
403 \param fillBackground Enable if the background shall be filled. 403 \param fillBackground Enable if the background shall be filled.
404 Defaults to false. 404 Defaults to false.
405 \return Pointer to the created static text. Returns 0 if an error 405 \return Pointer to the created static text. Returns 0 if an error
406 occurred. This pointer should not be dropped. See 406 occurred. This pointer should not be dropped. See
407 IReferenceCounted::drop() for more information. */ 407 IReferenceCounted::drop() for more information. */
408 virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle, 408 virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle,
409 bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1, 409 bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1,
410 bool fillBackground = false) = 0; 410 bool fillBackground = false) = 0;
411 411
412 //! Adds an edit box. 412 //! Adds an edit box.
413 /** Supports unicode input from every keyboard around the world, 413 /** Supports unicode input from every keyboard around the world,
414 scrolling, copying and pasting (exchanging data with the clipboard 414 scrolling, copying and pasting (exchanging data with the clipboard
415 directly), maximum character amount, marking, and all shortcuts like 415 directly), maximum character amount, marking, and all shortcuts like
416 ctrl+X, ctrl+V, ctrl+C, shift+Left, shift+Right, Home, End, and so on. 416 ctrl+X, ctrl+V, ctrl+C, shift+Left, shift+Right, Home, End, and so on.
417 \param text Text to be displayed. Can be altered after creation 417 \param text Text to be displayed. Can be altered after creation
418 by setText(). 418 by setText().
419 \param rectangle Rectangle specifying the borders of the edit box. 419 \param rectangle Rectangle specifying the borders of the edit box.
420 \param border Set to true if the edit box should have a 3d border. 420 \param border Set to true if the edit box should have a 3d border.
421 \param parent Parent item of the element, e.g. a window. 421 \param parent Parent item of the element, e.g. a window.
422 Set it to 0 to place the edit box directly in the environment. 422 Set it to 0 to place the edit box directly in the environment.
423 \param id The ID of the element. 423 \param id The ID of the element.
424 \return Pointer to the created edit box. Returns 0 if an error occurred. 424 \return Pointer to the created edit box. Returns 0 if an error occurred.
425 This pointer should not be dropped. See IReferenceCounted::drop() for 425 This pointer should not be dropped. See IReferenceCounted::drop() for
426 more information. */ 426 more information. */
427 virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle, 427 virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle,
428 bool border=true, IGUIElement* parent=0, s32 id=-1) = 0; 428 bool border=true, IGUIElement* parent=0, s32 id=-1) = 0;
429 429
430 //! Adds a spin box. 430 //! Adds a spin box.
431 /** An edit box with up and down buttons 431 /** An edit box with up and down buttons
432 \param text Text to be displayed. Can be altered after creation by setText(). 432 \param text Text to be displayed. Can be altered after creation by setText().
433 \param rectangle Rectangle specifying the borders of the spin box. 433 \param rectangle Rectangle specifying the borders of the spin box.
434 \param border Set to true if the spin box should have a 3d border. 434 \param border Set to true if the spin box should have a 3d border.
435 \param parent Parent item of the element, e.g. a window. 435 \param parent Parent item of the element, e.g. a window.
436 Set it to 0 to place the spin box directly in the environment. 436 Set it to 0 to place the spin box directly in the environment.
437 \param id The ID of the element. 437 \param id The ID of the element.
438 \return Pointer to the created spin box. Returns 0 if an error occurred. 438 \return Pointer to the created spin box. Returns 0 if an error occurred.
439 This pointer should not be dropped. See IReferenceCounted::drop() for 439 This pointer should not be dropped. See IReferenceCounted::drop() for
440 more information. */ 440 more information. */
441 virtual IGUISpinBox* addSpinBox(const wchar_t* text, const core::rect<s32>& rectangle, 441 virtual IGUISpinBox* addSpinBox(const wchar_t* text, const core::rect<s32>& rectangle,
442 bool border=true,IGUIElement* parent=0, s32 id=-1) = 0; 442 bool border=true,IGUIElement* parent=0, s32 id=-1) = 0;
443 443
444 //! Adds an element for fading in or out. 444 //! Adds an element for fading in or out.
445 /** \param rectangle Rectangle specifying the borders of the fader. 445 /** \param rectangle Rectangle specifying the borders of the fader.
446 If the pointer is NULL, the whole screen is used. 446 If the pointer is NULL, the whole screen is used.
447 \param parent Parent item of the element, e.g. a window. 447 \param parent Parent item of the element, e.g. a window.
448 \param id An identifier for the fader. 448 \param id An identifier for the fader.
449 \return Pointer to the created in-out-fader. Returns 0 if an error 449 \return Pointer to the created in-out-fader. Returns 0 if an error
450 occurred. This pointer should not be dropped. See 450 occurred. This pointer should not be dropped. See
451 IReferenceCounted::drop() for more information. */ 451 IReferenceCounted::drop() for more information. */
452 virtual IGUIInOutFader* addInOutFader(const core::rect<s32>* rectangle=0, IGUIElement* parent=0, s32 id=-1) = 0; 452 virtual IGUIInOutFader* addInOutFader(const core::rect<s32>* rectangle=0, IGUIElement* parent=0, s32 id=-1) = 0;
453 453
454 //! Adds a tab control to the environment. 454 //! Adds a tab control to the environment.
455 /** \param rectangle Rectangle specifying the borders of the tab control. 455 /** \param rectangle Rectangle specifying the borders of the tab control.
456 \param parent Parent item of the element, e.g. a window. 456 \param parent Parent item of the element, e.g. a window.
457 Set it to 0 to place the tab control directly in the environment. 457 Set it to 0 to place the tab control directly in the environment.
458 \param fillbackground Specifies if the background of the tab control 458 \param fillbackground Specifies if the background of the tab control
459 should be drawn. 459 should be drawn.
460 \param border Specifies if a flat 3d border should be drawn. This is 460 \param border Specifies if a flat 3d border should be drawn. This is
461 usually not necessary unless you place the control directly into 461 usually not necessary unless you place the control directly into
462 the environment without a window as parent. 462 the environment without a window as parent.
463 \param id An identifier for the tab control. 463 \param id An identifier for the tab control.
464 \return Pointer to the created tab control element. Returns 0 if an 464 \return Pointer to the created tab control element. Returns 0 if an
465 error occurred. This pointer should not be dropped. See 465 error occurred. This pointer should not be dropped. See
466 IReferenceCounted::drop() for more information. */ 466 IReferenceCounted::drop() for more information. */
467 virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle, 467 virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle,
468 IGUIElement* parent=0, bool fillbackground=false, 468 IGUIElement* parent=0, bool fillbackground=false,
469 bool border=true, s32 id=-1) = 0; 469 bool border=true, s32 id=-1) = 0;
470 470
471 //! Adds tab to the environment. 471 //! Adds tab to the environment.
472 /** You can use this element to group other elements. This is not used 472 /** You can use this element to group other elements. This is not used
473 for creating tabs on tab controls, please use IGUITabControl::addTab() 473 for creating tabs on tab controls, please use IGUITabControl::addTab()
474 for this instead. 474 for this instead.
475 \param rectangle Rectangle specifying the borders of the tab. 475 \param rectangle Rectangle specifying the borders of the tab.
476 \param parent Parent item of the element, e.g. a window. 476 \param parent Parent item of the element, e.g. a window.
477 Set it to 0 to place the tab directly in the environment. 477 Set it to 0 to place the tab directly in the environment.
478 \param id An identifier for the tab. 478 \param id An identifier for the tab.
479 \return Pointer to the created tab. Returns 0 if an 479 \return Pointer to the created tab. Returns 0 if an
480 error occurred. This pointer should not be dropped. See 480 error occurred. This pointer should not be dropped. See
481 IReferenceCounted::drop() for more information. */ 481 IReferenceCounted::drop() for more information. */
482 virtual IGUITab* addTab(const core::rect<s32>& rectangle, 482 virtual IGUITab* addTab(const core::rect<s32>& rectangle,
483 IGUIElement* parent=0, s32 id=-1) = 0; 483 IGUIElement* parent=0, s32 id=-1) = 0;
484 484
485 //! Adds a context menu to the environment. 485 //! Adds a context menu to the environment.
486 /** \param rectangle Rectangle specifying the borders of the menu. 486 /** \param rectangle Rectangle specifying the borders of the menu.
487 Note that the menu is resizing itself based on what items you add. 487 Note that the menu is resizing itself based on what items you add.
488 \param parent Parent item of the element, e.g. a window. 488 \param parent Parent item of the element, e.g. a window.
489 Set it to 0 to place the menu directly in the environment. 489 Set it to 0 to place the menu directly in the environment.
490 \param id An identifier for the menu. 490 \param id An identifier for the menu.
491 \return Pointer to the created context menu. Returns 0 if an 491 \return Pointer to the created context menu. Returns 0 if an
492 error occurred. This pointer should not be dropped. See 492 error occurred. This pointer should not be dropped. See
493 IReferenceCounted::drop() for more information. */ 493 IReferenceCounted::drop() for more information. */
494 virtual IGUIContextMenu* addContextMenu(const core::rect<s32>& rectangle, 494 virtual IGUIContextMenu* addContextMenu(const core::rect<s32>& rectangle,
495 IGUIElement* parent=0, s32 id=-1) = 0; 495 IGUIElement* parent=0, s32 id=-1) = 0;
496 496
497 //! Adds a menu to the environment. 497 //! Adds a menu to the environment.
498 /** This is like the menu you can find on top of most windows in modern 498 /** This is like the menu you can find on top of most windows in modern
499 graphical user interfaces. 499 graphical user interfaces.
500 \param parent Parent item of the element, e.g. a window. 500 \param parent Parent item of the element, e.g. a window.
501 Set it to 0 to place the menu directly in the environment. 501 Set it to 0 to place the menu directly in the environment.
502 \param id An identifier for the menu. 502 \param id An identifier for the menu.
503 \return Pointer to the created menu. Returns 0 if an 503 \return Pointer to the created menu. Returns 0 if an
504 error occurred. This pointer should not be dropped. See 504 error occurred. This pointer should not be dropped. See
505 IReferenceCounted::drop() for more information. */ 505 IReferenceCounted::drop() for more information. */
506 virtual IGUIContextMenu* addMenu(IGUIElement* parent=0, s32 id=-1) = 0; 506 virtual IGUIContextMenu* addMenu(IGUIElement* parent=0, s32 id=-1) = 0;
507 507
508 //! Adds a toolbar to the environment. 508 //! Adds a toolbar to the environment.
509 /** It is like a menu that is always placed on top of its parent, and 509 /** It is like a menu that is always placed on top of its parent, and
510 contains buttons. 510 contains buttons.
511 \param parent Parent item of the element, e.g. a window. 511 \param parent Parent item of the element, e.g. a window.
512 Set it to 0 to place the tool bar directly in the environment. 512 Set it to 0 to place the tool bar directly in the environment.
513 \param id An identifier for the tool bar. 513 \param id An identifier for the tool bar.
514 \return Pointer to the created tool bar. Returns 0 if an 514 \return Pointer to the created tool bar. Returns 0 if an
515 error occurred. This pointer should not be dropped. See 515 error occurred. This pointer should not be dropped. See
516 IReferenceCounted::drop() for more information. */ 516 IReferenceCounted::drop() for more information. */
517 virtual IGUIToolBar* addToolBar(IGUIElement* parent=0, s32 id=-1) = 0; 517 virtual IGUIToolBar* addToolBar(IGUIElement* parent=0, s32 id=-1) = 0;
518 518
519 //! Adds a combo box to the environment. 519 //! Adds a combo box to the environment.
520 /** \param rectangle Rectangle specifying the borders of the combo box. 520 /** \param rectangle Rectangle specifying the borders of the combo box.
521 \param parent Parent item of the element, e.g. a window. 521 \param parent Parent item of the element, e.g. a window.
522 Set it to 0 to place the combo box directly in the environment. 522 Set it to 0 to place the combo box directly in the environment.
523 \param id An identifier for the combo box. 523 \param id An identifier for the combo box.
524 \return Pointer to the created combo box. Returns 0 if an 524 \return Pointer to the created combo box. Returns 0 if an
525 error occurred. This pointer should not be dropped. See 525 error occurred. This pointer should not be dropped. See
526 IReferenceCounted::drop() for more information. */ 526 IReferenceCounted::drop() for more information. */
527 virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle, 527 virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle,
528 IGUIElement* parent=0, s32 id=-1) = 0; 528 IGUIElement* parent=0, s32 id=-1) = 0;
529 529
530 //! Adds a table to the environment 530 //! Adds a table to the environment
531 /** \param rectangle Rectangle specifying the borders of the table. 531 /** \param rectangle Rectangle specifying the borders of the table.
532 \param parent Parent item of the element, e.g. a window. Set it to 0 532 \param parent Parent item of the element, e.g. a window. Set it to 0
533 to place the element directly in the environment. 533 to place the element directly in the environment.
534 \param id An identifier for the table. 534 \param id An identifier for the table.
535 \param drawBackground Flag whether the background should be drawn. 535 \param drawBackground Flag whether the background should be drawn.
536 \return Pointer to the created table. Returns 0 if an error occurred. 536 \return Pointer to the created table. Returns 0 if an error occurred.
537 This pointer should not be dropped. See IReferenceCounted::drop() for 537 This pointer should not be dropped. See IReferenceCounted::drop() for
538 more information. */ 538 more information. */
539 virtual IGUITable* addTable(const core::rect<s32>& rectangle, 539 virtual IGUITable* addTable(const core::rect<s32>& rectangle,
540 IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) =0; 540 IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) =0;
541 541
542 //! Get the default element factory which can create all built-in elements 542 //! Get the default element factory which can create all built-in elements
543 /** \return Pointer to the factory. 543 /** \return Pointer to the factory.
544 This pointer should not be dropped. See IReferenceCounted::drop() for 544 This pointer should not be dropped. See IReferenceCounted::drop() for
545 more information. */ 545 more information. */
546 virtual IGUIElementFactory* getDefaultGUIElementFactory() const = 0; 546 virtual IGUIElementFactory* getDefaultGUIElementFactory() const = 0;
547 547
548 //! Adds an element factory to the gui environment. 548 //! Adds an element factory to the gui environment.
549 /** Use this to extend the gui environment with new element types which 549 /** Use this to extend the gui environment with new element types which
550 it should be able to create automatically, for example when loading 550 it should be able to create automatically, for example when loading
551 data from xml files. 551 data from xml files.
552 \param factoryToAdd Pointer to new factory. */ 552 \param factoryToAdd Pointer to new factory. */
553 virtual void registerGUIElementFactory(IGUIElementFactory* factoryToAdd) = 0; 553 virtual void registerGUIElementFactory(IGUIElementFactory* factoryToAdd) = 0;
554 554
555 //! Get amount of registered gui element factories. 555 //! Get amount of registered gui element factories.
556 /** \return Amount of registered gui element factories. */ 556 /** \return Amount of registered gui element factories. */
557 virtual u32 getRegisteredGUIElementFactoryCount() const = 0; 557 virtual u32 getRegisteredGUIElementFactoryCount() const = 0;
558 558
559 //! Get a gui element factory by index 559 //! Get a gui element factory by index
560 /** \param index Index of the factory. 560 /** \param index Index of the factory.
561 \return Factory at given index, or 0 if no such factory exists. */ 561 \return Factory at given index, or 0 if no such factory exists. */
562 virtual IGUIElementFactory* getGUIElementFactory(u32 index) const = 0; 562 virtual IGUIElementFactory* getGUIElementFactory(u32 index) const = 0;
563 563
564 //! Adds a GUI element by its name 564 //! Adds a GUI element by its name
565 /** Each factory is checked if it can create an element of the given 565 /** Each factory is checked if it can create an element of the given
566 name. The first match will be created. 566 name. The first match will be created.
567 \param elementName Name of the element to be created. 567 \param elementName Name of the element to be created.
568 \param parent Parent of the new element, if not 0. 568 \param parent Parent of the new element, if not 0.
569 \return New GUI element, or 0 if no such element exists. */ 569 \return New GUI element, or 0 if no such element exists. */
570 virtual IGUIElement* addGUIElement(const c8* elementName, IGUIElement* parent=0) = 0; 570 virtual IGUIElement* addGUIElement(const c8* elementName, IGUIElement* parent=0) = 0;
571 571
572 //! Saves the current gui into a file. 572 //! Saves the current gui into a file.
573 /** \param filename Name of the file. 573 /** \param filename Name of the file.
574 \param start The GUIElement to start with. Root if 0. 574 \param start The GUIElement to start with. Root if 0.
575 \return True if saving succeeded, else false. */ 575 \return True if saving succeeded, else false. */
576 virtual bool saveGUI(const io::path& filename, IGUIElement* start=0) = 0; 576 virtual bool saveGUI(const io::path& filename, IGUIElement* start=0) = 0;
577 577
578 //! Saves the current gui into a file. 578 //! Saves the current gui into a file.
579 /** \param file The file to write to. 579 /** \param file The file to write to.
580 \param start The GUIElement to start with. Root if 0. 580 \param start The GUIElement to start with. Root if 0.
581 \return True if saving succeeded, else false. */ 581 \return True if saving succeeded, else false. */
582 virtual bool saveGUI(io::IWriteFile* file, IGUIElement* start=0) = 0; 582 virtual bool saveGUI(io::IWriteFile* file, IGUIElement* start=0) = 0;
583 583
584 //! Loads the gui. Note that the current gui is not cleared before. 584 //! Loads the gui. Note that the current gui is not cleared before.
585 /** When a parent is set the elements will be added below the parent, the parent itself does not deserialize. 585 /** When a parent is set the elements will be added below the parent, the parent itself does not deserialize.
586 When the file contains skin-settings from the gui-environment those are always serialized into the 586 When the file contains skin-settings from the gui-environment those are always serialized into the
587 guienvironment independent of the parent setting. 587 guienvironment independent of the parent setting.
588 \param filename Name of the file. 588 \param filename Name of the file.
589 \param parent Parent for the loaded GUI, root if 0. 589 \param parent Parent for the loaded GUI, root if 0.
590 \return True if loading succeeded, else false. */ 590 \return True if loading succeeded, else false. */
591 virtual bool loadGUI(const io::path& filename, IGUIElement* parent=0) = 0; 591 virtual bool loadGUI(const io::path& filename, IGUIElement* parent=0) = 0;
592 592
593 //! Loads the gui. Note that the current gui is not cleared before. 593 //! Loads the gui. Note that the current gui is not cleared before.
594 /** When a parent is set the elements will be added below the parent, the parent itself does not deserialize. 594 /** When a parent is set the elements will be added below the parent, the parent itself does not deserialize.
595 When the file contains skin-settings from the gui-environment those are always serialized into the 595 When the file contains skin-settings from the gui-environment those are always serialized into the
596 guienvironment independent of the parent setting. 596 guienvironment independent of the parent setting.
597 \param file The file to load from. 597 \param file The file to load from.
598 \param parent Parent for the loaded GUI, root if 0. 598 \param parent Parent for the loaded GUI, root if 0.
599 \return True if loading succeeded, else false. */ 599 \return True if loading succeeded, else false. */
600 virtual bool loadGUI(io::IReadFile* file, IGUIElement* parent=0) = 0; 600 virtual bool loadGUI(io::IReadFile* file, IGUIElement* parent=0) = 0;
601 601
602 //! Writes attributes of the gui environment 602 //! Writes attributes of the gui environment
603 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const =0; 603 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const =0;
604 604
605 //! Reads attributes of the gui environment 605 //! Reads attributes of the gui environment
606 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)=0; 606 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)=0;
607 607
608 //! writes an element 608 //! writes an element
609 virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* node) =0; 609 virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* node) =0;
610 610
611 //! reads an element 611 //! reads an element
612 virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* node) =0; 612 virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* node) =0;
613}; 613};
614 614
615 615
616} // end namespace gui 616} // end namespace gui
617} // end namespace irr 617} // end namespace irr
618 618
619#endif 619#endif
620 620
diff --git a/libraries/irrlicht-1.8/include/IGUIFileOpenDialog.h b/libraries/irrlicht-1.8/include/IGUIFileOpenDialog.h
index 2384038..f89413b 100644
--- a/libraries/irrlicht-1.8/include/IGUIFileOpenDialog.h
+++ b/libraries/irrlicht-1.8/include/IGUIFileOpenDialog.h
@@ -1,44 +1,44 @@
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#ifndef __I_GUI_FILE_OPEN_DIALOG_H_INCLUDED__ 5#ifndef __I_GUI_FILE_OPEN_DIALOG_H_INCLUDED__
6#define __I_GUI_FILE_OPEN_DIALOG_H_INCLUDED__ 6#define __I_GUI_FILE_OPEN_DIALOG_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9#include "path.h" 9#include "path.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace gui 13namespace gui
14{ 14{
15 15
16 //! Standard file chooser dialog. 16 //! Standard file chooser dialog.
17 /** \warning When the user selects a folder this does change the current working directory 17 /** \warning When the user selects a folder this does change the current working directory
18 18
19 \par This element can create the following events of type EGUI_EVENT_TYPE: 19 \par This element can create the following events of type EGUI_EVENT_TYPE:
20 \li EGET_DIRECTORY_SELECTED 20 \li EGET_DIRECTORY_SELECTED
21 \li EGET_FILE_SELECTED 21 \li EGET_FILE_SELECTED
22 \li EGET_FILE_CHOOSE_DIALOG_CANCELLED 22 \li EGET_FILE_CHOOSE_DIALOG_CANCELLED
23 */ 23 */
24 class IGUIFileOpenDialog : public IGUIElement 24 class IGUIFileOpenDialog : public IGUIElement
25 { 25 {
26 public: 26 public:
27 27
28 //! constructor 28 //! constructor
29 IGUIFileOpenDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 29 IGUIFileOpenDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
30 : IGUIElement(EGUIET_FILE_OPEN_DIALOG, environment, parent, id, rectangle) {} 30 : IGUIElement(EGUIET_FILE_OPEN_DIALOG, environment, parent, id, rectangle) {}
31 31
32 //! Returns the filename of the selected file. Returns NULL, if no file was selected. 32 //! Returns the filename of the selected file. Returns NULL, if no file was selected.
33 virtual const wchar_t* getFileName() const = 0; 33 virtual const wchar_t* getFileName() const = 0;
34 34
35 //! Returns the directory of the selected file. Returns NULL, if no directory was selected. 35 //! Returns the directory of the selected file. Returns NULL, if no directory was selected.
36 virtual const io::path& getDirectoryName() = 0; 36 virtual const io::path& getDirectoryName() = 0;
37 }; 37 };
38 38
39 39
40} // end namespace gui 40} // end namespace gui
41} // end namespace irr 41} // end namespace irr
42 42
43#endif 43#endif
44 44
diff --git a/libraries/irrlicht-1.8/include/IGUIFont.h b/libraries/irrlicht-1.8/include/IGUIFont.h
index 4746c81..2e97c82 100644
--- a/libraries/irrlicht-1.8/include/IGUIFont.h
+++ b/libraries/irrlicht-1.8/include/IGUIFont.h
@@ -1,104 +1,104 @@
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#ifndef __I_GUI_FONT_H_INCLUDED__ 5#ifndef __I_GUI_FONT_H_INCLUDED__
6#define __I_GUI_FONT_H_INCLUDED__ 6#define __I_GUI_FONT_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "SColor.h" 9#include "SColor.h"
10#include "rect.h" 10#include "rect.h"
11#include "irrString.h" 11#include "irrString.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace gui 15namespace gui
16{ 16{
17 17
18//! An enum for the different types of GUI font. 18//! An enum for the different types of GUI font.
19enum EGUI_FONT_TYPE 19enum EGUI_FONT_TYPE
20{ 20{
21 //! Bitmap fonts loaded from an XML file or a texture. 21 //! Bitmap fonts loaded from an XML file or a texture.
22 EGFT_BITMAP = 0, 22 EGFT_BITMAP = 0,
23 23
24 //! Scalable vector fonts loaded from an XML file. 24 //! Scalable vector fonts loaded from an XML file.
25 /** These fonts reside in system memory and use no video memory 25 /** These fonts reside in system memory and use no video memory
26 until they are displayed. These are slower than bitmap fonts 26 until they are displayed. These are slower than bitmap fonts
27 but can be easily scaled and rotated. */ 27 but can be easily scaled and rotated. */
28 EGFT_VECTOR, 28 EGFT_VECTOR,
29 29
30 //! A font which uses a the native API provided by the operating system. 30 //! A font which uses a the native API provided by the operating system.
31 /** Currently not used. */ 31 /** Currently not used. */
32 EGFT_OS, 32 EGFT_OS,
33 33
34 //! An external font type provided by the user. 34 //! An external font type provided by the user.
35 EGFT_CUSTOM 35 EGFT_CUSTOM
36}; 36};
37 37
38//! Font interface. 38//! Font interface.
39class IGUIFont : public virtual IReferenceCounted 39class IGUIFont : public virtual IReferenceCounted
40{ 40{
41public: 41public:
42 42
43 //! Draws some text and clips it to the specified rectangle if wanted. 43 //! Draws some text and clips it to the specified rectangle if wanted.
44 /** \param text: Text to draw 44 /** \param text: Text to draw
45 \param position: Rectangle specifying position where to draw the text. 45 \param position: Rectangle specifying position where to draw the text.
46 \param color: Color of the text 46 \param color: Color of the text
47 \param hcenter: Specifies if the text should be centered horizontally into the rectangle. 47 \param hcenter: Specifies if the text should be centered horizontally into the rectangle.
48 \param vcenter: Specifies if the text should be centered vertically into the rectangle. 48 \param vcenter: Specifies if the text should be centered vertically into the rectangle.
49 \param clip: Optional pointer to a rectangle against which the text will be clipped. 49 \param clip: Optional pointer to a rectangle against which the text will be clipped.
50 If the pointer is null, no clipping will be done. */ 50 If the pointer is null, no clipping will be done. */
51 virtual void draw(const core::stringw& text, const core::rect<s32>& position, 51 virtual void draw(const core::stringw& text, const core::rect<s32>& position,
52 video::SColor color, bool hcenter=false, bool vcenter=false, 52 video::SColor color, bool hcenter=false, bool vcenter=false,
53 const core::rect<s32>* clip=0) = 0; 53 const core::rect<s32>* clip=0) = 0;
54 54
55 //! Calculates the width and height of a given string of text. 55 //! Calculates the width and height of a given string of text.
56 /** \return Returns width and height of the area covered by the text if 56 /** \return Returns width and height of the area covered by the text if
57 it would be drawn. */ 57 it would be drawn. */
58 virtual core::dimension2d<u32> getDimension(const wchar_t* text) const = 0; 58 virtual core::dimension2d<u32> getDimension(const wchar_t* text) const = 0;
59 59
60 //! Calculates the index of the character in the text which is on a specific position. 60 //! Calculates the index of the character in the text which is on a specific position.
61 /** \param text: Text string. 61 /** \param text: Text string.
62 \param pixel_x: X pixel position of which the index of the character will be returned. 62 \param pixel_x: X pixel position of which the index of the character will be returned.
63 \return Returns zero based index of the character in the text, and -1 if no no character 63 \return Returns zero based index of the character in the text, and -1 if no no character
64 is on this position. (=the text is too short). */ 64 is on this position. (=the text is too short). */
65 virtual s32 getCharacterFromPos(const wchar_t* text, s32 pixel_x) const = 0; 65 virtual s32 getCharacterFromPos(const wchar_t* text, s32 pixel_x) const = 0;
66 66
67 //! Returns the type of this font 67 //! Returns the type of this font
68 virtual EGUI_FONT_TYPE getType() const { return EGFT_CUSTOM; } 68 virtual EGUI_FONT_TYPE getType() const { return EGFT_CUSTOM; }
69 69
70 //! Sets global kerning width for the font. 70 //! Sets global kerning width for the font.
71 virtual void setKerningWidth (s32 kerning) = 0; 71 virtual void setKerningWidth (s32 kerning) = 0;
72 72
73 //! Sets global kerning height for the font. 73 //! Sets global kerning height for the font.
74 virtual void setKerningHeight (s32 kerning) = 0; 74 virtual void setKerningHeight (s32 kerning) = 0;
75 75
76 //! Gets kerning values (distance between letters) for the font. If no parameters are provided, 76 //! Gets kerning values (distance between letters) for the font. If no parameters are provided,
77 /** the global kerning distance is returned. 77 /** the global kerning distance is returned.
78 \param thisLetter: If this parameter is provided, the left side kerning 78 \param thisLetter: If this parameter is provided, the left side kerning
79 for this letter is added to the global kerning value. For example, a 79 for this letter is added to the global kerning value. For example, a
80 space might only be one pixel wide, but it may be displayed as several 80 space might only be one pixel wide, but it may be displayed as several
81 pixels. 81 pixels.
82 \param previousLetter: If provided, kerning is calculated for both 82 \param previousLetter: If provided, kerning is calculated for both
83 letters and added to the global kerning value. For example, in a font 83 letters and added to the global kerning value. For example, in a font
84 which supports kerning pairs a string such as 'Wo' may have the 'o' 84 which supports kerning pairs a string such as 'Wo' may have the 'o'
85 tucked neatly under the 'W'. 85 tucked neatly under the 'W'.
86 */ 86 */
87 virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const = 0; 87 virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const = 0;
88 88
89 //! Returns the distance between letters 89 //! Returns the distance between letters
90 virtual s32 getKerningHeight() const = 0; 90 virtual s32 getKerningHeight() const = 0;
91 91
92 //! Define which characters should not be drawn by the font. 92 //! Define which characters should not be drawn by the font.
93 /** For example " " would not draw any space which is usually blank in 93 /** For example " " would not draw any space which is usually blank in
94 most fonts. 94 most fonts.
95 \param s String of symbols which are not send down to the videodriver 95 \param s String of symbols which are not send down to the videodriver
96 */ 96 */
97 virtual void setInvisibleCharacters( const wchar_t *s ) = 0; 97 virtual void setInvisibleCharacters( const wchar_t *s ) = 0;
98}; 98};
99 99
100} // end namespace gui 100} // end namespace gui
101} // end namespace irr 101} // end namespace irr
102 102
103#endif 103#endif
104 104
diff --git a/libraries/irrlicht-1.8/include/IGUIFontBitmap.h b/libraries/irrlicht-1.8/include/IGUIFontBitmap.h
index 36ae37e..c05a652 100644
--- a/libraries/irrlicht-1.8/include/IGUIFontBitmap.h
+++ b/libraries/irrlicht-1.8/include/IGUIFontBitmap.h
@@ -1,46 +1,46 @@
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#ifndef __I_GUI_FONT_BITMAP_H_INCLUDED__ 5#ifndef __I_GUI_FONT_BITMAP_H_INCLUDED__
6#define __I_GUI_FONT_BITMAP_H_INCLUDED__ 6#define __I_GUI_FONT_BITMAP_H_INCLUDED__
7 7
8#include "IGUIFont.h" 8#include "IGUIFont.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace gui 12namespace gui
13{ 13{
14 class IGUISpriteBank; 14 class IGUISpriteBank;
15 15
16//! Font interface. 16//! Font interface.
17class IGUIFontBitmap : public IGUIFont 17class IGUIFontBitmap : public IGUIFont
18{ 18{
19public: 19public:
20 20
21 //! Returns the type of this font 21 //! Returns the type of this font
22 virtual EGUI_FONT_TYPE getType() const { return EGFT_BITMAP; } 22 virtual EGUI_FONT_TYPE getType() const { return EGFT_BITMAP; }
23 23
24 //! returns the parsed Symbol Information 24 //! returns the parsed Symbol Information
25 virtual IGUISpriteBank* getSpriteBank() const = 0; 25 virtual IGUISpriteBank* getSpriteBank() const = 0;
26 26
27 //! returns the sprite number from a given character 27 //! returns the sprite number from a given character
28 virtual u32 getSpriteNoFromChar(const wchar_t *c) const = 0; 28 virtual u32 getSpriteNoFromChar(const wchar_t *c) const = 0;
29 29
30 //! Gets kerning values (distance between letters) for the font. If no parameters are provided, 30 //! Gets kerning values (distance between letters) for the font. If no parameters are provided,
31 /** the global kerning distance is returned. 31 /** the global kerning distance is returned.
32 \param thisLetter: If this parameter is provided, the left side kerning for this letter is added 32 \param thisLetter: If this parameter is provided, the left side kerning for this letter is added
33 to the global kerning value. For example, a space might only be one pixel wide, but it may 33 to the global kerning value. For example, a space might only be one pixel wide, but it may
34 be displayed as several pixels. 34 be displayed as several pixels.
35 \param previousLetter: If provided, kerning is calculated for both letters and added to the global 35 \param previousLetter: If provided, kerning is calculated for both letters and added to the global
36 kerning value. For example, EGFT_BITMAP will add the right kerning value of previousLetter to the 36 kerning value. For example, EGFT_BITMAP will add the right kerning value of previousLetter to the
37 left side kerning value of thisLetter, then add the global value. 37 left side kerning value of thisLetter, then add the global value.
38 */ 38 */
39 virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const = 0; 39 virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const = 0;
40}; 40};
41 41
42} // end namespace gui 42} // end namespace gui
43} // end namespace irr 43} // end namespace irr
44 44
45#endif 45#endif
46 46
diff --git a/libraries/irrlicht-1.8/include/IGUIImage.h b/libraries/irrlicht-1.8/include/IGUIImage.h
index 9bca201..5e6d347 100644
--- a/libraries/irrlicht-1.8/include/IGUIImage.h
+++ b/libraries/irrlicht-1.8/include/IGUIImage.h
@@ -1,58 +1,58 @@
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#ifndef __I_GUI_IMAGE_H_INCLUDED__ 5#ifndef __I_GUI_IMAGE_H_INCLUDED__
6#define __I_GUI_IMAGE_H_INCLUDED__ 6#define __I_GUI_IMAGE_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace video 12namespace video
13{ 13{
14 class ITexture; 14 class ITexture;
15} 15}
16namespace gui 16namespace gui
17{ 17{
18 18
19 //! GUI element displaying an image. 19 //! GUI element displaying an image.
20 class IGUIImage : public IGUIElement 20 class IGUIImage : public IGUIElement
21 { 21 {
22 public: 22 public:
23 23
24 //! constructor 24 //! constructor
25 IGUIImage(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 25 IGUIImage(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
26 : IGUIElement(EGUIET_IMAGE, environment, parent, id, rectangle) {} 26 : IGUIElement(EGUIET_IMAGE, environment, parent, id, rectangle) {}
27 27
28 //! Sets an image texture 28 //! Sets an image texture
29 virtual void setImage(video::ITexture* image) = 0; 29 virtual void setImage(video::ITexture* image) = 0;
30 30
31 //! Gets the image texture 31 //! Gets the image texture
32 virtual video::ITexture* getImage() const = 0; 32 virtual video::ITexture* getImage() const = 0;
33 33
34 //! Sets the color of the image 34 //! Sets the color of the image
35 virtual void setColor(video::SColor color) = 0; 35 virtual void setColor(video::SColor color) = 0;
36 36
37 //! Sets if the image should scale to fit the element 37 //! Sets if the image should scale to fit the element
38 virtual void setScaleImage(bool scale) = 0; 38 virtual void setScaleImage(bool scale) = 0;
39 39
40 //! Sets if the image should use its alpha channel to draw itself 40 //! Sets if the image should use its alpha channel to draw itself
41 virtual void setUseAlphaChannel(bool use) = 0; 41 virtual void setUseAlphaChannel(bool use) = 0;
42 42
43 //! Gets the color of the image 43 //! Gets the color of the image
44 virtual video::SColor getColor() const = 0; 44 virtual video::SColor getColor() const = 0;
45 45
46 //! Returns true if the image is scaled to fit, false if not 46 //! Returns true if the image is scaled to fit, false if not
47 virtual bool isImageScaled() const = 0; 47 virtual bool isImageScaled() const = 0;
48 48
49 //! Returns true if the image is using the alpha channel, false if not 49 //! Returns true if the image is using the alpha channel, false if not
50 virtual bool isAlphaChannelUsed() const = 0; 50 virtual bool isAlphaChannelUsed() const = 0;
51 }; 51 };
52 52
53 53
54} // end namespace gui 54} // end namespace gui
55} // end namespace irr 55} // end namespace irr
56 56
57#endif 57#endif
58 58
diff --git a/libraries/irrlicht-1.8/include/IGUIImageList.h b/libraries/irrlicht-1.8/include/IGUIImageList.h
index f1f50c1..fb4ca4b 100644
--- a/libraries/irrlicht-1.8/include/IGUIImageList.h
+++ b/libraries/irrlicht-1.8/include/IGUIImageList.h
@@ -1,45 +1,45 @@
1// This file is part of the "Irrlicht Engine". 1// This file is part of the "Irrlicht Engine".
2// written by Reinhard Ostermeier, reinhard@nospam.r-ostermeier.de 2// written by Reinhard Ostermeier, reinhard@nospam.r-ostermeier.de
3 3
4#ifndef __I_GUI_IMAGE_LIST_H_INCLUDED__ 4#ifndef __I_GUI_IMAGE_LIST_H_INCLUDED__
5#define __I_GUI_IMAGE_LIST_H_INCLUDED__ 5#define __I_GUI_IMAGE_LIST_H_INCLUDED__
6 6
7#include "IGUIElement.h" 7#include "IGUIElement.h"
8#include "rect.h" 8#include "rect.h"
9#include "irrTypes.h" 9#include "irrTypes.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace gui 13namespace gui
14{ 14{
15 15
16//! Font interface. 16//! Font interface.
17class IGUIImageList : public virtual IReferenceCounted 17class IGUIImageList : public virtual IReferenceCounted
18{ 18{
19public: 19public:
20 20
21 //! Destructor 21 //! Destructor
22 virtual ~IGUIImageList() {}; 22 virtual ~IGUIImageList() {};
23 23
24 //! Draws an image and clips it to the specified rectangle if wanted 24 //! Draws an image and clips it to the specified rectangle if wanted
25 //! \param index: Index of the image 25 //! \param index: Index of the image
26 //! \param destPos: Position of the image to draw 26 //! \param destPos: Position of the image to draw
27 //! \param clip: Optional pointer to a rectalgle against which the text will be clipped. 27 //! \param clip: Optional pointer to a rectalgle against which the text will be clipped.
28 //! If the pointer is null, no clipping will be done. 28 //! If the pointer is null, no clipping will be done.
29 virtual void draw(s32 index, const core::position2d<s32>& destPos, 29 virtual void draw(s32 index, const core::position2d<s32>& destPos,
30 const core::rect<s32>* clip = 0) = 0; 30 const core::rect<s32>* clip = 0) = 0;
31 31
32 //! Returns the count of Images in the list. 32 //! Returns the count of Images in the list.
33 //! \return Returns the count of Images in the list. 33 //! \return Returns the count of Images in the list.
34 virtual s32 getImageCount() const = 0; 34 virtual s32 getImageCount() const = 0;
35 35
36 //! Returns the size of the images in the list. 36 //! Returns the size of the images in the list.
37 //! \return Returns the size of the images in the list. 37 //! \return Returns the size of the images in the list.
38 virtual core::dimension2d<s32> getImageSize() const = 0; 38 virtual core::dimension2d<s32> getImageSize() const = 0;
39}; 39};
40 40
41} // end namespace gui 41} // end namespace gui
42} // end namespace irr 42} // end namespace irr
43 43
44#endif 44#endif
45 45
diff --git a/libraries/irrlicht-1.8/include/IGUIInOutFader.h b/libraries/irrlicht-1.8/include/IGUIInOutFader.h
index a89f615..6846d7b 100644
--- a/libraries/irrlicht-1.8/include/IGUIInOutFader.h
+++ b/libraries/irrlicht-1.8/include/IGUIInOutFader.h
@@ -1,67 +1,67 @@
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#ifndef __I_GUI_IN_OUT_FADER_H_INCLUDED__ 5#ifndef __I_GUI_IN_OUT_FADER_H_INCLUDED__
6#define __I_GUI_IN_OUT_FADER_H_INCLUDED__ 6#define __I_GUI_IN_OUT_FADER_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9#include "SColor.h" 9#include "SColor.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace gui 13namespace gui
14{ 14{
15 15
16 //! Element for fading out or in 16 //! Element for fading out or in
17 /** Here is a small example on how the class is used. In this example we fade 17 /** Here is a small example on how the class is used. In this example we fade
18 in from a total red screen in the beginning. As you can see, the fader is not 18 in from a total red screen in the beginning. As you can see, the fader is not
19 only useful for dramatic in and out fading, but also to show that the player 19 only useful for dramatic in and out fading, but also to show that the player
20 is hit in a first person shooter game for example. 20 is hit in a first person shooter game for example.
21 \code 21 \code
22 gui::IGUIInOutFader* fader = device->getGUIEnvironment()->addInOutFader(); 22 gui::IGUIInOutFader* fader = device->getGUIEnvironment()->addInOutFader();
23 fader->setColor(video::SColor(0,255,0,0)); 23 fader->setColor(video::SColor(0,255,0,0));
24 fader->fadeIn(4000); 24 fader->fadeIn(4000);
25 \endcode 25 \endcode
26 */ 26 */
27 class IGUIInOutFader : public IGUIElement 27 class IGUIInOutFader : public IGUIElement
28 { 28 {
29 public: 29 public:
30 30
31 //! constructor 31 //! constructor
32 IGUIInOutFader(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 32 IGUIInOutFader(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
33 : IGUIElement(EGUIET_IN_OUT_FADER, environment, parent, id, rectangle) {} 33 : IGUIElement(EGUIET_IN_OUT_FADER, environment, parent, id, rectangle) {}
34 34
35 //! Gets the color to fade out to or to fade in from. 35 //! Gets the color to fade out to or to fade in from.
36 virtual video::SColor getColor() const = 0; 36 virtual video::SColor getColor() const = 0;
37 37
38 //! Sets the color to fade out to or to fade in from. 38 //! Sets the color to fade out to or to fade in from.
39 /** \param color: Color to where it is faded out od from it is faded in. */ 39 /** \param color: Color to where it is faded out od from it is faded in. */
40 virtual void setColor(video::SColor color) = 0; 40 virtual void setColor(video::SColor color) = 0;
41 virtual void setColor(video::SColor source, video::SColor dest) = 0; 41 virtual void setColor(video::SColor source, video::SColor dest) = 0;
42 42
43 //! Starts the fade in process. 43 //! Starts the fade in process.
44 /** In the beginning the whole rect is drawn by the set color 44 /** In the beginning the whole rect is drawn by the set color
45 (black by default) and at the end of the overgiven time the 45 (black by default) and at the end of the overgiven time the
46 color has faded out. 46 color has faded out.
47 \param time: Time specifying how long it should need to fade in, 47 \param time: Time specifying how long it should need to fade in,
48 in milliseconds. */ 48 in milliseconds. */
49 virtual void fadeIn(u32 time) = 0; 49 virtual void fadeIn(u32 time) = 0;
50 50
51 //! Starts the fade out process. 51 //! Starts the fade out process.
52 /** In the beginning everything is visible, and at the end of 52 /** In the beginning everything is visible, and at the end of
53 the time only the set color (black by the fault) will be drawn. 53 the time only the set color (black by the fault) will be drawn.
54 \param time: Time specifying how long it should need to fade out, 54 \param time: Time specifying how long it should need to fade out,
55 in milliseconds. */ 55 in milliseconds. */
56 virtual void fadeOut(u32 time) = 0; 56 virtual void fadeOut(u32 time) = 0;
57 57
58 //! Returns if the fade in or out process is done. 58 //! Returns if the fade in or out process is done.
59 virtual bool isReady() const = 0; 59 virtual bool isReady() const = 0;
60 }; 60 };
61 61
62 62
63} // end namespace gui 63} // end namespace gui
64} // end namespace irr 64} // end namespace irr
65 65
66#endif 66#endif
67 67
diff --git a/libraries/irrlicht-1.8/include/IGUIListBox.h b/libraries/irrlicht-1.8/include/IGUIListBox.h
index 0af7d7c..de922ce 100644
--- a/libraries/irrlicht-1.8/include/IGUIListBox.h
+++ b/libraries/irrlicht-1.8/include/IGUIListBox.h
@@ -1,138 +1,138 @@
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#ifndef __I_GUI_LIST_BOX_H_INCLUDED__ 5#ifndef __I_GUI_LIST_BOX_H_INCLUDED__
6#define __I_GUI_LIST_BOX_H_INCLUDED__ 6#define __I_GUI_LIST_BOX_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9#include "SColor.h" 9#include "SColor.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace gui 13namespace gui
14{ 14{
15 class IGUISpriteBank; 15 class IGUISpriteBank;
16 16
17 //! Enumeration for listbox colors 17 //! Enumeration for listbox colors
18 enum EGUI_LISTBOX_COLOR 18 enum EGUI_LISTBOX_COLOR
19 { 19 {
20 //! Color of text 20 //! Color of text
21 EGUI_LBC_TEXT=0, 21 EGUI_LBC_TEXT=0,
22 //! Color of selected text 22 //! Color of selected text
23 EGUI_LBC_TEXT_HIGHLIGHT, 23 EGUI_LBC_TEXT_HIGHLIGHT,
24 //! Color of icon 24 //! Color of icon
25 EGUI_LBC_ICON, 25 EGUI_LBC_ICON,
26 //! Color of selected icon 26 //! Color of selected icon
27 EGUI_LBC_ICON_HIGHLIGHT, 27 EGUI_LBC_ICON_HIGHLIGHT,
28 //! Not used, just counts the number of available colors 28 //! Not used, just counts the number of available colors
29 EGUI_LBC_COUNT 29 EGUI_LBC_COUNT
30 }; 30 };
31 31
32 32
33 //! Default list box GUI element. 33 //! Default list box GUI element.
34 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 34 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
35 \li EGET_LISTBOX_CHANGED 35 \li EGET_LISTBOX_CHANGED
36 \li EGET_LISTBOX_SELECTED_AGAIN 36 \li EGET_LISTBOX_SELECTED_AGAIN
37 */ 37 */
38 class IGUIListBox : public IGUIElement 38 class IGUIListBox : public IGUIElement
39 { 39 {
40 public: 40 public:
41 //! constructor 41 //! constructor
42 IGUIListBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 42 IGUIListBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
43 : IGUIElement(EGUIET_LIST_BOX, environment, parent, id, rectangle) {} 43 : IGUIElement(EGUIET_LIST_BOX, environment, parent, id, rectangle) {}
44 44
45 //! returns amount of list items 45 //! returns amount of list items
46 virtual u32 getItemCount() const = 0; 46 virtual u32 getItemCount() const = 0;
47 47
48 //! returns string of a list item. the may id be a value from 0 to itemCount-1 48 //! returns string of a list item. the may id be a value from 0 to itemCount-1
49 virtual const wchar_t* getListItem(u32 id) const = 0; 49 virtual const wchar_t* getListItem(u32 id) const = 0;
50 50
51 //! adds an list item, returns id of item 51 //! adds an list item, returns id of item
52 virtual u32 addItem(const wchar_t* text) = 0; 52 virtual u32 addItem(const wchar_t* text) = 0;
53 53
54 //! adds an list item with an icon 54 //! adds an list item with an icon
55 /** \param text Text of list entry 55 /** \param text Text of list entry
56 \param icon Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon 56 \param icon Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon
57 \return The id of the new created item */ 57 \return The id of the new created item */
58 virtual u32 addItem(const wchar_t* text, s32 icon) = 0; 58 virtual u32 addItem(const wchar_t* text, s32 icon) = 0;
59 59
60 //! Removes an item from the list 60 //! Removes an item from the list
61 virtual void removeItem(u32 index) = 0; 61 virtual void removeItem(u32 index) = 0;
62 62
63 //! get the the id of the item at the given absolute coordinates 63 //! get the the id of the item at the given absolute coordinates
64 /** \return The id of the listitem or -1 when no item is at those coordinates*/ 64 /** \return The id of the listitem or -1 when no item is at those coordinates*/
65 virtual s32 getItemAt(s32 xpos, s32 ypos) const = 0; 65 virtual s32 getItemAt(s32 xpos, s32 ypos) const = 0;
66 66
67 //! Returns the icon of an item 67 //! Returns the icon of an item
68 virtual s32 getIcon(u32 index) const = 0; 68 virtual s32 getIcon(u32 index) const = 0;
69 69
70 //! Sets the sprite bank which should be used to draw list icons. 70 //! Sets the sprite bank which should be used to draw list icons.
71 /** This font is set to the sprite bank of the built-in-font by 71 /** This font is set to the sprite bank of the built-in-font by
72 default. A sprite can be displayed in front of every list item. 72 default. A sprite can be displayed in front of every list item.
73 An icon is an index within the icon sprite bank. Several 73 An icon is an index within the icon sprite bank. Several
74 default icons are available in the skin through getIcon. */ 74 default icons are available in the skin through getIcon. */
75 virtual void setSpriteBank(IGUISpriteBank* bank) = 0; 75 virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
76 76
77 //! clears the list, deletes all items in the listbox 77 //! clears the list, deletes all items in the listbox
78 virtual void clear() = 0; 78 virtual void clear() = 0;
79 79
80 //! returns id of selected item. returns -1 if no item is selected. 80 //! returns id of selected item. returns -1 if no item is selected.
81 virtual s32 getSelected() const = 0; 81 virtual s32 getSelected() const = 0;
82 82
83 //! sets the selected item. Set this to -1 if no item should be selected 83 //! sets the selected item. Set this to -1 if no item should be selected
84 virtual void setSelected(s32 index) = 0; 84 virtual void setSelected(s32 index) = 0;
85 85
86 //! sets the selected item. Set this to 0 if no item should be selected 86 //! sets the selected item. Set this to 0 if no item should be selected
87 virtual void setSelected(const wchar_t *item) = 0; 87 virtual void setSelected(const wchar_t *item) = 0;
88 88
89 //! set whether the listbox should scroll to newly selected items 89 //! set whether the listbox should scroll to newly selected items
90 virtual void setAutoScrollEnabled(bool scroll) = 0; 90 virtual void setAutoScrollEnabled(bool scroll) = 0;
91 91
92 //! returns true if automatic scrolling is enabled, false if not. 92 //! returns true if automatic scrolling is enabled, false if not.
93 virtual bool isAutoScrollEnabled() const = 0; 93 virtual bool isAutoScrollEnabled() const = 0;
94 94
95 //! set all item colors at given index to color 95 //! set all item colors at given index to color
96 virtual void setItemOverrideColor(u32 index, video::SColor color) = 0; 96 virtual void setItemOverrideColor(u32 index, video::SColor color) = 0;
97 97
98 //! set all item colors of specified type at given index to color 98 //! set all item colors of specified type at given index to color
99 virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) = 0; 99 virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) = 0;
100 100
101 //! clear all item colors at index 101 //! clear all item colors at index
102 virtual void clearItemOverrideColor(u32 index) = 0; 102 virtual void clearItemOverrideColor(u32 index) = 0;
103 103
104 //! clear item color at index for given colortype 104 //! clear item color at index for given colortype
105 virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) = 0; 105 virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) = 0;
106 106
107 //! has the item at index its color overwritten? 107 //! has the item at index its color overwritten?
108 virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0; 108 virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0;
109 109
110 //! return the overwrite color at given item index. 110 //! return the overwrite color at given item index.
111 virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0; 111 virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0;
112 112
113 //! return the default color which is used for the given colorType 113 //! return the default color which is used for the given colorType
114 virtual video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const = 0; 114 virtual video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const = 0;
115 115
116 //! set the item at the given index 116 //! set the item at the given index
117 virtual void setItem(u32 index, const wchar_t* text, s32 icon) = 0; 117 virtual void setItem(u32 index, const wchar_t* text, s32 icon) = 0;
118 118
119 //! Insert the item at the given index 119 //! Insert the item at the given index
120 /** \return The index on success or -1 on failure. */ 120 /** \return The index on success or -1 on failure. */
121 virtual s32 insertItem(u32 index, const wchar_t* text, s32 icon) = 0; 121 virtual s32 insertItem(u32 index, const wchar_t* text, s32 icon) = 0;
122 122
123 //! Swap the items at the given indices 123 //! Swap the items at the given indices
124 virtual void swapItems(u32 index1, u32 index2) = 0; 124 virtual void swapItems(u32 index1, u32 index2) = 0;
125 125
126 //! set global itemHeight 126 //! set global itemHeight
127 virtual void setItemHeight( s32 height ) = 0; 127 virtual void setItemHeight( s32 height ) = 0;
128 128
129 //! Sets whether to draw the background 129 //! Sets whether to draw the background
130 virtual void setDrawBackground(bool draw) = 0; 130 virtual void setDrawBackground(bool draw) = 0;
131}; 131};
132 132
133 133
134} // end namespace gui 134} // end namespace gui
135} // end namespace irr 135} // end namespace irr
136 136
137#endif 137#endif
138 138
diff --git a/libraries/irrlicht-1.8/include/IGUIMeshViewer.h b/libraries/irrlicht-1.8/include/IGUIMeshViewer.h
index 3255f4e..62ff1ab 100644
--- a/libraries/irrlicht-1.8/include/IGUIMeshViewer.h
+++ b/libraries/irrlicht-1.8/include/IGUIMeshViewer.h
@@ -1,53 +1,53 @@
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#ifndef __I_GUI_MESH_VIEWER_H_INCLUDED__ 5#ifndef __I_GUI_MESH_VIEWER_H_INCLUDED__
6#define __I_GUI_MESH_VIEWER_H_INCLUDED__ 6#define __I_GUI_MESH_VIEWER_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12 12
13namespace video 13namespace video
14{ 14{
15 class SMaterial; 15 class SMaterial;
16} // end namespace video 16} // end namespace video
17 17
18namespace scene 18namespace scene
19{ 19{
20 class IAnimatedMesh; 20 class IAnimatedMesh;
21} // end namespace scene 21} // end namespace scene
22 22
23namespace gui 23namespace gui
24{ 24{
25 25
26 //! 3d mesh viewing GUI element. 26 //! 3d mesh viewing GUI element.
27 class IGUIMeshViewer : public IGUIElement 27 class IGUIMeshViewer : public IGUIElement
28 { 28 {
29 public: 29 public:
30 30
31 //! constructor 31 //! constructor
32 IGUIMeshViewer(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 32 IGUIMeshViewer(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
33 : IGUIElement(EGUIET_MESH_VIEWER, environment, parent, id, rectangle) {} 33 : IGUIElement(EGUIET_MESH_VIEWER, environment, parent, id, rectangle) {}
34 34
35 //! Sets the mesh to be shown 35 //! Sets the mesh to be shown
36 virtual void setMesh(scene::IAnimatedMesh* mesh) = 0; 36 virtual void setMesh(scene::IAnimatedMesh* mesh) = 0;
37 37
38 //! Gets the displayed mesh 38 //! Gets the displayed mesh
39 virtual scene::IAnimatedMesh* getMesh() const = 0; 39 virtual scene::IAnimatedMesh* getMesh() const = 0;
40 40
41 //! Sets the material 41 //! Sets the material
42 virtual void setMaterial(const video::SMaterial& material) = 0; 42 virtual void setMaterial(const video::SMaterial& material) = 0;
43 43
44 //! Gets the material 44 //! Gets the material
45 virtual const video::SMaterial& getMaterial() const = 0; 45 virtual const video::SMaterial& getMaterial() const = 0;
46 }; 46 };
47 47
48 48
49} // end namespace gui 49} // end namespace gui
50} // end namespace irr 50} // end namespace irr
51 51
52#endif 52#endif
53 53
diff --git a/libraries/irrlicht-1.8/include/IGUIScrollBar.h b/libraries/irrlicht-1.8/include/IGUIScrollBar.h
index c75900e..4064ef9 100644
--- a/libraries/irrlicht-1.8/include/IGUIScrollBar.h
+++ b/libraries/irrlicht-1.8/include/IGUIScrollBar.h
@@ -1,65 +1,65 @@
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#ifndef __I_GUI_SCROLL_BAR_H_INCLUDED__ 5#ifndef __I_GUI_SCROLL_BAR_H_INCLUDED__
6#define __I_GUI_SCROLL_BAR_H_INCLUDED__ 6#define __I_GUI_SCROLL_BAR_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace gui 12namespace gui
13{ 13{
14 14
15 //! Default scroll bar GUI element. 15 //! Default scroll bar GUI element.
16 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 16 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
17 \li EGET_SCROLL_BAR_CHANGED 17 \li EGET_SCROLL_BAR_CHANGED
18 */ 18 */
19 class IGUIScrollBar : public IGUIElement 19 class IGUIScrollBar : public IGUIElement
20 { 20 {
21 public: 21 public:
22 22
23 //! constructor 23 //! constructor
24 IGUIScrollBar(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 24 IGUIScrollBar(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
25 : IGUIElement(EGUIET_SCROLL_BAR, environment, parent, id, rectangle) {} 25 : IGUIElement(EGUIET_SCROLL_BAR, environment, parent, id, rectangle) {}
26 26
27 //! sets the maximum value of the scrollbar. 27 //! sets the maximum value of the scrollbar.
28 virtual void setMax(s32 max) = 0; 28 virtual void setMax(s32 max) = 0;
29 //! gets the maximum value of the scrollbar. 29 //! gets the maximum value of the scrollbar.
30 virtual s32 getMax() const = 0; 30 virtual s32 getMax() const = 0;
31 31
32 //! sets the minimum value of the scrollbar. 32 //! sets the minimum value of the scrollbar.
33 virtual void setMin(s32 min) = 0; 33 virtual void setMin(s32 min) = 0;
34 //! gets the minimum value of the scrollbar. 34 //! gets the minimum value of the scrollbar.
35 virtual s32 getMin() const = 0; 35 virtual s32 getMin() const = 0;
36 36
37 //! gets the small step value 37 //! gets the small step value
38 virtual s32 getSmallStep() const = 0; 38 virtual s32 getSmallStep() const = 0;
39 39
40 //! Sets the small step 40 //! Sets the small step
41 /** That is the amount that the value changes by when clicking 41 /** That is the amount that the value changes by when clicking
42 on the buttons or using the cursor keys. */ 42 on the buttons or using the cursor keys. */
43 virtual void setSmallStep(s32 step) = 0; 43 virtual void setSmallStep(s32 step) = 0;
44 44
45 //! gets the large step value 45 //! gets the large step value
46 virtual s32 getLargeStep() const = 0; 46 virtual s32 getLargeStep() const = 0;
47 47
48 //! Sets the large step 48 //! Sets the large step
49 /** That is the amount that the value changes by when clicking 49 /** That is the amount that the value changes by when clicking
50 in the tray, or using the page up and page down keys. */ 50 in the tray, or using the page up and page down keys. */
51 virtual void setLargeStep(s32 step) = 0; 51 virtual void setLargeStep(s32 step) = 0;
52 52
53 //! gets the current position of the scrollbar 53 //! gets the current position of the scrollbar
54 virtual s32 getPos() const = 0; 54 virtual s32 getPos() const = 0;
55 55
56 //! sets the current position of the scrollbar 56 //! sets the current position of the scrollbar
57 virtual void setPos(s32 pos) = 0; 57 virtual void setPos(s32 pos) = 0;
58 }; 58 };
59 59
60 60
61} // end namespace gui 61} // end namespace gui
62} // end namespace irr 62} // end namespace irr
63 63
64#endif 64#endif
65 65
diff --git a/libraries/irrlicht-1.8/include/IGUISkin.h b/libraries/irrlicht-1.8/include/IGUISkin.h
index d3bf337..0500be2 100644
--- a/libraries/irrlicht-1.8/include/IGUISkin.h
+++ b/libraries/irrlicht-1.8/include/IGUISkin.h
@@ -1,574 +1,574 @@
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#ifndef __I_GUI_SKIN_H_INCLUDED__ 5#ifndef __I_GUI_SKIN_H_INCLUDED__
6#define __I_GUI_SKIN_H_INCLUDED__ 6#define __I_GUI_SKIN_H_INCLUDED__
7 7
8#include "IAttributeExchangingObject.h" 8#include "IAttributeExchangingObject.h"
9#include "EGUIAlignment.h" 9#include "EGUIAlignment.h"
10#include "SColor.h" 10#include "SColor.h"
11#include "rect.h" 11#include "rect.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace gui 15namespace gui
16{ 16{
17 class IGUIFont; 17 class IGUIFont;
18 class IGUISpriteBank; 18 class IGUISpriteBank;
19 class IGUIElement; 19 class IGUIElement;
20 20
21 //! Enumeration of available default skins. 21 //! Enumeration of available default skins.
22 /** To set one of the skins, use the following code, for example to set 22 /** To set one of the skins, use the following code, for example to set
23 the Windows classic skin: 23 the Windows classic skin:
24 \code 24 \code
25 gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC); 25 gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC);
26 environment->setSkin(newskin); 26 environment->setSkin(newskin);
27 newskin->drop(); 27 newskin->drop();
28 \endcode 28 \endcode
29 */ 29 */
30 enum EGUI_SKIN_TYPE 30 enum EGUI_SKIN_TYPE
31 { 31 {
32 //! Default windows look and feel 32 //! Default windows look and feel
33 EGST_WINDOWS_CLASSIC=0, 33 EGST_WINDOWS_CLASSIC=0,
34 34
35 //! Like EGST_WINDOWS_CLASSIC, but with metallic shaded windows and buttons 35 //! Like EGST_WINDOWS_CLASSIC, but with metallic shaded windows and buttons
36 EGST_WINDOWS_METALLIC, 36 EGST_WINDOWS_METALLIC,
37 37
38 //! Burning's skin 38 //! Burning's skin
39 EGST_BURNING_SKIN, 39 EGST_BURNING_SKIN,
40 40
41 //! An unknown skin, not serializable at present 41 //! An unknown skin, not serializable at present
42 EGST_UNKNOWN, 42 EGST_UNKNOWN,
43 43
44 //! this value is not used, it only specifies the number of skin types 44 //! this value is not used, it only specifies the number of skin types
45 EGST_COUNT 45 EGST_COUNT
46 }; 46 };
47 47
48 //! Names for gui element types 48 //! Names for gui element types
49 const c8* const GUISkinTypeNames[EGST_COUNT+1] = 49 const c8* const GUISkinTypeNames[EGST_COUNT+1] =
50 { 50 {
51 "windowsClassic", 51 "windowsClassic",
52 "windowsMetallic", 52 "windowsMetallic",
53 "burning", 53 "burning",
54 "unknown", 54 "unknown",
55 0, 55 0,
56 }; 56 };
57 57
58 58
59 //! Enumeration for skin colors 59 //! Enumeration for skin colors
60 enum EGUI_DEFAULT_COLOR 60 enum EGUI_DEFAULT_COLOR
61 { 61 {
62 //! Dark shadow for three-dimensional display elements. 62 //! Dark shadow for three-dimensional display elements.
63 EGDC_3D_DARK_SHADOW = 0, 63 EGDC_3D_DARK_SHADOW = 0,
64 //! Shadow color for three-dimensional display elements (for edges facing away from the light source). 64 //! Shadow color for three-dimensional display elements (for edges facing away from the light source).
65 EGDC_3D_SHADOW, 65 EGDC_3D_SHADOW,
66 //! Face color for three-dimensional display elements and for dialog box backgrounds. 66 //! Face color for three-dimensional display elements and for dialog box backgrounds.
67 EGDC_3D_FACE, 67 EGDC_3D_FACE,
68 //! Highlight color for three-dimensional display elements (for edges facing the light source.) 68 //! Highlight color for three-dimensional display elements (for edges facing the light source.)
69 EGDC_3D_HIGH_LIGHT, 69 EGDC_3D_HIGH_LIGHT,
70 //! Light color for three-dimensional display elements (for edges facing the light source.) 70 //! Light color for three-dimensional display elements (for edges facing the light source.)
71 EGDC_3D_LIGHT, 71 EGDC_3D_LIGHT,
72 //! Active window border. 72 //! Active window border.
73 EGDC_ACTIVE_BORDER, 73 EGDC_ACTIVE_BORDER,
74 //! Active window title bar text. 74 //! Active window title bar text.
75 EGDC_ACTIVE_CAPTION, 75 EGDC_ACTIVE_CAPTION,
76 //! Background color of multiple document interface (MDI) applications. 76 //! Background color of multiple document interface (MDI) applications.
77 EGDC_APP_WORKSPACE, 77 EGDC_APP_WORKSPACE,
78 //! Text on a button 78 //! Text on a button
79 EGDC_BUTTON_TEXT, 79 EGDC_BUTTON_TEXT,
80 //! Grayed (disabled) text. 80 //! Grayed (disabled) text.
81 EGDC_GRAY_TEXT, 81 EGDC_GRAY_TEXT,
82 //! Item(s) selected in a control. 82 //! Item(s) selected in a control.
83 EGDC_HIGH_LIGHT, 83 EGDC_HIGH_LIGHT,
84 //! Text of item(s) selected in a control. 84 //! Text of item(s) selected in a control.
85 EGDC_HIGH_LIGHT_TEXT, 85 EGDC_HIGH_LIGHT_TEXT,
86 //! Inactive window border. 86 //! Inactive window border.
87 EGDC_INACTIVE_BORDER, 87 EGDC_INACTIVE_BORDER,
88 //! Inactive window caption. 88 //! Inactive window caption.
89 EGDC_INACTIVE_CAPTION, 89 EGDC_INACTIVE_CAPTION,
90 //! Tool tip text color 90 //! Tool tip text color
91 EGDC_TOOLTIP, 91 EGDC_TOOLTIP,
92 //! Tool tip background color 92 //! Tool tip background color
93 EGDC_TOOLTIP_BACKGROUND, 93 EGDC_TOOLTIP_BACKGROUND,
94 //! Scrollbar gray area 94 //! Scrollbar gray area
95 EGDC_SCROLLBAR, 95 EGDC_SCROLLBAR,
96 //! Window background 96 //! Window background
97 EGDC_WINDOW, 97 EGDC_WINDOW,
98 //! Window symbols like on close buttons, scroll bars and check boxes 98 //! Window symbols like on close buttons, scroll bars and check boxes
99 EGDC_WINDOW_SYMBOL, 99 EGDC_WINDOW_SYMBOL,
100 //! Icons in a list or tree 100 //! Icons in a list or tree
101 EGDC_ICON, 101 EGDC_ICON,
102 //! Selected icons in a list or tree 102 //! Selected icons in a list or tree
103 EGDC_ICON_HIGH_LIGHT, 103 EGDC_ICON_HIGH_LIGHT,
104 //! Grayed (disabled) window symbols like on close buttons, scroll bars and check boxes 104 //! Grayed (disabled) window symbols like on close buttons, scroll bars and check boxes
105 EGDC_GRAY_WINDOW_SYMBOL, 105 EGDC_GRAY_WINDOW_SYMBOL,
106 //! Window background for editable field (editbox, checkbox-field) 106 //! Window background for editable field (editbox, checkbox-field)
107 EGDC_EDITABLE, 107 EGDC_EDITABLE,
108 //! Grayed (disabled) window background for editable field (editbox, checkbox-field) 108 //! Grayed (disabled) window background for editable field (editbox, checkbox-field)
109 EGDC_GRAY_EDITABLE, 109 EGDC_GRAY_EDITABLE,
110 //! Show focus of window background for editable field (editbox or when checkbox-field is pressed) 110 //! Show focus of window background for editable field (editbox or when checkbox-field is pressed)
111 EGDC_FOCUSED_EDITABLE, 111 EGDC_FOCUSED_EDITABLE,
112 112
113 //! this value is not used, it only specifies the amount of default colors 113 //! this value is not used, it only specifies the amount of default colors
114 //! available. 114 //! available.
115 EGDC_COUNT 115 EGDC_COUNT
116 }; 116 };
117 117
118 //! Names for default skin colors 118 //! Names for default skin colors
119 const c8* const GUISkinColorNames[EGDC_COUNT+1] = 119 const c8* const GUISkinColorNames[EGDC_COUNT+1] =
120 { 120 {
121 "3DDarkShadow", 121 "3DDarkShadow",
122 "3DShadow", 122 "3DShadow",
123 "3DFace", 123 "3DFace",
124 "3DHighlight", 124 "3DHighlight",
125 "3DLight", 125 "3DLight",
126 "ActiveBorder", 126 "ActiveBorder",
127 "ActiveCaption", 127 "ActiveCaption",
128 "AppWorkspace", 128 "AppWorkspace",
129 "ButtonText", 129 "ButtonText",
130 "GrayText", 130 "GrayText",
131 "Highlight", 131 "Highlight",
132 "HighlightText", 132 "HighlightText",
133 "InactiveBorder", 133 "InactiveBorder",
134 "InactiveCaption", 134 "InactiveCaption",
135 "ToolTip", 135 "ToolTip",
136 "ToolTipBackground", 136 "ToolTipBackground",
137 "ScrollBar", 137 "ScrollBar",
138 "Window", 138 "Window",
139 "WindowSymbol", 139 "WindowSymbol",
140 "Icon", 140 "Icon",
141 "IconHighlight", 141 "IconHighlight",
142 "GrayWindowSymbol", 142 "GrayWindowSymbol",
143 "Editable", 143 "Editable",
144 "GrayEditable", 144 "GrayEditable",
145 "FocusedEditable", 145 "FocusedEditable",
146 0, 146 0,
147 }; 147 };
148 148
149 //! Enumeration for default sizes. 149 //! Enumeration for default sizes.
150 enum EGUI_DEFAULT_SIZE 150 enum EGUI_DEFAULT_SIZE
151 { 151 {
152 //! default with / height of scrollbar 152 //! default with / height of scrollbar
153 EGDS_SCROLLBAR_SIZE = 0, 153 EGDS_SCROLLBAR_SIZE = 0,
154 //! height of menu 154 //! height of menu
155 EGDS_MENU_HEIGHT, 155 EGDS_MENU_HEIGHT,
156 //! width of a window button 156 //! width of a window button
157 EGDS_WINDOW_BUTTON_WIDTH, 157 EGDS_WINDOW_BUTTON_WIDTH,
158 //! width of a checkbox check 158 //! width of a checkbox check
159 EGDS_CHECK_BOX_WIDTH, 159 EGDS_CHECK_BOX_WIDTH,
160 //! \deprecated This may be removed by Irrlicht 1.9 160 //! \deprecated This may be removed by Irrlicht 1.9
161 EGDS_MESSAGE_BOX_WIDTH, 161 EGDS_MESSAGE_BOX_WIDTH,
162 //! \deprecated This may be removed by Irrlicht 1.9 162 //! \deprecated This may be removed by Irrlicht 1.9
163 EGDS_MESSAGE_BOX_HEIGHT, 163 EGDS_MESSAGE_BOX_HEIGHT,
164 //! width of a default button 164 //! width of a default button
165 EGDS_BUTTON_WIDTH, 165 EGDS_BUTTON_WIDTH,
166 //! height of a default button 166 //! height of a default button
167 EGDS_BUTTON_HEIGHT, 167 EGDS_BUTTON_HEIGHT,
168 //! distance for text from background 168 //! distance for text from background
169 EGDS_TEXT_DISTANCE_X, 169 EGDS_TEXT_DISTANCE_X,
170 //! distance for text from background 170 //! distance for text from background
171 EGDS_TEXT_DISTANCE_Y, 171 EGDS_TEXT_DISTANCE_Y,
172 //! distance for text in the title bar, from the left of the window rect 172 //! distance for text in the title bar, from the left of the window rect
173 EGDS_TITLEBARTEXT_DISTANCE_X, 173 EGDS_TITLEBARTEXT_DISTANCE_X,
174 //! distance for text in the title bar, from the top of the window rect 174 //! distance for text in the title bar, from the top of the window rect
175 EGDS_TITLEBARTEXT_DISTANCE_Y, 175 EGDS_TITLEBARTEXT_DISTANCE_Y,
176 //! free space in a messagebox between borders and contents on all sides 176 //! free space in a messagebox between borders and contents on all sides
177 EGDS_MESSAGE_BOX_GAP_SPACE, 177 EGDS_MESSAGE_BOX_GAP_SPACE,
178 //! minimal space to reserve for messagebox text-width 178 //! minimal space to reserve for messagebox text-width
179 EGDS_MESSAGE_BOX_MIN_TEXT_WIDTH, 179 EGDS_MESSAGE_BOX_MIN_TEXT_WIDTH,
180 //! maximal space to reserve for messagebox text-width 180 //! maximal space to reserve for messagebox text-width
181 EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH, 181 EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH,
182 //! minimal space to reserve for messagebox text-height 182 //! minimal space to reserve for messagebox text-height
183 EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT, 183 EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT,
184 //! maximal space to reserve for messagebox text-height 184 //! maximal space to reserve for messagebox text-height
185 EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT, 185 EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT,
186 //! pixels to move the button image to the right when a pushbutton is pressed 186 //! pixels to move the button image to the right when a pushbutton is pressed
187 EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X, 187 EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X,
188 //! pixels to move the button image down when a pushbutton is pressed 188 //! pixels to move the button image down when a pushbutton is pressed
189 EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y, 189 EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y,
190 //! pixels to move the button text to the right when a pushbutton is pressed 190 //! pixels to move the button text to the right when a pushbutton is pressed
191 EGDS_BUTTON_PRESSED_TEXT_OFFSET_X, 191 EGDS_BUTTON_PRESSED_TEXT_OFFSET_X,
192 //! pixels to move the button text down when a pushbutton is pressed 192 //! pixels to move the button text down when a pushbutton is pressed
193 EGDS_BUTTON_PRESSED_TEXT_OFFSET_Y, 193 EGDS_BUTTON_PRESSED_TEXT_OFFSET_Y,
194 194
195 //! this value is not used, it only specifies the amount of default sizes 195 //! this value is not used, it only specifies the amount of default sizes
196 //! available. 196 //! available.
197 EGDS_COUNT 197 EGDS_COUNT
198 }; 198 };
199 199
200 200
201 //! Names for default skin sizes 201 //! Names for default skin sizes
202 const c8* const GUISkinSizeNames[EGDS_COUNT+1] = 202 const c8* const GUISkinSizeNames[EGDS_COUNT+1] =
203 { 203 {
204 "ScrollBarSize", 204 "ScrollBarSize",
205 "MenuHeight", 205 "MenuHeight",
206 "WindowButtonWidth", 206 "WindowButtonWidth",
207 "CheckBoxWidth", 207 "CheckBoxWidth",
208 "MessageBoxWidth", 208 "MessageBoxWidth",
209 "MessageBoxHeight", 209 "MessageBoxHeight",
210 "ButtonWidth", 210 "ButtonWidth",
211 "ButtonHeight", 211 "ButtonHeight",
212 "TextDistanceX", 212 "TextDistanceX",
213 "TextDistanceY", 213 "TextDistanceY",
214 "TitleBarTextX", 214 "TitleBarTextX",
215 "TitleBarTextY", 215 "TitleBarTextY",
216 "MessageBoxGapSpace", 216 "MessageBoxGapSpace",
217 "MessageBoxMinTextWidth", 217 "MessageBoxMinTextWidth",
218 "MessageBoxMaxTextWidth", 218 "MessageBoxMaxTextWidth",
219 "MessageBoxMinTextHeight", 219 "MessageBoxMinTextHeight",
220 "MessageBoxMaxTextHeight", 220 "MessageBoxMaxTextHeight",
221 "ButtonPressedImageOffsetX", 221 "ButtonPressedImageOffsetX",
222 "ButtonPressedImageOffsetY" 222 "ButtonPressedImageOffsetY"
223 "ButtonPressedTextOffsetX", 223 "ButtonPressedTextOffsetX",
224 "ButtonPressedTextOffsetY", 224 "ButtonPressedTextOffsetY",
225 0 225 0
226 }; 226 };
227 227
228 228
229 enum EGUI_DEFAULT_TEXT 229 enum EGUI_DEFAULT_TEXT
230 { 230 {
231 //! Text for the OK button on a message box 231 //! Text for the OK button on a message box
232 EGDT_MSG_BOX_OK = 0, 232 EGDT_MSG_BOX_OK = 0,
233 //! Text for the Cancel button on a message box 233 //! Text for the Cancel button on a message box
234 EGDT_MSG_BOX_CANCEL, 234 EGDT_MSG_BOX_CANCEL,
235 //! Text for the Yes button on a message box 235 //! Text for the Yes button on a message box
236 EGDT_MSG_BOX_YES, 236 EGDT_MSG_BOX_YES,
237 //! Text for the No button on a message box 237 //! Text for the No button on a message box
238 EGDT_MSG_BOX_NO, 238 EGDT_MSG_BOX_NO,
239 //! Tooltip text for window close button 239 //! Tooltip text for window close button
240 EGDT_WINDOW_CLOSE, 240 EGDT_WINDOW_CLOSE,
241 //! Tooltip text for window maximize button 241 //! Tooltip text for window maximize button
242 EGDT_WINDOW_MAXIMIZE, 242 EGDT_WINDOW_MAXIMIZE,
243 //! Tooltip text for window minimize button 243 //! Tooltip text for window minimize button
244 EGDT_WINDOW_MINIMIZE, 244 EGDT_WINDOW_MINIMIZE,
245 //! Tooltip text for window restore button 245 //! Tooltip text for window restore button
246 EGDT_WINDOW_RESTORE, 246 EGDT_WINDOW_RESTORE,
247 247
248 //! this value is not used, it only specifies the number of default texts 248 //! this value is not used, it only specifies the number of default texts
249 EGDT_COUNT 249 EGDT_COUNT
250 }; 250 };
251 251
252 //! Names for default skin sizes 252 //! Names for default skin sizes
253 const c8* const GUISkinTextNames[EGDT_COUNT+1] = 253 const c8* const GUISkinTextNames[EGDT_COUNT+1] =
254 { 254 {
255 "MessageBoxOkay", 255 "MessageBoxOkay",
256 "MessageBoxCancel", 256 "MessageBoxCancel",
257 "MessageBoxYes", 257 "MessageBoxYes",
258 "MessageBoxNo", 258 "MessageBoxNo",
259 "WindowButtonClose", 259 "WindowButtonClose",
260 "WindowButtonMaximize", 260 "WindowButtonMaximize",
261 "WindowButtonMinimize", 261 "WindowButtonMinimize",
262 "WindowButtonRestore", 262 "WindowButtonRestore",
263 0 263 0
264 }; 264 };
265 265
266 //! Customizable symbols for GUI 266 //! Customizable symbols for GUI
267 enum EGUI_DEFAULT_ICON 267 enum EGUI_DEFAULT_ICON
268 { 268 {
269 //! maximize window button 269 //! maximize window button
270 EGDI_WINDOW_MAXIMIZE = 0, 270 EGDI_WINDOW_MAXIMIZE = 0,
271 //! restore window button 271 //! restore window button
272 EGDI_WINDOW_RESTORE, 272 EGDI_WINDOW_RESTORE,
273 //! close window button 273 //! close window button
274 EGDI_WINDOW_CLOSE, 274 EGDI_WINDOW_CLOSE,
275 //! minimize window button 275 //! minimize window button
276 EGDI_WINDOW_MINIMIZE, 276 EGDI_WINDOW_MINIMIZE,
277 //! resize icon for bottom right corner of a window 277 //! resize icon for bottom right corner of a window
278 EGDI_WINDOW_RESIZE, 278 EGDI_WINDOW_RESIZE,
279 //! scroll bar up button 279 //! scroll bar up button
280 EGDI_CURSOR_UP, 280 EGDI_CURSOR_UP,
281 //! scroll bar down button 281 //! scroll bar down button
282 EGDI_CURSOR_DOWN, 282 EGDI_CURSOR_DOWN,
283 //! scroll bar left button 283 //! scroll bar left button
284 EGDI_CURSOR_LEFT, 284 EGDI_CURSOR_LEFT,
285 //! scroll bar right button 285 //! scroll bar right button
286 EGDI_CURSOR_RIGHT, 286 EGDI_CURSOR_RIGHT,
287 //! icon for menu children 287 //! icon for menu children
288 EGDI_MENU_MORE, 288 EGDI_MENU_MORE,
289 //! tick for checkbox 289 //! tick for checkbox
290 EGDI_CHECK_BOX_CHECKED, 290 EGDI_CHECK_BOX_CHECKED,
291 //! down arrow for dropdown menus 291 //! down arrow for dropdown menus
292 EGDI_DROP_DOWN, 292 EGDI_DROP_DOWN,
293 //! smaller up arrow 293 //! smaller up arrow
294 EGDI_SMALL_CURSOR_UP, 294 EGDI_SMALL_CURSOR_UP,
295 //! smaller down arrow 295 //! smaller down arrow
296 EGDI_SMALL_CURSOR_DOWN, 296 EGDI_SMALL_CURSOR_DOWN,
297 //! selection dot in a radio button 297 //! selection dot in a radio button
298 EGDI_RADIO_BUTTON_CHECKED, 298 EGDI_RADIO_BUTTON_CHECKED,
299 //! << icon indicating there is more content to the left 299 //! << icon indicating there is more content to the left
300 EGDI_MORE_LEFT, 300 EGDI_MORE_LEFT,
301 //! >> icon indicating that there is more content to the right 301 //! >> icon indicating that there is more content to the right
302 EGDI_MORE_RIGHT, 302 EGDI_MORE_RIGHT,
303 //! icon indicating that there is more content above 303 //! icon indicating that there is more content above
304 EGDI_MORE_UP, 304 EGDI_MORE_UP,
305 //! icon indicating that there is more content below 305 //! icon indicating that there is more content below
306 EGDI_MORE_DOWN, 306 EGDI_MORE_DOWN,
307 //! plus icon for trees 307 //! plus icon for trees
308 EGDI_EXPAND, 308 EGDI_EXPAND,
309 309
310 //! minus icon for trees 310 //! minus icon for trees
311 EGDI_COLLAPSE, 311 EGDI_COLLAPSE,
312 //! file icon for file selection 312 //! file icon for file selection
313 EGDI_FILE, 313 EGDI_FILE,
314 //! folder icon for file selection 314 //! folder icon for file selection
315 EGDI_DIRECTORY, 315 EGDI_DIRECTORY,
316 316
317 //! value not used, it only specifies the number of icons 317 //! value not used, it only specifies the number of icons
318 EGDI_COUNT 318 EGDI_COUNT
319 }; 319 };
320 320
321 const c8* const GUISkinIconNames[EGDI_COUNT+1] = 321 const c8* const GUISkinIconNames[EGDI_COUNT+1] =
322 { 322 {
323 "windowMaximize", 323 "windowMaximize",
324 "windowRestore", 324 "windowRestore",
325 "windowClose", 325 "windowClose",
326 "windowMinimize", 326 "windowMinimize",
327 "windowResize", 327 "windowResize",
328 "cursorUp", 328 "cursorUp",
329 "cursorDown", 329 "cursorDown",
330 "cursorLeft", 330 "cursorLeft",
331 "cursorRight", 331 "cursorRight",
332 "menuMore", 332 "menuMore",
333 "checkBoxChecked", 333 "checkBoxChecked",
334 "dropDown", 334 "dropDown",
335 "smallCursorUp", 335 "smallCursorUp",
336 "smallCursorDown", 336 "smallCursorDown",
337 "radioButtonChecked", 337 "radioButtonChecked",
338 "moreLeft", 338 "moreLeft",
339 "moreRight", 339 "moreRight",
340 "moreUp", 340 "moreUp",
341 "moreDown", 341 "moreDown",
342 "expand", 342 "expand",
343 "collapse", 343 "collapse",
344 "file", 344 "file",
345 "directory", 345 "directory",
346 0 346 0
347 }; 347 };
348 348
349 // Customizable fonts 349 // Customizable fonts
350 enum EGUI_DEFAULT_FONT 350 enum EGUI_DEFAULT_FONT
351 { 351 {
352 //! For static text, edit boxes, lists and most other places 352 //! For static text, edit boxes, lists and most other places
353 EGDF_DEFAULT=0, 353 EGDF_DEFAULT=0,
354 //! Font for buttons 354 //! Font for buttons
355 EGDF_BUTTON, 355 EGDF_BUTTON,
356 //! Font for window title bars 356 //! Font for window title bars
357 EGDF_WINDOW, 357 EGDF_WINDOW,
358 //! Font for menu items 358 //! Font for menu items
359 EGDF_MENU, 359 EGDF_MENU,
360 //! Font for tooltips 360 //! Font for tooltips
361 EGDF_TOOLTIP, 361 EGDF_TOOLTIP,
362 //! this value is not used, it only specifies the amount of default fonts 362 //! this value is not used, it only specifies the amount of default fonts
363 //! available. 363 //! available.
364 EGDF_COUNT 364 EGDF_COUNT
365 }; 365 };
366 366
367 const c8* const GUISkinFontNames[EGDF_COUNT+1] = 367 const c8* const GUISkinFontNames[EGDF_COUNT+1] =
368 { 368 {
369 "defaultFont", 369 "defaultFont",
370 "buttonFont", 370 "buttonFont",
371 "windowFont", 371 "windowFont",
372 "menuFont", 372 "menuFont",
373 "tooltipFont", 373 "tooltipFont",
374 0 374 0
375 }; 375 };
376 376
377 //! A skin modifies the look of the GUI elements. 377 //! A skin modifies the look of the GUI elements.
378 class IGUISkin : public virtual io::IAttributeExchangingObject 378 class IGUISkin : public virtual io::IAttributeExchangingObject
379 { 379 {
380 public: 380 public:
381 381
382 //! returns default color 382 //! returns default color
383 virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const = 0; 383 virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const = 0;
384 384
385 //! sets a default color 385 //! sets a default color
386 virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0; 386 virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) = 0;
387 387
388 //! returns size for the given size type 388 //! returns size for the given size type
389 virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0; 389 virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0;
390 390
391 //! Returns a default text. 391 //! Returns a default text.
392 /** For example for Message box button captions: 392 /** For example for Message box button captions:
393 "OK", "Cancel", "Yes", "No" and so on. */ 393 "OK", "Cancel", "Yes", "No" and so on. */
394 virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const = 0; 394 virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const = 0;
395 395
396 //! Sets a default text. 396 //! Sets a default text.
397 /** For example for Message box button captions: 397 /** For example for Message box button captions:
398 "OK", "Cancel", "Yes", "No" and so on. */ 398 "OK", "Cancel", "Yes", "No" and so on. */
399 virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) = 0; 399 virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) = 0;
400 400
401 //! sets a default size 401 //! sets a default size
402 virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0; 402 virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) = 0;
403 403
404 //! returns the default font 404 //! returns the default font
405 virtual IGUIFont* getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const = 0; 405 virtual IGUIFont* getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const = 0;
406 406
407 //! sets a default font 407 //! sets a default font
408 virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT) = 0; 408 virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT) = 0;
409 409
410 //! returns the sprite bank 410 //! returns the sprite bank
411 virtual IGUISpriteBank* getSpriteBank() const = 0; 411 virtual IGUISpriteBank* getSpriteBank() const = 0;
412 412
413 //! sets the sprite bank 413 //! sets the sprite bank
414 virtual void setSpriteBank(IGUISpriteBank* bank) = 0; 414 virtual void setSpriteBank(IGUISpriteBank* bank) = 0;
415 415
416 //! Returns a default icon 416 //! Returns a default icon
417 /** Returns the sprite index within the sprite bank */ 417 /** Returns the sprite index within the sprite bank */
418 virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0; 418 virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0;
419 419
420 //! Sets a default icon 420 //! Sets a default icon
421 /** Sets the sprite index used for drawing icons like arrows, 421 /** Sets the sprite index used for drawing icons like arrows,
422 close buttons and ticks in checkboxes 422 close buttons and ticks in checkboxes
423 \param icon: Enum specifying which icon to change 423 \param icon: Enum specifying which icon to change
424 \param index: The sprite index used to draw this icon */ 424 \param index: The sprite index used to draw this icon */
425 virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0; 425 virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
426 426
427 //! draws a standard 3d button pane 427 //! draws a standard 3d button pane
428 /** Used for drawing for example buttons in normal state. 428 /** Used for drawing for example buttons in normal state.
429 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and 429 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
430 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details. 430 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
431 \param element: Pointer to the element which wishes to draw this. This parameter 431 \param element: Pointer to the element which wishes to draw this. This parameter
432 is usually not used by IGUISkin, but can be used for example by more complex 432 is usually not used by IGUISkin, but can be used for example by more complex
433 implementations to find out how to draw the part exactly. 433 implementations to find out how to draw the part exactly.
434 \param rect: Defining area where to draw. 434 \param rect: Defining area where to draw.
435 \param clip: Clip area. */ 435 \param clip: Clip area. */
436 virtual void draw3DButtonPaneStandard(IGUIElement* element, 436 virtual void draw3DButtonPaneStandard(IGUIElement* element,
437 const core::rect<s32>& rect, 437 const core::rect<s32>& rect,
438 const core::rect<s32>* clip=0) = 0; 438 const core::rect<s32>* clip=0) = 0;
439 439
440 //! draws a pressed 3d button pane 440 //! draws a pressed 3d button pane
441 /** Used for drawing for example buttons in pressed state. 441 /** Used for drawing for example buttons in pressed state.
442 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and 442 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
443 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details. 443 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
444 \param element: Pointer to the element which wishes to draw this. This parameter 444 \param element: Pointer to the element which wishes to draw this. This parameter
445 is usually not used by IGUISkin, but can be used for example by more complex 445 is usually not used by IGUISkin, but can be used for example by more complex
446 implementations to find out how to draw the part exactly. 446 implementations to find out how to draw the part exactly.
447 \param rect: Defining area where to draw. 447 \param rect: Defining area where to draw.
448 \param clip: Clip area. */ 448 \param clip: Clip area. */
449 virtual void draw3DButtonPanePressed(IGUIElement* element, 449 virtual void draw3DButtonPanePressed(IGUIElement* element,
450 const core::rect<s32>& rect, 450 const core::rect<s32>& rect,
451 const core::rect<s32>* clip=0) = 0; 451 const core::rect<s32>* clip=0) = 0;
452 452
453 //! draws a sunken 3d pane 453 //! draws a sunken 3d pane
454 /** Used for drawing the background of edit, combo or check boxes. 454 /** Used for drawing the background of edit, combo or check boxes.
455 \param element: Pointer to the element which wishes to draw this. This parameter 455 \param element: Pointer to the element which wishes to draw this. This parameter
456 is usually not used by IGUISkin, but can be used for example by more complex 456 is usually not used by IGUISkin, but can be used for example by more complex
457 implementations to find out how to draw the part exactly. 457 implementations to find out how to draw the part exactly.
458 \param bgcolor: Background color. 458 \param bgcolor: Background color.
459 \param flat: Specifies if the sunken pane should be flat or displayed as sunken 459 \param flat: Specifies if the sunken pane should be flat or displayed as sunken
460 deep into the ground. 460 deep into the ground.
461 \param fillBackGround: Specifies if the background should be filled with the background 461 \param fillBackGround: Specifies if the background should be filled with the background
462 color or not be drawn at all. 462 color or not be drawn at all.
463 \param rect: Defining area where to draw. 463 \param rect: Defining area where to draw.
464 \param clip: Clip area. */ 464 \param clip: Clip area. */
465 virtual void draw3DSunkenPane(IGUIElement* element, 465 virtual void draw3DSunkenPane(IGUIElement* element,
466 video::SColor bgcolor, bool flat, bool fillBackGround, 466 video::SColor bgcolor, bool flat, bool fillBackGround,
467 const core::rect<s32>& rect, 467 const core::rect<s32>& rect,
468 const core::rect<s32>* clip=0) = 0; 468 const core::rect<s32>* clip=0) = 0;
469 469
470 //! draws a window background 470 //! draws a window background
471 /** Used for drawing the background of dialogs and windows. 471 /** Used for drawing the background of dialogs and windows.
472 \param element: Pointer to the element which wishes to draw this. This parameter 472 \param element: Pointer to the element which wishes to draw this. This parameter
473 is usually not used by IGUISkin, but can be used for example by more complex 473 is usually not used by IGUISkin, but can be used for example by more complex
474 implementations to find out how to draw the part exactly. 474 implementations to find out how to draw the part exactly.
475 \param titleBarColor: Title color. 475 \param titleBarColor: Title color.
476 \param drawTitleBar: True to enable title drawing. 476 \param drawTitleBar: True to enable title drawing.
477 \param rect: Defining area where to draw. 477 \param rect: Defining area where to draw.
478 \param clip: Clip area. 478 \param clip: Clip area.
479 \param checkClientArea: When set to non-null the function will not draw anything, 479 \param checkClientArea: When set to non-null the function will not draw anything,
480 but will instead return the clientArea which can be used for drawing by the calling window. 480 but will instead return the clientArea which can be used for drawing by the calling window.
481 That is the area without borders and without titlebar. 481 That is the area without borders and without titlebar.
482 \return Returns rect where it would be good to draw title bar text. This will 482 \return Returns rect where it would be good to draw title bar text. This will
483 work even when checkClientArea is set to a non-null value.*/ 483 work even when checkClientArea is set to a non-null value.*/
484 virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element, 484 virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element,
485 bool drawTitleBar, video::SColor titleBarColor, 485 bool drawTitleBar, video::SColor titleBarColor,
486 const core::rect<s32>& rect, 486 const core::rect<s32>& rect,
487 const core::rect<s32>* clip=0, 487 const core::rect<s32>* clip=0,
488 core::rect<s32>* checkClientArea=0) = 0; 488 core::rect<s32>* checkClientArea=0) = 0;
489 489
490 //! draws a standard 3d menu pane 490 //! draws a standard 3d menu pane
491 /** Used for drawing for menus and context menus. 491 /** Used for drawing for menus and context menus.
492 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and 492 It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
493 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details. 493 EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
494 \param element: Pointer to the element which wishes to draw this. This parameter 494 \param element: Pointer to the element which wishes to draw this. This parameter
495 is usually not used by IGUISkin, but can be used for example by more complex 495 is usually not used by IGUISkin, but can be used for example by more complex
496 implementations to find out how to draw the part exactly. 496 implementations to find out how to draw the part exactly.
497 \param rect: Defining area where to draw. 497 \param rect: Defining area where to draw.
498 \param clip: Clip area. */ 498 \param clip: Clip area. */
499 virtual void draw3DMenuPane(IGUIElement* element, 499 virtual void draw3DMenuPane(IGUIElement* element,
500 const core::rect<s32>& rect, 500 const core::rect<s32>& rect,
501 const core::rect<s32>* clip=0) = 0; 501 const core::rect<s32>* clip=0) = 0;
502 502
503 //! draws a standard 3d tool bar 503 //! draws a standard 3d tool bar
504 /** Used for drawing for toolbars and menus. 504 /** Used for drawing for toolbars and menus.
505 \param element: Pointer to the element which wishes to draw this. This parameter 505 \param element: Pointer to the element which wishes to draw this. This parameter
506 is usually not used by IGUISkin, but can be used for example by more complex 506 is usually not used by IGUISkin, but can be used for example by more complex
507 implementations to find out how to draw the part exactly. 507 implementations to find out how to draw the part exactly.
508 \param rect: Defining area where to draw. 508 \param rect: Defining area where to draw.
509 \param clip: Clip area. */ 509 \param clip: Clip area. */
510 virtual void draw3DToolBar(IGUIElement* element, 510 virtual void draw3DToolBar(IGUIElement* element,
511 const core::rect<s32>& rect, 511 const core::rect<s32>& rect,
512 const core::rect<s32>* clip=0) = 0; 512 const core::rect<s32>* clip=0) = 0;
513 513
514 //! draws a tab button 514 //! draws a tab button
515 /** Used for drawing for tab buttons on top of tabs. 515 /** Used for drawing for tab buttons on top of tabs.
516 \param element: Pointer to the element which wishes to draw this. This parameter 516 \param element: Pointer to the element which wishes to draw this. This parameter
517 is usually not used by IGUISkin, but can be used for example by more complex 517 is usually not used by IGUISkin, but can be used for example by more complex
518 implementations to find out how to draw the part exactly. 518 implementations to find out how to draw the part exactly.
519 \param active: Specifies if the tab is currently active. 519 \param active: Specifies if the tab is currently active.
520 \param rect: Defining area where to draw. 520 \param rect: Defining area where to draw.
521 \param clip: Clip area. 521 \param clip: Clip area.
522 \param alignment Alignment of GUI element. */ 522 \param alignment Alignment of GUI element. */
523 virtual void draw3DTabButton(IGUIElement* element, bool active, 523 virtual void draw3DTabButton(IGUIElement* element, bool active,
524 const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) = 0; 524 const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) = 0;
525 525
526 //! draws a tab control body 526 //! draws a tab control body
527 /** \param element: Pointer to the element which wishes to draw this. This parameter 527 /** \param element: Pointer to the element which wishes to draw this. This parameter
528 is usually not used by IGUISkin, but can be used for example by more complex 528 is usually not used by IGUISkin, but can be used for example by more complex
529 implementations to find out how to draw the part exactly. 529 implementations to find out how to draw the part exactly.
530 \param border: Specifies if the border should be drawn. 530 \param border: Specifies if the border should be drawn.
531 \param background: Specifies if the background should be drawn. 531 \param background: Specifies if the background should be drawn.
532 \param rect: Defining area where to draw. 532 \param rect: Defining area where to draw.
533 \param clip: Clip area. 533 \param clip: Clip area.
534 \param tabHeight Height of tab. 534 \param tabHeight Height of tab.
535 \param alignment Alignment of GUI element. */ 535 \param alignment Alignment of GUI element. */
536 virtual void draw3DTabBody(IGUIElement* element, bool border, bool background, 536 virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
537 const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT ) = 0; 537 const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT ) = 0;
538 538
539 //! draws an icon, usually from the skin's sprite bank 539 //! draws an icon, usually from the skin's sprite bank
540 /** \param element: Pointer to the element which wishes to draw this icon. 540 /** \param element: Pointer to the element which wishes to draw this icon.
541 This parameter is usually not used by IGUISkin, but can be used for example 541 This parameter is usually not used by IGUISkin, but can be used for example
542 by more complex implementations to find out how to draw the part exactly. 542 by more complex implementations to find out how to draw the part exactly.
543 \param icon: Specifies the icon to be drawn. 543 \param icon: Specifies the icon to be drawn.
544 \param position: The position to draw the icon 544 \param position: The position to draw the icon
545 \param starttime: The time at the start of the animation 545 \param starttime: The time at the start of the animation
546 \param currenttime: The present time, used to calculate the frame number 546 \param currenttime: The present time, used to calculate the frame number
547 \param loop: Whether the animation should loop or not 547 \param loop: Whether the animation should loop or not
548 \param clip: Clip area. */ 548 \param clip: Clip area. */
549 virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon, 549 virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
550 const core::position2di position, u32 starttime=0, u32 currenttime=0, 550 const core::position2di position, u32 starttime=0, u32 currenttime=0,
551 bool loop=false, const core::rect<s32>* clip=0) = 0; 551 bool loop=false, const core::rect<s32>* clip=0) = 0;
552 552
553 //! draws a 2d rectangle. 553 //! draws a 2d rectangle.
554 /** \param element: Pointer to the element which wishes to draw this icon. 554 /** \param element: Pointer to the element which wishes to draw this icon.
555 This parameter is usually not used by IGUISkin, but can be used for example 555 This parameter is usually not used by IGUISkin, but can be used for example
556 by more complex implementations to find out how to draw the part exactly. 556 by more complex implementations to find out how to draw the part exactly.
557 \param color: Color of the rectangle to draw. The alpha component specifies how 557 \param color: Color of the rectangle to draw. The alpha component specifies how
558 transparent the rectangle will be. 558 transparent the rectangle will be.
559 \param pos: Position of the rectangle. 559 \param pos: Position of the rectangle.
560 \param clip: Pointer to rectangle against which the rectangle will be clipped. 560 \param clip: Pointer to rectangle against which the rectangle will be clipped.
561 If the pointer is null, no clipping will be performed. */ 561 If the pointer is null, no clipping will be performed. */
562 virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color, 562 virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
563 const core::rect<s32>& pos, const core::rect<s32>* clip = 0) = 0; 563 const core::rect<s32>& pos, const core::rect<s32>* clip = 0) = 0;
564 564
565 //! get the type of this skin 565 //! get the type of this skin
566 virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; } 566 virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
567 }; 567 };
568 568
569 569
570} // end namespace gui 570} // end namespace gui
571} // end namespace irr 571} // end namespace irr
572 572
573#endif 573#endif
574 574
diff --git a/libraries/irrlicht-1.8/include/IGUISpinBox.h b/libraries/irrlicht-1.8/include/IGUISpinBox.h
index bef139d..2310161 100644
--- a/libraries/irrlicht-1.8/include/IGUISpinBox.h
+++ b/libraries/irrlicht-1.8/include/IGUISpinBox.h
@@ -1,69 +1,69 @@
1// Copyright (C) 2006-2012 Michael Zeilfelder 1// Copyright (C) 2006-2012 Michael Zeilfelder
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#ifndef __I_GUI_SPIN_BOX_H_INCLUDED__ 5#ifndef __I_GUI_SPIN_BOX_H_INCLUDED__
6#define __I_GUI_SPIN_BOX_H_INCLUDED__ 6#define __I_GUI_SPIN_BOX_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace gui 12namespace gui
13{ 13{
14 class IGUIEditBox; 14 class IGUIEditBox;
15 15
16 //! Single line edit box + spin buttons 16 //! Single line edit box + spin buttons
17 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 17 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
18 \li EGET_SPINBOX_CHANGED 18 \li EGET_SPINBOX_CHANGED
19 */ 19 */
20 class IGUISpinBox : public IGUIElement 20 class IGUISpinBox : public IGUIElement
21 { 21 {
22 public: 22 public:
23 23
24 //! constructor 24 //! constructor
25 IGUISpinBox(IGUIEnvironment* environment, IGUIElement* parent, 25 IGUISpinBox(IGUIEnvironment* environment, IGUIElement* parent,
26 s32 id, core::rect<s32> rectangle) 26 s32 id, core::rect<s32> rectangle)
27 : IGUIElement(EGUIET_SPIN_BOX, environment, parent, id, rectangle) {} 27 : IGUIElement(EGUIET_SPIN_BOX, environment, parent, id, rectangle) {}
28 28
29 //! Access the edit box used in the spin control 29 //! Access the edit box used in the spin control
30 virtual IGUIEditBox* getEditBox() const = 0; 30 virtual IGUIEditBox* getEditBox() const = 0;
31 31
32 //! set the current value of the spinbox 32 //! set the current value of the spinbox
33 /** \param val: value to be set in the spinbox */ 33 /** \param val: value to be set in the spinbox */
34 virtual void setValue(f32 val) = 0; 34 virtual void setValue(f32 val) = 0;
35 35
36 //! Get the current value of the spinbox 36 //! Get the current value of the spinbox
37 virtual f32 getValue() const = 0; 37 virtual f32 getValue() const = 0;
38 38
39 //! set the range of values which can be used in the spinbox 39 //! set the range of values which can be used in the spinbox
40 /** \param min: minimum value 40 /** \param min: minimum value
41 \param max: maximum value */ 41 \param max: maximum value */
42 virtual void setRange(f32 min, f32 max) = 0; 42 virtual void setRange(f32 min, f32 max) = 0;
43 43
44 //! get the minimum value which can be used in the spinbox 44 //! get the minimum value which can be used in the spinbox
45 virtual f32 getMin() const = 0; 45 virtual f32 getMin() const = 0;
46 46
47 //! get the maximum value which can be used in the spinbox 47 //! get the maximum value which can be used in the spinbox
48 virtual f32 getMax() const = 0; 48 virtual f32 getMax() const = 0;
49 49
50 //! Step size by which values are changed when pressing the spinbuttons 50 //! Step size by which values are changed when pressing the spinbuttons
51 /** The step size also determines the number of decimal places to display 51 /** The step size also determines the number of decimal places to display
52 \param step: stepsize used for value changes when pressing spinbuttons */ 52 \param step: stepsize used for value changes when pressing spinbuttons */
53 virtual void setStepSize(f32 step=1.f) = 0; 53 virtual void setStepSize(f32 step=1.f) = 0;
54 54
55 //! Sets the number of decimal places to display. 55 //! Sets the number of decimal places to display.
56 //! Note that this also rounds the range to the same number of decimal places. 56 //! Note that this also rounds the range to the same number of decimal places.
57 /** \param places: The number of decimal places to display, use -1 to reset */ 57 /** \param places: The number of decimal places to display, use -1 to reset */
58 virtual void setDecimalPlaces(s32 places) = 0; 58 virtual void setDecimalPlaces(s32 places) = 0;
59 59
60 //! get the current step size 60 //! get the current step size
61 virtual f32 getStepSize() const = 0; 61 virtual f32 getStepSize() const = 0;
62 }; 62 };
63 63
64 64
65} // end namespace gui 65} // end namespace gui
66} // end namespace irr 66} // end namespace irr
67 67
68#endif // __I_GUI_SPIN_BOX_H_INCLUDED__ 68#endif // __I_GUI_SPIN_BOX_H_INCLUDED__
69 69
diff --git a/libraries/irrlicht-1.8/include/IGUISpriteBank.h b/libraries/irrlicht-1.8/include/IGUISpriteBank.h
index 4a2b5f5..872bbca 100644
--- a/libraries/irrlicht-1.8/include/IGUISpriteBank.h
+++ b/libraries/irrlicht-1.8/include/IGUISpriteBank.h
@@ -1,95 +1,95 @@
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#ifndef __I_GUI_SPRITE_BANK_H_INCLUDED__ 5#ifndef __I_GUI_SPRITE_BANK_H_INCLUDED__
6#define __I_GUI_SPRITE_BANK_H_INCLUDED__ 6#define __I_GUI_SPRITE_BANK_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "irrArray.h" 9#include "irrArray.h"
10#include "SColor.h" 10#include "SColor.h"
11#include "rect.h" 11#include "rect.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15 15
16namespace video 16namespace video
17{ 17{
18 class ITexture; 18 class ITexture;
19} // end namespace video 19} // end namespace video
20 20
21namespace gui 21namespace gui
22{ 22{
23 23
24//! A single sprite frame. 24//! A single sprite frame.
25struct SGUISpriteFrame 25struct SGUISpriteFrame
26{ 26{
27 u32 textureNumber; 27 u32 textureNumber;
28 u32 rectNumber; 28 u32 rectNumber;
29}; 29};
30 30
31//! A sprite composed of several frames. 31//! A sprite composed of several frames.
32struct SGUISprite 32struct SGUISprite
33{ 33{
34 SGUISprite() : Frames(), frameTime(0) {} 34 SGUISprite() : Frames(), frameTime(0) {}
35 35
36 core::array<SGUISpriteFrame> Frames; 36 core::array<SGUISpriteFrame> Frames;
37 u32 frameTime; 37 u32 frameTime;
38}; 38};
39 39
40 40
41//! Sprite bank interface. 41//! Sprite bank interface.
42/** See http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=25742&highlight=spritebank 42/** See http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=25742&highlight=spritebank
43* for more information how to use the spritebank. 43* for more information how to use the spritebank.
44*/ 44*/
45class IGUISpriteBank : public virtual IReferenceCounted 45class IGUISpriteBank : public virtual IReferenceCounted
46{ 46{
47public: 47public:
48 48
49 //! Returns the list of rectangles held by the sprite bank 49 //! Returns the list of rectangles held by the sprite bank
50 virtual core::array< core::rect<s32> >& getPositions() = 0; 50 virtual core::array< core::rect<s32> >& getPositions() = 0;
51 51
52 //! Returns the array of animated sprites within the sprite bank 52 //! Returns the array of animated sprites within the sprite bank
53 virtual core::array< SGUISprite >& getSprites() = 0; 53 virtual core::array< SGUISprite >& getSprites() = 0;
54 54
55 //! Returns the number of textures held by the sprite bank 55 //! Returns the number of textures held by the sprite bank
56 virtual u32 getTextureCount() const = 0; 56 virtual u32 getTextureCount() const = 0;
57 57
58 //! Gets the texture with the specified index 58 //! Gets the texture with the specified index
59 virtual video::ITexture* getTexture(u32 index) const = 0; 59 virtual video::ITexture* getTexture(u32 index) const = 0;
60 60
61 //! Adds a texture to the sprite bank 61 //! Adds a texture to the sprite bank
62 virtual void addTexture(video::ITexture* texture) = 0; 62 virtual void addTexture(video::ITexture* texture) = 0;
63 63
64 //! Changes one of the textures in the sprite bank 64 //! Changes one of the textures in the sprite bank
65 virtual void setTexture(u32 index, video::ITexture* texture) = 0; 65 virtual void setTexture(u32 index, video::ITexture* texture) = 0;
66 66
67 //! Add the texture and use it for a single non-animated sprite. 67 //! Add the texture and use it for a single non-animated sprite.
68 //! The texture and the corresponding rectangle and sprite will all be added to the end of each array. 68 //! The texture and the corresponding rectangle and sprite will all be added to the end of each array.
69 //! returns the index of the sprite or -1 on failure 69 //! returns the index of the sprite or -1 on failure
70 virtual s32 addTextureAsSprite(video::ITexture* texture) = 0; 70 virtual s32 addTextureAsSprite(video::ITexture* texture) = 0;
71 71
72 //! clears sprites, rectangles and textures 72 //! clears sprites, rectangles and textures
73 virtual void clear() = 0; 73 virtual void clear() = 0;
74 74
75 //! Draws a sprite in 2d with position and color 75 //! Draws a sprite in 2d with position and color
76 virtual void draw2DSprite(u32 index, const core::position2di& pos, 76 virtual void draw2DSprite(u32 index, const core::position2di& pos,
77 const core::rect<s32>* clip=0, 77 const core::rect<s32>* clip=0,
78 const video::SColor& color= video::SColor(255,255,255,255), 78 const video::SColor& color= video::SColor(255,255,255,255),
79 u32 starttime=0, u32 currenttime=0, 79 u32 starttime=0, u32 currenttime=0,
80 bool loop=true, bool center=false) = 0; 80 bool loop=true, bool center=false) = 0;
81 81
82 //! Draws a sprite batch in 2d using an array of positions and a color 82 //! Draws a sprite batch in 2d using an array of positions and a color
83 virtual void draw2DSpriteBatch(const core::array<u32>& indices, const core::array<core::position2di>& pos, 83 virtual void draw2DSpriteBatch(const core::array<u32>& indices, const core::array<core::position2di>& pos,
84 const core::rect<s32>* clip=0, 84 const core::rect<s32>* clip=0,
85 const video::SColor& color= video::SColor(255,255,255,255), 85 const video::SColor& color= video::SColor(255,255,255,255),
86 u32 starttime=0, u32 currenttime=0, 86 u32 starttime=0, u32 currenttime=0,
87 bool loop=true, bool center=false) = 0; 87 bool loop=true, bool center=false) = 0;
88}; 88};
89 89
90 90
91} // end namespace gui 91} // end namespace gui
92} // end namespace irr 92} // end namespace irr
93 93
94#endif // __I_GUI_SPRITE_BANK_H_INCLUDED__ 94#endif // __I_GUI_SPRITE_BANK_H_INCLUDED__
95 95
diff --git a/libraries/irrlicht-1.8/include/IGUIStaticText.h b/libraries/irrlicht-1.8/include/IGUIStaticText.h
index 30325bc..b0594ab 100644
--- a/libraries/irrlicht-1.8/include/IGUIStaticText.h
+++ b/libraries/irrlicht-1.8/include/IGUIStaticText.h
@@ -1,135 +1,135 @@
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#ifndef __I_GUI_STATIC_TEXT_H_INCLUDED__ 5#ifndef __I_GUI_STATIC_TEXT_H_INCLUDED__
6#define __I_GUI_STATIC_TEXT_H_INCLUDED__ 6#define __I_GUI_STATIC_TEXT_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9#include "SColor.h" 9#include "SColor.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace gui 13namespace gui
14{ 14{
15 class IGUIFont; 15 class IGUIFont;
16 16
17 //! Multi or single line text label. 17 //! Multi or single line text label.
18 class IGUIStaticText : public IGUIElement 18 class IGUIStaticText : public IGUIElement
19 { 19 {
20 public: 20 public:
21 21
22 //! constructor 22 //! constructor
23 IGUIStaticText(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 23 IGUIStaticText(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
24 : IGUIElement(EGUIET_STATIC_TEXT, environment, parent, id, rectangle) {} 24 : IGUIElement(EGUIET_STATIC_TEXT, environment, parent, id, rectangle) {}
25 25
26 //! Sets another skin independent font. 26 //! Sets another skin independent font.
27 /** If this is set to zero, the button uses the font of the skin. 27 /** If this is set to zero, the button uses the font of the skin.
28 \param font: New font to set. */ 28 \param font: New font to set. */
29 virtual void setOverrideFont(IGUIFont* font=0) = 0; 29 virtual void setOverrideFont(IGUIFont* font=0) = 0;
30 30
31 //! Gets the override font (if any) 31 //! Gets the override font (if any)
32 /** \return The override font (may be 0) */ 32 /** \return The override font (may be 0) */
33 virtual IGUIFont* getOverrideFont(void) const = 0; 33 virtual IGUIFont* getOverrideFont(void) const = 0;
34 34
35 //! Get the font which is used right now for drawing 35 //! Get the font which is used right now for drawing
36 /** Currently this is the override font when one is set and the 36 /** Currently this is the override font when one is set and the
37 font of the active skin otherwise */ 37 font of the active skin otherwise */
38 virtual IGUIFont* getActiveFont() const = 0; 38 virtual IGUIFont* getActiveFont() const = 0;
39 39
40 //! Sets another color for the text. 40 //! Sets another color for the text.
41 /** If set, the static text does not use the EGDC_BUTTON_TEXT color defined 41 /** If set, the static text does not use the EGDC_BUTTON_TEXT color defined
42 in the skin, but the set color instead. You don't need to call 42 in the skin, but the set color instead. You don't need to call
43 IGUIStaticText::enableOverrrideColor(true) after this, this is done 43 IGUIStaticText::enableOverrrideColor(true) after this, this is done
44 by this function. 44 by this function.
45 If you set a color, and you want the text displayed with the color 45 If you set a color, and you want the text displayed with the color
46 of the skin again, call IGUIStaticText::enableOverrideColor(false); 46 of the skin again, call IGUIStaticText::enableOverrideColor(false);
47 \param color: New color of the text. */ 47 \param color: New color of the text. */
48 virtual void setOverrideColor(video::SColor color) = 0; 48 virtual void setOverrideColor(video::SColor color) = 0;
49 49
50 //! Gets the override color 50 //! Gets the override color
51 /** \return: The override color */ 51 /** \return: The override color */
52 virtual video::SColor getOverrideColor(void) const = 0; 52 virtual video::SColor getOverrideColor(void) const = 0;
53 53
54 //! Sets if the static text should use the overide color or the color in the gui skin. 54 //! Sets if the static text should use the overide color or the color in the gui skin.
55 /** \param enable: If set to true, the override color, which can be set 55 /** \param enable: If set to true, the override color, which can be set
56 with IGUIStaticText::setOverrideColor is used, otherwise the 56 with IGUIStaticText::setOverrideColor is used, otherwise the
57 EGDC_BUTTON_TEXT color of the skin. */ 57 EGDC_BUTTON_TEXT color of the skin. */
58 virtual void enableOverrideColor(bool enable) = 0; 58 virtual void enableOverrideColor(bool enable) = 0;
59 59
60 //! Checks if an override color is enabled 60 //! Checks if an override color is enabled
61 /** \return true if the override color is enabled, false otherwise */ 61 /** \return true if the override color is enabled, false otherwise */
62 virtual bool isOverrideColorEnabled(void) const = 0; 62 virtual bool isOverrideColorEnabled(void) const = 0;
63 63
64 //! Sets another color for the background. 64 //! Sets another color for the background.
65 virtual void setBackgroundColor(video::SColor color) = 0; 65 virtual void setBackgroundColor(video::SColor color) = 0;
66 66
67 //! Sets whether to draw the background 67 //! Sets whether to draw the background
68 virtual void setDrawBackground(bool draw) = 0; 68 virtual void setDrawBackground(bool draw) = 0;
69 69
70 //! Gets the background color 70 //! Gets the background color
71 /** \return: The background color */ 71 /** \return: The background color */
72 virtual video::SColor getBackgroundColor() const = 0; 72 virtual video::SColor getBackgroundColor() const = 0;
73 73
74 //! Checks if background drawing is enabled 74 //! Checks if background drawing is enabled
75 /** \return true if background drawing is enabled, false otherwise */ 75 /** \return true if background drawing is enabled, false otherwise */
76 virtual bool isDrawBackgroundEnabled() const = 0; 76 virtual bool isDrawBackgroundEnabled() const = 0;
77 77
78 //! Sets whether to draw the border 78 //! Sets whether to draw the border
79 virtual void setDrawBorder(bool draw) = 0; 79 virtual void setDrawBorder(bool draw) = 0;
80 80
81 //! Checks if border drawing is enabled 81 //! Checks if border drawing is enabled
82 /** \return true if border drawing is enabled, false otherwise */ 82 /** \return true if border drawing is enabled, false otherwise */
83 virtual bool isDrawBorderEnabled() const = 0; 83 virtual bool isDrawBorderEnabled() const = 0;
84 84
85 //! Sets text justification mode 85 //! Sets text justification mode
86 /** \param horizontal: EGUIA_UPPERLEFT for left justified (default), 86 /** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
87 EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text. 87 EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
88 \param vertical: EGUIA_UPPERLEFT to align with top edge, 88 \param vertical: EGUIA_UPPERLEFT to align with top edge,
89 EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */ 89 EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
90 virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0; 90 virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
91 91
92 //! Enables or disables word wrap for using the static text as multiline text control. 92 //! Enables or disables word wrap for using the static text as multiline text control.
93 /** \param enable: If set to true, words going over one line are 93 /** \param enable: If set to true, words going over one line are
94 broken on to the next line. */ 94 broken on to the next line. */
95 virtual void setWordWrap(bool enable) = 0; 95 virtual void setWordWrap(bool enable) = 0;
96 96
97 //! Checks if word wrap is enabled 97 //! Checks if word wrap is enabled
98 /** \return true if word wrap is enabled, false otherwise */ 98 /** \return true if word wrap is enabled, false otherwise */
99 virtual bool isWordWrapEnabled(void) const = 0; 99 virtual bool isWordWrapEnabled(void) const = 0;
100 100
101 //! Returns the height of the text in pixels when it is drawn. 101 //! Returns the height of the text in pixels when it is drawn.
102 /** This is useful for adjusting the layout of gui elements based on the height 102 /** This is useful for adjusting the layout of gui elements based on the height
103 of the multiline text in this element. 103 of the multiline text in this element.
104 \return Height of text in pixels. */ 104 \return Height of text in pixels. */
105 virtual s32 getTextHeight() const = 0; 105 virtual s32 getTextHeight() const = 0;
106 106
107 //! Returns the width of the current text, in the current font 107 //! Returns the width of the current text, in the current font
108 /** If the text is broken, this returns the width of the widest line 108 /** If the text is broken, this returns the width of the widest line
109 \return The width of the text, or the widest broken line. */ 109 \return The width of the text, or the widest broken line. */
110 virtual s32 getTextWidth(void) const = 0; 110 virtual s32 getTextWidth(void) const = 0;
111 111
112 //! Set whether the text in this label should be clipped if it goes outside bounds 112 //! Set whether the text in this label should be clipped if it goes outside bounds
113 virtual void setTextRestrainedInside(bool restrainedInside) = 0; 113 virtual void setTextRestrainedInside(bool restrainedInside) = 0;
114 114
115 //! Checks if the text in this label should be clipped if it goes outside bounds 115 //! Checks if the text in this label should be clipped if it goes outside bounds
116 virtual bool isTextRestrainedInside() const = 0; 116 virtual bool isTextRestrainedInside() const = 0;
117 117
118 //! Set whether the string should be interpreted as right-to-left (RTL) text 118 //! Set whether the string should be interpreted as right-to-left (RTL) text
119 /** \note This component does not implement the Unicode bidi standard, the 119 /** \note This component does not implement the Unicode bidi standard, the
120 text of the component should be already RTL if you call this. The 120 text of the component should be already RTL if you call this. The
121 main difference when RTL is enabled is that the linebreaks for multiline 121 main difference when RTL is enabled is that the linebreaks for multiline
122 elements are performed starting from the end. 122 elements are performed starting from the end.
123 */ 123 */
124 virtual void setRightToLeft(bool rtl) = 0; 124 virtual void setRightToLeft(bool rtl) = 0;
125 125
126 //! Checks whether the text in this element should be interpreted as right-to-left 126 //! Checks whether the text in this element should be interpreted as right-to-left
127 virtual bool isRightToLeft() const = 0; 127 virtual bool isRightToLeft() const = 0;
128 }; 128 };
129 129
130 130
131} // end namespace gui 131} // end namespace gui
132} // end namespace irr 132} // end namespace irr
133 133
134#endif 134#endif
135 135
diff --git a/libraries/irrlicht-1.8/include/IGUITabControl.h b/libraries/irrlicht-1.8/include/IGUITabControl.h
index 660c4d0..d9b4d12 100644
--- a/libraries/irrlicht-1.8/include/IGUITabControl.h
+++ b/libraries/irrlicht-1.8/include/IGUITabControl.h
@@ -1,136 +1,136 @@
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#ifndef __I_GUI_TAB_CONTROL_H_INCLUDED__ 5#ifndef __I_GUI_TAB_CONTROL_H_INCLUDED__
6#define __I_GUI_TAB_CONTROL_H_INCLUDED__ 6#define __I_GUI_TAB_CONTROL_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9#include "SColor.h" 9#include "SColor.h"
10#include "IGUISkin.h" 10#include "IGUISkin.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace gui 14namespace gui
15{ 15{
16 //! A tab-page, onto which other gui elements could be added. 16 //! A tab-page, onto which other gui elements could be added.
17 /** IGUITab refers to the page itself, not to the tab in the tabbar of an IGUITabControl. */ 17 /** IGUITab refers to the page itself, not to the tab in the tabbar of an IGUITabControl. */
18 class IGUITab : public IGUIElement 18 class IGUITab : public IGUIElement
19 { 19 {
20 public: 20 public:
21 21
22 //! constructor 22 //! constructor
23 IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 23 IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
24 : IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {} 24 : IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {}
25 25
26 //! Returns zero based index of tab if in tabcontrol. 26 //! Returns zero based index of tab if in tabcontrol.
27 /** Can be accessed later IGUITabControl::getTab() by this number. 27 /** Can be accessed later IGUITabControl::getTab() by this number.
28 Note that this number can change when other tabs are inserted or removed . 28 Note that this number can change when other tabs are inserted or removed .
29 */ 29 */
30 virtual s32 getNumber() const = 0; 30 virtual s32 getNumber() const = 0;
31 31
32 //! sets if the tab should draw its background 32 //! sets if the tab should draw its background
33 virtual void setDrawBackground(bool draw=true) = 0; 33 virtual void setDrawBackground(bool draw=true) = 0;
34 34
35 //! sets the color of the background, if it should be drawn. 35 //! sets the color of the background, if it should be drawn.
36 virtual void setBackgroundColor(video::SColor c) = 0; 36 virtual void setBackgroundColor(video::SColor c) = 0;
37 37
38 //! returns true if the tab is drawing its background, false if not 38 //! returns true if the tab is drawing its background, false if not
39 virtual bool isDrawingBackground() const = 0; 39 virtual bool isDrawingBackground() const = 0;
40 40
41 //! returns the color of the background 41 //! returns the color of the background
42 virtual video::SColor getBackgroundColor() const = 0; 42 virtual video::SColor getBackgroundColor() const = 0;
43 43
44 //! sets the color of the text 44 //! sets the color of the text
45 virtual void setTextColor(video::SColor c) = 0; 45 virtual void setTextColor(video::SColor c) = 0;
46 46
47 //! gets the color of the text 47 //! gets the color of the text
48 virtual video::SColor getTextColor() const = 0; 48 virtual video::SColor getTextColor() const = 0;
49 }; 49 };
50 50
51 //! A standard tab control 51 //! A standard tab control
52 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 52 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
53 \li EGET_TAB_CHANGED 53 \li EGET_TAB_CHANGED
54 */ 54 */
55 class IGUITabControl : public IGUIElement 55 class IGUITabControl : public IGUIElement
56 { 56 {
57 public: 57 public:
58 58
59 //! constructor 59 //! constructor
60 IGUITabControl(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 60 IGUITabControl(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
61 : IGUIElement(EGUIET_TAB_CONTROL, environment, parent, id, rectangle) {} 61 : IGUIElement(EGUIET_TAB_CONTROL, environment, parent, id, rectangle) {}
62 62
63 //! Adds a tab 63 //! Adds a tab
64 virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1) = 0; 64 virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1) = 0;
65 65
66 //! Insert the tab at the given index 66 //! Insert the tab at the given index
67 /** \return The tab on success or NULL on failure. */ 67 /** \return The tab on success or NULL on failure. */
68 virtual IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1) = 0; 68 virtual IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1) = 0;
69 69
70 //! Removes a tab from the tabcontrol 70 //! Removes a tab from the tabcontrol
71 virtual void removeTab(s32 idx) = 0; 71 virtual void removeTab(s32 idx) = 0;
72 72
73 //! Clears the tabcontrol removing all tabs 73 //! Clears the tabcontrol removing all tabs
74 virtual void clear() = 0; 74 virtual void clear() = 0;
75 75
76 //! Returns amount of tabs in the tabcontrol 76 //! Returns amount of tabs in the tabcontrol
77 virtual s32 getTabCount() const = 0; 77 virtual s32 getTabCount() const = 0;
78 78
79 //! Returns a tab based on zero based index 79 //! Returns a tab based on zero based index
80 /** \param idx: zero based index of tab. Is a value betwenn 0 and getTabcount()-1; 80 /** \param idx: zero based index of tab. Is a value betwenn 0 and getTabcount()-1;
81 \return Returns pointer to the Tab. Returns 0 if no tab 81 \return Returns pointer to the Tab. Returns 0 if no tab
82 is corresponding to this tab. */ 82 is corresponding to this tab. */
83 virtual IGUITab* getTab(s32 idx) const = 0; 83 virtual IGUITab* getTab(s32 idx) const = 0;
84 84
85 //! Brings a tab to front. 85 //! Brings a tab to front.
86 /** \param idx: number of the tab. 86 /** \param idx: number of the tab.
87 \return Returns true if successful. */ 87 \return Returns true if successful. */
88 virtual bool setActiveTab(s32 idx) = 0; 88 virtual bool setActiveTab(s32 idx) = 0;
89 89
90 //! Brings a tab to front. 90 //! Brings a tab to front.
91 /** \param tab: pointer to the tab. 91 /** \param tab: pointer to the tab.
92 \return Returns true if successful. */ 92 \return Returns true if successful. */
93 virtual bool setActiveTab(IGUITab *tab) = 0; 93 virtual bool setActiveTab(IGUITab *tab) = 0;
94 94
95 //! Returns which tab is currently active 95 //! Returns which tab is currently active
96 virtual s32 getActiveTab() const = 0; 96 virtual s32 getActiveTab() const = 0;
97 97
98 //! get the the id of the tab at the given absolute coordinates 98 //! get the the id of the tab at the given absolute coordinates
99 /** \return The id of the tab or -1 when no tab is at those coordinates*/ 99 /** \return The id of the tab or -1 when no tab is at those coordinates*/
100 virtual s32 getTabAt(s32 xpos, s32 ypos) const = 0; 100 virtual s32 getTabAt(s32 xpos, s32 ypos) const = 0;
101 101
102 //! Set the height of the tabs 102 //! Set the height of the tabs
103 virtual void setTabHeight( s32 height ) = 0; 103 virtual void setTabHeight( s32 height ) = 0;
104 104
105 //! Get the height of the tabs 105 //! Get the height of the tabs
106 /** return Returns the height of the tabs */ 106 /** return Returns the height of the tabs */
107 virtual s32 getTabHeight() const = 0; 107 virtual s32 getTabHeight() const = 0;
108 108
109 //! set the maximal width of a tab. Per default width is 0 which means "no width restriction". 109 //! set the maximal width of a tab. Per default width is 0 which means "no width restriction".
110 virtual void setTabMaxWidth(s32 width ) = 0; 110 virtual void setTabMaxWidth(s32 width ) = 0;
111 111
112 //! get the maximal width of a tab 112 //! get the maximal width of a tab
113 virtual s32 getTabMaxWidth() const = 0; 113 virtual s32 getTabMaxWidth() const = 0;
114 114
115 //! Set the alignment of the tabs 115 //! Set the alignment of the tabs
116 /** Use EGUIA_UPPERLEFT or EGUIA_LOWERRIGHT */ 116 /** Use EGUIA_UPPERLEFT or EGUIA_LOWERRIGHT */
117 virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) = 0; 117 virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) = 0;
118 118
119 //! Get the alignment of the tabs 119 //! Get the alignment of the tabs
120 /** return Returns the alignment of the tabs */ 120 /** return Returns the alignment of the tabs */
121 virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const = 0; 121 virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const = 0;
122 122
123 //! Set the extra width added to tabs on each side of the text 123 //! Set the extra width added to tabs on each side of the text
124 virtual void setTabExtraWidth( s32 extraWidth ) = 0; 124 virtual void setTabExtraWidth( s32 extraWidth ) = 0;
125 125
126 //! Get the extra width added to tabs on each side of the text 126 //! Get the extra width added to tabs on each side of the text
127 /** return Returns the extra width of the tabs */ 127 /** return Returns the extra width of the tabs */
128 virtual s32 getTabExtraWidth() const = 0; 128 virtual s32 getTabExtraWidth() const = 0;
129 }; 129 };
130 130
131 131
132} // end namespace gui 132} // end namespace gui
133} // end namespace irr 133} // end namespace irr
134 134
135#endif 135#endif
136 136
diff --git a/libraries/irrlicht-1.8/include/IGUITable.h b/libraries/irrlicht-1.8/include/IGUITable.h
index 4f271a9..219d28d 100644
--- a/libraries/irrlicht-1.8/include/IGUITable.h
+++ b/libraries/irrlicht-1.8/include/IGUITable.h
@@ -1,205 +1,205 @@
1// Copyright (C) 2003-2012 Nikolaus Gebhardt 1// Copyright (C) 2003-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#ifndef __I_GUI_TABLE_H_INCLUDED__ 5#ifndef __I_GUI_TABLE_H_INCLUDED__
6#define __I_GUI_TABLE_H_INCLUDED__ 6#define __I_GUI_TABLE_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9#include "irrTypes.h" 9#include "irrTypes.h"
10#include "SColor.h" 10#include "SColor.h"
11#include "IGUISkin.h" 11#include "IGUISkin.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace gui 15namespace gui
16{ 16{
17 17
18 //! modes for ordering used when a column header is clicked 18 //! modes for ordering used when a column header is clicked
19 enum EGUI_COLUMN_ORDERING 19 enum EGUI_COLUMN_ORDERING
20 { 20 {
21 //! Do not use ordering 21 //! Do not use ordering
22 EGCO_NONE, 22 EGCO_NONE,
23 23
24 //! Send a EGET_TABLE_HEADER_CHANGED message when a column header is clicked. 24 //! Send a EGET_TABLE_HEADER_CHANGED message when a column header is clicked.
25 EGCO_CUSTOM, 25 EGCO_CUSTOM,
26 26
27 //! Sort it ascending by it's ascii value like: a,b,c,... 27 //! Sort it ascending by it's ascii value like: a,b,c,...
28 EGCO_ASCENDING, 28 EGCO_ASCENDING,
29 29
30 //! Sort it descending by it's ascii value like: z,x,y,... 30 //! Sort it descending by it's ascii value like: z,x,y,...
31 EGCO_DESCENDING, 31 EGCO_DESCENDING,
32 32
33 //! Sort it ascending on first click, descending on next, etc 33 //! Sort it ascending on first click, descending on next, etc
34 EGCO_FLIP_ASCENDING_DESCENDING, 34 EGCO_FLIP_ASCENDING_DESCENDING,
35 35
36 //! Not used as mode, only to get maximum value for this enum 36 //! Not used as mode, only to get maximum value for this enum
37 EGCO_COUNT 37 EGCO_COUNT
38 }; 38 };
39 39
40 //! Names for EGUI_COLUMN_ORDERING types 40 //! Names for EGUI_COLUMN_ORDERING types
41 const c8* const GUIColumnOrderingNames[] = 41 const c8* const GUIColumnOrderingNames[] =
42 { 42 {
43 "none", 43 "none",
44 "custom", 44 "custom",
45 "ascend", 45 "ascend",
46 "descend", 46 "descend",
47 "ascend_descend", 47 "ascend_descend",
48 0, 48 0,
49 }; 49 };
50 50
51 enum EGUI_ORDERING_MODE 51 enum EGUI_ORDERING_MODE
52 { 52 {
53 //! No element ordering 53 //! No element ordering
54 EGOM_NONE, 54 EGOM_NONE,
55 55
56 //! Elements are ordered from the smallest to the largest. 56 //! Elements are ordered from the smallest to the largest.
57 EGOM_ASCENDING, 57 EGOM_ASCENDING,
58 58
59 //! Elements are ordered from the largest to the smallest. 59 //! Elements are ordered from the largest to the smallest.
60 EGOM_DESCENDING, 60 EGOM_DESCENDING,
61 61
62 //! this value is not used, it only specifies the amount of default ordering types 62 //! this value is not used, it only specifies the amount of default ordering types
63 //! available. 63 //! available.
64 EGOM_COUNT 64 EGOM_COUNT
65 }; 65 };
66 66
67 const c8* const GUIOrderingModeNames[] = 67 const c8* const GUIOrderingModeNames[] =
68 { 68 {
69 "none", 69 "none",
70 "ascending", 70 "ascending",
71 "descending", 71 "descending",
72 0 72 0
73 }; 73 };
74 74
75 enum EGUI_TABLE_DRAW_FLAGS 75 enum EGUI_TABLE_DRAW_FLAGS
76 { 76 {
77 EGTDF_ROWS = 1, 77 EGTDF_ROWS = 1,
78 EGTDF_COLUMNS = 2, 78 EGTDF_COLUMNS = 2,
79 EGTDF_ACTIVE_ROW = 4, 79 EGTDF_ACTIVE_ROW = 4,
80 EGTDF_COUNT 80 EGTDF_COUNT
81 }; 81 };
82 82
83 //! Default list box GUI element. 83 //! Default list box GUI element.
84 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 84 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
85 \li EGET_TABLE_CHANGED 85 \li EGET_TABLE_CHANGED
86 \li EGET_TABLE_SELECTED_AGAIN 86 \li EGET_TABLE_SELECTED_AGAIN
87 \li EGET_TABLE_HEADER_CHANGED 87 \li EGET_TABLE_HEADER_CHANGED
88 */ 88 */
89 class IGUITable : public IGUIElement 89 class IGUITable : public IGUIElement
90 { 90 {
91 public: 91 public:
92 //! constructor 92 //! constructor
93 IGUITable(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 93 IGUITable(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
94 : IGUIElement(EGUIET_TABLE, environment, parent, id, rectangle) {} 94 : IGUIElement(EGUIET_TABLE, environment, parent, id, rectangle) {}
95 95
96 //! Adds a column 96 //! Adds a column
97 /** If columnIndex is outside the current range, do push new colum at the end */ 97 /** If columnIndex is outside the current range, do push new colum at the end */
98 virtual void addColumn(const wchar_t* caption, s32 columnIndex=-1) = 0; 98 virtual void addColumn(const wchar_t* caption, s32 columnIndex=-1) = 0;
99 99
100 //! remove a column from the table 100 //! remove a column from the table
101 virtual void removeColumn(u32 columnIndex) = 0; 101 virtual void removeColumn(u32 columnIndex) = 0;
102 102
103 //! Returns the number of columns in the table control 103 //! Returns the number of columns in the table control
104 virtual s32 getColumnCount() const = 0; 104 virtual s32 getColumnCount() const = 0;
105 105
106 //! Makes a column active. This will trigger an ordering process. 106 //! Makes a column active. This will trigger an ordering process.
107 /** \param idx: The id of the column to make active. 107 /** \param idx: The id of the column to make active.
108 \param doOrder: Do also the ordering which depending on mode for active column 108 \param doOrder: Do also the ordering which depending on mode for active column
109 \return True if successful. */ 109 \return True if successful. */
110 virtual bool setActiveColumn(s32 idx, bool doOrder=false) = 0; 110 virtual bool setActiveColumn(s32 idx, bool doOrder=false) = 0;
111 111
112 //! Returns which header is currently active 112 //! Returns which header is currently active
113 virtual s32 getActiveColumn() const = 0; 113 virtual s32 getActiveColumn() const = 0;
114 114
115 //! Returns the ordering used by the currently active column 115 //! Returns the ordering used by the currently active column
116 virtual EGUI_ORDERING_MODE getActiveColumnOrdering() const = 0; 116 virtual EGUI_ORDERING_MODE getActiveColumnOrdering() const = 0;
117 117
118 //! Set the width of a column 118 //! Set the width of a column
119 virtual void setColumnWidth(u32 columnIndex, u32 width) = 0; 119 virtual void setColumnWidth(u32 columnIndex, u32 width) = 0;
120 120
121 //! Get the width of a column 121 //! Get the width of a column
122 virtual u32 getColumnWidth(u32 columnIndex) const = 0; 122 virtual u32 getColumnWidth(u32 columnIndex) const = 0;
123 123
124 //! columns can be resized by drag 'n drop 124 //! columns can be resized by drag 'n drop
125 virtual void setResizableColumns(bool resizable) = 0; 125 virtual void setResizableColumns(bool resizable) = 0;
126 126
127 //! can columns be resized by dran 'n drop? 127 //! can columns be resized by dran 'n drop?
128 virtual bool hasResizableColumns() const = 0; 128 virtual bool hasResizableColumns() const = 0;
129 129
130 //! This tells the table control which ordering mode should be used when a column header is clicked. 130 //! This tells the table control which ordering mode should be used when a column header is clicked.
131 /** \param columnIndex The index of the column header. 131 /** \param columnIndex The index of the column header.
132 \param mode: One of the modes defined in EGUI_COLUMN_ORDERING */ 132 \param mode: One of the modes defined in EGUI_COLUMN_ORDERING */
133 virtual void setColumnOrdering(u32 columnIndex, EGUI_COLUMN_ORDERING mode) = 0; 133 virtual void setColumnOrdering(u32 columnIndex, EGUI_COLUMN_ORDERING mode) = 0;
134 134
135 //! Returns which row is currently selected 135 //! Returns which row is currently selected
136 virtual s32 getSelected() const = 0; 136 virtual s32 getSelected() const = 0;
137 137
138 //! set wich row is currently selected 138 //! set wich row is currently selected
139 virtual void setSelected( s32 index ) = 0; 139 virtual void setSelected( s32 index ) = 0;
140 140
141 //! Get amount of rows in the tabcontrol 141 //! Get amount of rows in the tabcontrol
142 virtual s32 getRowCount() const = 0; 142 virtual s32 getRowCount() const = 0;
143 143
144 //! adds a row to the table 144 //! adds a row to the table
145 /** \param rowIndex Zero based index of rows. The row will be 145 /** \param rowIndex Zero based index of rows. The row will be
146 inserted at this position, if a row already exist there, it 146 inserted at this position, if a row already exist there, it
147 will be placed after it. If the row is larger than the actual 147 will be placed after it. If the row is larger than the actual
148 number of row by more than one, it won't be created. Note that 148 number of row by more than one, it won't be created. Note that
149 if you create a row that's not at the end, there might be 149 if you create a row that's not at the end, there might be
150 performance issues. 150 performance issues.
151 \return index of inserted row. */ 151 \return index of inserted row. */
152 virtual u32 addRow(u32 rowIndex) = 0; 152 virtual u32 addRow(u32 rowIndex) = 0;
153 153
154 //! Remove a row from the table 154 //! Remove a row from the table
155 virtual void removeRow(u32 rowIndex) = 0; 155 virtual void removeRow(u32 rowIndex) = 0;
156 156
157 //! clears the table rows, but keeps the columns intact 157 //! clears the table rows, but keeps the columns intact
158 virtual void clearRows() = 0; 158 virtual void clearRows() = 0;
159 159
160 //! Swap two row positions. 160 //! Swap two row positions.
161 virtual void swapRows(u32 rowIndexA, u32 rowIndexB) = 0; 161 virtual void swapRows(u32 rowIndexA, u32 rowIndexB) = 0;
162 162
163 //! This tells the table to start ordering all the rows. 163 //! This tells the table to start ordering all the rows.
164 /** You need to explicitly tell the table to re order the rows 164 /** You need to explicitly tell the table to re order the rows
165 when a new row is added or the cells data is changed. This 165 when a new row is added or the cells data is changed. This
166 makes the system more flexible and doesn't make you pay the 166 makes the system more flexible and doesn't make you pay the
167 cost of ordering when adding a lot of rows. 167 cost of ordering when adding a lot of rows.
168 \param columnIndex: When set to -1 the active column is used. 168 \param columnIndex: When set to -1 the active column is used.
169 \param mode Ordering mode of the rows. */ 169 \param mode Ordering mode of the rows. */
170 virtual void orderRows(s32 columnIndex=-1, EGUI_ORDERING_MODE mode=EGOM_NONE) = 0; 170 virtual void orderRows(s32 columnIndex=-1, EGUI_ORDERING_MODE mode=EGOM_NONE) = 0;
171 171
172 //! Set the text of a cell 172 //! Set the text of a cell
173 virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& text) = 0; 173 virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& text) = 0;
174 174
175 //! Set the text of a cell, and set a color of this cell. 175 //! Set the text of a cell, and set a color of this cell.
176 virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& text, video::SColor color) = 0; 176 virtual void setCellText(u32 rowIndex, u32 columnIndex, const core::stringw& text, video::SColor color) = 0;
177 177
178 //! Set the data of a cell 178 //! Set the data of a cell
179 virtual void setCellData(u32 rowIndex, u32 columnIndex, void *data) = 0; 179 virtual void setCellData(u32 rowIndex, u32 columnIndex, void *data) = 0;
180 180
181 //! Set the color of a cell text 181 //! Set the color of a cell text
182 virtual void setCellColor(u32 rowIndex, u32 columnIndex, video::SColor color) = 0; 182 virtual void setCellColor(u32 rowIndex, u32 columnIndex, video::SColor color) = 0;
183 183
184 //! Get the text of a cell 184 //! Get the text of a cell
185 virtual const wchar_t* getCellText(u32 rowIndex, u32 columnIndex ) const = 0; 185 virtual const wchar_t* getCellText(u32 rowIndex, u32 columnIndex ) const = 0;
186 186
187 //! Get the data of a cell 187 //! Get the data of a cell
188 virtual void* getCellData(u32 rowIndex, u32 columnIndex ) const = 0; 188 virtual void* getCellData(u32 rowIndex, u32 columnIndex ) const = 0;
189 189
190 //! clears the table, deletes all items in the table 190 //! clears the table, deletes all items in the table
191 virtual void clear() = 0; 191 virtual void clear() = 0;
192 192
193 //! Set flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout 193 //! Set flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout
194 virtual void setDrawFlags(s32 flags) = 0; 194 virtual void setDrawFlags(s32 flags) = 0;
195 195
196 //! Get the flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout 196 //! Get the flags, as defined in EGUI_TABLE_DRAW_FLAGS, which influence the layout
197 virtual s32 getDrawFlags() const = 0; 197 virtual s32 getDrawFlags() const = 0;
198 }; 198 };
199 199
200 200
201} // end namespace gui 201} // end namespace gui
202} // end namespace irr 202} // end namespace irr
203 203
204#endif 204#endif
205 205
diff --git a/libraries/irrlicht-1.8/include/IGUIToolbar.h b/libraries/irrlicht-1.8/include/IGUIToolbar.h
index 58796bf..08519fc 100644
--- a/libraries/irrlicht-1.8/include/IGUIToolbar.h
+++ b/libraries/irrlicht-1.8/include/IGUIToolbar.h
@@ -1,40 +1,40 @@
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#ifndef __I_GUI_TOOL_BAR_H_INCLUDED__ 5#ifndef __I_GUI_TOOL_BAR_H_INCLUDED__
6#define __I_GUI_TOOL_BAR_H_INCLUDED__ 6#define __I_GUI_TOOL_BAR_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace video 12namespace video
13{ 13{
14 class ITexture; 14 class ITexture;
15} // end namespace video 15} // end namespace video
16namespace gui 16namespace gui
17{ 17{
18 class IGUIButton; 18 class IGUIButton;
19 19
20 //! Stays at the top of its parent like the menu bar and contains tool buttons 20 //! Stays at the top of its parent like the menu bar and contains tool buttons
21 class IGUIToolBar : public IGUIElement 21 class IGUIToolBar : public IGUIElement
22 { 22 {
23 public: 23 public:
24 24
25 //! constructor 25 //! constructor
26 IGUIToolBar(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 26 IGUIToolBar(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
27 : IGUIElement(EGUIET_TOOL_BAR, environment, parent, id, rectangle) {} 27 : IGUIElement(EGUIET_TOOL_BAR, environment, parent, id, rectangle) {}
28 28
29 //! Adds a button to the tool bar 29 //! Adds a button to the tool bar
30 virtual IGUIButton* addButton(s32 id=-1, const wchar_t* text=0,const wchar_t* tooltiptext=0, 30 virtual IGUIButton* addButton(s32 id=-1, const wchar_t* text=0,const wchar_t* tooltiptext=0,
31 video::ITexture* img=0, video::ITexture* pressedimg=0, 31 video::ITexture* img=0, video::ITexture* pressedimg=0,
32 bool isPushButton=false, bool useAlphaChannel=false) = 0; 32 bool isPushButton=false, bool useAlphaChannel=false) = 0;
33 }; 33 };
34 34
35 35
36} // end namespace gui 36} // end namespace gui
37} // end namespace irr 37} // end namespace irr
38 38
39#endif 39#endif
40 40
diff --git a/libraries/irrlicht-1.8/include/IGUITreeView.h b/libraries/irrlicht-1.8/include/IGUITreeView.h
index 4552b29..5f21022 100644
--- a/libraries/irrlicht-1.8/include/IGUITreeView.h
+++ b/libraries/irrlicht-1.8/include/IGUITreeView.h
@@ -1,278 +1,278 @@
1// written by Reinhard Ostermeier, reinhard@nospam.r-ostermeier.de 1// written by Reinhard Ostermeier, reinhard@nospam.r-ostermeier.de
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#ifndef __I_GUI_TREE_VIEW_H_INCLUDED__ 5#ifndef __I_GUI_TREE_VIEW_H_INCLUDED__
6#define __I_GUI_TREE_VIEW_H_INCLUDED__ 6#define __I_GUI_TREE_VIEW_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9#include "IGUIImageList.h" 9#include "IGUIImageList.h"
10#include "irrTypes.h" 10#include "irrTypes.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace gui 14namespace gui
15{ 15{
16 class IGUIFont; 16 class IGUIFont;
17 class IGUITreeView; 17 class IGUITreeView;
18 18
19 19
20 //! Node for gui tree view 20 //! Node for gui tree view
21 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 21 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
22 \li EGET_TREEVIEW_NODE_EXPAND 22 \li EGET_TREEVIEW_NODE_EXPAND
23 \li EGET_TREEVIEW_NODE_COLLAPS 23 \li EGET_TREEVIEW_NODE_COLLAPS
24 \li EGET_TREEVIEW_NODE_DESELECT 24 \li EGET_TREEVIEW_NODE_DESELECT
25 \li EGET_TREEVIEW_NODE_SELECT 25 \li EGET_TREEVIEW_NODE_SELECT
26 */ 26 */
27 class IGUITreeViewNode : public IReferenceCounted 27 class IGUITreeViewNode : public IReferenceCounted
28 { 28 {
29 public: 29 public:
30 //! returns the owner (tree view) of this node 30 //! returns the owner (tree view) of this node
31 virtual IGUITreeView* getOwner() const = 0; 31 virtual IGUITreeView* getOwner() const = 0;
32 32
33 //! Returns the parent node of this node. 33 //! Returns the parent node of this node.
34 /** For the root node this will return 0. */ 34 /** For the root node this will return 0. */
35 virtual IGUITreeViewNode* getParent() const = 0; 35 virtual IGUITreeViewNode* getParent() const = 0;
36 36
37 //! returns the text of the node 37 //! returns the text of the node
38 virtual const wchar_t* getText() const = 0; 38 virtual const wchar_t* getText() const = 0;
39 39
40 //! sets the text of the node 40 //! sets the text of the node
41 virtual void setText( const wchar_t* text ) = 0; 41 virtual void setText( const wchar_t* text ) = 0;
42 42
43 //! returns the icon text of the node 43 //! returns the icon text of the node
44 virtual const wchar_t* getIcon() const = 0; 44 virtual const wchar_t* getIcon() const = 0;
45 45
46 //! sets the icon text of the node 46 //! sets the icon text of the node
47 virtual void setIcon( const wchar_t* icon ) = 0; 47 virtual void setIcon( const wchar_t* icon ) = 0;
48 48
49 //! returns the image index of the node 49 //! returns the image index of the node
50 virtual u32 getImageIndex() const = 0; 50 virtual u32 getImageIndex() const = 0;
51 51
52 //! sets the image index of the node 52 //! sets the image index of the node
53 virtual void setImageIndex( u32 imageIndex ) = 0; 53 virtual void setImageIndex( u32 imageIndex ) = 0;
54 54
55 //! returns the image index of the node 55 //! returns the image index of the node
56 virtual u32 getSelectedImageIndex() const = 0; 56 virtual u32 getSelectedImageIndex() const = 0;
57 57
58 //! sets the image index of the node 58 //! sets the image index of the node
59 virtual void setSelectedImageIndex( u32 imageIndex ) = 0; 59 virtual void setSelectedImageIndex( u32 imageIndex ) = 0;
60 60
61 //! returns the user data (void*) of this node 61 //! returns the user data (void*) of this node
62 virtual void* getData() const = 0; 62 virtual void* getData() const = 0;
63 63
64 //! sets the user data (void*) of this node 64 //! sets the user data (void*) of this node
65 virtual void setData( void* data ) = 0; 65 virtual void setData( void* data ) = 0;
66 66
67 //! returns the user data2 (IReferenceCounted) of this node 67 //! returns the user data2 (IReferenceCounted) of this node
68 virtual IReferenceCounted* getData2() const = 0; 68 virtual IReferenceCounted* getData2() const = 0;
69 69
70 //! sets the user data2 (IReferenceCounted) of this node 70 //! sets the user data2 (IReferenceCounted) of this node
71 virtual void setData2( IReferenceCounted* data ) = 0; 71 virtual void setData2( IReferenceCounted* data ) = 0;
72 72
73 //! returns the child item count 73 //! returns the child item count
74 virtual u32 getChildCount() const = 0; 74 virtual u32 getChildCount() const = 0;
75 75
76 //! removes all children (recursive) from this node 76 //! removes all children (recursive) from this node
77 virtual void clearChildren() = 0; 77 virtual void clearChildren() = 0;
78 78
79 //! removes all children (recursive) from this node 79 //! removes all children (recursive) from this node
80 /** \deprecated Deprecated in 1.8, use clearChildren() instead. 80 /** \deprecated Deprecated in 1.8, use clearChildren() instead.
81 This method may be removed by Irrlicht 1.9 */ 81 This method may be removed by Irrlicht 1.9 */
82 _IRR_DEPRECATED_ void clearChilds() 82 _IRR_DEPRECATED_ void clearChilds()
83 { 83 {
84 return clearChildren(); 84 return clearChildren();
85 } 85 }
86 86
87 //! returns true if this node has child nodes 87 //! returns true if this node has child nodes
88 virtual bool hasChildren() const = 0; 88 virtual bool hasChildren() const = 0;
89 89
90 //! returns true if this node has child nodes 90 //! returns true if this node has child nodes
91 /** \deprecated Deprecated in 1.8, use hasChildren() instead. 91 /** \deprecated Deprecated in 1.8, use hasChildren() instead.
92 This method may be removed by Irrlicht 1.9 */ 92 This method may be removed by Irrlicht 1.9 */
93 _IRR_DEPRECATED_ bool hasChilds() const 93 _IRR_DEPRECATED_ bool hasChilds() const
94 { 94 {
95 return hasChildren(); 95 return hasChildren();
96 } 96 }
97 97
98 //! Adds a new node behind the last child node. 98 //! Adds a new node behind the last child node.
99 /** \param text text of the new node 99 /** \param text text of the new node
100 \param icon icon text of the new node 100 \param icon icon text of the new node
101 \param imageIndex index of the image for the new node (-1 = none) 101 \param imageIndex index of the image for the new node (-1 = none)
102 \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex) 102 \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
103 \param data user data (void*) of the new node 103 \param data user data (void*) of the new node
104 \param data2 user data2 (IReferenceCounted*) of the new node 104 \param data2 user data2 (IReferenceCounted*) of the new node
105 \return The new node 105 \return The new node
106 */ 106 */
107 virtual IGUITreeViewNode* addChildBack( 107 virtual IGUITreeViewNode* addChildBack(
108 const wchar_t* text, const wchar_t* icon = 0, 108 const wchar_t* text, const wchar_t* icon = 0,
109 s32 imageIndex=-1, s32 selectedImageIndex=-1, 109 s32 imageIndex=-1, s32 selectedImageIndex=-1,
110 void* data=0, IReferenceCounted* data2=0) =0; 110 void* data=0, IReferenceCounted* data2=0) =0;
111 111
112 //! Adds a new node before the first child node. 112 //! Adds a new node before the first child node.
113 /** \param text text of the new node 113 /** \param text text of the new node
114 \param icon icon text of the new node 114 \param icon icon text of the new node
115 \param imageIndex index of the image for the new node (-1 = none) 115 \param imageIndex index of the image for the new node (-1 = none)
116 \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex) 116 \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
117 \param data user data (void*) of the new node 117 \param data user data (void*) of the new node
118 \param data2 user data2 (IReferenceCounted*) of the new node 118 \param data2 user data2 (IReferenceCounted*) of the new node
119 \return The new node 119 \return The new node
120 */ 120 */
121 virtual IGUITreeViewNode* addChildFront( 121 virtual IGUITreeViewNode* addChildFront(
122 const wchar_t* text, const wchar_t* icon = 0, 122 const wchar_t* text, const wchar_t* icon = 0,
123 s32 imageIndex=-1, s32 selectedImageIndex=-1, 123 s32 imageIndex=-1, s32 selectedImageIndex=-1,
124 void* data=0, IReferenceCounted* data2=0 ) =0; 124 void* data=0, IReferenceCounted* data2=0 ) =0;
125 125
126 //! Adds a new node behind the other node. 126 //! Adds a new node behind the other node.
127 /** The other node has also te be a child node from this node. 127 /** The other node has also te be a child node from this node.
128 \param other Node to insert after 128 \param other Node to insert after
129 \param text text of the new node 129 \param text text of the new node
130 \param icon icon text of the new node 130 \param icon icon text of the new node
131 \param imageIndex index of the image for the new node (-1 = none) 131 \param imageIndex index of the image for the new node (-1 = none)
132 \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex) 132 \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
133 \param data user data (void*) of the new node 133 \param data user data (void*) of the new node
134 \param data2 user data2 (IReferenceCounted*) of the new node 134 \param data2 user data2 (IReferenceCounted*) of the new node
135 \return The new node or 0 if other is no child node from this 135 \return The new node or 0 if other is no child node from this
136 */ 136 */
137 virtual IGUITreeViewNode* insertChildAfter( 137 virtual IGUITreeViewNode* insertChildAfter(
138 IGUITreeViewNode* other, 138 IGUITreeViewNode* other,
139 const wchar_t* text, const wchar_t* icon = 0, 139 const wchar_t* text, const wchar_t* icon = 0,
140 s32 imageIndex=-1, s32 selectedImageIndex=-1, 140 s32 imageIndex=-1, s32 selectedImageIndex=-1,
141 void* data=0, IReferenceCounted* data2=0) =0; 141 void* data=0, IReferenceCounted* data2=0) =0;
142 142
143 //! Adds a new node before the other node. 143 //! Adds a new node before the other node.
144 /** The other node has also te be a child node from this node. 144 /** The other node has also te be a child node from this node.
145 \param other Node to insert before 145 \param other Node to insert before
146 \param text text of the new node 146 \param text text of the new node
147 \param icon icon text of the new node 147 \param icon icon text of the new node
148 \param imageIndex index of the image for the new node (-1 = none) 148 \param imageIndex index of the image for the new node (-1 = none)
149 \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex) 149 \param selectedImageIndex index of the selected image for the new node (-1 = same as imageIndex)
150 \param data user data (void*) of the new node 150 \param data user data (void*) of the new node
151 \param data2 user data2 (IReferenceCounted*) of the new node 151 \param data2 user data2 (IReferenceCounted*) of the new node
152 \return The new node or 0 if other is no child node from this 152 \return The new node or 0 if other is no child node from this
153 */ 153 */
154 virtual IGUITreeViewNode* insertChildBefore( 154 virtual IGUITreeViewNode* insertChildBefore(
155 IGUITreeViewNode* other, 155 IGUITreeViewNode* other,
156 const wchar_t* text, const wchar_t* icon = 0, 156 const wchar_t* text, const wchar_t* icon = 0,
157 s32 imageIndex=-1, s32 selectedImageIndex=-1, 157 s32 imageIndex=-1, s32 selectedImageIndex=-1,
158 void* data=0, IReferenceCounted* data2=0) = 0; 158 void* data=0, IReferenceCounted* data2=0) = 0;
159 159
160 //! Return the first child node from this node. 160 //! Return the first child node from this node.
161 /** \return The first child node or 0 if this node has no children. */ 161 /** \return The first child node or 0 if this node has no children. */
162 virtual IGUITreeViewNode* getFirstChild() const = 0; 162 virtual IGUITreeViewNode* getFirstChild() const = 0;
163 163
164 //! Return the last child node from this node. 164 //! Return the last child node from this node.
165 /** \return The last child node or 0 if this node has no children. */ 165 /** \return The last child node or 0 if this node has no children. */
166 virtual IGUITreeViewNode* getLastChild() const = 0; 166 virtual IGUITreeViewNode* getLastChild() const = 0;
167 167
168 //! Returns the previous sibling node from this node. 168 //! Returns the previous sibling node from this node.
169 /** \return The previous sibling node from this node or 0 if this is 169 /** \return The previous sibling node from this node or 0 if this is
170 the first node from the parent node. 170 the first node from the parent node.
171 */ 171 */
172 virtual IGUITreeViewNode* getPrevSibling() const = 0; 172 virtual IGUITreeViewNode* getPrevSibling() const = 0;
173 173
174 //! Returns the next sibling node from this node. 174 //! Returns the next sibling node from this node.
175 /** \return The next sibling node from this node or 0 if this is 175 /** \return The next sibling node from this node or 0 if this is
176 the last node from the parent node. 176 the last node from the parent node.
177 */ 177 */
178 virtual IGUITreeViewNode* getNextSibling() const = 0; 178 virtual IGUITreeViewNode* getNextSibling() const = 0;
179 179
180 //! Returns the next visible (expanded, may be out of scrolling) node from this node. 180 //! Returns the next visible (expanded, may be out of scrolling) node from this node.
181 /** \return The next visible node from this node or 0 if this is 181 /** \return The next visible node from this node or 0 if this is
182 the last visible node. */ 182 the last visible node. */
183 virtual IGUITreeViewNode* getNextVisible() const = 0; 183 virtual IGUITreeViewNode* getNextVisible() const = 0;
184 184
185 //! Deletes a child node. 185 //! Deletes a child node.
186 /** \return Returns true if the node was found as a child and is deleted. */ 186 /** \return Returns true if the node was found as a child and is deleted. */
187 virtual bool deleteChild( IGUITreeViewNode* child ) = 0; 187 virtual bool deleteChild( IGUITreeViewNode* child ) = 0;
188 188
189 //! Moves a child node one position up. 189 //! Moves a child node one position up.
190 /** \return True if the node was found as achild node and was not already the first child. */ 190 /** \return True if the node was found as achild node and was not already the first child. */
191 virtual bool moveChildUp( IGUITreeViewNode* child ) = 0; 191 virtual bool moveChildUp( IGUITreeViewNode* child ) = 0;
192 192
193 //! Moves a child node one position down. 193 //! Moves a child node one position down.
194 /** \return True if the node was found as achild node and was not already the last child. */ 194 /** \return True if the node was found as achild node and was not already the last child. */
195 virtual bool moveChildDown( IGUITreeViewNode* child ) = 0; 195 virtual bool moveChildDown( IGUITreeViewNode* child ) = 0;
196 196
197 //! Returns true if the node is expanded (children are visible). 197 //! Returns true if the node is expanded (children are visible).
198 virtual bool getExpanded() const = 0; 198 virtual bool getExpanded() const = 0;
199 199
200 //! Sets if the node is expanded. 200 //! Sets if the node is expanded.
201 virtual void setExpanded( bool expanded ) = 0; 201 virtual void setExpanded( bool expanded ) = 0;
202 202
203 //! Returns true if the node is currently selected. 203 //! Returns true if the node is currently selected.
204 virtual bool getSelected() const = 0; 204 virtual bool getSelected() const = 0;
205 205
206 //! Sets this node as selected. 206 //! Sets this node as selected.
207 virtual void setSelected( bool selected ) = 0; 207 virtual void setSelected( bool selected ) = 0;
208 208
209 //! Returns true if this node is the root node. 209 //! Returns true if this node is the root node.
210 virtual bool isRoot() const = 0; 210 virtual bool isRoot() const = 0;
211 211
212 //! Returns the level of this node. 212 //! Returns the level of this node.
213 /** The root node has level 0. Direct children of the root has level 1 ... */ 213 /** The root node has level 0. Direct children of the root has level 1 ... */
214 virtual s32 getLevel() const = 0; 214 virtual s32 getLevel() const = 0;
215 215
216 //! Returns true if this node is visible (all parents are expanded). 216 //! Returns true if this node is visible (all parents are expanded).
217 virtual bool isVisible() const = 0; 217 virtual bool isVisible() const = 0;
218 }; 218 };
219 219
220 220
221 //! Default tree view GUI element. 221 //! Default tree view GUI element.
222 /** Displays a windows like tree buttons to expand/collaps the child 222 /** Displays a windows like tree buttons to expand/collaps the child
223 nodes of an node and optional tree lines. Each node consits of an 223 nodes of an node and optional tree lines. Each node consits of an
224 text, an icon text and a void pointer for user data. */ 224 text, an icon text and a void pointer for user data. */
225 class IGUITreeView : public IGUIElement 225 class IGUITreeView : public IGUIElement
226 { 226 {
227 public: 227 public:
228 //! constructor 228 //! constructor
229 IGUITreeView(IGUIEnvironment* environment, IGUIElement* parent, 229 IGUITreeView(IGUIEnvironment* environment, IGUIElement* parent,
230 s32 id, core::rect<s32> rectangle) 230 s32 id, core::rect<s32> rectangle)
231 : IGUIElement( EGUIET_TREE_VIEW, environment, parent, id, rectangle ) {} 231 : IGUIElement( EGUIET_TREE_VIEW, environment, parent, id, rectangle ) {}
232 232
233 //! returns the root node (not visible) from the tree. 233 //! returns the root node (not visible) from the tree.
234 virtual IGUITreeViewNode* getRoot() const = 0; 234 virtual IGUITreeViewNode* getRoot() const = 0;
235 235
236 //! returns the selected node of the tree or 0 if none is selected 236 //! returns the selected node of the tree or 0 if none is selected
237 virtual IGUITreeViewNode* getSelected() const = 0; 237 virtual IGUITreeViewNode* getSelected() const = 0;
238 238
239 //! returns true if the tree lines are visible 239 //! returns true if the tree lines are visible
240 virtual bool getLinesVisible() const = 0; 240 virtual bool getLinesVisible() const = 0;
241 241
242 //! sets if the tree lines are visible 242 //! sets if the tree lines are visible
243 /** \param visible true for visible, false for invisible */ 243 /** \param visible true for visible, false for invisible */
244 virtual void setLinesVisible( bool visible ) = 0; 244 virtual void setLinesVisible( bool visible ) = 0;
245 245
246 //! Sets the font which should be used as icon font. 246 //! Sets the font which should be used as icon font.
247 /** This font is set to the Irrlicht engine built-in-font by 247 /** This font is set to the Irrlicht engine built-in-font by
248 default. Icons can be displayed in front of every list item. 248 default. Icons can be displayed in front of every list item.
249 An icon is a string, displayed with the icon font. When using 249 An icon is a string, displayed with the icon font. When using
250 the build-in-font of the Irrlicht engine as icon font, the icon 250 the build-in-font of the Irrlicht engine as icon font, the icon
251 strings defined in GUIIcons.h can be used. 251 strings defined in GUIIcons.h can be used.
252 */ 252 */
253 virtual void setIconFont( IGUIFont* font ) = 0; 253 virtual void setIconFont( IGUIFont* font ) = 0;
254 254
255 //! Sets the image list which should be used for the image and selected image of every node. 255 //! Sets the image list which should be used for the image and selected image of every node.
256 /** The default is 0 (no images). */ 256 /** The default is 0 (no images). */
257 virtual void setImageList( IGUIImageList* imageList ) = 0; 257 virtual void setImageList( IGUIImageList* imageList ) = 0;
258 258
259 //! Returns the image list which is used for the nodes. 259 //! Returns the image list which is used for the nodes.
260 virtual IGUIImageList* getImageList() const = 0; 260 virtual IGUIImageList* getImageList() const = 0;
261 261
262 //! Sets if the image is left of the icon. Default is true. 262 //! Sets if the image is left of the icon. Default is true.
263 virtual void setImageLeftOfIcon( bool bLeftOf ) = 0; 263 virtual void setImageLeftOfIcon( bool bLeftOf ) = 0;
264 264
265 //! Returns if the Image is left of the icon. Default is true. 265 //! Returns if the Image is left of the icon. Default is true.
266 virtual bool getImageLeftOfIcon() const = 0; 266 virtual bool getImageLeftOfIcon() const = 0;
267 267
268 //! Returns the node which is associated to the last event. 268 //! Returns the node which is associated to the last event.
269 /** This pointer is only valid inside the OnEvent call! */ 269 /** This pointer is only valid inside the OnEvent call! */
270 virtual IGUITreeViewNode* getLastEventNode() const = 0; 270 virtual IGUITreeViewNode* getLastEventNode() const = 0;
271 }; 271 };
272 272
273 273
274} // end namespace gui 274} // end namespace gui
275} // end namespace irr 275} // end namespace irr
276 276
277#endif 277#endif
278 278
diff --git a/libraries/irrlicht-1.8/include/IGUIWindow.h b/libraries/irrlicht-1.8/include/IGUIWindow.h
index 6383bf0..23d45da 100644
--- a/libraries/irrlicht-1.8/include/IGUIWindow.h
+++ b/libraries/irrlicht-1.8/include/IGUIWindow.h
@@ -1,74 +1,74 @@
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#ifndef __I_GUI_WINDOW_H_INCLUDED__ 5#ifndef __I_GUI_WINDOW_H_INCLUDED__
6#define __I_GUI_WINDOW_H_INCLUDED__ 6#define __I_GUI_WINDOW_H_INCLUDED__
7 7
8#include "IGUIElement.h" 8#include "IGUIElement.h"
9#include "EMessageBoxFlags.h" 9#include "EMessageBoxFlags.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace gui 13namespace gui
14{ 14{
15 class IGUIButton; 15 class IGUIButton;
16 16
17 //! Default moveable window GUI element with border, caption and close icons. 17 //! Default moveable window GUI element with border, caption and close icons.
18 /** \par This element can create the following events of type EGUI_EVENT_TYPE: 18 /** \par This element can create the following events of type EGUI_EVENT_TYPE:
19 \li EGET_ELEMENT_CLOSED 19 \li EGET_ELEMENT_CLOSED
20 */ 20 */
21 class IGUIWindow : public IGUIElement 21 class IGUIWindow : public IGUIElement
22 { 22 {
23 public: 23 public:
24 24
25 //! constructor 25 //! constructor
26 IGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 26 IGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
27 : IGUIElement(EGUIET_WINDOW, environment, parent, id, rectangle) {} 27 : IGUIElement(EGUIET_WINDOW, environment, parent, id, rectangle) {}
28 28
29 //! Returns pointer to the close button 29 //! Returns pointer to the close button
30 /** You can hide the button by calling setVisible(false) on the result. */ 30 /** You can hide the button by calling setVisible(false) on the result. */
31 virtual IGUIButton* getCloseButton() const = 0; 31 virtual IGUIButton* getCloseButton() const = 0;
32 32
33 //! Returns pointer to the minimize button 33 //! Returns pointer to the minimize button
34 /** You can hide the button by calling setVisible(false) on the result. */ 34 /** You can hide the button by calling setVisible(false) on the result. */
35 virtual IGUIButton* getMinimizeButton() const = 0; 35 virtual IGUIButton* getMinimizeButton() const = 0;
36 36
37 //! Returns pointer to the maximize button 37 //! Returns pointer to the maximize button
38 /** You can hide the button by calling setVisible(false) on the result. */ 38 /** You can hide the button by calling setVisible(false) on the result. */
39 virtual IGUIButton* getMaximizeButton() const = 0; 39 virtual IGUIButton* getMaximizeButton() const = 0;
40 40
41 //! Returns true if the window can be dragged with the mouse, false if not 41 //! Returns true if the window can be dragged with the mouse, false if not
42 virtual bool isDraggable() const = 0; 42 virtual bool isDraggable() const = 0;
43 43
44 //! Sets whether the window can be dragged by the mouse 44 //! Sets whether the window can be dragged by the mouse
45 virtual void setDraggable(bool draggable) = 0; 45 virtual void setDraggable(bool draggable) = 0;
46 46
47 //! Set if the window background will be drawn 47 //! Set if the window background will be drawn
48 virtual void setDrawBackground(bool draw) = 0; 48 virtual void setDrawBackground(bool draw) = 0;
49 49
50 //! Get if the window background will be drawn 50 //! Get if the window background will be drawn
51 virtual bool getDrawBackground() const = 0; 51 virtual bool getDrawBackground() const = 0;
52 52
53 //! Set if the window titlebar will be drawn 53 //! Set if the window titlebar will be drawn
54 //! Note: If the background is not drawn, then the titlebar is automatically also not drawn 54 //! Note: If the background is not drawn, then the titlebar is automatically also not drawn
55 virtual void setDrawTitlebar(bool draw) = 0; 55 virtual void setDrawTitlebar(bool draw) = 0;
56 56
57 //! Get if the window titlebar will be drawn 57 //! Get if the window titlebar will be drawn
58 virtual bool getDrawTitlebar() const = 0; 58 virtual bool getDrawTitlebar() const = 0;
59 59
60 //! Returns the rectangle of the drawable area (without border and without titlebar) 60 //! Returns the rectangle of the drawable area (without border and without titlebar)
61 /** The coordinates are given relative to the top-left position of the gui element.<br> 61 /** The coordinates are given relative to the top-left position of the gui element.<br>
62 So to get absolute positions you have to add the resulting rectangle to getAbsolutePosition().UpperLeftCorner.<br> 62 So to get absolute positions you have to add the resulting rectangle to getAbsolutePosition().UpperLeftCorner.<br>
63 To get it relative to the parent element you have to add the resulting rectangle to getRelativePosition().UpperLeftCorner. 63 To get it relative to the parent element you have to add the resulting rectangle to getRelativePosition().UpperLeftCorner.
64 Beware that adding a menu will not change the clientRect as menus are own gui elements, so in that case you might want to subtract 64 Beware that adding a menu will not change the clientRect as menus are own gui elements, so in that case you might want to subtract
65 the menu area additionally. */ 65 the menu area additionally. */
66 virtual core::rect<s32> getClientRect() const = 0; 66 virtual core::rect<s32> getClientRect() const = 0;
67 }; 67 };
68 68
69 69
70} // end namespace gui 70} // end namespace gui
71} // end namespace irr 71} // end namespace irr
72 72
73#endif 73#endif
74 74
diff --git a/libraries/irrlicht-1.8/include/IGeometryCreator.h b/libraries/irrlicht-1.8/include/IGeometryCreator.h
index 164e94b..22cd013 100644
--- a/libraries/irrlicht-1.8/include/IGeometryCreator.h
+++ b/libraries/irrlicht-1.8/include/IGeometryCreator.h
@@ -1,177 +1,177 @@
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#ifndef __I_GEOMETRY_CREATOR_H_INCLUDED__ 5#ifndef __I_GEOMETRY_CREATOR_H_INCLUDED__
6#define __I_GEOMETRY_CREATOR_H_INCLUDED__ 6#define __I_GEOMETRY_CREATOR_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "IMesh.h" 9#include "IMesh.h"
10#include "IImage.h" 10#include "IImage.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace video 14namespace video
15{ 15{
16 class IVideoDriver; 16 class IVideoDriver;
17 class SMaterial; 17 class SMaterial;
18} 18}
19 19
20namespace scene 20namespace scene
21{ 21{
22 22
23//! Helper class for creating geometry on the fly. 23//! Helper class for creating geometry on the fly.
24/** You can get an instance of this class through ISceneManager::getGeometryCreator() */ 24/** You can get an instance of this class through ISceneManager::getGeometryCreator() */
25class IGeometryCreator : public IReferenceCounted 25class IGeometryCreator : public IReferenceCounted
26{ 26{
27public: 27public:
28 28
29 //! Creates a simple cube mesh. 29 //! Creates a simple cube mesh.
30 /** 30 /**
31 \param size Dimensions of the cube. 31 \param size Dimensions of the cube.
32 \return Generated mesh. 32 \return Generated mesh.
33 */ 33 */
34 virtual IMesh* createCubeMesh(const core::vector3df& size=core::vector3df(5.f,5.f,5.f)) const =0; 34 virtual IMesh* createCubeMesh(const core::vector3df& size=core::vector3df(5.f,5.f,5.f)) const =0;
35 35
36 //! Create a pseudo-random mesh representing a hilly terrain. 36 //! Create a pseudo-random mesh representing a hilly terrain.
37 /** 37 /**
38 \param tileSize The size of each tile. 38 \param tileSize The size of each tile.
39 \param tileCount The number of tiles in each dimension. 39 \param tileCount The number of tiles in each dimension.
40 \param material The material to apply to the mesh. 40 \param material The material to apply to the mesh.
41 \param hillHeight The maximum height of the hills. 41 \param hillHeight The maximum height of the hills.
42 \param countHills The number of hills along each dimension. 42 \param countHills The number of hills along each dimension.
43 \param textureRepeatCount The number of times to repeat the material texture along each dimension. 43 \param textureRepeatCount The number of times to repeat the material texture along each dimension.
44 \return Generated mesh. 44 \return Generated mesh.
45 */ 45 */
46 virtual IMesh* createHillPlaneMesh( 46 virtual IMesh* createHillPlaneMesh(
47 const core::dimension2d<f32>& tileSize, 47 const core::dimension2d<f32>& tileSize,
48 const core::dimension2d<u32>& tileCount, 48 const core::dimension2d<u32>& tileCount,
49 video::SMaterial* material, f32 hillHeight, 49 video::SMaterial* material, f32 hillHeight,
50 const core::dimension2d<f32>& countHills, 50 const core::dimension2d<f32>& countHills,
51 const core::dimension2d<f32>& textureRepeatCount) const =0; 51 const core::dimension2d<f32>& textureRepeatCount) const =0;
52 52
53 //! Create a simple rectangular textured plane mesh. 53 //! Create a simple rectangular textured plane mesh.
54 /** 54 /**
55 \param tileSize The size of each tile. 55 \param tileSize The size of each tile.
56 \param tileCount The number of tiles in each dimension. 56 \param tileCount The number of tiles in each dimension.
57 \param material The material to apply to the mesh. 57 \param material The material to apply to the mesh.
58 \param textureRepeatCount The number of times to repeat the material texture along each dimension. 58 \param textureRepeatCount The number of times to repeat the material texture along each dimension.
59 \return Generated mesh. 59 \return Generated mesh.
60 */ 60 */
61 IMesh* createPlaneMesh( 61 IMesh* createPlaneMesh(
62 const core::dimension2d<f32>& tileSize, 62 const core::dimension2d<f32>& tileSize,
63 const core::dimension2d<u32>& tileCount=core::dimension2du(1,1), 63 const core::dimension2d<u32>& tileCount=core::dimension2du(1,1),
64 video::SMaterial* material=0, 64 video::SMaterial* material=0,
65 const core::dimension2df& textureRepeatCount=core::dimension2df(1.f,1.f)) const 65 const core::dimension2df& textureRepeatCount=core::dimension2df(1.f,1.f)) const
66 { 66 {
67 return createHillPlaneMesh(tileSize, tileCount, material, 0.f, core::dimension2df(), textureRepeatCount); 67 return createHillPlaneMesh(tileSize, tileCount, material, 0.f, core::dimension2df(), textureRepeatCount);
68 } 68 }
69 69
70 //! Create a terrain mesh from an image representing a heightfield. 70 //! Create a terrain mesh from an image representing a heightfield.
71 /** 71 /**
72 \param texture The texture to apply to the terrain. 72 \param texture The texture to apply to the terrain.
73 \param heightmap An image that will be interpreted as a heightmap. The 73 \param heightmap An image that will be interpreted as a heightmap. The
74 brightness (average color) of each pixel is interpreted as a height, 74 brightness (average color) of each pixel is interpreted as a height,
75 with a 255 brightness pixel producing the maximum height. 75 with a 255 brightness pixel producing the maximum height.
76 \param stretchSize The size that each pixel will produce, i.e. a 76 \param stretchSize The size that each pixel will produce, i.e. a
77 512x512 heightmap 77 512x512 heightmap
78 and a stretchSize of (10.f, 20.f) will produce a mesh of size 78 and a stretchSize of (10.f, 20.f) will produce a mesh of size
79 5120.f x 10240.f 79 5120.f x 10240.f
80 \param maxHeight The maximum height of the terrain. 80 \param maxHeight The maximum height of the terrain.
81 \param driver The current video driver. 81 \param driver The current video driver.
82 \param defaultVertexBlockSize (to be documented) 82 \param defaultVertexBlockSize (to be documented)
83 \param debugBorders (to be documented) 83 \param debugBorders (to be documented)
84 \return Generated mesh. 84 \return Generated mesh.
85 */ 85 */
86 virtual IMesh* createTerrainMesh(video::IImage* texture, 86 virtual IMesh* createTerrainMesh(video::IImage* texture,
87 video::IImage* heightmap, 87 video::IImage* heightmap,
88 const core::dimension2d<f32>& stretchSize, 88 const core::dimension2d<f32>& stretchSize,
89 f32 maxHeight, video::IVideoDriver* driver, 89 f32 maxHeight, video::IVideoDriver* driver,
90 const core::dimension2d<u32>& defaultVertexBlockSize, 90 const core::dimension2d<u32>& defaultVertexBlockSize,
91 bool debugBorders=false) const =0; 91 bool debugBorders=false) const =0;
92 92
93 //! Create an arrow mesh, composed of a cylinder and a cone. 93 //! Create an arrow mesh, composed of a cylinder and a cone.
94 /** 94 /**
95 \param tesselationCylinder Number of quads composing the cylinder. 95 \param tesselationCylinder Number of quads composing the cylinder.
96 \param tesselationCone Number of triangles composing the cone's roof. 96 \param tesselationCone Number of triangles composing the cone's roof.
97 \param height Total height of the arrow 97 \param height Total height of the arrow
98 \param cylinderHeight Total height of the cylinder, should be lesser 98 \param cylinderHeight Total height of the cylinder, should be lesser
99 than total height 99 than total height
100 \param widthCylinder Diameter of the cylinder 100 \param widthCylinder Diameter of the cylinder
101 \param widthCone Diameter of the cone's base, should be not smaller 101 \param widthCone Diameter of the cone's base, should be not smaller
102 than the cylinder's diameter 102 than the cylinder's diameter
103 \param colorCylinder color of the cylinder 103 \param colorCylinder color of the cylinder
104 \param colorCone color of the cone 104 \param colorCone color of the cone
105 \return Generated mesh. 105 \return Generated mesh.
106 */ 106 */
107 virtual IMesh* createArrowMesh(const u32 tesselationCylinder = 4, 107 virtual IMesh* createArrowMesh(const u32 tesselationCylinder = 4,
108 const u32 tesselationCone = 8, const f32 height = 1.f, 108 const u32 tesselationCone = 8, const f32 height = 1.f,
109 const f32 cylinderHeight = 0.6f, const f32 widthCylinder = 0.05f, 109 const f32 cylinderHeight = 0.6f, const f32 widthCylinder = 0.05f,
110 const f32 widthCone = 0.3f, const video::SColor colorCylinder = 0xFFFFFFFF, 110 const f32 widthCone = 0.3f, const video::SColor colorCylinder = 0xFFFFFFFF,
111 const video::SColor colorCone = 0xFFFFFFFF) const =0; 111 const video::SColor colorCone = 0xFFFFFFFF) const =0;
112 112
113 113
114 //! Create a sphere mesh. 114 //! Create a sphere mesh.
115 /** 115 /**
116 \param radius Radius of the sphere 116 \param radius Radius of the sphere
117 \param polyCountX Number of quads used for the horizontal tiling 117 \param polyCountX Number of quads used for the horizontal tiling
118 \param polyCountY Number of quads used for the vertical tiling 118 \param polyCountY Number of quads used for the vertical tiling
119 \return Generated mesh. 119 \return Generated mesh.
120 */ 120 */
121 virtual IMesh* createSphereMesh(f32 radius = 5.f, 121 virtual IMesh* createSphereMesh(f32 radius = 5.f,
122 u32 polyCountX = 16, u32 polyCountY = 16) const =0; 122 u32 polyCountX = 16, u32 polyCountY = 16) const =0;
123 123
124 //! Create a cylinder mesh. 124 //! Create a cylinder mesh.
125 /** 125 /**
126 \param radius Radius of the cylinder. 126 \param radius Radius of the cylinder.
127 \param length Length of the cylinder. 127 \param length Length of the cylinder.
128 \param tesselation Number of quads around the circumference of the cylinder. 128 \param tesselation Number of quads around the circumference of the cylinder.
129 \param color The color of the cylinder. 129 \param color The color of the cylinder.
130 \param closeTop If true, close the ends of the cylinder, otherwise leave them open. 130 \param closeTop If true, close the ends of the cylinder, otherwise leave them open.
131 \param oblique (to be documented) 131 \param oblique (to be documented)
132 \return Generated mesh. 132 \return Generated mesh.
133 */ 133 */
134 virtual IMesh* createCylinderMesh(f32 radius, f32 length, 134 virtual IMesh* createCylinderMesh(f32 radius, f32 length,
135 u32 tesselation, 135 u32 tesselation,
136 const video::SColor& color=video::SColor(0xffffffff), 136 const video::SColor& color=video::SColor(0xffffffff),
137 bool closeTop=true, f32 oblique=0.f) const =0; 137 bool closeTop=true, f32 oblique=0.f) const =0;
138 138
139 //! Create a cone mesh. 139 //! Create a cone mesh.
140 /** 140 /**
141 \param radius Radius of the cone. 141 \param radius Radius of the cone.
142 \param length Length of the cone. 142 \param length Length of the cone.
143 \param tesselation Number of quads around the circumference of the cone. 143 \param tesselation Number of quads around the circumference of the cone.
144 \param colorTop The color of the top of the cone. 144 \param colorTop The color of the top of the cone.
145 \param colorBottom The color of the bottom of the cone. 145 \param colorBottom The color of the bottom of the cone.
146 \param oblique (to be documented) 146 \param oblique (to be documented)
147 \return Generated mesh. 147 \return Generated mesh.
148 */ 148 */
149 virtual IMesh* createConeMesh(f32 radius, f32 length, u32 tesselation, 149 virtual IMesh* createConeMesh(f32 radius, f32 length, u32 tesselation,
150 const video::SColor& colorTop=video::SColor(0xffffffff), 150 const video::SColor& colorTop=video::SColor(0xffffffff),
151 const video::SColor& colorBottom=video::SColor(0xffffffff), 151 const video::SColor& colorBottom=video::SColor(0xffffffff),
152 f32 oblique=0.f) const =0; 152 f32 oblique=0.f) const =0;
153 153
154 //! Create a volume light mesh. 154 //! Create a volume light mesh.
155 /** 155 /**
156 \param subdivideU Horizontal patch count. 156 \param subdivideU Horizontal patch count.
157 \param subdivideV Vertical patch count. 157 \param subdivideV Vertical patch count.
158 \param footColor Color at the bottom of the light. 158 \param footColor Color at the bottom of the light.
159 \param tailColor Color at the mid of the light. 159 \param tailColor Color at the mid of the light.
160 \param lpDistance Virtual distance of the light point for normals. 160 \param lpDistance Virtual distance of the light point for normals.
161 \param lightDim Dimensions of the light. 161 \param lightDim Dimensions of the light.
162 \return Generated mesh. 162 \return Generated mesh.
163 */ 163 */
164 virtual IMesh* createVolumeLightMesh( 164 virtual IMesh* createVolumeLightMesh(
165 const u32 subdivideU=32, const u32 subdivideV=32, 165 const u32 subdivideU=32, const u32 subdivideV=32,
166 const video::SColor footColor = 0xffffffff, 166 const video::SColor footColor = 0xffffffff,
167 const video::SColor tailColor = 0xffffffff, 167 const video::SColor tailColor = 0xffffffff,
168 const f32 lpDistance = 8.f, 168 const f32 lpDistance = 8.f,
169 const core::vector3df& lightDim = core::vector3df(1.f,1.2f,1.f)) const =0; 169 const core::vector3df& lightDim = core::vector3df(1.f,1.2f,1.f)) const =0;
170}; 170};
171 171
172 172
173} // end namespace scene 173} // end namespace scene
174} // end namespace irr 174} // end namespace irr
175 175
176#endif // __I_GEOMETRY_CREATOR_H_INCLUDED__ 176#endif // __I_GEOMETRY_CREATOR_H_INCLUDED__
177 177
diff --git a/libraries/irrlicht-1.8/include/IImage.h b/libraries/irrlicht-1.8/include/IImage.h
index 2cb1f8c..d484293 100644
--- a/libraries/irrlicht-1.8/include/IImage.h
+++ b/libraries/irrlicht-1.8/include/IImage.h
@@ -1,155 +1,155 @@
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#ifndef __I_IMAGE_H_INCLUDED__ 5#ifndef __I_IMAGE_H_INCLUDED__
6#define __I_IMAGE_H_INCLUDED__ 6#define __I_IMAGE_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "position2d.h" 9#include "position2d.h"
10#include "rect.h" 10#include "rect.h"
11#include "SColor.h" 11#include "SColor.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace video 15namespace video
16{ 16{
17 17
18//! Interface for software image data. 18//! Interface for software image data.
19/** Image loaders create these images from files. IVideoDrivers convert 19/** Image loaders create these images from files. IVideoDrivers convert
20these images into their (hardware) textures. 20these images into their (hardware) textures.
21*/ 21*/
22class IImage : public virtual IReferenceCounted 22class IImage : public virtual IReferenceCounted
23{ 23{
24public: 24public:
25 25
26 //! Lock function. Use this to get a pointer to the image data. 26 //! Lock function. Use this to get a pointer to the image data.
27 /** After you don't need the pointer anymore, you must call unlock(). 27 /** After you don't need the pointer anymore, you must call unlock().
28 \return Pointer to the image data. What type of data is pointed to 28 \return Pointer to the image data. What type of data is pointed to
29 depends on the color format of the image. For example if the color 29 depends on the color format of the image. For example if the color
30 format is ECF_A8R8G8B8, it is of u32. Be sure to call unlock() after 30 format is ECF_A8R8G8B8, it is of u32. Be sure to call unlock() after
31 you don't need the pointer any more. */ 31 you don't need the pointer any more. */
32 virtual void* lock() = 0; 32 virtual void* lock() = 0;
33 33
34 //! Unlock function. 34 //! Unlock function.
35 /** Should be called after the pointer received by lock() is not 35 /** Should be called after the pointer received by lock() is not
36 needed anymore. */ 36 needed anymore. */
37 virtual void unlock() = 0; 37 virtual void unlock() = 0;
38 38
39 //! Returns width and height of image data. 39 //! Returns width and height of image data.
40 virtual const core::dimension2d<u32>& getDimension() const = 0; 40 virtual const core::dimension2d<u32>& getDimension() const = 0;
41 41
42 //! Returns bits per pixel. 42 //! Returns bits per pixel.
43 virtual u32 getBitsPerPixel() const = 0; 43 virtual u32 getBitsPerPixel() const = 0;
44 44
45 //! Returns bytes per pixel 45 //! Returns bytes per pixel
46 virtual u32 getBytesPerPixel() const = 0; 46 virtual u32 getBytesPerPixel() const = 0;
47 47
48 //! Returns image data size in bytes 48 //! Returns image data size in bytes
49 virtual u32 getImageDataSizeInBytes() const = 0; 49 virtual u32 getImageDataSizeInBytes() const = 0;
50 50
51 //! Returns image data size in pixels 51 //! Returns image data size in pixels
52 virtual u32 getImageDataSizeInPixels() const = 0; 52 virtual u32 getImageDataSizeInPixels() const = 0;
53 53
54 //! Returns a pixel 54 //! Returns a pixel
55 virtual SColor getPixel(u32 x, u32 y) const = 0; 55 virtual SColor getPixel(u32 x, u32 y) const = 0;
56 56
57 //! Sets a pixel 57 //! Sets a pixel
58 virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend = false ) = 0; 58 virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend = false ) = 0;
59 59
60 //! Returns the color format 60 //! Returns the color format
61 virtual ECOLOR_FORMAT getColorFormat() const = 0; 61 virtual ECOLOR_FORMAT getColorFormat() const = 0;
62 62
63 //! Returns mask for red value of a pixel 63 //! Returns mask for red value of a pixel
64 virtual u32 getRedMask() const = 0; 64 virtual u32 getRedMask() const = 0;
65 65
66 //! Returns mask for green value of a pixel 66 //! Returns mask for green value of a pixel
67 virtual u32 getGreenMask() const = 0; 67 virtual u32 getGreenMask() const = 0;
68 68
69 //! Returns mask for blue value of a pixel 69 //! Returns mask for blue value of a pixel
70 virtual u32 getBlueMask() const = 0; 70 virtual u32 getBlueMask() const = 0;
71 71
72 //! Returns mask for alpha value of a pixel 72 //! Returns mask for alpha value of a pixel
73 virtual u32 getAlphaMask() const = 0; 73 virtual u32 getAlphaMask() const = 0;
74 74
75 //! Returns pitch of image 75 //! Returns pitch of image
76 virtual u32 getPitch() const =0; 76 virtual u32 getPitch() const =0;
77 77
78 //! Copies the image into the target, scaling the image to fit 78 //! Copies the image into the target, scaling the image to fit
79 virtual void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) =0; 79 virtual void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) =0;
80 80
81 //! Copies the image into the target, scaling the image to fit 81 //! Copies the image into the target, scaling the image to fit
82 virtual void copyToScaling(IImage* target) =0; 82 virtual void copyToScaling(IImage* target) =0;
83 83
84 //! copies this surface into another 84 //! copies this surface into another
85 virtual void copyTo(IImage* target, const core::position2d<s32>& pos=core::position2d<s32>(0,0)) =0; 85 virtual void copyTo(IImage* target, const core::position2d<s32>& pos=core::position2d<s32>(0,0)) =0;
86 86
87 //! copies this surface into another 87 //! copies this surface into another
88 virtual void copyTo(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect=0) =0; 88 virtual void copyTo(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect=0) =0;
89 89
90 //! copies this surface into another, using the alpha mask and cliprect and a color to add with 90 //! copies this surface into another, using the alpha mask and cliprect and a color to add with
91 virtual void copyToWithAlpha(IImage* target, const core::position2d<s32>& pos, 91 virtual void copyToWithAlpha(IImage* target, const core::position2d<s32>& pos,
92 const core::rect<s32>& sourceRect, const SColor &color, 92 const core::rect<s32>& sourceRect, const SColor &color,
93 const core::rect<s32>* clipRect = 0) =0; 93 const core::rect<s32>* clipRect = 0) =0;
94 94
95 //! copies this surface into another, scaling it to fit, appyling a box filter 95 //! copies this surface into another, scaling it to fit, appyling a box filter
96 virtual void copyToScalingBoxFilter(IImage* target, s32 bias = 0, bool blend = false) = 0; 96 virtual void copyToScalingBoxFilter(IImage* target, s32 bias = 0, bool blend = false) = 0;
97 97
98 //! fills the surface with given color 98 //! fills the surface with given color
99 virtual void fill(const SColor &color) =0; 99 virtual void fill(const SColor &color) =0;
100 100
101 //! get the amount of Bits per Pixel of the given color format 101 //! get the amount of Bits per Pixel of the given color format
102 static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format) 102 static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format)
103 { 103 {
104 switch(format) 104 switch(format)
105 { 105 {
106 case ECF_A1R5G5B5: 106 case ECF_A1R5G5B5:
107 return 16; 107 return 16;
108 case ECF_R5G6B5: 108 case ECF_R5G6B5:
109 return 16; 109 return 16;
110 case ECF_R8G8B8: 110 case ECF_R8G8B8:
111 return 24; 111 return 24;
112 case ECF_A8R8G8B8: 112 case ECF_A8R8G8B8:
113 return 32; 113 return 32;
114 case ECF_R16F: 114 case ECF_R16F:
115 return 16; 115 return 16;
116 case ECF_G16R16F: 116 case ECF_G16R16F:
117 return 32; 117 return 32;
118 case ECF_A16B16G16R16F: 118 case ECF_A16B16G16R16F:
119 return 64; 119 return 64;
120 case ECF_R32F: 120 case ECF_R32F:
121 return 32; 121 return 32;
122 case ECF_G32R32F: 122 case ECF_G32R32F:
123 return 64; 123 return 64;
124 case ECF_A32B32G32R32F: 124 case ECF_A32B32G32R32F:
125 return 128; 125 return 128;
126 default: 126 default:
127 return 0; 127 return 0;
128 } 128 }
129 } 129 }
130 130
131 //! test if the color format is only viable for RenderTarget textures 131 //! test if the color format is only viable for RenderTarget textures
132 /** Since we don't have support for e.g. floating point IImage formats 132 /** Since we don't have support for e.g. floating point IImage formats
133 one should test if the color format can be used for arbitrary usage, or 133 one should test if the color format can be used for arbitrary usage, or
134 if it is restricted to RTTs. */ 134 if it is restricted to RTTs. */
135 static bool isRenderTargetOnlyFormat(const ECOLOR_FORMAT format) 135 static bool isRenderTargetOnlyFormat(const ECOLOR_FORMAT format)
136 { 136 {
137 switch(format) 137 switch(format)
138 { 138 {
139 case ECF_A1R5G5B5: 139 case ECF_A1R5G5B5:
140 case ECF_R5G6B5: 140 case ECF_R5G6B5:
141 case ECF_R8G8B8: 141 case ECF_R8G8B8:
142 case ECF_A8R8G8B8: 142 case ECF_A8R8G8B8:
143 return false; 143 return false;
144 default: 144 default:
145 return true; 145 return true;
146 } 146 }
147 } 147 }
148 148
149}; 149};
150 150
151} // end namespace video 151} // end namespace video
152} // end namespace irr 152} // end namespace irr
153 153
154#endif 154#endif
155 155
diff --git a/libraries/irrlicht-1.8/include/IImageLoader.h b/libraries/irrlicht-1.8/include/IImageLoader.h
index 5ff091d..77603f5 100644
--- a/libraries/irrlicht-1.8/include/IImageLoader.h
+++ b/libraries/irrlicht-1.8/include/IImageLoader.h
@@ -1,53 +1,53 @@
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#ifndef __I_SURFACE_LOADER_H_INCLUDED__ 5#ifndef __I_SURFACE_LOADER_H_INCLUDED__
6#define __I_SURFACE_LOADER_H_INCLUDED__ 6#define __I_SURFACE_LOADER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "IImage.h" 9#include "IImage.h"
10#include "path.h" 10#include "path.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace io 14namespace io
15{ 15{
16 class IReadFile; 16 class IReadFile;
17} // end namespace io 17} // end namespace io
18namespace video 18namespace video
19{ 19{
20 20
21//! Class which is able to create a image from a file. 21//! Class which is able to create a image from a file.
22/** If you want the Irrlicht Engine be able to load textures of 22/** If you want the Irrlicht Engine be able to load textures of
23currently unsupported file formats (e.g .gif), then implement 23currently unsupported file formats (e.g .gif), then implement
24this and add your new Surface loader with 24this and add your new Surface loader with
25IVideoDriver::addExternalImageLoader() to the engine. */ 25IVideoDriver::addExternalImageLoader() to the engine. */
26class IImageLoader : public virtual IReferenceCounted 26class IImageLoader : public virtual IReferenceCounted
27{ 27{
28public: 28public:
29 29
30 //! Check if the file might be loaded by this class 30 //! Check if the file might be loaded by this class
31 /** Check is based on the file extension (e.g. ".tga") 31 /** Check is based on the file extension (e.g. ".tga")
32 \param filename Name of file to check. 32 \param filename Name of file to check.
33 \return True if file seems to be loadable. */ 33 \return True if file seems to be loadable. */
34 virtual bool isALoadableFileExtension(const io::path& filename) const = 0; 34 virtual bool isALoadableFileExtension(const io::path& filename) const = 0;
35 35
36 //! Check if the file might be loaded by this class 36 //! Check if the file might be loaded by this class
37 /** Check might look into the file. 37 /** Check might look into the file.
38 \param file File handle to check. 38 \param file File handle to check.
39 \return True if file seems to be loadable. */ 39 \return True if file seems to be loadable. */
40 virtual bool isALoadableFileFormat(io::IReadFile* file) const = 0; 40 virtual bool isALoadableFileFormat(io::IReadFile* file) const = 0;
41 41
42 //! Creates a surface from the file 42 //! Creates a surface from the file
43 /** \param file File handle to check. 43 /** \param file File handle to check.
44 \return Pointer to newly created image, or 0 upon error. */ 44 \return Pointer to newly created image, or 0 upon error. */
45 virtual IImage* loadImage(io::IReadFile* file) const = 0; 45 virtual IImage* loadImage(io::IReadFile* file) const = 0;
46}; 46};
47 47
48 48
49} // end namespace video 49} // end namespace video
50} // end namespace irr 50} // end namespace irr
51 51
52#endif 52#endif
53 53
diff --git a/libraries/irrlicht-1.8/include/IImageWriter.h b/libraries/irrlicht-1.8/include/IImageWriter.h
index 884a488..fd00793 100644
--- a/libraries/irrlicht-1.8/include/IImageWriter.h
+++ b/libraries/irrlicht-1.8/include/IImageWriter.h
@@ -1,45 +1,45 @@
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#ifndef _I_IMAGE_WRITER_H_INCLUDED__ 5#ifndef _I_IMAGE_WRITER_H_INCLUDED__
6#define _I_IMAGE_WRITER_H_INCLUDED__ 6#define _I_IMAGE_WRITER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "irrString.h" 9#include "irrString.h"
10#include "coreutil.h" 10#include "coreutil.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace io 14namespace io
15{ 15{
16 class IWriteFile; 16 class IWriteFile;
17} // end namespace io 17} // end namespace io
18 18
19namespace video 19namespace video
20{ 20{
21 class IImage; 21 class IImage;
22 22
23 23
24//! Interface for writing software image data. 24//! Interface for writing software image data.
25class IImageWriter : public IReferenceCounted 25class IImageWriter : public IReferenceCounted
26{ 26{
27public: 27public:
28 //! Check if this writer can write a file with the given extension 28 //! Check if this writer can write a file with the given extension
29 /** \param filename Name of the file to check. 29 /** \param filename Name of the file to check.
30 \return True if file extension specifies a writable type. */ 30 \return True if file extension specifies a writable type. */
31 virtual bool isAWriteableFileExtension(const io::path& filename) const = 0; 31 virtual bool isAWriteableFileExtension(const io::path& filename) const = 0;
32 32
33 //! Write image to file 33 //! Write image to file
34 /** \param file File handle to write to. 34 /** \param file File handle to write to.
35 \param image Image to write into file. 35 \param image Image to write into file.
36 \param param Writer specific parameter, influencing e.g. quality. 36 \param param Writer specific parameter, influencing e.g. quality.
37 \return True if image was successfully written. */ 37 \return True if image was successfully written. */
38 virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param = 0) const = 0; 38 virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param = 0) const = 0;
39}; 39};
40 40
41} // namespace video 41} // namespace video
42} // namespace irr 42} // namespace irr
43 43
44#endif // _I_IMAGE_WRITER_H_INCLUDED__ 44#endif // _I_IMAGE_WRITER_H_INCLUDED__
45 45
diff --git a/libraries/irrlicht-1.8/include/IIndexBuffer.h b/libraries/irrlicht-1.8/include/IIndexBuffer.h
index 5599b0f..ff5738c 100644
--- a/libraries/irrlicht-1.8/include/IIndexBuffer.h
+++ b/libraries/irrlicht-1.8/include/IIndexBuffer.h
@@ -1,65 +1,65 @@
1// Copyright (C) 2008-2012 Nikolaus Gebhardt 1// Copyright (C) 2008-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#ifndef __I_INDEX_BUFFER_H_INCLUDED__ 5#ifndef __I_INDEX_BUFFER_H_INCLUDED__
6#define __I_INDEX_BUFFER_H_INCLUDED__ 6#define __I_INDEX_BUFFER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "irrArray.h" 9#include "irrArray.h"
10 10
11#include "SVertexIndex.h" 11#include "SVertexIndex.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15 15
16namespace video 16namespace video
17{ 17{
18 18
19} 19}
20 20
21namespace scene 21namespace scene
22{ 22{
23 23
24 class IIndexBuffer : public virtual IReferenceCounted 24 class IIndexBuffer : public virtual IReferenceCounted
25 { 25 {
26 public: 26 public:
27 27
28 virtual void* getData() =0; 28 virtual void* getData() =0;
29 29
30 virtual video::E_INDEX_TYPE getType() const =0; 30 virtual video::E_INDEX_TYPE getType() const =0;
31 virtual void setType(video::E_INDEX_TYPE IndexType) =0; 31 virtual void setType(video::E_INDEX_TYPE IndexType) =0;
32 32
33 virtual u32 stride() const =0; 33 virtual u32 stride() const =0;
34 34
35 virtual u32 size() const =0; 35 virtual u32 size() const =0;
36 virtual void push_back (const u32 &element) =0; 36 virtual void push_back (const u32 &element) =0;
37 virtual u32 operator [](u32 index) const =0; 37 virtual u32 operator [](u32 index) const =0;
38 virtual u32 getLast() =0; 38 virtual u32 getLast() =0;
39 virtual void setValue(u32 index, u32 value) =0; 39 virtual void setValue(u32 index, u32 value) =0;
40 virtual void set_used(u32 usedNow) =0; 40 virtual void set_used(u32 usedNow) =0;
41 virtual void reallocate(u32 new_size) =0; 41 virtual void reallocate(u32 new_size) =0;
42 virtual u32 allocated_size() const=0; 42 virtual u32 allocated_size() const=0;
43 43
44 virtual void* pointer() =0; 44 virtual void* pointer() =0;
45 45
46 //! get the current hardware mapping hint 46 //! get the current hardware mapping hint
47 virtual E_HARDWARE_MAPPING getHardwareMappingHint() const =0; 47 virtual E_HARDWARE_MAPPING getHardwareMappingHint() const =0;
48 48
49 //! set the hardware mapping hint, for driver 49 //! set the hardware mapping hint, for driver
50 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) =0; 50 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) =0;
51 51
52 //! flags the meshbuffer as changed, reloads hardware buffers 52 //! flags the meshbuffer as changed, reloads hardware buffers
53 virtual void setDirty() = 0; 53 virtual void setDirty() = 0;
54 54
55 //! Get the currently used ID for identification of changes. 55 //! Get the currently used ID for identification of changes.
56 /** This shouldn't be used for anything outside the VideoDriver. */ 56 /** This shouldn't be used for anything outside the VideoDriver. */
57 virtual u32 getChangedID() const = 0; 57 virtual u32 getChangedID() const = 0;
58 }; 58 };
59 59
60 60
61} // end namespace scene 61} // end namespace scene
62} // end namespace irr 62} // end namespace irr
63 63
64#endif 64#endif
65 65
diff --git a/libraries/irrlicht-1.8/include/ILightManager.h b/libraries/irrlicht-1.8/include/ILightManager.h
index ff66798..35fb9cb 100644
--- a/libraries/irrlicht-1.8/include/ILightManager.h
+++ b/libraries/irrlicht-1.8/include/ILightManager.h
@@ -1,62 +1,62 @@
1// Written by Colin MacDonald - all rights assigned to Nikolaus Gebhardt 1// Written by Colin MacDonald - all rights assigned to Nikolaus Gebhardt
2// Copyright (C) 2008-2012 Nikolaus Gebhardt 2// Copyright (C) 2008-2012 Nikolaus Gebhardt
3// This file is part of the "Irrlicht Engine". 3// This file is part of the "Irrlicht Engine".
4// For conditions of distribution and use, see copyright notice in irrlicht.h 4// For conditions of distribution and use, see copyright notice in irrlicht.h
5 5
6#ifndef __I_LIGHT_MANAGER_H_INCLUDED__ 6#ifndef __I_LIGHT_MANAGER_H_INCLUDED__
7#define __I_LIGHT_MANAGER_H_INCLUDED__ 7#define __I_LIGHT_MANAGER_H_INCLUDED__
8 8
9#include "IReferenceCounted.h" 9#include "IReferenceCounted.h"
10#include "irrArray.h" 10#include "irrArray.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace scene 14namespace scene
15{ 15{
16 class ILightSceneNode; 16 class ILightSceneNode;
17 17
18 //! ILightManager provides an interface for user applications to manipulate the list of lights in the scene. 18 //! ILightManager provides an interface for user applications to manipulate the list of lights in the scene.
19 /** The light list can be trimmed or re-ordered before device/ hardware 19 /** The light list can be trimmed or re-ordered before device/ hardware
20 lights are created, and/or individual lights can be switched on and off 20 lights are created, and/or individual lights can be switched on and off
21 before or after each scene node is rendered. It is assumed that the 21 before or after each scene node is rendered. It is assumed that the
22 ILightManager implementation will store any data that it wishes to 22 ILightManager implementation will store any data that it wishes to
23 retain, i.e. the ISceneManager to which it is assigned, the lightList, 23 retain, i.e. the ISceneManager to which it is assigned, the lightList,
24 the current render pass, and the current scene node. */ 24 the current render pass, and the current scene node. */
25 class ILightManager : public IReferenceCounted 25 class ILightManager : public IReferenceCounted
26 { 26 {
27 public: 27 public:
28 //! Called after the scene's light list has been built, but before rendering has begun. 28 //! Called after the scene's light list has been built, but before rendering has begun.
29 /** As actual device/hardware lights are not created until the 29 /** As actual device/hardware lights are not created until the
30 ESNRP_LIGHT render pass, this provides an opportunity for the 30 ESNRP_LIGHT render pass, this provides an opportunity for the
31 light manager to trim or re-order the light list, before any 31 light manager to trim or re-order the light list, before any
32 device/hardware lights have actually been created. 32 device/hardware lights have actually been created.
33 \param lightList: the Scene Manager's light list, which 33 \param lightList: the Scene Manager's light list, which
34 the light manager may modify. This reference will remain valid 34 the light manager may modify. This reference will remain valid
35 until OnPostRender(). 35 until OnPostRender().
36 */ 36 */
37 virtual void OnPreRender(core::array<ISceneNode*> & lightList) = 0; 37 virtual void OnPreRender(core::array<ISceneNode*> & lightList) = 0;
38 38
39 //! Called after the last scene node is rendered. 39 //! Called after the last scene node is rendered.
40 /** After this call returns, the lightList passed to OnPreRender() becomes invalid. */ 40 /** After this call returns, the lightList passed to OnPreRender() becomes invalid. */
41 virtual void OnPostRender(void) = 0; 41 virtual void OnPostRender(void) = 0;
42 42
43 //! Called before a render pass begins 43 //! Called before a render pass begins
44 /** \param renderPass: the render pass that's about to begin */ 44 /** \param renderPass: the render pass that's about to begin */
45 virtual void OnRenderPassPreRender(E_SCENE_NODE_RENDER_PASS renderPass) = 0; 45 virtual void OnRenderPassPreRender(E_SCENE_NODE_RENDER_PASS renderPass) = 0;
46 46
47 //! Called after the render pass specified in OnRenderPassPreRender() ends 47 //! Called after the render pass specified in OnRenderPassPreRender() ends
48 /** \param[in] renderPass: the render pass that has finished */ 48 /** \param[in] renderPass: the render pass that has finished */
49 virtual void OnRenderPassPostRender(E_SCENE_NODE_RENDER_PASS renderPass) = 0; 49 virtual void OnRenderPassPostRender(E_SCENE_NODE_RENDER_PASS renderPass) = 0;
50 50
51 //! Called before the given scene node is rendered 51 //! Called before the given scene node is rendered
52 /** \param[in] node: the scene node that's about to be rendered */ 52 /** \param[in] node: the scene node that's about to be rendered */
53 virtual void OnNodePreRender(ISceneNode* node) = 0; 53 virtual void OnNodePreRender(ISceneNode* node) = 0;
54 54
55 //! Called after the the node specified in OnNodePreRender() has been rendered 55 //! Called after the the node specified in OnNodePreRender() has been rendered
56 /** \param[in] node: the scene node that has just been rendered */ 56 /** \param[in] node: the scene node that has just been rendered */
57 virtual void OnNodePostRender(ISceneNode* node) = 0; 57 virtual void OnNodePostRender(ISceneNode* node) = 0;
58 }; 58 };
59} // end namespace scene 59} // end namespace scene
60} // end namespace irr 60} // end namespace irr
61 61
62#endif 62#endif
diff --git a/libraries/irrlicht-1.8/include/ILightSceneNode.h b/libraries/irrlicht-1.8/include/ILightSceneNode.h
index 445ee2d..3feb207 100644
--- a/libraries/irrlicht-1.8/include/ILightSceneNode.h
+++ b/libraries/irrlicht-1.8/include/ILightSceneNode.h
@@ -1,86 +1,86 @@
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#ifndef __I_LIGHT_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_LIGHT_SCENE_NODE_H_INCLUDED__
6#define __I_LIGHT_SCENE_NODE_H_INCLUDED__ 6#define __I_LIGHT_SCENE_NODE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9#include "SLight.h" 9#include "SLight.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 15
16//! Scene node which is a dynamic light. 16//! Scene node which is a dynamic light.
17/** You can switch the light on and off by making it visible or not. It can be 17/** You can switch the light on and off by making it visible or not. It can be
18animated by ordinary scene node animators. If the light type is directional or 18animated by ordinary scene node animators. If the light type is directional or
19spot, the direction of the light source is defined by the rotation of the scene 19spot, the direction of the light source is defined by the rotation of the scene
20node (assuming (0,0,1) as the local direction of the light). 20node (assuming (0,0,1) as the local direction of the light).
21*/ 21*/
22class ILightSceneNode : public ISceneNode 22class ILightSceneNode : public ISceneNode
23{ 23{
24public: 24public:
25 25
26 //! constructor 26 //! constructor
27 ILightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 27 ILightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
28 const core::vector3df& position = core::vector3df(0,0,0)) 28 const core::vector3df& position = core::vector3df(0,0,0))
29 : ISceneNode(parent, mgr, id, position) {} 29 : ISceneNode(parent, mgr, id, position) {}
30 30
31 //! Sets the light data associated with this ILightSceneNode 31 //! Sets the light data associated with this ILightSceneNode
32 /** \param light The new light data. */ 32 /** \param light The new light data. */
33 virtual void setLightData(const video::SLight& light) = 0; 33 virtual void setLightData(const video::SLight& light) = 0;
34 34
35 //! Gets the light data associated with this ILightSceneNode 35 //! Gets the light data associated with this ILightSceneNode
36 /** \return The light data. */ 36 /** \return The light data. */
37 virtual const video::SLight& getLightData() const = 0; 37 virtual const video::SLight& getLightData() const = 0;
38 38
39 //! Gets the light data associated with this ILightSceneNode 39 //! Gets the light data associated with this ILightSceneNode
40 /** \return The light data. */ 40 /** \return The light data. */
41 virtual video::SLight& getLightData() = 0; 41 virtual video::SLight& getLightData() = 0;
42 42
43 //! Sets if the node should be visible or not. 43 //! Sets if the node should be visible or not.
44 /** All children of this node won't be visible either, when set 44 /** All children of this node won't be visible either, when set
45 to true. 45 to true.
46 \param isVisible If the node shall be visible. */ 46 \param isVisible If the node shall be visible. */
47 virtual void setVisible(bool isVisible) = 0; 47 virtual void setVisible(bool isVisible) = 0;
48 48
49 //! Sets the light's radius of influence. 49 //! Sets the light's radius of influence.
50 /** Outside this radius the light won't lighten geometry and cast no 50 /** Outside this radius the light won't lighten geometry and cast no
51 shadows. Setting the radius will also influence the attenuation, setting 51 shadows. Setting the radius will also influence the attenuation, setting
52 it to (0,1/radius,0). If you want to override this behavior, set the 52 it to (0,1/radius,0). If you want to override this behavior, set the
53 attenuation after the radius. 53 attenuation after the radius.
54 \param radius The new radius. */ 54 \param radius The new radius. */
55 virtual void setRadius(f32 radius) = 0; 55 virtual void setRadius(f32 radius) = 0;
56 56
57 //! Gets the light's radius of influence. 57 //! Gets the light's radius of influence.
58 /** \return The current radius. */ 58 /** \return The current radius. */
59 virtual f32 getRadius() const = 0; 59 virtual f32 getRadius() const = 0;
60 60
61 //! Sets the light type. 61 //! Sets the light type.
62 /** \param type The new type. */ 62 /** \param type The new type. */
63 virtual void setLightType(video::E_LIGHT_TYPE type) = 0; 63 virtual void setLightType(video::E_LIGHT_TYPE type) = 0;
64 64
65 //! Gets the light type. 65 //! Gets the light type.
66 /** \return The current light type. */ 66 /** \return The current light type. */
67 virtual video::E_LIGHT_TYPE getLightType() const = 0; 67 virtual video::E_LIGHT_TYPE getLightType() const = 0;
68 68
69 //! Sets whether this light casts shadows. 69 //! Sets whether this light casts shadows.
70 /** Enabling this flag won't automatically cast shadows, the meshes 70 /** Enabling this flag won't automatically cast shadows, the meshes
71 will still need shadow scene nodes attached. But one can enable or 71 will still need shadow scene nodes attached. But one can enable or
72 disable distinct lights for shadow casting for performance reasons. 72 disable distinct lights for shadow casting for performance reasons.
73 \param shadow True if this light shall cast shadows. */ 73 \param shadow True if this light shall cast shadows. */
74 virtual void enableCastShadow(bool shadow=true) = 0; 74 virtual void enableCastShadow(bool shadow=true) = 0;
75 75
76 //! Check whether this light casts shadows. 76 //! Check whether this light casts shadows.
77 /** \return True if light would cast shadows, else false. */ 77 /** \return True if light would cast shadows, else false. */
78 virtual bool getCastShadow() const = 0; 78 virtual bool getCastShadow() const = 0;
79}; 79};
80 80
81} // end namespace scene 81} // end namespace scene
82} // end namespace irr 82} // end namespace irr
83 83
84 84
85#endif 85#endif
86 86
diff --git a/libraries/irrlicht-1.8/include/ILogger.h b/libraries/irrlicht-1.8/include/ILogger.h
index b6c9f6f..53f6273 100644
--- a/libraries/irrlicht-1.8/include/ILogger.h
+++ b/libraries/irrlicht-1.8/include/ILogger.h
@@ -1,102 +1,102 @@
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#ifndef __I_LOGGER_H_INCLUDED__ 5#ifndef __I_LOGGER_H_INCLUDED__
6#define __I_LOGGER_H_INCLUDED__ 6#define __I_LOGGER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12 12
13//! Possible log levels. 13//! Possible log levels.
14//! When used has filter ELL_DEBUG means => log everything and ELL_NONE means => log (nearly) nothing. 14//! When used has filter ELL_DEBUG means => log everything and ELL_NONE means => log (nearly) nothing.
15//! When used to print logging information ELL_DEBUG will have lowest priority while ELL_NONE 15//! When used to print logging information ELL_DEBUG will have lowest priority while ELL_NONE
16//! messages are never filtered and always printed. 16//! messages are never filtered and always printed.
17enum ELOG_LEVEL 17enum ELOG_LEVEL
18{ 18{
19 //! Used for printing information helpful in debugging 19 //! Used for printing information helpful in debugging
20 ELL_DEBUG, 20 ELL_DEBUG,
21 21
22 //! Useful information to print. For example hardware infos or something started/stopped. 22 //! Useful information to print. For example hardware infos or something started/stopped.
23 ELL_INFORMATION, 23 ELL_INFORMATION,
24 24
25 //! Warnings that something isn't as expected and can cause oddities 25 //! Warnings that something isn't as expected and can cause oddities
26 ELL_WARNING, 26 ELL_WARNING,
27 27
28 //! Something did go wrong. 28 //! Something did go wrong.
29 ELL_ERROR, 29 ELL_ERROR,
30 30
31 //! Logs with ELL_NONE will never be filtered. 31 //! Logs with ELL_NONE will never be filtered.
32 //! And used as filter it will remove all logging except ELL_NONE messages. 32 //! And used as filter it will remove all logging except ELL_NONE messages.
33 ELL_NONE 33 ELL_NONE
34}; 34};
35 35
36 36
37//! Interface for logging messages, warnings and errors 37//! Interface for logging messages, warnings and errors
38class ILogger : public virtual IReferenceCounted 38class ILogger : public virtual IReferenceCounted
39{ 39{
40public: 40public:
41 41
42 //! Destructor 42 //! Destructor
43 virtual ~ILogger() {} 43 virtual ~ILogger() {}
44 44
45 //! Returns the current set log level. 45 //! Returns the current set log level.
46 virtual ELOG_LEVEL getLogLevel() const = 0; 46 virtual ELOG_LEVEL getLogLevel() const = 0;
47 47
48 //! Sets a new log level. 48 //! Sets a new log level.
49 /** With this value, texts which are sent to the logger are filtered 49 /** With this value, texts which are sent to the logger are filtered
50 out. For example setting this value to ELL_WARNING, only warnings and 50 out. For example setting this value to ELL_WARNING, only warnings and
51 errors are printed out. Setting it to ELL_INFORMATION, which is the 51 errors are printed out. Setting it to ELL_INFORMATION, which is the
52 default setting, warnings, errors and informational texts are printed 52 default setting, warnings, errors and informational texts are printed
53 out. 53 out.
54 \param ll: new log level filter value. */ 54 \param ll: new log level filter value. */
55 virtual void setLogLevel(ELOG_LEVEL ll) = 0; 55 virtual void setLogLevel(ELOG_LEVEL ll) = 0;
56 56
57 //! Prints out a text into the log 57 //! Prints out a text into the log
58 /** \param text: Text to print out. 58 /** \param text: Text to print out.
59 \param ll: Log level of the text. If the text is an error, set 59 \param ll: Log level of the text. If the text is an error, set
60 it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it 60 it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
61 is just an informational text, set it to ELL_INFORMATION. Texts are 61 is just an informational text, set it to ELL_INFORMATION. Texts are
62 filtered with these levels. If you want to be a text displayed, 62 filtered with these levels. If you want to be a text displayed,
63 independent on what level filter is set, use ELL_NONE. */ 63 independent on what level filter is set, use ELL_NONE. */
64 virtual void log(const c8* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0; 64 virtual void log(const c8* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
65 65
66 //! Prints out a text into the log 66 //! Prints out a text into the log
67 /** \param text: Text to print out. 67 /** \param text: Text to print out.
68 \param hint: Additional info. This string is added after a " :" to the 68 \param hint: Additional info. This string is added after a " :" to the
69 string. 69 string.
70 \param ll: Log level of the text. If the text is an error, set 70 \param ll: Log level of the text. If the text is an error, set
71 it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it 71 it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
72 is just an informational text, set it to ELL_INFORMATION. Texts are 72 is just an informational text, set it to ELL_INFORMATION. Texts are
73 filtered with these levels. If you want to be a text displayed, 73 filtered with these levels. If you want to be a text displayed,
74 independent on what level filter is set, use ELL_NONE. */ 74 independent on what level filter is set, use ELL_NONE. */
75 virtual void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0; 75 virtual void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
76 virtual void log(const c8* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0; 76 virtual void log(const c8* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
77 77
78 //! Prints out a text into the log 78 //! Prints out a text into the log
79 /** \param text: Text to print out. 79 /** \param text: Text to print out.
80 \param hint: Additional info. This string is added after a " :" to the 80 \param hint: Additional info. This string is added after a " :" to the
81 string. 81 string.
82 \param ll: Log level of the text. If the text is an error, set 82 \param ll: Log level of the text. If the text is an error, set
83 it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it 83 it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
84 is just an informational text, set it to ELL_INFORMATION. Texts are 84 is just an informational text, set it to ELL_INFORMATION. Texts are
85 filtered with these levels. If you want to be a text displayed, 85 filtered with these levels. If you want to be a text displayed,
86 independent on what level filter is set, use ELL_NONE. */ 86 independent on what level filter is set, use ELL_NONE. */
87 virtual void log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0; 87 virtual void log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
88 88
89 //! Prints out a text into the log 89 //! Prints out a text into the log
90 /** \param text: Text to print out. 90 /** \param text: Text to print out.
91 \param ll: Log level of the text. If the text is an error, set 91 \param ll: Log level of the text. If the text is an error, set
92 it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it 92 it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
93 is just an informational text, set it to ELL_INFORMATION. Texts are 93 is just an informational text, set it to ELL_INFORMATION. Texts are
94 filtered with these levels. If you want to be a text displayed, 94 filtered with these levels. If you want to be a text displayed,
95 independent on what level filter is set, use ELL_NONE. */ 95 independent on what level filter is set, use ELL_NONE. */
96 virtual void log(const wchar_t* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0; 96 virtual void log(const wchar_t* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
97}; 97};
98 98
99} // end namespace 99} // end namespace
100 100
101#endif 101#endif
102 102
diff --git a/libraries/irrlicht-1.8/include/IMaterialRenderer.h b/libraries/irrlicht-1.8/include/IMaterialRenderer.h
index 1828a71..a4e1d20 100644
--- a/libraries/irrlicht-1.8/include/IMaterialRenderer.h
+++ b/libraries/irrlicht-1.8/include/IMaterialRenderer.h
@@ -1,101 +1,101 @@
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#ifndef __I_MATERIAL_RENDERER_H_INCLUDED__ 5#ifndef __I_MATERIAL_RENDERER_H_INCLUDED__
6#define __I_MATERIAL_RENDERER_H_INCLUDED__ 6#define __I_MATERIAL_RENDERER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "SMaterial.h" 9#include "SMaterial.h"
10#include "S3DVertex.h" 10#include "S3DVertex.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace video 14namespace video
15{ 15{
16 16
17class IVideoDriver; 17class IVideoDriver;
18class IMaterialRendererServices; 18class IMaterialRendererServices;
19 19
20//! Interface for material rendering. 20//! Interface for material rendering.
21/** Can be used to extend the engine with new materials. Refer to 21/** Can be used to extend the engine with new materials. Refer to
22IVideoDriver::addMaterialRenderer() for more informations on how to extend the 22IVideoDriver::addMaterialRenderer() for more informations on how to extend the
23engine with new materials. */ 23engine with new materials. */
24class IMaterialRenderer : public virtual IReferenceCounted 24class IMaterialRenderer : public virtual IReferenceCounted
25{ 25{
26public: 26public:
27 27
28 //! Called by the IVideoDriver implementation the let the renderer set its needed render states. 28 //! Called by the IVideoDriver implementation the let the renderer set its needed render states.
29 /** This is called during the IVideoDriver::setMaterial() call. 29 /** This is called during the IVideoDriver::setMaterial() call.
30 When overriding this, you can set some renderstates or for example a 30 When overriding this, you can set some renderstates or for example a
31 vertex or pixel shader if you like. 31 vertex or pixel shader if you like.
32 \param material: The new material parameters to be set. The renderer 32 \param material: The new material parameters to be set. The renderer
33 may change the material flags in this material. For example if this 33 may change the material flags in this material. For example if this
34 material does not accept the zbuffer = true, it can set it to false. 34 material does not accept the zbuffer = true, it can set it to false.
35 This is useful, because in the next lastMaterial will be just the 35 This is useful, because in the next lastMaterial will be just the
36 material in this call. 36 material in this call.
37 \param lastMaterial: The material parameters which have been set before 37 \param lastMaterial: The material parameters which have been set before
38 this material. 38 this material.
39 \param resetAllRenderstates: True if all renderstates should really be 39 \param resetAllRenderstates: True if all renderstates should really be
40 reset. This is usually true if the last rendering mode was not a usual 40 reset. This is usually true if the last rendering mode was not a usual
41 3d rendering mode, but for example a 2d rendering mode. 41 3d rendering mode, but for example a 2d rendering mode.
42 You should reset really all renderstates if this is true, no matter if 42 You should reset really all renderstates if this is true, no matter if
43 the lastMaterial had some similar settings. This is used because in 43 the lastMaterial had some similar settings. This is used because in
44 most cases, some common renderstates are not changed if they are 44 most cases, some common renderstates are not changed if they are
45 already there, for example bilinear filtering, wireframe, 45 already there, for example bilinear filtering, wireframe,
46 gouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and 46 gouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and
47 fogenable. 47 fogenable.
48 \param services: Interface providing some methods for changing 48 \param services: Interface providing some methods for changing
49 advanced, internal states of a IVideoDriver. */ 49 advanced, internal states of a IVideoDriver. */
50 virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, 50 virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,
51 bool resetAllRenderstates, IMaterialRendererServices* services) {} 51 bool resetAllRenderstates, IMaterialRendererServices* services) {}
52 52
53 //! Called every time before a new bunch of geometry is being drawn using this material with for example drawIndexedTriangleList() call. 53 //! Called every time before a new bunch of geometry is being drawn using this material with for example drawIndexedTriangleList() call.
54 /** OnSetMaterial should normally only be called if the renderer decides 54 /** OnSetMaterial should normally only be called if the renderer decides
55 that the renderstates should be changed, it won't be called if for 55 that the renderstates should be changed, it won't be called if for
56 example two drawIndexedTriangleList() will be called with the same 56 example two drawIndexedTriangleList() will be called with the same
57 material set. This method will be called every time. This is useful for 57 material set. This method will be called every time. This is useful for
58 example for materials with shaders, which don't only set new 58 example for materials with shaders, which don't only set new
59 renderstates but also shader constants. 59 renderstates but also shader constants.
60 \param service: Pointer to interface providing methos for setting 60 \param service: Pointer to interface providing methos for setting
61 constants and other things. 61 constants and other things.
62 \param vtxtype: Vertex type with which the next rendering will be done. 62 \param vtxtype: Vertex type with which the next rendering will be done.
63 This can be used by the material renderer to set some specific 63 This can be used by the material renderer to set some specific
64 optimized shaders or if this is an incompatible vertex type for this 64 optimized shaders or if this is an incompatible vertex type for this
65 renderer, to refuse rendering for example. 65 renderer, to refuse rendering for example.
66 \return Returns true if everything is ok, and false if nothing should 66 \return Returns true if everything is ok, and false if nothing should
67 be rendered. The material renderer can choose to return false for 67 be rendered. The material renderer can choose to return false for
68 example if he doesn't support the specified vertex type. This is 68 example if he doesn't support the specified vertex type. This is
69 actually done in D3D8 and D3D9 when using a normal mapped material with 69 actually done in D3D8 and D3D9 when using a normal mapped material with
70 a vertex type other than EVT_TANGENTS. */ 70 a vertex type other than EVT_TANGENTS. */
71 virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) { return true; } 71 virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) { return true; }
72 72
73 //! Called by the IVideoDriver to unset this material. 73 //! Called by the IVideoDriver to unset this material.
74 /** Called during the IVideoDriver::setMaterial() call before the new 74 /** Called during the IVideoDriver::setMaterial() call before the new
75 material will get the OnSetMaterial() call. */ 75 material will get the OnSetMaterial() call. */
76 virtual void OnUnsetMaterial() {} 76 virtual void OnUnsetMaterial() {}
77 77
78 //! Returns if the material is transparent. 78 //! Returns if the material is transparent.
79 /** The scene managment needs to know this 79 /** The scene managment needs to know this
80 for being able to sort the materials by opaque and transparent. */ 80 for being able to sort the materials by opaque and transparent. */
81 virtual bool isTransparent() const { return false; } 81 virtual bool isTransparent() const { return false; }
82 82
83 //! Returns the render capability of the material. 83 //! Returns the render capability of the material.
84 /** Because some more complex materials 84 /** Because some more complex materials
85 are implemented in multiple ways and need special hardware capabilities, it is possible 85 are implemented in multiple ways and need special hardware capabilities, it is possible
86 to query how the current material renderer is performing on the current hardware with this 86 to query how the current material renderer is performing on the current hardware with this
87 function. 87 function.
88 \return Returns 0 if everything is running fine. Any other value is material renderer 88 \return Returns 0 if everything is running fine. Any other value is material renderer
89 specific and means for example that the renderer switched back to a fall back material because 89 specific and means for example that the renderer switched back to a fall back material because
90 it cannot use the latest shaders. More specific examples: 90 it cannot use the latest shaders. More specific examples:
91 Fixed function pipeline materials should return 0 in most cases, parallax mapped 91 Fixed function pipeline materials should return 0 in most cases, parallax mapped
92 material will only return 0 when at least pixel shader 1.4 is available on that machine. */ 92 material will only return 0 when at least pixel shader 1.4 is available on that machine. */
93 virtual s32 getRenderCapability() const { return 0; } 93 virtual s32 getRenderCapability() const { return 0; }
94}; 94};
95 95
96 96
97} // end namespace video 97} // end namespace video
98} // end namespace irr 98} // end namespace irr
99 99
100#endif 100#endif
101 101
diff --git a/libraries/irrlicht-1.8/include/IMaterialRendererServices.h b/libraries/irrlicht-1.8/include/IMaterialRendererServices.h
index 9f045b5..dafad09 100644
--- a/libraries/irrlicht-1.8/include/IMaterialRendererServices.h
+++ b/libraries/irrlicht-1.8/include/IMaterialRendererServices.h
@@ -1,115 +1,115 @@
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#ifndef __I_MATERIAL_RENDERER_SERVICES_H_INCLUDED__ 5#ifndef __I_MATERIAL_RENDERER_SERVICES_H_INCLUDED__
6#define __I_MATERIAL_RENDERER_SERVICES_H_INCLUDED__ 6#define __I_MATERIAL_RENDERER_SERVICES_H_INCLUDED__
7 7
8#include "SMaterial.h" 8#include "SMaterial.h"
9#include "S3DVertex.h" 9#include "S3DVertex.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace video 13namespace video
14{ 14{
15 15
16class IVideoDriver; 16class IVideoDriver;
17 17
18 18
19//! Interface providing some methods for changing advanced, internal states of a IVideoDriver. 19//! Interface providing some methods for changing advanced, internal states of a IVideoDriver.
20class IMaterialRendererServices 20class IMaterialRendererServices
21{ 21{
22public: 22public:
23 23
24 //! Destructor 24 //! Destructor
25 virtual ~IMaterialRendererServices() {} 25 virtual ~IMaterialRendererServices() {}
26 26
27 //! Can be called by an IMaterialRenderer to make its work easier. 27 //! Can be called by an IMaterialRenderer to make its work easier.
28 /** Sets all basic renderstates if needed. 28 /** Sets all basic renderstates if needed.
29 Basic render states are diffuse, ambient, specular, and emissive color, 29 Basic render states are diffuse, ambient, specular, and emissive color,
30 specular power, bilinear and trilinear filtering, wireframe mode, 30 specular power, bilinear and trilinear filtering, wireframe mode,
31 grouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and 31 grouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and
32 fog enabling. 32 fog enabling.
33 \param material The new material to be used. 33 \param material The new material to be used.
34 \param lastMaterial The material used until now. 34 \param lastMaterial The material used until now.
35 \param resetAllRenderstates Set to true if all renderstates should be 35 \param resetAllRenderstates Set to true if all renderstates should be
36 set, regardless of their current state. */ 36 set, regardless of their current state. */
37 virtual void setBasicRenderStates(const SMaterial& material, 37 virtual void setBasicRenderStates(const SMaterial& material,
38 const SMaterial& lastMaterial, 38 const SMaterial& lastMaterial,
39 bool resetAllRenderstates) = 0; 39 bool resetAllRenderstates) = 0;
40 40
41 //! Sets a constant for the vertex shader based on a name. 41 //! Sets a constant for the vertex shader based on a name.
42 /** This can be used if you used a high level shader language like GLSL 42 /** This can be used if you used a high level shader language like GLSL
43 or HLSL to create a shader. Example: If you created a shader which has 43 or HLSL to create a shader. Example: If you created a shader which has
44 variables named 'mWorldViewProj' (containing the WorldViewProjection 44 variables named 'mWorldViewProj' (containing the WorldViewProjection
45 matrix) and another one named 'fTime' containing one float, you can set 45 matrix) and another one named 'fTime' containing one float, you can set
46 them in your IShaderConstantSetCallBack derived class like this: 46 them in your IShaderConstantSetCallBack derived class like this:
47 \code 47 \code
48 virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData) 48 virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
49 { 49 {
50 video::IVideoDriver* driver = services->getVideoDriver(); 50 video::IVideoDriver* driver = services->getVideoDriver();
51 51
52 f32 time = (f32)os::Timer::getTime()/100000.0f; 52 f32 time = (f32)os::Timer::getTime()/100000.0f;
53 services->setVertexShaderConstant("fTime", &time, 1); 53 services->setVertexShaderConstant("fTime", &time, 1);
54 54
55 core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION)); 55 core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION));
56 worldViewProj *= driver->getTransform(video::ETS_VIEW); 56 worldViewProj *= driver->getTransform(video::ETS_VIEW);
57 worldViewProj *= driver->getTransform(video::ETS_WORLD); 57 worldViewProj *= driver->getTransform(video::ETS_WORLD);
58 services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16); 58 services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
59 } 59 }
60 \endcode 60 \endcode
61 \param name Name of the variable 61 \param name Name of the variable
62 \param floats Pointer to array of floats 62 \param floats Pointer to array of floats
63 \param count Amount of floats in array. 63 \param count Amount of floats in array.
64 \return True if successful. 64 \return True if successful.
65 */ 65 */
66 virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count) = 0; 66 virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count) = 0;
67 67
68 //! Bool interface for the above. 68 //! Bool interface for the above.
69 virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count) = 0; 69 virtual bool setVertexShaderConstant(const c8* name, const bool* bools, int count) = 0;
70 70
71 //! Int interface for the above. 71 //! Int interface for the above.
72 virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count) = 0; 72 virtual bool setVertexShaderConstant(const c8* name, const s32* ints, int count) = 0;
73 73
74 //! Sets a vertex shader constant. 74 //! Sets a vertex shader constant.
75 /** Can be used if you created a shader using pixel/vertex shader 75 /** Can be used if you created a shader using pixel/vertex shader
76 assembler or ARB_fragment_program or ARB_vertex_program. 76 assembler or ARB_fragment_program or ARB_vertex_program.
77 \param data: Data to be set in the constants 77 \param data: Data to be set in the constants
78 \param startRegister: First register to be set 78 \param startRegister: First register to be set
79 \param constantAmount: Amount of registers to be set. One register consists of 4 floats. */ 79 \param constantAmount: Amount of registers to be set. One register consists of 4 floats. */
80 virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0; 80 virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0;
81 81
82 //! Sets a constant for the pixel shader based on a name. 82 //! Sets a constant for the pixel shader based on a name.
83 /** This can be used if you used a high level shader language like GLSL 83 /** This can be used if you used a high level shader language like GLSL
84 or HLSL to create a shader. See setVertexShaderConstant() for an 84 or HLSL to create a shader. See setVertexShaderConstant() for an
85 example on how to use this. 85 example on how to use this.
86 \param name Name of the variable 86 \param name Name of the variable
87 \param floats Pointer to array of floats 87 \param floats Pointer to array of floats
88 \param count Amount of floats in array. 88 \param count Amount of floats in array.
89 \return True if successful. */ 89 \return True if successful. */
90 virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count) = 0; 90 virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count) = 0;
91 91
92 //! Bool interface for the above. 92 //! Bool interface for the above.
93 virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count) = 0; 93 virtual bool setPixelShaderConstant(const c8* name, const bool* bools, int count) = 0;
94 94
95 //! Int interface for the above. 95 //! Int interface for the above.
96 virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count) = 0; 96 virtual bool setPixelShaderConstant(const c8* name, const s32* ints, int count) = 0;
97 97
98 //! Sets a pixel shader constant. 98 //! Sets a pixel shader constant.
99 /** Can be used if you created a shader using pixel/vertex shader 99 /** Can be used if you created a shader using pixel/vertex shader
100 assembler or ARB_fragment_program or ARB_vertex_program. 100 assembler or ARB_fragment_program or ARB_vertex_program.
101 \param data Data to be set in the constants 101 \param data Data to be set in the constants
102 \param startRegister First register to be set. 102 \param startRegister First register to be set.
103 \param constantAmount Amount of registers to be set. One register consists of 4 floats. */ 103 \param constantAmount Amount of registers to be set. One register consists of 4 floats. */
104 virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0; 104 virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0;
105 105
106 //! Get pointer to the IVideoDriver interface 106 //! Get pointer to the IVideoDriver interface
107 /** \return Pointer to the IVideoDriver interface */ 107 /** \return Pointer to the IVideoDriver interface */
108 virtual IVideoDriver* getVideoDriver() = 0; 108 virtual IVideoDriver* getVideoDriver() = 0;
109}; 109};
110 110
111} // end namespace video 111} // end namespace video
112} // end namespace irr 112} // end namespace irr
113 113
114#endif 114#endif
115 115
diff --git a/libraries/irrlicht-1.8/include/IMesh.h b/libraries/irrlicht-1.8/include/IMesh.h
index 8e0bcc2..89f936b 100644
--- a/libraries/irrlicht-1.8/include/IMesh.h
+++ b/libraries/irrlicht-1.8/include/IMesh.h
@@ -1,75 +1,75 @@
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#ifndef __I_MESH_H_INCLUDED__ 5#ifndef __I_MESH_H_INCLUDED__
6#define __I_MESH_H_INCLUDED__ 6#define __I_MESH_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "SMaterial.h" 9#include "SMaterial.h"
10#include "EHardwareBufferFlags.h" 10#include "EHardwareBufferFlags.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace scene 14namespace scene
15{ 15{
16 class IMeshBuffer; 16 class IMeshBuffer;
17 17
18 //! Class which holds the geometry of an object. 18 //! Class which holds the geometry of an object.
19 /** An IMesh is nothing more than a collection of some mesh buffers 19 /** An IMesh is nothing more than a collection of some mesh buffers
20 (IMeshBuffer). SMesh is a simple implementation of an IMesh. 20 (IMeshBuffer). SMesh is a simple implementation of an IMesh.
21 A mesh is usually added to an IMeshSceneNode in order to be rendered. 21 A mesh is usually added to an IMeshSceneNode in order to be rendered.
22 */ 22 */
23 class IMesh : public virtual IReferenceCounted 23 class IMesh : public virtual IReferenceCounted
24 { 24 {
25 public: 25 public:
26 26
27 //! Get the amount of mesh buffers. 27 //! Get the amount of mesh buffers.
28 /** \return Amount of mesh buffers (IMeshBuffer) in this mesh. */ 28 /** \return Amount of mesh buffers (IMeshBuffer) in this mesh. */
29 virtual u32 getMeshBufferCount() const = 0; 29 virtual u32 getMeshBufferCount() const = 0;
30 30
31 //! Get pointer to a mesh buffer. 31 //! Get pointer to a mesh buffer.
32 /** \param nr: Zero based index of the mesh buffer. The maximum value is 32 /** \param nr: Zero based index of the mesh buffer. The maximum value is
33 getMeshBufferCount() - 1; 33 getMeshBufferCount() - 1;
34 \return Pointer to the mesh buffer or 0 if there is no such 34 \return Pointer to the mesh buffer or 0 if there is no such
35 mesh buffer. */ 35 mesh buffer. */
36 virtual IMeshBuffer* getMeshBuffer(u32 nr) const = 0; 36 virtual IMeshBuffer* getMeshBuffer(u32 nr) const = 0;
37 37
38 //! Get pointer to a mesh buffer which fits a material 38 //! Get pointer to a mesh buffer which fits a material
39 /** \param material: material to search for 39 /** \param material: material to search for
40 \return Pointer to the mesh buffer or 0 if there is no such 40 \return Pointer to the mesh buffer or 0 if there is no such
41 mesh buffer. */ 41 mesh buffer. */
42 virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const = 0; 42 virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const = 0;
43 43
44 //! Get an axis aligned bounding box of the mesh. 44 //! Get an axis aligned bounding box of the mesh.
45 /** \return Bounding box of this mesh. */ 45 /** \return Bounding box of this mesh. */
46 virtual const core::aabbox3d<f32>& getBoundingBox() const = 0; 46 virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
47 47
48 //! Set user-defined axis aligned bounding box 48 //! Set user-defined axis aligned bounding box
49 /** \param box New bounding box to use for the mesh. */ 49 /** \param box New bounding box to use for the mesh. */
50 virtual void setBoundingBox( const core::aabbox3df& box) = 0; 50 virtual void setBoundingBox( const core::aabbox3df& box) = 0;
51 51
52 //! Sets a flag of all contained materials to a new value. 52 //! Sets a flag of all contained materials to a new value.
53 /** \param flag: Flag to set in all materials. 53 /** \param flag: Flag to set in all materials.
54 \param newvalue: New value to set in all materials. */ 54 \param newvalue: New value to set in all materials. */
55 virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) = 0; 55 virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) = 0;
56 56
57 //! Set the hardware mapping hint 57 //! Set the hardware mapping hint
58 /** This methods allows to define optimization hints for the 58 /** This methods allows to define optimization hints for the
59 hardware. This enables, e.g., the use of hardware buffers on 59 hardware. This enables, e.g., the use of hardware buffers on
60 pltforms that support this feature. This can lead to noticeable 60 pltforms that support this feature. This can lead to noticeable
61 performance gains. */ 61 performance gains. */
62 virtual void setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0; 62 virtual void setHardwareMappingHint(E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0;
63 63
64 //! Flag the meshbuffer as changed, reloads hardware buffers 64 //! Flag the meshbuffer as changed, reloads hardware buffers
65 /** This method has to be called every time the vertices or 65 /** This method has to be called every time the vertices or
66 indices have changed. Otherwise, changes won't be updated 66 indices have changed. Otherwise, changes won't be updated
67 on the GPU in the next render cycle. */ 67 on the GPU in the next render cycle. */
68 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0; 68 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0;
69 }; 69 };
70 70
71} // end namespace scene 71} // end namespace scene
72} // end namespace irr 72} // end namespace irr
73 73
74#endif 74#endif
75 75
diff --git a/libraries/irrlicht-1.8/include/IMeshBuffer.h b/libraries/irrlicht-1.8/include/IMeshBuffer.h
index 44b865b..99a9f48 100644
--- a/libraries/irrlicht-1.8/include/IMeshBuffer.h
+++ b/libraries/irrlicht-1.8/include/IMeshBuffer.h
@@ -1,154 +1,154 @@
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#ifndef __I_MESH_BUFFER_H_INCLUDED__ 5#ifndef __I_MESH_BUFFER_H_INCLUDED__
6#define __I_MESH_BUFFER_H_INCLUDED__ 6#define __I_MESH_BUFFER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "SMaterial.h" 9#include "SMaterial.h"
10#include "aabbox3d.h" 10#include "aabbox3d.h"
11#include "S3DVertex.h" 11#include "S3DVertex.h"
12#include "SVertexIndex.h" 12#include "SVertexIndex.h"
13#include "EHardwareBufferFlags.h" 13#include "EHardwareBufferFlags.h"
14#include "EPrimitiveTypes.h" 14#include "EPrimitiveTypes.h"
15 15
16namespace irr 16namespace irr
17{ 17{
18namespace scene 18namespace scene
19{ 19{
20 //! Struct for holding a mesh with a single material. 20 //! Struct for holding a mesh with a single material.
21 /** A part of an IMesh which has the same material on each face of that 21 /** A part of an IMesh which has the same material on each face of that
22 group. Logical groups of an IMesh need not be put into separate mesh 22 group. Logical groups of an IMesh need not be put into separate mesh
23 buffers, but can be. Separately animated parts of the mesh must be put 23 buffers, but can be. Separately animated parts of the mesh must be put
24 into separate mesh buffers. 24 into separate mesh buffers.
25 Some mesh buffer implementations have limitations on the number of 25 Some mesh buffer implementations have limitations on the number of
26 vertices the buffer can hold. In that case, logical grouping can help. 26 vertices the buffer can hold. In that case, logical grouping can help.
27 Moreover, the number of vertices should be optimized for the GPU upload, 27 Moreover, the number of vertices should be optimized for the GPU upload,
28 which often depends on the type of gfx card. Typial figures are 28 which often depends on the type of gfx card. Typial figures are
29 1000-10000 vertices per buffer. 29 1000-10000 vertices per buffer.
30 SMeshBuffer is a simple implementation of a MeshBuffer, which supports 30 SMeshBuffer is a simple implementation of a MeshBuffer, which supports
31 up to 65535 vertices. 31 up to 65535 vertices.
32 32
33 Since meshbuffers are used for drawing, and hence will be exposed 33 Since meshbuffers are used for drawing, and hence will be exposed
34 to the driver, chances are high that they are grab()'ed from somewhere. 34 to the driver, chances are high that they are grab()'ed from somewhere.
35 It's therefore required to dynamically allocate meshbuffers which are 35 It's therefore required to dynamically allocate meshbuffers which are
36 passed to a video driver and only drop the buffer once it's not used in 36 passed to a video driver and only drop the buffer once it's not used in
37 the current code block anymore. 37 the current code block anymore.
38 */ 38 */
39 class IMeshBuffer : public virtual IReferenceCounted 39 class IMeshBuffer : public virtual IReferenceCounted
40 { 40 {
41 public: 41 public:
42 42
43 //! Get the material of this meshbuffer 43 //! Get the material of this meshbuffer
44 /** \return Material of this buffer. */ 44 /** \return Material of this buffer. */
45 virtual video::SMaterial& getMaterial() = 0; 45 virtual video::SMaterial& getMaterial() = 0;
46 46
47 //! Get the material of this meshbuffer 47 //! Get the material of this meshbuffer
48 /** \return Material of this buffer. */ 48 /** \return Material of this buffer. */
49 virtual const video::SMaterial& getMaterial() const = 0; 49 virtual const video::SMaterial& getMaterial() const = 0;
50 50
51 //! Get type of vertex data which is stored in this meshbuffer. 51 //! Get type of vertex data which is stored in this meshbuffer.
52 /** \return Vertex type of this buffer. */ 52 /** \return Vertex type of this buffer. */
53 virtual video::E_VERTEX_TYPE getVertexType() const = 0; 53 virtual video::E_VERTEX_TYPE getVertexType() const = 0;
54 54
55 //! Get access to vertex data. The data is an array of vertices. 55 //! Get access to vertex data. The data is an array of vertices.
56 /** Which vertex type is used can be determined by getVertexType(). 56 /** Which vertex type is used can be determined by getVertexType().
57 \return Pointer to array of vertices. */ 57 \return Pointer to array of vertices. */
58 virtual const void* getVertices() const = 0; 58 virtual const void* getVertices() const = 0;
59 59
60 //! Get access to vertex data. The data is an array of vertices. 60 //! Get access to vertex data. The data is an array of vertices.
61 /** Which vertex type is used can be determined by getVertexType(). 61 /** Which vertex type is used can be determined by getVertexType().
62 \return Pointer to array of vertices. */ 62 \return Pointer to array of vertices. */
63 virtual void* getVertices() = 0; 63 virtual void* getVertices() = 0;
64 64
65 //! Get amount of vertices in meshbuffer. 65 //! Get amount of vertices in meshbuffer.
66 /** \return Number of vertices in this buffer. */ 66 /** \return Number of vertices in this buffer. */
67 virtual u32 getVertexCount() const = 0; 67 virtual u32 getVertexCount() const = 0;
68 68
69 //! Get type of index data which is stored in this meshbuffer. 69 //! Get type of index data which is stored in this meshbuffer.
70 /** \return Index type of this buffer. */ 70 /** \return Index type of this buffer. */
71 virtual video::E_INDEX_TYPE getIndexType() const =0; 71 virtual video::E_INDEX_TYPE getIndexType() const =0;
72 72
73 //! Get access to Indices. 73 //! Get access to Indices.
74 /** \return Pointer to indices array. */ 74 /** \return Pointer to indices array. */
75 virtual const u16* getIndices() const = 0; 75 virtual const u16* getIndices() const = 0;
76 76
77 //! Get access to Indices. 77 //! Get access to Indices.
78 /** \return Pointer to indices array. */ 78 /** \return Pointer to indices array. */
79 virtual u16* getIndices() = 0; 79 virtual u16* getIndices() = 0;
80 80
81 //! Get amount of indices in this meshbuffer. 81 //! Get amount of indices in this meshbuffer.
82 /** \return Number of indices in this buffer. */ 82 /** \return Number of indices in this buffer. */
83 virtual u32 getIndexCount() const = 0; 83 virtual u32 getIndexCount() const = 0;
84 84
85 //! Get the axis aligned bounding box of this meshbuffer. 85 //! Get the axis aligned bounding box of this meshbuffer.
86 /** \return Axis aligned bounding box of this buffer. */ 86 /** \return Axis aligned bounding box of this buffer. */
87 virtual const core::aabbox3df& getBoundingBox() const = 0; 87 virtual const core::aabbox3df& getBoundingBox() const = 0;
88 88
89 //! Set axis aligned bounding box 89 //! Set axis aligned bounding box
90 /** \param box User defined axis aligned bounding box to use 90 /** \param box User defined axis aligned bounding box to use
91 for this buffer. */ 91 for this buffer. */
92 virtual void setBoundingBox(const core::aabbox3df& box) = 0; 92 virtual void setBoundingBox(const core::aabbox3df& box) = 0;
93 93
94 //! Recalculates the bounding box. Should be called if the mesh changed. 94 //! Recalculates the bounding box. Should be called if the mesh changed.
95 virtual void recalculateBoundingBox() = 0; 95 virtual void recalculateBoundingBox() = 0;
96 96
97 //! returns position of vertex i 97 //! returns position of vertex i
98 virtual const core::vector3df& getPosition(u32 i) const = 0; 98 virtual const core::vector3df& getPosition(u32 i) const = 0;
99 99
100 //! returns position of vertex i 100 //! returns position of vertex i
101 virtual core::vector3df& getPosition(u32 i) = 0; 101 virtual core::vector3df& getPosition(u32 i) = 0;
102 102
103 //! returns normal of vertex i 103 //! returns normal of vertex i
104 virtual const core::vector3df& getNormal(u32 i) const = 0; 104 virtual const core::vector3df& getNormal(u32 i) const = 0;
105 105
106 //! returns normal of vertex i 106 //! returns normal of vertex i
107 virtual core::vector3df& getNormal(u32 i) = 0; 107 virtual core::vector3df& getNormal(u32 i) = 0;
108 108
109 //! returns texture coord of vertex i 109 //! returns texture coord of vertex i
110 virtual const core::vector2df& getTCoords(u32 i) const = 0; 110 virtual const core::vector2df& getTCoords(u32 i) const = 0;
111 111
112 //! returns texture coord of vertex i 112 //! returns texture coord of vertex i
113 virtual core::vector2df& getTCoords(u32 i) = 0; 113 virtual core::vector2df& getTCoords(u32 i) = 0;
114 114
115 //! Append the vertices and indices to the current buffer 115 //! Append the vertices and indices to the current buffer
116 /** Only works for compatible vertex types. 116 /** Only works for compatible vertex types.
117 \param vertices Pointer to a vertex array. 117 \param vertices Pointer to a vertex array.
118 \param numVertices Number of vertices in the array. 118 \param numVertices Number of vertices in the array.
119 \param indices Pointer to index array. 119 \param indices Pointer to index array.
120 \param numIndices Number of indices in array. */ 120 \param numIndices Number of indices in array. */
121 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) = 0; 121 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) = 0;
122 122
123 //! Append the meshbuffer to the current buffer 123 //! Append the meshbuffer to the current buffer
124 /** Only works for compatible vertex types 124 /** Only works for compatible vertex types
125 \param other Buffer to append to this one. */ 125 \param other Buffer to append to this one. */
126 virtual void append(const IMeshBuffer* const other) = 0; 126 virtual void append(const IMeshBuffer* const other) = 0;
127 127
128 //! get the current hardware mapping hint 128 //! get the current hardware mapping hint
129 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const = 0; 129 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const = 0;
130 130
131 //! get the current hardware mapping hint 131 //! get the current hardware mapping hint
132 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const = 0; 132 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const = 0;
133 133
134 //! set the hardware mapping hint, for driver 134 //! set the hardware mapping hint, for driver
135 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) = 0; 135 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) = 0;
136 136
137 //! flags the meshbuffer as changed, reloads hardware buffers 137 //! flags the meshbuffer as changed, reloads hardware buffers
138 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0; 138 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0;
139 139
140 //! Get the currently used ID for identification of changes. 140 //! Get the currently used ID for identification of changes.
141 /** This shouldn't be used for anything outside the VideoDriver. */ 141 /** This shouldn't be used for anything outside the VideoDriver. */
142 virtual u32 getChangedID_Vertex() const = 0; 142 virtual u32 getChangedID_Vertex() const = 0;
143 143
144 //! Get the currently used ID for identification of changes. 144 //! Get the currently used ID for identification of changes.
145 /** This shouldn't be used for anything outside the VideoDriver. */ 145 /** This shouldn't be used for anything outside the VideoDriver. */
146 virtual u32 getChangedID_Index() const = 0; 146 virtual u32 getChangedID_Index() const = 0;
147 }; 147 };
148 148
149} // end namespace scene 149} // end namespace scene
150} // end namespace irr 150} // end namespace irr
151 151
152#endif 152#endif
153 153
154 154
diff --git a/libraries/irrlicht-1.8/include/IMeshCache.h b/libraries/irrlicht-1.8/include/IMeshCache.h
index 083fc5b..2d2bfa0 100644
--- a/libraries/irrlicht-1.8/include/IMeshCache.h
+++ b/libraries/irrlicht-1.8/include/IMeshCache.h
@@ -1,177 +1,177 @@
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#ifndef __I_MESH_CACHE_H_INCLUDED__ 5#ifndef __I_MESH_CACHE_H_INCLUDED__
6#define __I_MESH_CACHE_H_INCLUDED__ 6#define __I_MESH_CACHE_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "path.h" 9#include "path.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13 13
14namespace scene 14namespace scene
15{ 15{
16 class IMesh; 16 class IMesh;
17 class IAnimatedMesh; 17 class IAnimatedMesh;
18 class IAnimatedMeshSceneNode; 18 class IAnimatedMeshSceneNode;
19 class IMeshLoader; 19 class IMeshLoader;
20 20
21 //! The mesh cache stores already loaded meshes and provides an interface to them. 21 //! The mesh cache stores already loaded meshes and provides an interface to them.
22 /** You can access it using ISceneManager::getMeshCache(). All existing 22 /** You can access it using ISceneManager::getMeshCache(). All existing
23 scene managers will return a pointer to the same mesh cache, because it 23 scene managers will return a pointer to the same mesh cache, because it
24 is shared between them. With this interface, it is possible to manually 24 is shared between them. With this interface, it is possible to manually
25 add new loaded meshes (if ISceneManager::getMesh() is not sufficient), 25 add new loaded meshes (if ISceneManager::getMesh() is not sufficient),
26 to remove them and to iterate through already loaded meshes. */ 26 to remove them and to iterate through already loaded meshes. */
27 class IMeshCache : public virtual IReferenceCounted 27 class IMeshCache : public virtual IReferenceCounted
28 { 28 {
29 public: 29 public:
30 30
31 //! Destructor 31 //! Destructor
32 virtual ~IMeshCache() {} 32 virtual ~IMeshCache() {}
33 33
34 //! Adds a mesh to the internal list of loaded meshes. 34 //! Adds a mesh to the internal list of loaded meshes.
35 /** Usually, ISceneManager::getMesh() is called to load a mesh 35 /** Usually, ISceneManager::getMesh() is called to load a mesh
36 from a file. That method searches the list of loaded meshes if 36 from a file. That method searches the list of loaded meshes if
37 a mesh has already been loaded and returns a pointer to if it 37 a mesh has already been loaded and returns a pointer to if it
38 is in that list and already in memory. Otherwise it loads the 38 is in that list and already in memory. Otherwise it loads the
39 mesh. With IMeshCache::addMesh(), it is possible to pretend 39 mesh. With IMeshCache::addMesh(), it is possible to pretend
40 that a mesh already has been loaded. This method can be used 40 that a mesh already has been loaded. This method can be used
41 for example by mesh loaders who need to load more than one mesh 41 for example by mesh loaders who need to load more than one mesh
42 with one call. They can add additional meshes with this method 42 with one call. They can add additional meshes with this method
43 to the scene manager. The COLLADA loader for example uses this 43 to the scene manager. The COLLADA loader for example uses this
44 method. 44 method.
45 \param name Name of the mesh. When calling 45 \param name Name of the mesh. When calling
46 ISceneManager::getMesh() with this name it will return the mesh 46 ISceneManager::getMesh() with this name it will return the mesh
47 set by this method. 47 set by this method.
48 \param mesh Pointer to a mesh which will now be referenced by 48 \param mesh Pointer to a mesh which will now be referenced by
49 this name. */ 49 this name. */
50 virtual void addMesh(const io::path& name, IAnimatedMesh* mesh) = 0; 50 virtual void addMesh(const io::path& name, IAnimatedMesh* mesh) = 0;
51 51
52 //! Removes the mesh from the cache. 52 //! Removes the mesh from the cache.
53 /** After loading a mesh with getMesh(), the mesh can be 53 /** After loading a mesh with getMesh(), the mesh can be
54 removed from the cache using this method, freeing a lot of 54 removed from the cache using this method, freeing a lot of
55 memory. 55 memory.
56 \param mesh Pointer to the mesh which shall be removed. */ 56 \param mesh Pointer to the mesh which shall be removed. */
57 virtual void removeMesh(const IMesh* const mesh) = 0; 57 virtual void removeMesh(const IMesh* const mesh) = 0;
58 58
59 //! Returns amount of loaded meshes in the cache. 59 //! Returns amount of loaded meshes in the cache.
60 /** You can load new meshes into the cache using getMesh() and 60 /** You can load new meshes into the cache using getMesh() and
61 addMesh(). If you ever need to access the internal mesh cache, 61 addMesh(). If you ever need to access the internal mesh cache,
62 you can do this using removeMesh(), getMeshNumber(), 62 you can do this using removeMesh(), getMeshNumber(),
63 getMeshByIndex() and getMeshName(). 63 getMeshByIndex() and getMeshName().
64 \return Number of meshes in cache. */ 64 \return Number of meshes in cache. */
65 virtual u32 getMeshCount() const = 0; 65 virtual u32 getMeshCount() const = 0;
66 66
67 //! Returns current index number of the mesh or -1 when not found. 67 //! Returns current index number of the mesh or -1 when not found.
68 /** \param mesh Pointer to the mesh to search for. 68 /** \param mesh Pointer to the mesh to search for.
69 \return Index of the mesh in the cache, or -1 if not found. */ 69 \return Index of the mesh in the cache, or -1 if not found. */
70 virtual s32 getMeshIndex(const IMesh* const mesh) const = 0; 70 virtual s32 getMeshIndex(const IMesh* const mesh) const = 0;
71 71
72 //! Returns a mesh based on its index number. 72 //! Returns a mesh based on its index number.
73 /** \param index: Index of the mesh, number between 0 and 73 /** \param index: Index of the mesh, number between 0 and
74 getMeshCount()-1. 74 getMeshCount()-1.
75 Note that this number is only valid until a new mesh is loaded 75 Note that this number is only valid until a new mesh is loaded
76 or removed. 76 or removed.
77 \return Pointer to the mesh or 0 if there is none with this 77 \return Pointer to the mesh or 0 if there is none with this
78 number. */ 78 number. */
79 virtual IAnimatedMesh* getMeshByIndex(u32 index) = 0; 79 virtual IAnimatedMesh* getMeshByIndex(u32 index) = 0;
80 80
81 //! Returns a mesh based on its name (often a filename). 81 //! Returns a mesh based on its name (often a filename).
82 /** \deprecated Use getMeshByName() instead. This method may be removed by 82 /** \deprecated Use getMeshByName() instead. This method may be removed by
83 Irrlicht 1.9 */ 83 Irrlicht 1.9 */
84 _IRR_DEPRECATED_ IAnimatedMesh* getMeshByFilename(const io::path& filename) 84 _IRR_DEPRECATED_ IAnimatedMesh* getMeshByFilename(const io::path& filename)
85 { 85 {
86 return getMeshByName(filename); 86 return getMeshByName(filename);
87 } 87 }
88 88
89 //! Get the name of a loaded mesh, based on its index. (Name is often identical to the filename). 89 //! Get the name of a loaded mesh, based on its index. (Name is often identical to the filename).
90 /** \deprecated Use getMeshName() instead. This method may be removed by 90 /** \deprecated Use getMeshName() instead. This method may be removed by
91 Irrlicht 1.9 */ 91 Irrlicht 1.9 */
92 _IRR_DEPRECATED_ const io::path& getMeshFilename(u32 index) const 92 _IRR_DEPRECATED_ const io::path& getMeshFilename(u32 index) const
93 { 93 {
94 return getMeshName(index).getInternalName(); 94 return getMeshName(index).getInternalName();
95 } 95 }
96 96
97 //! Get the name of a loaded mesh, if there is any. (Name is often identical to the filename). 97 //! Get the name of a loaded mesh, if there is any. (Name is often identical to the filename).
98 /** \deprecated Use getMeshName() instead. This method may be removed by 98 /** \deprecated Use getMeshName() instead. This method may be removed by
99 Irrlicht 1.9 */ 99 Irrlicht 1.9 */
100 _IRR_DEPRECATED_ const io::path& getMeshFilename(const IMesh* const mesh) const 100 _IRR_DEPRECATED_ const io::path& getMeshFilename(const IMesh* const mesh) const
101 { 101 {
102 return getMeshName(mesh).getInternalName(); 102 return getMeshName(mesh).getInternalName();
103 } 103 }
104 104
105 //! Renames a loaded mesh. 105 //! Renames a loaded mesh.
106 /** \deprecated Use renameMesh() instead. This method may be removed by 106 /** \deprecated Use renameMesh() instead. This method may be removed by
107 Irrlicht 1.9 */ 107 Irrlicht 1.9 */
108 _IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename) 108 _IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename)
109 { 109 {
110 return renameMesh(index, filename); 110 return renameMesh(index, filename);
111 } 111 }
112 112
113 //! Renames a loaded mesh. 113 //! Renames a loaded mesh.
114 /** \deprecated Use renameMesh() instead. This method may be removed by 114 /** \deprecated Use renameMesh() instead. This method may be removed by
115 Irrlicht 1.9 */ 115 Irrlicht 1.9 */
116 _IRR_DEPRECATED_ bool setMeshFilename(const IMesh* const mesh, const io::path& filename) 116 _IRR_DEPRECATED_ bool setMeshFilename(const IMesh* const mesh, const io::path& filename)
117 { 117 {
118 return renameMesh(mesh, filename); 118 return renameMesh(mesh, filename);
119 } 119 }
120 120
121 //! Returns a mesh based on its name. 121 //! Returns a mesh based on its name.
122 /** \param name Name of the mesh. Usually a filename. 122 /** \param name Name of the mesh. Usually a filename.
123 \return Pointer to the mesh or 0 if there is none with this number. */ 123 \return Pointer to the mesh or 0 if there is none with this number. */
124 virtual IAnimatedMesh* getMeshByName(const io::path& name) = 0; 124 virtual IAnimatedMesh* getMeshByName(const io::path& name) = 0;
125 125
126 //! Get the name of a loaded mesh, based on its index. 126 //! Get the name of a loaded mesh, based on its index.
127 /** \param index: Index of the mesh, number between 0 and getMeshCount()-1. 127 /** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
128 \return The name if mesh was found and has a name, else the path is empty. */ 128 \return The name if mesh was found and has a name, else the path is empty. */
129 virtual const io::SNamedPath& getMeshName(u32 index) const = 0; 129 virtual const io::SNamedPath& getMeshName(u32 index) const = 0;
130 130
131 //! Get the name of the loaded mesh if there is any. 131 //! Get the name of the loaded mesh if there is any.
132 /** \param mesh Pointer to mesh to query. 132 /** \param mesh Pointer to mesh to query.
133 \return The name if mesh was found and has a name, else the path is empty. */ 133 \return The name if mesh was found and has a name, else the path is empty. */
134 virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0; 134 virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const = 0;
135 135
136 //! Renames a loaded mesh. 136 //! Renames a loaded mesh.
137 /** Note that renaming meshes might change the ordering of the 137 /** Note that renaming meshes might change the ordering of the
138 meshes, and so the index of the meshes as returned by 138 meshes, and so the index of the meshes as returned by
139 getMeshIndex() or taken by some methods will change. 139 getMeshIndex() or taken by some methods will change.
140 \param index The index of the mesh in the cache. 140 \param index The index of the mesh in the cache.
141 \param name New name for the mesh. 141 \param name New name for the mesh.
142 \return True if mesh was renamed. */ 142 \return True if mesh was renamed. */
143 virtual bool renameMesh(u32 index, const io::path& name) = 0; 143 virtual bool renameMesh(u32 index, const io::path& name) = 0;
144 144
145 //! Renames the loaded mesh 145 //! Renames the loaded mesh
146 /** Note that renaming meshes might change the ordering of the 146 /** Note that renaming meshes might change the ordering of the
147 meshes, and so the index of the meshes as returned by 147 meshes, and so the index of the meshes as returned by
148 getMeshIndex() or taken by some methods will change. 148 getMeshIndex() or taken by some methods will change.
149 \param mesh Mesh to be renamed. 149 \param mesh Mesh to be renamed.
150 \param name New name for the mesh. 150 \param name New name for the mesh.
151 \return True if mesh was renamed. */ 151 \return True if mesh was renamed. */
152 virtual bool renameMesh(const IMesh* const mesh, const io::path& name) = 0; 152 virtual bool renameMesh(const IMesh* const mesh, const io::path& name) = 0;
153 153
154 //! Check if a mesh was already loaded. 154 //! Check if a mesh was already loaded.
155 /** \param name Name of the mesh. Usually a filename. 155 /** \param name Name of the mesh. Usually a filename.
156 \return True if the mesh has been loaded, else false. */ 156 \return True if the mesh has been loaded, else false. */
157 virtual bool isMeshLoaded(const io::path& name) = 0; 157 virtual bool isMeshLoaded(const io::path& name) = 0;
158 158
159 //! Clears the whole mesh cache, removing all meshes. 159 //! Clears the whole mesh cache, removing all meshes.
160 /** All meshes will be reloaded completely when using ISceneManager::getMesh() 160 /** All meshes will be reloaded completely when using ISceneManager::getMesh()
161 after calling this method. 161 after calling this method.
162 Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh() 162 Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh()
163 and you did not grab them, then they may become invalid. */ 163 and you did not grab them, then they may become invalid. */
164 virtual void clear() = 0; 164 virtual void clear() = 0;
165 165
166 //! Clears all meshes that are held in the mesh cache but not used anywhere else. 166 //! Clears all meshes that are held in the mesh cache but not used anywhere else.
167 /** Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh() 167 /** Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh()
168 and you did not grab them, then they may become invalid. */ 168 and you did not grab them, then they may become invalid. */
169 virtual void clearUnusedMeshes() = 0; 169 virtual void clearUnusedMeshes() = 0;
170 }; 170 };
171 171
172 172
173} // end namespace scene 173} // end namespace scene
174} // end namespace irr 174} // end namespace irr
175 175
176#endif 176#endif
177 177
diff --git a/libraries/irrlicht-1.8/include/IMeshLoader.h b/libraries/irrlicht-1.8/include/IMeshLoader.h
index 7f874c0..3955fb4 100644
--- a/libraries/irrlicht-1.8/include/IMeshLoader.h
+++ b/libraries/irrlicht-1.8/include/IMeshLoader.h
@@ -1,53 +1,53 @@
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#ifndef __I_MESH_LOADER_H_INCLUDED__ 5#ifndef __I_MESH_LOADER_H_INCLUDED__
6#define __I_MESH_LOADER_H_INCLUDED__ 6#define __I_MESH_LOADER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "path.h" 9#include "path.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace io 13namespace io
14{ 14{
15 class IReadFile; 15 class IReadFile;
16} // end namespace io 16} // end namespace io
17namespace scene 17namespace scene
18{ 18{
19 class IAnimatedMesh; 19 class IAnimatedMesh;
20 20
21//! Class which is able to load an animated mesh from a file. 21//! Class which is able to load an animated mesh from a file.
22/** If you want Irrlicht be able to load meshes of 22/** If you want Irrlicht be able to load meshes of
23currently unsupported file formats (e.g. .cob), then implement 23currently unsupported file formats (e.g. .cob), then implement
24this and add your new Meshloader with 24this and add your new Meshloader with
25ISceneManager::addExternalMeshLoader() to the engine. */ 25ISceneManager::addExternalMeshLoader() to the engine. */
26class IMeshLoader : public virtual IReferenceCounted 26class IMeshLoader : public virtual IReferenceCounted
27{ 27{
28public: 28public:
29 29
30 //! Destructor 30 //! Destructor
31 virtual ~IMeshLoader() {} 31 virtual ~IMeshLoader() {}
32 32
33 //! Returns true if the file might be loaded by this class. 33 //! Returns true if the file might be loaded by this class.
34 /** This decision should be based on the file extension (e.g. ".cob") 34 /** This decision should be based on the file extension (e.g. ".cob")
35 only. 35 only.
36 \param filename Name of the file to test. 36 \param filename Name of the file to test.
37 \return True if the file might be loaded by this class. */ 37 \return True if the file might be loaded by this class. */
38 virtual bool isALoadableFileExtension(const io::path& filename) const = 0; 38 virtual bool isALoadableFileExtension(const io::path& filename) const = 0;
39 39
40 //! Creates/loads an animated mesh from the file. 40 //! Creates/loads an animated mesh from the file.
41 /** \param file File handler to load the file from. 41 /** \param file File handler to load the file from.
42 \return Pointer to the created mesh. Returns 0 if loading failed. 42 \return Pointer to the created mesh. Returns 0 if loading failed.
43 If you no longer need the mesh, you should call IAnimatedMesh::drop(). 43 If you no longer need the mesh, you should call IAnimatedMesh::drop().
44 See IReferenceCounted::drop() for more information. */ 44 See IReferenceCounted::drop() for more information. */
45 virtual IAnimatedMesh* createMesh(io::IReadFile* file) = 0; 45 virtual IAnimatedMesh* createMesh(io::IReadFile* file) = 0;
46}; 46};
47 47
48 48
49} // end namespace scene 49} // end namespace scene
50} // end namespace irr 50} // end namespace irr
51 51
52#endif 52#endif
53 53
diff --git a/libraries/irrlicht-1.8/include/IMeshManipulator.h b/libraries/irrlicht-1.8/include/IMeshManipulator.h
index 3476c57..d6ac89f 100644
--- a/libraries/irrlicht-1.8/include/IMeshManipulator.h
+++ b/libraries/irrlicht-1.8/include/IMeshManipulator.h
@@ -1,393 +1,393 @@
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#ifndef __I_MESH_MANIPULATOR_H_INCLUDED__ 5#ifndef __I_MESH_MANIPULATOR_H_INCLUDED__
6#define __I_MESH_MANIPULATOR_H_INCLUDED__ 6#define __I_MESH_MANIPULATOR_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "vector3d.h" 9#include "vector3d.h"
10#include "aabbox3d.h" 10#include "aabbox3d.h"
11#include "matrix4.h" 11#include "matrix4.h"
12#include "IAnimatedMesh.h" 12#include "IAnimatedMesh.h"
13#include "IMeshBuffer.h" 13#include "IMeshBuffer.h"
14#include "SVertexManipulator.h" 14#include "SVertexManipulator.h"
15 15
16namespace irr 16namespace irr
17{ 17{
18namespace scene 18namespace scene
19{ 19{
20 20
21 struct SMesh; 21 struct SMesh;
22 22
23 //! An interface for easy manipulation of meshes. 23 //! An interface for easy manipulation of meshes.
24 /** Scale, set alpha value, flip surfaces, and so on. This exists for 24 /** Scale, set alpha value, flip surfaces, and so on. This exists for
25 fixing problems with wrong imported or exported meshes quickly after 25 fixing problems with wrong imported or exported meshes quickly after
26 loading. It is not intended for doing mesh modifications and/or 26 loading. It is not intended for doing mesh modifications and/or
27 animations during runtime. 27 animations during runtime.
28 */ 28 */
29 class IMeshManipulator : public virtual IReferenceCounted 29 class IMeshManipulator : public virtual IReferenceCounted
30 { 30 {
31 public: 31 public:
32 32
33 //! Flips the direction of surfaces. 33 //! Flips the direction of surfaces.
34 /** Changes backfacing triangles to frontfacing 34 /** Changes backfacing triangles to frontfacing
35 triangles and vice versa. 35 triangles and vice versa.
36 \param mesh Mesh on which the operation is performed. */ 36 \param mesh Mesh on which the operation is performed. */
37 virtual void flipSurfaces(IMesh* mesh) const = 0; 37 virtual void flipSurfaces(IMesh* mesh) const = 0;
38 38
39 //! Sets the alpha vertex color value of the whole mesh to a new value. 39 //! Sets the alpha vertex color value of the whole mesh to a new value.
40 /** \param mesh Mesh on which the operation is performed. 40 /** \param mesh Mesh on which the operation is performed.
41 \param alpha New alpha value. Must be a value between 0 and 255. */ 41 \param alpha New alpha value. Must be a value between 0 and 255. */
42 void setVertexColorAlpha(IMesh* mesh, s32 alpha) const 42 void setVertexColorAlpha(IMesh* mesh, s32 alpha) const
43 { 43 {
44 apply(scene::SVertexColorSetAlphaManipulator(alpha), mesh); 44 apply(scene::SVertexColorSetAlphaManipulator(alpha), mesh);
45 } 45 }
46 46
47 //! Sets the alpha vertex color value of the whole mesh to a new value. 47 //! Sets the alpha vertex color value of the whole mesh to a new value.
48 /** \param buffer Meshbuffer on which the operation is performed. 48 /** \param buffer Meshbuffer on which the operation is performed.
49 \param alpha New alpha value. Must be a value between 0 and 255. */ 49 \param alpha New alpha value. Must be a value between 0 and 255. */
50 void setVertexColorAlpha(IMeshBuffer* buffer, s32 alpha) const 50 void setVertexColorAlpha(IMeshBuffer* buffer, s32 alpha) const
51 { 51 {
52 apply(scene::SVertexColorSetAlphaManipulator(alpha), buffer); 52 apply(scene::SVertexColorSetAlphaManipulator(alpha), buffer);
53 } 53 }
54 54
55 //! Sets the colors of all vertices to one color 55 //! Sets the colors of all vertices to one color
56 /** \param mesh Mesh on which the operation is performed. 56 /** \param mesh Mesh on which the operation is performed.
57 \param color New color. */ 57 \param color New color. */
58 void setVertexColors(IMesh* mesh, video::SColor color) const 58 void setVertexColors(IMesh* mesh, video::SColor color) const
59 { 59 {
60 apply(scene::SVertexColorSetManipulator(color), mesh); 60 apply(scene::SVertexColorSetManipulator(color), mesh);
61 } 61 }
62 62
63 //! Sets the colors of all vertices to one color 63 //! Sets the colors of all vertices to one color
64 /** \param buffer Meshbuffer on which the operation is performed. 64 /** \param buffer Meshbuffer on which the operation is performed.
65 \param color New color. */ 65 \param color New color. */
66 void setVertexColors(IMeshBuffer* buffer, video::SColor color) const 66 void setVertexColors(IMeshBuffer* buffer, video::SColor color) const
67 { 67 {
68 apply(scene::SVertexColorSetManipulator(color), buffer); 68 apply(scene::SVertexColorSetManipulator(color), buffer);
69 } 69 }
70 70
71 //! Recalculates all normals of the mesh. 71 //! Recalculates all normals of the mesh.
72 /** \param mesh: Mesh on which the operation is performed. 72 /** \param mesh: Mesh on which the operation is performed.
73 \param smooth: If the normals shall be smoothed. 73 \param smooth: If the normals shall be smoothed.
74 \param angleWeighted: If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision. */ 74 \param angleWeighted: If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision. */
75 virtual void recalculateNormals(IMesh* mesh, bool smooth = false, 75 virtual void recalculateNormals(IMesh* mesh, bool smooth = false,
76 bool angleWeighted = false) const=0; 76 bool angleWeighted = false) const=0;
77 77
78 //! Recalculates all normals of the mesh buffer. 78 //! Recalculates all normals of the mesh buffer.
79 /** \param buffer: Mesh buffer on which the operation is performed. 79 /** \param buffer: Mesh buffer on which the operation is performed.
80 \param smooth: If the normals shall be smoothed. 80 \param smooth: If the normals shall be smoothed.
81 \param angleWeighted: If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision. */ 81 \param angleWeighted: If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision. */
82 virtual void recalculateNormals(IMeshBuffer* buffer, 82 virtual void recalculateNormals(IMeshBuffer* buffer,
83 bool smooth = false, bool angleWeighted = false) const=0; 83 bool smooth = false, bool angleWeighted = false) const=0;
84 84
85 //! Recalculates tangents, requires a tangent mesh 85 //! Recalculates tangents, requires a tangent mesh
86 /** \param mesh Mesh on which the operation is performed. 86 /** \param mesh Mesh on which the operation is performed.
87 \param recalculateNormals If the normals shall be recalculated, otherwise original normals of the mesh are used unchanged. 87 \param recalculateNormals If the normals shall be recalculated, otherwise original normals of the mesh are used unchanged.
88 \param smooth If the normals shall be smoothed. 88 \param smooth If the normals shall be smoothed.
89 \param angleWeighted If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision. 89 \param angleWeighted If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision.
90 */ 90 */
91 virtual void recalculateTangents(IMesh* mesh, 91 virtual void recalculateTangents(IMesh* mesh,
92 bool recalculateNormals=false, bool smooth=false, 92 bool recalculateNormals=false, bool smooth=false,
93 bool angleWeighted=false) const=0; 93 bool angleWeighted=false) const=0;
94 94
95 //! Recalculates tangents, requires a tangent mesh buffer 95 //! Recalculates tangents, requires a tangent mesh buffer
96 /** \param buffer Meshbuffer on which the operation is performed. 96 /** \param buffer Meshbuffer on which the operation is performed.
97 \param recalculateNormals If the normals shall be recalculated, otherwise original normals of the buffer are used unchanged. 97 \param recalculateNormals If the normals shall be recalculated, otherwise original normals of the buffer are used unchanged.
98 \param smooth If the normals shall be smoothed. 98 \param smooth If the normals shall be smoothed.
99 \param angleWeighted If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision. 99 \param angleWeighted If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision.
100 */ 100 */
101 virtual void recalculateTangents(IMeshBuffer* buffer, 101 virtual void recalculateTangents(IMeshBuffer* buffer,
102 bool recalculateNormals=false, bool smooth=false, 102 bool recalculateNormals=false, bool smooth=false,
103 bool angleWeighted=false) const=0; 103 bool angleWeighted=false) const=0;
104 104
105 //! Scales the actual mesh, not a scene node. 105 //! Scales the actual mesh, not a scene node.
106 /** \param mesh Mesh on which the operation is performed. 106 /** \param mesh Mesh on which the operation is performed.
107 \param factor Scale factor for each axis. */ 107 \param factor Scale factor for each axis. */
108 void scale(IMesh* mesh, const core::vector3df& factor) const 108 void scale(IMesh* mesh, const core::vector3df& factor) const
109 { 109 {
110 apply(SVertexPositionScaleManipulator(factor), mesh, true); 110 apply(SVertexPositionScaleManipulator(factor), mesh, true);
111 } 111 }
112 112
113 //! Scales the actual meshbuffer, not a scene node. 113 //! Scales the actual meshbuffer, not a scene node.
114 /** \param buffer Meshbuffer on which the operation is performed. 114 /** \param buffer Meshbuffer on which the operation is performed.
115 \param factor Scale factor for each axis. */ 115 \param factor Scale factor for each axis. */
116 void scale(IMeshBuffer* buffer, const core::vector3df& factor) const 116 void scale(IMeshBuffer* buffer, const core::vector3df& factor) const
117 { 117 {
118 apply(SVertexPositionScaleManipulator(factor), buffer, true); 118 apply(SVertexPositionScaleManipulator(factor), buffer, true);
119 } 119 }
120 120
121 //! Scales the actual mesh, not a scene node. 121 //! Scales the actual mesh, not a scene node.
122 /** \deprecated Use scale() instead. This method may be removed by Irrlicht 1.9 122 /** \deprecated Use scale() instead. This method may be removed by Irrlicht 1.9
123 \param mesh Mesh on which the operation is performed. 123 \param mesh Mesh on which the operation is performed.
124 \param factor Scale factor for each axis. */ 124 \param factor Scale factor for each axis. */
125 _IRR_DEPRECATED_ void scaleMesh(IMesh* mesh, const core::vector3df& factor) const {return scale(mesh,factor);} 125 _IRR_DEPRECATED_ void scaleMesh(IMesh* mesh, const core::vector3df& factor) const {return scale(mesh,factor);}
126 126
127 //! Scale the texture coords of a mesh. 127 //! Scale the texture coords of a mesh.
128 /** \param mesh Mesh on which the operation is performed. 128 /** \param mesh Mesh on which the operation is performed.
129 \param factor Vector which defines the scale for each axis. 129 \param factor Vector which defines the scale for each axis.
130 \param level Number of texture coord, starting from 1. Support for level 2 exists for LightMap buffers. */ 130 \param level Number of texture coord, starting from 1. Support for level 2 exists for LightMap buffers. */
131 void scaleTCoords(scene::IMesh* mesh, const core::vector2df& factor, u32 level=1) const 131 void scaleTCoords(scene::IMesh* mesh, const core::vector2df& factor, u32 level=1) const
132 { 132 {
133 apply(SVertexTCoordsScaleManipulator(factor, level), mesh); 133 apply(SVertexTCoordsScaleManipulator(factor, level), mesh);
134 } 134 }
135 135
136 //! Scale the texture coords of a meshbuffer. 136 //! Scale the texture coords of a meshbuffer.
137 /** \param buffer Meshbuffer on which the operation is performed. 137 /** \param buffer Meshbuffer on which the operation is performed.
138 \param factor Vector which defines the scale for each axis. 138 \param factor Vector which defines the scale for each axis.
139 \param level Number of texture coord, starting from 1. Support for level 2 exists for LightMap buffers. */ 139 \param level Number of texture coord, starting from 1. Support for level 2 exists for LightMap buffers. */
140 void scaleTCoords(scene::IMeshBuffer* buffer, const core::vector2df& factor, u32 level=1) const 140 void scaleTCoords(scene::IMeshBuffer* buffer, const core::vector2df& factor, u32 level=1) const
141 { 141 {
142 apply(SVertexTCoordsScaleManipulator(factor, level), buffer); 142 apply(SVertexTCoordsScaleManipulator(factor, level), buffer);
143 } 143 }
144 144
145 //! Applies a transformation to a mesh 145 //! Applies a transformation to a mesh
146 /** \param mesh Mesh on which the operation is performed. 146 /** \param mesh Mesh on which the operation is performed.
147 \param m transformation matrix. */ 147 \param m transformation matrix. */
148 void transform(IMesh* mesh, const core::matrix4& m) const 148 void transform(IMesh* mesh, const core::matrix4& m) const
149 { 149 {
150 apply(SVertexPositionTransformManipulator(m), mesh, true); 150 apply(SVertexPositionTransformManipulator(m), mesh, true);
151 } 151 }
152 152
153 //! Applies a transformation to a meshbuffer 153 //! Applies a transformation to a meshbuffer
154 /** \param buffer Meshbuffer on which the operation is performed. 154 /** \param buffer Meshbuffer on which the operation is performed.
155 \param m transformation matrix. */ 155 \param m transformation matrix. */
156 void transform(IMeshBuffer* buffer, const core::matrix4& m) const 156 void transform(IMeshBuffer* buffer, const core::matrix4& m) const
157 { 157 {
158 apply(SVertexPositionTransformManipulator(m), buffer, true); 158 apply(SVertexPositionTransformManipulator(m), buffer, true);
159 } 159 }
160 160
161 //! Applies a transformation to a mesh 161 //! Applies a transformation to a mesh
162 /** \deprecated Use transform() instead. This method may be removed by Irrlicht 1.9 162 /** \deprecated Use transform() instead. This method may be removed by Irrlicht 1.9
163 \param mesh Mesh on which the operation is performed. 163 \param mesh Mesh on which the operation is performed.
164 \param m transformation matrix. */ 164 \param m transformation matrix. */
165 _IRR_DEPRECATED_ virtual void transformMesh(IMesh* mesh, const core::matrix4& m) const {return transform(mesh,m);} 165 _IRR_DEPRECATED_ virtual void transformMesh(IMesh* mesh, const core::matrix4& m) const {return transform(mesh,m);}
166 166
167 //! Creates a planar texture mapping on the mesh 167 //! Creates a planar texture mapping on the mesh
168 /** \param mesh: Mesh on which the operation is performed. 168 /** \param mesh: Mesh on which the operation is performed.
169 \param resolution: resolution of the planar mapping. This is 169 \param resolution: resolution of the planar mapping. This is
170 the value specifying which is the relation between world space 170 the value specifying which is the relation between world space
171 and texture coordinate space. */ 171 and texture coordinate space. */
172 virtual void makePlanarTextureMapping(IMesh* mesh, f32 resolution=0.001f) const=0; 172 virtual void makePlanarTextureMapping(IMesh* mesh, f32 resolution=0.001f) const=0;
173 173
174 //! Creates a planar texture mapping on the meshbuffer 174 //! Creates a planar texture mapping on the meshbuffer
175 /** \param meshbuffer: Buffer on which the operation is performed. 175 /** \param meshbuffer: Buffer on which the operation is performed.
176 \param resolution: resolution of the planar mapping. This is 176 \param resolution: resolution of the planar mapping. This is
177 the value specifying which is the relation between world space 177 the value specifying which is the relation between world space
178 and texture coordinate space. */ 178 and texture coordinate space. */
179 virtual void makePlanarTextureMapping(scene::IMeshBuffer* meshbuffer, f32 resolution=0.001f) const=0; 179 virtual void makePlanarTextureMapping(scene::IMeshBuffer* meshbuffer, f32 resolution=0.001f) const=0;
180 180
181 //! Creates a planar texture mapping on the buffer 181 //! Creates a planar texture mapping on the buffer
182 /** This method is currently implemented towards the LWO planar mapping. A more general biasing might be required. 182 /** This method is currently implemented towards the LWO planar mapping. A more general biasing might be required.
183 \param mesh Mesh on which the operation is performed. 183 \param mesh Mesh on which the operation is performed.
184 \param resolutionS Resolution of the planar mapping in horizontal direction. This is the ratio between object space and texture space. 184 \param resolutionS Resolution of the planar mapping in horizontal direction. This is the ratio between object space and texture space.
185 \param resolutionT Resolution of the planar mapping in vertical direction. This is the ratio between object space and texture space. 185 \param resolutionT Resolution of the planar mapping in vertical direction. This is the ratio between object space and texture space.
186 \param axis The axis along which the texture is projected. The allowed values are 0 (X), 1(Y), and 2(Z). 186 \param axis The axis along which the texture is projected. The allowed values are 0 (X), 1(Y), and 2(Z).
187 \param offset Vector added to the vertex positions (in object coordinates). 187 \param offset Vector added to the vertex positions (in object coordinates).
188 */ 188 */
189 virtual void makePlanarTextureMapping(scene::IMesh* mesh, 189 virtual void makePlanarTextureMapping(scene::IMesh* mesh,
190 f32 resolutionS, f32 resolutionT, 190 f32 resolutionS, f32 resolutionT,
191 u8 axis, const core::vector3df& offset) const=0; 191 u8 axis, const core::vector3df& offset) const=0;
192 192
193 //! Creates a planar texture mapping on the meshbuffer 193 //! Creates a planar texture mapping on the meshbuffer
194 /** This method is currently implemented towards the LWO planar mapping. A more general biasing might be required. 194 /** This method is currently implemented towards the LWO planar mapping. A more general biasing might be required.
195 \param buffer Buffer on which the operation is performed. 195 \param buffer Buffer on which the operation is performed.
196 \param resolutionS Resolution of the planar mapping in horizontal direction. This is the ratio between object space and texture space. 196 \param resolutionS Resolution of the planar mapping in horizontal direction. This is the ratio between object space and texture space.
197 \param resolutionT Resolution of the planar mapping in vertical direction. This is the ratio between object space and texture space. 197 \param resolutionT Resolution of the planar mapping in vertical direction. This is the ratio between object space and texture space.
198 \param axis The axis along which the texture is projected. The allowed values are 0 (X), 1(Y), and 2(Z). 198 \param axis The axis along which the texture is projected. The allowed values are 0 (X), 1(Y), and 2(Z).
199 \param offset Vector added to the vertex positions (in object coordinates). 199 \param offset Vector added to the vertex positions (in object coordinates).
200 */ 200 */
201 virtual void makePlanarTextureMapping(scene::IMeshBuffer* buffer, 201 virtual void makePlanarTextureMapping(scene::IMeshBuffer* buffer,
202 f32 resolutionS, f32 resolutionT, 202 f32 resolutionS, f32 resolutionT,
203 u8 axis, const core::vector3df& offset) const=0; 203 u8 axis, const core::vector3df& offset) const=0;
204 204
205 //! Clones a static IMesh into a modifiable SMesh. 205 //! Clones a static IMesh into a modifiable SMesh.
206 /** All meshbuffers in the returned SMesh 206 /** All meshbuffers in the returned SMesh
207 are of type SMeshBuffer or SMeshBufferLightMap. 207 are of type SMeshBuffer or SMeshBufferLightMap.
208 \param mesh Mesh to copy. 208 \param mesh Mesh to copy.
209 \return Cloned mesh. If you no longer need the 209 \return Cloned mesh. If you no longer need the
210 cloned mesh, you should call SMesh::drop(). See 210 cloned mesh, you should call SMesh::drop(). See
211 IReferenceCounted::drop() for more information. */ 211 IReferenceCounted::drop() for more information. */
212 virtual SMesh* createMeshCopy(IMesh* mesh) const = 0; 212 virtual SMesh* createMeshCopy(IMesh* mesh) const = 0;
213 213
214 //! Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices. 214 //! Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices.
215 /** This is useful if you want to draw tangent space normal 215 /** This is useful if you want to draw tangent space normal
216 mapped geometry because it calculates the tangent and binormal 216 mapped geometry because it calculates the tangent and binormal
217 data which is needed there. 217 data which is needed there.
218 \param mesh Input mesh 218 \param mesh Input mesh
219 \param recalculateNormals The normals are recalculated if set, 219 \param recalculateNormals The normals are recalculated if set,
220 otherwise the original ones are kept. Note that keeping the 220 otherwise the original ones are kept. Note that keeping the
221 normals may introduce inaccurate tangents if the normals are 221 normals may introduce inaccurate tangents if the normals are
222 very different to those calculated from the faces. 222 very different to those calculated from the faces.
223 \param smooth The normals/tangents are smoothed across the 223 \param smooth The normals/tangents are smoothed across the
224 meshbuffer's faces if this flag is set. 224 meshbuffer's faces if this flag is set.
225 \param angleWeighted Improved smoothing calculation used 225 \param angleWeighted Improved smoothing calculation used
226 \param recalculateTangents Whether are actually calculated, or just the mesh with proper type is created. 226 \param recalculateTangents Whether are actually calculated, or just the mesh with proper type is created.
227 \return Mesh consisting only of S3DVertexTangents vertices. If 227 \return Mesh consisting only of S3DVertexTangents vertices. If
228 you no longer need the cloned mesh, you should call 228 you no longer need the cloned mesh, you should call
229 IMesh::drop(). See IReferenceCounted::drop() for more 229 IMesh::drop(). See IReferenceCounted::drop() for more
230 information. */ 230 information. */
231 virtual IMesh* createMeshWithTangents(IMesh* mesh, 231 virtual IMesh* createMeshWithTangents(IMesh* mesh,
232 bool recalculateNormals=false, bool smooth=false, 232 bool recalculateNormals=false, bool smooth=false,
233 bool angleWeighted=false, bool recalculateTangents=true) const=0; 233 bool angleWeighted=false, bool recalculateTangents=true) const=0;
234 234
235 //! Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices. 235 //! Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices.
236 /** \param mesh Input mesh 236 /** \param mesh Input mesh
237 \return Mesh consisting only of S3DVertex2TCoord vertices. If 237 \return Mesh consisting only of S3DVertex2TCoord vertices. If
238 you no longer need the cloned mesh, you should call 238 you no longer need the cloned mesh, you should call
239 IMesh::drop(). See IReferenceCounted::drop() for more 239 IMesh::drop(). See IReferenceCounted::drop() for more
240 information. */ 240 information. */
241 virtual IMesh* createMeshWith2TCoords(IMesh* mesh) const = 0; 241 virtual IMesh* createMeshWith2TCoords(IMesh* mesh) const = 0;
242 242
243 //! Creates a copy of the mesh, which will only consist of S3DVertex vertices. 243 //! Creates a copy of the mesh, which will only consist of S3DVertex vertices.
244 /** \param mesh Input mesh 244 /** \param mesh Input mesh
245 \return Mesh consisting only of S3DVertex vertices. If 245 \return Mesh consisting only of S3DVertex vertices. If
246 you no longer need the cloned mesh, you should call 246 you no longer need the cloned mesh, you should call
247 IMesh::drop(). See IReferenceCounted::drop() for more 247 IMesh::drop(). See IReferenceCounted::drop() for more
248 information. */ 248 information. */
249 virtual IMesh* createMeshWith1TCoords(IMesh* mesh) const = 0; 249 virtual IMesh* createMeshWith1TCoords(IMesh* mesh) const = 0;
250 250
251 //! Creates a copy of a mesh with all vertices unwelded 251 //! Creates a copy of a mesh with all vertices unwelded
252 /** \param mesh Input mesh 252 /** \param mesh Input mesh
253 \return Mesh consisting only of unique faces. All vertices 253 \return Mesh consisting only of unique faces. All vertices
254 which were previously shared are now duplicated. If you no 254 which were previously shared are now duplicated. If you no
255 longer need the cloned mesh, you should call IMesh::drop(). See 255 longer need the cloned mesh, you should call IMesh::drop(). See
256 IReferenceCounted::drop() for more information. */ 256 IReferenceCounted::drop() for more information. */
257 virtual IMesh* createMeshUniquePrimitives(IMesh* mesh) const = 0; 257 virtual IMesh* createMeshUniquePrimitives(IMesh* mesh) const = 0;
258 258
259 //! Creates a copy of a mesh with vertices welded 259 //! Creates a copy of a mesh with vertices welded
260 /** \param mesh Input mesh 260 /** \param mesh Input mesh
261 \param tolerance The threshold for vertex comparisons. 261 \param tolerance The threshold for vertex comparisons.
262 \return Mesh without redundant vertices. If you no longer need 262 \return Mesh without redundant vertices. If you no longer need
263 the cloned mesh, you should call IMesh::drop(). See 263 the cloned mesh, you should call IMesh::drop(). See
264 IReferenceCounted::drop() for more information. */ 264 IReferenceCounted::drop() for more information. */
265 virtual IMesh* createMeshWelded(IMesh* mesh, f32 tolerance=core::ROUNDING_ERROR_f32) const = 0; 265 virtual IMesh* createMeshWelded(IMesh* mesh, f32 tolerance=core::ROUNDING_ERROR_f32) const = 0;
266 266
267 //! Get amount of polygons in mesh. 267 //! Get amount of polygons in mesh.
268 /** \param mesh Input mesh 268 /** \param mesh Input mesh
269 \return Number of polygons in mesh. */ 269 \return Number of polygons in mesh. */
270 virtual s32 getPolyCount(IMesh* mesh) const = 0; 270 virtual s32 getPolyCount(IMesh* mesh) const = 0;
271 271
272 //! Get amount of polygons in mesh. 272 //! Get amount of polygons in mesh.
273 /** \param mesh Input mesh 273 /** \param mesh Input mesh
274 \return Number of polygons in mesh. */ 274 \return Number of polygons in mesh. */
275 virtual s32 getPolyCount(IAnimatedMesh* mesh) const = 0; 275 virtual s32 getPolyCount(IAnimatedMesh* mesh) const = 0;
276 276
277 //! Create a new AnimatedMesh and adds the mesh to it 277 //! Create a new AnimatedMesh and adds the mesh to it
278 /** \param mesh Input mesh 278 /** \param mesh Input mesh
279 \param type The type of the animated mesh to create. 279 \param type The type of the animated mesh to create.
280 \return Newly created animated mesh with mesh as its only 280 \return Newly created animated mesh with mesh as its only
281 content. When you don't need the animated mesh anymore, you 281 content. When you don't need the animated mesh anymore, you
282 should call IAnimatedMesh::drop(). See 282 should call IAnimatedMesh::drop(). See
283 IReferenceCounted::drop() for more information. */ 283 IReferenceCounted::drop() for more information. */
284 virtual IAnimatedMesh * createAnimatedMesh(IMesh* mesh, 284 virtual IAnimatedMesh * createAnimatedMesh(IMesh* mesh,
285 scene::E_ANIMATED_MESH_TYPE type = scene::EAMT_UNKNOWN) const = 0; 285 scene::E_ANIMATED_MESH_TYPE type = scene::EAMT_UNKNOWN) const = 0;
286 286
287 //! Vertex cache optimization according to the Forsyth paper 287 //! Vertex cache optimization according to the Forsyth paper
288 /** More information can be found at 288 /** More information can be found at
289 http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html 289 http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html
290 290
291 The function is thread-safe (read: you can optimize several 291 The function is thread-safe (read: you can optimize several
292 meshes in different threads). 292 meshes in different threads).
293 293
294 \param mesh Source mesh for the operation. 294 \param mesh Source mesh for the operation.
295 \return A new mesh optimized for the vertex cache. */ 295 \return A new mesh optimized for the vertex cache. */
296 virtual IMesh* createForsythOptimizedMesh(const IMesh *mesh) const = 0; 296 virtual IMesh* createForsythOptimizedMesh(const IMesh *mesh) const = 0;
297 297
298 //! Apply a manipulator on the Meshbuffer 298 //! Apply a manipulator on the Meshbuffer
299 /** \param func A functor defining the mesh manipulation. 299 /** \param func A functor defining the mesh manipulation.
300 \param buffer The Meshbuffer to apply the manipulator to. 300 \param buffer The Meshbuffer to apply the manipulator to.
301 \param boundingBoxUpdate Specifies if the bounding box should be updated during manipulation. 301 \param boundingBoxUpdate Specifies if the bounding box should be updated during manipulation.
302 \return True if the functor was successfully applied, else false. */ 302 \return True if the functor was successfully applied, else false. */
303 template <typename Functor> 303 template <typename Functor>
304 bool apply(const Functor& func, IMeshBuffer* buffer, bool boundingBoxUpdate=false) const 304 bool apply(const Functor& func, IMeshBuffer* buffer, bool boundingBoxUpdate=false) const
305 { 305 {
306 return apply_(func, buffer, boundingBoxUpdate, func); 306 return apply_(func, buffer, boundingBoxUpdate, func);
307 } 307 }
308 308
309 309
310 //! Apply a manipulator on the Mesh 310 //! Apply a manipulator on the Mesh
311 /** \param func A functor defining the mesh manipulation. 311 /** \param func A functor defining the mesh manipulation.
312 \param mesh The Mesh to apply the manipulator to. 312 \param mesh The Mesh to apply the manipulator to.
313 \param boundingBoxUpdate Specifies if the bounding box should be updated during manipulation. 313 \param boundingBoxUpdate Specifies if the bounding box should be updated during manipulation.
314 \return True if the functor was successfully applied, else false. */ 314 \return True if the functor was successfully applied, else false. */
315 template <typename Functor> 315 template <typename Functor>
316 bool apply(const Functor& func, IMesh* mesh, bool boundingBoxUpdate=false) const 316 bool apply(const Functor& func, IMesh* mesh, bool boundingBoxUpdate=false) const
317 { 317 {
318 if (!mesh) 318 if (!mesh)
319 return true; 319 return true;
320 bool result = true; 320 bool result = true;
321 core::aabbox3df bufferbox; 321 core::aabbox3df bufferbox;
322 for (u32 i=0; i<mesh->getMeshBufferCount(); ++i) 322 for (u32 i=0; i<mesh->getMeshBufferCount(); ++i)
323 { 323 {
324 result &= apply(func, mesh->getMeshBuffer(i), boundingBoxUpdate); 324 result &= apply(func, mesh->getMeshBuffer(i), boundingBoxUpdate);
325 if (boundingBoxUpdate) 325 if (boundingBoxUpdate)
326 { 326 {
327 if (0==i) 327 if (0==i)
328 bufferbox.reset(mesh->getMeshBuffer(i)->getBoundingBox()); 328 bufferbox.reset(mesh->getMeshBuffer(i)->getBoundingBox());
329 else 329 else
330 bufferbox.addInternalBox(mesh->getMeshBuffer(i)->getBoundingBox()); 330 bufferbox.addInternalBox(mesh->getMeshBuffer(i)->getBoundingBox());
331 } 331 }
332 } 332 }
333 if (boundingBoxUpdate) 333 if (boundingBoxUpdate)
334 mesh->setBoundingBox(bufferbox); 334 mesh->setBoundingBox(bufferbox);
335 return result; 335 return result;
336 } 336 }
337 337
338protected: 338protected:
339 //! Apply a manipulator based on the type of the functor 339 //! Apply a manipulator based on the type of the functor
340 /** \param func A functor defining the mesh manipulation. 340 /** \param func A functor defining the mesh manipulation.
341 \param buffer The Meshbuffer to apply the manipulator to. 341 \param buffer The Meshbuffer to apply the manipulator to.
342 \param boundingBoxUpdate Specifies if the bounding box should be updated during manipulation. 342 \param boundingBoxUpdate Specifies if the bounding box should be updated during manipulation.
343 \param typeTest Unused parameter, which handles the proper call selection based on the type of the Functor which is passed in two times. 343 \param typeTest Unused parameter, which handles the proper call selection based on the type of the Functor which is passed in two times.
344 \return True if the functor was successfully applied, else false. */ 344 \return True if the functor was successfully applied, else false. */
345 template <typename Functor> 345 template <typename Functor>
346 bool apply_(const Functor& func, IMeshBuffer* buffer, bool boundingBoxUpdate, const IVertexManipulator& typeTest) const 346 bool apply_(const Functor& func, IMeshBuffer* buffer, bool boundingBoxUpdate, const IVertexManipulator& typeTest) const
347 { 347 {
348 if (!buffer) 348 if (!buffer)
349 return true; 349 return true;
350 350
351 core::aabbox3df bufferbox; 351 core::aabbox3df bufferbox;
352 for (u32 i=0; i<buffer->getVertexCount(); ++i) 352 for (u32 i=0; i<buffer->getVertexCount(); ++i)
353 { 353 {
354 switch (buffer->getVertexType()) 354 switch (buffer->getVertexType())
355 { 355 {
356 case video::EVT_STANDARD: 356 case video::EVT_STANDARD:
357 { 357 {
358 video::S3DVertex* verts = (video::S3DVertex*)buffer->getVertices(); 358 video::S3DVertex* verts = (video::S3DVertex*)buffer->getVertices();
359 func(verts[i]); 359 func(verts[i]);
360 } 360 }
361 break; 361 break;
362 case video::EVT_2TCOORDS: 362 case video::EVT_2TCOORDS:
363 { 363 {
364 video::S3DVertex2TCoords* verts = (video::S3DVertex2TCoords*)buffer->getVertices(); 364 video::S3DVertex2TCoords* verts = (video::S3DVertex2TCoords*)buffer->getVertices();
365 func(verts[i]); 365 func(verts[i]);
366 } 366 }
367 break; 367 break;
368 case video::EVT_TANGENTS: 368 case video::EVT_TANGENTS:
369 { 369 {
370 video::S3DVertexTangents* verts = (video::S3DVertexTangents*)buffer->getVertices(); 370 video::S3DVertexTangents* verts = (video::S3DVertexTangents*)buffer->getVertices();
371 func(verts[i]); 371 func(verts[i]);
372 } 372 }
373 break; 373 break;
374 } 374 }
375 if (boundingBoxUpdate) 375 if (boundingBoxUpdate)
376 { 376 {
377 if (0==i) 377 if (0==i)
378 bufferbox.reset(buffer->getPosition(0)); 378 bufferbox.reset(buffer->getPosition(0));
379 else 379 else
380 bufferbox.addInternalPoint(buffer->getPosition(i)); 380 bufferbox.addInternalPoint(buffer->getPosition(i));
381 } 381 }
382 } 382 }
383 if (boundingBoxUpdate) 383 if (boundingBoxUpdate)
384 buffer->setBoundingBox(bufferbox); 384 buffer->setBoundingBox(bufferbox);
385 return true; 385 return true;
386 } 386 }
387}; 387};
388 388
389} // end namespace scene 389} // end namespace scene
390} // end namespace irr 390} // end namespace irr
391 391
392 392
393#endif 393#endif
diff --git a/libraries/irrlicht-1.8/include/IMeshSceneNode.h b/libraries/irrlicht-1.8/include/IMeshSceneNode.h
index fdffc03..4541069 100644
--- a/libraries/irrlicht-1.8/include/IMeshSceneNode.h
+++ b/libraries/irrlicht-1.8/include/IMeshSceneNode.h
@@ -1,79 +1,79 @@
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#ifndef __I_MESH_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_MESH_SCENE_NODE_H_INCLUDED__
6#define __I_MESH_SCENE_NODE_H_INCLUDED__ 6#define __I_MESH_SCENE_NODE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15class IShadowVolumeSceneNode; 15class IShadowVolumeSceneNode;
16class IMesh; 16class IMesh;
17 17
18 18
19//! A scene node displaying a static mesh 19//! A scene node displaying a static mesh
20class IMeshSceneNode : public ISceneNode 20class IMeshSceneNode : public ISceneNode
21{ 21{
22public: 22public:
23 23
24 //! Constructor 24 //! Constructor
25 /** Use setMesh() to set the mesh to display. 25 /** Use setMesh() to set the mesh to display.
26 */ 26 */
27 IMeshSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 27 IMeshSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
28 const core::vector3df& position = core::vector3df(0,0,0), 28 const core::vector3df& position = core::vector3df(0,0,0),
29 const core::vector3df& rotation = core::vector3df(0,0,0), 29 const core::vector3df& rotation = core::vector3df(0,0,0),
30 const core::vector3df& scale = core::vector3df(1,1,1)) 30 const core::vector3df& scale = core::vector3df(1,1,1))
31 : ISceneNode(parent, mgr, id, position, rotation, scale) {} 31 : ISceneNode(parent, mgr, id, position, rotation, scale) {}
32 32
33 //! Sets a new mesh to display 33 //! Sets a new mesh to display
34 /** \param mesh Mesh to display. */ 34 /** \param mesh Mesh to display. */
35 virtual void setMesh(IMesh* mesh) = 0; 35 virtual void setMesh(IMesh* mesh) = 0;
36 36
37 //! Get the currently defined mesh for display. 37 //! Get the currently defined mesh for display.
38 /** \return Pointer to mesh which is displayed by this node. */ 38 /** \return Pointer to mesh which is displayed by this node. */
39 virtual IMesh* getMesh(void) = 0; 39 virtual IMesh* getMesh(void) = 0;
40 40
41 //! Creates shadow volume scene node as child of this node. 41 //! Creates shadow volume scene node as child of this node.
42 /** The shadow can be rendered using the ZPass or the zfail 42 /** The shadow can be rendered using the ZPass or the zfail
43 method. ZPass is a little bit faster because the shadow volume 43 method. ZPass is a little bit faster because the shadow volume
44 creation is easier, but with this method there occur ugly 44 creation is easier, but with this method there occur ugly
45 looking artifacs when the camera is inside the shadow volume. 45 looking artifacs when the camera is inside the shadow volume.
46 These error do not occur with the ZFail method. 46 These error do not occur with the ZFail method.
47 \param shadowMesh: Optional custom mesh for shadow volume. 47 \param shadowMesh: Optional custom mesh for shadow volume.
48 \param id: Id of the shadow scene node. This id can be used to 48 \param id: Id of the shadow scene node. This id can be used to
49 identify the node later. 49 identify the node later.
50 \param zfailmethod: If set to true, the shadow will use the 50 \param zfailmethod: If set to true, the shadow will use the
51 zfail method, if not, zpass is used. 51 zfail method, if not, zpass is used.
52 \param infinity: Value used by the shadow volume algorithm to 52 \param infinity: Value used by the shadow volume algorithm to
53 scale the shadow volume (for zfail shadow volume we support only 53 scale the shadow volume (for zfail shadow volume we support only
54 finite shadows, so camera zfar must be larger than shadow back cap, 54 finite shadows, so camera zfar must be larger than shadow back cap,
55 which is depend on infinity parameter). 55 which is depend on infinity parameter).
56 \return Pointer to the created shadow scene node. This pointer 56 \return Pointer to the created shadow scene node. This pointer
57 should not be dropped. See IReferenceCounted::drop() for more 57 should not be dropped. See IReferenceCounted::drop() for more
58 information. */ 58 information. */
59 virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0, 59 virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(const IMesh* shadowMesh=0,
60 s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f) = 0; 60 s32 id=-1, bool zfailmethod=true, f32 infinity=1000.0f) = 0;
61 61
62 //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style. 62 //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
63 /** In this way it is possible to change the materials of a mesh 63 /** In this way it is possible to change the materials of a mesh
64 causing all mesh scene nodes referencing this mesh to change, too. 64 causing all mesh scene nodes referencing this mesh to change, too.
65 \param readonly Flag if the materials shall be read-only. */ 65 \param readonly Flag if the materials shall be read-only. */
66 virtual void setReadOnlyMaterials(bool readonly) = 0; 66 virtual void setReadOnlyMaterials(bool readonly) = 0;
67 67
68 //! Check if the scene node should not copy the materials of the mesh but use them in a read only style 68 //! Check if the scene node should not copy the materials of the mesh but use them in a read only style
69 /** This flag can be set by setReadOnlyMaterials(). 69 /** This flag can be set by setReadOnlyMaterials().
70 \return Whether the materials are read-only. */ 70 \return Whether the materials are read-only. */
71 virtual bool isReadOnlyMaterials() const = 0; 71 virtual bool isReadOnlyMaterials() const = 0;
72}; 72};
73 73
74} // end namespace scene 74} // end namespace scene
75} // end namespace irr 75} // end namespace irr
76 76
77 77
78#endif 78#endif
79 79
diff --git a/libraries/irrlicht-1.8/include/IMeshWriter.h b/libraries/irrlicht-1.8/include/IMeshWriter.h
index 555a798..aef3e28 100644
--- a/libraries/irrlicht-1.8/include/IMeshWriter.h
+++ b/libraries/irrlicht-1.8/include/IMeshWriter.h
@@ -1,58 +1,58 @@
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#ifndef __IRR_I_MESH_WRITER_H_INCLUDED__ 5#ifndef __IRR_I_MESH_WRITER_H_INCLUDED__
6#define __IRR_I_MESH_WRITER_H_INCLUDED__ 6#define __IRR_I_MESH_WRITER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "EMeshWriterEnums.h" 9#include "EMeshWriterEnums.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace io 13namespace io
14{ 14{
15 class IWriteFile; 15 class IWriteFile;
16} // end namespace io 16} // end namespace io
17 17
18namespace scene 18namespace scene
19{ 19{
20 class IMesh; 20 class IMesh;
21 21
22 //! Interface for writing meshes 22 //! Interface for writing meshes
23 class IMeshWriter : public virtual IReferenceCounted 23 class IMeshWriter : public virtual IReferenceCounted
24 { 24 {
25 public: 25 public:
26 26
27 //! Destructor 27 //! Destructor
28 virtual ~IMeshWriter() {} 28 virtual ~IMeshWriter() {}
29 29
30 //! Get the type of the mesh writer 30 //! Get the type of the mesh writer
31 /** For own implementations, use MAKE_IRR_ID as shown in the 31 /** For own implementations, use MAKE_IRR_ID as shown in the
32 EMESH_WRITER_TYPE enumeration to return your own unique mesh 32 EMESH_WRITER_TYPE enumeration to return your own unique mesh
33 type id. 33 type id.
34 \return Type of the mesh writer. */ 34 \return Type of the mesh writer. */
35 virtual EMESH_WRITER_TYPE getType() const = 0; 35 virtual EMESH_WRITER_TYPE getType() const = 0;
36 36
37 //! Write a static mesh. 37 //! Write a static mesh.
38 /** \param file File handle to write the mesh to. 38 /** \param file File handle to write the mesh to.
39 \param mesh Pointer to mesh to be written. 39 \param mesh Pointer to mesh to be written.
40 \param flags Optional flags to set properties of the writer. 40 \param flags Optional flags to set properties of the writer.
41 \return True if sucessful */ 41 \return True if sucessful */
42 virtual bool writeMesh(io::IWriteFile* file, scene::IMesh* mesh, 42 virtual bool writeMesh(io::IWriteFile* file, scene::IMesh* mesh,
43 s32 flags=EMWF_NONE) = 0; 43 s32 flags=EMWF_NONE) = 0;
44 44
45 // Writes an animated mesh 45 // Writes an animated mesh
46 // for future use, no writer is able to write animated meshes currently 46 // for future use, no writer is able to write animated meshes currently
47 /* \return Returns true if sucessful */ 47 /* \return Returns true if sucessful */
48 //virtual bool writeAnimatedMesh(io::IWriteFile* file, 48 //virtual bool writeAnimatedMesh(io::IWriteFile* file,
49 // scene::IAnimatedMesh* mesh, 49 // scene::IAnimatedMesh* mesh,
50 // s32 flags=EMWF_NONE) = 0; 50 // s32 flags=EMWF_NONE) = 0;
51 }; 51 };
52 52
53 53
54} // end namespace 54} // end namespace
55} // end namespace 55} // end namespace
56 56
57#endif 57#endif
58 58
diff --git a/libraries/irrlicht-1.8/include/IMetaTriangleSelector.h b/libraries/irrlicht-1.8/include/IMetaTriangleSelector.h
index 2cbb385..366893a 100644
--- a/libraries/irrlicht-1.8/include/IMetaTriangleSelector.h
+++ b/libraries/irrlicht-1.8/include/IMetaTriangleSelector.h
@@ -1,43 +1,43 @@
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#ifndef __I_META_TRIANGLE_SELECTOR_H_INCLUDED__ 5#ifndef __I_META_TRIANGLE_SELECTOR_H_INCLUDED__
6#define __I_META_TRIANGLE_SELECTOR_H_INCLUDED__ 6#define __I_META_TRIANGLE_SELECTOR_H_INCLUDED__
7 7
8#include "ITriangleSelector.h" 8#include "ITriangleSelector.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! Interface for making multiple triangle selectors work as one big selector. 15//! Interface for making multiple triangle selectors work as one big selector.
16/** This is nothing more than a collection of one or more triangle selectors 16/** This is nothing more than a collection of one or more triangle selectors
17providing together the interface of one triangle selector. In this way, 17providing together the interface of one triangle selector. In this way,
18collision tests can be done with different triangle soups in one pass. 18collision tests can be done with different triangle soups in one pass.
19*/ 19*/
20class IMetaTriangleSelector : public ITriangleSelector 20class IMetaTriangleSelector : public ITriangleSelector
21{ 21{
22public: 22public:
23 23
24 //! Adds a triangle selector to the collection of triangle selectors. 24 //! Adds a triangle selector to the collection of triangle selectors.
25 /** \param toAdd: Pointer to an triangle selector to add to the list. */ 25 /** \param toAdd: Pointer to an triangle selector to add to the list. */
26 virtual void addTriangleSelector(ITriangleSelector* toAdd) = 0; 26 virtual void addTriangleSelector(ITriangleSelector* toAdd) = 0;
27 27
28 //! Removes a specific triangle selector from the collection. 28 //! Removes a specific triangle selector from the collection.
29 /** \param toRemove: Pointer to an triangle selector which is in the 29 /** \param toRemove: Pointer to an triangle selector which is in the
30 list but will be removed. 30 list but will be removed.
31 \return True if successful, false if not. */ 31 \return True if successful, false if not. */
32 virtual bool removeTriangleSelector(ITriangleSelector* toRemove) = 0; 32 virtual bool removeTriangleSelector(ITriangleSelector* toRemove) = 0;
33 33
34 //! Removes all triangle selectors from the collection. 34 //! Removes all triangle selectors from the collection.
35 virtual void removeAllTriangleSelectors() = 0; 35 virtual void removeAllTriangleSelectors() = 0;
36}; 36};
37 37
38} // end namespace scene 38} // end namespace scene
39} // end namespace irr 39} // end namespace irr
40 40
41 41
42#endif 42#endif
43 43
diff --git a/libraries/irrlicht-1.8/include/IOSOperator.h b/libraries/irrlicht-1.8/include/IOSOperator.h
index 22fb691..b5c6236 100644
--- a/libraries/irrlicht-1.8/include/IOSOperator.h
+++ b/libraries/irrlicht-1.8/include/IOSOperator.h
@@ -1,50 +1,50 @@
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#ifndef __I_OS_OPERATOR_H_INCLUDED__ 5#ifndef __I_OS_OPERATOR_H_INCLUDED__
6#define __I_OS_OPERATOR_H_INCLUDED__ 6#define __I_OS_OPERATOR_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "irrString.h" 9#include "irrString.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13 13
14//! The Operating system operator provides operation system specific methods and informations. 14//! The Operating system operator provides operation system specific methods and informations.
15class IOSOperator : public virtual IReferenceCounted 15class IOSOperator : public virtual IReferenceCounted
16{ 16{
17public: 17public:
18 //! Get the current operation system version as string. 18 //! Get the current operation system version as string.
19 virtual const core::stringc& getOperatingSystemVersion() const = 0; 19 virtual const core::stringc& getOperatingSystemVersion() const = 0;
20 20
21 //! Get the current operation system version as string. 21 //! Get the current operation system version as string.
22 /** \deprecated Use getOperatingSystemVersion instead. This method will be removed in Irrlicht 1.9. */ 22 /** \deprecated Use getOperatingSystemVersion instead. This method will be removed in Irrlicht 1.9. */
23 _IRR_DEPRECATED_ const wchar_t* getOperationSystemVersion() const 23 _IRR_DEPRECATED_ const wchar_t* getOperationSystemVersion() const
24 { 24 {
25 return core::stringw(getOperatingSystemVersion()).c_str(); 25 return core::stringw(getOperatingSystemVersion()).c_str();
26 } 26 }
27 27
28 //! Copies text to the clipboard 28 //! Copies text to the clipboard
29 virtual void copyToClipboard(const c8* text) const = 0; 29 virtual void copyToClipboard(const c8* text) const = 0;
30 30
31 //! Get text from the clipboard 31 //! Get text from the clipboard
32 /** \return Returns 0 if no string is in there. */ 32 /** \return Returns 0 if no string is in there. */
33 virtual const c8* getTextFromClipboard() const = 0; 33 virtual const c8* getTextFromClipboard() const = 0;
34 34
35 //! Get the processor speed in megahertz 35 //! Get the processor speed in megahertz
36 /** \param MHz The integer variable to store the speed in. 36 /** \param MHz The integer variable to store the speed in.
37 \return True if successful, false if not */ 37 \return True if successful, false if not */
38 virtual bool getProcessorSpeedMHz(u32* MHz) const = 0; 38 virtual bool getProcessorSpeedMHz(u32* MHz) const = 0;
39 39
40 //! Get the total and available system RAM 40 //! Get the total and available system RAM
41 /** \param Total: will contain the total system memory 41 /** \param Total: will contain the total system memory
42 \param Avail: will contain the available memory 42 \param Avail: will contain the available memory
43 \return True if successful, false if not */ 43 \return True if successful, false if not */
44 virtual bool getSystemMemory(u32* Total, u32* Avail) const = 0; 44 virtual bool getSystemMemory(u32* Total, u32* Avail) const = 0;
45 45
46}; 46};
47 47
48} // end namespace 48} // end namespace
49 49
50#endif 50#endif
diff --git a/libraries/irrlicht-1.8/include/IParticleAffector.h b/libraries/irrlicht-1.8/include/IParticleAffector.h
index e2b83e8..f5a18c6 100644
--- a/libraries/irrlicht-1.8/include/IParticleAffector.h
+++ b/libraries/irrlicht-1.8/include/IParticleAffector.h
@@ -1,72 +1,72 @@
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#ifndef __I_PARTICLE_AFFECTOR_H_INCLUDED__ 5#ifndef __I_PARTICLE_AFFECTOR_H_INCLUDED__
6#define __I_PARTICLE_AFFECTOR_H_INCLUDED__ 6#define __I_PARTICLE_AFFECTOR_H_INCLUDED__
7 7
8#include "IAttributeExchangingObject.h" 8#include "IAttributeExchangingObject.h"
9#include "SParticle.h" 9#include "SParticle.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 15
16//! Types of built in particle affectors 16//! Types of built in particle affectors
17enum E_PARTICLE_AFFECTOR_TYPE 17enum E_PARTICLE_AFFECTOR_TYPE
18{ 18{
19 EPAT_NONE = 0, 19 EPAT_NONE = 0,
20 EPAT_ATTRACT, 20 EPAT_ATTRACT,
21 EPAT_FADE_OUT, 21 EPAT_FADE_OUT,
22 EPAT_GRAVITY, 22 EPAT_GRAVITY,
23 EPAT_ROTATE, 23 EPAT_ROTATE,
24 EPAT_SCALE, 24 EPAT_SCALE,
25 EPAT_COUNT 25 EPAT_COUNT
26}; 26};
27 27
28//! Names for built in particle affectors 28//! Names for built in particle affectors
29const c8* const ParticleAffectorTypeNames[] = 29const c8* const ParticleAffectorTypeNames[] =
30{ 30{
31 "None", 31 "None",
32 "Attract", 32 "Attract",
33 "FadeOut", 33 "FadeOut",
34 "Gravity", 34 "Gravity",
35 "Rotate", 35 "Rotate",
36 "Scale", 36 "Scale",
37 0 37 0
38}; 38};
39 39
40//! A particle affector modifies particles. 40//! A particle affector modifies particles.
41class IParticleAffector : public virtual io::IAttributeExchangingObject 41class IParticleAffector : public virtual io::IAttributeExchangingObject
42{ 42{
43public: 43public:
44 44
45 //! constructor 45 //! constructor
46 IParticleAffector() : Enabled(true) {} 46 IParticleAffector() : Enabled(true) {}
47 47
48 //! Affects an array of particles. 48 //! Affects an array of particles.
49 /** \param now Current time. (Same as ITimer::getTime() would return) 49 /** \param now Current time. (Same as ITimer::getTime() would return)
50 \param particlearray Array of particles. 50 \param particlearray Array of particles.
51 \param count Amount of particles in array. */ 51 \param count Amount of particles in array. */
52 virtual void affect(u32 now, SParticle* particlearray, u32 count) = 0; 52 virtual void affect(u32 now, SParticle* particlearray, u32 count) = 0;
53 53
54 //! Sets whether or not the affector is currently enabled. 54 //! Sets whether or not the affector is currently enabled.
55 virtual void setEnabled(bool enabled) { Enabled = enabled; } 55 virtual void setEnabled(bool enabled) { Enabled = enabled; }
56 56
57 //! Gets whether or not the affector is currently enabled. 57 //! Gets whether or not the affector is currently enabled.
58 virtual bool getEnabled() const { return Enabled; } 58 virtual bool getEnabled() const { return Enabled; }
59 59
60 //! Get emitter type 60 //! Get emitter type
61 virtual E_PARTICLE_AFFECTOR_TYPE getType() const = 0; 61 virtual E_PARTICLE_AFFECTOR_TYPE getType() const = 0;
62 62
63protected: 63protected:
64 bool Enabled; 64 bool Enabled;
65}; 65};
66 66
67} // end namespace scene 67} // end namespace scene
68} // end namespace irr 68} // end namespace irr
69 69
70 70
71#endif 71#endif
72 72
diff --git a/libraries/irrlicht-1.8/include/IParticleAnimatedMeshSceneNodeEmitter.h b/libraries/irrlicht-1.8/include/IParticleAnimatedMeshSceneNodeEmitter.h
index 9be329d..b64d1d6 100644
--- a/libraries/irrlicht-1.8/include/IParticleAnimatedMeshSceneNodeEmitter.h
+++ b/libraries/irrlicht-1.8/include/IParticleAnimatedMeshSceneNodeEmitter.h
@@ -1,54 +1,54 @@
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#ifndef __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ 5#ifndef __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__
6#define __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ 6#define __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__
7 7
8#include "IParticleEmitter.h" 8#include "IParticleEmitter.h"
9#include "IAnimatedMeshSceneNode.h" 9#include "IAnimatedMeshSceneNode.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 15
16//! A particle emitter which emits particles from mesh vertices. 16//! A particle emitter which emits particles from mesh vertices.
17class IParticleAnimatedMeshSceneNodeEmitter : public IParticleEmitter 17class IParticleAnimatedMeshSceneNodeEmitter : public IParticleEmitter
18{ 18{
19public: 19public:
20 20
21 //! Set Mesh to emit particles from 21 //! Set Mesh to emit particles from
22 virtual void setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node ) = 0; 22 virtual void setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node ) = 0;
23 23
24 //! Set whether to use vertex normal for direction, or direction specified 24 //! Set whether to use vertex normal for direction, or direction specified
25 virtual void setUseNormalDirection( bool useNormalDirection = true ) = 0; 25 virtual void setUseNormalDirection( bool useNormalDirection = true ) = 0;
26 26
27 //! Set the amount that the normal is divided by for getting a particles direction 27 //! Set the amount that the normal is divided by for getting a particles direction
28 virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) = 0; 28 virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) = 0;
29 29
30 //! Sets whether to emit min<->max particles for every vertex or to pick min<->max vertices 30 //! Sets whether to emit min<->max particles for every vertex or to pick min<->max vertices
31 virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0; 31 virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0;
32 32
33 //! Get mesh we're emitting particles from 33 //! Get mesh we're emitting particles from
34 virtual const IAnimatedMeshSceneNode* getAnimatedMeshSceneNode() const = 0; 34 virtual const IAnimatedMeshSceneNode* getAnimatedMeshSceneNode() const = 0;
35 35
36 //! Get whether to use vertex normal for direction, or direction specified 36 //! Get whether to use vertex normal for direction, or direction specified
37 virtual bool isUsingNormalDirection() const = 0; 37 virtual bool isUsingNormalDirection() const = 0;
38 38
39 //! Get the amount that the normal is divided by for getting a particles direction 39 //! Get the amount that the normal is divided by for getting a particles direction
40 virtual f32 getNormalDirectionModifier() const = 0; 40 virtual f32 getNormalDirectionModifier() const = 0;
41 41
42 //! Gets whether to emit min<->max particles for every vertex or to pick min<->max vertices 42 //! Gets whether to emit min<->max particles for every vertex or to pick min<->max vertices
43 virtual bool getEveryMeshVertex() const = 0; 43 virtual bool getEveryMeshVertex() const = 0;
44 44
45 //! Get emitter type 45 //! Get emitter type
46 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_ANIMATED_MESH; } 46 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_ANIMATED_MESH; }
47}; 47};
48 48
49} // end namespace scene 49} // end namespace scene
50} // end namespace irr 50} // end namespace irr
51 51
52 52
53#endif // __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ 53#endif // __I_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__
54 54
diff --git a/libraries/irrlicht-1.8/include/IParticleAttractionAffector.h b/libraries/irrlicht-1.8/include/IParticleAttractionAffector.h
index 6f9d8ab..7e874e8 100644
--- a/libraries/irrlicht-1.8/include/IParticleAttractionAffector.h
+++ b/libraries/irrlicht-1.8/include/IParticleAttractionAffector.h
@@ -1,59 +1,59 @@
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#ifndef __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__ 5#ifndef __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
6#define __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__ 6#define __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
7 7
8#include "IParticleAffector.h" 8#include "IParticleAffector.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! A particle affector which attracts or detracts particles. 15//! A particle affector which attracts or detracts particles.
16class IParticleAttractionAffector : public IParticleAffector 16class IParticleAttractionAffector : public IParticleAffector
17{ 17{
18public: 18public:
19 19
20 //! Set the point that particles will attract to 20 //! Set the point that particles will attract to
21 virtual void setPoint( const core::vector3df& point ) = 0; 21 virtual void setPoint( const core::vector3df& point ) = 0;
22 22
23 //! Set whether or not the particles are attracting or detracting 23 //! Set whether or not the particles are attracting or detracting
24 virtual void setAttract( bool attract ) = 0; 24 virtual void setAttract( bool attract ) = 0;
25 25
26 //! Set whether or not this will affect particles in the X direction 26 //! Set whether or not this will affect particles in the X direction
27 virtual void setAffectX( bool affect ) = 0; 27 virtual void setAffectX( bool affect ) = 0;
28 28
29 //! Set whether or not this will affect particles in the Y direction 29 //! Set whether or not this will affect particles in the Y direction
30 virtual void setAffectY( bool affect ) = 0; 30 virtual void setAffectY( bool affect ) = 0;
31 31
32 //! Set whether or not this will affect particles in the Z direction 32 //! Set whether or not this will affect particles in the Z direction
33 virtual void setAffectZ( bool affect ) = 0; 33 virtual void setAffectZ( bool affect ) = 0;
34 34
35 //! Get the point that particles are attracted to 35 //! Get the point that particles are attracted to
36 virtual const core::vector3df& getPoint() const = 0; 36 virtual const core::vector3df& getPoint() const = 0;
37 37
38 //! Get whether or not the particles are attracting or detracting 38 //! Get whether or not the particles are attracting or detracting
39 virtual bool getAttract() const = 0; 39 virtual bool getAttract() const = 0;
40 40
41 //! Get whether or not the particles X position are affected 41 //! Get whether or not the particles X position are affected
42 virtual bool getAffectX() const = 0; 42 virtual bool getAffectX() const = 0;
43 43
44 //! Get whether or not the particles Y position are affected 44 //! Get whether or not the particles Y position are affected
45 virtual bool getAffectY() const = 0; 45 virtual bool getAffectY() const = 0;
46 46
47 //! Get whether or not the particles Z position are affected 47 //! Get whether or not the particles Z position are affected
48 virtual bool getAffectZ() const = 0; 48 virtual bool getAffectZ() const = 0;
49 49
50 //! Get emitter type 50 //! Get emitter type
51 virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_ATTRACT; } 51 virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_ATTRACT; }
52}; 52};
53 53
54} // end namespace scene 54} // end namespace scene
55} // end namespace irr 55} // end namespace irr
56 56
57 57
58#endif // __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__ 58#endif // __I_PARTICLE_ATTRACTION_AFFECTOR_H_INCLUDED__
59 59
diff --git a/libraries/irrlicht-1.8/include/IParticleBoxEmitter.h b/libraries/irrlicht-1.8/include/IParticleBoxEmitter.h
index d359272..9ea388a 100644
--- a/libraries/irrlicht-1.8/include/IParticleBoxEmitter.h
+++ b/libraries/irrlicht-1.8/include/IParticleBoxEmitter.h
@@ -1,36 +1,36 @@
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#ifndef __I_PARTICLE_BOX_EMITTER_H_INCLUDED__ 5#ifndef __I_PARTICLE_BOX_EMITTER_H_INCLUDED__
6#define __I_PARTICLE_BOX_EMITTER_H_INCLUDED__ 6#define __I_PARTICLE_BOX_EMITTER_H_INCLUDED__
7 7
8#include "IParticleEmitter.h" 8#include "IParticleEmitter.h"
9#include "aabbox3d.h" 9#include "aabbox3d.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 15
16//! A particle emitter which emits particles from a box shaped space 16//! A particle emitter which emits particles from a box shaped space
17class IParticleBoxEmitter : public IParticleEmitter 17class IParticleBoxEmitter : public IParticleEmitter
18{ 18{
19public: 19public:
20 20
21 //! Set the box shape 21 //! Set the box shape
22 virtual void setBox( const core::aabbox3df& box ) = 0; 22 virtual void setBox( const core::aabbox3df& box ) = 0;
23 23
24 //! Get the box shape set 24 //! Get the box shape set
25 virtual const core::aabbox3df& getBox() const = 0; 25 virtual const core::aabbox3df& getBox() const = 0;
26 26
27 //! Get emitter type 27 //! Get emitter type
28 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_BOX; } 28 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_BOX; }
29}; 29};
30 30
31} // end namespace scene 31} // end namespace scene
32} // end namespace irr 32} // end namespace irr
33 33
34 34
35#endif 35#endif
36 36
diff --git a/libraries/irrlicht-1.8/include/IParticleCylinderEmitter.h b/libraries/irrlicht-1.8/include/IParticleCylinderEmitter.h
index dac5ebe..cd063b8 100644
--- a/libraries/irrlicht-1.8/include/IParticleCylinderEmitter.h
+++ b/libraries/irrlicht-1.8/include/IParticleCylinderEmitter.h
@@ -1,59 +1,59 @@
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#ifndef __I_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__ 5#ifndef __I_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__
6#define __I_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__ 6#define __I_PARTICLE_CYLINDER_EMITTER_H_INCLUDED__
7 7
8#include "IParticleEmitter.h" 8#include "IParticleEmitter.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! A particle emitter which emits from a cylindrically shaped space. 15//! A particle emitter which emits from a cylindrically shaped space.
16class IParticleCylinderEmitter : public IParticleEmitter 16class IParticleCylinderEmitter : public IParticleEmitter
17{ 17{
18public: 18public:
19 19
20 //! Set the center of the radius for the cylinder, at one end of the cylinder 20 //! Set the center of the radius for the cylinder, at one end of the cylinder
21 virtual void setCenter( const core::vector3df& center ) = 0; 21 virtual void setCenter( const core::vector3df& center ) = 0;
22 22
23 //! Set the normal of the cylinder 23 //! Set the normal of the cylinder
24 virtual void setNormal( const core::vector3df& normal ) = 0; 24 virtual void setNormal( const core::vector3df& normal ) = 0;
25 25
26 //! Set the radius of the cylinder 26 //! Set the radius of the cylinder
27 virtual void setRadius( f32 radius ) = 0; 27 virtual void setRadius( f32 radius ) = 0;
28 28
29 //! Set the length of the cylinder 29 //! Set the length of the cylinder
30 virtual void setLength( f32 length ) = 0; 30 virtual void setLength( f32 length ) = 0;
31 31
32 //! Set whether or not to draw points inside the cylinder 32 //! Set whether or not to draw points inside the cylinder
33 virtual void setOutlineOnly( bool outlineOnly = true ) = 0; 33 virtual void setOutlineOnly( bool outlineOnly = true ) = 0;
34 34
35 //! Get the center of the cylinder 35 //! Get the center of the cylinder
36 virtual const core::vector3df& getCenter() const = 0; 36 virtual const core::vector3df& getCenter() const = 0;
37 37
38 //! Get the normal of the cylinder 38 //! Get the normal of the cylinder
39 virtual const core::vector3df& getNormal() const = 0; 39 virtual const core::vector3df& getNormal() const = 0;
40 40
41 //! Get the radius of the cylinder 41 //! Get the radius of the cylinder
42 virtual f32 getRadius() const = 0; 42 virtual f32 getRadius() const = 0;
43 43
44 //! Get the center of the cylinder 44 //! Get the center of the cylinder
45 virtual f32 getLength() const = 0; 45 virtual f32 getLength() const = 0;
46 46
47 //! Get whether or not to draw points inside the cylinder 47 //! Get whether or not to draw points inside the cylinder
48 virtual bool getOutlineOnly() const = 0; 48 virtual bool getOutlineOnly() const = 0;
49 49
50 //! Get emitter type 50 //! Get emitter type
51 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_CYLINDER; } 51 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_CYLINDER; }
52}; 52};
53 53
54} // end namespace scene 54} // end namespace scene
55} // end namespace irr 55} // end namespace irr
56 56
57 57
58#endif 58#endif
59 59
diff --git a/libraries/irrlicht-1.8/include/IParticleEmitter.h b/libraries/irrlicht-1.8/include/IParticleEmitter.h
index 4b88266..6fc9a2c 100644
--- a/libraries/irrlicht-1.8/include/IParticleEmitter.h
+++ b/libraries/irrlicht-1.8/include/IParticleEmitter.h
@@ -1,129 +1,129 @@
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#ifndef __I_PARTICLE_EMITTER_H_INCLUDED__ 5#ifndef __I_PARTICLE_EMITTER_H_INCLUDED__
6#define __I_PARTICLE_EMITTER_H_INCLUDED__ 6#define __I_PARTICLE_EMITTER_H_INCLUDED__
7 7
8#include "IAttributeExchangingObject.h" 8#include "IAttributeExchangingObject.h"
9#include "SParticle.h" 9#include "SParticle.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 15
16//! Types of built in particle emitters 16//! Types of built in particle emitters
17enum E_PARTICLE_EMITTER_TYPE 17enum E_PARTICLE_EMITTER_TYPE
18{ 18{
19 EPET_POINT = 0, 19 EPET_POINT = 0,
20 EPET_ANIMATED_MESH, 20 EPET_ANIMATED_MESH,
21 EPET_BOX, 21 EPET_BOX,
22 EPET_CYLINDER, 22 EPET_CYLINDER,
23 EPET_MESH, 23 EPET_MESH,
24 EPET_RING, 24 EPET_RING,
25 EPET_SPHERE, 25 EPET_SPHERE,
26 EPET_COUNT 26 EPET_COUNT
27}; 27};
28 28
29//! Names for built in particle emitters 29//! Names for built in particle emitters
30const c8* const ParticleEmitterTypeNames[] = 30const c8* const ParticleEmitterTypeNames[] =
31{ 31{
32 "Point", 32 "Point",
33 "AnimatedMesh", 33 "AnimatedMesh",
34 "Box", 34 "Box",
35 "Cylinder", 35 "Cylinder",
36 "Mesh", 36 "Mesh",
37 "Ring", 37 "Ring",
38 "Sphere", 38 "Sphere",
39 0 39 0
40}; 40};
41 41
42//! A particle emitter for using with particle systems. 42//! A particle emitter for using with particle systems.
43/** A Particle emitter emitts new particles into a particle system. 43/** A Particle emitter emitts new particles into a particle system.
44*/ 44*/
45class IParticleEmitter : public virtual io::IAttributeExchangingObject 45class IParticleEmitter : public virtual io::IAttributeExchangingObject
46{ 46{
47public: 47public:
48 48
49 //! Prepares an array with new particles to emitt into the system 49 //! Prepares an array with new particles to emitt into the system
50 /** \param now Current time. 50 /** \param now Current time.
51 \param timeSinceLastCall Time elapsed since last call, in milliseconds. 51 \param timeSinceLastCall Time elapsed since last call, in milliseconds.
52 \param outArray Pointer which will point to the array with the new 52 \param outArray Pointer which will point to the array with the new
53 particles to add into the system. 53 particles to add into the system.
54 \return Amount of new particles in the array. Can be 0. */ 54 \return Amount of new particles in the array. Can be 0. */
55 virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) = 0; 55 virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) = 0;
56 56
57 //! Set direction the emitter emits particles 57 //! Set direction the emitter emits particles
58 virtual void setDirection( const core::vector3df& newDirection ) = 0; 58 virtual void setDirection( const core::vector3df& newDirection ) = 0;
59 59
60 //! Set minimum number of particles the emitter emits per second 60 //! Set minimum number of particles the emitter emits per second
61 virtual void setMinParticlesPerSecond( u32 minPPS ) = 0; 61 virtual void setMinParticlesPerSecond( u32 minPPS ) = 0;
62 62
63 //! Set maximum number of particles the emitter emits per second 63 //! Set maximum number of particles the emitter emits per second
64 virtual void setMaxParticlesPerSecond( u32 maxPPS ) = 0; 64 virtual void setMaxParticlesPerSecond( u32 maxPPS ) = 0;
65 65
66 //! Set minimum starting color for particles 66 //! Set minimum starting color for particles
67 virtual void setMinStartColor( const video::SColor& color ) = 0; 67 virtual void setMinStartColor( const video::SColor& color ) = 0;
68 68
69 //! Set maximum starting color for particles 69 //! Set maximum starting color for particles
70 virtual void setMaxStartColor( const video::SColor& color ) = 0; 70 virtual void setMaxStartColor( const video::SColor& color ) = 0;
71 71
72 //! Set the maximum starting size for particles 72 //! Set the maximum starting size for particles
73 virtual void setMaxStartSize( const core::dimension2df& size ) = 0; 73 virtual void setMaxStartSize( const core::dimension2df& size ) = 0;
74 74
75 //! Set the minimum starting size for particles 75 //! Set the minimum starting size for particles
76 virtual void setMinStartSize( const core::dimension2df& size ) = 0; 76 virtual void setMinStartSize( const core::dimension2df& size ) = 0;
77 77
78 //! Set the minimum particle life-time in milliseconds 78 //! Set the minimum particle life-time in milliseconds
79 virtual void setMinLifeTime( u32 lifeTimeMin ) = 0; 79 virtual void setMinLifeTime( u32 lifeTimeMin ) = 0;
80 80
81 //! Set the maximum particle life-time in milliseconds 81 //! Set the maximum particle life-time in milliseconds
82 virtual void setMaxLifeTime( u32 lifeTimeMax ) = 0; 82 virtual void setMaxLifeTime( u32 lifeTimeMax ) = 0;
83 83
84 //! Set maximal random derivation from the direction 84 //! Set maximal random derivation from the direction
85 virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) = 0; 85 virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) = 0;
86 86
87 //! Get direction the emitter emits particles 87 //! Get direction the emitter emits particles
88 virtual const core::vector3df& getDirection() const = 0; 88 virtual const core::vector3df& getDirection() const = 0;
89 89
90 //! Get the minimum number of particles the emitter emits per second 90 //! Get the minimum number of particles the emitter emits per second
91 virtual u32 getMinParticlesPerSecond() const = 0; 91 virtual u32 getMinParticlesPerSecond() const = 0;
92 92
93 //! Get the maximum number of particles the emitter emits per second 93 //! Get the maximum number of particles the emitter emits per second
94 virtual u32 getMaxParticlesPerSecond() const = 0; 94 virtual u32 getMaxParticlesPerSecond() const = 0;
95 95
96 //! Get the minimum starting color for particles 96 //! Get the minimum starting color for particles
97 virtual const video::SColor& getMinStartColor() const = 0; 97 virtual const video::SColor& getMinStartColor() const = 0;
98 98
99 //! Get the maximum starting color for particles 99 //! Get the maximum starting color for particles
100 virtual const video::SColor& getMaxStartColor() const = 0; 100 virtual const video::SColor& getMaxStartColor() const = 0;
101 101
102 //! Get the maximum starting size for particles 102 //! Get the maximum starting size for particles
103 virtual const core::dimension2df& getMaxStartSize() const = 0; 103 virtual const core::dimension2df& getMaxStartSize() const = 0;
104 104
105 //! Get the minimum starting size for particles 105 //! Get the minimum starting size for particles
106 virtual const core::dimension2df& getMinStartSize() const = 0; 106 virtual const core::dimension2df& getMinStartSize() const = 0;
107 107
108 //! Get the minimum particle life-time in milliseconds 108 //! Get the minimum particle life-time in milliseconds
109 virtual u32 getMinLifeTime() const = 0; 109 virtual u32 getMinLifeTime() const = 0;
110 110
111 //! Get the maximum particle life-time in milliseconds 111 //! Get the maximum particle life-time in milliseconds
112 virtual u32 getMaxLifeTime() const = 0; 112 virtual u32 getMaxLifeTime() const = 0;
113 113
114 //! Get maximal random derivation from the direction 114 //! Get maximal random derivation from the direction
115 virtual s32 getMaxAngleDegrees() const = 0; 115 virtual s32 getMaxAngleDegrees() const = 0;
116 116
117 117
118 //! Get emitter type 118 //! Get emitter type
119 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_POINT; } 119 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_POINT; }
120}; 120};
121 121
122typedef IParticleEmitter IParticlePointEmitter; 122typedef IParticleEmitter IParticlePointEmitter;
123 123
124} // end namespace scene 124} // end namespace scene
125} // end namespace irr 125} // end namespace irr
126 126
127 127
128#endif 128#endif
129 129
diff --git a/libraries/irrlicht-1.8/include/IParticleFadeOutAffector.h b/libraries/irrlicht-1.8/include/IParticleFadeOutAffector.h
index 759ba58..c3ce78b 100644
--- a/libraries/irrlicht-1.8/include/IParticleFadeOutAffector.h
+++ b/libraries/irrlicht-1.8/include/IParticleFadeOutAffector.h
@@ -1,41 +1,41 @@
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#ifndef __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__ 5#ifndef __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__
6#define __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__ 6#define __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__
7 7
8#include "IParticleAffector.h" 8#include "IParticleAffector.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! A particle affector which fades out the particles. 15//! A particle affector which fades out the particles.
16class IParticleFadeOutAffector : public IParticleAffector 16class IParticleFadeOutAffector : public IParticleAffector
17{ 17{
18public: 18public:
19 19
20 //! Sets the targetColor, i.e. the color the particles will interpolate to over time. 20 //! Sets the targetColor, i.e. the color the particles will interpolate to over time.
21 virtual void setTargetColor( const video::SColor& targetColor ) = 0; 21 virtual void setTargetColor( const video::SColor& targetColor ) = 0;
22 22
23 //! Sets the time in milliseconds it takes for each particle to fade out (minimal 1 ms) 23 //! Sets the time in milliseconds it takes for each particle to fade out (minimal 1 ms)
24 virtual void setFadeOutTime( u32 fadeOutTime ) = 0; 24 virtual void setFadeOutTime( u32 fadeOutTime ) = 0;
25 25
26 //! Gets the targetColor, i.e. the color the particles will interpolate to over time. 26 //! Gets the targetColor, i.e. the color the particles will interpolate to over time.
27 virtual const video::SColor& getTargetColor() const = 0; 27 virtual const video::SColor& getTargetColor() const = 0;
28 28
29 //! Gets the time in milliseconds it takes for each particle to fade out. 29 //! Gets the time in milliseconds it takes for each particle to fade out.
30 virtual u32 getFadeOutTime() const = 0; 30 virtual u32 getFadeOutTime() const = 0;
31 31
32 //! Get emitter type 32 //! Get emitter type
33 virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_FADE_OUT; } 33 virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_FADE_OUT; }
34}; 34};
35 35
36} // end namespace scene 36} // end namespace scene
37} // end namespace irr 37} // end namespace irr
38 38
39 39
40#endif // __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__ 40#endif // __I_PARTICLE_FADE_OUT_AFFECTOR_H_INCLUDED__
41 41
diff --git a/libraries/irrlicht-1.8/include/IParticleGravityAffector.h b/libraries/irrlicht-1.8/include/IParticleGravityAffector.h
index 4113888..f0e4f8e 100644
--- a/libraries/irrlicht-1.8/include/IParticleGravityAffector.h
+++ b/libraries/irrlicht-1.8/include/IParticleGravityAffector.h
@@ -1,42 +1,42 @@
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#ifndef __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__ 5#ifndef __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__
6#define __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__ 6#define __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__
7 7
8#include "IParticleAffector.h" 8#include "IParticleAffector.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! A particle affector which applies gravity to particles. 15//! A particle affector which applies gravity to particles.
16class IParticleGravityAffector : public IParticleAffector 16class IParticleGravityAffector : public IParticleAffector
17{ 17{
18public: 18public:
19 19
20 //! Set the time in milliseconds when the gravity force is totally lost 20 //! Set the time in milliseconds when the gravity force is totally lost
21 /** At that point the particle does not move any more. */ 21 /** At that point the particle does not move any more. */
22 virtual void setTimeForceLost( f32 timeForceLost ) = 0; 22 virtual void setTimeForceLost( f32 timeForceLost ) = 0;
23 23
24 //! Set the direction and force of gravity in all 3 dimensions. 24 //! Set the direction and force of gravity in all 3 dimensions.
25 virtual void setGravity( const core::vector3df& gravity ) = 0; 25 virtual void setGravity( const core::vector3df& gravity ) = 0;
26 26
27 //! Get the time in milliseconds when the gravity force is totally lost 27 //! Get the time in milliseconds when the gravity force is totally lost
28 virtual f32 getTimeForceLost() const = 0; 28 virtual f32 getTimeForceLost() const = 0;
29 29
30 //! Get the direction and force of gravity. 30 //! Get the direction and force of gravity.
31 virtual const core::vector3df& getGravity() const = 0; 31 virtual const core::vector3df& getGravity() const = 0;
32 32
33 //! Get emitter type 33 //! Get emitter type
34 virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_GRAVITY; } 34 virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_GRAVITY; }
35}; 35};
36 36
37} // end namespace scene 37} // end namespace scene
38} // end namespace irr 38} // end namespace irr
39 39
40 40
41#endif // __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__ 41#endif // __I_PARTICLE_GRAVITY_AFFECTOR_H_INCLUDED__
42 42
diff --git a/libraries/irrlicht-1.8/include/IParticleMeshEmitter.h b/libraries/irrlicht-1.8/include/IParticleMeshEmitter.h
index 6550d24..4d066a1 100644
--- a/libraries/irrlicht-1.8/include/IParticleMeshEmitter.h
+++ b/libraries/irrlicht-1.8/include/IParticleMeshEmitter.h
@@ -1,54 +1,54 @@
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#ifndef __I_PARTICLE_MESH_EMITTER_H_INCLUDED__ 5#ifndef __I_PARTICLE_MESH_EMITTER_H_INCLUDED__
6#define __I_PARTICLE_MESH_EMITTER_H_INCLUDED__ 6#define __I_PARTICLE_MESH_EMITTER_H_INCLUDED__
7 7
8#include "IParticleEmitter.h" 8#include "IParticleEmitter.h"
9#include "IMesh.h" 9#include "IMesh.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 15
16//! A particle emitter which emits from vertices of a mesh 16//! A particle emitter which emits from vertices of a mesh
17class IParticleMeshEmitter : public IParticleEmitter 17class IParticleMeshEmitter : public IParticleEmitter
18{ 18{
19public: 19public:
20 20
21 //! Set Mesh to emit particles from 21 //! Set Mesh to emit particles from
22 virtual void setMesh( IMesh* mesh ) = 0; 22 virtual void setMesh( IMesh* mesh ) = 0;
23 23
24 //! Set whether to use vertex normal for direction, or direction specified 24 //! Set whether to use vertex normal for direction, or direction specified
25 virtual void setUseNormalDirection( bool useNormalDirection = true ) = 0; 25 virtual void setUseNormalDirection( bool useNormalDirection = true ) = 0;
26 26
27 //! Set the amount that the normal is divided by for getting a particles direction 27 //! Set the amount that the normal is divided by for getting a particles direction
28 virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) = 0; 28 virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) = 0;
29 29
30 //! Sets whether to emit min<->max particles for every vertex or to pick min<->max vertices 30 //! Sets whether to emit min<->max particles for every vertex or to pick min<->max vertices
31 virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0; 31 virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0;
32 32
33 //! Get Mesh we're emitting particles from 33 //! Get Mesh we're emitting particles from
34 virtual const IMesh* getMesh() const = 0; 34 virtual const IMesh* getMesh() const = 0;
35 35
36 //! Get whether to use vertex normal for direction, or direction specified 36 //! Get whether to use vertex normal for direction, or direction specified
37 virtual bool isUsingNormalDirection() const = 0; 37 virtual bool isUsingNormalDirection() const = 0;
38 38
39 //! Get the amount that the normal is divided by for getting a particles direction 39 //! Get the amount that the normal is divided by for getting a particles direction
40 virtual f32 getNormalDirectionModifier() const = 0; 40 virtual f32 getNormalDirectionModifier() const = 0;
41 41
42 //! Gets whether to emit min<->max particles for every vertex or to pick min<->max vertices 42 //! Gets whether to emit min<->max particles for every vertex or to pick min<->max vertices
43 virtual bool getEveryMeshVertex() const = 0; 43 virtual bool getEveryMeshVertex() const = 0;
44 44
45 //! Get emitter type 45 //! Get emitter type
46 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_MESH; } 46 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_MESH; }
47}; 47};
48 48
49} // end namespace scene 49} // end namespace scene
50} // end namespace irr 50} // end namespace irr
51 51
52 52
53#endif 53#endif
54 54
diff --git a/libraries/irrlicht-1.8/include/IParticleRingEmitter.h b/libraries/irrlicht-1.8/include/IParticleRingEmitter.h
index 089b2ae..4330092 100644
--- a/libraries/irrlicht-1.8/include/IParticleRingEmitter.h
+++ b/libraries/irrlicht-1.8/include/IParticleRingEmitter.h
@@ -1,47 +1,47 @@
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#ifndef __I_PARTICLE_RING_EMITTER_H_INCLUDED__ 5#ifndef __I_PARTICLE_RING_EMITTER_H_INCLUDED__
6#define __I_PARTICLE_RING_EMITTER_H_INCLUDED__ 6#define __I_PARTICLE_RING_EMITTER_H_INCLUDED__
7 7
8#include "IParticleEmitter.h" 8#include "IParticleEmitter.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! A particle emitter which emits particles along a ring shaped area. 15//! A particle emitter which emits particles along a ring shaped area.
16class IParticleRingEmitter : public IParticleEmitter 16class IParticleRingEmitter : public IParticleEmitter
17{ 17{
18public: 18public:
19 19
20 //! Set the center of the ring 20 //! Set the center of the ring
21 virtual void setCenter( const core::vector3df& center ) = 0; 21 virtual void setCenter( const core::vector3df& center ) = 0;
22 22
23 //! Set the radius of the ring 23 //! Set the radius of the ring
24 virtual void setRadius( f32 radius ) = 0; 24 virtual void setRadius( f32 radius ) = 0;
25 25
26 //! Set the thickness of the ring 26 //! Set the thickness of the ring
27 virtual void setRingThickness( f32 ringThickness ) = 0; 27 virtual void setRingThickness( f32 ringThickness ) = 0;
28 28
29 //! Get the center of the ring 29 //! Get the center of the ring
30 virtual const core::vector3df& getCenter() const = 0; 30 virtual const core::vector3df& getCenter() const = 0;
31 31
32 //! Get the radius of the ring 32 //! Get the radius of the ring
33 virtual f32 getRadius() const = 0; 33 virtual f32 getRadius() const = 0;
34 34
35 //! Get the thickness of the ring 35 //! Get the thickness of the ring
36 virtual f32 getRingThickness() const = 0; 36 virtual f32 getRingThickness() const = 0;
37 37
38 //! Get emitter type 38 //! Get emitter type
39 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_RING; } 39 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_RING; }
40}; 40};
41 41
42} // end namespace scene 42} // end namespace scene
43} // end namespace irr 43} // end namespace irr
44 44
45 45
46#endif 46#endif
47 47
diff --git a/libraries/irrlicht-1.8/include/IParticleRotationAffector.h b/libraries/irrlicht-1.8/include/IParticleRotationAffector.h
index d7d4cce..611fc3b 100644
--- a/libraries/irrlicht-1.8/include/IParticleRotationAffector.h
+++ b/libraries/irrlicht-1.8/include/IParticleRotationAffector.h
@@ -1,41 +1,41 @@
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#ifndef __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__ 5#ifndef __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__
6#define __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__ 6#define __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__
7 7
8#include "IParticleAffector.h" 8#include "IParticleAffector.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! A particle affector which rotates the particle system. 15//! A particle affector which rotates the particle system.
16class IParticleRotationAffector : public IParticleAffector 16class IParticleRotationAffector : public IParticleAffector
17{ 17{
18public: 18public:
19 19
20 //! Set the point that particles will rotate around 20 //! Set the point that particles will rotate around
21 virtual void setPivotPoint( const core::vector3df& point ) = 0; 21 virtual void setPivotPoint( const core::vector3df& point ) = 0;
22 22
23 //! Set the speed in degrees per second in all 3 dimensions 23 //! Set the speed in degrees per second in all 3 dimensions
24 virtual void setSpeed( const core::vector3df& speed ) = 0; 24 virtual void setSpeed( const core::vector3df& speed ) = 0;
25 25
26 //! Get the point that particles are attracted to 26 //! Get the point that particles are attracted to
27 virtual const core::vector3df& getPivotPoint() const = 0; 27 virtual const core::vector3df& getPivotPoint() const = 0;
28 28
29 //! Get the speed in degrees per second in all 3 dimensions 29 //! Get the speed in degrees per second in all 3 dimensions
30 virtual const core::vector3df& getSpeed() const = 0; 30 virtual const core::vector3df& getSpeed() const = 0;
31 31
32 //! Get emitter type 32 //! Get emitter type
33 virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_ROTATE; } 33 virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_ROTATE; }
34}; 34};
35 35
36} // end namespace scene 36} // end namespace scene
37} // end namespace irr 37} // end namespace irr
38 38
39 39
40#endif // __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__ 40#endif // __I_PARTICLE_ROTATION_AFFECTOR_H_INCLUDED__
41 41
diff --git a/libraries/irrlicht-1.8/include/IParticleSphereEmitter.h b/libraries/irrlicht-1.8/include/IParticleSphereEmitter.h
index 75c14a8..edde2da 100644
--- a/libraries/irrlicht-1.8/include/IParticleSphereEmitter.h
+++ b/libraries/irrlicht-1.8/include/IParticleSphereEmitter.h
@@ -1,41 +1,41 @@
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#ifndef __I_PARTICLE_SPHERE_EMITTER_H_INCLUDED__ 5#ifndef __I_PARTICLE_SPHERE_EMITTER_H_INCLUDED__
6#define __I_PARTICLE_SPHERE_EMITTER_H_INCLUDED__ 6#define __I_PARTICLE_SPHERE_EMITTER_H_INCLUDED__
7 7
8#include "IParticleEmitter.h" 8#include "IParticleEmitter.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! A particle emitter which emits from a spherical space. 15//! A particle emitter which emits from a spherical space.
16class IParticleSphereEmitter : public IParticleEmitter 16class IParticleSphereEmitter : public IParticleEmitter
17{ 17{
18public: 18public:
19 19
20 //! Set the center of the sphere for particle emissions 20 //! Set the center of the sphere for particle emissions
21 virtual void setCenter( const core::vector3df& center ) = 0; 21 virtual void setCenter( const core::vector3df& center ) = 0;
22 22
23 //! Set the radius of the sphere for particle emissions 23 //! Set the radius of the sphere for particle emissions
24 virtual void setRadius( f32 radius ) = 0; 24 virtual void setRadius( f32 radius ) = 0;
25 25
26 //! Get the center of the sphere for particle emissions 26 //! Get the center of the sphere for particle emissions
27 virtual const core::vector3df& getCenter() const = 0; 27 virtual const core::vector3df& getCenter() const = 0;
28 28
29 //! Get the radius of the sphere for particle emissions 29 //! Get the radius of the sphere for particle emissions
30 virtual f32 getRadius() const = 0; 30 virtual f32 getRadius() const = 0;
31 31
32 //! Get emitter type 32 //! Get emitter type
33 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_SPHERE; } 33 virtual E_PARTICLE_EMITTER_TYPE getType() const { return EPET_SPHERE; }
34}; 34};
35 35
36} // end namespace scene 36} // end namespace scene
37} // end namespace irr 37} // end namespace irr
38 38
39 39
40#endif 40#endif
41 41
diff --git a/libraries/irrlicht-1.8/include/IParticleSystemSceneNode.h b/libraries/irrlicht-1.8/include/IParticleSystemSceneNode.h
index adb2050..56a47c8 100644
--- a/libraries/irrlicht-1.8/include/IParticleSystemSceneNode.h
+++ b/libraries/irrlicht-1.8/include/IParticleSystemSceneNode.h
@@ -1,512 +1,512 @@
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#ifndef __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__
6#define __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__ 6#define __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9#include "IParticleAnimatedMeshSceneNodeEmitter.h" 9#include "IParticleAnimatedMeshSceneNodeEmitter.h"
10#include "IParticleBoxEmitter.h" 10#include "IParticleBoxEmitter.h"
11#include "IParticleCylinderEmitter.h" 11#include "IParticleCylinderEmitter.h"
12#include "IParticleMeshEmitter.h" 12#include "IParticleMeshEmitter.h"
13#include "IParticleRingEmitter.h" 13#include "IParticleRingEmitter.h"
14#include "IParticleSphereEmitter.h" 14#include "IParticleSphereEmitter.h"
15#include "IParticleAttractionAffector.h" 15#include "IParticleAttractionAffector.h"
16#include "IParticleFadeOutAffector.h" 16#include "IParticleFadeOutAffector.h"
17#include "IParticleGravityAffector.h" 17#include "IParticleGravityAffector.h"
18#include "IParticleRotationAffector.h" 18#include "IParticleRotationAffector.h"
19#include "dimension2d.h" 19#include "dimension2d.h"
20 20
21namespace irr 21namespace irr
22{ 22{
23namespace scene 23namespace scene
24{ 24{
25 25
26//! A particle system scene node for creating snow, fire, exlosions, smoke... 26//! A particle system scene node for creating snow, fire, exlosions, smoke...
27/** A scene node controlling a particle System. The behavior of the particles 27/** A scene node controlling a particle System. The behavior of the particles
28can be controlled by setting the right particle emitters and affectors. 28can be controlled by setting the right particle emitters and affectors.
29You can for example easily create a campfire by doing this: 29You can for example easily create a campfire by doing this:
30 30
31\code 31\code
32 scene::IParticleSystemSceneNode* p = scenemgr->addParticleSystemSceneNode(); 32 scene::IParticleSystemSceneNode* p = scenemgr->addParticleSystemSceneNode();
33 p->setParticleSize(core::dimension2d<f32>(20.0f, 10.0f)); 33 p->setParticleSize(core::dimension2d<f32>(20.0f, 10.0f));
34 scene::IParticleEmitter* em = p->createBoxEmitter( 34 scene::IParticleEmitter* em = p->createBoxEmitter(
35 core::aabbox3d<f32>(-5,0,-5,5,1,5), 35 core::aabbox3d<f32>(-5,0,-5,5,1,5),
36 core::vector3df(0.0f,0.03f,0.0f), 36 core::vector3df(0.0f,0.03f,0.0f),
37 40,80, video::SColor(0,255,255,255),video::SColor(0,255,255,255), 1100,2000); 37 40,80, video::SColor(0,255,255,255),video::SColor(0,255,255,255), 1100,2000);
38 p->setEmitter(em); 38 p->setEmitter(em);
39 em->drop(); 39 em->drop();
40 scene::IParticleAffector* paf = p->createFadeOutParticleAffector(); 40 scene::IParticleAffector* paf = p->createFadeOutParticleAffector();
41 p->addAffector(paf); 41 p->addAffector(paf);
42 paf->drop(); 42 paf->drop();
43\endcode 43\endcode
44 44
45*/ 45*/
46class IParticleSystemSceneNode : public ISceneNode 46class IParticleSystemSceneNode : public ISceneNode
47{ 47{
48public: 48public:
49 49
50 //! Constructor 50 //! Constructor
51 IParticleSystemSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 51 IParticleSystemSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
52 const core::vector3df& position = core::vector3df(0,0,0), 52 const core::vector3df& position = core::vector3df(0,0,0),
53 const core::vector3df& rotation = core::vector3df(0,0,0), 53 const core::vector3df& rotation = core::vector3df(0,0,0),
54 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) 54 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
55 : ISceneNode(parent, mgr, id, position, rotation, scale) {} 55 : ISceneNode(parent, mgr, id, position, rotation, scale) {}
56 56
57 //! Sets the size of all particles. 57 //! Sets the size of all particles.
58 virtual void setParticleSize( 58 virtual void setParticleSize(
59 const core::dimension2d<f32> &size = core::dimension2d<f32>(5.0f, 5.0f)) = 0; 59 const core::dimension2d<f32> &size = core::dimension2d<f32>(5.0f, 5.0f)) = 0;
60 60
61 //! Sets if the particles should be global. 61 //! Sets if the particles should be global.
62 /** If they are, the particles are affected by the movement of the 62 /** If they are, the particles are affected by the movement of the
63 particle system scene node too, otherwise they completely ignore it. 63 particle system scene node too, otherwise they completely ignore it.
64 Default is true. */ 64 Default is true. */
65 virtual void setParticlesAreGlobal(bool global=true) = 0; 65 virtual void setParticlesAreGlobal(bool global=true) = 0;
66 66
67 //! Remove all currently visible particles 67 //! Remove all currently visible particles
68 virtual void clearParticles() = 0; 68 virtual void clearParticles() = 0;
69 69
70 //! Do manually update the particles. 70 //! Do manually update the particles.
71 //! This should only be called when you want to render the node outside the scenegraph, 71 //! This should only be called when you want to render the node outside the scenegraph,
72 //! as the node will care about this otherwise automatically. 72 //! as the node will care about this otherwise automatically.
73 virtual void doParticleSystem(u32 time) = 0; 73 virtual void doParticleSystem(u32 time) = 0;
74 74
75 //! Gets the particle emitter, which creates the particles. 75 //! Gets the particle emitter, which creates the particles.
76 /** \return The particle emitter. Can be 0 if none is set. */ 76 /** \return The particle emitter. Can be 0 if none is set. */
77 virtual IParticleEmitter* getEmitter() =0; 77 virtual IParticleEmitter* getEmitter() =0;
78 78
79 //! Sets the particle emitter, which creates the particles. 79 //! Sets the particle emitter, which creates the particles.
80 /** A particle emitter can be created using one of the createEmitter 80 /** A particle emitter can be created using one of the createEmitter
81 methods. For example to create and use a simple PointEmitter, call 81 methods. For example to create and use a simple PointEmitter, call
82 IParticleEmitter* p = createPointEmitter(); setEmitter(p); p->drop(); 82 IParticleEmitter* p = createPointEmitter(); setEmitter(p); p->drop();
83 \param emitter: Sets the particle emitter. You can set this to 0 for 83 \param emitter: Sets the particle emitter. You can set this to 0 for
84 removing the current emitter and stopping the particle system emitting 84 removing the current emitter and stopping the particle system emitting
85 new particles. */ 85 new particles. */
86 virtual void setEmitter(IParticleEmitter* emitter) = 0; 86 virtual void setEmitter(IParticleEmitter* emitter) = 0;
87 87
88 //! Adds new particle effector to the particle system. 88 //! Adds new particle effector to the particle system.
89 /** A particle affector modifies the particles. For example, the FadeOut 89 /** A particle affector modifies the particles. For example, the FadeOut
90 affector lets all particles fade out after some time. It is created and 90 affector lets all particles fade out after some time. It is created and
91 used in this way: 91 used in this way:
92 \code 92 \code
93 IParticleAffector* p = createFadeOutParticleAffector(); 93 IParticleAffector* p = createFadeOutParticleAffector();
94 addAffector(p); 94 addAffector(p);
95 p->drop(); 95 p->drop();
96 \endcode 96 \endcode
97 Please note that an affector is not necessary for the particle system to 97 Please note that an affector is not necessary for the particle system to
98 work. 98 work.
99 \param affector: New affector. */ 99 \param affector: New affector. */
100 virtual void addAffector(IParticleAffector* affector) = 0; 100 virtual void addAffector(IParticleAffector* affector) = 0;
101 101
102 //! Get a list of all particle affectors. 102 //! Get a list of all particle affectors.
103 /** \return The list of particle affectors attached to this node. */ 103 /** \return The list of particle affectors attached to this node. */
104 virtual const core::list<IParticleAffector*>& getAffectors() const = 0; 104 virtual const core::list<IParticleAffector*>& getAffectors() const = 0;
105 105
106 //! Removes all particle affectors in the particle system. 106 //! Removes all particle affectors in the particle system.
107 virtual void removeAllAffectors() = 0; 107 virtual void removeAllAffectors() = 0;
108 108
109 //! Creates a particle emitter for an animated mesh scene node 109 //! Creates a particle emitter for an animated mesh scene node
110 /** \param node: Pointer to the animated mesh scene node to emit 110 /** \param node: Pointer to the animated mesh scene node to emit
111 particles from 111 particles from
112 \param useNormalDirection: If true, the direction of each particle 112 \param useNormalDirection: If true, the direction of each particle
113 created will be the normal of the vertex that it's emitting from. The 113 created will be the normal of the vertex that it's emitting from. The
114 normal is divided by the normalDirectionModifier parameter, which 114 normal is divided by the normalDirectionModifier parameter, which
115 defaults to 100.0f. 115 defaults to 100.0f.
116 \param direction: Direction and speed of particle emission. 116 \param direction: Direction and speed of particle emission.
117 \param normalDirectionModifier: If the emitter is using the normal 117 \param normalDirectionModifier: If the emitter is using the normal
118 direction then the normal of the vertex that is being emitted from is 118 direction then the normal of the vertex that is being emitted from is
119 divided by this number. 119 divided by this number.
120 \param mbNumber: This allows you to specify a specific meshBuffer for 120 \param mbNumber: This allows you to specify a specific meshBuffer for
121 the IMesh* to emit particles from. The default value is -1, which 121 the IMesh* to emit particles from. The default value is -1, which
122 means a random meshBuffer picked from all of the meshes meshBuffers 122 means a random meshBuffer picked from all of the meshes meshBuffers
123 will be selected to pick a random vertex from. If the value is 0 or 123 will be selected to pick a random vertex from. If the value is 0 or
124 greater, it will only pick random vertices from the meshBuffer 124 greater, it will only pick random vertices from the meshBuffer
125 specified by this value. 125 specified by this value.
126 \param everyMeshVertex: If true, the emitter will emit between min/max 126 \param everyMeshVertex: If true, the emitter will emit between min/max
127 particles every second, for every vertex in the mesh, if false, it will 127 particles every second, for every vertex in the mesh, if false, it will
128 emit between min/max particles from random vertices in the mesh. 128 emit between min/max particles from random vertices in the mesh.
129 \param minParticlesPerSecond: Minimal amount of particles emitted per 129 \param minParticlesPerSecond: Minimal amount of particles emitted per
130 second. 130 second.
131 \param maxParticlesPerSecond: Maximal amount of particles emitted per 131 \param maxParticlesPerSecond: Maximal amount of particles emitted per
132 second. 132 second.
133 \param minStartColor: Minimal initial start color of a particle. The 133 \param minStartColor: Minimal initial start color of a particle. The
134 real color of every particle is calculated as random interpolation 134 real color of every particle is calculated as random interpolation
135 between minStartColor and maxStartColor. 135 between minStartColor and maxStartColor.
136 \param maxStartColor: Maximal initial start color of a particle. The 136 \param maxStartColor: Maximal initial start color of a particle. The
137 real color of every particle is calculated as random interpolation 137 real color of every particle is calculated as random interpolation
138 between minStartColor and maxStartColor. 138 between minStartColor and maxStartColor.
139 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. 139 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
140 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. 140 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
141 \param maxAngleDegrees: Maximal angle in degrees, the emitting 141 \param maxAngleDegrees: Maximal angle in degrees, the emitting
142 direction of the particle will differ from the original direction. 142 direction of the particle will differ from the original direction.
143 \param minStartSize: Minimal initial start size of a particle. The 143 \param minStartSize: Minimal initial start size of a particle. The
144 real size of every particle is calculated as random interpolation 144 real size of every particle is calculated as random interpolation
145 between minStartSize and maxStartSize. 145 between minStartSize and maxStartSize.
146 \param maxStartSize: Maximal initial start size of a particle. The 146 \param maxStartSize: Maximal initial start size of a particle. The
147 real size of every particle is calculated as random interpolation 147 real size of every particle is calculated as random interpolation
148 between minStartSize and maxStartSize. 148 between minStartSize and maxStartSize.
149 \return Pointer to the created particle emitter. To set this emitter 149 \return Pointer to the created particle emitter. To set this emitter
150 as new emitter of this particle system, just call setEmitter(). Note 150 as new emitter of this particle system, just call setEmitter(). Note
151 that you'll have to drop() the returned pointer, after you don't need 151 that you'll have to drop() the returned pointer, after you don't need
152 it any more, see IReferenceCounted::drop() for more informations. */ 152 it any more, see IReferenceCounted::drop() for more informations. */
153 virtual IParticleAnimatedMeshSceneNodeEmitter* createAnimatedMeshSceneNodeEmitter( 153 virtual IParticleAnimatedMeshSceneNodeEmitter* createAnimatedMeshSceneNodeEmitter(
154 scene::IAnimatedMeshSceneNode* node, bool useNormalDirection = true, 154 scene::IAnimatedMeshSceneNode* node, bool useNormalDirection = true,
155 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), 155 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
156 f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1, 156 f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1,
157 bool everyMeshVertex = false, 157 bool everyMeshVertex = false,
158 u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10, 158 u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
159 const video::SColor& minStartColor = video::SColor(255,0,0,0), 159 const video::SColor& minStartColor = video::SColor(255,0,0,0),
160 const video::SColor& maxStartColor = video::SColor(255,255,255,255), 160 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
161 u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, 161 u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
162 s32 maxAngleDegrees = 0, 162 s32 maxAngleDegrees = 0,
163 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), 163 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
164 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; 164 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
165 165
166 //! Creates a box particle emitter. 166 //! Creates a box particle emitter.
167 /** \param box: The box for the emitter. 167 /** \param box: The box for the emitter.
168 \param direction: Direction and speed of particle emission. 168 \param direction: Direction and speed of particle emission.
169 \param minParticlesPerSecond: Minimal amount of particles emitted per 169 \param minParticlesPerSecond: Minimal amount of particles emitted per
170 second. 170 second.
171 \param maxParticlesPerSecond: Maximal amount of particles emitted per 171 \param maxParticlesPerSecond: Maximal amount of particles emitted per
172 second. 172 second.
173 \param minStartColor: Minimal initial start color of a particle. The 173 \param minStartColor: Minimal initial start color of a particle. The
174 real color of every particle is calculated as random interpolation 174 real color of every particle is calculated as random interpolation
175 between minStartColor and maxStartColor. 175 between minStartColor and maxStartColor.
176 \param maxStartColor: Maximal initial start color of a particle. The 176 \param maxStartColor: Maximal initial start color of a particle. The
177 real color of every particle is calculated as random interpolation 177 real color of every particle is calculated as random interpolation
178 between minStartColor and maxStartColor. 178 between minStartColor and maxStartColor.
179 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. 179 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
180 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. 180 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
181 \param maxAngleDegrees: Maximal angle in degrees, the emitting 181 \param maxAngleDegrees: Maximal angle in degrees, the emitting
182 direction of the particle will differ from the original direction. 182 direction of the particle will differ from the original direction.
183 \param minStartSize: Minimal initial start size of a particle. The 183 \param minStartSize: Minimal initial start size of a particle. The
184 real size of every particle is calculated as random interpolation 184 real size of every particle is calculated as random interpolation
185 between minStartSize and maxStartSize. 185 between minStartSize and maxStartSize.
186 \param maxStartSize: Maximal initial start size of a particle. The 186 \param maxStartSize: Maximal initial start size of a particle. The
187 real size of every particle is calculated as random interpolation 187 real size of every particle is calculated as random interpolation
188 between minStartSize and maxStartSize. 188 between minStartSize and maxStartSize.
189 \return Pointer to the created particle emitter. To set this emitter 189 \return Pointer to the created particle emitter. To set this emitter
190 as new emitter of this particle system, just call setEmitter(). Note 190 as new emitter of this particle system, just call setEmitter(). Note
191 that you'll have to drop() the returned pointer, after you don't need 191 that you'll have to drop() the returned pointer, after you don't need
192 it any more, see IReferenceCounted::drop() for more informations. */ 192 it any more, see IReferenceCounted::drop() for more informations. */
193 virtual IParticleBoxEmitter* createBoxEmitter( 193 virtual IParticleBoxEmitter* createBoxEmitter(
194 const core::aabbox3df& box = core::aabbox3df(-10,28,-10,10,30,10), 194 const core::aabbox3df& box = core::aabbox3df(-10,28,-10,10,30,10),
195 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), 195 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
196 u32 minParticlesPerSecond = 5, 196 u32 minParticlesPerSecond = 5,
197 u32 maxParticlesPerSecond = 10, 197 u32 maxParticlesPerSecond = 10,
198 const video::SColor& minStartColor = video::SColor(255,0,0,0), 198 const video::SColor& minStartColor = video::SColor(255,0,0,0),
199 const video::SColor& maxStartColor = video::SColor(255,255,255,255), 199 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
200 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, 200 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
201 s32 maxAngleDegrees=0, 201 s32 maxAngleDegrees=0,
202 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), 202 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
203 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; 203 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
204 204
205 //! Creates a particle emitter for emitting from a cylinder 205 //! Creates a particle emitter for emitting from a cylinder
206 /** \param center: The center of the circle at the base of the cylinder 206 /** \param center: The center of the circle at the base of the cylinder
207 \param radius: The thickness of the cylinder 207 \param radius: The thickness of the cylinder
208 \param normal: Direction of the length of the cylinder 208 \param normal: Direction of the length of the cylinder
209 \param length: The length of the the cylinder 209 \param length: The length of the the cylinder
210 \param outlineOnly: Whether or not to put points inside the cylinder or 210 \param outlineOnly: Whether or not to put points inside the cylinder or
211 on the outline only 211 on the outline only
212 \param direction: Direction and speed of particle emission. 212 \param direction: Direction and speed of particle emission.
213 \param minParticlesPerSecond: Minimal amount of particles emitted per 213 \param minParticlesPerSecond: Minimal amount of particles emitted per
214 second. 214 second.
215 \param maxParticlesPerSecond: Maximal amount of particles emitted per 215 \param maxParticlesPerSecond: Maximal amount of particles emitted per
216 second. 216 second.
217 \param minStartColor: Minimal initial start color of a particle. The 217 \param minStartColor: Minimal initial start color of a particle. The
218 real color of every particle is calculated as random interpolation 218 real color of every particle is calculated as random interpolation
219 between minStartColor and maxStartColor. 219 between minStartColor and maxStartColor.
220 \param maxStartColor: Maximal initial start color of a particle. The 220 \param maxStartColor: Maximal initial start color of a particle. The
221 real color of every particle is calculated as random interpolation 221 real color of every particle is calculated as random interpolation
222 between minStartColor and maxStartColor. 222 between minStartColor and maxStartColor.
223 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. 223 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
224 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. 224 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
225 \param maxAngleDegrees: Maximal angle in degrees, the emitting 225 \param maxAngleDegrees: Maximal angle in degrees, the emitting
226 direction of the particle will differ from the original direction. 226 direction of the particle will differ from the original direction.
227 \param minStartSize: Minimal initial start size of a particle. The 227 \param minStartSize: Minimal initial start size of a particle. The
228 real size of every particle is calculated as random interpolation 228 real size of every particle is calculated as random interpolation
229 between minStartSize and maxStartSize. 229 between minStartSize and maxStartSize.
230 \param maxStartSize: Maximal initial start size of a particle. The 230 \param maxStartSize: Maximal initial start size of a particle. The
231 real size of every particle is calculated as random interpolation 231 real size of every particle is calculated as random interpolation
232 between minStartSize and maxStartSize. 232 between minStartSize and maxStartSize.
233 \return Pointer to the created particle emitter. To set this emitter 233 \return Pointer to the created particle emitter. To set this emitter
234 as new emitter of this particle system, just call setEmitter(). Note 234 as new emitter of this particle system, just call setEmitter(). Note
235 that you'll have to drop() the returned pointer, after you don't need 235 that you'll have to drop() the returned pointer, after you don't need
236 it any more, see IReferenceCounted::drop() for more informations. */ 236 it any more, see IReferenceCounted::drop() for more informations. */
237 virtual IParticleCylinderEmitter* createCylinderEmitter( 237 virtual IParticleCylinderEmitter* createCylinderEmitter(
238 const core::vector3df& center, f32 radius, 238 const core::vector3df& center, f32 radius,
239 const core::vector3df& normal, f32 length, 239 const core::vector3df& normal, f32 length,
240 bool outlineOnly = false, 240 bool outlineOnly = false,
241 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), 241 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
242 u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10, 242 u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
243 const video::SColor& minStartColor = video::SColor(255,0,0,0), 243 const video::SColor& minStartColor = video::SColor(255,0,0,0),
244 const video::SColor& maxStartColor = video::SColor(255,255,255,255), 244 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
245 u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, 245 u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
246 s32 maxAngleDegrees = 0, 246 s32 maxAngleDegrees = 0,
247 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), 247 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
248 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; 248 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
249 249
250 //! Creates a mesh particle emitter. 250 //! Creates a mesh particle emitter.
251 /** \param mesh: Pointer to mesh to emit particles from 251 /** \param mesh: Pointer to mesh to emit particles from
252 \param useNormalDirection: If true, the direction of each particle 252 \param useNormalDirection: If true, the direction of each particle
253 created will be the normal of the vertex that it's emitting from. The 253 created will be the normal of the vertex that it's emitting from. The
254 normal is divided by the normalDirectionModifier parameter, which 254 normal is divided by the normalDirectionModifier parameter, which
255 defaults to 100.0f. 255 defaults to 100.0f.
256 \param direction: Direction and speed of particle emission. 256 \param direction: Direction and speed of particle emission.
257 \param normalDirectionModifier: If the emitter is using the normal 257 \param normalDirectionModifier: If the emitter is using the normal
258 direction then the normal of the vertex that is being emitted from is 258 direction then the normal of the vertex that is being emitted from is
259 divided by this number. 259 divided by this number.
260 \param mbNumber: This allows you to specify a specific meshBuffer for 260 \param mbNumber: This allows you to specify a specific meshBuffer for
261 the IMesh* to emit particles from. The default value is -1, which 261 the IMesh* to emit particles from. The default value is -1, which
262 means a random meshBuffer picked from all of the meshes meshBuffers 262 means a random meshBuffer picked from all of the meshes meshBuffers
263 will be selected to pick a random vertex from. If the value is 0 or 263 will be selected to pick a random vertex from. If the value is 0 or
264 greater, it will only pick random vertices from the meshBuffer 264 greater, it will only pick random vertices from the meshBuffer
265 specified by this value. 265 specified by this value.
266 \param everyMeshVertex: If true, the emitter will emit between min/max 266 \param everyMeshVertex: If true, the emitter will emit between min/max
267 particles every second, for every vertex in the mesh, if false, it will 267 particles every second, for every vertex in the mesh, if false, it will
268 emit between min/max particles from random vertices in the mesh. 268 emit between min/max particles from random vertices in the mesh.
269 \param minParticlesPerSecond: Minimal amount of particles emitted per 269 \param minParticlesPerSecond: Minimal amount of particles emitted per
270 second. 270 second.
271 \param maxParticlesPerSecond: Maximal amount of particles emitted per 271 \param maxParticlesPerSecond: Maximal amount of particles emitted per
272 second. 272 second.
273 \param minStartColor: Minimal initial start color of a particle. The 273 \param minStartColor: Minimal initial start color of a particle. The
274 real color of every particle is calculated as random interpolation 274 real color of every particle is calculated as random interpolation
275 between minStartColor and maxStartColor. 275 between minStartColor and maxStartColor.
276 \param maxStartColor: Maximal initial start color of a particle. The 276 \param maxStartColor: Maximal initial start color of a particle. The
277 real color of every particle is calculated as random interpolation 277 real color of every particle is calculated as random interpolation
278 between minStartColor and maxStartColor. 278 between minStartColor and maxStartColor.
279 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. 279 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
280 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. 280 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
281 \param maxAngleDegrees: Maximal angle in degrees, the emitting 281 \param maxAngleDegrees: Maximal angle in degrees, the emitting
282 direction of the particle will differ from the original direction. 282 direction of the particle will differ from the original direction.
283 \param minStartSize: Minimal initial start size of a particle. The 283 \param minStartSize: Minimal initial start size of a particle. The
284 real size of every particle is calculated as random interpolation 284 real size of every particle is calculated as random interpolation
285 between minStartSize and maxStartSize. 285 between minStartSize and maxStartSize.
286 \param maxStartSize: Maximal initial start size of a particle. The 286 \param maxStartSize: Maximal initial start size of a particle. The
287 real size of every particle is calculated as random interpolation 287 real size of every particle is calculated as random interpolation
288 between minStartSize and maxStartSize. 288 between minStartSize and maxStartSize.
289 \return Pointer to the created particle emitter. To set this emitter 289 \return Pointer to the created particle emitter. To set this emitter
290 as new emitter of this particle system, just call setEmitter(). Note 290 as new emitter of this particle system, just call setEmitter(). Note
291 that you'll have to drop() the returned pointer, after you don't need 291 that you'll have to drop() the returned pointer, after you don't need
292 it any more, see IReferenceCounted::drop() for more informations. */ 292 it any more, see IReferenceCounted::drop() for more informations. */
293 virtual IParticleMeshEmitter* createMeshEmitter( 293 virtual IParticleMeshEmitter* createMeshEmitter(
294 scene::IMesh* mesh, bool useNormalDirection = true, 294 scene::IMesh* mesh, bool useNormalDirection = true,
295 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), 295 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
296 f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1, 296 f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1,
297 bool everyMeshVertex = false, 297 bool everyMeshVertex = false,
298 u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10, 298 u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
299 const video::SColor& minStartColor = video::SColor(255,0,0,0), 299 const video::SColor& minStartColor = video::SColor(255,0,0,0),
300 const video::SColor& maxStartColor = video::SColor(255,255,255,255), 300 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
301 u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000, 301 u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
302 s32 maxAngleDegrees = 0, 302 s32 maxAngleDegrees = 0,
303 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), 303 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
304 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; 304 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
305 305
306 //! Creates a point particle emitter. 306 //! Creates a point particle emitter.
307 /** \param direction: Direction and speed of particle emission. 307 /** \param direction: Direction and speed of particle emission.
308 \param minParticlesPerSecond: Minimal amount of particles emitted per 308 \param minParticlesPerSecond: Minimal amount of particles emitted per
309 second. 309 second.
310 \param maxParticlesPerSecond: Maximal amount of particles emitted per 310 \param maxParticlesPerSecond: Maximal amount of particles emitted per
311 second. 311 second.
312 \param minStartColor: Minimal initial start color of a particle. The 312 \param minStartColor: Minimal initial start color of a particle. The
313 real color of every particle is calculated as random interpolation 313 real color of every particle is calculated as random interpolation
314 between minStartColor and maxStartColor. 314 between minStartColor and maxStartColor.
315 \param maxStartColor: Maximal initial start color of a particle. The 315 \param maxStartColor: Maximal initial start color of a particle. The
316 real color of every particle is calculated as random interpolation 316 real color of every particle is calculated as random interpolation
317 between minStartColor and maxStartColor. 317 between minStartColor and maxStartColor.
318 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. 318 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
319 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. 319 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
320 \param maxAngleDegrees: Maximal angle in degrees, the emitting 320 \param maxAngleDegrees: Maximal angle in degrees, the emitting
321 direction of the particle will differ from the original direction. 321 direction of the particle will differ from the original direction.
322 \param minStartSize: Minimal initial start size of a particle. The 322 \param minStartSize: Minimal initial start size of a particle. The
323 real size of every particle is calculated as random interpolation 323 real size of every particle is calculated as random interpolation
324 between minStartSize and maxStartSize. 324 between minStartSize and maxStartSize.
325 \param maxStartSize: Maximal initial start size of a particle. The 325 \param maxStartSize: Maximal initial start size of a particle. The
326 real size of every particle is calculated as random interpolation 326 real size of every particle is calculated as random interpolation
327 between minStartSize and maxStartSize. 327 between minStartSize and maxStartSize.
328 \return Pointer to the created particle emitter. To set this emitter 328 \return Pointer to the created particle emitter. To set this emitter
329 as new emitter of this particle system, just call setEmitter(). Note 329 as new emitter of this particle system, just call setEmitter(). Note
330 that you'll have to drop() the returned pointer, after you don't need 330 that you'll have to drop() the returned pointer, after you don't need
331 it any more, see IReferenceCounted::drop() for more informations. */ 331 it any more, see IReferenceCounted::drop() for more informations. */
332 virtual IParticlePointEmitter* createPointEmitter( 332 virtual IParticlePointEmitter* createPointEmitter(
333 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), 333 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
334 u32 minParticlesPerSecond = 5, 334 u32 minParticlesPerSecond = 5,
335 u32 maxParticlesPerSecond = 10, 335 u32 maxParticlesPerSecond = 10,
336 const video::SColor& minStartColor = video::SColor(255,0,0,0), 336 const video::SColor& minStartColor = video::SColor(255,0,0,0),
337 const video::SColor& maxStartColor = video::SColor(255,255,255,255), 337 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
338 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, 338 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
339 s32 maxAngleDegrees=0, 339 s32 maxAngleDegrees=0,
340 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), 340 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
341 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; 341 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
342 342
343 //! Creates a ring particle emitter. 343 //! Creates a ring particle emitter.
344 /** \param center: Center of ring 344 /** \param center: Center of ring
345 \param radius: Distance of points from center, points will be rotated 345 \param radius: Distance of points from center, points will be rotated
346 around the Y axis at a random 360 degrees and will then be shifted by 346 around the Y axis at a random 360 degrees and will then be shifted by
347 the provided ringThickness values in each axis. 347 the provided ringThickness values in each axis.
348 \param ringThickness : thickness of the ring or how wide the ring is 348 \param ringThickness : thickness of the ring or how wide the ring is
349 \param direction: Direction and speed of particle emission. 349 \param direction: Direction and speed of particle emission.
350 \param minParticlesPerSecond: Minimal amount of particles emitted per 350 \param minParticlesPerSecond: Minimal amount of particles emitted per
351 second. 351 second.
352 \param maxParticlesPerSecond: Maximal amount of particles emitted per 352 \param maxParticlesPerSecond: Maximal amount of particles emitted per
353 second. 353 second.
354 \param minStartColor: Minimal initial start color of a particle. The 354 \param minStartColor: Minimal initial start color of a particle. The
355 real color of every particle is calculated as random interpolation 355 real color of every particle is calculated as random interpolation
356 between minStartColor and maxStartColor. 356 between minStartColor and maxStartColor.
357 \param maxStartColor: Maximal initial start color of a particle. The 357 \param maxStartColor: Maximal initial start color of a particle. The
358 real color of every particle is calculated as random interpolation 358 real color of every particle is calculated as random interpolation
359 between minStartColor and maxStartColor. 359 between minStartColor and maxStartColor.
360 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. 360 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
361 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. 361 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
362 \param maxAngleDegrees: Maximal angle in degrees, the emitting 362 \param maxAngleDegrees: Maximal angle in degrees, the emitting
363 direction of the particle will differ from the original direction. 363 direction of the particle will differ from the original direction.
364 \param minStartSize: Minimal initial start size of a particle. The 364 \param minStartSize: Minimal initial start size of a particle. The
365 real size of every particle is calculated as random interpolation 365 real size of every particle is calculated as random interpolation
366 between minStartSize and maxStartSize. 366 between minStartSize and maxStartSize.
367 \param maxStartSize: Maximal initial start size of a particle. The 367 \param maxStartSize: Maximal initial start size of a particle. The
368 real size of every particle is calculated as random interpolation 368 real size of every particle is calculated as random interpolation
369 between minStartSize and maxStartSize. 369 between minStartSize and maxStartSize.
370 \return Pointer to the created particle emitter. To set this emitter 370 \return Pointer to the created particle emitter. To set this emitter
371 as new emitter of this particle system, just call setEmitter(). Note 371 as new emitter of this particle system, just call setEmitter(). Note
372 that you'll have to drop() the returned pointer, after you don't need 372 that you'll have to drop() the returned pointer, after you don't need
373 it any more, see IReferenceCounted::drop() for more informations. */ 373 it any more, see IReferenceCounted::drop() for more informations. */
374 virtual IParticleRingEmitter* createRingEmitter( 374 virtual IParticleRingEmitter* createRingEmitter(
375 const core::vector3df& center, f32 radius, f32 ringThickness, 375 const core::vector3df& center, f32 radius, f32 ringThickness,
376 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), 376 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
377 u32 minParticlesPerSecond = 5, 377 u32 minParticlesPerSecond = 5,
378 u32 maxParticlesPerSecond = 10, 378 u32 maxParticlesPerSecond = 10,
379 const video::SColor& minStartColor = video::SColor(255,0,0,0), 379 const video::SColor& minStartColor = video::SColor(255,0,0,0),
380 const video::SColor& maxStartColor = video::SColor(255,255,255,255), 380 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
381 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, 381 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
382 s32 maxAngleDegrees=0, 382 s32 maxAngleDegrees=0,
383 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), 383 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
384 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; 384 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
385 385
386 //! Creates a sphere particle emitter. 386 //! Creates a sphere particle emitter.
387 /** \param center: Center of sphere 387 /** \param center: Center of sphere
388 \param radius: Radius of sphere 388 \param radius: Radius of sphere
389 \param direction: Direction and speed of particle emission. 389 \param direction: Direction and speed of particle emission.
390 \param minParticlesPerSecond: Minimal amount of particles emitted per 390 \param minParticlesPerSecond: Minimal amount of particles emitted per
391 second. 391 second.
392 \param maxParticlesPerSecond: Maximal amount of particles emitted per 392 \param maxParticlesPerSecond: Maximal amount of particles emitted per
393 second. 393 second.
394 \param minStartColor: Minimal initial start color of a particle. The 394 \param minStartColor: Minimal initial start color of a particle. The
395 real color of every particle is calculated as random interpolation 395 real color of every particle is calculated as random interpolation
396 between minStartColor and maxStartColor. 396 between minStartColor and maxStartColor.
397 \param maxStartColor: Maximal initial start color of a particle. The 397 \param maxStartColor: Maximal initial start color of a particle. The
398 real color of every particle is calculated as random interpolation 398 real color of every particle is calculated as random interpolation
399 between minStartColor and maxStartColor. 399 between minStartColor and maxStartColor.
400 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds. 400 \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
401 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds. 401 \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
402 \param maxAngleDegrees: Maximal angle in degrees, the emitting 402 \param maxAngleDegrees: Maximal angle in degrees, the emitting
403 direction of the particle will differ from the original direction. 403 direction of the particle will differ from the original direction.
404 \param minStartSize: Minimal initial start size of a particle. The 404 \param minStartSize: Minimal initial start size of a particle. The
405 real size of every particle is calculated as random interpolation 405 real size of every particle is calculated as random interpolation
406 between minStartSize and maxStartSize. 406 between minStartSize and maxStartSize.
407 \param maxStartSize: Maximal initial start size of a particle. The 407 \param maxStartSize: Maximal initial start size of a particle. The
408 real size of every particle is calculated as random interpolation 408 real size of every particle is calculated as random interpolation
409 between minStartSize and maxStartSize. 409 between minStartSize and maxStartSize.
410 \return Pointer to the created particle emitter. To set this emitter 410 \return Pointer to the created particle emitter. To set this emitter
411 as new emitter of this particle system, just call setEmitter(). Note 411 as new emitter of this particle system, just call setEmitter(). Note
412 that you'll have to drop() the returned pointer, after you don't need 412 that you'll have to drop() the returned pointer, after you don't need
413 it any more, see IReferenceCounted::drop() for more informations. */ 413 it any more, see IReferenceCounted::drop() for more informations. */
414 virtual IParticleSphereEmitter* createSphereEmitter( 414 virtual IParticleSphereEmitter* createSphereEmitter(
415 const core::vector3df& center, f32 radius, 415 const core::vector3df& center, f32 radius,
416 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f), 416 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
417 u32 minParticlesPerSecond = 5, 417 u32 minParticlesPerSecond = 5,
418 u32 maxParticlesPerSecond = 10, 418 u32 maxParticlesPerSecond = 10,
419 const video::SColor& minStartColor = video::SColor(255,0,0,0), 419 const video::SColor& minStartColor = video::SColor(255,0,0,0),
420 const video::SColor& maxStartColor = video::SColor(255,255,255,255), 420 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
421 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000, 421 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
422 s32 maxAngleDegrees=0, 422 s32 maxAngleDegrees=0,
423 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), 423 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
424 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0; 424 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
425 425
426 //! Creates a point attraction affector. 426 //! Creates a point attraction affector.
427 /** This affector modifies the positions of the particles and attracts 427 /** This affector modifies the positions of the particles and attracts
428 them to a specified point at a specified speed per second. 428 them to a specified point at a specified speed per second.
429 \param point: Point to attract particles to. 429 \param point: Point to attract particles to.
430 \param speed: Speed in units per second, to attract to the specified 430 \param speed: Speed in units per second, to attract to the specified
431 point. 431 point.
432 \param attract: Whether the particles attract or detract from this 432 \param attract: Whether the particles attract or detract from this
433 point. 433 point.
434 \param affectX: Whether or not this will affect the X position of the 434 \param affectX: Whether or not this will affect the X position of the
435 particle. 435 particle.
436 \param affectY: Whether or not this will affect the Y position of the 436 \param affectY: Whether or not this will affect the Y position of the
437 particle. 437 particle.
438 \param affectZ: Whether or not this will affect the Z position of the 438 \param affectZ: Whether or not this will affect the Z position of the
439 particle. 439 particle.
440 \return Pointer to the created particle affector. To add this affector 440 \return Pointer to the created particle affector. To add this affector
441 as new affector of this particle system, just call addAffector(). Note 441 as new affector of this particle system, just call addAffector(). Note
442 that you'll have to drop() the returned pointer, after you don't need 442 that you'll have to drop() the returned pointer, after you don't need
443 it any more, see IReferenceCounted::drop() for more informations. */ 443 it any more, see IReferenceCounted::drop() for more informations. */
444 virtual IParticleAttractionAffector* createAttractionAffector( 444 virtual IParticleAttractionAffector* createAttractionAffector(
445 const core::vector3df& point, f32 speed = 1.0f, bool attract = true, 445 const core::vector3df& point, f32 speed = 1.0f, bool attract = true,
446 bool affectX = true, bool affectY = true, bool affectZ = true) = 0; 446 bool affectX = true, bool affectY = true, bool affectZ = true) = 0;
447 447
448 //! Creates a scale particle affector. 448 //! Creates a scale particle affector.
449 /** This affector scales the particle to the a multiple of its size defined 449 /** This affector scales the particle to the a multiple of its size defined
450 by the scaleTo variable. 450 by the scaleTo variable.
451 \param scaleTo: multiple of the size which the particle will be scaled to until deletion 451 \param scaleTo: multiple of the size which the particle will be scaled to until deletion
452 \return Pointer to the created particle affector. 452 \return Pointer to the created particle affector.
453 To add this affector as new affector of this particle system, 453 To add this affector as new affector of this particle system,
454 just call addAffector(). Note that you'll have to drop() the 454 just call addAffector(). Note that you'll have to drop() the
455 returned pointer, after you don't need it any more, see 455 returned pointer, after you don't need it any more, see
456 IReferenceCounted::drop() for more information. */ 456 IReferenceCounted::drop() for more information. */
457 virtual IParticleAffector* createScaleParticleAffector(const core::dimension2df& scaleTo = core::dimension2df(1.0f, 1.0f)) = 0; 457 virtual IParticleAffector* createScaleParticleAffector(const core::dimension2df& scaleTo = core::dimension2df(1.0f, 1.0f)) = 0;
458 458
459 //! Creates a fade out particle affector. 459 //! Creates a fade out particle affector.
460 /** This affector modifies the color of every particle and and reaches 460 /** This affector modifies the color of every particle and and reaches
461 the final color when the particle dies. This affector looks really 461 the final color when the particle dies. This affector looks really
462 good, if the EMT_TRANSPARENT_ADD_COLOR material is used and the 462 good, if the EMT_TRANSPARENT_ADD_COLOR material is used and the
463 targetColor is video::SColor(0,0,0,0): Particles are fading out into 463 targetColor is video::SColor(0,0,0,0): Particles are fading out into
464 void with this setting. 464 void with this setting.
465 \param targetColor: Color whereto the color of the particle is changed. 465 \param targetColor: Color whereto the color of the particle is changed.
466 \param timeNeededToFadeOut: How much time in milli seconds should the 466 \param timeNeededToFadeOut: How much time in milli seconds should the
467 affector need to change the color to the targetColor. 467 affector need to change the color to the targetColor.
468 \return Pointer to the created particle affector. To add this affector 468 \return Pointer to the created particle affector. To add this affector
469 as new affector of this particle system, just call addAffector(). Note 469 as new affector of this particle system, just call addAffector(). Note
470 that you'll have to drop() the returned pointer, after you don't need 470 that you'll have to drop() the returned pointer, after you don't need
471 it any more, see IReferenceCounted::drop() for more informations. */ 471 it any more, see IReferenceCounted::drop() for more informations. */
472 virtual IParticleFadeOutAffector* createFadeOutParticleAffector( 472 virtual IParticleFadeOutAffector* createFadeOutParticleAffector(
473 const video::SColor& targetColor = video::SColor(0,0,0,0), 473 const video::SColor& targetColor = video::SColor(0,0,0,0),
474 u32 timeNeededToFadeOut = 1000) = 0; 474 u32 timeNeededToFadeOut = 1000) = 0;
475 475
476 //! Creates a gravity affector. 476 //! Creates a gravity affector.
477 /** This affector modifies the direction of the particle. It assumes 477 /** This affector modifies the direction of the particle. It assumes
478 that the particle is fired out of the emitter with huge force, but is 478 that the particle is fired out of the emitter with huge force, but is
479 loosing this after some time and is catched by the gravity then. This 479 loosing this after some time and is catched by the gravity then. This
480 affector is ideal for creating things like fountains. 480 affector is ideal for creating things like fountains.
481 \param gravity: Direction and force of gravity. 481 \param gravity: Direction and force of gravity.
482 \param timeForceLost: Time in milli seconds when the force of the 482 \param timeForceLost: Time in milli seconds when the force of the
483 emitter is totally lost and the particle does not move any more. This 483 emitter is totally lost and the particle does not move any more. This
484 is the time where gravity fully affects the particle. 484 is the time where gravity fully affects the particle.
485 \return Pointer to the created particle affector. To add this affector 485 \return Pointer to the created particle affector. To add this affector
486 as new affector of this particle system, just call addAffector(). Note 486 as new affector of this particle system, just call addAffector(). Note
487 that you'll have to drop() the returned pointer, after you don't need 487 that you'll have to drop() the returned pointer, after you don't need
488 it any more, see IReferenceCounted::drop() for more informations. */ 488 it any more, see IReferenceCounted::drop() for more informations. */
489 virtual IParticleGravityAffector* createGravityAffector( 489 virtual IParticleGravityAffector* createGravityAffector(
490 const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f), 490 const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f),
491 u32 timeForceLost = 1000) = 0; 491 u32 timeForceLost = 1000) = 0;
492 492
493 //! Creates a rotation affector. 493 //! Creates a rotation affector.
494 /** This affector modifies the positions of the particles and attracts 494 /** This affector modifies the positions of the particles and attracts
495 them to a specified point at a specified speed per second. 495 them to a specified point at a specified speed per second.
496 \param speed: Rotation in degrees per second 496 \param speed: Rotation in degrees per second
497 \param pivotPoint: Point to rotate the particles around 497 \param pivotPoint: Point to rotate the particles around
498 \return Pointer to the created particle affector. To add this affector 498 \return Pointer to the created particle affector. To add this affector
499 as new affector of this particle system, just call addAffector(). Note 499 as new affector of this particle system, just call addAffector(). Note
500 that you'll have to drop() the returned pointer, after you don't need 500 that you'll have to drop() the returned pointer, after you don't need
501 it any more, see IReferenceCounted::drop() for more informations. */ 501 it any more, see IReferenceCounted::drop() for more informations. */
502 virtual IParticleRotationAffector* createRotationAffector( 502 virtual IParticleRotationAffector* createRotationAffector(
503 const core::vector3df& speed = core::vector3df(5.0f,5.0f,5.0f), 503 const core::vector3df& speed = core::vector3df(5.0f,5.0f,5.0f),
504 const core::vector3df& pivotPoint = core::vector3df(0.0f,0.0f,0.0f) ) = 0; 504 const core::vector3df& pivotPoint = core::vector3df(0.0f,0.0f,0.0f) ) = 0;
505}; 505};
506 506
507} // end namespace scene 507} // end namespace scene
508} // end namespace irr 508} // end namespace irr
509 509
510 510
511#endif 511#endif
512 512
diff --git a/libraries/irrlicht-1.8/include/IQ3LevelMesh.h b/libraries/irrlicht-1.8/include/IQ3LevelMesh.h
index 62feffc..f8ff03f 100644
--- a/libraries/irrlicht-1.8/include/IQ3LevelMesh.h
+++ b/libraries/irrlicht-1.8/include/IQ3LevelMesh.h
@@ -1,46 +1,46 @@
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#ifndef __I_Q3_LEVEL_MESH_H_INCLUDED__ 5#ifndef __I_Q3_LEVEL_MESH_H_INCLUDED__
6#define __I_Q3_LEVEL_MESH_H_INCLUDED__ 6#define __I_Q3_LEVEL_MESH_H_INCLUDED__
7 7
8#include "IAnimatedMesh.h" 8#include "IAnimatedMesh.h"
9#include "IQ3Shader.h" 9#include "IQ3Shader.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 //! Interface for a Mesh which can be loaded directly from a Quake3 .bsp-file. 15 //! Interface for a Mesh which can be loaded directly from a Quake3 .bsp-file.
16 /** The Mesh tries to load all textures of the map.*/ 16 /** The Mesh tries to load all textures of the map.*/
17 class IQ3LevelMesh : public IAnimatedMesh 17 class IQ3LevelMesh : public IAnimatedMesh
18 { 18 {
19 public: 19 public:
20 20
21 //! loads the shader definition from file 21 //! loads the shader definition from file
22 /** \param filename Name of the shaderfile, defaults to /scripts if fileNameIsValid is false. 22 /** \param filename Name of the shaderfile, defaults to /scripts if fileNameIsValid is false.
23 \param fileNameIsValid Specifies whether the filename is valid in the current situation. */ 23 \param fileNameIsValid Specifies whether the filename is valid in the current situation. */
24 virtual const quake3::IShader* getShader( const c8* filename, bool fileNameIsValid=true ) = 0; 24 virtual const quake3::IShader* getShader( const c8* filename, bool fileNameIsValid=true ) = 0;
25 25
26 //! returns a already loaded Shader 26 //! returns a already loaded Shader
27 virtual const quake3::IShader* getShader(u32 index) const = 0; 27 virtual const quake3::IShader* getShader(u32 index) const = 0;
28 28
29 //! get's an interface to the entities 29 //! get's an interface to the entities
30 virtual quake3::tQ3EntityList& getEntityList() = 0; 30 virtual quake3::tQ3EntityList& getEntityList() = 0;
31 31
32 //! returns the requested brush entity 32 //! returns the requested brush entity
33 /** \param num The number from the model key of the entity. 33 /** \param num The number from the model key of the entity.
34 34
35 Use this interface if you parse the entities yourself.*/ 35 Use this interface if you parse the entities yourself.*/
36 virtual IMesh* getBrushEntityMesh(s32 num) const = 0; 36 virtual IMesh* getBrushEntityMesh(s32 num) const = 0;
37 37
38 //! returns the requested brush entity 38 //! returns the requested brush entity
39 virtual IMesh* getBrushEntityMesh(quake3::IEntity &ent) const = 0; 39 virtual IMesh* getBrushEntityMesh(quake3::IEntity &ent) const = 0;
40 }; 40 };
41 41
42} // end namespace scene 42} // end namespace scene
43} // end namespace irr 43} // end namespace irr
44 44
45#endif 45#endif
46 46
diff --git a/libraries/irrlicht-1.8/include/IQ3Shader.h b/libraries/irrlicht-1.8/include/IQ3Shader.h
index 080471a..3163651 100644
--- a/libraries/irrlicht-1.8/include/IQ3Shader.h
+++ b/libraries/irrlicht-1.8/include/IQ3Shader.h
@@ -1,884 +1,884 @@
1// Copyright (C) 2006-2012 Nikolaus Gebhardt / Thomas Alten 1// Copyright (C) 2006-2012 Nikolaus Gebhardt / Thomas Alten
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#ifndef __I_Q3_LEVEL_SHADER_H_INCLUDED__ 5#ifndef __I_Q3_LEVEL_SHADER_H_INCLUDED__
6#define __I_Q3_LEVEL_SHADER_H_INCLUDED__ 6#define __I_Q3_LEVEL_SHADER_H_INCLUDED__
7 7
8#include "irrArray.h" 8#include "irrArray.h"
9#include "fast_atof.h" 9#include "fast_atof.h"
10#include "IFileSystem.h" 10#include "IFileSystem.h"
11#include "IVideoDriver.h" 11#include "IVideoDriver.h"
12#include "coreutil.h" 12#include "coreutil.h"
13 13
14namespace irr 14namespace irr
15{ 15{
16namespace scene 16namespace scene
17{ 17{
18namespace quake3 18namespace quake3
19{ 19{
20 20
21 static core::stringc irrEmptyStringc(""); 21 static core::stringc irrEmptyStringc("");
22 22
23 //! Hold the different Mesh Types used for getMesh 23 //! Hold the different Mesh Types used for getMesh
24 enum eQ3MeshIndex 24 enum eQ3MeshIndex
25 { 25 {
26 E_Q3_MESH_GEOMETRY = 0, 26 E_Q3_MESH_GEOMETRY = 0,
27 E_Q3_MESH_ITEMS, 27 E_Q3_MESH_ITEMS,
28 E_Q3_MESH_BILLBOARD, 28 E_Q3_MESH_BILLBOARD,
29 E_Q3_MESH_FOG, 29 E_Q3_MESH_FOG,
30 E_Q3_MESH_UNRESOLVED, 30 E_Q3_MESH_UNRESOLVED,
31 E_Q3_MESH_SIZE 31 E_Q3_MESH_SIZE
32 }; 32 };
33 33
34 /*! used to customize Quake3 BSP Loader 34 /*! used to customize Quake3 BSP Loader
35 */ 35 */
36 36
37 struct Q3LevelLoadParameter 37 struct Q3LevelLoadParameter
38 { 38 {
39 Q3LevelLoadParameter () 39 Q3LevelLoadParameter ()
40 :defaultLightMapMaterial ( video::EMT_LIGHTMAP_M4 ), 40 :defaultLightMapMaterial ( video::EMT_LIGHTMAP_M4 ),
41 defaultModulate ( video::EMFN_MODULATE_4X ), 41 defaultModulate ( video::EMFN_MODULATE_4X ),
42 defaultFilter ( video::EMF_BILINEAR_FILTER ), 42 defaultFilter ( video::EMF_BILINEAR_FILTER ),
43 patchTesselation ( 8 ), 43 patchTesselation ( 8 ),
44 verbose ( 0 ), 44 verbose ( 0 ),
45 startTime ( 0 ), endTime ( 0 ), 45 startTime ( 0 ), endTime ( 0 ),
46 mergeShaderBuffer ( 1 ), 46 mergeShaderBuffer ( 1 ),
47 cleanUnResolvedMeshes ( 1 ), 47 cleanUnResolvedMeshes ( 1 ),
48 loadAllShaders ( 0 ), 48 loadAllShaders ( 0 ),
49 loadSkyShader ( 0 ), 49 loadSkyShader ( 0 ),
50 alpharef ( 1 ), 50 alpharef ( 1 ),
51 swapLump ( 0 ), 51 swapLump ( 0 ),
52 #ifdef __BIG_ENDIAN__ 52 #ifdef __BIG_ENDIAN__
53 swapHeader ( 1 ) 53 swapHeader ( 1 )
54 #else 54 #else
55 swapHeader ( 0 ) 55 swapHeader ( 0 )
56 #endif 56 #endif
57 { 57 {
58 memcpy ( scriptDir, "scripts\x0", 8 ); 58 memcpy ( scriptDir, "scripts\x0", 8 );
59 } 59 }
60 60
61 video::E_MATERIAL_TYPE defaultLightMapMaterial; 61 video::E_MATERIAL_TYPE defaultLightMapMaterial;
62 video::E_MODULATE_FUNC defaultModulate; 62 video::E_MODULATE_FUNC defaultModulate;
63 video::E_MATERIAL_FLAG defaultFilter; 63 video::E_MATERIAL_FLAG defaultFilter;
64 s32 patchTesselation; 64 s32 patchTesselation;
65 s32 verbose; 65 s32 verbose;
66 u32 startTime; 66 u32 startTime;
67 u32 endTime; 67 u32 endTime;
68 s32 mergeShaderBuffer; 68 s32 mergeShaderBuffer;
69 s32 cleanUnResolvedMeshes; 69 s32 cleanUnResolvedMeshes;
70 s32 loadAllShaders; 70 s32 loadAllShaders;
71 s32 loadSkyShader; 71 s32 loadSkyShader;
72 s32 alpharef; 72 s32 alpharef;
73 s32 swapLump; 73 s32 swapLump;
74 s32 swapHeader; 74 s32 swapHeader;
75 c8 scriptDir [ 64 ]; 75 c8 scriptDir [ 64 ];
76 }; 76 };
77 77
78 // some useful typedefs 78 // some useful typedefs
79 typedef core::array< core::stringc > tStringList; 79 typedef core::array< core::stringc > tStringList;
80 typedef core::array< video::ITexture* > tTexArray; 80 typedef core::array< video::ITexture* > tTexArray;
81 81
82 // string helper.. TODO: move to generic files 82 // string helper.. TODO: move to generic files
83 inline s16 isEqual ( const core::stringc &string, u32 &pos, const c8 *list[], u16 listSize ) 83 inline s16 isEqual ( const core::stringc &string, u32 &pos, const c8 *list[], u16 listSize )
84 { 84 {
85 const char * in = string.c_str () + pos; 85 const char * in = string.c_str () + pos;
86 86
87 for ( u16 i = 0; i != listSize; ++i ) 87 for ( u16 i = 0; i != listSize; ++i )
88 { 88 {
89 if (string.size() < pos) 89 if (string.size() < pos)
90 return -2; 90 return -2;
91 u32 len = (u32) strlen ( list[i] ); 91 u32 len = (u32) strlen ( list[i] );
92 if (string.size() < pos+len) 92 if (string.size() < pos+len)
93 continue; 93 continue;
94 if ( in [len] != 0 && in [len] != ' ' ) 94 if ( in [len] != 0 && in [len] != ' ' )
95 continue; 95 continue;
96 if ( strncmp ( in, list[i], len ) ) 96 if ( strncmp ( in, list[i], len ) )
97 continue; 97 continue;
98 98
99 pos += len + 1; 99 pos += len + 1;
100 return (s16) i; 100 return (s16) i;
101 } 101 }
102 return -2; 102 return -2;
103 } 103 }
104 104
105 inline f32 getAsFloat ( const core::stringc &string, u32 &pos ) 105 inline f32 getAsFloat ( const core::stringc &string, u32 &pos )
106 { 106 {
107 const char * in = string.c_str () + pos; 107 const char * in = string.c_str () + pos;
108 108
109 f32 value = 0.f; 109 f32 value = 0.f;
110 pos += (u32) ( core::fast_atof_move ( in, value ) - in ) + 1; 110 pos += (u32) ( core::fast_atof_move ( in, value ) - in ) + 1;
111 return value; 111 return value;
112 } 112 }
113 113
114 //! get a quake3 vector translated to irrlicht position (x,-z,y ) 114 //! get a quake3 vector translated to irrlicht position (x,-z,y )
115 inline core::vector3df getAsVector3df ( const core::stringc &string, u32 &pos ) 115 inline core::vector3df getAsVector3df ( const core::stringc &string, u32 &pos )
116 { 116 {
117 core::vector3df v; 117 core::vector3df v;
118 118
119 v.X = getAsFloat ( string, pos ); 119 v.X = getAsFloat ( string, pos );
120 v.Z = getAsFloat ( string, pos ); 120 v.Z = getAsFloat ( string, pos );
121 v.Y = getAsFloat ( string, pos ); 121 v.Y = getAsFloat ( string, pos );
122 122
123 return v; 123 return v;
124 } 124 }
125 125
126 126
127 /* 127 /*
128 extract substrings 128 extract substrings
129 */ 129 */
130 inline void getAsStringList ( tStringList &list, s32 max, const core::stringc &string, u32 &startPos ) 130 inline void getAsStringList ( tStringList &list, s32 max, const core::stringc &string, u32 &startPos )
131 { 131 {
132 list.clear (); 132 list.clear ();
133 133
134 s32 finish = 0; 134 s32 finish = 0;
135 s32 endPos; 135 s32 endPos;
136 do 136 do
137 { 137 {
138 endPos = string.findNext ( ' ', startPos ); 138 endPos = string.findNext ( ' ', startPos );
139 if ( endPos == -1 ) 139 if ( endPos == -1 )
140 { 140 {
141 finish = 1; 141 finish = 1;
142 endPos = string.size(); 142 endPos = string.size();
143 } 143 }
144 144
145 list.push_back ( string.subString ( startPos, endPos - startPos ) ); 145 list.push_back ( string.subString ( startPos, endPos - startPos ) );
146 startPos = endPos + 1; 146 startPos = endPos + 1;
147 147
148 if ( list.size() >= (u32) max ) 148 if ( list.size() >= (u32) max )
149 finish = 1; 149 finish = 1;
150 150
151 } while ( !finish ); 151 } while ( !finish );
152 152
153 } 153 }
154 154
155 //! A blend function for a q3 shader. 155 //! A blend function for a q3 shader.
156 struct SBlendFunc 156 struct SBlendFunc
157 { 157 {
158 SBlendFunc ( video::E_MODULATE_FUNC mod ) 158 SBlendFunc ( video::E_MODULATE_FUNC mod )
159 : type ( video::EMT_SOLID ), modulate ( mod ), 159 : type ( video::EMT_SOLID ), modulate ( mod ),
160 param0( 0.f ), 160 param0( 0.f ),
161 isTransparent ( 0 ) {} 161 isTransparent ( 0 ) {}
162 162
163 video::E_MATERIAL_TYPE type; 163 video::E_MATERIAL_TYPE type;
164 video::E_MODULATE_FUNC modulate; 164 video::E_MODULATE_FUNC modulate;
165 165
166 f32 param0; 166 f32 param0;
167 u32 isTransparent; 167 u32 isTransparent;
168 }; 168 };
169 169
170 // parses the content of Variable cull 170 // parses the content of Variable cull
171 inline bool getCullingFunction ( const core::stringc &cull ) 171 inline bool getCullingFunction ( const core::stringc &cull )
172 { 172 {
173 if ( cull.size() == 0 ) 173 if ( cull.size() == 0 )
174 return true; 174 return true;
175 175
176 bool ret = true; 176 bool ret = true;
177 static const c8 * funclist[] = { "none", "disable", "twosided" }; 177 static const c8 * funclist[] = { "none", "disable", "twosided" };
178 178
179 u32 pos = 0; 179 u32 pos = 0;
180 switch ( isEqual ( cull, pos, funclist, 3 ) ) 180 switch ( isEqual ( cull, pos, funclist, 3 ) )
181 { 181 {
182 case 0: 182 case 0:
183 case 1: 183 case 1:
184 case 2: 184 case 2:
185 ret = false; 185 ret = false;
186 break; 186 break;
187 } 187 }
188 return ret; 188 return ret;
189 } 189 }
190 190
191 // parses the content of Variable depthfunc 191 // parses the content of Variable depthfunc
192 // return a z-test 192 // return a z-test
193 inline u8 getDepthFunction ( const core::stringc &string ) 193 inline u8 getDepthFunction ( const core::stringc &string )
194 { 194 {
195 u8 ret = video::ECFN_LESSEQUAL; 195 u8 ret = video::ECFN_LESSEQUAL;
196 196
197 if ( string.size() == 0 ) 197 if ( string.size() == 0 )
198 return ret; 198 return ret;
199 199
200 static const c8 * funclist[] = { "lequal","equal" }; 200 static const c8 * funclist[] = { "lequal","equal" };
201 201
202 u32 pos = 0; 202 u32 pos = 0;
203 switch ( isEqual ( string, pos, funclist, 2 ) ) 203 switch ( isEqual ( string, pos, funclist, 2 ) )
204 { 204 {
205 case 0: 205 case 0:
206 ret = video::ECFN_LESSEQUAL; 206 ret = video::ECFN_LESSEQUAL;
207 case 1: 207 case 1:
208 ret = video::ECFN_EQUAL; 208 ret = video::ECFN_EQUAL;
209 break; 209 break;
210 } 210 }
211 return ret; 211 return ret;
212 } 212 }
213 213
214 214
215 /*! 215 /*!
216 parses the content of Variable blendfunc,alphafunc 216 parses the content of Variable blendfunc,alphafunc
217 it also make a hint for rendering as transparent or solid node. 217 it also make a hint for rendering as transparent or solid node.
218 218
219 we assume a typical quake scene would look like this.. 219 we assume a typical quake scene would look like this..
220 1) Big Static Mesh ( solid ) 220 1) Big Static Mesh ( solid )
221 2) static scene item ( may use transparency ) but rendered in the solid pass 221 2) static scene item ( may use transparency ) but rendered in the solid pass
222 3) additional transparency item in the transparent pass 222 3) additional transparency item in the transparent pass
223 223
224 it's not 100% accurate! it just empirical.. 224 it's not 100% accurate! it just empirical..
225 */ 225 */
226 inline static void getBlendFunc ( const core::stringc &string, SBlendFunc &blendfunc ) 226 inline static void getBlendFunc ( const core::stringc &string, SBlendFunc &blendfunc )
227 { 227 {
228 if ( string.size() == 0 ) 228 if ( string.size() == 0 )
229 return; 229 return;
230 230
231 // maps to E_BLEND_FACTOR 231 // maps to E_BLEND_FACTOR
232 static const c8 * funclist[] = 232 static const c8 * funclist[] =
233 { 233 {
234 "gl_zero", 234 "gl_zero",
235 "gl_one", 235 "gl_one",
236 "gl_dst_color", 236 "gl_dst_color",
237 "gl_one_minus_dst_color", 237 "gl_one_minus_dst_color",
238 "gl_src_color", 238 "gl_src_color",
239 "gl_one_minus_src_color", 239 "gl_one_minus_src_color",
240 "gl_src_alpha", 240 "gl_src_alpha",
241 "gl_one_minus_src_alpha", 241 "gl_one_minus_src_alpha",
242 "gl_dst_alpha", 242 "gl_dst_alpha",
243 "gl_one_minus_dst_alpha", 243 "gl_one_minus_dst_alpha",
244 "gl_src_alpha_sat", 244 "gl_src_alpha_sat",
245 245
246 "add", 246 "add",
247 "filter", 247 "filter",
248 "blend", 248 "blend",
249 249
250 "ge128", 250 "ge128",
251 "gt0", 251 "gt0",
252 }; 252 };
253 253
254 254
255 u32 pos = 0; 255 u32 pos = 0;
256 s32 srcFact = isEqual ( string, pos, funclist, 16 ); 256 s32 srcFact = isEqual ( string, pos, funclist, 16 );
257 257
258 if ( srcFact < 0 ) 258 if ( srcFact < 0 )
259 return; 259 return;
260 260
261 u32 resolved = 0; 261 u32 resolved = 0;
262 s32 dstFact = isEqual ( string, pos, funclist, 16 ); 262 s32 dstFact = isEqual ( string, pos, funclist, 16 );
263 263
264 switch ( srcFact ) 264 switch ( srcFact )
265 { 265 {
266 case video::EBF_ZERO: 266 case video::EBF_ZERO:
267 switch ( dstFact ) 267 switch ( dstFact )
268 { 268 {
269 // gl_zero gl_src_color == gl_dst_color gl_zero 269 // gl_zero gl_src_color == gl_dst_color gl_zero
270 case video::EBF_SRC_COLOR: 270 case video::EBF_SRC_COLOR:
271 blendfunc.type = video::EMT_ONETEXTURE_BLEND; 271 blendfunc.type = video::EMT_ONETEXTURE_BLEND;
272 blendfunc.param0 = video::pack_textureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, blendfunc.modulate ); 272 blendfunc.param0 = video::pack_textureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, blendfunc.modulate );
273 blendfunc.isTransparent = 1; 273 blendfunc.isTransparent = 1;
274 resolved = 1; 274 resolved = 1;
275 break; 275 break;
276 } break; 276 } break;
277 277
278 case video::EBF_ONE: 278 case video::EBF_ONE:
279 switch ( dstFact ) 279 switch ( dstFact )
280 { 280 {
281 // gl_one gl_zero 281 // gl_one gl_zero
282 case video::EBF_ZERO: 282 case video::EBF_ZERO:
283 blendfunc.type = video::EMT_SOLID; 283 blendfunc.type = video::EMT_SOLID;
284 blendfunc.isTransparent = 0; 284 blendfunc.isTransparent = 0;
285 resolved = 1; 285 resolved = 1;
286 break; 286 break;
287 287
288 // gl_one gl_one 288 // gl_one gl_one
289 case video::EBF_ONE: 289 case video::EBF_ONE:
290 blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR; 290 blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR;
291 blendfunc.isTransparent = 1; 291 blendfunc.isTransparent = 1;
292 resolved = 1; 292 resolved = 1;
293 break; 293 break;
294 } break; 294 } break;
295 295
296 case video::EBF_SRC_ALPHA: 296 case video::EBF_SRC_ALPHA:
297 switch ( dstFact ) 297 switch ( dstFact )
298 { 298 {
299 // gl_src_alpha gl_one_minus_src_alpha 299 // gl_src_alpha gl_one_minus_src_alpha
300 case video::EBF_ONE_MINUS_SRC_ALPHA: 300 case video::EBF_ONE_MINUS_SRC_ALPHA:
301 blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; 301 blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
302 blendfunc.param0 = 1.f/255.f; 302 blendfunc.param0 = 1.f/255.f;
303 blendfunc.isTransparent = 1; 303 blendfunc.isTransparent = 1;
304 resolved = 1; 304 resolved = 1;
305 break; 305 break;
306 } break; 306 } break;
307 307
308 case 11: 308 case 11:
309 // add 309 // add
310 blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR; 310 blendfunc.type = video::EMT_TRANSPARENT_ADD_COLOR;
311 blendfunc.isTransparent = 1; 311 blendfunc.isTransparent = 1;
312 resolved = 1; 312 resolved = 1;
313 break; 313 break;
314 case 12: 314 case 12:
315 // filter = gl_dst_color gl_zero or gl_zero gl_src_color 315 // filter = gl_dst_color gl_zero or gl_zero gl_src_color
316 blendfunc.type = video::EMT_ONETEXTURE_BLEND; 316 blendfunc.type = video::EMT_ONETEXTURE_BLEND;
317 blendfunc.param0 = video::pack_textureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, blendfunc.modulate ); 317 blendfunc.param0 = video::pack_textureBlendFunc ( video::EBF_DST_COLOR, video::EBF_ZERO, blendfunc.modulate );
318 blendfunc.isTransparent = 1; 318 blendfunc.isTransparent = 1;
319 resolved = 1; 319 resolved = 1;
320 break; 320 break;
321 case 13: 321 case 13:
322 // blend = gl_src_alpha gl_one_minus_src_alpha 322 // blend = gl_src_alpha gl_one_minus_src_alpha
323 blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; 323 blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
324 blendfunc.param0 = 1.f/255.f; 324 blendfunc.param0 = 1.f/255.f;
325 blendfunc.isTransparent = 1; 325 blendfunc.isTransparent = 1;
326 resolved = 1; 326 resolved = 1;
327 break; 327 break;
328 case 14: 328 case 14:
329 // alphafunc ge128 329 // alphafunc ge128
330 blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; 330 blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
331 blendfunc.param0 = 0.5f; 331 blendfunc.param0 = 0.5f;
332 blendfunc.isTransparent = 1; 332 blendfunc.isTransparent = 1;
333 resolved = 1; 333 resolved = 1;
334 break; 334 break;
335 case 15: 335 case 15:
336 // alphafunc gt0 336 // alphafunc gt0
337 blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; 337 blendfunc.type = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
338 blendfunc.param0 = 1.f / 255.f; 338 blendfunc.param0 = 1.f / 255.f;
339 blendfunc.isTransparent = 1; 339 blendfunc.isTransparent = 1;
340 resolved = 1; 340 resolved = 1;
341 break; 341 break;
342 342
343 } 343 }
344 344
345 // use the generic blender 345 // use the generic blender
346 if ( 0 == resolved ) 346 if ( 0 == resolved )
347 { 347 {
348 blendfunc.type = video::EMT_ONETEXTURE_BLEND; 348 blendfunc.type = video::EMT_ONETEXTURE_BLEND;
349 blendfunc.param0 = video::pack_textureBlendFunc ( 349 blendfunc.param0 = video::pack_textureBlendFunc (
350 (video::E_BLEND_FACTOR) srcFact, 350 (video::E_BLEND_FACTOR) srcFact,
351 (video::E_BLEND_FACTOR) dstFact, 351 (video::E_BLEND_FACTOR) dstFact,
352 blendfunc.modulate); 352 blendfunc.modulate);
353 353
354 blendfunc.isTransparent = 1; 354 blendfunc.isTransparent = 1;
355 } 355 }
356 } 356 }
357 357
358 // random noise [-1;1] 358 // random noise [-1;1]
359 struct Noiser 359 struct Noiser
360 { 360 {
361 static f32 get () 361 static f32 get ()
362 { 362 {
363 static u32 RandomSeed = 0x69666966; 363 static u32 RandomSeed = 0x69666966;
364 RandomSeed = (RandomSeed * 3631 + 1); 364 RandomSeed = (RandomSeed * 3631 + 1);
365 365
366 f32 value = ( (f32) (RandomSeed & 0x7FFF ) * (1.0f / (f32)(0x7FFF >> 1) ) ) - 1.f; 366 f32 value = ( (f32) (RandomSeed & 0x7FFF ) * (1.0f / (f32)(0x7FFF >> 1) ) ) - 1.f;
367 return value; 367 return value;
368 } 368 }
369 }; 369 };
370 370
371 enum eQ3ModifierFunction 371 enum eQ3ModifierFunction
372 { 372 {
373 TCMOD = 0, 373 TCMOD = 0,
374 DEFORMVERTEXES = 1, 374 DEFORMVERTEXES = 1,
375 RGBGEN = 2, 375 RGBGEN = 2,
376 TCGEN = 3, 376 TCGEN = 3,
377 MAP = 4, 377 MAP = 4,
378 ALPHAGEN = 5, 378 ALPHAGEN = 5,
379 379
380 FUNCTION2 = 0x10, 380 FUNCTION2 = 0x10,
381 SCROLL = FUNCTION2 + 1, 381 SCROLL = FUNCTION2 + 1,
382 SCALE = FUNCTION2 + 2, 382 SCALE = FUNCTION2 + 2,
383 ROTATE = FUNCTION2 + 3, 383 ROTATE = FUNCTION2 + 3,
384 STRETCH = FUNCTION2 + 4, 384 STRETCH = FUNCTION2 + 4,
385 TURBULENCE = FUNCTION2 + 5, 385 TURBULENCE = FUNCTION2 + 5,
386 WAVE = FUNCTION2 + 6, 386 WAVE = FUNCTION2 + 6,
387 387
388 IDENTITY = FUNCTION2 + 7, 388 IDENTITY = FUNCTION2 + 7,
389 VERTEX = FUNCTION2 + 8, 389 VERTEX = FUNCTION2 + 8,
390 TEXTURE = FUNCTION2 + 9, 390 TEXTURE = FUNCTION2 + 9,
391 LIGHTMAP = FUNCTION2 + 10, 391 LIGHTMAP = FUNCTION2 + 10,
392 ENVIRONMENT = FUNCTION2 + 11, 392 ENVIRONMENT = FUNCTION2 + 11,
393 DOLLAR_LIGHTMAP = FUNCTION2 + 12, 393 DOLLAR_LIGHTMAP = FUNCTION2 + 12,
394 BULGE = FUNCTION2 + 13, 394 BULGE = FUNCTION2 + 13,
395 AUTOSPRITE = FUNCTION2 + 14, 395 AUTOSPRITE = FUNCTION2 + 14,
396 AUTOSPRITE2 = FUNCTION2 + 15, 396 AUTOSPRITE2 = FUNCTION2 + 15,
397 TRANSFORM = FUNCTION2 + 16, 397 TRANSFORM = FUNCTION2 + 16,
398 EXACTVERTEX = FUNCTION2 + 17, 398 EXACTVERTEX = FUNCTION2 + 17,
399 CONSTANT = FUNCTION2 + 18, 399 CONSTANT = FUNCTION2 + 18,
400 LIGHTINGSPECULAR = FUNCTION2 + 19, 400 LIGHTINGSPECULAR = FUNCTION2 + 19,
401 MOVE = FUNCTION2 + 20, 401 MOVE = FUNCTION2 + 20,
402 NORMAL = FUNCTION2 + 21, 402 NORMAL = FUNCTION2 + 21,
403 IDENTITYLIGHTING = FUNCTION2 + 22, 403 IDENTITYLIGHTING = FUNCTION2 + 22,
404 404
405 WAVE_MODIFIER_FUNCTION = 0x30, 405 WAVE_MODIFIER_FUNCTION = 0x30,
406 SINUS = WAVE_MODIFIER_FUNCTION + 1, 406 SINUS = WAVE_MODIFIER_FUNCTION + 1,
407 COSINUS = WAVE_MODIFIER_FUNCTION + 2, 407 COSINUS = WAVE_MODIFIER_FUNCTION + 2,
408 SQUARE = WAVE_MODIFIER_FUNCTION + 3, 408 SQUARE = WAVE_MODIFIER_FUNCTION + 3,
409 TRIANGLE = WAVE_MODIFIER_FUNCTION + 4, 409 TRIANGLE = WAVE_MODIFIER_FUNCTION + 4,
410 SAWTOOTH = WAVE_MODIFIER_FUNCTION + 5, 410 SAWTOOTH = WAVE_MODIFIER_FUNCTION + 5,
411 SAWTOOTH_INVERSE = WAVE_MODIFIER_FUNCTION + 6, 411 SAWTOOTH_INVERSE = WAVE_MODIFIER_FUNCTION + 6,
412 NOISE = WAVE_MODIFIER_FUNCTION + 7, 412 NOISE = WAVE_MODIFIER_FUNCTION + 7,
413 413
414 414
415 UNKNOWN = -2 415 UNKNOWN = -2
416 416
417 }; 417 };
418 418
419 struct SModifierFunction 419 struct SModifierFunction
420 { 420 {
421 SModifierFunction () 421 SModifierFunction ()
422 : masterfunc0 ( UNKNOWN ), masterfunc1( UNKNOWN ), func ( SINUS ), 422 : masterfunc0 ( UNKNOWN ), masterfunc1( UNKNOWN ), func ( SINUS ),
423 tcgen( TEXTURE ), rgbgen ( IDENTITY ), alphagen ( UNKNOWN ), 423 tcgen( TEXTURE ), rgbgen ( IDENTITY ), alphagen ( UNKNOWN ),
424 base ( 0 ), amp ( 1 ), phase ( 0 ), frequency ( 1 ), 424 base ( 0 ), amp ( 1 ), phase ( 0 ), frequency ( 1 ),
425 wave ( 1 ), 425 wave ( 1 ),
426 x ( 0 ), y ( 0 ), z( 0 ), count( 0 ) {} 426 x ( 0 ), y ( 0 ), z( 0 ), count( 0 ) {}
427 427
428 // "tcmod","deformvertexes","rgbgen", "tcgen" 428 // "tcmod","deformvertexes","rgbgen", "tcgen"
429 eQ3ModifierFunction masterfunc0; 429 eQ3ModifierFunction masterfunc0;
430 // depends 430 // depends
431 eQ3ModifierFunction masterfunc1; 431 eQ3ModifierFunction masterfunc1;
432 // depends 432 // depends
433 eQ3ModifierFunction func; 433 eQ3ModifierFunction func;
434 434
435 eQ3ModifierFunction tcgen; 435 eQ3ModifierFunction tcgen;
436 eQ3ModifierFunction rgbgen; 436 eQ3ModifierFunction rgbgen;
437 eQ3ModifierFunction alphagen; 437 eQ3ModifierFunction alphagen;
438 438
439 union 439 union
440 { 440 {
441 f32 base; 441 f32 base;
442 f32 bulgewidth; 442 f32 bulgewidth;
443 }; 443 };
444 444
445 union 445 union
446 { 446 {
447 f32 amp; 447 f32 amp;
448 f32 bulgeheight; 448 f32 bulgeheight;
449 }; 449 };
450 450
451 f32 phase; 451 f32 phase;
452 452
453 union 453 union
454 { 454 {
455 f32 frequency; 455 f32 frequency;
456 f32 bulgespeed; 456 f32 bulgespeed;
457 }; 457 };
458 458
459 union 459 union
460 { 460 {
461 f32 wave; 461 f32 wave;
462 f32 div; 462 f32 div;
463 }; 463 };
464 464
465 f32 x; 465 f32 x;
466 f32 y; 466 f32 y;
467 f32 z; 467 f32 z;
468 u32 count; 468 u32 count;
469 469
470 f32 evaluate ( f32 dt ) const 470 f32 evaluate ( f32 dt ) const
471 { 471 {
472 // phase in 0 and 1.. 472 // phase in 0 and 1..
473 f32 x = core::fract( (dt + phase ) * frequency ); 473 f32 x = core::fract( (dt + phase ) * frequency );
474 f32 y = 0.f; 474 f32 y = 0.f;
475 475
476 switch ( func ) 476 switch ( func )
477 { 477 {
478 case SINUS: 478 case SINUS:
479 y = sinf ( x * core::PI * 2.f ); 479 y = sinf ( x * core::PI * 2.f );
480 break; 480 break;
481 case COSINUS: 481 case COSINUS:
482 y = cosf ( x * core::PI * 2.f ); 482 y = cosf ( x * core::PI * 2.f );
483 break; 483 break;
484 case SQUARE: 484 case SQUARE:
485 y = x < 0.5f ? 1.f : -1.f; 485 y = x < 0.5f ? 1.f : -1.f;
486 break; 486 break;
487 case TRIANGLE: 487 case TRIANGLE:
488 y = x < 0.5f ? ( 4.f * x ) - 1.f : ( -4.f * x ) + 3.f; 488 y = x < 0.5f ? ( 4.f * x ) - 1.f : ( -4.f * x ) + 3.f;
489 break; 489 break;
490 case SAWTOOTH: 490 case SAWTOOTH:
491 y = x; 491 y = x;
492 break; 492 break;
493 case SAWTOOTH_INVERSE: 493 case SAWTOOTH_INVERSE:
494 y = 1.f - x; 494 y = 1.f - x;
495 break; 495 break;
496 case NOISE: 496 case NOISE:
497 y = Noiser::get(); 497 y = Noiser::get();
498 break; 498 break;
499 default: 499 default:
500 break; 500 break;
501 } 501 }
502 502
503 return base + ( y * amp ); 503 return base + ( y * amp );
504 } 504 }
505 505
506 506
507 }; 507 };
508 508
509 inline core::vector3df getMD3Normal ( u32 i, u32 j ) 509 inline core::vector3df getMD3Normal ( u32 i, u32 j )
510 { 510 {
511 const f32 lng = i * 2.0f * core::PI / 255.0f; 511 const f32 lng = i * 2.0f * core::PI / 255.0f;
512 const f32 lat = j * 2.0f * core::PI / 255.0f; 512 const f32 lat = j * 2.0f * core::PI / 255.0f;
513 return core::vector3df(cosf ( lat ) * sinf ( lng ), 513 return core::vector3df(cosf ( lat ) * sinf ( lng ),
514 sinf ( lat ) * sinf ( lng ), 514 sinf ( lat ) * sinf ( lng ),
515 cosf ( lng )); 515 cosf ( lng ));
516 } 516 }
517 517
518 // 518 //
519 inline void getModifierFunc ( SModifierFunction& fill, const core::stringc &string, u32 &pos ) 519 inline void getModifierFunc ( SModifierFunction& fill, const core::stringc &string, u32 &pos )
520 { 520 {
521 if ( string.size() == 0 ) 521 if ( string.size() == 0 )
522 return; 522 return;
523 523
524 static const c8 * funclist[] = 524 static const c8 * funclist[] =
525 { 525 {
526 "sin","cos","square", 526 "sin","cos","square",
527 "triangle", "sawtooth","inversesawtooth", "noise" 527 "triangle", "sawtooth","inversesawtooth", "noise"
528 }; 528 };
529 529
530 fill.func = (eQ3ModifierFunction) isEqual ( string,pos, funclist,7 ); 530 fill.func = (eQ3ModifierFunction) isEqual ( string,pos, funclist,7 );
531 fill.func = fill.func == UNKNOWN ? SINUS : (eQ3ModifierFunction) ((u32) fill.func + WAVE_MODIFIER_FUNCTION + 1); 531 fill.func = fill.func == UNKNOWN ? SINUS : (eQ3ModifierFunction) ((u32) fill.func + WAVE_MODIFIER_FUNCTION + 1);
532 532
533 fill.base = getAsFloat ( string, pos ); 533 fill.base = getAsFloat ( string, pos );
534 fill.amp = getAsFloat ( string, pos ); 534 fill.amp = getAsFloat ( string, pos );
535 fill.phase = getAsFloat ( string, pos ); 535 fill.phase = getAsFloat ( string, pos );
536 fill.frequency = getAsFloat ( string, pos ); 536 fill.frequency = getAsFloat ( string, pos );
537 } 537 }
538 538
539 539
540 // name = "a b c .." 540 // name = "a b c .."
541 struct SVariable 541 struct SVariable
542 { 542 {
543 core::stringc name; 543 core::stringc name;
544 core::stringc content; 544 core::stringc content;
545 545
546 SVariable ( const c8 * n, const c8 *c = 0 ) : name ( n ), content (c) {} 546 SVariable ( const c8 * n, const c8 *c = 0 ) : name ( n ), content (c) {}
547 virtual ~SVariable () {} 547 virtual ~SVariable () {}
548 548
549 void clear () 549 void clear ()
550 { 550 {
551 name = ""; 551 name = "";
552 content = ""; 552 content = "";
553 } 553 }
554 554
555 s32 isValid () const 555 s32 isValid () const
556 { 556 {
557 return name.size(); 557 return name.size();
558 } 558 }
559 559
560 bool operator == ( const SVariable &other ) const 560 bool operator == ( const SVariable &other ) const
561 { 561 {
562 return 0 == strcmp ( name.c_str(), other.name.c_str () ); 562 return 0 == strcmp ( name.c_str(), other.name.c_str () );
563 } 563 }
564 564
565 bool operator < ( const SVariable &other ) const 565 bool operator < ( const SVariable &other ) const
566 { 566 {
567 return 0 > strcmp ( name.c_str(), other.name.c_str () ); 567 return 0 > strcmp ( name.c_str(), other.name.c_str () );
568 } 568 }
569 569
570 }; 570 };
571 571
572 572
573 // string database. "a" = "Hello", "b" = "1234.6" 573 // string database. "a" = "Hello", "b" = "1234.6"
574 struct SVarGroup 574 struct SVarGroup
575 { 575 {
576 SVarGroup () { Variable.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE ); } 576 SVarGroup () { Variable.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE ); }
577 virtual ~SVarGroup () {} 577 virtual ~SVarGroup () {}
578 578
579 u32 isDefined ( const c8 * name, const c8 * content = 0 ) const 579 u32 isDefined ( const c8 * name, const c8 * content = 0 ) const
580 { 580 {
581 for ( u32 i = 0; i != Variable.size (); ++i ) 581 for ( u32 i = 0; i != Variable.size (); ++i )
582 { 582 {
583 if ( 0 == strcmp ( Variable[i].name.c_str(), name ) && 583 if ( 0 == strcmp ( Variable[i].name.c_str(), name ) &&
584 ( 0 == content || strstr ( Variable[i].content.c_str(), content ) ) 584 ( 0 == content || strstr ( Variable[i].content.c_str(), content ) )
585 ) 585 )
586 { 586 {
587 return i + 1; 587 return i + 1;
588 } 588 }
589 } 589 }
590 return 0; 590 return 0;
591 } 591 }
592 592
593 // searches for Variable name and returns is content 593 // searches for Variable name and returns is content
594 // if Variable is not found a reference to an Empty String is returned 594 // if Variable is not found a reference to an Empty String is returned
595 const core::stringc &get( const c8 * name ) const 595 const core::stringc &get( const c8 * name ) const
596 { 596 {
597 SVariable search ( name ); 597 SVariable search ( name );
598 s32 index = Variable.linear_search ( search ); 598 s32 index = Variable.linear_search ( search );
599 if ( index < 0 ) 599 if ( index < 0 )
600 return irrEmptyStringc; 600 return irrEmptyStringc;
601 601
602 return Variable [ index ].content; 602 return Variable [ index ].content;
603 } 603 }
604 604
605 // set the Variable name 605 // set the Variable name
606 void set ( const c8 * name, const c8 * content = 0 ) 606 void set ( const c8 * name, const c8 * content = 0 )
607 { 607 {
608 u32 index = isDefined ( name, 0 ); 608 u32 index = isDefined ( name, 0 );
609 if ( 0 == index ) 609 if ( 0 == index )
610 { 610 {
611 Variable.push_back ( SVariable ( name, content ) ); 611 Variable.push_back ( SVariable ( name, content ) );
612 } 612 }
613 else 613 else
614 { 614 {
615 Variable [ index ].content = content; 615 Variable [ index ].content = content;
616 } 616 }
617 } 617 }
618 618
619 619
620 core::array < SVariable > Variable; 620 core::array < SVariable > Variable;
621 }; 621 };
622 622
623 //! holding a group a variable 623 //! holding a group a variable
624 struct SVarGroupList: public IReferenceCounted 624 struct SVarGroupList: public IReferenceCounted
625 { 625 {
626 SVarGroupList () 626 SVarGroupList ()
627 { 627 {
628 VariableGroup.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE ); 628 VariableGroup.setAllocStrategy ( core::ALLOC_STRATEGY_SAFE );
629 } 629 }
630 virtual ~SVarGroupList () {} 630 virtual ~SVarGroupList () {}
631 631
632 core::array < SVarGroup > VariableGroup; 632 core::array < SVarGroup > VariableGroup;
633 }; 633 };
634 634
635 635
636 //! A Parsed Shader Holding Variables ordered in Groups 636 //! A Parsed Shader Holding Variables ordered in Groups
637 struct IShader 637 struct IShader
638 { 638 {
639 IShader () 639 IShader ()
640 : ID ( 0 ), VarGroup ( 0 ) {} 640 : ID ( 0 ), VarGroup ( 0 ) {}
641 virtual ~IShader () {} 641 virtual ~IShader () {}
642 642
643 void operator = (const IShader &other ) 643 void operator = (const IShader &other )
644 { 644 {
645 ID = other.ID; 645 ID = other.ID;
646 VarGroup = other.VarGroup; 646 VarGroup = other.VarGroup;
647 name = other.name; 647 name = other.name;
648 } 648 }
649 649
650 bool operator == (const IShader &other ) const 650 bool operator == (const IShader &other ) const
651 { 651 {
652 return 0 == strcmp ( name.c_str(), other.name.c_str () ); 652 return 0 == strcmp ( name.c_str(), other.name.c_str () );
653 //return name == other.name; 653 //return name == other.name;
654 } 654 }
655 655
656 bool operator < (const IShader &other ) const 656 bool operator < (const IShader &other ) const
657 { 657 {
658 return strcmp ( name.c_str(), other.name.c_str () ) < 0; 658 return strcmp ( name.c_str(), other.name.c_str () ) < 0;
659 //return name < other.name; 659 //return name < other.name;
660 } 660 }
661 661
662 u32 getGroupSize () const 662 u32 getGroupSize () const
663 { 663 {
664 if ( 0 == VarGroup ) 664 if ( 0 == VarGroup )
665 return 0; 665 return 0;
666 return VarGroup->VariableGroup.size (); 666 return VarGroup->VariableGroup.size ();
667 } 667 }
668 668
669 const SVarGroup * getGroup ( u32 stage ) const 669 const SVarGroup * getGroup ( u32 stage ) const
670 { 670 {
671 if ( 0 == VarGroup || stage >= VarGroup->VariableGroup.size () ) 671 if ( 0 == VarGroup || stage >= VarGroup->VariableGroup.size () )
672 return 0; 672 return 0;
673 673
674 return &VarGroup->VariableGroup [ stage ]; 674 return &VarGroup->VariableGroup [ stage ];
675 } 675 }
676 676
677 // id 677 // id
678 s32 ID; 678 s32 ID;
679 SVarGroupList *VarGroup; // reference 679 SVarGroupList *VarGroup; // reference
680 680
681 // Shader: shader name ( also first variable in first Vargroup ) 681 // Shader: shader name ( also first variable in first Vargroup )
682 // Entity: classname ( variable in Group(1) ) 682 // Entity: classname ( variable in Group(1) )
683 core::stringc name; 683 core::stringc name;
684 }; 684 };
685 685
686 typedef IShader IEntity; 686 typedef IShader IEntity;
687 687
688 typedef core::array < IEntity > tQ3EntityList; 688 typedef core::array < IEntity > tQ3EntityList;
689 689
690 /* 690 /*
691 dump shader like original layout, regardless of internal data holding 691 dump shader like original layout, regardless of internal data holding
692 no recursive folding.. 692 no recursive folding..
693 */ 693 */
694 inline void dumpVarGroup ( core::stringc &dest, const SVarGroup * group, s32 stack ) 694 inline void dumpVarGroup ( core::stringc &dest, const SVarGroup * group, s32 stack )
695 { 695 {
696 core::stringc buf; 696 core::stringc buf;
697 s32 i; 697 s32 i;
698 698
699 699
700 if ( stack > 0 ) 700 if ( stack > 0 )
701 { 701 {
702 buf = ""; 702 buf = "";
703 for ( i = 0; i < stack - 1; ++i ) 703 for ( i = 0; i < stack - 1; ++i )
704 buf += '\t'; 704 buf += '\t';
705 705
706 buf += "{\n"; 706 buf += "{\n";
707 dest.append ( buf ); 707 dest.append ( buf );
708 } 708 }
709 709
710 for ( u32 g = 0; g != group->Variable.size(); ++g ) 710 for ( u32 g = 0; g != group->Variable.size(); ++g )
711 { 711 {
712 buf = ""; 712 buf = "";
713 for ( i = 0; i < stack; ++i ) 713 for ( i = 0; i < stack; ++i )
714 buf += '\t'; 714 buf += '\t';
715 715
716 buf += group->Variable[g].name; 716 buf += group->Variable[g].name;
717 buf += " "; 717 buf += " ";
718 buf += group->Variable[g].content; 718 buf += group->Variable[g].content;
719 buf += "\n"; 719 buf += "\n";
720 dest.append ( buf ); 720 dest.append ( buf );
721 } 721 }
722 722
723 if ( stack > 1 ) 723 if ( stack > 1 )
724 { 724 {
725 buf = ""; 725 buf = "";
726 for ( i = 0; i < stack - 1; ++i ) 726 for ( i = 0; i < stack - 1; ++i )
727 buf += '\t'; 727 buf += '\t';
728 728
729 buf += "}\n"; 729 buf += "}\n";
730 dest.append ( buf ); 730 dest.append ( buf );
731 } 731 }
732 732
733 } 733 }
734 734
735 /*! 735 /*!
736 dump a Shader or an Entity 736 dump a Shader or an Entity
737 */ 737 */
738 inline core::stringc & dumpShader ( core::stringc &dest, const IShader * shader, bool entity = false ) 738 inline core::stringc & dumpShader ( core::stringc &dest, const IShader * shader, bool entity = false )
739 { 739 {
740 if ( 0 == shader ) 740 if ( 0 == shader )
741 return dest; 741 return dest;
742 742
743 const SVarGroup * group; 743 const SVarGroup * group;
744 744
745 const u32 size = shader->VarGroup->VariableGroup.size (); 745 const u32 size = shader->VarGroup->VariableGroup.size ();
746 for ( u32 i = 0; i != size; ++i ) 746 for ( u32 i = 0; i != size; ++i )
747 { 747 {
748 group = &shader->VarGroup->VariableGroup[ i ]; 748 group = &shader->VarGroup->VariableGroup[ i ];
749 dumpVarGroup ( dest, group, core::clamp( (int)i, 0, 2 ) ); 749 dumpVarGroup ( dest, group, core::clamp( (int)i, 0, 2 ) );
750 } 750 }
751 751
752 if ( !entity ) 752 if ( !entity )
753 { 753 {
754 if ( size <= 1 ) 754 if ( size <= 1 )
755 { 755 {
756 dest.append ( "{\n" ); 756 dest.append ( "{\n" );
757 } 757 }
758 dest.append ( "}\n" ); 758 dest.append ( "}\n" );
759 } 759 }
760 return dest; 760 return dest;
761 } 761 }
762 762
763 763
764 /* 764 /*
765 quake3 doesn't care much about tga & jpg 765 quake3 doesn't care much about tga & jpg
766 load one or multiple files stored in name started at startPos to the texture array textures 766 load one or multiple files stored in name started at startPos to the texture array textures
767 if texture is not loaded 0 will be added ( to find missing textures easier) 767 if texture is not loaded 0 will be added ( to find missing textures easier)
768 */ 768 */
769 inline void getTextures(tTexArray &textures, 769 inline void getTextures(tTexArray &textures,
770 const core::stringc &name, u32 &startPos, 770 const core::stringc &name, u32 &startPos,
771 io::IFileSystem *fileSystem, 771 io::IFileSystem *fileSystem,
772 video::IVideoDriver* driver) 772 video::IVideoDriver* driver)
773 { 773 {
774 static const char* extension[] = 774 static const char* extension[] =
775 { 775 {
776 ".jpg", 776 ".jpg",
777 ".jpeg", 777 ".jpeg",
778 ".png", 778 ".png",
779 ".dds", 779 ".dds",
780 ".tga", 780 ".tga",
781 ".bmp", 781 ".bmp",
782 ".pcx" 782 ".pcx"
783 }; 783 };
784 784
785 tStringList stringList; 785 tStringList stringList;
786 getAsStringList(stringList, -1, name, startPos); 786 getAsStringList(stringList, -1, name, startPos);
787 787
788 textures.clear(); 788 textures.clear();
789 789
790 io::path loadFile; 790 io::path loadFile;
791 for ( u32 i = 0; i!= stringList.size (); ++i ) 791 for ( u32 i = 0; i!= stringList.size (); ++i )
792 { 792 {
793 video::ITexture* texture = 0; 793 video::ITexture* texture = 0;
794 for (u32 g = 0; g != 7 ; ++g) 794 for (u32 g = 0; g != 7 ; ++g)
795 { 795 {
796 core::cutFilenameExtension ( loadFile, stringList[i] ); 796 core::cutFilenameExtension ( loadFile, stringList[i] );
797 797
798 if ( loadFile == "$whiteimage" ) 798 if ( loadFile == "$whiteimage" )
799 { 799 {
800 texture = driver->getTexture( "$whiteimage" ); 800 texture = driver->getTexture( "$whiteimage" );
801 if ( 0 == texture ) 801 if ( 0 == texture )
802 { 802 {
803 core::dimension2du s ( 2, 2 ); 803 core::dimension2du s ( 2, 2 );
804 u32 image[4] = { 0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF }; 804 u32 image[4] = { 0xFFFFFFFF, 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF };
805 video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image ); 805 video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
806 texture = driver->addTexture( "$whiteimage", w ); 806 texture = driver->addTexture( "$whiteimage", w );
807 w->drop (); 807 w->drop ();
808 } 808 }
809 809
810 } 810 }
811 else 811 else
812 if ( loadFile == "$redimage" ) 812 if ( loadFile == "$redimage" )
813 { 813 {
814 texture = driver->getTexture( "$redimage" ); 814 texture = driver->getTexture( "$redimage" );
815 if ( 0 == texture ) 815 if ( 0 == texture )
816 { 816 {
817 core::dimension2du s ( 2, 2 ); 817 core::dimension2du s ( 2, 2 );
818 u32 image[4] = { 0xFFFF0000, 0xFFFF0000,0xFFFF0000,0xFFFF0000 }; 818 u32 image[4] = { 0xFFFF0000, 0xFFFF0000,0xFFFF0000,0xFFFF0000 };
819 video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image ); 819 video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
820 texture = driver->addTexture( "$redimage", w ); 820 texture = driver->addTexture( "$redimage", w );
821 w->drop (); 821 w->drop ();
822 } 822 }
823 } 823 }
824 else 824 else
825 if ( loadFile == "$blueimage" ) 825 if ( loadFile == "$blueimage" )
826 { 826 {
827 texture = driver->getTexture( "$blueimage" ); 827 texture = driver->getTexture( "$blueimage" );
828 if ( 0 == texture ) 828 if ( 0 == texture )
829 { 829 {
830 core::dimension2du s ( 2, 2 ); 830 core::dimension2du s ( 2, 2 );
831 u32 image[4] = { 0xFF0000FF, 0xFF0000FF,0xFF0000FF,0xFF0000FF }; 831 u32 image[4] = { 0xFF0000FF, 0xFF0000FF,0xFF0000FF,0xFF0000FF };
832 video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image ); 832 video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
833 texture = driver->addTexture( "$blueimage", w ); 833 texture = driver->addTexture( "$blueimage", w );
834 w->drop (); 834 w->drop ();
835 } 835 }
836 } 836 }
837 else 837 else
838 if ( loadFile == "$checkerimage" ) 838 if ( loadFile == "$checkerimage" )
839 { 839 {
840 texture = driver->getTexture( "$checkerimage" ); 840 texture = driver->getTexture( "$checkerimage" );
841 if ( 0 == texture ) 841 if ( 0 == texture )
842 { 842 {
843 core::dimension2du s ( 2, 2 ); 843 core::dimension2du s ( 2, 2 );
844 u32 image[4] = { 0xFFFFFFFF, 0xFF000000,0xFF000000,0xFFFFFFFF }; 844 u32 image[4] = { 0xFFFFFFFF, 0xFF000000,0xFF000000,0xFFFFFFFF };
845 video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image ); 845 video::IImage* w = driver->createImageFromData ( video::ECF_A8R8G8B8, s,&image );
846 texture = driver->addTexture( "$checkerimage", w ); 846 texture = driver->addTexture( "$checkerimage", w );
847 w->drop (); 847 w->drop ();
848 } 848 }
849 } 849 }
850 else 850 else
851 if ( loadFile == "$lightmap" ) 851 if ( loadFile == "$lightmap" )
852 { 852 {
853 texture = 0; 853 texture = 0;
854 } 854 }
855 else 855 else
856 { 856 {
857 loadFile.append ( extension[g] ); 857 loadFile.append ( extension[g] );
858 } 858 }
859 859
860 if ( fileSystem->existFile ( loadFile ) ) 860 if ( fileSystem->existFile ( loadFile ) )
861 { 861 {
862 texture = driver->getTexture( loadFile ); 862 texture = driver->getTexture( loadFile );
863 if ( texture ) 863 if ( texture )
864 break; 864 break;
865 texture = 0; 865 texture = 0;
866 } 866 }
867 } 867 }
868 // take 0 Texture 868 // take 0 Texture
869 textures.push_back(texture); 869 textures.push_back(texture);
870 } 870 }
871 } 871 }
872 872
873 873
874 //! Manages various Quake3 Shader Styles 874 //! Manages various Quake3 Shader Styles
875 class IShaderManager : public IReferenceCounted 875 class IShaderManager : public IReferenceCounted
876 { 876 {
877 }; 877 };
878 878
879} // end namespace quake3 879} // end namespace quake3
880} // end namespace scene 880} // end namespace scene
881} // end namespace irr 881} // end namespace irr
882 882
883#endif 883#endif
884 884
diff --git a/libraries/irrlicht-1.8/include/IRandomizer.h b/libraries/irrlicht-1.8/include/IRandomizer.h
index a0c0730..2d7d1d8 100644
--- a/libraries/irrlicht-1.8/include/IRandomizer.h
+++ b/libraries/irrlicht-1.8/include/IRandomizer.h
@@ -1,33 +1,33 @@
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#ifndef __I_RANDOMIZER_H_INCLUDED__ 5#ifndef __I_RANDOMIZER_H_INCLUDED__
6#define __I_RANDOMIZER_H_INCLUDED__ 6#define __I_RANDOMIZER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12 12
13//! Interface for generating random numbers 13//! Interface for generating random numbers
14class IRandomizer : public virtual IReferenceCounted 14class IRandomizer : public virtual IReferenceCounted
15{ 15{
16public: 16public:
17 //! resets the randomizer 17 //! resets the randomizer
18 /** \param value Initialization value (seed) */ 18 /** \param value Initialization value (seed) */
19 virtual void reset(s32 value=0x0f0f0f0f) =0; 19 virtual void reset(s32 value=0x0f0f0f0f) =0;
20 20
21 //! generates a pseudo random number in the range 0..randMax() 21 //! generates a pseudo random number in the range 0..randMax()
22 virtual s32 rand() const =0; 22 virtual s32 rand() const =0;
23 23
24 //! generates a pseudo random number in the range 0..1 24 //! generates a pseudo random number in the range 0..1
25 virtual f32 frand() const =0; 25 virtual f32 frand() const =0;
26 26
27 //! get maxmimum number generated by rand() 27 //! get maxmimum number generated by rand()
28 virtual s32 randMax() const =0; 28 virtual s32 randMax() const =0;
29}; 29};
30 30
31} // end namespace irr 31} // end namespace irr
32 32
33#endif 33#endif
diff --git a/libraries/irrlicht-1.8/include/IReadFile.h b/libraries/irrlicht-1.8/include/IReadFile.h
index e925690..eb4f0bd 100644
--- a/libraries/irrlicht-1.8/include/IReadFile.h
+++ b/libraries/irrlicht-1.8/include/IReadFile.h
@@ -1,58 +1,58 @@
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#ifndef __I_READ_FILE_H_INCLUDED__ 5#ifndef __I_READ_FILE_H_INCLUDED__
6#define __I_READ_FILE_H_INCLUDED__ 6#define __I_READ_FILE_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "coreutil.h" 9#include "coreutil.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace io 13namespace io
14{ 14{
15 15
16 //! Interface providing read acess to a file. 16 //! Interface providing read acess to a file.
17 class IReadFile : public virtual IReferenceCounted 17 class IReadFile : public virtual IReferenceCounted
18 { 18 {
19 public: 19 public:
20 //! Reads an amount of bytes from the file. 20 //! Reads an amount of bytes from the file.
21 /** \param buffer Pointer to buffer where read bytes are written to. 21 /** \param buffer Pointer to buffer where read bytes are written to.
22 \param sizeToRead Amount of bytes to read from the file. 22 \param sizeToRead Amount of bytes to read from the file.
23 \return How many bytes were read. */ 23 \return How many bytes were read. */
24 virtual s32 read(void* buffer, u32 sizeToRead) = 0; 24 virtual s32 read(void* buffer, u32 sizeToRead) = 0;
25 25
26 //! Changes position in file 26 //! Changes position in file
27 /** \param finalPos Destination position in the file. 27 /** \param finalPos Destination position in the file.
28 \param relativeMovement If set to true, the position in the file is 28 \param relativeMovement If set to true, the position in the file is
29 changed relative to current position. Otherwise the position is changed 29 changed relative to current position. Otherwise the position is changed
30 from beginning of file. 30 from beginning of file.
31 \return True if successful, otherwise false. */ 31 \return True if successful, otherwise false. */
32 virtual bool seek(long finalPos, bool relativeMovement = false) = 0; 32 virtual bool seek(long finalPos, bool relativeMovement = false) = 0;
33 33
34 //! Get size of file. 34 //! Get size of file.
35 /** \return Size of the file in bytes. */ 35 /** \return Size of the file in bytes. */
36 virtual long getSize() const = 0; 36 virtual long getSize() const = 0;
37 37
38 //! Get the current position in the file. 38 //! Get the current position in the file.
39 /** \return Current position in the file in bytes. */ 39 /** \return Current position in the file in bytes. */
40 virtual long getPos() const = 0; 40 virtual long getPos() const = 0;
41 41
42 //! Get name of file. 42 //! Get name of file.
43 /** \return File name as zero terminated character string. */ 43 /** \return File name as zero terminated character string. */
44 virtual const io::path& getFileName() const = 0; 44 virtual const io::path& getFileName() const = 0;
45 }; 45 };
46 46
47 //! Internal function, please do not use. 47 //! Internal function, please do not use.
48 IReadFile* createReadFile(const io::path& fileName); 48 IReadFile* createReadFile(const io::path& fileName);
49 //! Internal function, please do not use. 49 //! Internal function, please do not use.
50 IReadFile* createLimitReadFile(const io::path& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize); 50 IReadFile* createLimitReadFile(const io::path& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize);
51 //! Internal function, please do not use. 51 //! Internal function, please do not use.
52 IReadFile* createMemoryReadFile(void* memory, long size, const io::path& fileName, bool deleteMemoryWhenDropped); 52 IReadFile* createMemoryReadFile(void* memory, long size, const io::path& fileName, bool deleteMemoryWhenDropped);
53 53
54} // end namespace io 54} // end namespace io
55} // end namespace irr 55} // end namespace irr
56 56
57#endif 57#endif
58 58
diff --git a/libraries/irrlicht-1.8/include/IReferenceCounted.h b/libraries/irrlicht-1.8/include/IReferenceCounted.h
index 8a551e8..0eb23a5 100644
--- a/libraries/irrlicht-1.8/include/IReferenceCounted.h
+++ b/libraries/irrlicht-1.8/include/IReferenceCounted.h
@@ -1,170 +1,170 @@
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#ifndef __I_IREFERENCE_COUNTED_H_INCLUDED__ 5#ifndef __I_IREFERENCE_COUNTED_H_INCLUDED__
6#define __I_IREFERENCE_COUNTED_H_INCLUDED__ 6#define __I_IREFERENCE_COUNTED_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12 12
13 //! Base class of most objects of the Irrlicht Engine. 13 //! Base class of most objects of the Irrlicht Engine.
14 /** This class provides reference counting through the methods grab() and drop(). 14 /** This class provides reference counting through the methods grab() and drop().
15 It also is able to store a debug string for every instance of an object. 15 It also is able to store a debug string for every instance of an object.
16 Most objects of the Irrlicht 16 Most objects of the Irrlicht
17 Engine are derived from IReferenceCounted, and so they are reference counted. 17 Engine are derived from IReferenceCounted, and so they are reference counted.
18 18
19 When you create an object in the Irrlicht engine, calling a method 19 When you create an object in the Irrlicht engine, calling a method
20 which starts with 'create', an object is created, and you get a pointer 20 which starts with 'create', an object is created, and you get a pointer
21 to the new object. If you no longer need the object, you have 21 to the new object. If you no longer need the object, you have
22 to call drop(). This will destroy the object, if grab() was not called 22 to call drop(). This will destroy the object, if grab() was not called
23 in another part of you program, because this part still needs the object. 23 in another part of you program, because this part still needs the object.
24 Note, that you only need to call drop() to the object, if you created it, 24 Note, that you only need to call drop() to the object, if you created it,
25 and the method had a 'create' in it. 25 and the method had a 'create' in it.
26 26
27 A simple example: 27 A simple example:
28 28
29 If you want to create a texture, you may want to call an imaginable method 29 If you want to create a texture, you may want to call an imaginable method
30 IDriver::createTexture. You call 30 IDriver::createTexture. You call
31 ITexture* texture = driver->createTexture(dimension2d<u32>(128, 128)); 31 ITexture* texture = driver->createTexture(dimension2d<u32>(128, 128));
32 If you no longer need the texture, call texture->drop(). 32 If you no longer need the texture, call texture->drop().
33 33
34 If you want to load a texture, you may want to call imaginable method 34 If you want to load a texture, you may want to call imaginable method
35 IDriver::loadTexture. You do this like 35 IDriver::loadTexture. You do this like
36 ITexture* texture = driver->loadTexture("example.jpg"); 36 ITexture* texture = driver->loadTexture("example.jpg");
37 You will not have to drop the pointer to the loaded texture, because 37 You will not have to drop the pointer to the loaded texture, because
38 the name of the method does not start with 'create'. The texture 38 the name of the method does not start with 'create'. The texture
39 is stored somewhere by the driver. 39 is stored somewhere by the driver.
40 */ 40 */
41 class IReferenceCounted 41 class IReferenceCounted
42 { 42 {
43 public: 43 public:
44 44
45 //! Constructor. 45 //! Constructor.
46 IReferenceCounted() 46 IReferenceCounted()
47 : DebugName(0), ReferenceCounter(1) 47 : DebugName(0), ReferenceCounter(1)
48 { 48 {
49 } 49 }
50 50
51 //! Destructor. 51 //! Destructor.
52 virtual ~IReferenceCounted() 52 virtual ~IReferenceCounted()
53 { 53 {
54 } 54 }
55 55
56 //! Grabs the object. Increments the reference counter by one. 56 //! Grabs the object. Increments the reference counter by one.
57 /** Someone who calls grab() to an object, should later also 57 /** Someone who calls grab() to an object, should later also
58 call drop() to it. If an object never gets as much drop() as 58 call drop() to it. If an object never gets as much drop() as
59 grab() calls, it will never be destroyed. The 59 grab() calls, it will never be destroyed. The
60 IReferenceCounted class provides a basic reference counting 60 IReferenceCounted class provides a basic reference counting
61 mechanism with its methods grab() and drop(). Most objects of 61 mechanism with its methods grab() and drop(). Most objects of
62 the Irrlicht Engine are derived from IReferenceCounted, and so 62 the Irrlicht Engine are derived from IReferenceCounted, and so
63 they are reference counted. 63 they are reference counted.
64 64
65 When you create an object in the Irrlicht engine, calling a 65 When you create an object in the Irrlicht engine, calling a
66 method which starts with 'create', an object is created, and 66 method which starts with 'create', an object is created, and
67 you get a pointer to the new object. If you no longer need the 67 you get a pointer to the new object. If you no longer need the
68 object, you have to call drop(). This will destroy the object, 68 object, you have to call drop(). This will destroy the object,
69 if grab() was not called in another part of you program, 69 if grab() was not called in another part of you program,
70 because this part still needs the object. Note, that you only 70 because this part still needs the object. Note, that you only
71 need to call drop() to the object, if you created it, and the 71 need to call drop() to the object, if you created it, and the
72 method had a 'create' in it. 72 method had a 'create' in it.
73 73
74 A simple example: 74 A simple example:
75 75
76 If you want to create a texture, you may want to call an 76 If you want to create a texture, you may want to call an
77 imaginable method IDriver::createTexture. You call 77 imaginable method IDriver::createTexture. You call
78 ITexture* texture = driver->createTexture(dimension2d<u32>(128, 128)); 78 ITexture* texture = driver->createTexture(dimension2d<u32>(128, 128));
79 If you no longer need the texture, call texture->drop(). 79 If you no longer need the texture, call texture->drop().
80 If you want to load a texture, you may want to call imaginable 80 If you want to load a texture, you may want to call imaginable
81 method IDriver::loadTexture. You do this like 81 method IDriver::loadTexture. You do this like
82 ITexture* texture = driver->loadTexture("example.jpg"); 82 ITexture* texture = driver->loadTexture("example.jpg");
83 You will not have to drop the pointer to the loaded texture, 83 You will not have to drop the pointer to the loaded texture,
84 because the name of the method does not start with 'create'. 84 because the name of the method does not start with 'create'.
85 The texture is stored somewhere by the driver. */ 85 The texture is stored somewhere by the driver. */
86 void grab() const { ++ReferenceCounter; } 86 void grab() const { ++ReferenceCounter; }
87 87
88 //! Drops the object. Decrements the reference counter by one. 88 //! Drops the object. Decrements the reference counter by one.
89 /** The IReferenceCounted class provides a basic reference 89 /** The IReferenceCounted class provides a basic reference
90 counting mechanism with its methods grab() and drop(). Most 90 counting mechanism with its methods grab() and drop(). Most
91 objects of the Irrlicht Engine are derived from 91 objects of the Irrlicht Engine are derived from
92 IReferenceCounted, and so they are reference counted. 92 IReferenceCounted, and so they are reference counted.
93 93
94 When you create an object in the Irrlicht engine, calling a 94 When you create an object in the Irrlicht engine, calling a
95 method which starts with 'create', an object is created, and 95 method which starts with 'create', an object is created, and
96 you get a pointer to the new object. If you no longer need the 96 you get a pointer to the new object. If you no longer need the
97 object, you have to call drop(). This will destroy the object, 97 object, you have to call drop(). This will destroy the object,
98 if grab() was not called in another part of you program, 98 if grab() was not called in another part of you program,
99 because this part still needs the object. Note, that you only 99 because this part still needs the object. Note, that you only
100 need to call drop() to the object, if you created it, and the 100 need to call drop() to the object, if you created it, and the
101 method had a 'create' in it. 101 method had a 'create' in it.
102 102
103 A simple example: 103 A simple example:
104 104
105 If you want to create a texture, you may want to call an 105 If you want to create a texture, you may want to call an
106 imaginable method IDriver::createTexture. You call 106 imaginable method IDriver::createTexture. You call
107 ITexture* texture = driver->createTexture(dimension2d<u32>(128, 128)); 107 ITexture* texture = driver->createTexture(dimension2d<u32>(128, 128));
108 If you no longer need the texture, call texture->drop(). 108 If you no longer need the texture, call texture->drop().
109 If you want to load a texture, you may want to call imaginable 109 If you want to load a texture, you may want to call imaginable
110 method IDriver::loadTexture. You do this like 110 method IDriver::loadTexture. You do this like
111 ITexture* texture = driver->loadTexture("example.jpg"); 111 ITexture* texture = driver->loadTexture("example.jpg");
112 You will not have to drop the pointer to the loaded texture, 112 You will not have to drop the pointer to the loaded texture,
113 because the name of the method does not start with 'create'. 113 because the name of the method does not start with 'create'.
114 The texture is stored somewhere by the driver. 114 The texture is stored somewhere by the driver.
115 \return True, if the object was deleted. */ 115 \return True, if the object was deleted. */
116 bool drop() const 116 bool drop() const
117 { 117 {
118 // someone is doing bad reference counting. 118 // someone is doing bad reference counting.
119 _IRR_DEBUG_BREAK_IF(ReferenceCounter <= 0) 119 _IRR_DEBUG_BREAK_IF(ReferenceCounter <= 0)
120 120
121 --ReferenceCounter; 121 --ReferenceCounter;
122 if (!ReferenceCounter) 122 if (!ReferenceCounter)
123 { 123 {
124 delete this; 124 delete this;
125 return true; 125 return true;
126 } 126 }
127 127
128 return false; 128 return false;
129 } 129 }
130 130
131 //! Get the reference count. 131 //! Get the reference count.
132 /** \return Current value of the reference counter. */ 132 /** \return Current value of the reference counter. */
133 s32 getReferenceCount() const 133 s32 getReferenceCount() const
134 { 134 {
135 return ReferenceCounter; 135 return ReferenceCounter;
136 } 136 }
137 137
138 //! Returns the debug name of the object. 138 //! Returns the debug name of the object.
139 /** The Debugname may only be set and changed by the object 139 /** The Debugname may only be set and changed by the object
140 itself. This method should only be used in Debug mode. 140 itself. This method should only be used in Debug mode.
141 \return Returns a string, previously set by setDebugName(); */ 141 \return Returns a string, previously set by setDebugName(); */
142 const c8* getDebugName() const 142 const c8* getDebugName() const
143 { 143 {
144 return DebugName; 144 return DebugName;
145 } 145 }
146 146
147 protected: 147 protected:
148 148
149 //! Sets the debug name of the object. 149 //! Sets the debug name of the object.
150 /** The Debugname may only be set and changed by the object 150 /** The Debugname may only be set and changed by the object
151 itself. This method should only be used in Debug mode. 151 itself. This method should only be used in Debug mode.
152 \param newName: New debug name to set. */ 152 \param newName: New debug name to set. */
153 void setDebugName(const c8* newName) 153 void setDebugName(const c8* newName)
154 { 154 {
155 DebugName = newName; 155 DebugName = newName;
156 } 156 }
157 157
158 private: 158 private:
159 159
160 //! The debug name. 160 //! The debug name.
161 const c8* DebugName; 161 const c8* DebugName;
162 162
163 //! The reference counter. Mutable to do reference counting on const objects. 163 //! The reference counter. Mutable to do reference counting on const objects.
164 mutable s32 ReferenceCounter; 164 mutable s32 ReferenceCounter;
165 }; 165 };
166 166
167} // end namespace irr 167} // end namespace irr
168 168
169#endif 169#endif
170 170
diff --git a/libraries/irrlicht-1.8/include/ISceneCollisionManager.h b/libraries/irrlicht-1.8/include/ISceneCollisionManager.h
index 5da7d9f..726936a 100644
--- a/libraries/irrlicht-1.8/include/ISceneCollisionManager.h
+++ b/libraries/irrlicht-1.8/include/ISceneCollisionManager.h
@@ -1,205 +1,205 @@
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#ifndef __I_SCENE_COLLISION_MANAGER_H_INCLUDED__ 5#ifndef __I_SCENE_COLLISION_MANAGER_H_INCLUDED__
6#define __I_SCENE_COLLISION_MANAGER_H_INCLUDED__ 6#define __I_SCENE_COLLISION_MANAGER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "vector3d.h" 9#include "vector3d.h"
10#include "triangle3d.h" 10#include "triangle3d.h"
11#include "position2d.h" 11#include "position2d.h"
12#include "line3d.h" 12#include "line3d.h"
13 13
14namespace irr 14namespace irr
15{ 15{
16 16
17namespace scene 17namespace scene
18{ 18{
19 class ISceneNode; 19 class ISceneNode;
20 class ICameraSceneNode; 20 class ICameraSceneNode;
21 class ITriangleSelector; 21 class ITriangleSelector;
22 22
23 //! The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes. 23 //! The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes.
24 class ISceneCollisionManager : public virtual IReferenceCounted 24 class ISceneCollisionManager : public virtual IReferenceCounted
25 { 25 {
26 public: 26 public:
27 27
28 //! Finds the nearest collision point of a line and lots of triangles, if there is one. 28 //! Finds the nearest collision point of a line and lots of triangles, if there is one.
29 /** \param ray: Line with which collisions are tested. 29 /** \param ray: Line with which collisions are tested.
30 \param selector: TriangleSelector containing the triangles. It 30 \param selector: TriangleSelector containing the triangles. It
31 can be created for example using 31 can be created for example using
32 ISceneManager::createTriangleSelector() or 32 ISceneManager::createTriangleSelector() or
33 ISceneManager::createTriangleOctreeSelector(). 33 ISceneManager::createTriangleOctreeSelector().
34 \param outCollisionPoint: If a collision is detected, this will 34 \param outCollisionPoint: If a collision is detected, this will
35 contain the position of the nearest collision to the line-start. 35 contain the position of the nearest collision to the line-start.
36 \param outTriangle: If a collision is detected, this will 36 \param outTriangle: If a collision is detected, this will
37 contain the triangle with which the ray collided. 37 contain the triangle with which the ray collided.
38 \param outNode: If a collision is detected, this will contain 38 \param outNode: If a collision is detected, this will contain
39 the scene node associated with the triangle that was hit. 39 the scene node associated with the triangle that was hit.
40 \return True if a collision was detected and false if not. */ 40 \return True if a collision was detected and false if not. */
41 virtual bool getCollisionPoint(const core::line3d<f32>& ray, 41 virtual bool getCollisionPoint(const core::line3d<f32>& ray,
42 ITriangleSelector* selector, core::vector3df& outCollisionPoint, 42 ITriangleSelector* selector, core::vector3df& outCollisionPoint,
43 core::triangle3df& outTriangle, ISceneNode*& outNode) =0; 43 core::triangle3df& outTriangle, ISceneNode*& outNode) =0;
44 44
45 //! Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid. 45 //! Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid.
46 /** This can be used for moving a character in a 3d world: The 46 /** This can be used for moving a character in a 3d world: The
47 character will slide at walls and is able to walk up stairs. 47 character will slide at walls and is able to walk up stairs.
48 The method used how to calculate the collision result position 48 The method used how to calculate the collision result position
49 is based on the paper "Improved Collision detection and 49 is based on the paper "Improved Collision detection and
50 Response" by Kasper Fauerby. 50 Response" by Kasper Fauerby.
51 \param selector: TriangleSelector containing the triangles of 51 \param selector: TriangleSelector containing the triangles of
52 the world. It can be created for example using 52 the world. It can be created for example using
53 ISceneManager::createTriangleSelector() or 53 ISceneManager::createTriangleSelector() or
54 ISceneManager::createTriangleOctreeSelector(). 54 ISceneManager::createTriangleOctreeSelector().
55 \param ellipsoidPosition: Position of the ellipsoid. 55 \param ellipsoidPosition: Position of the ellipsoid.
56 \param ellipsoidRadius: Radius of the ellipsoid. 56 \param ellipsoidRadius: Radius of the ellipsoid.
57 \param ellipsoidDirectionAndSpeed: Direction and speed of the 57 \param ellipsoidDirectionAndSpeed: Direction and speed of the
58 movement of the ellipsoid. 58 movement of the ellipsoid.
59 \param triout: Optional parameter where the last triangle 59 \param triout: Optional parameter where the last triangle
60 causing a collision is stored, if there is a collision. 60 causing a collision is stored, if there is a collision.
61 \param hitPosition: Return value for the position of the collision 61 \param hitPosition: Return value for the position of the collision
62 \param outFalling: Is set to true if the ellipsoid is falling 62 \param outFalling: Is set to true if the ellipsoid is falling
63 down, caused by gravity. 63 down, caused by gravity.
64 \param outNode: the node with which the ellipoid collided (if any) 64 \param outNode: the node with which the ellipoid collided (if any)
65 \param slidingSpeed: DOCUMENTATION NEEDED. 65 \param slidingSpeed: DOCUMENTATION NEEDED.
66 \param gravityDirectionAndSpeed: Direction and force of gravity. 66 \param gravityDirectionAndSpeed: Direction and force of gravity.
67 \return New position of the ellipsoid. */ 67 \return New position of the ellipsoid. */
68 virtual core::vector3df getCollisionResultPosition( 68 virtual core::vector3df getCollisionResultPosition(
69 ITriangleSelector* selector, 69 ITriangleSelector* selector,
70 const core::vector3df &ellipsoidPosition, 70 const core::vector3df &ellipsoidPosition,
71 const core::vector3df& ellipsoidRadius, 71 const core::vector3df& ellipsoidRadius,
72 const core::vector3df& ellipsoidDirectionAndSpeed, 72 const core::vector3df& ellipsoidDirectionAndSpeed,
73 core::triangle3df& triout, 73 core::triangle3df& triout,
74 core::vector3df& hitPosition, 74 core::vector3df& hitPosition,
75 bool& outFalling, 75 bool& outFalling,
76 ISceneNode*& outNode, 76 ISceneNode*& outNode,
77 f32 slidingSpeed = 0.0005f, 77 f32 slidingSpeed = 0.0005f,
78 const core::vector3df& gravityDirectionAndSpeed 78 const core::vector3df& gravityDirectionAndSpeed
79 = core::vector3df(0.0f, 0.0f, 0.0f)) = 0; 79 = core::vector3df(0.0f, 0.0f, 0.0f)) = 0;
80 80
81 //! Returns a 3d ray which would go through the 2d screen coodinates. 81 //! Returns a 3d ray which would go through the 2d screen coodinates.
82 /** \param pos: Screen coordinates in pixels. 82 /** \param pos: Screen coordinates in pixels.
83 \param camera: Camera from which the ray starts. If null, the 83 \param camera: Camera from which the ray starts. If null, the
84 active camera is used. 84 active camera is used.
85 \return Ray starting from the position of the camera and ending 85 \return Ray starting from the position of the camera and ending
86 at a length of the far value of the camera at a position which 86 at a length of the far value of the camera at a position which
87 would be behind the 2d screen coodinates. */ 87 would be behind the 2d screen coodinates. */
88 virtual core::line3d<f32> getRayFromScreenCoordinates( 88 virtual core::line3d<f32> getRayFromScreenCoordinates(
89 const core::position2d<s32>& pos, ICameraSceneNode* camera = 0) = 0; 89 const core::position2d<s32>& pos, ICameraSceneNode* camera = 0) = 0;
90 90
91 //! Calculates 2d screen position from a 3d position. 91 //! Calculates 2d screen position from a 3d position.
92 /** \param pos: 3D position in world space to be transformed 92 /** \param pos: 3D position in world space to be transformed
93 into 2d. 93 into 2d.
94 \param camera: Camera to be used. If null, the currently active 94 \param camera: Camera to be used. If null, the currently active
95 camera is used. 95 camera is used.
96 \param useViewPort: Calculate screen coordinates relative to 96 \param useViewPort: Calculate screen coordinates relative to
97 the current view port. Please note that unless the driver does 97 the current view port. Please note that unless the driver does
98 not take care of the view port, it is usually best to get the 98 not take care of the view port, it is usually best to get the
99 result in absolute screen coordinates (flag=false). 99 result in absolute screen coordinates (flag=false).
100 \return 2d screen coordinates which a object in the 3d world 100 \return 2d screen coordinates which a object in the 3d world
101 would have if it would be rendered to the screen. If the 3d 101 would have if it would be rendered to the screen. If the 3d
102 position is behind the camera, it is set to (-1000,-1000). In 102 position is behind the camera, it is set to (-1000,-1000). In
103 most cases you can ignore this fact, because if you use this 103 most cases you can ignore this fact, because if you use this
104 method for drawing a decorator over a 3d object, it will be 104 method for drawing a decorator over a 3d object, it will be
105 clipped by the screen borders. */ 105 clipped by the screen borders. */
106 virtual core::position2d<s32> getScreenCoordinatesFrom3DPosition( 106 virtual core::position2d<s32> getScreenCoordinatesFrom3DPosition(
107 const core::vector3df& pos, ICameraSceneNode* camera=0, bool useViewPort=false) = 0; 107 const core::vector3df& pos, ICameraSceneNode* camera=0, bool useViewPort=false) = 0;
108 108
109 //! Gets the scene node, which is currently visible under the given screencoordinates, viewed from the currently active camera. 109 //! Gets the scene node, which is currently visible under the given screencoordinates, viewed from the currently active camera.
110 /** The collision tests are done using a bounding box for each 110 /** The collision tests are done using a bounding box for each
111 scene node. You can limit the recursive search so just all children of the specified root are tested. 111 scene node. You can limit the recursive search so just all children of the specified root are tested.
112 \param pos: Position in pixel screen coordinates, under which 112 \param pos: Position in pixel screen coordinates, under which
113 the returned scene node will be. 113 the returned scene node will be.
114 \param idBitMask: Only scene nodes with an id with bits set 114 \param idBitMask: Only scene nodes with an id with bits set
115 like in this mask will be tested. If the BitMask is 0, this 115 like in this mask will be tested. If the BitMask is 0, this
116 feature is disabled. 116 feature is disabled.
117 Please note that the default node id of -1 will match with 117 Please note that the default node id of -1 will match with
118 every bitmask != 0 118 every bitmask != 0
119 \param bNoDebugObjects: Doesn't take debug objects into account 119 \param bNoDebugObjects: Doesn't take debug objects into account
120 when true. These are scene nodes with IsDebugObject() = true. 120 when true. These are scene nodes with IsDebugObject() = true.
121 \param root If different from 0, the search is limited to the children of this node. 121 \param root If different from 0, the search is limited to the children of this node.
122 \return Visible scene node under screen coordinates with 122 \return Visible scene node under screen coordinates with
123 matching bits in its id. If there is no scene node under this 123 matching bits in its id. If there is no scene node under this
124 position, 0 is returned. */ 124 position, 0 is returned. */
125 virtual ISceneNode* getSceneNodeFromScreenCoordinatesBB(const core::position2d<s32>& pos, 125 virtual ISceneNode* getSceneNodeFromScreenCoordinatesBB(const core::position2d<s32>& pos,
126 s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode* root=0) =0; 126 s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode* root=0) =0;
127 127
128 //! Returns the nearest scene node which collides with a 3d ray and whose id matches a bitmask. 128 //! Returns the nearest scene node which collides with a 3d ray and whose id matches a bitmask.
129 /** The collision tests are done using a bounding box for each 129 /** The collision tests are done using a bounding box for each
130 scene node. The recursive search can be limited be specifying a scene node. 130 scene node. The recursive search can be limited be specifying a scene node.
131 \param ray Line with which collisions are tested. 131 \param ray Line with which collisions are tested.
132 \param idBitMask Only scene nodes with an id which matches at 132 \param idBitMask Only scene nodes with an id which matches at
133 least one of the bits contained in this mask will be tested. 133 least one of the bits contained in this mask will be tested.
134 However, if this parameter is 0, then all nodes are checked. 134 However, if this parameter is 0, then all nodes are checked.
135 \param bNoDebugObjects: Doesn't take debug objects into account when true. These 135 \param bNoDebugObjects: Doesn't take debug objects into account when true. These
136 are scene nodes with IsDebugObject() = true. 136 are scene nodes with IsDebugObject() = true.
137 \param root If different from 0, the search is limited to the children of this node. 137 \param root If different from 0, the search is limited to the children of this node.
138 \return Scene node nearest to ray.start, which collides with 138 \return Scene node nearest to ray.start, which collides with
139 the ray and matches the idBitMask, if the mask is not null. If 139 the ray and matches the idBitMask, if the mask is not null. If
140 no scene node is found, 0 is returned. */ 140 no scene node is found, 0 is returned. */
141 virtual ISceneNode* getSceneNodeFromRayBB(const core::line3d<f32>& ray, 141 virtual ISceneNode* getSceneNodeFromRayBB(const core::line3d<f32>& ray,
142 s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode* root=0) =0; 142 s32 idBitMask=0, bool bNoDebugObjects=false, ISceneNode* root=0) =0;
143 143
144 //! Get the scene node, which the given camera is looking at and whose id matches the bitmask. 144 //! Get the scene node, which the given camera is looking at and whose id matches the bitmask.
145 /** A ray is simply casted from the position of the camera to 145 /** A ray is simply casted from the position of the camera to
146 the view target position, and all scene nodes are tested 146 the view target position, and all scene nodes are tested
147 against this ray. The collision tests are done using a bounding 147 against this ray. The collision tests are done using a bounding
148 box for each scene node. 148 box for each scene node.
149 \param camera: Camera from which the ray is casted. 149 \param camera: Camera from which the ray is casted.
150 \param idBitMask: Only scene nodes with an id which matches at least one of the 150 \param idBitMask: Only scene nodes with an id which matches at least one of the
151 bits contained in this mask will be tested. However, if this parameter is 0, then 151 bits contained in this mask will be tested. However, if this parameter is 0, then
152 all nodes are checked. 152 all nodes are checked.
153 feature is disabled. 153 feature is disabled.
154 Please note that the default node id of -1 will match with 154 Please note that the default node id of -1 will match with
155 every bitmask != 0 155 every bitmask != 0
156 \param bNoDebugObjects: Doesn't take debug objects into account 156 \param bNoDebugObjects: Doesn't take debug objects into account
157 when true. These are scene nodes with IsDebugObject() = true. 157 when true. These are scene nodes with IsDebugObject() = true.
158 \return Scene node nearest to the camera, which collides with 158 \return Scene node nearest to the camera, which collides with
159 the ray and matches the idBitMask, if the mask is not null. If 159 the ray and matches the idBitMask, if the mask is not null. If
160 no scene node is found, 0 is returned. */ 160 no scene node is found, 0 is returned. */
161 virtual ISceneNode* getSceneNodeFromCameraBB(ICameraSceneNode* camera, 161 virtual ISceneNode* getSceneNodeFromCameraBB(ICameraSceneNode* camera,
162 s32 idBitMask=0, bool bNoDebugObjects = false) = 0; 162 s32 idBitMask=0, bool bNoDebugObjects = false) = 0;
163 163
164 //! Perform a ray/box and ray/triangle collision check on a heirarchy of scene nodes. 164 //! Perform a ray/box and ray/triangle collision check on a heirarchy of scene nodes.
165 /** This checks all scene nodes under the specified one, first by ray/bounding 165 /** This checks all scene nodes under the specified one, first by ray/bounding
166 box, and then by accurate ray/triangle collision, finding the nearest collision, 166 box, and then by accurate ray/triangle collision, finding the nearest collision,
167 and the scene node containg it. It returns the node hit, and (via output 167 and the scene node containg it. It returns the node hit, and (via output
168 parameters) the position of the collision, and the triangle that was hit. 168 parameters) the position of the collision, and the triangle that was hit.
169 169
170 All scene nodes in the hierarchy tree under the specified node are checked. Only 170 All scene nodes in the hierarchy tree under the specified node are checked. Only
171 nodes that are visible, with an ID that matches at least one bit in the supplied 171 nodes that are visible, with an ID that matches at least one bit in the supplied
172 bitmask, and which have a triangle selector are considered as candidates for being hit. 172 bitmask, and which have a triangle selector are considered as candidates for being hit.
173 You do not have to build a meta triangle selector; the individual triangle selectors 173 You do not have to build a meta triangle selector; the individual triangle selectors
174 of each candidate scene node are used automatically. 174 of each candidate scene node are used automatically.
175 175
176 \param ray: Line with which collisions are tested. 176 \param ray: Line with which collisions are tested.
177 \param outCollisionPoint: If a collision is detected, this will contain the 177 \param outCollisionPoint: If a collision is detected, this will contain the
178 position of the nearest collision. 178 position of the nearest collision.
179 \param outTriangle: If a collision is detected, this will contain the triangle 179 \param outTriangle: If a collision is detected, this will contain the triangle
180 with which the ray collided. 180 with which the ray collided.
181 \param idBitMask: Only scene nodes with an id which matches at least one of the 181 \param idBitMask: Only scene nodes with an id which matches at least one of the
182 bits contained in this mask will be tested. However, if this parameter is 0, then 182 bits contained in this mask will be tested. However, if this parameter is 0, then
183 all nodes are checked. 183 all nodes are checked.
184 \param collisionRootNode: the scene node at which to begin checking. Only this 184 \param collisionRootNode: the scene node at which to begin checking. Only this
185 node and its children will be checked. If you want to check the entire scene, 185 node and its children will be checked. If you want to check the entire scene,
186 pass 0, and the root scene node will be used (this is the default). 186 pass 0, and the root scene node will be used (this is the default).
187 \param noDebugObjects: when true, debug objects are not considered viable targets. 187 \param noDebugObjects: when true, debug objects are not considered viable targets.
188 Debug objects are scene nodes with IsDebugObject() = true. 188 Debug objects are scene nodes with IsDebugObject() = true.
189 \return Returns the scene node containing the hit triangle nearest to ray.start. 189 \return Returns the scene node containing the hit triangle nearest to ray.start.
190 If no collision is detected, then 0 is returned. */ 190 If no collision is detected, then 0 is returned. */
191 virtual ISceneNode* getSceneNodeAndCollisionPointFromRay( 191 virtual ISceneNode* getSceneNodeAndCollisionPointFromRay(
192 core::line3df ray, 192 core::line3df ray,
193 core::vector3df & outCollisionPoint, 193 core::vector3df & outCollisionPoint,
194 core::triangle3df & outTriangle, 194 core::triangle3df & outTriangle,
195 s32 idBitMask = 0, 195 s32 idBitMask = 0,
196 ISceneNode * collisionRootNode = 0, 196 ISceneNode * collisionRootNode = 0,
197 bool noDebugObjects = false) = 0; 197 bool noDebugObjects = false) = 0;
198 }; 198 };
199 199
200 200
201} // end namespace scene 201} // end namespace scene
202} // end namespace irr 202} // end namespace irr
203 203
204#endif 204#endif
205 205
diff --git a/libraries/irrlicht-1.8/include/ISceneLoader.h b/libraries/irrlicht-1.8/include/ISceneLoader.h
index c71c15d..45a80f3 100644
--- a/libraries/irrlicht-1.8/include/ISceneLoader.h
+++ b/libraries/irrlicht-1.8/include/ISceneLoader.h
@@ -1,62 +1,62 @@
1// Copyright (C) 2010-2012 Nikolaus Gebhardt 1// Copyright (C) 2010-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#ifndef __I_SCENE_LOADER_H_INCLUDED__ 5#ifndef __I_SCENE_LOADER_H_INCLUDED__
6#define __I_SCENE_LOADER_H_INCLUDED__ 6#define __I_SCENE_LOADER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "path.h" 9#include "path.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace io 13namespace io
14{ 14{
15 class IReadFile; 15 class IReadFile;
16} // end namespace io 16} // end namespace io
17namespace scene 17namespace scene
18{ 18{
19 class ISceneNode; 19 class ISceneNode;
20 class ISceneUserDataSerializer; 20 class ISceneUserDataSerializer;
21 21
22//! Class which can load a scene into the scene manager. 22//! Class which can load a scene into the scene manager.
23/** If you want Irrlicht to be able to load currently unsupported 23/** If you want Irrlicht to be able to load currently unsupported
24scene file formats (e.g. .vrml), then implement this and add your 24scene file formats (e.g. .vrml), then implement this and add your
25new Sceneloader to the engine with ISceneManager::addExternalSceneLoader(). */ 25new Sceneloader to the engine with ISceneManager::addExternalSceneLoader(). */
26class ISceneLoader : public virtual IReferenceCounted 26class ISceneLoader : public virtual IReferenceCounted
27{ 27{
28public: 28public:
29 29
30 //! Returns true if the class might be able to load this file. 30 //! Returns true if the class might be able to load this file.
31 /** This decision should be based on the file extension (e.g. ".vrml") 31 /** This decision should be based on the file extension (e.g. ".vrml")
32 only. 32 only.
33 \param filename Name of the file to test. 33 \param filename Name of the file to test.
34 \return True if the extension is a recognised type. */ 34 \return True if the extension is a recognised type. */
35 virtual bool isALoadableFileExtension(const io::path& filename) const = 0; 35 virtual bool isALoadableFileExtension(const io::path& filename) const = 0;
36 36
37 //! Returns true if the class might be able to load this file. 37 //! Returns true if the class might be able to load this file.
38 /** This decision will be based on a quick look at the contents of the file. 38 /** This decision will be based on a quick look at the contents of the file.
39 \param file The file to test. 39 \param file The file to test.
40 \return True if the extension is a recognised type. */ 40 \return True if the extension is a recognised type. */
41 virtual bool isALoadableFileFormat(io::IReadFile* file) const = 0; 41 virtual bool isALoadableFileFormat(io::IReadFile* file) const = 0;
42 42
43 //! Loads the scene into the scene manager. 43 //! Loads the scene into the scene manager.
44 /** \param file File which contains the scene. 44 /** \param file File which contains the scene.
45 \param userDataSerializer: If you want to load user data which may be attached 45 \param userDataSerializer: If you want to load user data which may be attached
46 to some some scene nodes in the file, implement the ISceneUserDataSerializer 46 to some some scene nodes in the file, implement the ISceneUserDataSerializer
47 interface and provide it as parameter here. Otherwise, simply specify 0 as this 47 interface and provide it as parameter here. Otherwise, simply specify 0 as this
48 parameter. 48 parameter.
49 \param rootNode The node to load the scene into, if none is provided then the 49 \param rootNode The node to load the scene into, if none is provided then the
50 scene will be loaded into the root node. 50 scene will be loaded into the root node.
51 \return Returns true on success, false on failure. Returns 0 if loading failed. */ 51 \return Returns true on success, false on failure. Returns 0 if loading failed. */
52 virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0, 52 virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0,
53 ISceneNode* rootNode=0) = 0; 53 ISceneNode* rootNode=0) = 0;
54 54
55}; 55};
56 56
57 57
58} // end namespace scene 58} // end namespace scene
59} // end namespace irr 59} // end namespace irr
60 60
61#endif 61#endif
62 62
diff --git a/libraries/irrlicht-1.8/include/ISceneManager.h b/libraries/irrlicht-1.8/include/ISceneManager.h
index 574fe27..2502d73 100644
--- a/libraries/irrlicht-1.8/include/ISceneManager.h
+++ b/libraries/irrlicht-1.8/include/ISceneManager.h
@@ -1,1663 +1,1663 @@
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#ifndef __I_SCENE_MANAGER_H_INCLUDED__ 5#ifndef __I_SCENE_MANAGER_H_INCLUDED__
6#define __I_SCENE_MANAGER_H_INCLUDED__ 6#define __I_SCENE_MANAGER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "irrArray.h" 9#include "irrArray.h"
10#include "irrString.h" 10#include "irrString.h"
11#include "path.h" 11#include "path.h"
12#include "vector3d.h" 12#include "vector3d.h"
13#include "dimension2d.h" 13#include "dimension2d.h"
14#include "SColor.h" 14#include "SColor.h"
15#include "ETerrainElements.h" 15#include "ETerrainElements.h"
16#include "ESceneNodeTypes.h" 16#include "ESceneNodeTypes.h"
17#include "ESceneNodeAnimatorTypes.h" 17#include "ESceneNodeAnimatorTypes.h"
18#include "EMeshWriterEnums.h" 18#include "EMeshWriterEnums.h"
19#include "SceneParameters.h" 19#include "SceneParameters.h"
20#include "IGeometryCreator.h" 20#include "IGeometryCreator.h"
21#include "ISkinnedMesh.h" 21#include "ISkinnedMesh.h"
22 22
23namespace irr 23namespace irr
24{ 24{
25 struct SKeyMap; 25 struct SKeyMap;
26 struct SEvent; 26 struct SEvent;
27 27
28namespace io 28namespace io
29{ 29{
30 class IReadFile; 30 class IReadFile;
31 class IAttributes; 31 class IAttributes;
32 class IWriteFile; 32 class IWriteFile;
33 class IFileSystem; 33 class IFileSystem;
34} // end namespace io 34} // end namespace io
35 35
36namespace gui 36namespace gui
37{ 37{
38 class IGUIFont; 38 class IGUIFont;
39 class IGUIEnvironment; 39 class IGUIEnvironment;
40} // end namespace gui 40} // end namespace gui
41 41
42namespace video 42namespace video
43{ 43{
44 class IVideoDriver; 44 class IVideoDriver;
45 class SMaterial; 45 class SMaterial;
46 class IImage; 46 class IImage;
47 class ITexture; 47 class ITexture;
48} // end namespace video 48} // end namespace video
49 49
50namespace scene 50namespace scene
51{ 51{
52 //! Enumeration for render passes. 52 //! Enumeration for render passes.
53 /** A parameter passed to the registerNodeForRendering() method of the ISceneManager, 53 /** A parameter passed to the registerNodeForRendering() method of the ISceneManager,
54 specifying when the node wants to be drawn in relation to the other nodes. */ 54 specifying when the node wants to be drawn in relation to the other nodes. */
55 enum E_SCENE_NODE_RENDER_PASS 55 enum E_SCENE_NODE_RENDER_PASS
56 { 56 {
57 //! No pass currently active 57 //! No pass currently active
58 ESNRP_NONE =0, 58 ESNRP_NONE =0,
59 59
60 //! Camera pass. The active view is set up here. The very first pass. 60 //! Camera pass. The active view is set up here. The very first pass.
61 ESNRP_CAMERA =1, 61 ESNRP_CAMERA =1,
62 62
63 //! In this pass, lights are transformed into camera space and added to the driver 63 //! In this pass, lights are transformed into camera space and added to the driver
64 ESNRP_LIGHT =2, 64 ESNRP_LIGHT =2,
65 65
66 //! This is used for sky boxes. 66 //! This is used for sky boxes.
67 ESNRP_SKY_BOX =4, 67 ESNRP_SKY_BOX =4,
68 68
69 //! All normal objects can use this for registering themselves. 69 //! All normal objects can use this for registering themselves.
70 /** This value will never be returned by 70 /** This value will never be returned by
71 ISceneManager::getSceneNodeRenderPass(). The scene manager 71 ISceneManager::getSceneNodeRenderPass(). The scene manager
72 will determine by itself if an object is transparent or solid 72 will determine by itself if an object is transparent or solid
73 and register the object as SNRT_TRANSPARENT or SNRT_SOLD 73 and register the object as SNRT_TRANSPARENT or SNRT_SOLD
74 automatically if you call registerNodeForRendering with this 74 automatically if you call registerNodeForRendering with this
75 value (which is default). Note that it will register the node 75 value (which is default). Note that it will register the node
76 only as ONE type. If your scene node has both solid and 76 only as ONE type. If your scene node has both solid and
77 transparent material types register it twice (one time as 77 transparent material types register it twice (one time as
78 SNRT_SOLID, the other time as SNRT_TRANSPARENT) and in the 78 SNRT_SOLID, the other time as SNRT_TRANSPARENT) and in the
79 render() method call getSceneNodeRenderPass() to find out the 79 render() method call getSceneNodeRenderPass() to find out the
80 current render pass and render only the corresponding parts of 80 current render pass and render only the corresponding parts of
81 the node. */ 81 the node. */
82 ESNRP_AUTOMATIC =24, 82 ESNRP_AUTOMATIC =24,
83 83
84 //! Solid scene nodes or special scene nodes without materials. 84 //! Solid scene nodes or special scene nodes without materials.
85 ESNRP_SOLID =8, 85 ESNRP_SOLID =8,
86 86
87 //! Transparent scene nodes, drawn after solid nodes. They are sorted from back to front and drawn in that order. 87 //! Transparent scene nodes, drawn after solid nodes. They are sorted from back to front and drawn in that order.
88 ESNRP_TRANSPARENT =16, 88 ESNRP_TRANSPARENT =16,
89 89
90 //! Transparent effect scene nodes, drawn after Transparent nodes. They are sorted from back to front and drawn in that order. 90 //! Transparent effect scene nodes, drawn after Transparent nodes. They are sorted from back to front and drawn in that order.
91 ESNRP_TRANSPARENT_EFFECT =32, 91 ESNRP_TRANSPARENT_EFFECT =32,
92 92
93 //! Drawn after the solid nodes, before the transparent nodes, the time for drawing shadow volumes 93 //! Drawn after the solid nodes, before the transparent nodes, the time for drawing shadow volumes
94 ESNRP_SHADOW =64 94 ESNRP_SHADOW =64
95 }; 95 };
96 96
97 class IAnimatedMesh; 97 class IAnimatedMesh;
98 class IAnimatedMeshSceneNode; 98 class IAnimatedMeshSceneNode;
99 class IBillboardSceneNode; 99 class IBillboardSceneNode;
100 class IBillboardTextSceneNode; 100 class IBillboardTextSceneNode;
101 class ICameraSceneNode; 101 class ICameraSceneNode;
102 class IDummyTransformationSceneNode; 102 class IDummyTransformationSceneNode;
103 class ILightManager; 103 class ILightManager;
104 class ILightSceneNode; 104 class ILightSceneNode;
105 class IMesh; 105 class IMesh;
106 class IMeshBuffer; 106 class IMeshBuffer;
107 class IMeshCache; 107 class IMeshCache;
108 class IMeshLoader; 108 class IMeshLoader;
109 class IMeshManipulator; 109 class IMeshManipulator;
110 class IMeshSceneNode; 110 class IMeshSceneNode;
111 class IMeshWriter; 111 class IMeshWriter;
112 class IMetaTriangleSelector; 112 class IMetaTriangleSelector;
113 class IParticleSystemSceneNode; 113 class IParticleSystemSceneNode;
114 class ISceneCollisionManager; 114 class ISceneCollisionManager;
115 class ISceneLoader; 115 class ISceneLoader;
116 class ISceneNode; 116 class ISceneNode;
117 class ISceneNodeAnimator; 117 class ISceneNodeAnimator;
118 class ISceneNodeAnimatorCollisionResponse; 118 class ISceneNodeAnimatorCollisionResponse;
119 class ISceneNodeAnimatorFactory; 119 class ISceneNodeAnimatorFactory;
120 class ISceneNodeFactory; 120 class ISceneNodeFactory;
121 class ISceneUserDataSerializer; 121 class ISceneUserDataSerializer;
122 class ITerrainSceneNode; 122 class ITerrainSceneNode;
123 class ITextSceneNode; 123 class ITextSceneNode;
124 class ITriangleSelector; 124 class ITriangleSelector;
125 class IVolumeLightSceneNode; 125 class IVolumeLightSceneNode;
126 126
127 namespace quake3 127 namespace quake3
128 { 128 {
129 struct IShader; 129 struct IShader;
130 } // end namespace quake3 130 } // end namespace quake3
131 131
132 //! The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff. 132 //! The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
133 /** All Scene nodes can be created only here. There is a always growing 133 /** All Scene nodes can be created only here. There is a always growing
134 list of scene nodes for lots of purposes: Indoor rendering scene nodes 134 list of scene nodes for lots of purposes: Indoor rendering scene nodes
135 like the Octree (addOctreeSceneNode()) or the terrain renderer 135 like the Octree (addOctreeSceneNode()) or the terrain renderer
136 (addTerrainSceneNode()), different Camera scene nodes 136 (addTerrainSceneNode()), different Camera scene nodes
137 (addCameraSceneNode(), addCameraSceneNodeMaya()), scene nodes for Light 137 (addCameraSceneNode(), addCameraSceneNodeMaya()), scene nodes for Light
138 (addLightSceneNode()), Billboards (addBillboardSceneNode()) and so on. 138 (addLightSceneNode()), Billboards (addBillboardSceneNode()) and so on.
139 A scene node is a node in the hierachical scene graph. Every scene node 139 A scene node is a node in the hierachical scene graph. Every scene node
140 may have children, which are other scene nodes. Children move relative 140 may have children, which are other scene nodes. Children move relative
141 the their parents position. If the parent of a node is not visible, its 141 the their parents position. If the parent of a node is not visible, its
142 children won't be visible, too. In this way, it is for example easily 142 children won't be visible, too. In this way, it is for example easily
143 possible to attach a light to a moving car or to place a walking 143 possible to attach a light to a moving car or to place a walking
144 character on a moving platform on a moving ship. 144 character on a moving platform on a moving ship.
145 The SceneManager is also able to load 3d mesh files of different 145 The SceneManager is also able to load 3d mesh files of different
146 formats. Take a look at getMesh() to find out what formats are 146 formats. Take a look at getMesh() to find out what formats are
147 supported. If these formats are not enough, use 147 supported. If these formats are not enough, use
148 addExternalMeshLoader() to add new formats to the engine. 148 addExternalMeshLoader() to add new formats to the engine.
149 */ 149 */
150 class ISceneManager : public virtual IReferenceCounted 150 class ISceneManager : public virtual IReferenceCounted
151 { 151 {
152 public: 152 public:
153 153
154 //! Get pointer to an animateable mesh. Loads the file if not loaded already. 154 //! Get pointer to an animateable mesh. Loads the file if not loaded already.
155 /** 155 /**
156 * If you want to remove a loaded mesh from the cache again, use removeMesh(). 156 * If you want to remove a loaded mesh from the cache again, use removeMesh().
157 * Currently there are the following mesh formats supported: 157 * Currently there are the following mesh formats supported:
158 * <TABLE border="1" cellpadding="2" cellspacing="0"> 158 * <TABLE border="1" cellpadding="2" cellspacing="0">
159 * <TR> 159 * <TR>
160 * <TD>Format</TD> 160 * <TD>Format</TD>
161 * <TD>Description</TD> 161 * <TD>Description</TD>
162 * </TR> 162 * </TR>
163 * <TR> 163 * <TR>
164 * <TD>3D Studio (.3ds)</TD> 164 * <TD>3D Studio (.3ds)</TD>
165 * <TD>Loader for 3D-Studio files which lots of 3D packages 165 * <TD>Loader for 3D-Studio files which lots of 3D packages
166 * are able to export. Only static meshes are currently 166 * are able to export. Only static meshes are currently
167 * supported by this importer.</TD> 167 * supported by this importer.</TD>
168 * </TR> 168 * </TR>
169 * <TR> 169 * <TR>
170 * <TD>3D World Studio (.smf)</TD> 170 * <TD>3D World Studio (.smf)</TD>
171 * <TD>Loader for Leadwerks SMF mesh files, a simple mesh format 171 * <TD>Loader for Leadwerks SMF mesh files, a simple mesh format
172 * containing static geometry for games. The proprietary .STF texture format 172 * containing static geometry for games. The proprietary .STF texture format
173 * is not supported yet. This loader was originally written by Joseph Ellis. </TD> 173 * is not supported yet. This loader was originally written by Joseph Ellis. </TD>
174 * </TR> 174 * </TR>
175 * <TR> 175 * <TR>
176 * <TD>Bliz Basic B3D (.b3d)</TD> 176 * <TD>Bliz Basic B3D (.b3d)</TD>
177 * <TD>Loader for blitz basic files, developed by Mark 177 * <TD>Loader for blitz basic files, developed by Mark
178 * Sibly. This is the ideal animated mesh format for game 178 * Sibly. This is the ideal animated mesh format for game
179 * characters as it is both rigidly defined and widely 179 * characters as it is both rigidly defined and widely
180 * supported by modeling and animation software. 180 * supported by modeling and animation software.
181 * As this format supports skeletal animations, an 181 * As this format supports skeletal animations, an
182 * ISkinnedMesh will be returned by this importer.</TD> 182 * ISkinnedMesh will be returned by this importer.</TD>
183 * </TR> 183 * </TR>
184 * <TR> 184 * <TR>
185 * <TD>Cartography shop 4 (.csm)</TD> 185 * <TD>Cartography shop 4 (.csm)</TD>
186 * <TD>Cartography Shop is a modeling program for creating 186 * <TD>Cartography Shop is a modeling program for creating
187 * architecture and calculating lighting. Irrlicht can 187 * architecture and calculating lighting. Irrlicht can
188 * directly import .csm files thanks to the IrrCSM library 188 * directly import .csm files thanks to the IrrCSM library
189 * created by Saurav Mohapatra which is now integrated 189 * created by Saurav Mohapatra which is now integrated
190 * directly in Irrlicht. If you are using this loader, 190 * directly in Irrlicht. If you are using this loader,
191 * please note that you'll have to set the path of the 191 * please note that you'll have to set the path of the
192 * textures before loading .csm files. You can do this 192 * textures before loading .csm files. You can do this
193 * using 193 * using
194 * SceneManager-&gt;getParameters()-&gt;setAttribute(scene::CSM_TEXTURE_PATH, 194 * SceneManager-&gt;getParameters()-&gt;setAttribute(scene::CSM_TEXTURE_PATH,
195 * &quot;path/to/your/textures&quot;);</TD> 195 * &quot;path/to/your/textures&quot;);</TD>
196 * </TR> 196 * </TR>
197 * <TR> 197 * <TR>
198 * <TD>COLLADA (.dae, .xml)</TD> 198 * <TD>COLLADA (.dae, .xml)</TD>
199 * <TD>COLLADA is an open Digital Asset Exchange Schema for 199 * <TD>COLLADA is an open Digital Asset Exchange Schema for
200 * the interactive 3D industry. There are exporters and 200 * the interactive 3D industry. There are exporters and
201 * importers for this format available for most of the 201 * importers for this format available for most of the
202 * big 3d packagesat http://collada.org. Irrlicht can 202 * big 3d packagesat http://collada.org. Irrlicht can
203 * import COLLADA files by using the 203 * import COLLADA files by using the
204 * ISceneManager::getMesh() method. COLLADA files need 204 * ISceneManager::getMesh() method. COLLADA files need
205 * not contain only one single mesh but multiple meshes 205 * not contain only one single mesh but multiple meshes
206 * and a whole scene setup with lights, cameras and mesh 206 * and a whole scene setup with lights, cameras and mesh
207 * instances, this loader can set up a scene as 207 * instances, this loader can set up a scene as
208 * described by the COLLADA file instead of loading and 208 * described by the COLLADA file instead of loading and
209 * returning one single mesh. By default, this loader 209 * returning one single mesh. By default, this loader
210 * behaves like the other loaders and does not create 210 * behaves like the other loaders and does not create
211 * instances, but it can be switched into this mode by 211 * instances, but it can be switched into this mode by
212 * using 212 * using
213 * SceneManager-&gt;getParameters()-&gt;setAttribute(COLLADA_CREATE_SCENE_INSTANCES, true); 213 * SceneManager-&gt;getParameters()-&gt;setAttribute(COLLADA_CREATE_SCENE_INSTANCES, true);
214 * Created scene nodes will be named as the names of the 214 * Created scene nodes will be named as the names of the
215 * nodes in the COLLADA file. The returned mesh is just 215 * nodes in the COLLADA file. The returned mesh is just
216 * a dummy object in this mode. Meshes included in the 216 * a dummy object in this mode. Meshes included in the
217 * scene will be added into the scene manager with the 217 * scene will be added into the scene manager with the
218 * following naming scheme: 218 * following naming scheme:
219 * "path/to/file/file.dea#meshname". The loading of such 219 * "path/to/file/file.dea#meshname". The loading of such
220 * meshes is logged. Currently, this loader is able to 220 * meshes is logged. Currently, this loader is able to
221 221
222 222
223 * create meshes (made of only polygons), lights, and 223 * create meshes (made of only polygons), lights, and
224 * cameras. Materials and animations are currently not 224 * cameras. Materials and animations are currently not
225 * supported but this will change with future releases. 225 * supported but this will change with future releases.
226 * </TD> 226 * </TD>
227 * </TR> 227 * </TR>
228 * <TR> 228 * <TR>
229 * <TD>Delgine DeleD (.dmf)</TD> 229 * <TD>Delgine DeleD (.dmf)</TD>
230 * <TD>DeleD (delgine.com) is a 3D editor and level-editor 230 * <TD>DeleD (delgine.com) is a 3D editor and level-editor
231 * combined into one and is specifically designed for 3D 231 * combined into one and is specifically designed for 3D
232 * game-development. With this loader, it is possible to 232 * game-development. With this loader, it is possible to
233 * directly load all geometry is as well as textures and 233 * directly load all geometry is as well as textures and
234 * lightmaps from .dmf files. To set texture and 234 * lightmaps from .dmf files. To set texture and
235 * material paths, see scene::DMF_USE_MATERIALS_DIRS and 235 * material paths, see scene::DMF_USE_MATERIALS_DIRS and
236 * scene::DMF_TEXTURE_PATH. It is also possible to flip 236 * scene::DMF_TEXTURE_PATH. It is also possible to flip
237 * the alpha texture by setting 237 * the alpha texture by setting
238 * scene::DMF_FLIP_ALPHA_TEXTURES to true and to set the 238 * scene::DMF_FLIP_ALPHA_TEXTURES to true and to set the
239 * material transparent reference value by setting 239 * material transparent reference value by setting
240 * scene::DMF_ALPHA_CHANNEL_REF to a float between 0 and 240 * scene::DMF_ALPHA_CHANNEL_REF to a float between 0 and
241 * 1. The loader is based on Salvatore Russo's .dmf 241 * 1. The loader is based on Salvatore Russo's .dmf
242 * loader, I just changed some parts of it. Thanks to 242 * loader, I just changed some parts of it. Thanks to
243 * Salvatore for his work and for allowing me to use his 243 * Salvatore for his work and for allowing me to use his
244 * code in Irrlicht and put it under Irrlicht's license. 244 * code in Irrlicht and put it under Irrlicht's license.
245 * For newer and more enchanced versions of the loader, 245 * For newer and more enchanced versions of the loader,
246 * take a look at delgine.com. 246 * take a look at delgine.com.
247 * </TD> 247 * </TD>
248 * </TR> 248 * </TR>
249 * <TR> 249 * <TR>
250 * <TD>DirectX (.x)</TD> 250 * <TD>DirectX (.x)</TD>
251 * <TD>Platform independent importer (so not D3D-only) for 251 * <TD>Platform independent importer (so not D3D-only) for
252 * .x files. Most 3D packages can export these natively 252 * .x files. Most 3D packages can export these natively
253 * and there are several tools for them available, e.g. 253 * and there are several tools for them available, e.g.
254 * the Maya exporter included in the DX SDK. 254 * the Maya exporter included in the DX SDK.
255 * .x files can include skeletal animations and Irrlicht 255 * .x files can include skeletal animations and Irrlicht
256 * is able to play and display them, users can manipulate 256 * is able to play and display them, users can manipulate
257 * the joints via the ISkinnedMesh interface. Currently, 257 * the joints via the ISkinnedMesh interface. Currently,
258 * Irrlicht only supports uncompressed .x files.</TD> 258 * Irrlicht only supports uncompressed .x files.</TD>
259 * </TR> 259 * </TR>
260 * <TR> 260 * <TR>
261 * <TD>Half-Life model (.mdl)</TD> 261 * <TD>Half-Life model (.mdl)</TD>
262 * <TD>This loader opens Half-life 1 models, it was contributed 262 * <TD>This loader opens Half-life 1 models, it was contributed
263 * by Fabio Concas and adapted by Thomas Alten.</TD> 263 * by Fabio Concas and adapted by Thomas Alten.</TD>
264 * </TR> 264 * </TR>
265 * <TR> 265 * <TR>
266 * <TD>Irrlicht Mesh (.irrMesh)</TD> 266 * <TD>Irrlicht Mesh (.irrMesh)</TD>
267 * <TD>This is a static mesh format written in XML, native 267 * <TD>This is a static mesh format written in XML, native
268 * to Irrlicht and written by the irr mesh writer. 268 * to Irrlicht and written by the irr mesh writer.
269 * This format is exported by the CopperCube engine's 269 * This format is exported by the CopperCube engine's
270 * lightmapper.</TD> 270 * lightmapper.</TD>
271 * </TR> 271 * </TR>
272 * <TR> 272 * <TR>
273 * <TD>LightWave (.lwo)</TD> 273 * <TD>LightWave (.lwo)</TD>
274 * <TD>Native to NewTek's LightWave 3D, the LWO format is well 274 * <TD>Native to NewTek's LightWave 3D, the LWO format is well
275 * known and supported by many exporters. This loader will 275 * known and supported by many exporters. This loader will
276 * import LWO2 models including lightmaps, bumpmaps and 276 * import LWO2 models including lightmaps, bumpmaps and
277 * reflection textures.</TD> 277 * reflection textures.</TD>
278 * </TR> 278 * </TR>
279 * <TR> 279 * <TR>
280 * <TD>Maya (.obj)</TD> 280 * <TD>Maya (.obj)</TD>
281 * <TD>Most 3D software can create .obj files which contain 281 * <TD>Most 3D software can create .obj files which contain
282 * static geometry without material data. The material 282 * static geometry without material data. The material
283 * files .mtl are also supported. This importer for 283 * files .mtl are also supported. This importer for
284 * Irrlicht can load them directly. </TD> 284 * Irrlicht can load them directly. </TD>
285 * </TR> 285 * </TR>
286 * <TR> 286 * <TR>
287 * <TD>Milkshape (.ms3d)</TD> 287 * <TD>Milkshape (.ms3d)</TD>
288 * <TD>.MS3D files contain models and sometimes skeletal 288 * <TD>.MS3D files contain models and sometimes skeletal
289 * animations from the Milkshape 3D modeling and animation 289 * animations from the Milkshape 3D modeling and animation
290 * software. Like the other skeletal mesh loaders, oints 290 * software. Like the other skeletal mesh loaders, oints
291 * are exposed via the ISkinnedMesh animated mesh type.</TD> 291 * are exposed via the ISkinnedMesh animated mesh type.</TD>
292 * </TR> 292 * </TR>
293 * <TR> 293 * <TR>
294 * <TD>My3D (.my3d)</TD> 294 * <TD>My3D (.my3d)</TD>
295 * <TD>.my3D is a flexible 3D file format. The My3DTools 295 * <TD>.my3D is a flexible 3D file format. The My3DTools
296 * contains plug-ins to export .my3D files from several 296 * contains plug-ins to export .my3D files from several
297 * 3D packages. With this built-in importer, Irrlicht 297 * 3D packages. With this built-in importer, Irrlicht
298 * can read and display those files directly. This 298 * can read and display those files directly. This
299 * loader was written by Zhuck Dimitry who also created 299 * loader was written by Zhuck Dimitry who also created
300 * the whole My3DTools package. If you are using this 300 * the whole My3DTools package. If you are using this
301 * loader, please note that you can set the path of the 301 * loader, please note that you can set the path of the
302 * textures before loading .my3d files. You can do this 302 * textures before loading .my3d files. You can do this
303 * using 303 * using
304 * SceneManager-&gt;getParameters()-&gt;setAttribute(scene::MY3D_TEXTURE_PATH, 304 * SceneManager-&gt;getParameters()-&gt;setAttribute(scene::MY3D_TEXTURE_PATH,
305 * &quot;path/to/your/textures&quot;); 305 * &quot;path/to/your/textures&quot;);
306 * </TD> 306 * </TD>
307 * </TR> 307 * </TR>
308 * <TR> 308 * <TR>
309 * <TD>OCT (.oct)</TD> 309 * <TD>OCT (.oct)</TD>
310 * <TD>The oct file format contains 3D geometry and 310 * <TD>The oct file format contains 3D geometry and
311 * lightmaps and can be loaded directly by Irrlicht. OCT 311 * lightmaps and can be loaded directly by Irrlicht. OCT
312 * files<br> can be created by FSRad, Paul Nette's 312 * files<br> can be created by FSRad, Paul Nette's
313 * radiosity processor or exported from Blender using 313 * radiosity processor or exported from Blender using
314 * OCTTools which can be found in the exporters/OCTTools 314 * OCTTools which can be found in the exporters/OCTTools
315 * directory of the SDK. Thanks to Murphy McCauley for 315 * directory of the SDK. Thanks to Murphy McCauley for
316 * creating all this.</TD> 316 * creating all this.</TD>
317 * </TR> 317 * </TR>
318 * <TR> 318 * <TR>
319 * <TD>OGRE Meshes (.mesh)</TD> 319 * <TD>OGRE Meshes (.mesh)</TD>
320 * <TD>Ogre .mesh files contain 3D data for the OGRE 3D 320 * <TD>Ogre .mesh files contain 3D data for the OGRE 3D
321 * engine. Irrlicht can read and display them directly 321 * engine. Irrlicht can read and display them directly
322 * with this importer. To define materials for the mesh, 322 * with this importer. To define materials for the mesh,
323 * copy a .material file named like the corresponding 323 * copy a .material file named like the corresponding
324 * .mesh file where the .mesh file is. (For example 324 * .mesh file where the .mesh file is. (For example
325 * ogrehead.material for ogrehead.mesh). Thanks to 325 * ogrehead.material for ogrehead.mesh). Thanks to
326 * Christian Stehno who wrote and contributed this 326 * Christian Stehno who wrote and contributed this
327 * loader.</TD> 327 * loader.</TD>
328 * </TR> 328 * </TR>
329 * <TR> 329 * <TR>
330 * <TD>Pulsar LMTools (.lmts)</TD> 330 * <TD>Pulsar LMTools (.lmts)</TD>
331 * <TD>LMTools is a set of tools (Windows &amp; Linux) for 331 * <TD>LMTools is a set of tools (Windows &amp; Linux) for
332 * creating lightmaps. Irrlicht can directly read .lmts 332 * creating lightmaps. Irrlicht can directly read .lmts
333 * files thanks to<br> the importer created by Jonas 333 * files thanks to<br> the importer created by Jonas
334 * Petersen. If you are using this loader, please note 334 * Petersen. If you are using this loader, please note
335 * that you can set the path of the textures before 335 * that you can set the path of the textures before
336 * loading .lmts files. You can do this using 336 * loading .lmts files. You can do this using
337 * SceneManager-&gt;getParameters()-&gt;setAttribute(scene::LMTS_TEXTURE_PATH, 337 * SceneManager-&gt;getParameters()-&gt;setAttribute(scene::LMTS_TEXTURE_PATH,
338 * &quot;path/to/your/textures&quot;); 338 * &quot;path/to/your/textures&quot;);
339 * Notes for<br> this version of the loader:<br> 339 * Notes for<br> this version of the loader:<br>
340 * - It does not recognise/support user data in the 340 * - It does not recognise/support user data in the
341 * *.lmts files.<br> 341 * *.lmts files.<br>
342 * - The TGAs generated by LMTools don't work in 342 * - The TGAs generated by LMTools don't work in
343 * Irrlicht for some reason (the textures are upside 343 * Irrlicht for some reason (the textures are upside
344 * down). Opening and resaving them in a graphics app 344 * down). Opening and resaving them in a graphics app
345 * will solve the problem.</TD> 345 * will solve the problem.</TD>
346 * </TR> 346 * </TR>
347 * <TR> 347 * <TR>
348 * <TD>Quake 3 levels (.bsp)</TD> 348 * <TD>Quake 3 levels (.bsp)</TD>
349 * <TD>Quake 3 is a popular game by IDSoftware, and .pk3 349 * <TD>Quake 3 is a popular game by IDSoftware, and .pk3
350 * files contain .bsp files and textures/lightmaps 350 * files contain .bsp files and textures/lightmaps
351 * describing huge prelighted levels. Irrlicht can read 351 * describing huge prelighted levels. Irrlicht can read
352 * .pk3 and .bsp files directly and thus render Quake 3 352 * .pk3 and .bsp files directly and thus render Quake 3
353 * levels directly. Written by Nikolaus Gebhardt 353 * levels directly. Written by Nikolaus Gebhardt
354 * enhanced by Dean P. Macri with the curved surfaces 354 * enhanced by Dean P. Macri with the curved surfaces
355 * feature. </TD> 355 * feature. </TD>
356 * </TR> 356 * </TR>
357 * <TR> 357 * <TR>
358 * <TD>Quake 2 models (.md2)</TD> 358 * <TD>Quake 2 models (.md2)</TD>
359 * <TD>Quake 2 models are characters with morph target 359 * <TD>Quake 2 models are characters with morph target
360 * animation. Irrlicht can read, display and animate 360 * animation. Irrlicht can read, display and animate
361 * them directly with this importer. </TD> 361 * them directly with this importer. </TD>
362 * </TR> 362 * </TR>
363 * <TR> 363 * <TR>
364 * <TD>Quake 3 models (.md3)</TD> 364 * <TD>Quake 3 models (.md3)</TD>
365 * <TD>Quake 3 models are characters with morph target 365 * <TD>Quake 3 models are characters with morph target
366 * animation, they contain mount points for weapons and body 366 * animation, they contain mount points for weapons and body
367 * parts and are typically made of several sections which are 367 * parts and are typically made of several sections which are
368 * manually joined together.</TD> 368 * manually joined together.</TD>
369 * </TR> 369 * </TR>
370 * <TR> 370 * <TR>
371 * <TD>Stanford Triangle (.ply)</TD> 371 * <TD>Stanford Triangle (.ply)</TD>
372 * <TD>Invented by Stanford University and known as the native 372 * <TD>Invented by Stanford University and known as the native
373 * format of the infamous "Stanford Bunny" model, this is a 373 * format of the infamous "Stanford Bunny" model, this is a
374 * popular static mesh format used by 3D scanning hardware 374 * popular static mesh format used by 3D scanning hardware
375 * and software. This loader supports extremely large models 375 * and software. This loader supports extremely large models
376 * in both ASCII and binary format, but only has rudimentary 376 * in both ASCII and binary format, but only has rudimentary
377 * material support in the form of vertex colors and texture 377 * material support in the form of vertex colors and texture
378 * coordinates.</TD> 378 * coordinates.</TD>
379 * </TR> 379 * </TR>
380 * <TR> 380 * <TR>
381 * <TD>Stereolithography (.stl)</TD> 381 * <TD>Stereolithography (.stl)</TD>
382 * <TD>The STL format is used for rapid prototyping and 382 * <TD>The STL format is used for rapid prototyping and
383 * computer-aided manufacturing, thus has no support for 383 * computer-aided manufacturing, thus has no support for
384 * materials.</TD> 384 * materials.</TD>
385 * </TR> 385 * </TR>
386 * </TABLE> 386 * </TABLE>
387 * 387 *
388 * To load and display a mesh quickly, just do this: 388 * To load and display a mesh quickly, just do this:
389 * \code 389 * \code
390 * SceneManager->addAnimatedMeshSceneNode( 390 * SceneManager->addAnimatedMeshSceneNode(
391 * SceneManager->getMesh("yourmesh.3ds")); 391 * SceneManager->getMesh("yourmesh.3ds"));
392 * \endcode 392 * \endcode
393 * If you would like to implement and add your own file format loader to Irrlicht, 393 * If you would like to implement and add your own file format loader to Irrlicht,
394 * see addExternalMeshLoader(). 394 * see addExternalMeshLoader().
395 * \param filename: Filename of the mesh to load. 395 * \param filename: Filename of the mesh to load.
396 * \return Null if failed, otherwise pointer to the mesh. 396 * \return Null if failed, otherwise pointer to the mesh.
397 * This pointer should not be dropped. See IReferenceCounted::drop() for more information. 397 * This pointer should not be dropped. See IReferenceCounted::drop() for more information.
398 **/ 398 **/
399 virtual IAnimatedMesh* getMesh(const io::path& filename) = 0; 399 virtual IAnimatedMesh* getMesh(const io::path& filename) = 0;
400 400
401 //! Get pointer to an animateable mesh. Loads the file if not loaded already. 401 //! Get pointer to an animateable mesh. Loads the file if not loaded already.
402 /** Works just as getMesh(const char* filename). If you want to 402 /** Works just as getMesh(const char* filename). If you want to
403 remove a loaded mesh from the cache again, use removeMesh(). 403 remove a loaded mesh from the cache again, use removeMesh().
404 \param file File handle of the mesh to load. 404 \param file File handle of the mesh to load.
405 \return NULL if failed and pointer to the mesh if successful. 405 \return NULL if failed and pointer to the mesh if successful.
406 This pointer should not be dropped. See 406 This pointer should not be dropped. See
407 IReferenceCounted::drop() for more information. */ 407 IReferenceCounted::drop() for more information. */
408 virtual IAnimatedMesh* getMesh(io::IReadFile* file) = 0; 408 virtual IAnimatedMesh* getMesh(io::IReadFile* file) = 0;
409 409
410 //! Get interface to the mesh cache which is shared beween all existing scene managers. 410 //! Get interface to the mesh cache which is shared beween all existing scene managers.
411 /** With this interface, it is possible to manually add new loaded 411 /** With this interface, it is possible to manually add new loaded
412 meshes (if ISceneManager::getMesh() is not sufficient), to remove them and to iterate 412 meshes (if ISceneManager::getMesh() is not sufficient), to remove them and to iterate
413 through already loaded meshes. */ 413 through already loaded meshes. */
414 virtual IMeshCache* getMeshCache() = 0; 414 virtual IMeshCache* getMeshCache() = 0;
415 415
416 //! Get the video driver. 416 //! Get the video driver.
417 /** \return Pointer to the video Driver. 417 /** \return Pointer to the video Driver.
418 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 418 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
419 virtual video::IVideoDriver* getVideoDriver() = 0; 419 virtual video::IVideoDriver* getVideoDriver() = 0;
420 420
421 //! Get the active GUIEnvironment 421 //! Get the active GUIEnvironment
422 /** \return Pointer to the GUIEnvironment 422 /** \return Pointer to the GUIEnvironment
423 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 423 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
424 virtual gui::IGUIEnvironment* getGUIEnvironment() = 0; 424 virtual gui::IGUIEnvironment* getGUIEnvironment() = 0;
425 425
426 //! Get the active FileSystem 426 //! Get the active FileSystem
427 /** \return Pointer to the FileSystem 427 /** \return Pointer to the FileSystem
428 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 428 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
429 virtual io::IFileSystem* getFileSystem() = 0; 429 virtual io::IFileSystem* getFileSystem() = 0;
430 430
431 //! adds Volume Lighting Scene Node. 431 //! adds Volume Lighting Scene Node.
432 /** Example Usage: 432 /** Example Usage:
433 scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(0, -1, 433 scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(0, -1,
434 32, 32, //Subdivide U/V 434 32, 32, //Subdivide U/V
435 video::SColor(0, 180, 180, 180), //foot color 435 video::SColor(0, 180, 180, 180), //foot color
436 video::SColor(0, 0, 0, 0) //tail color 436 video::SColor(0, 0, 0, 0) //tail color
437 ); 437 );
438 if (n) 438 if (n)
439 { 439 {
440 n->setScale(core::vector3df(46.0f, 45.0f, 46.0f)); 440 n->setScale(core::vector3df(46.0f, 45.0f, 46.0f));
441 n->getMaterial(0).setTexture(0, smgr->getVideoDriver()->getTexture("lightFalloff.png")); 441 n->getMaterial(0).setTexture(0, smgr->getVideoDriver()->getTexture("lightFalloff.png"));
442 } 442 }
443 \return Pointer to the volumeLight if successful, otherwise NULL. 443 \return Pointer to the volumeLight if successful, otherwise NULL.
444 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 444 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
445 virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1, 445 virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1,
446 const u32 subdivU = 32, const u32 subdivV = 32, 446 const u32 subdivU = 32, const u32 subdivV = 32,
447 const video::SColor foot = video::SColor(51, 0, 230, 180), 447 const video::SColor foot = video::SColor(51, 0, 230, 180),
448 const video::SColor tail = video::SColor(0, 0, 0, 0), 448 const video::SColor tail = video::SColor(0, 0, 0, 0),
449 const core::vector3df& position = core::vector3df(0,0,0), 449 const core::vector3df& position = core::vector3df(0,0,0),
450 const core::vector3df& rotation = core::vector3df(0,0,0), 450 const core::vector3df& rotation = core::vector3df(0,0,0),
451 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; 451 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
452 452
453 //! Adds a cube scene node 453 //! Adds a cube scene node
454 /** \param size: Size of the cube, uniformly in each dimension. 454 /** \param size: Size of the cube, uniformly in each dimension.
455 \param parent: Parent of the scene node. Can be 0 if no parent. 455 \param parent: Parent of the scene node. Can be 0 if no parent.
456 \param id: Id of the node. This id can be used to identify the scene node. 456 \param id: Id of the node. This id can be used to identify the scene node.
457 \param position: Position of the space relative to its parent 457 \param position: Position of the space relative to its parent
458 where the scene node will be placed. 458 where the scene node will be placed.
459 \param rotation: Initital rotation of the scene node. 459 \param rotation: Initital rotation of the scene node.
460 \param scale: Initial scale of the scene node. 460 \param scale: Initial scale of the scene node.
461 \return Pointer to the created test scene node. This 461 \return Pointer to the created test scene node. This
462 pointer should not be dropped. See IReferenceCounted::drop() 462 pointer should not be dropped. See IReferenceCounted::drop()
463 for more information. */ 463 for more information. */
464 virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1, 464 virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1,
465 const core::vector3df& position = core::vector3df(0,0,0), 465 const core::vector3df& position = core::vector3df(0,0,0),
466 const core::vector3df& rotation = core::vector3df(0,0,0), 466 const core::vector3df& rotation = core::vector3df(0,0,0),
467 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; 467 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
468 468
469 //! Adds a sphere scene node of the given radius and detail 469 //! Adds a sphere scene node of the given radius and detail
470 /** \param radius: Radius of the sphere. 470 /** \param radius: Radius of the sphere.
471 \param polyCount: The number of vertices in horizontal and 471 \param polyCount: The number of vertices in horizontal and
472 vertical direction. The total polyCount of the sphere is 472 vertical direction. The total polyCount of the sphere is
473 polyCount*polyCount. This parameter must be less than 256 to 473 polyCount*polyCount. This parameter must be less than 256 to
474 stay within the 16-bit limit of the indices of a meshbuffer. 474 stay within the 16-bit limit of the indices of a meshbuffer.
475 \param parent: Parent of the scene node. Can be 0 if no parent. 475 \param parent: Parent of the scene node. Can be 0 if no parent.
476 \param id: Id of the node. This id can be used to identify the scene node. 476 \param id: Id of the node. This id can be used to identify the scene node.
477 \param position: Position of the space relative to its parent 477 \param position: Position of the space relative to its parent
478 where the scene node will be placed. 478 where the scene node will be placed.
479 \param rotation: Initital rotation of the scene node. 479 \param rotation: Initital rotation of the scene node.
480 \param scale: Initial scale of the scene node. 480 \param scale: Initial scale of the scene node.
481 \return Pointer to the created test scene node. This 481 \return Pointer to the created test scene node. This
482 pointer should not be dropped. See IReferenceCounted::drop() 482 pointer should not be dropped. See IReferenceCounted::drop()
483 for more information. */ 483 for more information. */
484 virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16, 484 virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16,
485 ISceneNode* parent=0, s32 id=-1, 485 ISceneNode* parent=0, s32 id=-1,
486 const core::vector3df& position = core::vector3df(0,0,0), 486 const core::vector3df& position = core::vector3df(0,0,0),
487 const core::vector3df& rotation = core::vector3df(0,0,0), 487 const core::vector3df& rotation = core::vector3df(0,0,0),
488 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; 488 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
489 489
490 //! Adds a scene node for rendering an animated mesh model. 490 //! Adds a scene node for rendering an animated mesh model.
491 /** \param mesh: Pointer to the loaded animated mesh to be displayed. 491 /** \param mesh: Pointer to the loaded animated mesh to be displayed.
492 \param parent: Parent of the scene node. Can be NULL if no parent. 492 \param parent: Parent of the scene node. Can be NULL if no parent.
493 \param id: Id of the node. This id can be used to identify the scene node. 493 \param id: Id of the node. This id can be used to identify the scene node.
494 \param position: Position of the space relative to its parent where the 494 \param position: Position of the space relative to its parent where the
495 scene node will be placed. 495 scene node will be placed.
496 \param rotation: Initital rotation of the scene node. 496 \param rotation: Initital rotation of the scene node.
497 \param scale: Initial scale of the scene node. 497 \param scale: Initial scale of the scene node.
498 \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed. 498 \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
499 \return Pointer to the created scene node. 499 \return Pointer to the created scene node.
500 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 500 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
501 virtual IAnimatedMeshSceneNode* addAnimatedMeshSceneNode(IAnimatedMesh* mesh, 501 virtual IAnimatedMeshSceneNode* addAnimatedMeshSceneNode(IAnimatedMesh* mesh,
502 ISceneNode* parent=0, s32 id=-1, 502 ISceneNode* parent=0, s32 id=-1,
503 const core::vector3df& position = core::vector3df(0,0,0), 503 const core::vector3df& position = core::vector3df(0,0,0),
504 const core::vector3df& rotation = core::vector3df(0,0,0), 504 const core::vector3df& rotation = core::vector3df(0,0,0),
505 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f), 505 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
506 bool alsoAddIfMeshPointerZero=false) = 0; 506 bool alsoAddIfMeshPointerZero=false) = 0;
507 507
508 //! Adds a scene node for rendering a static mesh. 508 //! Adds a scene node for rendering a static mesh.
509 /** \param mesh: Pointer to the loaded static mesh to be displayed. 509 /** \param mesh: Pointer to the loaded static mesh to be displayed.
510 \param parent: Parent of the scene node. Can be NULL if no parent. 510 \param parent: Parent of the scene node. Can be NULL if no parent.
511 \param id: Id of the node. This id can be used to identify the scene node. 511 \param id: Id of the node. This id can be used to identify the scene node.
512 \param position: Position of the space relative to its parent where the 512 \param position: Position of the space relative to its parent where the
513 scene node will be placed. 513 scene node will be placed.
514 \param rotation: Initital rotation of the scene node. 514 \param rotation: Initital rotation of the scene node.
515 \param scale: Initial scale of the scene node. 515 \param scale: Initial scale of the scene node.
516 \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed. 516 \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
517 \return Pointer to the created scene node. 517 \return Pointer to the created scene node.
518 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 518 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
519 virtual IMeshSceneNode* addMeshSceneNode(IMesh* mesh, ISceneNode* parent=0, s32 id=-1, 519 virtual IMeshSceneNode* addMeshSceneNode(IMesh* mesh, ISceneNode* parent=0, s32 id=-1,
520 const core::vector3df& position = core::vector3df(0,0,0), 520 const core::vector3df& position = core::vector3df(0,0,0),
521 const core::vector3df& rotation = core::vector3df(0,0,0), 521 const core::vector3df& rotation = core::vector3df(0,0,0),
522 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f), 522 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
523 bool alsoAddIfMeshPointerZero=false) = 0; 523 bool alsoAddIfMeshPointerZero=false) = 0;
524 524
525 //! Adds a scene node for rendering a animated water surface mesh. 525 //! Adds a scene node for rendering a animated water surface mesh.
526 /** Looks really good when the Material type EMT_TRANSPARENT_REFLECTION 526 /** Looks really good when the Material type EMT_TRANSPARENT_REFLECTION
527 is used. 527 is used.
528 \param waveHeight: Height of the water waves. 528 \param waveHeight: Height of the water waves.
529 \param waveSpeed: Speed of the water waves. 529 \param waveSpeed: Speed of the water waves.
530 \param waveLength: Lenght of a water wave. 530 \param waveLength: Lenght of a water wave.
531 \param mesh: Pointer to the loaded static mesh to be displayed with water waves on it. 531 \param mesh: Pointer to the loaded static mesh to be displayed with water waves on it.
532 \param parent: Parent of the scene node. Can be NULL if no parent. 532 \param parent: Parent of the scene node. Can be NULL if no parent.
533 \param id: Id of the node. This id can be used to identify the scene node. 533 \param id: Id of the node. This id can be used to identify the scene node.
534 \param position: Position of the space relative to its parent where the 534 \param position: Position of the space relative to its parent where the
535 scene node will be placed. 535 scene node will be placed.
536 \param rotation: Initital rotation of the scene node. 536 \param rotation: Initital rotation of the scene node.
537 \param scale: Initial scale of the scene node. 537 \param scale: Initial scale of the scene node.
538 \return Pointer to the created scene node. 538 \return Pointer to the created scene node.
539 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 539 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
540 virtual ISceneNode* addWaterSurfaceSceneNode(IMesh* mesh, 540 virtual ISceneNode* addWaterSurfaceSceneNode(IMesh* mesh,
541 f32 waveHeight=2.0f, f32 waveSpeed=300.0f, f32 waveLength=10.0f, 541 f32 waveHeight=2.0f, f32 waveSpeed=300.0f, f32 waveLength=10.0f,
542 ISceneNode* parent=0, s32 id=-1, 542 ISceneNode* parent=0, s32 id=-1,
543 const core::vector3df& position = core::vector3df(0,0,0), 543 const core::vector3df& position = core::vector3df(0,0,0),
544 const core::vector3df& rotation = core::vector3df(0,0,0), 544 const core::vector3df& rotation = core::vector3df(0,0,0),
545 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; 545 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
546 546
547 547
548 //! Adds a scene node for rendering using a octree to the scene graph. 548 //! Adds a scene node for rendering using a octree to the scene graph.
549 /** This a good method for rendering 549 /** This a good method for rendering
550 scenes with lots of geometry. The Octree is built on the fly from the mesh. 550 scenes with lots of geometry. The Octree is built on the fly from the mesh.
551 \param mesh: The mesh containing all geometry from which the octree will be build. 551 \param mesh: The mesh containing all geometry from which the octree will be build.
552 If this animated mesh has more than one frames in it, the first frame is taken. 552 If this animated mesh has more than one frames in it, the first frame is taken.
553 \param parent: Parent node of the octree node. 553 \param parent: Parent node of the octree node.
554 \param id: id of the node. This id can be used to identify the node. 554 \param id: id of the node. This id can be used to identify the node.
555 \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node. 555 \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
556 If a node gets less polys than this value it will not be split into 556 If a node gets less polys than this value it will not be split into
557 smaller nodes. 557 smaller nodes.
558 \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed. 558 \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
559 \return Pointer to the Octree if successful, otherwise 0. 559 \return Pointer to the Octree if successful, otherwise 0.
560 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 560 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
561 virtual IMeshSceneNode* addOctreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0, 561 virtual IMeshSceneNode* addOctreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0,
562 s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) = 0; 562 s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) = 0;
563 563
564 //! Adds a scene node for rendering using a octree to the scene graph. 564 //! Adds a scene node for rendering using a octree to the scene graph.
565 /** \deprecated Use addOctreeSceneNode instead. This method may be removed by Irrlicht 1.9. */ 565 /** \deprecated Use addOctreeSceneNode instead. This method may be removed by Irrlicht 1.9. */
566 _IRR_DEPRECATED_ IMeshSceneNode* addOctTreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0, 566 _IRR_DEPRECATED_ IMeshSceneNode* addOctTreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0,
567 s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) 567 s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false)
568 { 568 {
569 return addOctreeSceneNode(mesh, parent, id, minimalPolysPerNode, alsoAddIfMeshPointerZero); 569 return addOctreeSceneNode(mesh, parent, id, minimalPolysPerNode, alsoAddIfMeshPointerZero);
570 } 570 }
571 571
572 //! Adds a scene node for rendering using a octree to the scene graph. 572 //! Adds a scene node for rendering using a octree to the scene graph.
573 /** This a good method for rendering scenes with lots of 573 /** This a good method for rendering scenes with lots of
574 geometry. The Octree is built on the fly from the mesh, much 574 geometry. The Octree is built on the fly from the mesh, much
575 faster then a bsp tree. 575 faster then a bsp tree.
576 \param mesh: The mesh containing all geometry from which the octree will be build. 576 \param mesh: The mesh containing all geometry from which the octree will be build.
577 \param parent: Parent node of the octree node. 577 \param parent: Parent node of the octree node.
578 \param id: id of the node. This id can be used to identify the node. 578 \param id: id of the node. This id can be used to identify the node.
579 \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node. 579 \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
580 If a node gets less polys than this value it will not be split into 580 If a node gets less polys than this value it will not be split into
581 smaller nodes. 581 smaller nodes.
582 \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed. 582 \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
583 \return Pointer to the octree if successful, otherwise 0. 583 \return Pointer to the octree if successful, otherwise 0.
584 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 584 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
585 virtual IMeshSceneNode* addOctreeSceneNode(IMesh* mesh, ISceneNode* parent=0, 585 virtual IMeshSceneNode* addOctreeSceneNode(IMesh* mesh, ISceneNode* parent=0,
586 s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false) = 0; 586 s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false) = 0;
587 587
588 //! Adds a scene node for rendering using a octree to the scene graph. 588 //! Adds a scene node for rendering using a octree to the scene graph.
589 /** \deprecated Use addOctreeSceneNode instead. This method may be removed by Irrlicht 1.9. */ 589 /** \deprecated Use addOctreeSceneNode instead. This method may be removed by Irrlicht 1.9. */
590 _IRR_DEPRECATED_ IMeshSceneNode* addOctTreeSceneNode(IMesh* mesh, ISceneNode* parent=0, 590 _IRR_DEPRECATED_ IMeshSceneNode* addOctTreeSceneNode(IMesh* mesh, ISceneNode* parent=0,
591 s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false) 591 s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false)
592 { 592 {
593 return addOctreeSceneNode(mesh, parent, id, minimalPolysPerNode, alsoAddIfMeshPointerZero); 593 return addOctreeSceneNode(mesh, parent, id, minimalPolysPerNode, alsoAddIfMeshPointerZero);
594 } 594 }
595 595
596 //! Adds a camera scene node to the scene graph and sets it as active camera. 596 //! Adds a camera scene node to the scene graph and sets it as active camera.
597 /** This camera does not react on user input like for example the one created with 597 /** This camera does not react on user input like for example the one created with
598 addCameraSceneNodeFPS(). If you want to move or animate it, use animators or the 598 addCameraSceneNodeFPS(). If you want to move or animate it, use animators or the
599 ISceneNode::setPosition(), ICameraSceneNode::setTarget() etc methods. 599 ISceneNode::setPosition(), ICameraSceneNode::setTarget() etc methods.
600 By default, a camera's look at position (set with setTarget()) and its scene node 600 By default, a camera's look at position (set with setTarget()) and its scene node
601 rotation (set with setRotation()) are independent. If you want to be able to 601 rotation (set with setRotation()) are independent. If you want to be able to
602 control the direction that the camera looks by using setRotation() then call 602 control the direction that the camera looks by using setRotation() then call
603 ICameraSceneNode::bindTargetAndRotation(true) on it. 603 ICameraSceneNode::bindTargetAndRotation(true) on it.
604 \param position: Position of the space relative to its parent where the camera will be placed. 604 \param position: Position of the space relative to its parent where the camera will be placed.
605 \param lookat: Position where the camera will look at. Also known as target. 605 \param lookat: Position where the camera will look at. Also known as target.
606 \param parent: Parent scene node of the camera. Can be null. If the parent moves, 606 \param parent: Parent scene node of the camera. Can be null. If the parent moves,
607 the camera will move too. 607 the camera will move too.
608 \param id: id of the camera. This id can be used to identify the camera. 608 \param id: id of the camera. This id can be used to identify the camera.
609 \param makeActive Flag whether this camera should become the active one. 609 \param makeActive Flag whether this camera should become the active one.
610 Make sure you always have one active camera. 610 Make sure you always have one active camera.
611 \return Pointer to interface to camera if successful, otherwise 0. 611 \return Pointer to interface to camera if successful, otherwise 0.
612 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 612 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
613 virtual ICameraSceneNode* addCameraSceneNode(ISceneNode* parent = 0, 613 virtual ICameraSceneNode* addCameraSceneNode(ISceneNode* parent = 0,
614 const core::vector3df& position = core::vector3df(0,0,0), 614 const core::vector3df& position = core::vector3df(0,0,0),
615 const core::vector3df& lookat = core::vector3df(0,0,100), 615 const core::vector3df& lookat = core::vector3df(0,0,100),
616 s32 id=-1, bool makeActive=true) = 0; 616 s32 id=-1, bool makeActive=true) = 0;
617 617
618 //! Adds a maya style user controlled camera scene node to the scene graph. 618 //! Adds a maya style user controlled camera scene node to the scene graph.
619 /** This is a standard camera with an animator that provides mouse control similar 619 /** This is a standard camera with an animator that provides mouse control similar
620 to camera in the 3D Software Maya by Alias Wavefront. 620 to camera in the 3D Software Maya by Alias Wavefront.
621 The camera does not react on setPosition anymore after applying this animator. Instead 621 The camera does not react on setPosition anymore after applying this animator. Instead
622 use setTarget, to fix the target the camera the camera hovers around. And setDistance 622 use setTarget, to fix the target the camera the camera hovers around. And setDistance
623 to set the current distance from that target, i.e. the radius of the orbit the camera 623 to set the current distance from that target, i.e. the radius of the orbit the camera
624 hovers on. 624 hovers on.
625 \param parent: Parent scene node of the camera. Can be null. 625 \param parent: Parent scene node of the camera. Can be null.
626 \param rotateSpeed: Rotation speed of the camera. 626 \param rotateSpeed: Rotation speed of the camera.
627 \param zoomSpeed: Zoom speed of the camera. 627 \param zoomSpeed: Zoom speed of the camera.
628 \param translationSpeed: TranslationSpeed of the camera. 628 \param translationSpeed: TranslationSpeed of the camera.
629 \param id: id of the camera. This id can be used to identify the camera. 629 \param id: id of the camera. This id can be used to identify the camera.
630 \param distance Initial distance of the camera from the object 630 \param distance Initial distance of the camera from the object
631 \param makeActive Flag whether this camera should become the active one. 631 \param makeActive Flag whether this camera should become the active one.
632 Make sure you always have one active camera. 632 Make sure you always have one active camera.
633 \return Returns a pointer to the interface of the camera if successful, otherwise 0. 633 \return Returns a pointer to the interface of the camera if successful, otherwise 0.
634 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 634 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
635 virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent=0, 635 virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent=0,
636 f32 rotateSpeed=-1500.f, f32 zoomSpeed=200.f, 636 f32 rotateSpeed=-1500.f, f32 zoomSpeed=200.f,
637 f32 translationSpeed=1500.f, s32 id=-1, f32 distance=70.f, 637 f32 translationSpeed=1500.f, s32 id=-1, f32 distance=70.f,
638 bool makeActive=true) =0; 638 bool makeActive=true) =0;
639 639
640 //! Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for first person shooters (FPS). 640 //! Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for first person shooters (FPS).
641 /** This FPS camera is intended to provide a demonstration of a 641 /** This FPS camera is intended to provide a demonstration of a
642 camera that behaves like a typical First Person Shooter. It is 642 camera that behaves like a typical First Person Shooter. It is
643 useful for simple demos and prototyping but is not intended to 643 useful for simple demos and prototyping but is not intended to
644 provide a full solution for a production quality game. It binds 644 provide a full solution for a production quality game. It binds
645 the camera scene node rotation to the look-at target; @see 645 the camera scene node rotation to the look-at target; @see
646 ICameraSceneNode::bindTargetAndRotation(). With this camera, 646 ICameraSceneNode::bindTargetAndRotation(). With this camera,
647 you look with the mouse, and move with cursor keys. If you want 647 you look with the mouse, and move with cursor keys. If you want
648 to change the key layout, you can specify your own keymap. For 648 to change the key layout, you can specify your own keymap. For
649 example to make the camera be controlled by the cursor keys AND 649 example to make the camera be controlled by the cursor keys AND
650 the keys W,A,S, and D, do something like this: 650 the keys W,A,S, and D, do something like this:
651 \code 651 \code
652 SKeyMap keyMap[8]; 652 SKeyMap keyMap[8];
653 keyMap[0].Action = EKA_MOVE_FORWARD; 653 keyMap[0].Action = EKA_MOVE_FORWARD;
654 keyMap[0].KeyCode = KEY_UP; 654 keyMap[0].KeyCode = KEY_UP;
655 keyMap[1].Action = EKA_MOVE_FORWARD; 655 keyMap[1].Action = EKA_MOVE_FORWARD;
656 keyMap[1].KeyCode = KEY_KEY_W; 656 keyMap[1].KeyCode = KEY_KEY_W;
657 657
658 keyMap[2].Action = EKA_MOVE_BACKWARD; 658 keyMap[2].Action = EKA_MOVE_BACKWARD;
659 keyMap[2].KeyCode = KEY_DOWN; 659 keyMap[2].KeyCode = KEY_DOWN;
660 keyMap[3].Action = EKA_MOVE_BACKWARD; 660 keyMap[3].Action = EKA_MOVE_BACKWARD;
661 keyMap[3].KeyCode = KEY_KEY_S; 661 keyMap[3].KeyCode = KEY_KEY_S;
662 662
663 keyMap[4].Action = EKA_STRAFE_LEFT; 663 keyMap[4].Action = EKA_STRAFE_LEFT;
664 keyMap[4].KeyCode = KEY_LEFT; 664 keyMap[4].KeyCode = KEY_LEFT;
665 keyMap[5].Action = EKA_STRAFE_LEFT; 665 keyMap[5].Action = EKA_STRAFE_LEFT;
666 keyMap[5].KeyCode = KEY_KEY_A; 666 keyMap[5].KeyCode = KEY_KEY_A;
667 667
668 keyMap[6].Action = EKA_STRAFE_RIGHT; 668 keyMap[6].Action = EKA_STRAFE_RIGHT;
669 keyMap[6].KeyCode = KEY_RIGHT; 669 keyMap[6].KeyCode = KEY_RIGHT;
670 keyMap[7].Action = EKA_STRAFE_RIGHT; 670 keyMap[7].Action = EKA_STRAFE_RIGHT;
671 keyMap[7].KeyCode = KEY_KEY_D; 671 keyMap[7].KeyCode = KEY_KEY_D;
672 672
673 camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8); 673 camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8);
674 \endcode 674 \endcode
675 \param parent: Parent scene node of the camera. Can be null. 675 \param parent: Parent scene node of the camera. Can be null.
676 \param rotateSpeed: Speed in degress with which the camera is 676 \param rotateSpeed: Speed in degress with which the camera is
677 rotated. This can be done only with the mouse. 677 rotated. This can be done only with the mouse.
678 \param moveSpeed: Speed in units per millisecond with which 678 \param moveSpeed: Speed in units per millisecond with which
679 the camera is moved. Movement is done with the cursor keys. 679 the camera is moved. Movement is done with the cursor keys.
680 \param id: id of the camera. This id can be used to identify 680 \param id: id of the camera. This id can be used to identify
681 the camera. 681 the camera.
682 \param keyMapArray: Optional pointer to an array of a keymap, 682 \param keyMapArray: Optional pointer to an array of a keymap,
683 specifying what keys should be used to move the camera. If this 683 specifying what keys should be used to move the camera. If this
684 is null, the default keymap is used. You can define actions 684 is null, the default keymap is used. You can define actions
685 more then one time in the array, to bind multiple keys to the 685 more then one time in the array, to bind multiple keys to the
686 same action. 686 same action.
687 \param keyMapSize: Amount of items in the keymap array. 687 \param keyMapSize: Amount of items in the keymap array.
688 \param noVerticalMovement: Setting this to true makes the 688 \param noVerticalMovement: Setting this to true makes the
689 camera only move within a horizontal plane, and disables 689 camera only move within a horizontal plane, and disables
690 vertical movement as known from most ego shooters. Default is 690 vertical movement as known from most ego shooters. Default is
691 'false', with which it is possible to fly around in space, if 691 'false', with which it is possible to fly around in space, if
692 no gravity is there. 692 no gravity is there.
693 \param jumpSpeed: Speed with which the camera is moved when 693 \param jumpSpeed: Speed with which the camera is moved when
694 jumping. 694 jumping.
695 \param invertMouse: Setting this to true makes the camera look 695 \param invertMouse: Setting this to true makes the camera look
696 up when the mouse is moved down and down when the mouse is 696 up when the mouse is moved down and down when the mouse is
697 moved up, the default is 'false' which means it will follow the 697 moved up, the default is 'false' which means it will follow the
698 movement of the mouse cursor. 698 movement of the mouse cursor.
699 \param makeActive Flag whether this camera should become the active one. 699 \param makeActive Flag whether this camera should become the active one.
700 Make sure you always have one active camera. 700 Make sure you always have one active camera.
701 \return Pointer to the interface of the camera if successful, 701 \return Pointer to the interface of the camera if successful,
702 otherwise 0. This pointer should not be dropped. See 702 otherwise 0. This pointer should not be dropped. See
703 IReferenceCounted::drop() for more information. */ 703 IReferenceCounted::drop() for more information. */
704 virtual ICameraSceneNode* addCameraSceneNodeFPS(ISceneNode* parent = 0, 704 virtual ICameraSceneNode* addCameraSceneNodeFPS(ISceneNode* parent = 0,
705 f32 rotateSpeed = 100.0f, f32 moveSpeed = 0.5f, s32 id=-1, 705 f32 rotateSpeed = 100.0f, f32 moveSpeed = 0.5f, s32 id=-1,
706 SKeyMap* keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false, 706 SKeyMap* keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false,
707 f32 jumpSpeed = 0.f, bool invertMouse=false, 707 f32 jumpSpeed = 0.f, bool invertMouse=false,
708 bool makeActive=true) = 0; 708 bool makeActive=true) = 0;
709 709
710 //! Adds a dynamic light scene node to the scene graph. 710 //! Adds a dynamic light scene node to the scene graph.
711 /** The light will cast dynamic light on all 711 /** The light will cast dynamic light on all
712 other scene nodes in the scene, which have the material flag video::MTF_LIGHTING 712 other scene nodes in the scene, which have the material flag video::MTF_LIGHTING
713 turned on. (This is the default setting in most scene nodes). 713 turned on. (This is the default setting in most scene nodes).
714 \param parent: Parent scene node of the light. Can be null. If the parent moves, 714 \param parent: Parent scene node of the light. Can be null. If the parent moves,
715 the light will move too. 715 the light will move too.
716 \param position: Position of the space relative to its parent where the light will be placed. 716 \param position: Position of the space relative to its parent where the light will be placed.
717 \param color: Diffuse color of the light. Ambient or Specular colors can be set manually with 717 \param color: Diffuse color of the light. Ambient or Specular colors can be set manually with
718 the ILightSceneNode::getLightData() method. 718 the ILightSceneNode::getLightData() method.
719 \param radius: Radius of the light. 719 \param radius: Radius of the light.
720 \param id: id of the node. This id can be used to identify the node. 720 \param id: id of the node. This id can be used to identify the node.
721 \return Pointer to the interface of the light if successful, otherwise NULL. 721 \return Pointer to the interface of the light if successful, otherwise NULL.
722 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 722 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
723 virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0, 723 virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0,
724 const core::vector3df& position = core::vector3df(0,0,0), 724 const core::vector3df& position = core::vector3df(0,0,0),
725 video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f), 725 video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f),
726 f32 radius=100.0f, s32 id=-1) = 0; 726 f32 radius=100.0f, s32 id=-1) = 0;
727 727
728 //! Adds a billboard scene node to the scene graph. 728 //! Adds a billboard scene node to the scene graph.
729 /** A billboard is like a 3d sprite: A 2d element, 729 /** A billboard is like a 3d sprite: A 2d element,
730 which always looks to the camera. It is usually used for things 730 which always looks to the camera. It is usually used for things
731 like explosions, fire, lensflares and things like that. 731 like explosions, fire, lensflares and things like that.
732 \param parent Parent scene node of the billboard. Can be null. 732 \param parent Parent scene node of the billboard. Can be null.
733 If the parent moves, the billboard will move too. 733 If the parent moves, the billboard will move too.
734 \param size Size of the billboard. This size is 2 dimensional 734 \param size Size of the billboard. This size is 2 dimensional
735 because a billboard only has width and height. 735 because a billboard only has width and height.
736 \param position Position of the space relative to its parent 736 \param position Position of the space relative to its parent
737 where the billboard will be placed. 737 where the billboard will be placed.
738 \param id An id of the node. This id can be used to identify 738 \param id An id of the node. This id can be used to identify
739 the node. 739 the node.
740 \param colorTop The color of the vertices at the top of the 740 \param colorTop The color of the vertices at the top of the
741 billboard (default: white). 741 billboard (default: white).
742 \param colorBottom The color of the vertices at the bottom of 742 \param colorBottom The color of the vertices at the bottom of
743 the billboard (default: white). 743 the billboard (default: white).
744 \return Pointer to the billboard if successful, otherwise NULL. 744 \return Pointer to the billboard if successful, otherwise NULL.
745 This pointer should not be dropped. See 745 This pointer should not be dropped. See
746 IReferenceCounted::drop() for more information. */ 746 IReferenceCounted::drop() for more information. */
747 virtual IBillboardSceneNode* addBillboardSceneNode(ISceneNode* parent = 0, 747 virtual IBillboardSceneNode* addBillboardSceneNode(ISceneNode* parent = 0,
748 const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f), 748 const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
749 const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1, 749 const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
750 video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0; 750 video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0;
751 751
752 //! Adds a skybox scene node to the scene graph. 752 //! Adds a skybox scene node to the scene graph.
753 /** A skybox is a big cube with 6 textures on it and 753 /** A skybox is a big cube with 6 textures on it and
754 is drawn around the camera position. 754 is drawn around the camera position.
755 \param top: Texture for the top plane of the box. 755 \param top: Texture for the top plane of the box.
756 \param bottom: Texture for the bottom plane of the box. 756 \param bottom: Texture for the bottom plane of the box.
757 \param left: Texture for the left plane of the box. 757 \param left: Texture for the left plane of the box.
758 \param right: Texture for the right plane of the box. 758 \param right: Texture for the right plane of the box.
759 \param front: Texture for the front plane of the box. 759 \param front: Texture for the front plane of the box.
760 \param back: Texture for the back plane of the box. 760 \param back: Texture for the back plane of the box.
761 \param parent: Parent scene node of the skybox. A skybox usually has no parent, 761 \param parent: Parent scene node of the skybox. A skybox usually has no parent,
762 so this should be null. Note: If a parent is set to the skybox, the box will not 762 so this should be null. Note: If a parent is set to the skybox, the box will not
763 change how it is drawn. 763 change how it is drawn.
764 \param id: An id of the node. This id can be used to identify the node. 764 \param id: An id of the node. This id can be used to identify the node.
765 \return Pointer to the sky box if successful, otherwise NULL. 765 \return Pointer to the sky box if successful, otherwise NULL.
766 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 766 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
767 virtual ISceneNode* addSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom, 767 virtual ISceneNode* addSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom,
768 video::ITexture* left, video::ITexture* right, video::ITexture* front, 768 video::ITexture* left, video::ITexture* right, video::ITexture* front,
769 video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) = 0; 769 video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) = 0;
770 770
771 //! Adds a skydome scene node to the scene graph. 771 //! Adds a skydome scene node to the scene graph.
772 /** A skydome is a large (half-) sphere with a panoramic texture 772 /** A skydome is a large (half-) sphere with a panoramic texture
773 on the inside and is drawn around the camera position. 773 on the inside and is drawn around the camera position.
774 \param texture: Texture for the dome. 774 \param texture: Texture for the dome.
775 \param horiRes: Number of vertices of a horizontal layer of the sphere. 775 \param horiRes: Number of vertices of a horizontal layer of the sphere.
776 \param vertRes: Number of vertices of a vertical layer of the sphere. 776 \param vertRes: Number of vertices of a vertical layer of the sphere.
777 \param texturePercentage: How much of the height of the 777 \param texturePercentage: How much of the height of the
778 texture is used. Should be between 0 and 1. 778 texture is used. Should be between 0 and 1.
779 \param spherePercentage: How much of the sphere is drawn. 779 \param spherePercentage: How much of the sphere is drawn.
780 Value should be between 0 and 2, where 1 is an exact 780 Value should be between 0 and 2, where 1 is an exact
781 half-sphere and 2 is a full sphere. 781 half-sphere and 2 is a full sphere.
782 \param radius The Radius of the sphere 782 \param radius The Radius of the sphere
783 \param parent: Parent scene node of the dome. A dome usually has no parent, 783 \param parent: Parent scene node of the dome. A dome usually has no parent,
784 so this should be null. Note: If a parent is set, the dome will not 784 so this should be null. Note: If a parent is set, the dome will not
785 change how it is drawn. 785 change how it is drawn.
786 \param id: An id of the node. This id can be used to identify the node. 786 \param id: An id of the node. This id can be used to identify the node.
787 \return Pointer to the sky dome if successful, otherwise NULL. 787 \return Pointer to the sky dome if successful, otherwise NULL.
788 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 788 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
789 virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture, 789 virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture,
790 u32 horiRes=16, u32 vertRes=8, 790 u32 horiRes=16, u32 vertRes=8,
791 f32 texturePercentage=0.9, f32 spherePercentage=2.0,f32 radius = 1000.f, 791 f32 texturePercentage=0.9, f32 spherePercentage=2.0,f32 radius = 1000.f,
792 ISceneNode* parent=0, s32 id=-1) = 0; 792 ISceneNode* parent=0, s32 id=-1) = 0;
793 793
794 //! Adds a particle system scene node to the scene graph. 794 //! Adds a particle system scene node to the scene graph.
795 /** \param withDefaultEmitter: Creates a default working point emitter 795 /** \param withDefaultEmitter: Creates a default working point emitter
796 which emitts some particles. Set this to true to see a particle system 796 which emitts some particles. Set this to true to see a particle system
797 in action. If set to false, you'll have to set the emitter you want by 797 in action. If set to false, you'll have to set the emitter you want by
798 calling IParticleSystemSceneNode::setEmitter(). 798 calling IParticleSystemSceneNode::setEmitter().
799 \param parent: Parent of the scene node. Can be NULL if no parent. 799 \param parent: Parent of the scene node. Can be NULL if no parent.
800 \param id: Id of the node. This id can be used to identify the scene node. 800 \param id: Id of the node. This id can be used to identify the scene node.
801 \param position: Position of the space relative to its parent where the 801 \param position: Position of the space relative to its parent where the
802 scene node will be placed. 802 scene node will be placed.
803 \param rotation: Initital rotation of the scene node. 803 \param rotation: Initital rotation of the scene node.
804 \param scale: Initial scale of the scene node. 804 \param scale: Initial scale of the scene node.
805 \return Pointer to the created scene node. 805 \return Pointer to the created scene node.
806 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 806 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
807 virtual IParticleSystemSceneNode* addParticleSystemSceneNode( 807 virtual IParticleSystemSceneNode* addParticleSystemSceneNode(
808 bool withDefaultEmitter=true, ISceneNode* parent=0, s32 id=-1, 808 bool withDefaultEmitter=true, ISceneNode* parent=0, s32 id=-1,
809 const core::vector3df& position = core::vector3df(0,0,0), 809 const core::vector3df& position = core::vector3df(0,0,0),
810 const core::vector3df& rotation = core::vector3df(0,0,0), 810 const core::vector3df& rotation = core::vector3df(0,0,0),
811 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; 811 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
812 812
813 //! Adds a terrain scene node to the scene graph. 813 //! Adds a terrain scene node to the scene graph.
814 /** This node implements is a simple terrain renderer which uses 814 /** This node implements is a simple terrain renderer which uses
815 a technique known as geo mip mapping 815 a technique known as geo mip mapping
816 for reducing the detail of triangle blocks which are far away. 816 for reducing the detail of triangle blocks which are far away.
817 The code for the TerrainSceneNode is based on the terrain 817 The code for the TerrainSceneNode is based on the terrain
818 renderer by Soconne and the GeoMipMapSceneNode developed by 818 renderer by Soconne and the GeoMipMapSceneNode developed by
819 Spintz. They made their code available for Irrlicht and allowed 819 Spintz. They made their code available for Irrlicht and allowed
820 it to be distributed under this licence. I only modified some 820 it to be distributed under this licence. I only modified some
821 parts. A lot of thanks go to them. 821 parts. A lot of thanks go to them.
822 822
823 This scene node is capable of loading terrains and updating 823 This scene node is capable of loading terrains and updating
824 the indices at runtime to enable viewing very large terrains 824 the indices at runtime to enable viewing very large terrains
825 very quickly. It uses a CLOD (Continuous Level of Detail) 825 very quickly. It uses a CLOD (Continuous Level of Detail)
826 algorithm which updates the indices for each patch based on 826 algorithm which updates the indices for each patch based on
827 a LOD (Level of Detail) which is determined based on a patch's 827 a LOD (Level of Detail) which is determined based on a patch's
828 distance from the camera. 828 distance from the camera.
829 829
830 The patch size of the terrain must always be a size of 2^N+1, 830 The patch size of the terrain must always be a size of 2^N+1,
831 i.e. 8+1(9), 16+1(17), etc. 831 i.e. 8+1(9), 16+1(17), etc.
832 The MaxLOD available is directly dependent on the patch size 832 The MaxLOD available is directly dependent on the patch size
833 of the terrain. LOD 0 contains all of the indices to draw all 833 of the terrain. LOD 0 contains all of the indices to draw all
834 the triangles at the max detail for a patch. As each LOD goes 834 the triangles at the max detail for a patch. As each LOD goes
835 up by 1 the step taken, in generating indices increases by 835 up by 1 the step taken, in generating indices increases by
836 -2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step 836 -2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step
837 taken is 4, LOD 3 - 8, etc. The step can be no larger than 837 taken is 4, LOD 3 - 8, etc. The step can be no larger than
838 the size of the patch, so having a LOD of 8, with a patch size 838 the size of the patch, so having a LOD of 8, with a patch size
839 of 17, is asking the algoritm to generate indices every 2^8 ( 839 of 17, is asking the algoritm to generate indices every 2^8 (
840 256 ) vertices, which is not possible with a patch size of 17. 840 256 ) vertices, which is not possible with a patch size of 17.
841 The maximum LOD for a patch size of 17 is 2^4 ( 16 ). So, 841 The maximum LOD for a patch size of 17 is 2^4 ( 16 ). So,
842 with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( 842 with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 (
843 every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every 843 every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every
844 8 vertices ) and LOD 4 ( every 16 vertices ). 844 8 vertices ) and LOD 4 ( every 16 vertices ).
845 \param heightMapFileName: The name of the file on disk, to read vertex data from. This should 845 \param heightMapFileName: The name of the file on disk, to read vertex data from. This should
846 be a gray scale bitmap. 846 be a gray scale bitmap.
847 \param parent: Parent of the scene node. Can be 0 if no parent. 847 \param parent: Parent of the scene node. Can be 0 if no parent.
848 \param id: Id of the node. This id can be used to identify the scene node. 848 \param id: Id of the node. This id can be used to identify the scene node.
849 \param position: The absolute position of this node. 849 \param position: The absolute position of this node.
850 \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED ) 850 \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
851 \param scale: The scale factor for the terrain. If you're 851 \param scale: The scale factor for the terrain. If you're
852 using a heightmap of size 129x129 and would like your terrain 852 using a heightmap of size 129x129 and would like your terrain
853 to be 12900x12900 in game units, then use a scale factor of ( 853 to be 12900x12900 in game units, then use a scale factor of (
854 core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y 854 core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
855 scaling factor of 0.0f, then your terrain will be flat. 855 scaling factor of 0.0f, then your terrain will be flat.
856 \param vertexColor: The default color of all the vertices. If no texture is associated 856 \param vertexColor: The default color of all the vertices. If no texture is associated
857 with the scene node, then all vertices will be this color. Defaults to white. 857 with the scene node, then all vertices will be this color. Defaults to white.
858 \param maxLOD: The maximum LOD (level of detail) for the node. Only change if you 858 \param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
859 know what you are doing, this might lead to strange behavior. 859 know what you are doing, this might lead to strange behavior.
860 \param patchSize: patch size of the terrain. Only change if you 860 \param patchSize: patch size of the terrain. Only change if you
861 know what you are doing, this might lead to strange behavior. 861 know what you are doing, this might lead to strange behavior.
862 \param smoothFactor: The number of times the vertices are smoothed. 862 \param smoothFactor: The number of times the vertices are smoothed.
863 \param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap. 863 \param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
864 \return Pointer to the created scene node. Can be null 864 \return Pointer to the created scene node. Can be null
865 if the terrain could not be created, for example because the 865 if the terrain could not be created, for example because the
866 heightmap could not be loaded. The returned pointer should 866 heightmap could not be loaded. The returned pointer should
867 not be dropped. See IReferenceCounted::drop() for more 867 not be dropped. See IReferenceCounted::drop() for more
868 information. */ 868 information. */
869 virtual ITerrainSceneNode* addTerrainSceneNode( 869 virtual ITerrainSceneNode* addTerrainSceneNode(
870 const io::path& heightMapFileName, 870 const io::path& heightMapFileName,
871 ISceneNode* parent=0, s32 id=-1, 871 ISceneNode* parent=0, s32 id=-1,
872 const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f), 872 const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
873 const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f), 873 const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
874 const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f), 874 const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f),
875 video::SColor vertexColor = video::SColor(255,255,255,255), 875 video::SColor vertexColor = video::SColor(255,255,255,255),
876 s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0, 876 s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0,
877 bool addAlsoIfHeightmapEmpty = false) = 0; 877 bool addAlsoIfHeightmapEmpty = false) = 0;
878 878
879 //! Adds a terrain scene node to the scene graph. 879 //! Adds a terrain scene node to the scene graph.
880 /** Just like the other addTerrainSceneNode() method, but takes an IReadFile 880 /** Just like the other addTerrainSceneNode() method, but takes an IReadFile
881 pointer as parameter for the heightmap. For more informations take a look 881 pointer as parameter for the heightmap. For more informations take a look
882 at the other function. 882 at the other function.
883 \param heightMapFile: The file handle to read vertex data from. This should 883 \param heightMapFile: The file handle to read vertex data from. This should
884 be a gray scale bitmap. 884 be a gray scale bitmap.
885 \param parent: Parent of the scene node. Can be 0 if no parent. 885 \param parent: Parent of the scene node. Can be 0 if no parent.
886 \param id: Id of the node. This id can be used to identify the scene node. 886 \param id: Id of the node. This id can be used to identify the scene node.
887 \param position: The absolute position of this node. 887 \param position: The absolute position of this node.
888 \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED ) 888 \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
889 \param scale: The scale factor for the terrain. If you're 889 \param scale: The scale factor for the terrain. If you're
890 using a heightmap of size 129x129 and would like your terrain 890 using a heightmap of size 129x129 and would like your terrain
891 to be 12900x12900 in game units, then use a scale factor of ( 891 to be 12900x12900 in game units, then use a scale factor of (
892 core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y 892 core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
893 scaling factor of 0.0f, then your terrain will be flat. 893 scaling factor of 0.0f, then your terrain will be flat.
894 \param vertexColor: The default color of all the vertices. If no texture is associated 894 \param vertexColor: The default color of all the vertices. If no texture is associated
895 with the scene node, then all vertices will be this color. Defaults to white. 895 with the scene node, then all vertices will be this color. Defaults to white.
896 \param maxLOD: The maximum LOD (level of detail) for the node. Only change if you 896 \param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
897 know what you are doing, this might lead to strange behavior. 897 know what you are doing, this might lead to strange behavior.
898 \param patchSize: patch size of the terrain. Only change if you 898 \param patchSize: patch size of the terrain. Only change if you
899 know what you are doing, this might lead to strange behavior. 899 know what you are doing, this might lead to strange behavior.
900 \param smoothFactor: The number of times the vertices are smoothed. 900 \param smoothFactor: The number of times the vertices are smoothed.
901 \param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap. 901 \param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
902 \return Pointer to the created scene node. Can be null 902 \return Pointer to the created scene node. Can be null
903 if the terrain could not be created, for example because the 903 if the terrain could not be created, for example because the
904 heightmap could not be loaded. The returned pointer should 904 heightmap could not be loaded. The returned pointer should
905 not be dropped. See IReferenceCounted::drop() for more 905 not be dropped. See IReferenceCounted::drop() for more
906 information. */ 906 information. */
907 virtual ITerrainSceneNode* addTerrainSceneNode( 907 virtual ITerrainSceneNode* addTerrainSceneNode(
908 io::IReadFile* heightMapFile, 908 io::IReadFile* heightMapFile,
909 ISceneNode* parent=0, s32 id=-1, 909 ISceneNode* parent=0, s32 id=-1,
910 const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f), 910 const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
911 const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f), 911 const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
912 const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f), 912 const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f),
913 video::SColor vertexColor = video::SColor(255,255,255,255), 913 video::SColor vertexColor = video::SColor(255,255,255,255),
914 s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0, 914 s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0,
915 bool addAlsoIfHeightmapEmpty = false) = 0; 915 bool addAlsoIfHeightmapEmpty = false) = 0;
916 916
917 //! Adds a quake3 scene node to the scene graph. 917 //! Adds a quake3 scene node to the scene graph.
918 /** A Quake3 Scene renders multiple meshes for a specific HighLanguage Shader (Quake3 Style ) 918 /** A Quake3 Scene renders multiple meshes for a specific HighLanguage Shader (Quake3 Style )
919 \return Pointer to the quake3 scene node if successful, otherwise NULL. 919 \return Pointer to the quake3 scene node if successful, otherwise NULL.
920 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 920 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
921 virtual IMeshSceneNode* addQuake3SceneNode(const IMeshBuffer* meshBuffer, const quake3::IShader * shader, 921 virtual IMeshSceneNode* addQuake3SceneNode(const IMeshBuffer* meshBuffer, const quake3::IShader * shader,
922 ISceneNode* parent=0, s32 id=-1 922 ISceneNode* parent=0, s32 id=-1
923 ) = 0; 923 ) = 0;
924 924
925 925
926 //! Adds an empty scene node to the scene graph. 926 //! Adds an empty scene node to the scene graph.
927 /** Can be used for doing advanced transformations 927 /** Can be used for doing advanced transformations
928 or structuring the scene graph. 928 or structuring the scene graph.
929 \return Pointer to the created scene node. 929 \return Pointer to the created scene node.
930 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 930 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
931 virtual ISceneNode* addEmptySceneNode(ISceneNode* parent=0, s32 id=-1) = 0; 931 virtual ISceneNode* addEmptySceneNode(ISceneNode* parent=0, s32 id=-1) = 0;
932 932
933 //! Adds a dummy transformation scene node to the scene graph. 933 //! Adds a dummy transformation scene node to the scene graph.
934 /** This scene node does not render itself, and does not respond to set/getPosition, 934 /** This scene node does not render itself, and does not respond to set/getPosition,
935 set/getRotation and set/getScale. Its just a simple scene node that takes a 935 set/getRotation and set/getScale. Its just a simple scene node that takes a
936 matrix as relative transformation, making it possible to insert any transformation 936 matrix as relative transformation, making it possible to insert any transformation
937 anywhere into the scene graph. 937 anywhere into the scene graph.
938 \return Pointer to the created scene node. 938 \return Pointer to the created scene node.
939 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 939 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
940 virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode( 940 virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode(
941 ISceneNode* parent=0, s32 id=-1) = 0; 941 ISceneNode* parent=0, s32 id=-1) = 0;
942 942
943 //! Adds a text scene node, which is able to display 2d text at a position in three dimensional space 943 //! Adds a text scene node, which is able to display 2d text at a position in three dimensional space
944 virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text, 944 virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text,
945 video::SColor color=video::SColor(100,255,255,255), 945 video::SColor color=video::SColor(100,255,255,255),
946 ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0), 946 ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0),
947 s32 id=-1) = 0; 947 s32 id=-1) = 0;
948 948
949 //! Adds a text scene node, which uses billboards. The node, and the text on it, will scale with distance. 949 //! Adds a text scene node, which uses billboards. The node, and the text on it, will scale with distance.
950 /** 950 /**
951 \param font The font to use on the billboard. Pass 0 to use the GUI environment's default font. 951 \param font The font to use on the billboard. Pass 0 to use the GUI environment's default font.
952 \param text The text to display on the billboard. 952 \param text The text to display on the billboard.
953 \param parent The billboard's parent. Pass 0 to use the root scene node. 953 \param parent The billboard's parent. Pass 0 to use the root scene node.
954 \param size The billboard's width and height. 954 \param size The billboard's width and height.
955 \param position The billboards position relative to its parent. 955 \param position The billboards position relative to its parent.
956 \param id: An id of the node. This id can be used to identify the node. 956 \param id: An id of the node. This id can be used to identify the node.
957 \param colorTop: The color of the vertices at the top of the billboard (default: white). 957 \param colorTop: The color of the vertices at the top of the billboard (default: white).
958 \param colorBottom: The color of the vertices at the bottom of the billboard (default: white). 958 \param colorBottom: The color of the vertices at the bottom of the billboard (default: white).
959 \return Pointer to the billboard if successful, otherwise NULL. 959 \return Pointer to the billboard if successful, otherwise NULL.
960 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 960 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
961 virtual IBillboardTextSceneNode* addBillboardTextSceneNode( gui::IGUIFont* font, const wchar_t* text, 961 virtual IBillboardTextSceneNode* addBillboardTextSceneNode( gui::IGUIFont* font, const wchar_t* text,
962 ISceneNode* parent = 0, 962 ISceneNode* parent = 0,
963 const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f), 963 const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
964 const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1, 964 const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
965 video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0; 965 video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0;
966 966
967 //! Adds a Hill Plane mesh to the mesh pool. 967 //! Adds a Hill Plane mesh to the mesh pool.
968 /** The mesh is generated on the fly 968 /** The mesh is generated on the fly
969 and looks like a plane with some hills on it. It is uses mostly for quick 969 and looks like a plane with some hills on it. It is uses mostly for quick
970 tests of the engine only. You can specify how many hills there should be 970 tests of the engine only. You can specify how many hills there should be
971 on the plane and how high they should be. Also you must specify a name for 971 on the plane and how high they should be. Also you must specify a name for
972 the mesh, because the mesh is added to the mesh pool, and can be retrieved 972 the mesh, because the mesh is added to the mesh pool, and can be retrieved
973 again using ISceneManager::getMesh() with the name as parameter. 973 again using ISceneManager::getMesh() with the name as parameter.
974 \param name: The name of this mesh which must be specified in order 974 \param name: The name of this mesh which must be specified in order
975 to be able to retrieve the mesh later with ISceneManager::getMesh(). 975 to be able to retrieve the mesh later with ISceneManager::getMesh().
976 \param tileSize: Size of a tile of the mesh. (10.0f, 10.0f) would be a 976 \param tileSize: Size of a tile of the mesh. (10.0f, 10.0f) would be a
977 good value to start, for example. 977 good value to start, for example.
978 \param tileCount: Specifies how much tiles there will be. If you specifiy 978 \param tileCount: Specifies how much tiles there will be. If you specifiy
979 for example that a tile has the size (10.0f, 10.0f) and the tileCount is 979 for example that a tile has the size (10.0f, 10.0f) and the tileCount is
980 (10,10), than you get a field of 100 tiles which has the dimension 100.0fx100.0f. 980 (10,10), than you get a field of 100 tiles which has the dimension 100.0fx100.0f.
981 \param material: Material of the hill mesh. 981 \param material: Material of the hill mesh.
982 \param hillHeight: Height of the hills. If you specify a negative value 982 \param hillHeight: Height of the hills. If you specify a negative value
983 you will get holes instead of hills. If the height is 0, no hills will be 983 you will get holes instead of hills. If the height is 0, no hills will be
984 created. 984 created.
985 \param countHills: Amount of hills on the plane. There will be countHills.X 985 \param countHills: Amount of hills on the plane. There will be countHills.X
986 hills along the X axis and countHills.Y along the Y axis. So in total there 986 hills along the X axis and countHills.Y along the Y axis. So in total there
987 will be countHills.X * countHills.Y hills. 987 will be countHills.X * countHills.Y hills.
988 \param textureRepeatCount: Defines how often the texture will be repeated in 988 \param textureRepeatCount: Defines how often the texture will be repeated in
989 x and y direction. 989 x and y direction.
990 return Null if the creation failed. The reason could be that you 990 return Null if the creation failed. The reason could be that you
991 specified some invalid parameters or that a mesh with that name already 991 specified some invalid parameters or that a mesh with that name already
992 exists. If successful, a pointer to the mesh is returned. 992 exists. If successful, a pointer to the mesh is returned.
993 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 993 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
994 virtual IAnimatedMesh* addHillPlaneMesh(const io::path& name, 994 virtual IAnimatedMesh* addHillPlaneMesh(const io::path& name,
995 const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount, 995 const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount,
996 video::SMaterial* material = 0, f32 hillHeight = 0.0f, 996 video::SMaterial* material = 0, f32 hillHeight = 0.0f,
997 const core::dimension2d<f32>& countHills = core::dimension2d<f32>(0.0f, 0.0f), 997 const core::dimension2d<f32>& countHills = core::dimension2d<f32>(0.0f, 0.0f),
998 const core::dimension2d<f32>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) = 0; 998 const core::dimension2d<f32>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) = 0;
999 999
1000 //! Adds a static terrain mesh to the mesh pool. 1000 //! Adds a static terrain mesh to the mesh pool.
1001 /** The mesh is generated on the fly 1001 /** The mesh is generated on the fly
1002 from a texture file and a height map file. Both files may be huge 1002 from a texture file and a height map file. Both files may be huge
1003 (8000x8000 pixels would be no problem) because the generator splits the 1003 (8000x8000 pixels would be no problem) because the generator splits the
1004 files into smaller textures if necessary. 1004 files into smaller textures if necessary.
1005 You must specify a name for the mesh, because the mesh is added to the mesh pool, 1005 You must specify a name for the mesh, because the mesh is added to the mesh pool,
1006 and can be retrieved again using ISceneManager::getMesh() with the name as parameter. 1006 and can be retrieved again using ISceneManager::getMesh() with the name as parameter.
1007 \param meshname: The name of this mesh which must be specified in order 1007 \param meshname: The name of this mesh which must be specified in order
1008 to be able to retrieve the mesh later with ISceneManager::getMesh(). 1008 to be able to retrieve the mesh later with ISceneManager::getMesh().
1009 \param texture: Texture for the terrain. Please note that this is not a 1009 \param texture: Texture for the terrain. Please note that this is not a
1010 hardware texture as usual (ITexture), but an IImage software texture. 1010 hardware texture as usual (ITexture), but an IImage software texture.
1011 You can load this texture with IVideoDriver::createImageFromFile(). 1011 You can load this texture with IVideoDriver::createImageFromFile().
1012 \param heightmap: A grayscaled heightmap image. Like the texture, 1012 \param heightmap: A grayscaled heightmap image. Like the texture,
1013 it can be created with IVideoDriver::createImageFromFile(). The amount 1013 it can be created with IVideoDriver::createImageFromFile(). The amount
1014 of triangles created depends on the size of this texture, so use a small 1014 of triangles created depends on the size of this texture, so use a small
1015 heightmap to increase rendering speed. 1015 heightmap to increase rendering speed.
1016 \param stretchSize: Parameter defining how big a is pixel on the heightmap. 1016 \param stretchSize: Parameter defining how big a is pixel on the heightmap.
1017 \param maxHeight: Defines how high a white pixel on the heighmap is. 1017 \param maxHeight: Defines how high a white pixel on the heighmap is.
1018 \param defaultVertexBlockSize: Defines the initial dimension between vertices. 1018 \param defaultVertexBlockSize: Defines the initial dimension between vertices.
1019 \return Null if the creation failed. The reason could be that you 1019 \return Null if the creation failed. The reason could be that you
1020 specified some invalid parameters, that a mesh with that name already 1020 specified some invalid parameters, that a mesh with that name already
1021 exists, or that a texture could not be found. If successful, a pointer to the mesh is returned. 1021 exists, or that a texture could not be found. If successful, a pointer to the mesh is returned.
1022 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1022 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1023 virtual IAnimatedMesh* addTerrainMesh(const io::path& meshname, 1023 virtual IAnimatedMesh* addTerrainMesh(const io::path& meshname,
1024 video::IImage* texture, video::IImage* heightmap, 1024 video::IImage* texture, video::IImage* heightmap,
1025 const core::dimension2d<f32>& stretchSize = core::dimension2d<f32>(10.0f,10.0f), 1025 const core::dimension2d<f32>& stretchSize = core::dimension2d<f32>(10.0f,10.0f),
1026 f32 maxHeight=200.0f, 1026 f32 maxHeight=200.0f,
1027 const core::dimension2d<u32>& defaultVertexBlockSize = core::dimension2d<u32>(64,64)) = 0; 1027 const core::dimension2d<u32>& defaultVertexBlockSize = core::dimension2d<u32>(64,64)) = 0;
1028 1028
1029 //! add a static arrow mesh to the meshpool 1029 //! add a static arrow mesh to the meshpool
1030 /** \param name Name of the mesh 1030 /** \param name Name of the mesh
1031 \param vtxColorCylinder color of the cylinder 1031 \param vtxColorCylinder color of the cylinder
1032 \param vtxColorCone color of the cone 1032 \param vtxColorCone color of the cone
1033 \param tesselationCylinder Number of quads the cylinder side consists of 1033 \param tesselationCylinder Number of quads the cylinder side consists of
1034 \param tesselationCone Number of triangles the cone's roof consits of 1034 \param tesselationCone Number of triangles the cone's roof consits of
1035 \param height Total height of the arrow 1035 \param height Total height of the arrow
1036 \param cylinderHeight Total height of the cylinder, should be lesser than total height 1036 \param cylinderHeight Total height of the cylinder, should be lesser than total height
1037 \param widthCylinder Diameter of the cylinder 1037 \param widthCylinder Diameter of the cylinder
1038 \param widthCone Diameter of the cone's base, should be not smaller than the cylinder's diameter 1038 \param widthCone Diameter of the cone's base, should be not smaller than the cylinder's diameter
1039 \return Pointer to the arrow mesh if successful, otherwise 0. 1039 \return Pointer to the arrow mesh if successful, otherwise 0.
1040 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1040 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1041 virtual IAnimatedMesh* addArrowMesh(const io::path& name, 1041 virtual IAnimatedMesh* addArrowMesh(const io::path& name,
1042 video::SColor vtxColorCylinder=0xFFFFFFFF, 1042 video::SColor vtxColorCylinder=0xFFFFFFFF,
1043 video::SColor vtxColorCone=0xFFFFFFFF, 1043 video::SColor vtxColorCone=0xFFFFFFFF,
1044 u32 tesselationCylinder=4, u32 tesselationCone=8, 1044 u32 tesselationCylinder=4, u32 tesselationCone=8,
1045 f32 height=1.f, f32 cylinderHeight=0.6f, 1045 f32 height=1.f, f32 cylinderHeight=0.6f,
1046 f32 widthCylinder=0.05f, f32 widthCone=0.3f) = 0; 1046 f32 widthCylinder=0.05f, f32 widthCone=0.3f) = 0;
1047 1047
1048 //! add a static sphere mesh to the meshpool 1048 //! add a static sphere mesh to the meshpool
1049 /** \param name Name of the mesh 1049 /** \param name Name of the mesh
1050 \param radius Radius of the sphere 1050 \param radius Radius of the sphere
1051 \param polyCountX Number of quads used for the horizontal tiling 1051 \param polyCountX Number of quads used for the horizontal tiling
1052 \param polyCountY Number of quads used for the vertical tiling 1052 \param polyCountY Number of quads used for the vertical tiling
1053 \return Pointer to the sphere mesh if successful, otherwise 0. 1053 \return Pointer to the sphere mesh if successful, otherwise 0.
1054 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1054 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1055 virtual IAnimatedMesh* addSphereMesh(const io::path& name, 1055 virtual IAnimatedMesh* addSphereMesh(const io::path& name,
1056 f32 radius=5.f, u32 polyCountX = 16, 1056 f32 radius=5.f, u32 polyCountX = 16,
1057 u32 polyCountY = 16) = 0; 1057 u32 polyCountY = 16) = 0;
1058 1058
1059 //! Add a volume light mesh to the meshpool 1059 //! Add a volume light mesh to the meshpool
1060 /** \param name Name of the mesh 1060 /** \param name Name of the mesh
1061 \param SubdivideU Horizontal subdivision count 1061 \param SubdivideU Horizontal subdivision count
1062 \param SubdivideV Vertical subdivision count 1062 \param SubdivideV Vertical subdivision count
1063 \param FootColor Color of the bottom of the light 1063 \param FootColor Color of the bottom of the light
1064 \param TailColor Color of the top of the light 1064 \param TailColor Color of the top of the light
1065 \return Pointer to the volume light mesh if successful, otherwise 0. 1065 \return Pointer to the volume light mesh if successful, otherwise 0.
1066 This pointer should not be dropped. See IReferenceCounted::drop() for more information. 1066 This pointer should not be dropped. See IReferenceCounted::drop() for more information.
1067 */ 1067 */
1068 virtual IAnimatedMesh* addVolumeLightMesh(const io::path& name, 1068 virtual IAnimatedMesh* addVolumeLightMesh(const io::path& name,
1069 const u32 SubdivideU = 32, const u32 SubdivideV = 32, 1069 const u32 SubdivideU = 32, const u32 SubdivideV = 32,
1070 const video::SColor FootColor = video::SColor(51, 0, 230, 180), 1070 const video::SColor FootColor = video::SColor(51, 0, 230, 180),
1071 const video::SColor TailColor = video::SColor(0, 0, 0, 0)) = 0; 1071 const video::SColor TailColor = video::SColor(0, 0, 0, 0)) = 0;
1072 1072
1073 //! Gets the root scene node. 1073 //! Gets the root scene node.
1074 /** This is the scene node which is parent 1074 /** This is the scene node which is parent
1075 of all scene nodes. The root scene node is a special scene node which 1075 of all scene nodes. The root scene node is a special scene node which
1076 only exists to manage all scene nodes. It will not be rendered and cannot 1076 only exists to manage all scene nodes. It will not be rendered and cannot
1077 be removed from the scene. 1077 be removed from the scene.
1078 \return Pointer to the root scene node. 1078 \return Pointer to the root scene node.
1079 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1079 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1080 virtual ISceneNode* getRootSceneNode() = 0; 1080 virtual ISceneNode* getRootSceneNode() = 0;
1081 1081
1082 //! Get the first scene node with the specified id. 1082 //! Get the first scene node with the specified id.
1083 /** \param id: The id to search for 1083 /** \param id: The id to search for
1084 \param start: Scene node to start from. All children of this scene 1084 \param start: Scene node to start from. All children of this scene
1085 node are searched. If null is specified, the root scene node is 1085 node are searched. If null is specified, the root scene node is
1086 taken. 1086 taken.
1087 \return Pointer to the first scene node with this id, 1087 \return Pointer to the first scene node with this id,
1088 and null if no scene node could be found. 1088 and null if no scene node could be found.
1089 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1089 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1090 virtual ISceneNode* getSceneNodeFromId(s32 id, ISceneNode* start=0) = 0; 1090 virtual ISceneNode* getSceneNodeFromId(s32 id, ISceneNode* start=0) = 0;
1091 1091
1092 //! Get the first scene node with the specified name. 1092 //! Get the first scene node with the specified name.
1093 /** \param name: The name to search for 1093 /** \param name: The name to search for
1094 \param start: Scene node to start from. All children of this scene 1094 \param start: Scene node to start from. All children of this scene
1095 node are searched. If null is specified, the root scene node is 1095 node are searched. If null is specified, the root scene node is
1096 taken. 1096 taken.
1097 \return Pointer to the first scene node with this id, 1097 \return Pointer to the first scene node with this id,
1098 and null if no scene node could be found. 1098 and null if no scene node could be found.
1099 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1099 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1100 virtual ISceneNode* getSceneNodeFromName(const c8* name, ISceneNode* start=0) = 0; 1100 virtual ISceneNode* getSceneNodeFromName(const c8* name, ISceneNode* start=0) = 0;
1101 1101
1102 //! Get the first scene node with the specified type. 1102 //! Get the first scene node with the specified type.
1103 /** \param type: The type to search for 1103 /** \param type: The type to search for
1104 \param start: Scene node to start from. All children of this scene 1104 \param start: Scene node to start from. All children of this scene
1105 node are searched. If null is specified, the root scene node is 1105 node are searched. If null is specified, the root scene node is
1106 taken. 1106 taken.
1107 \return Pointer to the first scene node with this type, 1107 \return Pointer to the first scene node with this type,
1108 and null if no scene node could be found. 1108 and null if no scene node could be found.
1109 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1109 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1110 virtual ISceneNode* getSceneNodeFromType(scene::ESCENE_NODE_TYPE type, ISceneNode* start=0) = 0; 1110 virtual ISceneNode* getSceneNodeFromType(scene::ESCENE_NODE_TYPE type, ISceneNode* start=0) = 0;
1111 1111
1112 //! Get scene nodes by type. 1112 //! Get scene nodes by type.
1113 /** \param type: Type of scene node to find (ESNT_ANY will return all child nodes). 1113 /** \param type: Type of scene node to find (ESNT_ANY will return all child nodes).
1114 \param outNodes: array to be filled with results. 1114 \param outNodes: array to be filled with results.
1115 \param start: Scene node to start from. All children of this scene 1115 \param start: Scene node to start from. All children of this scene
1116 node are searched. If null is specified, the root scene node is 1116 node are searched. If null is specified, the root scene node is
1117 taken. */ 1117 taken. */
1118 virtual void getSceneNodesFromType(ESCENE_NODE_TYPE type, 1118 virtual void getSceneNodesFromType(ESCENE_NODE_TYPE type,
1119 core::array<scene::ISceneNode*>& outNodes, 1119 core::array<scene::ISceneNode*>& outNodes,
1120 ISceneNode* start=0) = 0; 1120 ISceneNode* start=0) = 0;
1121 1121
1122 //! Get the current active camera. 1122 //! Get the current active camera.
1123 /** \return The active camera is returned. Note that this can 1123 /** \return The active camera is returned. Note that this can
1124 be NULL, if there was no camera created yet. 1124 be NULL, if there was no camera created yet.
1125 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1125 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1126 virtual ICameraSceneNode* getActiveCamera() const =0; 1126 virtual ICameraSceneNode* getActiveCamera() const =0;
1127 1127
1128 //! Sets the currently active camera. 1128 //! Sets the currently active camera.
1129 /** The previous active camera will be deactivated. 1129 /** The previous active camera will be deactivated.
1130 \param camera: The new camera which should be active. */ 1130 \param camera: The new camera which should be active. */
1131 virtual void setActiveCamera(ICameraSceneNode* camera) = 0; 1131 virtual void setActiveCamera(ICameraSceneNode* camera) = 0;
1132 1132
1133 //! Sets the color of stencil buffers shadows drawn by the scene manager. 1133 //! Sets the color of stencil buffers shadows drawn by the scene manager.
1134 virtual void setShadowColor(video::SColor color = video::SColor(150,0,0,0)) = 0; 1134 virtual void setShadowColor(video::SColor color = video::SColor(150,0,0,0)) = 0;
1135 1135
1136 //! Get the current color of shadows. 1136 //! Get the current color of shadows.
1137 virtual video::SColor getShadowColor() const = 0; 1137 virtual video::SColor getShadowColor() const = 0;
1138 1138
1139 //! Registers a node for rendering it at a specific time. 1139 //! Registers a node for rendering it at a specific time.
1140 /** This method should only be used by SceneNodes when they get a 1140 /** This method should only be used by SceneNodes when they get a
1141 ISceneNode::OnRegisterSceneNode() call. 1141 ISceneNode::OnRegisterSceneNode() call.
1142 \param node: Node to register for drawing. Usually scene nodes would set 'this' 1142 \param node: Node to register for drawing. Usually scene nodes would set 'this'
1143 as parameter here because they want to be drawn. 1143 as parameter here because they want to be drawn.
1144 \param pass: Specifies when the node wants to be drawn in relation to the other nodes. 1144 \param pass: Specifies when the node wants to be drawn in relation to the other nodes.
1145 For example, if the node is a shadow, it usually wants to be drawn after all other nodes 1145 For example, if the node is a shadow, it usually wants to be drawn after all other nodes
1146 and will use ESNRP_SHADOW for this. See scene::E_SCENE_NODE_RENDER_PASS for details. 1146 and will use ESNRP_SHADOW for this. See scene::E_SCENE_NODE_RENDER_PASS for details.
1147 \return scene will be rendered ( passed culling ) */ 1147 \return scene will be rendered ( passed culling ) */
1148 virtual u32 registerNodeForRendering(ISceneNode* node, 1148 virtual u32 registerNodeForRendering(ISceneNode* node,
1149 E_SCENE_NODE_RENDER_PASS pass = ESNRP_AUTOMATIC) = 0; 1149 E_SCENE_NODE_RENDER_PASS pass = ESNRP_AUTOMATIC) = 0;
1150 1150
1151 //! Draws all the scene nodes. 1151 //! Draws all the scene nodes.
1152 /** This can only be invoked between 1152 /** This can only be invoked between
1153 IVideoDriver::beginScene() and IVideoDriver::endScene(). Please note that 1153 IVideoDriver::beginScene() and IVideoDriver::endScene(). Please note that
1154 the scene is not only drawn when calling this, but also animated 1154 the scene is not only drawn when calling this, but also animated
1155 by existing scene node animators, culling of scene nodes is done, etc. */ 1155 by existing scene node animators, culling of scene nodes is done, etc. */
1156 virtual void drawAll() = 0; 1156 virtual void drawAll() = 0;
1157 1157
1158 //! Creates a rotation animator, which rotates the attached scene node around itself. 1158 //! Creates a rotation animator, which rotates the attached scene node around itself.
1159 /** \param rotationSpeed Specifies the speed of the animation in degree per 10 milliseconds. 1159 /** \param rotationSpeed Specifies the speed of the animation in degree per 10 milliseconds.
1160 \return The animator. Attach it to a scene node with ISceneNode::addAnimator() 1160 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1161 and the animator will animate it. 1161 and the animator will animate it.
1162 If you no longer need the animator, you should call ISceneNodeAnimator::drop(). 1162 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1163 See IReferenceCounted::drop() for more information. */ 1163 See IReferenceCounted::drop() for more information. */
1164 virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationSpeed) = 0; 1164 virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationSpeed) = 0;
1165 1165
1166 //! Creates a fly circle animator, which lets the attached scene node fly around a center. 1166 //! Creates a fly circle animator, which lets the attached scene node fly around a center.
1167 /** \param center: Center of the circle. 1167 /** \param center: Center of the circle.
1168 \param radius: Radius of the circle. 1168 \param radius: Radius of the circle.
1169 \param speed: The orbital speed, in radians per millisecond. 1169 \param speed: The orbital speed, in radians per millisecond.
1170 \param direction: Specifies the upvector used for alignment of the mesh. 1170 \param direction: Specifies the upvector used for alignment of the mesh.
1171 \param startPosition: The position on the circle where the animator will 1171 \param startPosition: The position on the circle where the animator will
1172 begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase) 1172 begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase)
1173 \param radiusEllipsoid: if radiusEllipsoid != 0 then radius2 froms a ellipsoid 1173 \param radiusEllipsoid: if radiusEllipsoid != 0 then radius2 froms a ellipsoid
1174 begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase) 1174 begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase)
1175 \return The animator. Attach it to a scene node with ISceneNode::addAnimator() 1175 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1176 and the animator will animate it. 1176 and the animator will animate it.
1177 If you no longer need the animator, you should call ISceneNodeAnimator::drop(). 1177 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1178 See IReferenceCounted::drop() for more information. */ 1178 See IReferenceCounted::drop() for more information. */
1179 virtual ISceneNodeAnimator* createFlyCircleAnimator( 1179 virtual ISceneNodeAnimator* createFlyCircleAnimator(
1180 const core::vector3df& center=core::vector3df(0.f,0.f,0.f), 1180 const core::vector3df& center=core::vector3df(0.f,0.f,0.f),
1181 f32 radius=100.f, f32 speed=0.001f, 1181 f32 radius=100.f, f32 speed=0.001f,
1182 const core::vector3df& direction=core::vector3df(0.f, 1.f, 0.f), 1182 const core::vector3df& direction=core::vector3df(0.f, 1.f, 0.f),
1183 f32 startPosition = 0.f, 1183 f32 startPosition = 0.f,
1184 f32 radiusEllipsoid = 0.f) = 0; 1184 f32 radiusEllipsoid = 0.f) = 0;
1185 1185
1186 //! Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points. 1186 //! Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points.
1187 /** \param startPoint: Start point of the line. 1187 /** \param startPoint: Start point of the line.
1188 \param endPoint: End point of the line. 1188 \param endPoint: End point of the line.
1189 \param timeForWay: Time in milli seconds how long the node should need to 1189 \param timeForWay: Time in milli seconds how long the node should need to
1190 move from the start point to the end point. 1190 move from the start point to the end point.
1191 \param loop: If set to false, the node stops when the end point is reached. 1191 \param loop: If set to false, the node stops when the end point is reached.
1192 If loop is true, the node begins again at the start. 1192 If loop is true, the node begins again at the start.
1193 \param pingpong Flag to set whether the animator should fly 1193 \param pingpong Flag to set whether the animator should fly
1194 back from end to start again. 1194 back from end to start again.
1195 \return The animator. Attach it to a scene node with ISceneNode::addAnimator() 1195 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1196 and the animator will animate it. 1196 and the animator will animate it.
1197 If you no longer need the animator, you should call ISceneNodeAnimator::drop(). 1197 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1198 See IReferenceCounted::drop() for more information. */ 1198 See IReferenceCounted::drop() for more information. */
1199 virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint, 1199 virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint,
1200 const core::vector3df& endPoint, u32 timeForWay, bool loop=false, bool pingpong = false) = 0; 1200 const core::vector3df& endPoint, u32 timeForWay, bool loop=false, bool pingpong = false) = 0;
1201 1201
1202 //! Creates a texture animator, which switches the textures of the target scene node based on a list of textures. 1202 //! Creates a texture animator, which switches the textures of the target scene node based on a list of textures.
1203 /** \param textures: List of textures to use. 1203 /** \param textures: List of textures to use.
1204 \param timePerFrame: Time in milliseconds, how long any texture in the list 1204 \param timePerFrame: Time in milliseconds, how long any texture in the list
1205 should be visible. 1205 should be visible.
1206 \param loop: If set to to false, the last texture remains set, and the animation 1206 \param loop: If set to to false, the last texture remains set, and the animation
1207 stops. If set to true, the animation restarts with the first texture. 1207 stops. If set to true, the animation restarts with the first texture.
1208 \return The animator. Attach it to a scene node with ISceneNode::addAnimator() 1208 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1209 and the animator will animate it. 1209 and the animator will animate it.
1210 If you no longer need the animator, you should call ISceneNodeAnimator::drop(). 1210 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1211 See IReferenceCounted::drop() for more information. */ 1211 See IReferenceCounted::drop() for more information. */
1212 virtual ISceneNodeAnimator* createTextureAnimator(const core::array<video::ITexture*>& textures, 1212 virtual ISceneNodeAnimator* createTextureAnimator(const core::array<video::ITexture*>& textures,
1213 s32 timePerFrame, bool loop=true) = 0; 1213 s32 timePerFrame, bool loop=true) = 0;
1214 1214
1215 //! Creates a scene node animator, which deletes the scene node after some time automatically. 1215 //! Creates a scene node animator, which deletes the scene node after some time automatically.
1216 /** \param timeMs: Time in milliseconds, after when the node will be deleted. 1216 /** \param timeMs: Time in milliseconds, after when the node will be deleted.
1217 \return The animator. Attach it to a scene node with ISceneNode::addAnimator() 1217 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1218 and the animator will animate it. 1218 and the animator will animate it.
1219 If you no longer need the animator, you should call ISceneNodeAnimator::drop(). 1219 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1220 See IReferenceCounted::drop() for more information. */ 1220 See IReferenceCounted::drop() for more information. */
1221 virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMs) = 0; 1221 virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMs) = 0;
1222 1222
1223 //! Creates a special scene node animator for doing automatic collision detection and response. 1223 //! Creates a special scene node animator for doing automatic collision detection and response.
1224 /** See ISceneNodeAnimatorCollisionResponse for details. 1224 /** See ISceneNodeAnimatorCollisionResponse for details.
1225 \param world: Triangle selector holding all triangles of the world with which 1225 \param world: Triangle selector holding all triangles of the world with which
1226 the scene node may collide. You can create a triangle selector with 1226 the scene node may collide. You can create a triangle selector with
1227 ISceneManager::createTriangleSelector(); 1227 ISceneManager::createTriangleSelector();
1228 \param sceneNode: SceneNode which should be manipulated. After you added this animator 1228 \param sceneNode: SceneNode which should be manipulated. After you added this animator
1229 to the scene node, the scene node will not be able to move through walls and is 1229 to the scene node, the scene node will not be able to move through walls and is
1230 affected by gravity. If you need to teleport the scene node to a new position without 1230 affected by gravity. If you need to teleport the scene node to a new position without
1231 it being effected by the collision geometry, then call sceneNode->setPosition(); then 1231 it being effected by the collision geometry, then call sceneNode->setPosition(); then
1232 animator->setTargetNode(sceneNode); 1232 animator->setTargetNode(sceneNode);
1233 \param ellipsoidRadius: Radius of the ellipsoid with which collision detection and 1233 \param ellipsoidRadius: Radius of the ellipsoid with which collision detection and
1234 response is done. If you have got a scene node, and you are unsure about 1234 response is done. If you have got a scene node, and you are unsure about
1235 how big the radius should be, you could use the following code to determine 1235 how big the radius should be, you could use the following code to determine
1236 it: 1236 it:
1237 \code 1237 \code
1238 const core::aabbox3d<f32>& box = yourSceneNode->getBoundingBox(); 1238 const core::aabbox3d<f32>& box = yourSceneNode->getBoundingBox();
1239 core::vector3df radius = box.MaxEdge - box.getCenter(); 1239 core::vector3df radius = box.MaxEdge - box.getCenter();
1240 \endcode 1240 \endcode
1241 \param gravityPerSecond: Sets the gravity of the environment, as an acceleration in 1241 \param gravityPerSecond: Sets the gravity of the environment, as an acceleration in
1242 units per second per second. If your units are equivalent to metres, then 1242 units per second per second. If your units are equivalent to metres, then
1243 core::vector3df(0,-10.0f,0) would give an approximately realistic gravity. 1243 core::vector3df(0,-10.0f,0) would give an approximately realistic gravity.
1244 You can disable gravity by setting it to core::vector3df(0,0,0). 1244 You can disable gravity by setting it to core::vector3df(0,0,0).
1245 \param ellipsoidTranslation: By default, the ellipsoid for collision detection is created around 1245 \param ellipsoidTranslation: By default, the ellipsoid for collision detection is created around
1246 the center of the scene node, which means that the ellipsoid surrounds 1246 the center of the scene node, which means that the ellipsoid surrounds
1247 it completely. If this is not what you want, you may specify a translation 1247 it completely. If this is not what you want, you may specify a translation
1248 for the ellipsoid. 1248 for the ellipsoid.
1249 \param slidingValue: DOCUMENTATION NEEDED. 1249 \param slidingValue: DOCUMENTATION NEEDED.
1250 \return The animator. Attach it to a scene node with ISceneNode::addAnimator() 1250 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1251 and the animator will cause it to do collision detection and response. 1251 and the animator will cause it to do collision detection and response.
1252 If you no longer need the animator, you should call ISceneNodeAnimator::drop(). 1252 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1253 See IReferenceCounted::drop() for more information. */ 1253 See IReferenceCounted::drop() for more information. */
1254 virtual ISceneNodeAnimatorCollisionResponse* createCollisionResponseAnimator( 1254 virtual ISceneNodeAnimatorCollisionResponse* createCollisionResponseAnimator(
1255 ITriangleSelector* world, ISceneNode* sceneNode, 1255 ITriangleSelector* world, ISceneNode* sceneNode,
1256 const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30), 1256 const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30),
1257 const core::vector3df& gravityPerSecond = core::vector3df(0,-10.0f,0), 1257 const core::vector3df& gravityPerSecond = core::vector3df(0,-10.0f,0),
1258 const core::vector3df& ellipsoidTranslation = core::vector3df(0,0,0), 1258 const core::vector3df& ellipsoidTranslation = core::vector3df(0,0,0),
1259 f32 slidingValue = 0.0005f) = 0; 1259 f32 slidingValue = 0.0005f) = 0;
1260 1260
1261 //! Creates a follow spline animator. 1261 //! Creates a follow spline animator.
1262 /** The animator modifies the position of 1262 /** The animator modifies the position of
1263 the attached scene node to make it follow a hermite spline. 1263 the attached scene node to make it follow a hermite spline.
1264 It uses a subset of hermite splines: either cardinal splines 1264 It uses a subset of hermite splines: either cardinal splines
1265 (tightness != 0.5) or catmull-rom-splines (tightness == 0.5). 1265 (tightness != 0.5) or catmull-rom-splines (tightness == 0.5).
1266 The animator moves from one control point to the next in 1266 The animator moves from one control point to the next in
1267 1/speed seconds. This code was sent in by Matthias Gall. 1267 1/speed seconds. This code was sent in by Matthias Gall.
1268 If you no longer need the animator, you should call ISceneNodeAnimator::drop(). 1268 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1269 See IReferenceCounted::drop() for more information. */ 1269 See IReferenceCounted::drop() for more information. */
1270 virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime, 1270 virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime,
1271 const core::array< core::vector3df >& points, 1271 const core::array< core::vector3df >& points,
1272 f32 speed = 1.0f, f32 tightness = 0.5f, bool loop=true, bool pingpong=false) = 0; 1272 f32 speed = 1.0f, f32 tightness = 0.5f, bool loop=true, bool pingpong=false) = 0;
1273 1273
1274 //! Creates a simple ITriangleSelector, based on a mesh. 1274 //! Creates a simple ITriangleSelector, based on a mesh.
1275 /** Triangle selectors 1275 /** Triangle selectors
1276 can be used for doing collision detection. Don't use this selector 1276 can be used for doing collision detection. Don't use this selector
1277 for a huge amount of triangles like in Quake3 maps. 1277 for a huge amount of triangles like in Quake3 maps.
1278 Instead, use for example ISceneManager::createOctreeTriangleSelector(). 1278 Instead, use for example ISceneManager::createOctreeTriangleSelector().
1279 Please note that the created triangle selector is not automaticly attached 1279 Please note that the created triangle selector is not automaticly attached
1280 to the scene node. You will have to call ISceneNode::setTriangleSelector() 1280 to the scene node. You will have to call ISceneNode::setTriangleSelector()
1281 for this. To create and attach a triangle selector is done like this: 1281 for this. To create and attach a triangle selector is done like this:
1282 \code 1282 \code
1283 ITriangleSelector* s = sceneManager->createTriangleSelector(yourMesh, 1283 ITriangleSelector* s = sceneManager->createTriangleSelector(yourMesh,
1284 yourSceneNode); 1284 yourSceneNode);
1285 yourSceneNode->setTriangleSelector(s); 1285 yourSceneNode->setTriangleSelector(s);
1286 s->drop(); 1286 s->drop();
1287 \endcode 1287 \endcode
1288 \param mesh: Mesh of which the triangles are taken. 1288 \param mesh: Mesh of which the triangles are taken.
1289 \param node: Scene node of which visibility and transformation is used. 1289 \param node: Scene node of which visibility and transformation is used.
1290 \return The selector, or null if not successful. 1290 \return The selector, or null if not successful.
1291 If you no longer need the selector, you should call ITriangleSelector::drop(). 1291 If you no longer need the selector, you should call ITriangleSelector::drop().
1292 See IReferenceCounted::drop() for more information. */ 1292 See IReferenceCounted::drop() for more information. */
1293 virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node) = 0; 1293 virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node) = 0;
1294 1294
1295 //! Creates a simple ITriangleSelector, based on an animated mesh scene node. 1295 //! Creates a simple ITriangleSelector, based on an animated mesh scene node.
1296 /** Details of the mesh associated with the node will be extracted internally. 1296 /** Details of the mesh associated with the node will be extracted internally.
1297 Call ITriangleSelector::update() to have the triangle selector updated based 1297 Call ITriangleSelector::update() to have the triangle selector updated based
1298 on the current frame of the animated mesh scene node. 1298 on the current frame of the animated mesh scene node.
1299 \param node The animated mesh scene node from which to build the selector 1299 \param node The animated mesh scene node from which to build the selector
1300 */ 1300 */
1301 virtual ITriangleSelector* createTriangleSelector(IAnimatedMeshSceneNode* node) = 0; 1301 virtual ITriangleSelector* createTriangleSelector(IAnimatedMeshSceneNode* node) = 0;
1302 1302
1303 1303
1304 //! Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box. 1304 //! Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box.
1305 /** Triangle selectors 1305 /** Triangle selectors
1306 can be used for doing collision detection. Every time when triangles are 1306 can be used for doing collision detection. Every time when triangles are
1307 queried, the triangle selector gets the bounding box of the scene node, 1307 queried, the triangle selector gets the bounding box of the scene node,
1308 an creates new triangles. In this way, it works good with animated scene nodes. 1308 an creates new triangles. In this way, it works good with animated scene nodes.
1309 \param node: Scene node of which the bounding box, visibility and transformation is used. 1309 \param node: Scene node of which the bounding box, visibility and transformation is used.
1310 \return The selector, or null if not successful. 1310 \return The selector, or null if not successful.
1311 If you no longer need the selector, you should call ITriangleSelector::drop(). 1311 If you no longer need the selector, you should call ITriangleSelector::drop().
1312 See IReferenceCounted::drop() for more information. */ 1312 See IReferenceCounted::drop() for more information. */
1313 virtual ITriangleSelector* createTriangleSelectorFromBoundingBox(ISceneNode* node) = 0; 1313 virtual ITriangleSelector* createTriangleSelectorFromBoundingBox(ISceneNode* node) = 0;
1314 1314
1315 //! Creates a Triangle Selector, optimized by an octree. 1315 //! Creates a Triangle Selector, optimized by an octree.
1316 /** Triangle selectors 1316 /** Triangle selectors
1317 can be used for doing collision detection. This triangle selector is 1317 can be used for doing collision detection. This triangle selector is
1318 optimized for huge amounts of triangle, it organizes them in an octree. 1318 optimized for huge amounts of triangle, it organizes them in an octree.
1319 Please note that the created triangle selector is not automaticly attached 1319 Please note that the created triangle selector is not automaticly attached
1320 to the scene node. You will have to call ISceneNode::setTriangleSelector() 1320 to the scene node. You will have to call ISceneNode::setTriangleSelector()
1321 for this. To create and attach a triangle selector is done like this: 1321 for this. To create and attach a triangle selector is done like this:
1322 \code 1322 \code
1323 ITriangleSelector* s = sceneManager->createOctreeTriangleSelector(yourMesh, 1323 ITriangleSelector* s = sceneManager->createOctreeTriangleSelector(yourMesh,
1324 yourSceneNode); 1324 yourSceneNode);
1325 yourSceneNode->setTriangleSelector(s); 1325 yourSceneNode->setTriangleSelector(s);
1326 s->drop(); 1326 s->drop();
1327 \endcode 1327 \endcode
1328 For more informations and examples on this, take a look at the collision 1328 For more informations and examples on this, take a look at the collision
1329 tutorial in the SDK. 1329 tutorial in the SDK.
1330 \param mesh: Mesh of which the triangles are taken. 1330 \param mesh: Mesh of which the triangles are taken.
1331 \param node: Scene node of which visibility and transformation is used. 1331 \param node: Scene node of which visibility and transformation is used.
1332 \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node. 1332 \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
1333 If a node gets less polys the this value, it will not be splitted into 1333 If a node gets less polys the this value, it will not be splitted into
1334 smaller nodes. 1334 smaller nodes.
1335 \return The selector, or null if not successful. 1335 \return The selector, or null if not successful.
1336 If you no longer need the selector, you should call ITriangleSelector::drop(). 1336 If you no longer need the selector, you should call ITriangleSelector::drop().
1337 See IReferenceCounted::drop() for more information. */ 1337 See IReferenceCounted::drop() for more information. */
1338 virtual ITriangleSelector* createOctreeTriangleSelector(IMesh* mesh, 1338 virtual ITriangleSelector* createOctreeTriangleSelector(IMesh* mesh,
1339 ISceneNode* node, s32 minimalPolysPerNode=32) = 0; 1339 ISceneNode* node, s32 minimalPolysPerNode=32) = 0;
1340 1340
1341 //! //! Creates a Triangle Selector, optimized by an octree. 1341 //! //! Creates a Triangle Selector, optimized by an octree.
1342 /** \deprecated Use createOctreeTriangleSelector instead. This method may be removed by Irrlicht 1.9. */ 1342 /** \deprecated Use createOctreeTriangleSelector instead. This method may be removed by Irrlicht 1.9. */
1343 _IRR_DEPRECATED_ ITriangleSelector* createOctTreeTriangleSelector(IMesh* mesh, 1343 _IRR_DEPRECATED_ ITriangleSelector* createOctTreeTriangleSelector(IMesh* mesh,
1344 ISceneNode* node, s32 minimalPolysPerNode=32) 1344 ISceneNode* node, s32 minimalPolysPerNode=32)
1345 { 1345 {
1346 return createOctreeTriangleSelector(mesh, node, minimalPolysPerNode); 1346 return createOctreeTriangleSelector(mesh, node, minimalPolysPerNode);
1347 } 1347 }
1348 1348
1349 //! Creates a meta triangle selector. 1349 //! Creates a meta triangle selector.
1350 /** A meta triangle selector is nothing more than a 1350 /** A meta triangle selector is nothing more than a
1351 collection of one or more triangle selectors providing together 1351 collection of one or more triangle selectors providing together
1352 the interface of one triangle selector. In this way, 1352 the interface of one triangle selector. In this way,
1353 collision tests can be done with different triangle soups in one pass. 1353 collision tests can be done with different triangle soups in one pass.
1354 \return The selector, or null if not successful. 1354 \return The selector, or null if not successful.
1355 If you no longer need the selector, you should call ITriangleSelector::drop(). 1355 If you no longer need the selector, you should call ITriangleSelector::drop().
1356 See IReferenceCounted::drop() for more information. */ 1356 See IReferenceCounted::drop() for more information. */
1357 virtual IMetaTriangleSelector* createMetaTriangleSelector() = 0; 1357 virtual IMetaTriangleSelector* createMetaTriangleSelector() = 0;
1358 1358
1359 //! Creates a triangle selector which can select triangles from a terrain scene node. 1359 //! Creates a triangle selector which can select triangles from a terrain scene node.
1360 /** \param node: Pointer to the created terrain scene node 1360 /** \param node: Pointer to the created terrain scene node
1361 \param LOD: Level of detail, 0 for highest detail. 1361 \param LOD: Level of detail, 0 for highest detail.
1362 \return The selector, or null if not successful. 1362 \return The selector, or null if not successful.
1363 If you no longer need the selector, you should call ITriangleSelector::drop(). 1363 If you no longer need the selector, you should call ITriangleSelector::drop().
1364 See IReferenceCounted::drop() for more information. */ 1364 See IReferenceCounted::drop() for more information. */
1365 virtual ITriangleSelector* createTerrainTriangleSelector( 1365 virtual ITriangleSelector* createTerrainTriangleSelector(
1366 ITerrainSceneNode* node, s32 LOD=0) = 0; 1366 ITerrainSceneNode* node, s32 LOD=0) = 0;
1367 1367
1368 //! Adds an external mesh loader for extending the engine with new file formats. 1368 //! Adds an external mesh loader for extending the engine with new file formats.
1369 /** If you want the engine to be extended with 1369 /** If you want the engine to be extended with
1370 file formats it currently is not able to load (e.g. .cob), just implement 1370 file formats it currently is not able to load (e.g. .cob), just implement
1371 the IMeshLoader interface in your loading class and add it with this method. 1371 the IMeshLoader interface in your loading class and add it with this method.
1372 Using this method it is also possible to override built-in mesh loaders with 1372 Using this method it is also possible to override built-in mesh loaders with
1373 newer or updated versions without the need to recompile the engine. 1373 newer or updated versions without the need to recompile the engine.
1374 \param externalLoader: Implementation of a new mesh loader. */ 1374 \param externalLoader: Implementation of a new mesh loader. */
1375 virtual void addExternalMeshLoader(IMeshLoader* externalLoader) = 0; 1375 virtual void addExternalMeshLoader(IMeshLoader* externalLoader) = 0;
1376 1376
1377 //! Returns the number of mesh loaders supported by Irrlicht at this time 1377 //! Returns the number of mesh loaders supported by Irrlicht at this time
1378 virtual u32 getMeshLoaderCount() const = 0; 1378 virtual u32 getMeshLoaderCount() const = 0;
1379 1379
1380 //! Retrieve the given mesh loader 1380 //! Retrieve the given mesh loader
1381 /** \param index The index of the loader to retrieve. This parameter is an 0-based 1381 /** \param index The index of the loader to retrieve. This parameter is an 0-based
1382 array index. 1382 array index.
1383 \return A pointer to the specified loader, 0 if the index is incorrect. */ 1383 \return A pointer to the specified loader, 0 if the index is incorrect. */
1384 virtual IMeshLoader* getMeshLoader(u32 index) const = 0; 1384 virtual IMeshLoader* getMeshLoader(u32 index) const = 0;
1385 1385
1386 //! Adds an external scene loader for extending the engine with new file formats. 1386 //! Adds an external scene loader for extending the engine with new file formats.
1387 /** If you want the engine to be extended with 1387 /** If you want the engine to be extended with
1388 file formats it currently is not able to load (e.g. .vrml), just implement 1388 file formats it currently is not able to load (e.g. .vrml), just implement
1389 the ISceneLoader interface in your loading class and add it with this method. 1389 the ISceneLoader interface in your loading class and add it with this method.
1390 Using this method it is also possible to override the built-in scene loaders 1390 Using this method it is also possible to override the built-in scene loaders
1391 with newer or updated versions without the need to recompile the engine. 1391 with newer or updated versions without the need to recompile the engine.
1392 \param externalLoader: Implementation of a new mesh loader. */ 1392 \param externalLoader: Implementation of a new mesh loader. */
1393 virtual void addExternalSceneLoader(ISceneLoader* externalLoader) = 0; 1393 virtual void addExternalSceneLoader(ISceneLoader* externalLoader) = 0;
1394 1394
1395 //! Returns the number of scene loaders supported by Irrlicht at this time 1395 //! Returns the number of scene loaders supported by Irrlicht at this time
1396 virtual u32 getSceneLoaderCount() const = 0; 1396 virtual u32 getSceneLoaderCount() const = 0;
1397 1397
1398 //! Retrieve the given scene loader 1398 //! Retrieve the given scene loader
1399 /** \param index The index of the loader to retrieve. This parameter is an 0-based 1399 /** \param index The index of the loader to retrieve. This parameter is an 0-based
1400 array index. 1400 array index.
1401 \return A pointer to the specified loader, 0 if the index is incorrect. */ 1401 \return A pointer to the specified loader, 0 if the index is incorrect. */
1402 virtual ISceneLoader* getSceneLoader(u32 index) const = 0; 1402 virtual ISceneLoader* getSceneLoader(u32 index) const = 0;
1403 1403
1404 //! Get pointer to the scene collision manager. 1404 //! Get pointer to the scene collision manager.
1405 /** \return Pointer to the collision manager 1405 /** \return Pointer to the collision manager
1406 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1406 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1407 virtual ISceneCollisionManager* getSceneCollisionManager() = 0; 1407 virtual ISceneCollisionManager* getSceneCollisionManager() = 0;
1408 1408
1409 //! Get pointer to the mesh manipulator. 1409 //! Get pointer to the mesh manipulator.
1410 /** \return Pointer to the mesh manipulator 1410 /** \return Pointer to the mesh manipulator
1411 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1411 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1412 virtual IMeshManipulator* getMeshManipulator() = 0; 1412 virtual IMeshManipulator* getMeshManipulator() = 0;
1413 1413
1414 //! Adds a scene node to the deletion queue. 1414 //! Adds a scene node to the deletion queue.
1415 /** The scene node is immediatly 1415 /** The scene node is immediatly
1416 deleted when it's secure. Which means when the scene node does not 1416 deleted when it's secure. Which means when the scene node does not
1417 execute animators and things like that. This method is for example 1417 execute animators and things like that. This method is for example
1418 used for deleting scene nodes by their scene node animators. In 1418 used for deleting scene nodes by their scene node animators. In
1419 most other cases, a ISceneNode::remove() call is enough, using this 1419 most other cases, a ISceneNode::remove() call is enough, using this
1420 deletion queue is not necessary. 1420 deletion queue is not necessary.
1421 See ISceneManager::createDeleteAnimator() for details. 1421 See ISceneManager::createDeleteAnimator() for details.
1422 \param node: Node to detete. */ 1422 \param node: Node to detete. */
1423 virtual void addToDeletionQueue(ISceneNode* node) = 0; 1423 virtual void addToDeletionQueue(ISceneNode* node) = 0;
1424 1424
1425 //! Posts an input event to the environment. 1425 //! Posts an input event to the environment.
1426 /** Usually you do not have to 1426 /** Usually you do not have to
1427 use this method, it is used by the internal engine. */ 1427 use this method, it is used by the internal engine. */
1428 virtual bool postEventFromUser(const SEvent& event) = 0; 1428 virtual bool postEventFromUser(const SEvent& event) = 0;
1429 1429
1430 //! Clears the whole scene. 1430 //! Clears the whole scene.
1431 /** All scene nodes are removed. */ 1431 /** All scene nodes are removed. */
1432 virtual void clear() = 0; 1432 virtual void clear() = 0;
1433 1433
1434 //! Get interface to the parameters set in this scene. 1434 //! Get interface to the parameters set in this scene.
1435 /** String parameters can be used by plugins and mesh loaders. 1435 /** String parameters can be used by plugins and mesh loaders.
1436 For example the CMS and LMTS loader want a parameter named 'CSM_TexturePath' 1436 For example the CMS and LMTS loader want a parameter named 'CSM_TexturePath'
1437 and 'LMTS_TexturePath' set to the path were attached textures can be found. See 1437 and 'LMTS_TexturePath' set to the path were attached textures can be found. See
1438 CSM_TEXTURE_PATH, LMTS_TEXTURE_PATH, MY3D_TEXTURE_PATH, 1438 CSM_TEXTURE_PATH, LMTS_TEXTURE_PATH, MY3D_TEXTURE_PATH,
1439 COLLADA_CREATE_SCENE_INSTANCES, DMF_TEXTURE_PATH and DMF_USE_MATERIALS_DIRS*/ 1439 COLLADA_CREATE_SCENE_INSTANCES, DMF_TEXTURE_PATH and DMF_USE_MATERIALS_DIRS*/
1440 virtual io::IAttributes* getParameters() = 0; 1440 virtual io::IAttributes* getParameters() = 0;
1441 1441
1442 //! Get current render pass. 1442 //! Get current render pass.
1443 /** All scene nodes are being rendered in a specific order. 1443 /** All scene nodes are being rendered in a specific order.
1444 First lights, cameras, sky boxes, solid geometry, and then transparent 1444 First lights, cameras, sky boxes, solid geometry, and then transparent
1445 stuff. During the rendering process, scene nodes may want to know what the scene 1445 stuff. During the rendering process, scene nodes may want to know what the scene
1446 manager is rendering currently, because for example they registered for rendering 1446 manager is rendering currently, because for example they registered for rendering
1447 twice, once for transparent geometry and once for solid. When knowing what rendering 1447 twice, once for transparent geometry and once for solid. When knowing what rendering
1448 pass currently is active they can render the correct part of their geometry. */ 1448 pass currently is active they can render the correct part of their geometry. */
1449 virtual E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass() const = 0; 1449 virtual E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass() const = 0;
1450 1450
1451 //! Get the default scene node factory which can create all built in scene nodes 1451 //! Get the default scene node factory which can create all built in scene nodes
1452 /** \return Pointer to the default scene node factory 1452 /** \return Pointer to the default scene node factory
1453 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1453 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1454 virtual ISceneNodeFactory* getDefaultSceneNodeFactory() = 0; 1454 virtual ISceneNodeFactory* getDefaultSceneNodeFactory() = 0;
1455 1455
1456 //! Adds a scene node factory to the scene manager. 1456 //! Adds a scene node factory to the scene manager.
1457 /** Use this to extend the scene manager with new scene node types which it should be 1457 /** Use this to extend the scene manager with new scene node types which it should be
1458 able to create automaticly, for example when loading data from xml files. */ 1458 able to create automaticly, for example when loading data from xml files. */
1459 virtual void registerSceneNodeFactory(ISceneNodeFactory* factoryToAdd) = 0; 1459 virtual void registerSceneNodeFactory(ISceneNodeFactory* factoryToAdd) = 0;
1460 1460
1461 //! Get amount of registered scene node factories. 1461 //! Get amount of registered scene node factories.
1462 virtual u32 getRegisteredSceneNodeFactoryCount() const = 0; 1462 virtual u32 getRegisteredSceneNodeFactoryCount() const = 0;
1463 1463
1464 //! Get a scene node factory by index 1464 //! Get a scene node factory by index
1465 /** \return Pointer to the requested scene node factory, or 0 if it does not exist. 1465 /** \return Pointer to the requested scene node factory, or 0 if it does not exist.
1466 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1466 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1467 virtual ISceneNodeFactory* getSceneNodeFactory(u32 index) = 0; 1467 virtual ISceneNodeFactory* getSceneNodeFactory(u32 index) = 0;
1468 1468
1469 //! Get the default scene node animator factory which can create all built-in scene node animators 1469 //! Get the default scene node animator factory which can create all built-in scene node animators
1470 /** \return Pointer to the default scene node animator factory 1470 /** \return Pointer to the default scene node animator factory
1471 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1471 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1472 virtual ISceneNodeAnimatorFactory* getDefaultSceneNodeAnimatorFactory() = 0; 1472 virtual ISceneNodeAnimatorFactory* getDefaultSceneNodeAnimatorFactory() = 0;
1473 1473
1474 //! Adds a scene node animator factory to the scene manager. 1474 //! Adds a scene node animator factory to the scene manager.
1475 /** Use this to extend the scene manager with new scene node animator types which it should be 1475 /** Use this to extend the scene manager with new scene node animator types which it should be
1476 able to create automaticly, for example when loading data from xml files. */ 1476 able to create automaticly, for example when loading data from xml files. */
1477 virtual void registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd) = 0; 1477 virtual void registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd) = 0;
1478 1478
1479 //! Get amount of registered scene node animator factories. 1479 //! Get amount of registered scene node animator factories.
1480 virtual u32 getRegisteredSceneNodeAnimatorFactoryCount() const = 0; 1480 virtual u32 getRegisteredSceneNodeAnimatorFactoryCount() const = 0;
1481 1481
1482 //! Get scene node animator factory by index 1482 //! Get scene node animator factory by index
1483 /** \return Pointer to the requested scene node animator factory, or 0 if it does not exist. 1483 /** \return Pointer to the requested scene node animator factory, or 0 if it does not exist.
1484 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1484 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1485 virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(u32 index) = 0; 1485 virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(u32 index) = 0;
1486 1486
1487 //! Get typename from a scene node type or null if not found 1487 //! Get typename from a scene node type or null if not found
1488 virtual const c8* getSceneNodeTypeName(ESCENE_NODE_TYPE type) = 0; 1488 virtual const c8* getSceneNodeTypeName(ESCENE_NODE_TYPE type) = 0;
1489 1489
1490 //! Returns a typename from a scene node animator type or null if not found 1490 //! Returns a typename from a scene node animator type or null if not found
1491 virtual const c8* getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) = 0; 1491 virtual const c8* getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) = 0;
1492 1492
1493 //! Adds a scene node to the scene by name 1493 //! Adds a scene node to the scene by name
1494 /** \return Pointer to the scene node added by a factory 1494 /** \return Pointer to the scene node added by a factory
1495 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 1495 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1496 virtual ISceneNode* addSceneNode(const char* sceneNodeTypeName, ISceneNode* parent=0) = 0; 1496 virtual ISceneNode* addSceneNode(const char* sceneNodeTypeName, ISceneNode* parent=0) = 0;
1497 1497
1498 //! creates a scene node animator based on its type name 1498 //! creates a scene node animator based on its type name
1499 /** \param typeName: Type of the scene node animator to add. 1499 /** \param typeName: Type of the scene node animator to add.
1500 \param target: Target scene node of the new animator. 1500 \param target: Target scene node of the new animator.
1501 \return Returns pointer to the new scene node animator or null if not successful. You need to 1501 \return Returns pointer to the new scene node animator or null if not successful. You need to
1502 drop this pointer after calling this, see IReferenceCounted::drop() for details. */ 1502 drop this pointer after calling this, see IReferenceCounted::drop() for details. */
1503 virtual ISceneNodeAnimator* createSceneNodeAnimator(const char* typeName, ISceneNode* target=0) = 0; 1503 virtual ISceneNodeAnimator* createSceneNodeAnimator(const char* typeName, ISceneNode* target=0) = 0;
1504 1504
1505 //! Creates a new scene manager. 1505 //! Creates a new scene manager.
1506 /** This can be used to easily draw and/or store two 1506 /** This can be used to easily draw and/or store two
1507 independent scenes at the same time. The mesh cache will be 1507 independent scenes at the same time. The mesh cache will be
1508 shared between all existing scene managers, which means if you 1508 shared between all existing scene managers, which means if you
1509 load a mesh in the original scene manager using for example 1509 load a mesh in the original scene manager using for example
1510 getMesh(), the mesh will be available in all other scene 1510 getMesh(), the mesh will be available in all other scene
1511 managers too, without loading. 1511 managers too, without loading.
1512 The original/main scene manager will still be there and 1512 The original/main scene manager will still be there and
1513 accessible via IrrlichtDevice::getSceneManager(). If you need 1513 accessible via IrrlichtDevice::getSceneManager(). If you need
1514 input event in this new scene manager, for example for FPS 1514 input event in this new scene manager, for example for FPS
1515 cameras, you'll need to forward input to this manually: Just 1515 cameras, you'll need to forward input to this manually: Just
1516 implement an IEventReceiver and call 1516 implement an IEventReceiver and call
1517 yourNewSceneManager->postEventFromUser(), and return true so 1517 yourNewSceneManager->postEventFromUser(), and return true so
1518 that the original scene manager doesn't get the event. 1518 that the original scene manager doesn't get the event.
1519 Otherwise, all input will go to the main scene manager 1519 Otherwise, all input will go to the main scene manager
1520 automatically. 1520 automatically.
1521 If you no longer need the new scene manager, you should call 1521 If you no longer need the new scene manager, you should call
1522 ISceneManager::drop(). 1522 ISceneManager::drop().
1523 See IReferenceCounted::drop() for more information. */ 1523 See IReferenceCounted::drop() for more information. */
1524 virtual ISceneManager* createNewSceneManager(bool cloneContent=false) = 0; 1524 virtual ISceneManager* createNewSceneManager(bool cloneContent=false) = 0;
1525 1525
1526 //! Saves the current scene into a file. 1526 //! Saves the current scene into a file.
1527 /** Scene nodes with the option isDebugObject set to true are 1527 /** Scene nodes with the option isDebugObject set to true are
1528 not being saved. The scene is usually written to an .irr file, 1528 not being saved. The scene is usually written to an .irr file,
1529 an xml based format. .irr files can Be edited with the Irrlicht 1529 an xml based format. .irr files can Be edited with the Irrlicht
1530 Engine Editor, irrEdit (http://irredit.irrlicht3d.org). To 1530 Engine Editor, irrEdit (http://irredit.irrlicht3d.org). To
1531 load .irr files again, see ISceneManager::loadScene(). 1531 load .irr files again, see ISceneManager::loadScene().
1532 \param filename Name of the file. 1532 \param filename Name of the file.
1533 \param userDataSerializer If you want to save some user data 1533 \param userDataSerializer If you want to save some user data
1534 for every scene node into the file, implement the 1534 for every scene node into the file, implement the
1535 ISceneUserDataSerializer interface and provide it as parameter 1535 ISceneUserDataSerializer interface and provide it as parameter
1536 here. Otherwise, simply specify 0 as this parameter. 1536 here. Otherwise, simply specify 0 as this parameter.
1537 \param node Node which is taken as the top node of the scene. 1537 \param node Node which is taken as the top node of the scene.
1538 This node and all of its descendants are saved into the scene 1538 This node and all of its descendants are saved into the scene
1539 file. Pass 0 or the scene manager to save the full scene (which 1539 file. Pass 0 or the scene manager to save the full scene (which
1540 is also the default). 1540 is also the default).
1541 \return True if successful. */ 1541 \return True if successful. */
1542 virtual bool saveScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0; 1542 virtual bool saveScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0;
1543 1543
1544 //! Saves the current scene into a file. 1544 //! Saves the current scene into a file.
1545 /** Scene nodes with the option isDebugObject set to true are 1545 /** Scene nodes with the option isDebugObject set to true are
1546 not being saved. The scene is usually written to an .irr file, 1546 not being saved. The scene is usually written to an .irr file,
1547 an xml based format. .irr files can Be edited with the Irrlicht 1547 an xml based format. .irr files can Be edited with the Irrlicht
1548 Engine Editor, irrEdit (http://irredit.irrlicht3d.org). To 1548 Engine Editor, irrEdit (http://irredit.irrlicht3d.org). To
1549 load .irr files again, see ISceneManager::loadScene(). 1549 load .irr files again, see ISceneManager::loadScene().
1550 \param file File where the scene is saved into. 1550 \param file File where the scene is saved into.
1551 \param userDataSerializer If you want to save some user data 1551 \param userDataSerializer If you want to save some user data
1552 for every scene node into the file, implement the 1552 for every scene node into the file, implement the
1553 ISceneUserDataSerializer interface and provide it as parameter 1553 ISceneUserDataSerializer interface and provide it as parameter
1554 here. Otherwise, simply specify 0 as this parameter. 1554 here. Otherwise, simply specify 0 as this parameter.
1555 \param node Node which is taken as the top node of the scene. 1555 \param node Node which is taken as the top node of the scene.
1556 This node and all of its descendants are saved into the scene 1556 This node and all of its descendants are saved into the scene
1557 file. Pass 0 or the scene manager to save the full scene (which 1557 file. Pass 0 or the scene manager to save the full scene (which
1558 is also the default). 1558 is also the default).
1559 \return True if successful. */ 1559 \return True if successful. */
1560 virtual bool saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0; 1560 virtual bool saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0;
1561 1561
1562 //! Saves the current scene into a file. 1562 //! Saves the current scene into a file.
1563 /** Scene nodes with the option isDebugObject set to true are 1563 /** Scene nodes with the option isDebugObject set to true are
1564 not being saved. The scene is usually written to an .irr file, 1564 not being saved. The scene is usually written to an .irr file,
1565 an xml based format. .irr files can Be edited with the Irrlicht 1565 an xml based format. .irr files can Be edited with the Irrlicht
1566 Engine Editor, irrEdit (http://irredit.irrlicht3d.org). To 1566 Engine Editor, irrEdit (http://irredit.irrlicht3d.org). To
1567 load .irr files again, see ISceneManager::loadScene(). 1567 load .irr files again, see ISceneManager::loadScene().
1568 \param writer XMLWriter with which the scene is saved. 1568 \param writer XMLWriter with which the scene is saved.
1569 \param currentPath Path which is used for relative file names. 1569 \param currentPath Path which is used for relative file names.
1570 Usually the directory of the file written into. 1570 Usually the directory of the file written into.
1571 \param userDataSerializer If you want to save some user data 1571 \param userDataSerializer If you want to save some user data
1572 for every scene node into the file, implement the 1572 for every scene node into the file, implement the
1573 ISceneUserDataSerializer interface and provide it as parameter 1573 ISceneUserDataSerializer interface and provide it as parameter
1574 here. Otherwise, simply specify 0 as this parameter. 1574 here. Otherwise, simply specify 0 as this parameter.
1575 \param node Node which is taken as the top node of the scene. 1575 \param node Node which is taken as the top node of the scene.
1576 This node and all of its descendants are saved into the scene 1576 This node and all of its descendants are saved into the scene
1577 file. Pass 0 or the scene manager to save the full scene (which 1577 file. Pass 0 or the scene manager to save the full scene (which
1578 is also the default). 1578 is also the default).
1579 \return True if successful. */ 1579 \return True if successful. */
1580 virtual bool saveScene(io::IXMLWriter* writer, const io::path& currentPath, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0; 1580 virtual bool saveScene(io::IXMLWriter* writer, const io::path& currentPath, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0;
1581 1581
1582 //! Loads a scene. Note that the current scene is not cleared before. 1582 //! Loads a scene. Note that the current scene is not cleared before.
1583 /** The scene is usually loaded from an .irr file, an xml based 1583 /** The scene is usually loaded from an .irr file, an xml based
1584 format, but other scene formats can be added to the engine via 1584 format, but other scene formats can be added to the engine via
1585 ISceneManager::addExternalSceneLoader. .irr files can Be edited 1585 ISceneManager::addExternalSceneLoader. .irr files can Be edited
1586 with the Irrlicht Engine Editor, irrEdit 1586 with the Irrlicht Engine Editor, irrEdit
1587 (http://irredit.irrlicht3d.org) or saved directly by the engine 1587 (http://irredit.irrlicht3d.org) or saved directly by the engine
1588 using ISceneManager::saveScene(). 1588 using ISceneManager::saveScene().
1589 \param filename Name of the file to load from. 1589 \param filename Name of the file to load from.
1590 \param userDataSerializer If you want to load user data 1590 \param userDataSerializer If you want to load user data
1591 possibily saved in that file for some scene nodes in the file, 1591 possibily saved in that file for some scene nodes in the file,
1592 implement the ISceneUserDataSerializer interface and provide it 1592 implement the ISceneUserDataSerializer interface and provide it
1593 as parameter here. Otherwise, simply specify 0 as this 1593 as parameter here. Otherwise, simply specify 0 as this
1594 parameter. 1594 parameter.
1595 \param rootNode Node which is taken as the root node of the 1595 \param rootNode Node which is taken as the root node of the
1596 scene. Pass 0 to add the scene directly to the scene manager 1596 scene. Pass 0 to add the scene directly to the scene manager
1597 (which is also the default). 1597 (which is also the default).
1598 \return True if successful. */ 1598 \return True if successful. */
1599 virtual bool loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* rootNode=0) = 0; 1599 virtual bool loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* rootNode=0) = 0;
1600 1600
1601 //! Loads a scene. Note that the current scene is not cleared before. 1601 //! Loads a scene. Note that the current scene is not cleared before.
1602 /** The scene is usually loaded from an .irr file, an xml based 1602 /** The scene is usually loaded from an .irr file, an xml based
1603 format, but other scene formats can be added to the engine via 1603 format, but other scene formats can be added to the engine via
1604 ISceneManager::addExternalSceneLoader. .irr files can Be edited 1604 ISceneManager::addExternalSceneLoader. .irr files can Be edited
1605 with the Irrlicht Engine Editor, irrEdit 1605 with the Irrlicht Engine Editor, irrEdit
1606 (http://irredit.irrlicht3d.org) or saved directly by the engine 1606 (http://irredit.irrlicht3d.org) or saved directly by the engine
1607 using ISceneManager::saveScene(). 1607 using ISceneManager::saveScene().
1608 \param file File where the scene is loaded from. 1608 \param file File where the scene is loaded from.
1609 \param userDataSerializer If you want to load user data 1609 \param userDataSerializer If you want to load user data
1610 possibily saved in that file for some scene nodes in the file, 1610 possibily saved in that file for some scene nodes in the file,
1611 implement the ISceneUserDataSerializer interface and provide it 1611 implement the ISceneUserDataSerializer interface and provide it
1612 as parameter here. Otherwise, simply specify 0 as this 1612 as parameter here. Otherwise, simply specify 0 as this
1613 parameter. 1613 parameter.
1614 \param rootNode Node which is taken as the root node of the 1614 \param rootNode Node which is taken as the root node of the
1615 scene. Pass 0 to add the scene directly to the scene manager 1615 scene. Pass 0 to add the scene directly to the scene manager
1616 (which is also the default). 1616 (which is also the default).
1617 \return True if successful. */ 1617 \return True if successful. */
1618 virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* rootNode=0) = 0; 1618 virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* rootNode=0) = 0;
1619 1619
1620 //! Get a mesh writer implementation if available 1620 //! Get a mesh writer implementation if available
1621 /** Note: You need to drop() the pointer after use again, see IReferenceCounted::drop() 1621 /** Note: You need to drop() the pointer after use again, see IReferenceCounted::drop()
1622 for details. */ 1622 for details. */
1623 virtual IMeshWriter* createMeshWriter(EMESH_WRITER_TYPE type) = 0; 1623 virtual IMeshWriter* createMeshWriter(EMESH_WRITER_TYPE type) = 0;
1624 1624
1625 //! Get a skinned mesh, which is not available as header-only code 1625 //! Get a skinned mesh, which is not available as header-only code
1626 /** Note: You need to drop() the pointer after use again, see IReferenceCounted::drop() 1626 /** Note: You need to drop() the pointer after use again, see IReferenceCounted::drop()
1627 for details. */ 1627 for details. */
1628 virtual ISkinnedMesh* createSkinnedMesh() = 0; 1628 virtual ISkinnedMesh* createSkinnedMesh() = 0;
1629 1629
1630 //! Sets ambient color of the scene 1630 //! Sets ambient color of the scene
1631 virtual void setAmbientLight(const video::SColorf &ambientColor) = 0; 1631 virtual void setAmbientLight(const video::SColorf &ambientColor) = 0;
1632 1632
1633 //! Get ambient color of the scene 1633 //! Get ambient color of the scene
1634 virtual const video::SColorf& getAmbientLight() const = 0; 1634 virtual const video::SColorf& getAmbientLight() const = 0;
1635 1635
1636 //! Register a custom callbacks manager which gets callbacks during scene rendering. 1636 //! Register a custom callbacks manager which gets callbacks during scene rendering.
1637 /** \param[in] lightManager: the new callbacks manager. You may pass 0 to remove the 1637 /** \param[in] lightManager: the new callbacks manager. You may pass 0 to remove the
1638 current callbacks manager and restore the default behavior. */ 1638 current callbacks manager and restore the default behavior. */
1639 virtual void setLightManager(ILightManager* lightManager) = 0; 1639 virtual void setLightManager(ILightManager* lightManager) = 0;
1640 1640
1641 //! Get an instance of a geometry creator. 1641 //! Get an instance of a geometry creator.
1642 /** The geometry creator provides some helper methods to create various types of 1642 /** The geometry creator provides some helper methods to create various types of
1643 basic geometry. This can be useful for custom scene nodes. */ 1643 basic geometry. This can be useful for custom scene nodes. */
1644 virtual const IGeometryCreator* getGeometryCreator(void) const = 0; 1644 virtual const IGeometryCreator* getGeometryCreator(void) const = 0;
1645 1645
1646 //! Check if node is culled in current view frustum 1646 //! Check if node is culled in current view frustum
1647 /** Please note that depending on the used culling method this 1647 /** Please note that depending on the used culling method this
1648 check can be rather coarse, or slow. A positive result is 1648 check can be rather coarse, or slow. A positive result is
1649 correct, though, i.e. if this method returns true the node is 1649 correct, though, i.e. if this method returns true the node is
1650 positively not visible. The node might still be invisible even 1650 positively not visible. The node might still be invisible even
1651 if this method returns false. 1651 if this method returns false.
1652 \param node The scene node which is checked for culling. 1652 \param node The scene node which is checked for culling.
1653 \return True if node is not visible in the current scene, else 1653 \return True if node is not visible in the current scene, else
1654 false. */ 1654 false. */
1655 virtual bool isCulled(const ISceneNode* node) const =0; 1655 virtual bool isCulled(const ISceneNode* node) const =0;
1656 }; 1656 };
1657 1657
1658 1658
1659} // end namespace scene 1659} // end namespace scene
1660} // end namespace irr 1660} // end namespace irr
1661 1661
1662#endif 1662#endif
1663 1663
diff --git a/libraries/irrlicht-1.8/include/ISceneNode.h b/libraries/irrlicht-1.8/include/ISceneNode.h
index ecaad4a..63d74f0 100644
--- a/libraries/irrlicht-1.8/include/ISceneNode.h
+++ b/libraries/irrlicht-1.8/include/ISceneNode.h
@@ -1,858 +1,858 @@
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#ifndef __I_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_SCENE_NODE_H_INCLUDED__
6#define __I_SCENE_NODE_H_INCLUDED__ 6#define __I_SCENE_NODE_H_INCLUDED__
7 7
8#include "IAttributeExchangingObject.h" 8#include "IAttributeExchangingObject.h"
9#include "ESceneNodeTypes.h" 9#include "ESceneNodeTypes.h"
10#include "ECullingTypes.h" 10#include "ECullingTypes.h"
11#include "EDebugSceneTypes.h" 11#include "EDebugSceneTypes.h"
12#include "ISceneNodeAnimator.h" 12#include "ISceneNodeAnimator.h"
13#include "ITriangleSelector.h" 13#include "ITriangleSelector.h"
14#include "SMaterial.h" 14#include "SMaterial.h"
15#include "irrString.h" 15#include "irrString.h"
16#include "aabbox3d.h" 16#include "aabbox3d.h"
17#include "matrix4.h" 17#include "matrix4.h"
18#include "irrList.h" 18#include "irrList.h"
19#include "IAttributes.h" 19#include "IAttributes.h"
20 20
21namespace irr 21namespace irr
22{ 22{
23namespace scene 23namespace scene
24{ 24{
25 class ISceneManager; 25 class ISceneManager;
26 26
27 //! Typedef for list of scene nodes 27 //! Typedef for list of scene nodes
28 typedef core::list<ISceneNode*> ISceneNodeList; 28 typedef core::list<ISceneNode*> ISceneNodeList;
29 //! Typedef for list of scene node animators 29 //! Typedef for list of scene node animators
30 typedef core::list<ISceneNodeAnimator*> ISceneNodeAnimatorList; 30 typedef core::list<ISceneNodeAnimator*> ISceneNodeAnimatorList;
31 31
32 //! Scene node interface. 32 //! Scene node interface.
33 /** A scene node is a node in the hierarchical scene graph. Every scene 33 /** A scene node is a node in the hierarchical scene graph. Every scene
34 node may have children, which are also scene nodes. Children move 34 node may have children, which are also scene nodes. Children move
35 relative to their parent's position. If the parent of a node is not 35 relative to their parent's position. If the parent of a node is not
36 visible, its children won't be visible either. In this way, it is for 36 visible, its children won't be visible either. In this way, it is for
37 example easily possible to attach a light to a moving car, or to place 37 example easily possible to attach a light to a moving car, or to place
38 a walking character on a moving platform on a moving ship. 38 a walking character on a moving platform on a moving ship.
39 */ 39 */
40 class ISceneNode : virtual public io::IAttributeExchangingObject 40 class ISceneNode : virtual public io::IAttributeExchangingObject
41 { 41 {
42 public: 42 public:
43 43
44 //! Constructor 44 //! Constructor
45 ISceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id=-1, 45 ISceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id=-1,
46 const core::vector3df& position = core::vector3df(0,0,0), 46 const core::vector3df& position = core::vector3df(0,0,0),
47 const core::vector3df& rotation = core::vector3df(0,0,0), 47 const core::vector3df& rotation = core::vector3df(0,0,0),
48 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) 48 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
49 : RelativeTranslation(position), RelativeRotation(rotation), RelativeScale(scale), 49 : RelativeTranslation(position), RelativeRotation(rotation), RelativeScale(scale),
50 Parent(0), SceneManager(mgr), TriangleSelector(0), ID(id), 50 Parent(0), SceneManager(mgr), TriangleSelector(0), ID(id),
51 AutomaticCullingState(EAC_BOX), DebugDataVisible(EDS_OFF), 51 AutomaticCullingState(EAC_BOX), DebugDataVisible(EDS_OFF),
52 IsVisible(true), IsDebugObject(false) 52 IsVisible(true), IsDebugObject(false)
53 { 53 {
54 if (parent) 54 if (parent)
55 parent->addChild(this); 55 parent->addChild(this);
56 56
57 updateAbsolutePosition(); 57 updateAbsolutePosition();
58 } 58 }
59 59
60 60
61 //! Destructor 61 //! Destructor
62 virtual ~ISceneNode() 62 virtual ~ISceneNode()
63 { 63 {
64 // delete all children 64 // delete all children
65 removeAll(); 65 removeAll();
66 66
67 // delete all animators 67 // delete all animators
68 ISceneNodeAnimatorList::Iterator ait = Animators.begin(); 68 ISceneNodeAnimatorList::Iterator ait = Animators.begin();
69 for (; ait != Animators.end(); ++ait) 69 for (; ait != Animators.end(); ++ait)
70 (*ait)->drop(); 70 (*ait)->drop();
71 71
72 if (TriangleSelector) 72 if (TriangleSelector)
73 TriangleSelector->drop(); 73 TriangleSelector->drop();
74 } 74 }
75 75
76 76
77 //! This method is called just before the rendering process of the whole scene. 77 //! This method is called just before the rendering process of the whole scene.
78 /** Nodes may register themselves in the render pipeline during this call, 78 /** Nodes may register themselves in the render pipeline during this call,
79 precalculate the geometry which should be renderered, and prevent their 79 precalculate the geometry which should be renderered, and prevent their
80 children from being able to register themselves if they are clipped by simply 80 children from being able to register themselves if they are clipped by simply
81 not calling their OnRegisterSceneNode method. 81 not calling their OnRegisterSceneNode method.
82 If you are implementing your own scene node, you should overwrite this method 82 If you are implementing your own scene node, you should overwrite this method
83 with an implementation code looking like this: 83 with an implementation code looking like this:
84 \code 84 \code
85 if (IsVisible) 85 if (IsVisible)
86 SceneManager->registerNodeForRendering(this); 86 SceneManager->registerNodeForRendering(this);
87 87
88 ISceneNode::OnRegisterSceneNode(); 88 ISceneNode::OnRegisterSceneNode();
89 \endcode 89 \endcode
90 */ 90 */
91 virtual void OnRegisterSceneNode() 91 virtual void OnRegisterSceneNode()
92 { 92 {
93 if (IsVisible) 93 if (IsVisible)
94 { 94 {
95 ISceneNodeList::Iterator it = Children.begin(); 95 ISceneNodeList::Iterator it = Children.begin();
96 for (; it != Children.end(); ++it) 96 for (; it != Children.end(); ++it)
97 (*it)->OnRegisterSceneNode(); 97 (*it)->OnRegisterSceneNode();
98 } 98 }
99 } 99 }
100 100
101 101
102 //! OnAnimate() is called just before rendering the whole scene. 102 //! OnAnimate() is called just before rendering the whole scene.
103 /** Nodes may calculate or store animations here, and may do other useful things, 103 /** Nodes may calculate or store animations here, and may do other useful things,
104 depending on what they are. Also, OnAnimate() should be called for all 104 depending on what they are. Also, OnAnimate() should be called for all
105 child scene nodes here. This method will be called once per frame, independent 105 child scene nodes here. This method will be called once per frame, independent
106 of whether the scene node is visible or not. 106 of whether the scene node is visible or not.
107 \param timeMs Current time in milliseconds. */ 107 \param timeMs Current time in milliseconds. */
108 virtual void OnAnimate(u32 timeMs) 108 virtual void OnAnimate(u32 timeMs)
109 { 109 {
110 if (IsVisible) 110 if (IsVisible)
111 { 111 {
112 // animate this node with all animators 112 // animate this node with all animators
113 113
114 ISceneNodeAnimatorList::Iterator ait = Animators.begin(); 114 ISceneNodeAnimatorList::Iterator ait = Animators.begin();
115 while (ait != Animators.end()) 115 while (ait != Animators.end())
116 { 116 {
117 // continue to the next node before calling animateNode() 117 // continue to the next node before calling animateNode()
118 // so that the animator may remove itself from the scene 118 // so that the animator may remove itself from the scene
119 // node without the iterator becoming invalid 119 // node without the iterator becoming invalid
120 ISceneNodeAnimator* anim = *ait; 120 ISceneNodeAnimator* anim = *ait;
121 ++ait; 121 ++ait;
122 anim->animateNode(this, timeMs); 122 anim->animateNode(this, timeMs);
123 } 123 }
124 124
125 // update absolute position 125 // update absolute position
126 updateAbsolutePosition(); 126 updateAbsolutePosition();
127 127
128 // perform the post render process on all children 128 // perform the post render process on all children
129 129
130 ISceneNodeList::Iterator it = Children.begin(); 130 ISceneNodeList::Iterator it = Children.begin();
131 for (; it != Children.end(); ++it) 131 for (; it != Children.end(); ++it)
132 (*it)->OnAnimate(timeMs); 132 (*it)->OnAnimate(timeMs);
133 } 133 }
134 } 134 }
135 135
136 136
137 //! Renders the node. 137 //! Renders the node.
138 virtual void render() = 0; 138 virtual void render() = 0;
139 139
140 140
141 //! Returns the name of the node. 141 //! Returns the name of the node.
142 /** \return Name as character string. */ 142 /** \return Name as character string. */
143 virtual const c8* getName() const 143 virtual const c8* getName() const
144 { 144 {
145 return Name.c_str(); 145 return Name.c_str();
146 } 146 }
147 147
148 148
149 //! Sets the name of the node. 149 //! Sets the name of the node.
150 /** \param name New name of the scene node. */ 150 /** \param name New name of the scene node. */
151 virtual void setName(const c8* name) 151 virtual void setName(const c8* name)
152 { 152 {
153 Name = name; 153 Name = name;
154 } 154 }
155 155
156 156
157 //! Sets the name of the node. 157 //! Sets the name of the node.
158 /** \param name New name of the scene node. */ 158 /** \param name New name of the scene node. */
159 virtual void setName(const core::stringc& name) 159 virtual void setName(const core::stringc& name)
160 { 160 {
161 Name = name; 161 Name = name;
162 } 162 }
163 163
164 164
165 //! Get the axis aligned, not transformed bounding box of this node. 165 //! Get the axis aligned, not transformed bounding box of this node.
166 /** This means that if this node is an animated 3d character, 166 /** This means that if this node is an animated 3d character,
167 moving in a room, the bounding box will always be around the 167 moving in a room, the bounding box will always be around the
168 origin. To get the box in real world coordinates, just 168 origin. To get the box in real world coordinates, just
169 transform it with the matrix you receive with 169 transform it with the matrix you receive with
170 getAbsoluteTransformation() or simply use 170 getAbsoluteTransformation() or simply use
171 getTransformedBoundingBox(), which does the same. 171 getTransformedBoundingBox(), which does the same.
172 \return The non-transformed bounding box. */ 172 \return The non-transformed bounding box. */
173 virtual const core::aabbox3d<f32>& getBoundingBox() const = 0; 173 virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
174 174
175 175
176 //! Get the axis aligned, transformed and animated absolute bounding box of this node. 176 //! Get the axis aligned, transformed and animated absolute bounding box of this node.
177 /** \return The transformed bounding box. */ 177 /** \return The transformed bounding box. */
178 virtual const core::aabbox3d<f32> getTransformedBoundingBox() const 178 virtual const core::aabbox3d<f32> getTransformedBoundingBox() const
179 { 179 {
180 core::aabbox3d<f32> box = getBoundingBox(); 180 core::aabbox3d<f32> box = getBoundingBox();
181 AbsoluteTransformation.transformBoxEx(box); 181 AbsoluteTransformation.transformBoxEx(box);
182 return box; 182 return box;
183 } 183 }
184 184
185 185
186 //! Get the absolute transformation of the node. Is recalculated every OnAnimate()-call. 186 //! Get the absolute transformation of the node. Is recalculated every OnAnimate()-call.
187 /** NOTE: For speed reasons the absolute transformation is not 187 /** NOTE: For speed reasons the absolute transformation is not
188 automatically recalculated on each change of the relative 188 automatically recalculated on each change of the relative
189 transformation or by a transformation change of an parent. Instead the 189 transformation or by a transformation change of an parent. Instead the
190 update usually happens once per frame in OnAnimate. You can enforce 190 update usually happens once per frame in OnAnimate. You can enforce
191 an update with updateAbsolutePosition(). 191 an update with updateAbsolutePosition().
192 \return The absolute transformation matrix. */ 192 \return The absolute transformation matrix. */
193 virtual const core::matrix4& getAbsoluteTransformation() const 193 virtual const core::matrix4& getAbsoluteTransformation() const
194 { 194 {
195 return AbsoluteTransformation; 195 return AbsoluteTransformation;
196 } 196 }
197 197
198 198
199 //! Returns the relative transformation of the scene node. 199 //! Returns the relative transformation of the scene node.
200 /** The relative transformation is stored internally as 3 200 /** The relative transformation is stored internally as 3
201 vectors: translation, rotation and scale. To get the relative 201 vectors: translation, rotation and scale. To get the relative
202 transformation matrix, it is calculated from these values. 202 transformation matrix, it is calculated from these values.
203 \return The relative transformation matrix. */ 203 \return The relative transformation matrix. */
204 virtual core::matrix4 getRelativeTransformation() const 204 virtual core::matrix4 getRelativeTransformation() const
205 { 205 {
206 core::matrix4 mat; 206 core::matrix4 mat;
207 mat.setRotationDegrees(RelativeRotation); 207 mat.setRotationDegrees(RelativeRotation);
208 mat.setTranslation(RelativeTranslation); 208 mat.setTranslation(RelativeTranslation);
209 209
210 if (RelativeScale != core::vector3df(1.f,1.f,1.f)) 210 if (RelativeScale != core::vector3df(1.f,1.f,1.f))
211 { 211 {
212 core::matrix4 smat; 212 core::matrix4 smat;
213 smat.setScale(RelativeScale); 213 smat.setScale(RelativeScale);
214 mat *= smat; 214 mat *= smat;
215 } 215 }
216 216
217 return mat; 217 return mat;
218 } 218 }
219 219
220 220
221 //! Returns whether the node should be visible (if all of its parents are visible). 221 //! Returns whether the node should be visible (if all of its parents are visible).
222 /** This is only an option set by the user, but has nothing to 222 /** This is only an option set by the user, but has nothing to
223 do with geometry culling 223 do with geometry culling
224 \return The requested visibility of the node, true means 224 \return The requested visibility of the node, true means
225 visible (if all parents are also visible). */ 225 visible (if all parents are also visible). */
226 virtual bool isVisible() const 226 virtual bool isVisible() const
227 { 227 {
228 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 228 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
229 return IsVisible; 229 return IsVisible;
230 } 230 }
231 231
232 //! Check whether the node is truly visible, taking into accounts its parents' visibility 232 //! Check whether the node is truly visible, taking into accounts its parents' visibility
233 /** \return true if the node and all its parents are visible, 233 /** \return true if the node and all its parents are visible,
234 false if this or any parent node is invisible. */ 234 false if this or any parent node is invisible. */
235 virtual bool isTrulyVisible() const 235 virtual bool isTrulyVisible() const
236 { 236 {
237 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 237 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
238 if(!IsVisible) 238 if(!IsVisible)
239 return false; 239 return false;
240 240
241 if(!Parent) 241 if(!Parent)
242 return true; 242 return true;
243 243
244 return Parent->isTrulyVisible(); 244 return Parent->isTrulyVisible();
245 } 245 }
246 246
247 //! Sets if the node should be visible or not. 247 //! Sets if the node should be visible or not.
248 /** All children of this node won't be visible either, when set 248 /** All children of this node won't be visible either, when set
249 to false. Invisible nodes are not valid candidates for selection by 249 to false. Invisible nodes are not valid candidates for selection by
250 collision manager bounding box methods. 250 collision manager bounding box methods.
251 \param isVisible If the node shall be visible. */ 251 \param isVisible If the node shall be visible. */
252 virtual void setVisible(bool isVisible) 252 virtual void setVisible(bool isVisible)
253 { 253 {
254 IsVisible = isVisible; 254 IsVisible = isVisible;
255 } 255 }
256 256
257 257
258 //! Get the id of the scene node. 258 //! Get the id of the scene node.
259 /** This id can be used to identify the node. 259 /** This id can be used to identify the node.
260 \return The id. */ 260 \return The id. */
261 virtual s32 getID() const 261 virtual s32 getID() const
262 { 262 {
263 return ID; 263 return ID;
264 } 264 }
265 265
266 266
267 //! Sets the id of the scene node. 267 //! Sets the id of the scene node.
268 /** This id can be used to identify the node. 268 /** This id can be used to identify the node.
269 \param id The new id. */ 269 \param id The new id. */
270 virtual void setID(s32 id) 270 virtual void setID(s32 id)
271 { 271 {
272 ID = id; 272 ID = id;
273 } 273 }
274 274
275 275
276 //! Adds a child to this scene node. 276 //! Adds a child to this scene node.
277 /** If the scene node already has a parent it is first removed 277 /** If the scene node already has a parent it is first removed
278 from the other parent. 278 from the other parent.
279 \param child A pointer to the new child. */ 279 \param child A pointer to the new child. */
280 virtual void addChild(ISceneNode* child) 280 virtual void addChild(ISceneNode* child)
281 { 281 {
282 if (child && (child != this)) 282 if (child && (child != this))
283 { 283 {
284 // Change scene manager? 284 // Change scene manager?
285 if (SceneManager != child->SceneManager) 285 if (SceneManager != child->SceneManager)
286 child->setSceneManager(SceneManager); 286 child->setSceneManager(SceneManager);
287 287
288 child->grab(); 288 child->grab();
289 child->remove(); // remove from old parent 289 child->remove(); // remove from old parent
290 Children.push_back(child); 290 Children.push_back(child);
291 child->Parent = this; 291 child->Parent = this;
292 } 292 }
293 } 293 }
294 294
295 295
296 //! Removes a child from this scene node. 296 //! Removes a child from this scene node.
297 /** If found in the children list, the child pointer is also 297 /** If found in the children list, the child pointer is also
298 dropped and might be deleted if no other grab exists. 298 dropped and might be deleted if no other grab exists.
299 \param child A pointer to the child which shall be removed. 299 \param child A pointer to the child which shall be removed.
300 \return True if the child was removed, and false if not, 300 \return True if the child was removed, and false if not,
301 e.g. because it couldn't be found in the children list. */ 301 e.g. because it couldn't be found in the children list. */
302 virtual bool removeChild(ISceneNode* child) 302 virtual bool removeChild(ISceneNode* child)
303 { 303 {
304 ISceneNodeList::Iterator it = Children.begin(); 304 ISceneNodeList::Iterator it = Children.begin();
305 for (; it != Children.end(); ++it) 305 for (; it != Children.end(); ++it)
306 if ((*it) == child) 306 if ((*it) == child)
307 { 307 {
308 (*it)->Parent = 0; 308 (*it)->Parent = 0;
309 (*it)->drop(); 309 (*it)->drop();
310 Children.erase(it); 310 Children.erase(it);
311 return true; 311 return true;
312 } 312 }
313 313
314 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 314 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
315 return false; 315 return false;
316 } 316 }
317 317
318 318
319 //! Removes all children of this scene node 319 //! Removes all children of this scene node
320 /** The scene nodes found in the children list are also dropped 320 /** The scene nodes found in the children list are also dropped
321 and might be deleted if no other grab exists on them. 321 and might be deleted if no other grab exists on them.
322 */ 322 */
323 virtual void removeAll() 323 virtual void removeAll()
324 { 324 {
325 ISceneNodeList::Iterator it = Children.begin(); 325 ISceneNodeList::Iterator it = Children.begin();
326 for (; it != Children.end(); ++it) 326 for (; it != Children.end(); ++it)
327 { 327 {
328 (*it)->Parent = 0; 328 (*it)->Parent = 0;
329 (*it)->drop(); 329 (*it)->drop();
330 } 330 }
331 331
332 Children.clear(); 332 Children.clear();
333 } 333 }
334 334
335 335
336 //! Removes this scene node from the scene 336 //! Removes this scene node from the scene
337 /** If no other grab exists for this node, it will be deleted. 337 /** If no other grab exists for this node, it will be deleted.
338 */ 338 */
339 virtual void remove() 339 virtual void remove()
340 { 340 {
341 if (Parent) 341 if (Parent)
342 Parent->removeChild(this); 342 Parent->removeChild(this);
343 } 343 }
344 344
345 345
346 //! Adds an animator which should animate this node. 346 //! Adds an animator which should animate this node.
347 /** \param animator A pointer to the new animator. */ 347 /** \param animator A pointer to the new animator. */
348 virtual void addAnimator(ISceneNodeAnimator* animator) 348 virtual void addAnimator(ISceneNodeAnimator* animator)
349 { 349 {
350 if (animator) 350 if (animator)
351 { 351 {
352 Animators.push_back(animator); 352 Animators.push_back(animator);
353 animator->grab(); 353 animator->grab();
354 } 354 }
355 } 355 }
356 356
357 357
358 //! Get a list of all scene node animators. 358 //! Get a list of all scene node animators.
359 /** \return The list of animators attached to this node. */ 359 /** \return The list of animators attached to this node. */
360 const core::list<ISceneNodeAnimator*>& getAnimators() const 360 const core::list<ISceneNodeAnimator*>& getAnimators() const
361 { 361 {
362 return Animators; 362 return Animators;
363 } 363 }
364 364
365 365
366 //! Removes an animator from this scene node. 366 //! Removes an animator from this scene node.
367 /** If the animator is found, it is also dropped and might be 367 /** If the animator is found, it is also dropped and might be
368 deleted if not other grab exists for it. 368 deleted if not other grab exists for it.
369 \param animator A pointer to the animator to be deleted. */ 369 \param animator A pointer to the animator to be deleted. */
370 virtual void removeAnimator(ISceneNodeAnimator* animator) 370 virtual void removeAnimator(ISceneNodeAnimator* animator)
371 { 371 {
372 ISceneNodeAnimatorList::Iterator it = Animators.begin(); 372 ISceneNodeAnimatorList::Iterator it = Animators.begin();
373 for (; it != Animators.end(); ++it) 373 for (; it != Animators.end(); ++it)
374 { 374 {
375 if ((*it) == animator) 375 if ((*it) == animator)
376 { 376 {
377 (*it)->drop(); 377 (*it)->drop();
378 Animators.erase(it); 378 Animators.erase(it);
379 return; 379 return;
380 } 380 }
381 } 381 }
382 } 382 }
383 383
384 384
385 //! Removes all animators from this scene node. 385 //! Removes all animators from this scene node.
386 /** The animators might also be deleted if no other grab exists 386 /** The animators might also be deleted if no other grab exists
387 for them. */ 387 for them. */
388 virtual void removeAnimators() 388 virtual void removeAnimators()
389 { 389 {
390 ISceneNodeAnimatorList::Iterator it = Animators.begin(); 390 ISceneNodeAnimatorList::Iterator it = Animators.begin();
391 for (; it != Animators.end(); ++it) 391 for (; it != Animators.end(); ++it)
392 (*it)->drop(); 392 (*it)->drop();
393 393
394 Animators.clear(); 394 Animators.clear();
395 } 395 }
396 396
397 397
398 //! Returns the material based on the zero based index i. 398 //! Returns the material based on the zero based index i.
399 /** To get the amount of materials used by this scene node, use 399 /** To get the amount of materials used by this scene node, use
400 getMaterialCount(). This function is needed for inserting the 400 getMaterialCount(). This function is needed for inserting the
401 node into the scene hierarchy at an optimal position for 401 node into the scene hierarchy at an optimal position for
402 minimizing renderstate changes, but can also be used to 402 minimizing renderstate changes, but can also be used to
403 directly modify the material of a scene node. 403 directly modify the material of a scene node.
404 \param num Zero based index. The maximal value is getMaterialCount() - 1. 404 \param num Zero based index. The maximal value is getMaterialCount() - 1.
405 \return The material at that index. */ 405 \return The material at that index. */
406 virtual video::SMaterial& getMaterial(u32 num) 406 virtual video::SMaterial& getMaterial(u32 num)
407 { 407 {
408 return video::IdentityMaterial; 408 return video::IdentityMaterial;
409 } 409 }
410 410
411 411
412 //! Get amount of materials used by this scene node. 412 //! Get amount of materials used by this scene node.
413 /** \return Current amount of materials of this scene node. */ 413 /** \return Current amount of materials of this scene node. */
414 virtual u32 getMaterialCount() const 414 virtual u32 getMaterialCount() const
415 { 415 {
416 return 0; 416 return 0;
417 } 417 }
418 418
419 419
420 //! Sets all material flags at once to a new value. 420 //! Sets all material flags at once to a new value.
421 /** Useful, for example, if you want the whole mesh to be 421 /** Useful, for example, if you want the whole mesh to be
422 affected by light. 422 affected by light.
423 \param flag Which flag of all materials to be set. 423 \param flag Which flag of all materials to be set.
424 \param newvalue New value of that flag. */ 424 \param newvalue New value of that flag. */
425 void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) 425 void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
426 { 426 {
427 for (u32 i=0; i<getMaterialCount(); ++i) 427 for (u32 i=0; i<getMaterialCount(); ++i)
428 getMaterial(i).setFlag(flag, newvalue); 428 getMaterial(i).setFlag(flag, newvalue);
429 } 429 }
430 430
431 431
432 //! Sets the texture of the specified layer in all materials of this scene node to the new texture. 432 //! Sets the texture of the specified layer in all materials of this scene node to the new texture.
433 /** \param textureLayer Layer of texture to be set. Must be a 433 /** \param textureLayer Layer of texture to be set. Must be a
434 value smaller than MATERIAL_MAX_TEXTURES. 434 value smaller than MATERIAL_MAX_TEXTURES.
435 \param texture New texture to be used. */ 435 \param texture New texture to be used. */
436 void setMaterialTexture(u32 textureLayer, video::ITexture* texture) 436 void setMaterialTexture(u32 textureLayer, video::ITexture* texture)
437 { 437 {
438 if (textureLayer >= video::MATERIAL_MAX_TEXTURES) 438 if (textureLayer >= video::MATERIAL_MAX_TEXTURES)
439 return; 439 return;
440 440
441 for (u32 i=0; i<getMaterialCount(); ++i) 441 for (u32 i=0; i<getMaterialCount(); ++i)
442 getMaterial(i).setTexture(textureLayer, texture); 442 getMaterial(i).setTexture(textureLayer, texture);
443 } 443 }
444 444
445 445
446 //! Sets the material type of all materials in this scene node to a new material type. 446 //! Sets the material type of all materials in this scene node to a new material type.
447 /** \param newType New type of material to be set. */ 447 /** \param newType New type of material to be set. */
448 void setMaterialType(video::E_MATERIAL_TYPE newType) 448 void setMaterialType(video::E_MATERIAL_TYPE newType)
449 { 449 {
450 for (u32 i=0; i<getMaterialCount(); ++i) 450 for (u32 i=0; i<getMaterialCount(); ++i)
451 getMaterial(i).MaterialType = newType; 451 getMaterial(i).MaterialType = newType;
452 } 452 }
453 453
454 454
455 //! Gets the scale of the scene node relative to its parent. 455 //! Gets the scale of the scene node relative to its parent.
456 /** This is the scale of this node relative to its parent. 456 /** This is the scale of this node relative to its parent.
457 If you want the absolute scale, use 457 If you want the absolute scale, use
458 getAbsoluteTransformation().getScale() 458 getAbsoluteTransformation().getScale()
459 \return The scale of the scene node. */ 459 \return The scale of the scene node. */
460 virtual const core::vector3df& getScale() const 460 virtual const core::vector3df& getScale() const
461 { 461 {
462 return RelativeScale; 462 return RelativeScale;
463 } 463 }
464 464
465 465
466 //! Sets the relative scale of the scene node. 466 //! Sets the relative scale of the scene node.
467 /** \param scale New scale of the node, relative to its parent. */ 467 /** \param scale New scale of the node, relative to its parent. */
468 virtual void setScale(const core::vector3df& scale) 468 virtual void setScale(const core::vector3df& scale)
469 { 469 {
470 RelativeScale = scale; 470 RelativeScale = scale;
471 } 471 }
472 472
473 473
474 //! Gets the rotation of the node relative to its parent. 474 //! Gets the rotation of the node relative to its parent.
475 /** Note that this is the relative rotation of the node. 475 /** Note that this is the relative rotation of the node.
476 If you want the absolute rotation, use 476 If you want the absolute rotation, use
477 getAbsoluteTransformation().getRotation() 477 getAbsoluteTransformation().getRotation()
478 \return Current relative rotation of the scene node. */ 478 \return Current relative rotation of the scene node. */
479 virtual const core::vector3df& getRotation() const 479 virtual const core::vector3df& getRotation() const
480 { 480 {
481 return RelativeRotation; 481 return RelativeRotation;
482 } 482 }
483 483
484 484
485 //! Sets the rotation of the node relative to its parent. 485 //! Sets the rotation of the node relative to its parent.
486 /** This only modifies the relative rotation of the node. 486 /** This only modifies the relative rotation of the node.
487 \param rotation New rotation of the node in degrees. */ 487 \param rotation New rotation of the node in degrees. */
488 virtual void setRotation(const core::vector3df& rotation) 488 virtual void setRotation(const core::vector3df& rotation)
489 { 489 {
490 RelativeRotation = rotation; 490 RelativeRotation = rotation;
491 } 491 }
492 492
493 493
494 //! Gets the position of the node relative to its parent. 494 //! Gets the position of the node relative to its parent.
495 /** Note that the position is relative to the parent. If you want 495 /** Note that the position is relative to the parent. If you want
496 the position in world coordinates, use getAbsolutePosition() instead. 496 the position in world coordinates, use getAbsolutePosition() instead.
497 \return The current position of the node relative to the parent. */ 497 \return The current position of the node relative to the parent. */
498 virtual const core::vector3df& getPosition() const 498 virtual const core::vector3df& getPosition() const
499 { 499 {
500 return RelativeTranslation; 500 return RelativeTranslation;
501 } 501 }
502 502
503 503
504 //! Sets the position of the node relative to its parent. 504 //! Sets the position of the node relative to its parent.
505 /** Note that the position is relative to the parent. 505 /** Note that the position is relative to the parent.
506 \param newpos New relative position of the scene node. */ 506 \param newpos New relative position of the scene node. */
507 virtual void setPosition(const core::vector3df& newpos) 507 virtual void setPosition(const core::vector3df& newpos)
508 { 508 {
509 RelativeTranslation = newpos; 509 RelativeTranslation = newpos;
510 } 510 }
511 511
512 512
513 //! Gets the absolute position of the node in world coordinates. 513 //! Gets the absolute position of the node in world coordinates.
514 /** If you want the position of the node relative to its parent, 514 /** If you want the position of the node relative to its parent,
515 use getPosition() instead. 515 use getPosition() instead.
516 NOTE: For speed reasons the absolute position is not 516 NOTE: For speed reasons the absolute position is not
517 automatically recalculated on each change of the relative 517 automatically recalculated on each change of the relative
518 position or by a position change of an parent. Instead the 518 position or by a position change of an parent. Instead the
519 update usually happens once per frame in OnAnimate. You can enforce 519 update usually happens once per frame in OnAnimate. You can enforce
520 an update with updateAbsolutePosition(). 520 an update with updateAbsolutePosition().
521 \return The current absolute position of the scene node (updated on last call of updateAbsolutePosition). */ 521 \return The current absolute position of the scene node (updated on last call of updateAbsolutePosition). */
522 virtual core::vector3df getAbsolutePosition() const 522 virtual core::vector3df getAbsolutePosition() const
523 { 523 {
524 return AbsoluteTransformation.getTranslation(); 524 return AbsoluteTransformation.getTranslation();
525 } 525 }
526 526
527 527
528 //! Enables or disables automatic culling based on the bounding box. 528 //! Enables or disables automatic culling based on the bounding box.
529 /** Automatic culling is enabled by default. Note that not 529 /** Automatic culling is enabled by default. Note that not
530 all SceneNodes support culling and that some nodes always cull 530 all SceneNodes support culling and that some nodes always cull
531 their geometry because it is their only reason for existence, 531 their geometry because it is their only reason for existence,
532 for example the OctreeSceneNode. 532 for example the OctreeSceneNode.
533 \param state The culling state to be used. */ 533 \param state The culling state to be used. */
534 void setAutomaticCulling( u32 state) 534 void setAutomaticCulling( u32 state)
535 { 535 {
536 AutomaticCullingState = state; 536 AutomaticCullingState = state;
537 } 537 }
538 538
539 539
540 //! Gets the automatic culling state. 540 //! Gets the automatic culling state.
541 /** \return The automatic culling state. */ 541 /** \return The automatic culling state. */
542 u32 getAutomaticCulling() const 542 u32 getAutomaticCulling() const
543 { 543 {
544 return AutomaticCullingState; 544 return AutomaticCullingState;
545 } 545 }
546 546
547 547
548 //! Sets if debug data like bounding boxes should be drawn. 548 //! Sets if debug data like bounding boxes should be drawn.
549 /** A bitwise OR of the types from @ref irr::scene::E_DEBUG_SCENE_TYPE. 549 /** A bitwise OR of the types from @ref irr::scene::E_DEBUG_SCENE_TYPE.
550 Please note that not all scene nodes support all debug data types. 550 Please note that not all scene nodes support all debug data types.
551 \param state The debug data visibility state to be used. */ 551 \param state The debug data visibility state to be used. */
552 virtual void setDebugDataVisible(u32 state) 552 virtual void setDebugDataVisible(u32 state)
553 { 553 {
554 DebugDataVisible = state; 554 DebugDataVisible = state;
555 } 555 }
556 556
557 //! Returns if debug data like bounding boxes are drawn. 557 //! Returns if debug data like bounding boxes are drawn.
558 /** \return A bitwise OR of the debug data values from 558 /** \return A bitwise OR of the debug data values from
559 @ref irr::scene::E_DEBUG_SCENE_TYPE that are currently visible. */ 559 @ref irr::scene::E_DEBUG_SCENE_TYPE that are currently visible. */
560 u32 isDebugDataVisible() const 560 u32 isDebugDataVisible() const
561 { 561 {
562 return DebugDataVisible; 562 return DebugDataVisible;
563 } 563 }
564 564
565 565
566 //! Sets if this scene node is a debug object. 566 //! Sets if this scene node is a debug object.
567 /** Debug objects have some special properties, for example they can be easily 567 /** Debug objects have some special properties, for example they can be easily
568 excluded from collision detection or from serialization, etc. */ 568 excluded from collision detection or from serialization, etc. */
569 void setIsDebugObject(bool debugObject) 569 void setIsDebugObject(bool debugObject)
570 { 570 {
571 IsDebugObject = debugObject; 571 IsDebugObject = debugObject;
572 } 572 }
573 573
574 574
575 //! Returns if this scene node is a debug object. 575 //! Returns if this scene node is a debug object.
576 /** Debug objects have some special properties, for example they can be easily 576 /** Debug objects have some special properties, for example they can be easily
577 excluded from collision detection or from serialization, etc. 577 excluded from collision detection or from serialization, etc.
578 \return If this node is a debug object, true is returned. */ 578 \return If this node is a debug object, true is returned. */
579 bool isDebugObject() const 579 bool isDebugObject() const
580 { 580 {
581 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 581 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
582 return IsDebugObject; 582 return IsDebugObject;
583 } 583 }
584 584
585 585
586 //! Returns a const reference to the list of all children. 586 //! Returns a const reference to the list of all children.
587 /** \return The list of all children of this node. */ 587 /** \return The list of all children of this node. */
588 const core::list<ISceneNode*>& getChildren() const 588 const core::list<ISceneNode*>& getChildren() const
589 { 589 {
590 return Children; 590 return Children;
591 } 591 }
592 592
593 593
594 //! Changes the parent of the scene node. 594 //! Changes the parent of the scene node.
595 /** \param newParent The new parent to be used. */ 595 /** \param newParent The new parent to be used. */
596 virtual void setParent(ISceneNode* newParent) 596 virtual void setParent(ISceneNode* newParent)
597 { 597 {
598 grab(); 598 grab();
599 remove(); 599 remove();
600 600
601 Parent = newParent; 601 Parent = newParent;
602 602
603 if (Parent) 603 if (Parent)
604 Parent->addChild(this); 604 Parent->addChild(this);
605 605
606 drop(); 606 drop();
607 } 607 }
608 608
609 609
610 //! Returns the triangle selector attached to this scene node. 610 //! Returns the triangle selector attached to this scene node.
611 /** The Selector can be used by the engine for doing collision 611 /** The Selector can be used by the engine for doing collision
612 detection. You can create a TriangleSelector with 612 detection. You can create a TriangleSelector with
613 ISceneManager::createTriangleSelector() or 613 ISceneManager::createTriangleSelector() or
614 ISceneManager::createOctreeTriangleSelector and set it with 614 ISceneManager::createOctreeTriangleSelector and set it with
615 ISceneNode::setTriangleSelector(). If a scene node got no triangle 615 ISceneNode::setTriangleSelector(). If a scene node got no triangle
616 selector, but collision tests should be done with it, a triangle 616 selector, but collision tests should be done with it, a triangle
617 selector is created using the bounding box of the scene node. 617 selector is created using the bounding box of the scene node.
618 \return A pointer to the TriangleSelector or 0, if there 618 \return A pointer to the TriangleSelector or 0, if there
619 is none. */ 619 is none. */
620 virtual ITriangleSelector* getTriangleSelector() const 620 virtual ITriangleSelector* getTriangleSelector() const
621 { 621 {
622 return TriangleSelector; 622 return TriangleSelector;
623 } 623 }
624 624
625 625
626 //! Sets the triangle selector of the scene node. 626 //! Sets the triangle selector of the scene node.
627 /** The Selector can be used by the engine for doing collision 627 /** The Selector can be used by the engine for doing collision
628 detection. You can create a TriangleSelector with 628 detection. You can create a TriangleSelector with
629 ISceneManager::createTriangleSelector() or 629 ISceneManager::createTriangleSelector() or
630 ISceneManager::createOctreeTriangleSelector(). Some nodes may 630 ISceneManager::createOctreeTriangleSelector(). Some nodes may
631 create their own selector by default, so it would be good to 631 create their own selector by default, so it would be good to
632 check if there is already a selector in this node by calling 632 check if there is already a selector in this node by calling
633 ISceneNode::getTriangleSelector(). 633 ISceneNode::getTriangleSelector().
634 \param selector New triangle selector for this scene node. */ 634 \param selector New triangle selector for this scene node. */
635 virtual void setTriangleSelector(ITriangleSelector* selector) 635 virtual void setTriangleSelector(ITriangleSelector* selector)
636 { 636 {
637 if (TriangleSelector != selector) 637 if (TriangleSelector != selector)
638 { 638 {
639 if (TriangleSelector) 639 if (TriangleSelector)
640 TriangleSelector->drop(); 640 TriangleSelector->drop();
641 641
642 TriangleSelector = selector; 642 TriangleSelector = selector;
643 if (TriangleSelector) 643 if (TriangleSelector)
644 TriangleSelector->grab(); 644 TriangleSelector->grab();
645 } 645 }
646 } 646 }
647 647
648 648
649 //! Updates the absolute position based on the relative and the parents position 649 //! Updates the absolute position based on the relative and the parents position
650 /** Note: This does not recursively update the parents absolute positions, so if you have a deeper 650 /** Note: This does not recursively update the parents absolute positions, so if you have a deeper
651 hierarchy you might want to update the parents first.*/ 651 hierarchy you might want to update the parents first.*/
652 virtual void updateAbsolutePosition() 652 virtual void updateAbsolutePosition()
653 { 653 {
654 if (Parent) 654 if (Parent)
655 { 655 {
656 AbsoluteTransformation = 656 AbsoluteTransformation =
657 Parent->getAbsoluteTransformation() * getRelativeTransformation(); 657 Parent->getAbsoluteTransformation() * getRelativeTransformation();
658 } 658 }
659 else 659 else
660 AbsoluteTransformation = getRelativeTransformation(); 660 AbsoluteTransformation = getRelativeTransformation();
661 } 661 }
662 662
663 663
664 //! Returns the parent of this scene node 664 //! Returns the parent of this scene node
665 /** \return A pointer to the parent. */ 665 /** \return A pointer to the parent. */
666 scene::ISceneNode* getParent() const 666 scene::ISceneNode* getParent() const
667 { 667 {
668 return Parent; 668 return Parent;
669 } 669 }
670 670
671 671
672 //! Returns type of the scene node 672 //! Returns type of the scene node
673 /** \return The type of this node. */ 673 /** \return The type of this node. */
674 virtual ESCENE_NODE_TYPE getType() const 674 virtual ESCENE_NODE_TYPE getType() const
675 { 675 {
676 return ESNT_UNKNOWN; 676 return ESNT_UNKNOWN;
677 } 677 }
678 678
679 679
680 //! Writes attributes of the scene node. 680 //! Writes attributes of the scene node.
681 /** Implement this to expose the attributes of your scene node 681 /** Implement this to expose the attributes of your scene node
682 for scripting languages, editors, debuggers or xml 682 for scripting languages, editors, debuggers or xml
683 serialization purposes. 683 serialization purposes.
684 \param out The attribute container to write into. 684 \param out The attribute container to write into.
685 \param options Additional options which might influence the 685 \param options Additional options which might influence the
686 serialization. */ 686 serialization. */
687 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const 687 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
688 { 688 {
689 if (!out) 689 if (!out)
690 return; 690 return;
691 out->addString ("Name", Name.c_str()); 691 out->addString ("Name", Name.c_str());
692 out->addInt ("Id", ID ); 692 out->addInt ("Id", ID );
693 693
694 out->addVector3d("Position", getPosition() ); 694 out->addVector3d("Position", getPosition() );
695 out->addVector3d("Rotation", getRotation() ); 695 out->addVector3d("Rotation", getRotation() );
696 out->addVector3d("Scale", getScale() ); 696 out->addVector3d("Scale", getScale() );
697 697
698 out->addBool ("Visible", IsVisible ); 698 out->addBool ("Visible", IsVisible );
699 out->addInt ("AutomaticCulling", AutomaticCullingState); 699 out->addInt ("AutomaticCulling", AutomaticCullingState);
700 out->addInt ("DebugDataVisible", DebugDataVisible ); 700 out->addInt ("DebugDataVisible", DebugDataVisible );
701 out->addBool ("IsDebugObject", IsDebugObject ); 701 out->addBool ("IsDebugObject", IsDebugObject );
702 } 702 }
703 703
704 704
705 //! Reads attributes of the scene node. 705 //! Reads attributes of the scene node.
706 /** Implement this to set the attributes of your scene node for 706 /** Implement this to set the attributes of your scene node for
707 scripting languages, editors, debuggers or xml deserialization 707 scripting languages, editors, debuggers or xml deserialization
708 purposes. 708 purposes.
709 \param in The attribute container to read from. 709 \param in The attribute container to read from.
710 \param options Additional options which might influence the 710 \param options Additional options which might influence the
711 deserialization. */ 711 deserialization. */
712 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) 712 virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
713 { 713 {
714 if (!in) 714 if (!in)
715 return; 715 return;
716 Name = in->getAttributeAsString("Name"); 716 Name = in->getAttributeAsString("Name");
717 ID = in->getAttributeAsInt("Id"); 717 ID = in->getAttributeAsInt("Id");
718 718
719 setPosition(in->getAttributeAsVector3d("Position")); 719 setPosition(in->getAttributeAsVector3d("Position"));
720 setRotation(in->getAttributeAsVector3d("Rotation")); 720 setRotation(in->getAttributeAsVector3d("Rotation"));
721 setScale(in->getAttributeAsVector3d("Scale")); 721 setScale(in->getAttributeAsVector3d("Scale"));
722 722
723 IsVisible = in->getAttributeAsBool("Visible"); 723 IsVisible = in->getAttributeAsBool("Visible");
724 s32 tmpState = in->getAttributeAsEnumeration("AutomaticCulling", 724 s32 tmpState = in->getAttributeAsEnumeration("AutomaticCulling",
725 scene::AutomaticCullingNames); 725 scene::AutomaticCullingNames);
726 if (tmpState != -1) 726 if (tmpState != -1)
727 AutomaticCullingState = (u32)tmpState; 727 AutomaticCullingState = (u32)tmpState;
728 else 728 else
729 AutomaticCullingState = in->getAttributeAsInt("AutomaticCulling"); 729 AutomaticCullingState = in->getAttributeAsInt("AutomaticCulling");
730 730
731 DebugDataVisible = in->getAttributeAsInt("DebugDataVisible"); 731 DebugDataVisible = in->getAttributeAsInt("DebugDataVisible");
732 IsDebugObject = in->getAttributeAsBool("IsDebugObject"); 732 IsDebugObject = in->getAttributeAsBool("IsDebugObject");
733 733
734 updateAbsolutePosition(); 734 updateAbsolutePosition();
735 } 735 }
736 736
737 //! Creates a clone of this scene node and its children. 737 //! Creates a clone of this scene node and its children.
738 /** \param newParent An optional new parent. 738 /** \param newParent An optional new parent.
739 \param newManager An optional new scene manager. 739 \param newManager An optional new scene manager.
740 \return The newly created clone of this node. */ 740 \return The newly created clone of this node. */
741 virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) 741 virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0)
742 { 742 {
743 return 0; // to be implemented by derived classes 743 return 0; // to be implemented by derived classes
744 } 744 }
745 745
746 //! Retrieve the scene manager for this node. 746 //! Retrieve the scene manager for this node.
747 /** \return The node's scene manager. */ 747 /** \return The node's scene manager. */
748 virtual ISceneManager* getSceneManager(void) const { return SceneManager; } 748 virtual ISceneManager* getSceneManager(void) const { return SceneManager; }
749 749
750 protected: 750 protected:
751 751
752 //! A clone function for the ISceneNode members. 752 //! A clone function for the ISceneNode members.
753 /** This method can be used by clone() implementations of 753 /** This method can be used by clone() implementations of
754 derived classes 754 derived classes
755 \param toCopyFrom The node from which the values are copied 755 \param toCopyFrom The node from which the values are copied
756 \param newManager The new scene manager. */ 756 \param newManager The new scene manager. */
757 void cloneMembers(ISceneNode* toCopyFrom, ISceneManager* newManager) 757 void cloneMembers(ISceneNode* toCopyFrom, ISceneManager* newManager)
758 { 758 {
759 Name = toCopyFrom->Name; 759 Name = toCopyFrom->Name;
760 AbsoluteTransformation = toCopyFrom->AbsoluteTransformation; 760 AbsoluteTransformation = toCopyFrom->AbsoluteTransformation;
761 RelativeTranslation = toCopyFrom->RelativeTranslation; 761 RelativeTranslation = toCopyFrom->RelativeTranslation;
762 RelativeRotation = toCopyFrom->RelativeRotation; 762 RelativeRotation = toCopyFrom->RelativeRotation;
763 RelativeScale = toCopyFrom->RelativeScale; 763 RelativeScale = toCopyFrom->RelativeScale;
764 ID = toCopyFrom->ID; 764 ID = toCopyFrom->ID;
765 setTriangleSelector(toCopyFrom->TriangleSelector); 765 setTriangleSelector(toCopyFrom->TriangleSelector);
766 AutomaticCullingState = toCopyFrom->AutomaticCullingState; 766 AutomaticCullingState = toCopyFrom->AutomaticCullingState;
767 DebugDataVisible = toCopyFrom->DebugDataVisible; 767 DebugDataVisible = toCopyFrom->DebugDataVisible;
768 IsVisible = toCopyFrom->IsVisible; 768 IsVisible = toCopyFrom->IsVisible;
769 IsDebugObject = toCopyFrom->IsDebugObject; 769 IsDebugObject = toCopyFrom->IsDebugObject;
770 770
771 if (newManager) 771 if (newManager)
772 SceneManager = newManager; 772 SceneManager = newManager;
773 else 773 else
774 SceneManager = toCopyFrom->SceneManager; 774 SceneManager = toCopyFrom->SceneManager;
775 775
776 // clone children 776 // clone children
777 777
778 ISceneNodeList::Iterator it = toCopyFrom->Children.begin(); 778 ISceneNodeList::Iterator it = toCopyFrom->Children.begin();
779 for (; it != toCopyFrom->Children.end(); ++it) 779 for (; it != toCopyFrom->Children.end(); ++it)
780 (*it)->clone(this, newManager); 780 (*it)->clone(this, newManager);
781 781
782 // clone animators 782 // clone animators
783 783
784 ISceneNodeAnimatorList::Iterator ait = toCopyFrom->Animators.begin(); 784 ISceneNodeAnimatorList::Iterator ait = toCopyFrom->Animators.begin();
785 for (; ait != toCopyFrom->Animators.end(); ++ait) 785 for (; ait != toCopyFrom->Animators.end(); ++ait)
786 { 786 {
787 ISceneNodeAnimator* anim = (*ait)->createClone(this, SceneManager); 787 ISceneNodeAnimator* anim = (*ait)->createClone(this, SceneManager);
788 if (anim) 788 if (anim)
789 { 789 {
790 addAnimator(anim); 790 addAnimator(anim);
791 anim->drop(); 791 anim->drop();
792 } 792 }
793 } 793 }
794 } 794 }
795 795
796 //! Sets the new scene manager for this node and all children. 796 //! Sets the new scene manager for this node and all children.
797 //! Called by addChild when moving nodes between scene managers 797 //! Called by addChild when moving nodes between scene managers
798 void setSceneManager(ISceneManager* newManager) 798 void setSceneManager(ISceneManager* newManager)
799 { 799 {
800 SceneManager = newManager; 800 SceneManager = newManager;
801 801
802 ISceneNodeList::Iterator it = Children.begin(); 802 ISceneNodeList::Iterator it = Children.begin();
803 for (; it != Children.end(); ++it) 803 for (; it != Children.end(); ++it)
804 (*it)->setSceneManager(newManager); 804 (*it)->setSceneManager(newManager);
805 } 805 }
806 806
807 //! Name of the scene node. 807 //! Name of the scene node.
808 core::stringc Name; 808 core::stringc Name;
809 809
810 //! Absolute transformation of the node. 810 //! Absolute transformation of the node.
811 core::matrix4 AbsoluteTransformation; 811 core::matrix4 AbsoluteTransformation;
812 812
813 //! Relative translation of the scene node. 813 //! Relative translation of the scene node.
814 core::vector3df RelativeTranslation; 814 core::vector3df RelativeTranslation;
815 815
816 //! Relative rotation of the scene node. 816 //! Relative rotation of the scene node.
817 core::vector3df RelativeRotation; 817 core::vector3df RelativeRotation;
818 818
819 //! Relative scale of the scene node. 819 //! Relative scale of the scene node.
820 core::vector3df RelativeScale; 820 core::vector3df RelativeScale;
821 821
822 //! Pointer to the parent 822 //! Pointer to the parent
823 ISceneNode* Parent; 823 ISceneNode* Parent;
824 824
825 //! List of all children of this node 825 //! List of all children of this node
826 core::list<ISceneNode*> Children; 826 core::list<ISceneNode*> Children;
827 827
828 //! List of all animator nodes 828 //! List of all animator nodes
829 core::list<ISceneNodeAnimator*> Animators; 829 core::list<ISceneNodeAnimator*> Animators;
830 830
831 //! Pointer to the scene manager 831 //! Pointer to the scene manager
832 ISceneManager* SceneManager; 832 ISceneManager* SceneManager;
833 833
834 //! Pointer to the triangle selector 834 //! Pointer to the triangle selector
835 ITriangleSelector* TriangleSelector; 835 ITriangleSelector* TriangleSelector;
836 836
837 //! ID of the node. 837 //! ID of the node.
838 s32 ID; 838 s32 ID;
839 839
840 //! Automatic culling state 840 //! Automatic culling state
841 u32 AutomaticCullingState; 841 u32 AutomaticCullingState;
842 842
843 //! Flag if debug data should be drawn, such as Bounding Boxes. 843 //! Flag if debug data should be drawn, such as Bounding Boxes.
844 u32 DebugDataVisible; 844 u32 DebugDataVisible;
845 845
846 //! Is the node visible? 846 //! Is the node visible?
847 bool IsVisible; 847 bool IsVisible;
848 848
849 //! Is debug object? 849 //! Is debug object?
850 bool IsDebugObject; 850 bool IsDebugObject;
851 }; 851 };
852 852
853 853
854} // end namespace scene 854} // end namespace scene
855} // end namespace irr 855} // end namespace irr
856 856
857#endif 857#endif
858 858
diff --git a/libraries/irrlicht-1.8/include/ISceneNodeAnimator.h b/libraries/irrlicht-1.8/include/ISceneNodeAnimator.h
index e03d975..c69474b 100644
--- a/libraries/irrlicht-1.8/include/ISceneNodeAnimator.h
+++ b/libraries/irrlicht-1.8/include/ISceneNodeAnimator.h
@@ -1,78 +1,78 @@
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#ifndef __I_SCENE_NODE_ANIMATOR_H_INCLUDED__ 5#ifndef __I_SCENE_NODE_ANIMATOR_H_INCLUDED__
6#define __I_SCENE_NODE_ANIMATOR_H_INCLUDED__ 6#define __I_SCENE_NODE_ANIMATOR_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "vector3d.h" 9#include "vector3d.h"
10#include "ESceneNodeAnimatorTypes.h" 10#include "ESceneNodeAnimatorTypes.h"
11#include "IAttributeExchangingObject.h" 11#include "IAttributeExchangingObject.h"
12#include "IEventReceiver.h" 12#include "IEventReceiver.h"
13 13
14namespace irr 14namespace irr
15{ 15{
16namespace io 16namespace io
17{ 17{
18 class IAttributes; 18 class IAttributes;
19} // end namespace io 19} // end namespace io
20namespace scene 20namespace scene
21{ 21{
22 class ISceneNode; 22 class ISceneNode;
23 class ISceneManager; 23 class ISceneManager;
24 24
25 //! Animates a scene node. Can animate position, rotation, material, and so on. 25 //! Animates a scene node. Can animate position, rotation, material, and so on.
26 /** A scene node animator is able to animate a scene node in a very simple way. It may 26 /** A scene node animator is able to animate a scene node in a very simple way. It may
27 change its position, rotation, scale and/or material. There are lots of animators 27 change its position, rotation, scale and/or material. There are lots of animators
28 to choose from. You can create scene node animators with the ISceneManager interface. 28 to choose from. You can create scene node animators with the ISceneManager interface.
29 */ 29 */
30 class ISceneNodeAnimator : public io::IAttributeExchangingObject, public IEventReceiver 30 class ISceneNodeAnimator : public io::IAttributeExchangingObject, public IEventReceiver
31 { 31 {
32 public: 32 public:
33 //! Animates a scene node. 33 //! Animates a scene node.
34 /** \param node Node to animate. 34 /** \param node Node to animate.
35 \param timeMs Current time in milli seconds. */ 35 \param timeMs Current time in milli seconds. */
36 virtual void animateNode(ISceneNode* node, u32 timeMs) =0; 36 virtual void animateNode(ISceneNode* node, u32 timeMs) =0;
37 37
38 //! Creates a clone of this animator. 38 //! Creates a clone of this animator.
39 /** Please note that you will have to drop 39 /** Please note that you will have to drop
40 (IReferenceCounted::drop()) the returned pointer after calling this. */ 40 (IReferenceCounted::drop()) the returned pointer after calling this. */
41 virtual ISceneNodeAnimator* createClone(ISceneNode* node, 41 virtual ISceneNodeAnimator* createClone(ISceneNode* node,
42 ISceneManager* newManager=0) =0; 42 ISceneManager* newManager=0) =0;
43 43
44 //! Returns true if this animator receives events. 44 //! Returns true if this animator receives events.
45 /** When attached to an active camera, this animator will be 45 /** When attached to an active camera, this animator will be
46 able to respond to events such as mouse and keyboard events. */ 46 able to respond to events such as mouse and keyboard events. */
47 virtual bool isEventReceiverEnabled() const 47 virtual bool isEventReceiverEnabled() const
48 { 48 {
49 return false; 49 return false;
50 } 50 }
51 51
52 //! Event receiver, override this function for camera controlling animators 52 //! Event receiver, override this function for camera controlling animators
53 virtual bool OnEvent(const SEvent& event) 53 virtual bool OnEvent(const SEvent& event)
54 { 54 {
55 return false; 55 return false;
56 } 56 }
57 57
58 //! Returns type of the scene node animator 58 //! Returns type of the scene node animator
59 virtual ESCENE_NODE_ANIMATOR_TYPE getType() const 59 virtual ESCENE_NODE_ANIMATOR_TYPE getType() const
60 { 60 {
61 return ESNAT_UNKNOWN; 61 return ESNAT_UNKNOWN;
62 } 62 }
63 63
64 //! Returns if the animator has finished. 64 //! Returns if the animator has finished.
65 /** This is only valid for non-looping animators with a discrete end state. 65 /** This is only valid for non-looping animators with a discrete end state.
66 \return true if the animator has finished, false if it is still running. */ 66 \return true if the animator has finished, false if it is still running. */
67 virtual bool hasFinished(void) const 67 virtual bool hasFinished(void) const
68 { 68 {
69 return false; 69 return false;
70 } 70 }
71 }; 71 };
72 72
73 73
74} // end namespace scene 74} // end namespace scene
75} // end namespace irr 75} // end namespace irr
76 76
77#endif 77#endif
78 78
diff --git a/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCameraFPS.h b/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCameraFPS.h
index 7b7a867..adfe9e9 100644
--- a/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCameraFPS.h
+++ b/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCameraFPS.h
@@ -1,69 +1,69 @@
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#ifndef __I_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__ 5#ifndef __I_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__
6#define __I_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__ 6#define __I_SCENE_NODE_ANIMATOR_CAMERA_FPS_H_INCLUDED__
7 7
8#include "ISceneNodeAnimator.h" 8#include "ISceneNodeAnimator.h"
9#include "IEventReceiver.h" 9#include "IEventReceiver.h"
10#include "irrArray.h" 10#include "irrArray.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14 struct SKeyMap; 14 struct SKeyMap;
15 15
16namespace scene 16namespace scene
17{ 17{
18 18
19 //! Special scene node animator for FPS cameras 19 //! Special scene node animator for FPS cameras
20 /** This scene node animator can be attached to a camera to make it act 20 /** This scene node animator can be attached to a camera to make it act
21 like a first person shooter 21 like a first person shooter
22 */ 22 */
23 class ISceneNodeAnimatorCameraFPS : public ISceneNodeAnimator 23 class ISceneNodeAnimatorCameraFPS : public ISceneNodeAnimator
24 { 24 {
25 public: 25 public:
26 26
27 //! Returns the speed of movement in units per millisecond 27 //! Returns the speed of movement in units per millisecond
28 virtual f32 getMoveSpeed() const = 0; 28 virtual f32 getMoveSpeed() const = 0;
29 29
30 //! Sets the speed of movement in units per millisecond 30 //! Sets the speed of movement in units per millisecond
31 virtual void setMoveSpeed(f32 moveSpeed) = 0; 31 virtual void setMoveSpeed(f32 moveSpeed) = 0;
32 32
33 //! Returns the rotation speed in degrees 33 //! Returns the rotation speed in degrees
34 /** The degrees are equivalent to a half screen movement of the mouse, 34 /** The degrees are equivalent to a half screen movement of the mouse,
35 i.e. if the mouse cursor had been moved to the border of the screen since 35 i.e. if the mouse cursor had been moved to the border of the screen since
36 the last animation. */ 36 the last animation. */
37 virtual f32 getRotateSpeed() const = 0; 37 virtual f32 getRotateSpeed() const = 0;
38 38
39 //! Set the rotation speed in degrees 39 //! Set the rotation speed in degrees
40 virtual void setRotateSpeed(f32 rotateSpeed) = 0; 40 virtual void setRotateSpeed(f32 rotateSpeed) = 0;
41 41
42 //! Sets the keyboard mapping for this animator (old style) 42 //! Sets the keyboard mapping for this animator (old style)
43 /** \param map Array of keyboard mappings, see irr::SKeyMap 43 /** \param map Array of keyboard mappings, see irr::SKeyMap
44 \param count Size of the keyboard map array. */ 44 \param count Size of the keyboard map array. */
45 virtual void setKeyMap(SKeyMap *map, u32 count) = 0; 45 virtual void setKeyMap(SKeyMap *map, u32 count) = 0;
46 46
47 //! Sets the keyboard mapping for this animator 47 //! Sets the keyboard mapping for this animator
48 //! \param keymap The new keymap array 48 //! \param keymap The new keymap array
49 virtual void setKeyMap(const core::array<SKeyMap>& keymap) = 0; 49 virtual void setKeyMap(const core::array<SKeyMap>& keymap) = 0;
50 50
51 //! Gets the keyboard mapping for this animator 51 //! Gets the keyboard mapping for this animator
52 virtual const core::array<SKeyMap>& getKeyMap() const = 0; 52 virtual const core::array<SKeyMap>& getKeyMap() const = 0;
53 53
54 //! Sets whether vertical movement should be allowed. 54 //! Sets whether vertical movement should be allowed.
55 /** If vertical movement is enabled then the camera may fight with 55 /** If vertical movement is enabled then the camera may fight with
56 gravity causing camera shake. Disable this if the camera has 56 gravity causing camera shake. Disable this if the camera has
57 a collision animator with gravity enabled. */ 57 a collision animator with gravity enabled. */
58 virtual void setVerticalMovement(bool allow) = 0; 58 virtual void setVerticalMovement(bool allow) = 0;
59 59
60 //! Sets whether the Y axis of the mouse should be inverted. 60 //! Sets whether the Y axis of the mouse should be inverted.
61 /** If enabled then moving the mouse down will cause 61 /** If enabled then moving the mouse down will cause
62 the camera to look up. It is disabled by default. */ 62 the camera to look up. It is disabled by default. */
63 virtual void setInvertMouse(bool invert) = 0; 63 virtual void setInvertMouse(bool invert) = 0;
64 }; 64 };
65} // end namespace scene 65} // end namespace scene
66} // end namespace irr 66} // end namespace irr
67 67
68#endif 68#endif
69 69
diff --git a/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCameraMaya.h b/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCameraMaya.h
index 94bd2e5..ebee950 100644
--- a/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCameraMaya.h
+++ b/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCameraMaya.h
@@ -1,58 +1,58 @@
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#ifndef __I_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__ 5#ifndef __I_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__
6#define __I_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__ 6#define __I_SCENE_NODE_ANIMATOR_CAMERA_MAYA_H_INCLUDED__
7 7
8#include "ISceneNodeAnimator.h" 8#include "ISceneNodeAnimator.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12 12
13namespace scene 13namespace scene
14{ 14{
15 15
16 //! Special scene node animator for Maya-style cameras 16 //! Special scene node animator for Maya-style cameras
17 /** This scene node animator can be attached to a camera to make it act like a 3d 17 /** This scene node animator can be attached to a camera to make it act like a 3d
18 modelling tool. 18 modelling tool.
19 The camera is moving relative to the target with the mouse, by pressing either 19 The camera is moving relative to the target with the mouse, by pressing either
20 of the three buttons. 20 of the three buttons.
21 In order to move the camera, set a new target for the camera. The distance defines 21 In order to move the camera, set a new target for the camera. The distance defines
22 the current orbit radius the camera moves on. Distance can be changed via the setter 22 the current orbit radius the camera moves on. Distance can be changed via the setter
23 or by mouse events. 23 or by mouse events.
24 */ 24 */
25 class ISceneNodeAnimatorCameraMaya : public ISceneNodeAnimator 25 class ISceneNodeAnimatorCameraMaya : public ISceneNodeAnimator
26 { 26 {
27 public: 27 public:
28 28
29 //! Returns the speed of movement 29 //! Returns the speed of movement
30 virtual f32 getMoveSpeed() const = 0; 30 virtual f32 getMoveSpeed() const = 0;
31 31
32 //! Sets the speed of movement 32 //! Sets the speed of movement
33 virtual void setMoveSpeed(f32 moveSpeed) = 0; 33 virtual void setMoveSpeed(f32 moveSpeed) = 0;
34 34
35 //! Returns the rotation speed 35 //! Returns the rotation speed
36 virtual f32 getRotateSpeed() const = 0; 36 virtual f32 getRotateSpeed() const = 0;
37 37
38 //! Set the rotation speed 38 //! Set the rotation speed
39 virtual void setRotateSpeed(f32 rotateSpeed) = 0; 39 virtual void setRotateSpeed(f32 rotateSpeed) = 0;
40 40
41 //! Returns the zoom speed 41 //! Returns the zoom speed
42 virtual f32 getZoomSpeed() const = 0; 42 virtual f32 getZoomSpeed() const = 0;
43 43
44 //! Set the zoom speed 44 //! Set the zoom speed
45 virtual void setZoomSpeed(f32 zoomSpeed) = 0; 45 virtual void setZoomSpeed(f32 zoomSpeed) = 0;
46 46
47 //! Returns the current distance, i.e. orbit radius 47 //! Returns the current distance, i.e. orbit radius
48 virtual f32 getDistance() const = 0; 48 virtual f32 getDistance() const = 0;
49 49
50 //! Set the distance 50 //! Set the distance
51 virtual void setDistance(f32 distance) = 0; 51 virtual void setDistance(f32 distance) = 0;
52 }; 52 };
53 53
54} // end namespace scene 54} // end namespace scene
55} // end namespace irr 55} // end namespace irr
56 56
57#endif 57#endif
58 58
diff --git a/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCollisionResponse.h b/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCollisionResponse.h
index 299c0a7..e2bba8a 100644
--- a/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCollisionResponse.h
+++ b/libraries/irrlicht-1.8/include/ISceneNodeAnimatorCollisionResponse.h
@@ -1,171 +1,171 @@
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#ifndef __I_SCENE_NODE_ANIMATOR_COLLISION_RESPONSE_H_INCLUDED__ 5#ifndef __I_SCENE_NODE_ANIMATOR_COLLISION_RESPONSE_H_INCLUDED__
6#define __I_SCENE_NODE_ANIMATOR_COLLISION_RESPONSE_H_INCLUDED__ 6#define __I_SCENE_NODE_ANIMATOR_COLLISION_RESPONSE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15 class ISceneNodeAnimatorCollisionResponse; 15 class ISceneNodeAnimatorCollisionResponse;
16 16
17 //! Callback interface for catching events of collisions. 17 //! Callback interface for catching events of collisions.
18 /** Implement this interface and use 18 /** Implement this interface and use
19 ISceneNodeAnimatorCollisionResponse::setCollisionCallback to be able to 19 ISceneNodeAnimatorCollisionResponse::setCollisionCallback to be able to
20 be notified if a collision has occurred. 20 be notified if a collision has occurred.
21 **/ 21 **/
22 class ICollisionCallback : public virtual IReferenceCounted 22 class ICollisionCallback : public virtual IReferenceCounted
23 { 23 {
24 public: 24 public:
25 25
26 //! Will be called when a collision occurrs. 26 //! Will be called when a collision occurrs.
27 /** See ISceneNodeAnimatorCollisionResponse::setCollisionCallback for more information. 27 /** See ISceneNodeAnimatorCollisionResponse::setCollisionCallback for more information.
28 \param animator: Collision response animator in which the collision occurred. You can call 28 \param animator: Collision response animator in which the collision occurred. You can call
29 this animator's methods to find the node, collisionPoint and/or collision triangle. 29 this animator's methods to find the node, collisionPoint and/or collision triangle.
30 \retval true if the collision was handled in the animator. The animator's target 30 \retval true if the collision was handled in the animator. The animator's target
31 node will *not* be stopped at the collision point, but will instead move fully 31 node will *not* be stopped at the collision point, but will instead move fully
32 to the location that triggered the collision check. 32 to the location that triggered the collision check.
33 \retval false if the collision was not handled in the animator. The animator's 33 \retval false if the collision was not handled in the animator. The animator's
34 target node will be moved to the collision position. 34 target node will be moved to the collision position.
35 */ 35 */
36 virtual bool onCollision(const ISceneNodeAnimatorCollisionResponse& animator) = 0; 36 virtual bool onCollision(const ISceneNodeAnimatorCollisionResponse& animator) = 0;
37 }; 37 };
38 38
39 //! Special scene node animator for doing automatic collision detection and response. 39 //! Special scene node animator for doing automatic collision detection and response.
40 /** This scene node animator can be attached to any single scene node 40 /** This scene node animator can be attached to any single scene node
41 and will then prevent it from moving through specified collision geometry 41 and will then prevent it from moving through specified collision geometry
42 (e.g. walls and floors of the) world, as well as having it fall under gravity. 42 (e.g. walls and floors of the) world, as well as having it fall under gravity.
43 This animator provides a simple implementation of first person shooter cameras. 43 This animator provides a simple implementation of first person shooter cameras.
44 Attach it to a camera, and the camera will behave as the player control in a 44 Attach it to a camera, and the camera will behave as the player control in a
45 first person shooter game: The camera stops and slides at walls, walks up stairs, 45 first person shooter game: The camera stops and slides at walls, walks up stairs,
46 falls down if there is no floor under it, and so on. 46 falls down if there is no floor under it, and so on.
47 47
48 The animator will treat any change in the position of its target scene 48 The animator will treat any change in the position of its target scene
49 node as movement, including a setPosition(), as movement. If you want to 49 node as movement, including a setPosition(), as movement. If you want to
50 teleport the target scene node manually to a location without it being effected 50 teleport the target scene node manually to a location without it being effected
51 by collision geometry, then call setTargetNode(node) after calling node->setPosition(). 51 by collision geometry, then call setTargetNode(node) after calling node->setPosition().
52 */ 52 */
53 class ISceneNodeAnimatorCollisionResponse : public ISceneNodeAnimator 53 class ISceneNodeAnimatorCollisionResponse : public ISceneNodeAnimator
54 { 54 {
55 public: 55 public:
56 56
57 //! Destructor 57 //! Destructor
58 virtual ~ISceneNodeAnimatorCollisionResponse() {} 58 virtual ~ISceneNodeAnimatorCollisionResponse() {}
59 59
60 //! Check if the attached scene node is falling. 60 //! Check if the attached scene node is falling.
61 /** Falling means that there is no blocking wall from the scene 61 /** Falling means that there is no blocking wall from the scene
62 node in the direction of the gravity. The implementation of 62 node in the direction of the gravity. The implementation of
63 this method is very fast, no collision detection is done when 63 this method is very fast, no collision detection is done when
64 invoking it. 64 invoking it.
65 \return True if the scene node is falling, false if not. */ 65 \return True if the scene node is falling, false if not. */
66 virtual bool isFalling() const = 0; 66 virtual bool isFalling() const = 0;
67 67
68 //! Sets the radius of the ellipsoid for collision detection and response. 68 //! Sets the radius of the ellipsoid for collision detection and response.
69 /** If you have a scene node, and you are unsure about how big 69 /** If you have a scene node, and you are unsure about how big
70 the radius should be, you could use the following code to 70 the radius should be, you could use the following code to
71 determine it: 71 determine it:
72 \code 72 \code
73 core::aabbox<f32> box = yourSceneNode->getBoundingBox(); 73 core::aabbox<f32> box = yourSceneNode->getBoundingBox();
74 core::vector3df radius = box.MaxEdge - box.getCenter(); 74 core::vector3df radius = box.MaxEdge - box.getCenter();
75 \endcode 75 \endcode
76 \param radius: New radius of the ellipsoid. */ 76 \param radius: New radius of the ellipsoid. */
77 virtual void setEllipsoidRadius(const core::vector3df& radius) = 0; 77 virtual void setEllipsoidRadius(const core::vector3df& radius) = 0;
78 78
79 //! Returns the radius of the ellipsoid for collision detection and response. 79 //! Returns the radius of the ellipsoid for collision detection and response.
80 /** \return Radius of the ellipsoid. */ 80 /** \return Radius of the ellipsoid. */
81 virtual core::vector3df getEllipsoidRadius() const = 0; 81 virtual core::vector3df getEllipsoidRadius() const = 0;
82 82
83 //! Sets the gravity of the environment. 83 //! Sets the gravity of the environment.
84 /** A good example value would be core::vector3df(0,-100.0f,0) 84 /** A good example value would be core::vector3df(0,-100.0f,0)
85 for letting gravity affect all object to fall down. For bigger 85 for letting gravity affect all object to fall down. For bigger
86 gravity, make increase the length of the vector. You can 86 gravity, make increase the length of the vector. You can
87 disable gravity by setting it to core::vector3df(0,0,0); 87 disable gravity by setting it to core::vector3df(0,0,0);
88 \param gravity: New gravity vector. */ 88 \param gravity: New gravity vector. */
89 virtual void setGravity(const core::vector3df& gravity) = 0; 89 virtual void setGravity(const core::vector3df& gravity) = 0;
90 90
91 //! Get current vector of gravity. 91 //! Get current vector of gravity.
92 //! \return Gravity vector. */ 92 //! \return Gravity vector. */
93 virtual core::vector3df getGravity() const = 0; 93 virtual core::vector3df getGravity() const = 0;
94 94
95 //! 'Jump' the animator, by adding a jump speed opposite to its gravity 95 //! 'Jump' the animator, by adding a jump speed opposite to its gravity
96 /** \param jumpSpeed The initial speed of the jump; the velocity will be opposite 96 /** \param jumpSpeed The initial speed of the jump; the velocity will be opposite
97 to this animator's gravity vector. */ 97 to this animator's gravity vector. */
98 virtual void jump(f32 jumpSpeed) = 0; 98 virtual void jump(f32 jumpSpeed) = 0;
99 99
100 //! Should the Target react on collision ( default = true ) 100 //! Should the Target react on collision ( default = true )
101 virtual void setAnimateTarget ( bool enable ) = 0; 101 virtual void setAnimateTarget ( bool enable ) = 0;
102 virtual bool getAnimateTarget () const = 0; 102 virtual bool getAnimateTarget () const = 0;
103 103
104 //! Set translation of the collision ellipsoid. 104 //! Set translation of the collision ellipsoid.
105 /** By default, the ellipsoid for collision detection is 105 /** By default, the ellipsoid for collision detection is
106 created around the center of the scene node, which means that 106 created around the center of the scene node, which means that
107 the ellipsoid surrounds it completely. If this is not what you 107 the ellipsoid surrounds it completely. If this is not what you
108 want, you may specify a translation for the ellipsoid. 108 want, you may specify a translation for the ellipsoid.
109 \param translation: Translation of the ellipsoid relative 109 \param translation: Translation of the ellipsoid relative
110 to the position of the scene node. */ 110 to the position of the scene node. */
111 virtual void setEllipsoidTranslation(const core::vector3df &translation) = 0; 111 virtual void setEllipsoidTranslation(const core::vector3df &translation) = 0;
112 112
113 //! Get the translation of the ellipsoid for collision detection. 113 //! Get the translation of the ellipsoid for collision detection.
114 /** See 114 /** See
115 ISceneNodeAnimatorCollisionResponse::setEllipsoidTranslation() 115 ISceneNodeAnimatorCollisionResponse::setEllipsoidTranslation()
116 for more details. 116 for more details.
117 \return Translation of the ellipsoid relative to the position 117 \return Translation of the ellipsoid relative to the position
118 of the scene node. */ 118 of the scene node. */
119 virtual core::vector3df getEllipsoidTranslation() const = 0; 119 virtual core::vector3df getEllipsoidTranslation() const = 0;
120 120
121 //! Sets a triangle selector holding all triangles of the world with which the scene node may collide. 121 //! Sets a triangle selector holding all triangles of the world with which the scene node may collide.
122 /** \param newWorld: New triangle selector containing triangles 122 /** \param newWorld: New triangle selector containing triangles
123 to let the scene node collide with. */ 123 to let the scene node collide with. */
124 virtual void setWorld(ITriangleSelector* newWorld) = 0; 124 virtual void setWorld(ITriangleSelector* newWorld) = 0;
125 125
126 //! Get the current triangle selector containing all triangles for collision detection. 126 //! Get the current triangle selector containing all triangles for collision detection.
127 virtual ITriangleSelector* getWorld() const = 0; 127 virtual ITriangleSelector* getWorld() const = 0;
128 128
129 //! Set the single node that this animator will act on. 129 //! Set the single node that this animator will act on.
130 /** \param node The new target node. Setting this will force the animator to update 130 /** \param node The new target node. Setting this will force the animator to update
131 its last target position for the node, allowing setPosition() to teleport 131 its last target position for the node, allowing setPosition() to teleport
132 the node through collision geometry. */ 132 the node through collision geometry. */
133 virtual void setTargetNode(ISceneNode * node) = 0; 133 virtual void setTargetNode(ISceneNode * node) = 0;
134 134
135 //! Gets the single node that this animator is acting on. 135 //! Gets the single node that this animator is acting on.
136 /** \return The node that this animator is acting on. */ 136 /** \return The node that this animator is acting on. */
137 virtual ISceneNode* getTargetNode(void) const = 0; 137 virtual ISceneNode* getTargetNode(void) const = 0;
138 138
139 //! Returns true if a collision occurred during the last animateNode() 139 //! Returns true if a collision occurred during the last animateNode()
140 virtual bool collisionOccurred() const = 0; 140 virtual bool collisionOccurred() const = 0;
141 141
142 //! Returns the last point of collision. 142 //! Returns the last point of collision.
143 virtual const core::vector3df & getCollisionPoint() const = 0; 143 virtual const core::vector3df & getCollisionPoint() const = 0;
144 144
145 //! Returns the last triangle that caused a collision 145 //! Returns the last triangle that caused a collision
146 virtual const core::triangle3df & getCollisionTriangle() const = 0; 146 virtual const core::triangle3df & getCollisionTriangle() const = 0;
147 147
148 //! Returns the position that the target node will be moved to, unless the collision is consumed in a callback. 148 //! Returns the position that the target node will be moved to, unless the collision is consumed in a callback.
149 /** 149 /**
150 If you have a collision callback registered, and it consumes the collision, then the 150 If you have a collision callback registered, and it consumes the collision, then the
151 node will ignore the collision and will not stop at this position. Instead, it will 151 node will ignore the collision and will not stop at this position. Instead, it will
152 move fully to the position that caused the collision to occur. */ 152 move fully to the position that caused the collision to occur. */
153 virtual const core::vector3df & getCollisionResultPosition(void) const = 0; 153 virtual const core::vector3df & getCollisionResultPosition(void) const = 0;
154 154
155 //! Returns the node that was collided with. 155 //! Returns the node that was collided with.
156 virtual ISceneNode* getCollisionNode(void) const = 0; 156 virtual ISceneNode* getCollisionNode(void) const = 0;
157 157
158 //! Sets a callback interface which will be called if a collision occurs. 158 //! Sets a callback interface which will be called if a collision occurs.
159 /** \param callback: collision callback handler that will be called when a collision 159 /** \param callback: collision callback handler that will be called when a collision
160 occurs. Set this to 0 to disable the callback. 160 occurs. Set this to 0 to disable the callback.
161 */ 161 */
162 virtual void setCollisionCallback(ICollisionCallback* callback) = 0; 162 virtual void setCollisionCallback(ICollisionCallback* callback) = 0;
163 163
164 }; 164 };
165 165
166 166
167} // end namespace scene 167} // end namespace scene
168} // end namespace irr 168} // end namespace irr
169 169
170#endif 170#endif
171 171
diff --git a/libraries/irrlicht-1.8/include/ISceneNodeAnimatorFactory.h b/libraries/irrlicht-1.8/include/ISceneNodeAnimatorFactory.h
index c3f5b3c..8afe3ef 100644
--- a/libraries/irrlicht-1.8/include/ISceneNodeAnimatorFactory.h
+++ b/libraries/irrlicht-1.8/include/ISceneNodeAnimatorFactory.h
@@ -1,69 +1,69 @@
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#ifndef __I_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__ 5#ifndef __I_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__
6#define __I_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__ 6#define __I_SCENE_NODE_ANIMATOR_FACTORY_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "ESceneNodeAnimatorTypes.h" 9#include "ESceneNodeAnimatorTypes.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 class ISceneNode; 15 class ISceneNode;
16 class ISceneNodeAnimator; 16 class ISceneNodeAnimator;
17 17
18 //! Interface for dynamic creation of scene node animators 18 //! Interface for dynamic creation of scene node animators
19 /** To be able to add custom scene node animators to Irrlicht and to make it possible for the 19 /** To be able to add custom scene node animators to Irrlicht and to make it possible for the
20 scene manager to save and load those external animators, simply implement this 20 scene manager to save and load those external animators, simply implement this
21 interface and register it in you scene manager via ISceneManager::registerSceneNodeAnimatorFactory. 21 interface and register it in you scene manager via ISceneManager::registerSceneNodeAnimatorFactory.
22 Note: When implementing your own scene node factory, don't call ISceneNodeManager::grab() to 22 Note: When implementing your own scene node factory, don't call ISceneNodeManager::grab() to
23 increase the reference counter of the scene node manager. This is not necessary because the 23 increase the reference counter of the scene node manager. This is not necessary because the
24 scene node manager will grab() the factory anyway, and otherwise cyclic references will 24 scene node manager will grab() the factory anyway, and otherwise cyclic references will
25 be created and the scene manager and all its nodes won't get deallocated. 25 be created and the scene manager and all its nodes won't get deallocated.
26 */ 26 */
27 class ISceneNodeAnimatorFactory : public virtual IReferenceCounted 27 class ISceneNodeAnimatorFactory : public virtual IReferenceCounted
28 { 28 {
29 public: 29 public:
30 30
31 //! creates a scene node animator based on its type id 31 //! creates a scene node animator based on its type id
32 /** \param type: Type of the scene node animator to add. 32 /** \param type: Type of the scene node animator to add.
33 \param target: Target scene node of the new animator. 33 \param target: Target scene node of the new animator.
34 \return Returns pointer to the new scene node animator or null if not successful. You need to 34 \return Returns pointer to the new scene node animator or null if not successful. You need to
35 drop this pointer after calling this, see IReferenceCounted::drop() for details. */ 35 drop this pointer after calling this, see IReferenceCounted::drop() for details. */
36 virtual ISceneNodeAnimator* createSceneNodeAnimator(ESCENE_NODE_ANIMATOR_TYPE type, ISceneNode* target) = 0; 36 virtual ISceneNodeAnimator* createSceneNodeAnimator(ESCENE_NODE_ANIMATOR_TYPE type, ISceneNode* target) = 0;
37 37
38 //! creates a scene node animator based on its type name 38 //! creates a scene node animator based on its type name
39 /** \param typeName: Type of the scene node animator to add. 39 /** \param typeName: Type of the scene node animator to add.
40 \param target: Target scene node of the new animator. 40 \param target: Target scene node of the new animator.
41 \return Returns pointer to the new scene node animator or null if not successful. You need to 41 \return Returns pointer to the new scene node animator or null if not successful. You need to
42 drop this pointer after calling this, see IReferenceCounted::drop() for details. */ 42 drop this pointer after calling this, see IReferenceCounted::drop() for details. */
43 virtual ISceneNodeAnimator* createSceneNodeAnimator(const c8* typeName, ISceneNode* target) = 0; 43 virtual ISceneNodeAnimator* createSceneNodeAnimator(const c8* typeName, ISceneNode* target) = 0;
44 44
45 //! returns amount of scene node animator types this factory is able to create 45 //! returns amount of scene node animator types this factory is able to create
46 virtual u32 getCreatableSceneNodeAnimatorTypeCount() const = 0; 46 virtual u32 getCreatableSceneNodeAnimatorTypeCount() const = 0;
47 47
48 //! returns type of a createable scene node animator type 48 //! returns type of a createable scene node animator type
49 /** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and 49 /** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and
50 getCreatableSceneNodeTypeCount() */ 50 getCreatableSceneNodeTypeCount() */
51 virtual ESCENE_NODE_ANIMATOR_TYPE getCreateableSceneNodeAnimatorType(u32 idx) const = 0; 51 virtual ESCENE_NODE_ANIMATOR_TYPE getCreateableSceneNodeAnimatorType(u32 idx) const = 0;
52 52
53 //! returns type name of a createable scene node animator type 53 //! returns type name of a createable scene node animator type
54 /** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and 54 /** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and
55 getCreatableSceneNodeAnimatorTypeCount() */ 55 getCreatableSceneNodeAnimatorTypeCount() */
56 virtual const c8* getCreateableSceneNodeAnimatorTypeName(u32 idx) const = 0; 56 virtual const c8* getCreateableSceneNodeAnimatorTypeName(u32 idx) const = 0;
57 57
58 //! returns type name of a createable scene node animator type 58 //! returns type name of a createable scene node animator type
59 /** \param type: Type of scene node animator. 59 /** \param type: Type of scene node animator.
60 \return: Returns name of scene node animator type if this factory can create the type, otherwise 0. */ 60 \return: Returns name of scene node animator type if this factory can create the type, otherwise 0. */
61 virtual const c8* getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const = 0; 61 virtual const c8* getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const = 0;
62 }; 62 };
63 63
64 64
65} // end namespace scene 65} // end namespace scene
66} // end namespace irr 66} // end namespace irr
67 67
68#endif 68#endif
69 69
diff --git a/libraries/irrlicht-1.8/include/ISceneNodeFactory.h b/libraries/irrlicht-1.8/include/ISceneNodeFactory.h
index 5359d2b..247b47b 100644
--- a/libraries/irrlicht-1.8/include/ISceneNodeFactory.h
+++ b/libraries/irrlicht-1.8/include/ISceneNodeFactory.h
@@ -1,68 +1,68 @@
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#ifndef __I_SCENE_NODE_FACTORY_H_INCLUDED__ 5#ifndef __I_SCENE_NODE_FACTORY_H_INCLUDED__
6#define __I_SCENE_NODE_FACTORY_H_INCLUDED__ 6#define __I_SCENE_NODE_FACTORY_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "ESceneNodeTypes.h" 9#include "ESceneNodeTypes.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13 13
14namespace scene 14namespace scene
15{ 15{
16 class ISceneNode; 16 class ISceneNode;
17 17
18 //! Interface for dynamic creation of scene nodes 18 //! Interface for dynamic creation of scene nodes
19 /** To be able to add custom scene nodes to Irrlicht and to make it possible for the 19 /** To be able to add custom scene nodes to Irrlicht and to make it possible for the
20 scene manager to save and load those external scene nodes, simply implement this 20 scene manager to save and load those external scene nodes, simply implement this
21 interface and register it in you scene manager via ISceneManager::registerSceneNodeFactory. 21 interface and register it in you scene manager via ISceneManager::registerSceneNodeFactory.
22 Note: When implementing your own scene node factory, don't call ISceneNodeManager::grab() to 22 Note: When implementing your own scene node factory, don't call ISceneNodeManager::grab() to
23 increase the reference counter of the scene node manager. This is not necessary because the 23 increase the reference counter of the scene node manager. This is not necessary because the
24 scene node manager will grab() the factory anyway, and otherwise cyclic references will 24 scene node manager will grab() the factory anyway, and otherwise cyclic references will
25 be created and the scene manager and all its nodes won't get deallocated. 25 be created and the scene manager and all its nodes won't get deallocated.
26 */ 26 */
27 class ISceneNodeFactory : public virtual IReferenceCounted 27 class ISceneNodeFactory : public virtual IReferenceCounted
28 { 28 {
29 public: 29 public:
30 //! adds a scene node to the scene graph based on its type id 30 //! adds a scene node to the scene graph based on its type id
31 /** \param type: Type of the scene node to add. 31 /** \param type: Type of the scene node to add.
32 \param parent: Parent scene node of the new node, can be null to add the scene node to the root. 32 \param parent: Parent scene node of the new node, can be null to add the scene node to the root.
33 \return Returns pointer to the new scene node or null if not successful. 33 \return Returns pointer to the new scene node or null if not successful.
34 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 34 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
35 virtual ISceneNode* addSceneNode(ESCENE_NODE_TYPE type, ISceneNode* parent=0) = 0; 35 virtual ISceneNode* addSceneNode(ESCENE_NODE_TYPE type, ISceneNode* parent=0) = 0;
36 36
37 //! adds a scene node to the scene graph based on its type name 37 //! adds a scene node to the scene graph based on its type name
38 /** \param typeName: Type name of the scene node to add. 38 /** \param typeName: Type name of the scene node to add.
39 \param parent: Parent scene node of the new node, can be null to add the scene node to the root. 39 \param parent: Parent scene node of the new node, can be null to add the scene node to the root.
40 \return Returns pointer to the new scene node or null if not successful. 40 \return Returns pointer to the new scene node or null if not successful.
41 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ 41 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
42 virtual ISceneNode* addSceneNode(const c8* typeName, ISceneNode* parent=0) = 0; 42 virtual ISceneNode* addSceneNode(const c8* typeName, ISceneNode* parent=0) = 0;
43 43
44 //! returns amount of scene node types this factory is able to create 44 //! returns amount of scene node types this factory is able to create
45 virtual u32 getCreatableSceneNodeTypeCount() const = 0; 45 virtual u32 getCreatableSceneNodeTypeCount() const = 0;
46 46
47 //! returns type of a createable scene node type 47 //! returns type of a createable scene node type
48 /** \param idx: Index of scene node type in this factory. Must be a value between 0 and 48 /** \param idx: Index of scene node type in this factory. Must be a value between 0 and
49 getCreatableSceneNodeTypeCount() */ 49 getCreatableSceneNodeTypeCount() */
50 virtual ESCENE_NODE_TYPE getCreateableSceneNodeType(u32 idx) const = 0; 50 virtual ESCENE_NODE_TYPE getCreateableSceneNodeType(u32 idx) const = 0;
51 51
52 //! returns type name of a createable scene node type by index 52 //! returns type name of a createable scene node type by index
53 /** \param idx: Index of scene node type in this factory. Must be a value between 0 and 53 /** \param idx: Index of scene node type in this factory. Must be a value between 0 and
54 getCreatableSceneNodeTypeCount() */ 54 getCreatableSceneNodeTypeCount() */
55 virtual const c8* getCreateableSceneNodeTypeName(u32 idx) const = 0; 55 virtual const c8* getCreateableSceneNodeTypeName(u32 idx) const = 0;
56 56
57 //! returns type name of a createable scene node type 57 //! returns type name of a createable scene node type
58 /** \param type: Type of scene node. 58 /** \param type: Type of scene node.
59 \return: Returns name of scene node type if this factory can create the type, otherwise 0. */ 59 \return: Returns name of scene node type if this factory can create the type, otherwise 0. */
60 virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) const = 0; 60 virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) const = 0;
61 }; 61 };
62 62
63 63
64} // end namespace scene 64} // end namespace scene
65} // end namespace irr 65} // end namespace irr
66 66
67#endif 67#endif
68 68
diff --git a/libraries/irrlicht-1.8/include/ISceneUserDataSerializer.h b/libraries/irrlicht-1.8/include/ISceneUserDataSerializer.h
index 309443b..0e63440 100644
--- a/libraries/irrlicht-1.8/include/ISceneUserDataSerializer.h
+++ b/libraries/irrlicht-1.8/include/ISceneUserDataSerializer.h
@@ -1,51 +1,51 @@
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#ifndef __I_SCENE_USER_DATA_SERIALIZER_H_INCLUDED__ 5#ifndef __I_SCENE_USER_DATA_SERIALIZER_H_INCLUDED__
6#define __I_SCENE_USER_DATA_SERIALIZER_H_INCLUDED__ 6#define __I_SCENE_USER_DATA_SERIALIZER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace io 12namespace io
13{ 13{
14 class IAttributes; 14 class IAttributes;
15} // end namespace io 15} // end namespace io
16namespace scene 16namespace scene
17{ 17{
18 class ISceneNode; 18 class ISceneNode;
19 19
20//! Interface to read and write user data to and from .irr files. 20//! Interface to read and write user data to and from .irr files.
21/** This interface is to be implemented by the user, to make it possible to read 21/** This interface is to be implemented by the user, to make it possible to read
22and write user data when reading or writing .irr files via ISceneManager. 22and write user data when reading or writing .irr files via ISceneManager.
23To be used with ISceneManager::loadScene() and ISceneManager::saveScene() */ 23To be used with ISceneManager::loadScene() and ISceneManager::saveScene() */
24class ISceneUserDataSerializer 24class ISceneUserDataSerializer
25{ 25{
26public: 26public:
27 27
28 virtual ~ISceneUserDataSerializer() {} 28 virtual ~ISceneUserDataSerializer() {}
29 29
30 //! Called when the scene manager create a scene node while loading a file. 30 //! Called when the scene manager create a scene node while loading a file.
31 virtual void OnCreateNode(ISceneNode* node) = 0; 31 virtual void OnCreateNode(ISceneNode* node) = 0;
32 32
33 //! Called when the scene manager read a scene node while loading a file. 33 //! Called when the scene manager read a scene node while loading a file.
34 /** The userData pointer contains a list of attributes with userData which 34 /** The userData pointer contains a list of attributes with userData which
35 were attached to the scene node in the read scene file.*/ 35 were attached to the scene node in the read scene file.*/
36 virtual void OnReadUserData(ISceneNode* forSceneNode, io::IAttributes* userData) = 0; 36 virtual void OnReadUserData(ISceneNode* forSceneNode, io::IAttributes* userData) = 0;
37 37
38 //! Called when the scene manager is writing a scene node to an xml file for example. 38 //! Called when the scene manager is writing a scene node to an xml file for example.
39 /** Implement this method and return a list of attributes containing the user data 39 /** Implement this method and return a list of attributes containing the user data
40 you want to be saved together with the scene node. Return 0 if no user data should 40 you want to be saved together with the scene node. Return 0 if no user data should
41 be added. Please note that the scene manager will call drop() to the returned pointer 41 be added. Please note that the scene manager will call drop() to the returned pointer
42 after it no longer needs it, so if you didn't create a new object for the return value 42 after it no longer needs it, so if you didn't create a new object for the return value
43 and returning a longer existing IAttributes object, simply call grab() before returning it. */ 43 and returning a longer existing IAttributes object, simply call grab() before returning it. */
44 virtual io::IAttributes* createUserData(ISceneNode* forSceneNode) = 0; 44 virtual io::IAttributes* createUserData(ISceneNode* forSceneNode) = 0;
45}; 45};
46 46
47} // end namespace scene 47} // end namespace scene
48} // end namespace irr 48} // end namespace irr
49 49
50#endif 50#endif
51 51
diff --git a/libraries/irrlicht-1.8/include/IShaderConstantSetCallBack.h b/libraries/irrlicht-1.8/include/IShaderConstantSetCallBack.h
index fdf9e9a..f88393f 100644
--- a/libraries/irrlicht-1.8/include/IShaderConstantSetCallBack.h
+++ b/libraries/irrlicht-1.8/include/IShaderConstantSetCallBack.h
@@ -1,85 +1,85 @@
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#ifndef __I_SHADER_CONSTANT_SET_CALLBACT_H_INCLUDED__ 5#ifndef __I_SHADER_CONSTANT_SET_CALLBACT_H_INCLUDED__
6#define __I_SHADER_CONSTANT_SET_CALLBACT_H_INCLUDED__ 6#define __I_SHADER_CONSTANT_SET_CALLBACT_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace video 12namespace video
13{ 13{
14 class IMaterialRendererServices; 14 class IMaterialRendererServices;
15 class SMaterial; 15 class SMaterial;
16 16
17//! Interface making it possible to set constants for gpu programs every frame. 17//! Interface making it possible to set constants for gpu programs every frame.
18/** Implement this interface in an own class and pass a pointer to it to one of 18/** Implement this interface in an own class and pass a pointer to it to one of
19the methods in IGPUProgrammingServices when creating a shader. The 19the methods in IGPUProgrammingServices when creating a shader. The
20OnSetConstants method will be called every frame now. */ 20OnSetConstants method will be called every frame now. */
21class IShaderConstantSetCallBack : public virtual IReferenceCounted 21class IShaderConstantSetCallBack : public virtual IReferenceCounted
22{ 22{
23public: 23public:
24 24
25 //! Called to let the callBack know the used material (optional method) 25 //! Called to let the callBack know the used material (optional method)
26 /** 26 /**
27 \code 27 \code
28 class MyCallBack : public IShaderConstantSetCallBack 28 class MyCallBack : public IShaderConstantSetCallBack
29 { 29 {
30 const video::SMaterial *UsedMaterial; 30 const video::SMaterial *UsedMaterial;
31 31
32 OnSetMaterial(const video::SMaterial& material) 32 OnSetMaterial(const video::SMaterial& material)
33 { 33 {
34 UsedMaterial=&material; 34 UsedMaterial=&material;
35 } 35 }
36 36
37 OnSetConstants(IMaterialRendererServices* services, s32 userData) 37 OnSetConstants(IMaterialRendererServices* services, s32 userData)
38 { 38 {
39 services->setVertexShaderConstant("myColor", reinterpret_cast<f32*>(&UsedMaterial->color), 4); 39 services->setVertexShaderConstant("myColor", reinterpret_cast<f32*>(&UsedMaterial->color), 4);
40 } 40 }
41 } 41 }
42 \endcode 42 \endcode
43 */ 43 */
44 virtual void OnSetMaterial(const SMaterial& material) { } 44 virtual void OnSetMaterial(const SMaterial& material) { }
45 45
46 //! Called by the engine when the vertex and/or pixel shader constants for an material renderer should be set. 46 //! Called by the engine when the vertex and/or pixel shader constants for an material renderer should be set.
47 /** 47 /**
48 Implement the IShaderConstantSetCallBack in an own class and implement your own 48 Implement the IShaderConstantSetCallBack in an own class and implement your own
49 OnSetConstants method using the given IMaterialRendererServices interface. 49 OnSetConstants method using the given IMaterialRendererServices interface.
50 Pass a pointer to this class to one of the methods in IGPUProgrammingServices 50 Pass a pointer to this class to one of the methods in IGPUProgrammingServices
51 when creating a shader. The OnSetConstants method will now be called every time 51 when creating a shader. The OnSetConstants method will now be called every time
52 before geometry is being drawn using your shader material. A sample implementation 52 before geometry is being drawn using your shader material. A sample implementation
53 would look like this: 53 would look like this:
54 \code 54 \code
55 virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData) 55 virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
56 { 56 {
57 video::IVideoDriver* driver = services->getVideoDriver(); 57 video::IVideoDriver* driver = services->getVideoDriver();
58 58
59 // set clip matrix at register 4 59 // set clip matrix at register 4
60 core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION)); 60 core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION));
61 worldViewProj *= driver->getTransform(video::ETS_VIEW); 61 worldViewProj *= driver->getTransform(video::ETS_VIEW);
62 worldViewProj *= driver->getTransform(video::ETS_WORLD); 62 worldViewProj *= driver->getTransform(video::ETS_WORLD);
63 services->setVertexShaderConstant(&worldViewProj.M[0], 4, 4); 63 services->setVertexShaderConstant(&worldViewProj.M[0], 4, 4);
64 // for high level shading languages, this would be another solution: 64 // for high level shading languages, this would be another solution:
65 //services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16); 65 //services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
66 66
67 // set some light color at register 9 67 // set some light color at register 9
68 video::SColorf col(0.0f,1.0f,1.0f,0.0f); 68 video::SColorf col(0.0f,1.0f,1.0f,0.0f);
69 services->setVertexShaderConstant(reinterpret_cast<const f32*>(&col), 9, 1); 69 services->setVertexShaderConstant(reinterpret_cast<const f32*>(&col), 9, 1);
70 // for high level shading languages, this would be another solution: 70 // for high level shading languages, this would be another solution:
71 //services->setVertexShaderConstant("myColor", reinterpret_cast<f32*>(&col), 4); 71 //services->setVertexShaderConstant("myColor", reinterpret_cast<f32*>(&col), 4);
72 } 72 }
73 \endcode 73 \endcode
74 \param services: Pointer to an interface providing methods to set the constants for the shader. 74 \param services: Pointer to an interface providing methods to set the constants for the shader.
75 \param userData: Userdata int which can be specified when creating the shader. 75 \param userData: Userdata int which can be specified when creating the shader.
76 */ 76 */
77 virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData) = 0; 77 virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData) = 0;
78}; 78};
79 79
80 80
81} // end namespace video 81} // end namespace video
82} // end namespace irr 82} // end namespace irr
83 83
84#endif 84#endif
85 85
diff --git a/libraries/irrlicht-1.8/include/IShadowVolumeSceneNode.h b/libraries/irrlicht-1.8/include/IShadowVolumeSceneNode.h
index 82c2ad3..40781a9 100644
--- a/libraries/irrlicht-1.8/include/IShadowVolumeSceneNode.h
+++ b/libraries/irrlicht-1.8/include/IShadowVolumeSceneNode.h
@@ -1,38 +1,38 @@
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#ifndef __I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__
6#define __I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__ 6#define __I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 class IMesh; 14 class IMesh;
15 15
16 //! Scene node for rendering a shadow volume into a stencil buffer. 16 //! Scene node for rendering a shadow volume into a stencil buffer.
17 class IShadowVolumeSceneNode : public ISceneNode 17 class IShadowVolumeSceneNode : public ISceneNode
18 { 18 {
19 public: 19 public:
20 20
21 //! constructor 21 //! constructor
22 IShadowVolumeSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id) 22 IShadowVolumeSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id)
23 : ISceneNode(parent, mgr, id) {} 23 : ISceneNode(parent, mgr, id) {}
24 24
25 //! Sets the mesh from which the shadow volume should be generated. 25 //! Sets the mesh from which the shadow volume should be generated.
26 /** To optimize shadow rendering, use a simpler mesh for shadows. 26 /** To optimize shadow rendering, use a simpler mesh for shadows.
27 */ 27 */
28 virtual void setShadowMesh(const IMesh* mesh) = 0; 28 virtual void setShadowMesh(const IMesh* mesh) = 0;
29 29
30 //! Updates the shadow volumes for current light positions. 30 //! Updates the shadow volumes for current light positions.
31 virtual void updateShadowVolumes() = 0; 31 virtual void updateShadowVolumes() = 0;
32 }; 32 };
33 33
34} // end namespace scene 34} // end namespace scene
35} // end namespace irr 35} // end namespace irr
36 36
37#endif 37#endif
38 38
diff --git a/libraries/irrlicht-1.8/include/ISkinnedMesh.h b/libraries/irrlicht-1.8/include/ISkinnedMesh.h
index 03f5016..5f0f9cb 100644
--- a/libraries/irrlicht-1.8/include/ISkinnedMesh.h
+++ b/libraries/irrlicht-1.8/include/ISkinnedMesh.h
@@ -1,219 +1,219 @@
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#ifndef __I_SKINNED_MESH_H_INCLUDED__ 5#ifndef __I_SKINNED_MESH_H_INCLUDED__
6#define __I_SKINNED_MESH_H_INCLUDED__ 6#define __I_SKINNED_MESH_H_INCLUDED__
7 7
8#include "irrArray.h" 8#include "irrArray.h"
9#include "IBoneSceneNode.h" 9#include "IBoneSceneNode.h"
10#include "IAnimatedMesh.h" 10#include "IAnimatedMesh.h"
11#include "SSkinMeshBuffer.h" 11#include "SSkinMeshBuffer.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace scene 15namespace scene
16{ 16{
17 17
18 enum E_INTERPOLATION_MODE 18 enum E_INTERPOLATION_MODE
19 { 19 {
20 // constant does use the current key-values without interpolation 20 // constant does use the current key-values without interpolation
21 EIM_CONSTANT = 0, 21 EIM_CONSTANT = 0,
22 22
23 // linear interpolation 23 // linear interpolation
24 EIM_LINEAR, 24 EIM_LINEAR,
25 25
26 //! count of all available interpolation modes 26 //! count of all available interpolation modes
27 EIM_COUNT 27 EIM_COUNT
28 }; 28 };
29 29
30 30
31 //! Interface for using some special functions of Skinned meshes 31 //! Interface for using some special functions of Skinned meshes
32 class ISkinnedMesh : public IAnimatedMesh 32 class ISkinnedMesh : public IAnimatedMesh
33 { 33 {
34 public: 34 public:
35 35
36 //! Gets joint count. 36 //! Gets joint count.
37 /** \return Amount of joints in the skeletal animated mesh. */ 37 /** \return Amount of joints in the skeletal animated mesh. */
38 virtual u32 getJointCount() const = 0; 38 virtual u32 getJointCount() const = 0;
39 39
40 //! Gets the name of a joint. 40 //! Gets the name of a joint.
41 /** \param number: Zero based index of joint. The last joint 41 /** \param number: Zero based index of joint. The last joint
42 has the number getJointCount()-1; 42 has the number getJointCount()-1;
43 \return Name of joint and null if an error happened. */ 43 \return Name of joint and null if an error happened. */
44 virtual const c8* getJointName(u32 number) const = 0; 44 virtual const c8* getJointName(u32 number) const = 0;
45 45
46 //! Gets a joint number from its name 46 //! Gets a joint number from its name
47 /** \param name: Name of the joint. 47 /** \param name: Name of the joint.
48 \return Number of the joint or -1 if not found. */ 48 \return Number of the joint or -1 if not found. */
49 virtual s32 getJointNumber(const c8* name) const = 0; 49 virtual s32 getJointNumber(const c8* name) const = 0;
50 50
51 //! Use animation from another mesh 51 //! Use animation from another mesh
52 /** The animation is linked (not copied) based on joint names 52 /** The animation is linked (not copied) based on joint names
53 so make sure they are unique. 53 so make sure they are unique.
54 \return True if all joints in this mesh were 54 \return True if all joints in this mesh were
55 matched up (empty names will not be matched, and it's case 55 matched up (empty names will not be matched, and it's case
56 sensitive). Unmatched joints will not be animated. */ 56 sensitive). Unmatched joints will not be animated. */
57 virtual bool useAnimationFrom(const ISkinnedMesh *mesh) = 0; 57 virtual bool useAnimationFrom(const ISkinnedMesh *mesh) = 0;
58 58
59 //! Update Normals when Animating 59 //! Update Normals when Animating
60 /** \param on If false don't animate, which is faster. 60 /** \param on If false don't animate, which is faster.
61 Else update normals, which allows for proper lighting of 61 Else update normals, which allows for proper lighting of
62 animated meshes. */ 62 animated meshes. */
63 virtual void updateNormalsWhenAnimating(bool on) = 0; 63 virtual void updateNormalsWhenAnimating(bool on) = 0;
64 64
65 //! Sets Interpolation Mode 65 //! Sets Interpolation Mode
66 virtual void setInterpolationMode(E_INTERPOLATION_MODE mode) = 0; 66 virtual void setInterpolationMode(E_INTERPOLATION_MODE mode) = 0;
67 67
68 //! Animates this mesh's joints based on frame input 68 //! Animates this mesh's joints based on frame input
69 virtual void animateMesh(f32 frame, f32 blend)=0; 69 virtual void animateMesh(f32 frame, f32 blend)=0;
70 70
71 //! Preforms a software skin on this mesh based of joint positions 71 //! Preforms a software skin on this mesh based of joint positions
72 virtual void skinMesh() = 0; 72 virtual void skinMesh() = 0;
73 73
74 //! converts the vertex type of all meshbuffers to tangents. 74 //! converts the vertex type of all meshbuffers to tangents.
75 /** E.g. used for bump mapping. */ 75 /** E.g. used for bump mapping. */
76 virtual void convertMeshToTangents() = 0; 76 virtual void convertMeshToTangents() = 0;
77 77
78 //! Allows to enable hardware skinning. 78 //! Allows to enable hardware skinning.
79 /* This feature is not implementated in Irrlicht yet */ 79 /* This feature is not implementated in Irrlicht yet */
80 virtual bool setHardwareSkinning(bool on) = 0; 80 virtual bool setHardwareSkinning(bool on) = 0;
81 81
82 //! A vertex weight 82 //! A vertex weight
83 struct SWeight 83 struct SWeight
84 { 84 {
85 //! Index of the mesh buffer 85 //! Index of the mesh buffer
86 u16 buffer_id; //I doubt 32bits is needed 86 u16 buffer_id; //I doubt 32bits is needed
87 87
88 //! Index of the vertex 88 //! Index of the vertex
89 u32 vertex_id; //Store global ID here 89 u32 vertex_id; //Store global ID here
90 90
91 //! Weight Strength/Percentage (0-1) 91 //! Weight Strength/Percentage (0-1)
92 f32 strength; 92 f32 strength;
93 93
94 private: 94 private:
95 //! Internal members used by CSkinnedMesh 95 //! Internal members used by CSkinnedMesh
96 friend class CSkinnedMesh; 96 friend class CSkinnedMesh;
97 bool *Moved; 97 bool *Moved;
98 core::vector3df StaticPos; 98 core::vector3df StaticPos;
99 core::vector3df StaticNormal; 99 core::vector3df StaticNormal;
100 }; 100 };
101 101
102 102
103 //! Animation keyframe which describes a new position 103 //! Animation keyframe which describes a new position
104 struct SPositionKey 104 struct SPositionKey
105 { 105 {
106 f32 frame; 106 f32 frame;
107 core::vector3df position; 107 core::vector3df position;
108 }; 108 };
109 109
110 //! Animation keyframe which describes a new scale 110 //! Animation keyframe which describes a new scale
111 struct SScaleKey 111 struct SScaleKey
112 { 112 {
113 f32 frame; 113 f32 frame;
114 core::vector3df scale; 114 core::vector3df scale;
115 }; 115 };
116 116
117 //! Animation keyframe which describes a new rotation 117 //! Animation keyframe which describes a new rotation
118 struct SRotationKey 118 struct SRotationKey
119 { 119 {
120 f32 frame; 120 f32 frame;
121 core::quaternion rotation; 121 core::quaternion rotation;
122 }; 122 };
123 123
124 //! Joints 124 //! Joints
125 struct SJoint 125 struct SJoint
126 { 126 {
127 SJoint() : UseAnimationFrom(0), GlobalSkinningSpace(false), 127 SJoint() : UseAnimationFrom(0), GlobalSkinningSpace(false),
128 positionHint(-1),scaleHint(-1),rotationHint(-1) 128 positionHint(-1),scaleHint(-1),rotationHint(-1)
129 { 129 {
130 } 130 }
131 131
132 //! The name of this joint 132 //! The name of this joint
133 core::stringc Name; 133 core::stringc Name;
134 134
135 //! Local matrix of this joint 135 //! Local matrix of this joint
136 core::matrix4 LocalMatrix; 136 core::matrix4 LocalMatrix;
137 137
138 //! List of child joints 138 //! List of child joints
139 core::array<SJoint*> Children; 139 core::array<SJoint*> Children;
140 140
141 //! List of attached meshes 141 //! List of attached meshes
142 core::array<u32> AttachedMeshes; 142 core::array<u32> AttachedMeshes;
143 143
144 //! Animation keys causing translation change 144 //! Animation keys causing translation change
145 core::array<SPositionKey> PositionKeys; 145 core::array<SPositionKey> PositionKeys;
146 146
147 //! Animation keys causing scale change 147 //! Animation keys causing scale change
148 core::array<SScaleKey> ScaleKeys; 148 core::array<SScaleKey> ScaleKeys;
149 149
150 //! Animation keys causing rotation change 150 //! Animation keys causing rotation change
151 core::array<SRotationKey> RotationKeys; 151 core::array<SRotationKey> RotationKeys;
152 152
153 //! Skin weights 153 //! Skin weights
154 core::array<SWeight> Weights; 154 core::array<SWeight> Weights;
155 155
156 //! Unnecessary for loaders, will be overwritten on finalize 156 //! Unnecessary for loaders, will be overwritten on finalize
157 core::matrix4 GlobalMatrix; 157 core::matrix4 GlobalMatrix;
158 core::matrix4 GlobalAnimatedMatrix; 158 core::matrix4 GlobalAnimatedMatrix;
159 core::matrix4 LocalAnimatedMatrix; 159 core::matrix4 LocalAnimatedMatrix;
160 core::vector3df Animatedposition; 160 core::vector3df Animatedposition;
161 core::vector3df Animatedscale; 161 core::vector3df Animatedscale;
162 core::quaternion Animatedrotation; 162 core::quaternion Animatedrotation;
163 163
164 core::matrix4 GlobalInversedMatrix; //the x format pre-calculates this 164 core::matrix4 GlobalInversedMatrix; //the x format pre-calculates this
165 165
166 private: 166 private:
167 //! Internal members used by CSkinnedMesh 167 //! Internal members used by CSkinnedMesh
168 friend class CSkinnedMesh; 168 friend class CSkinnedMesh;
169 169
170 SJoint *UseAnimationFrom; 170 SJoint *UseAnimationFrom;
171 bool GlobalSkinningSpace; 171 bool GlobalSkinningSpace;
172 172
173 s32 positionHint; 173 s32 positionHint;
174 s32 scaleHint; 174 s32 scaleHint;
175 s32 rotationHint; 175 s32 rotationHint;
176 }; 176 };
177 177
178 178
179 //Interface for the mesh loaders (finalize should lock these functions, and they should have some prefix like loader_ 179 //Interface for the mesh loaders (finalize should lock these functions, and they should have some prefix like loader_
180 180
181 //these functions will use the needed arrays, set values, etc to help the loaders 181 //these functions will use the needed arrays, set values, etc to help the loaders
182 182
183 //! exposed for loaders: to add mesh buffers 183 //! exposed for loaders: to add mesh buffers
184 virtual core::array<SSkinMeshBuffer*>& getMeshBuffers() = 0; 184 virtual core::array<SSkinMeshBuffer*>& getMeshBuffers() = 0;
185 185
186 //! exposed for loaders: joints list 186 //! exposed for loaders: joints list
187 virtual core::array<SJoint*>& getAllJoints() = 0; 187 virtual core::array<SJoint*>& getAllJoints() = 0;
188 188
189 //! exposed for loaders: joints list 189 //! exposed for loaders: joints list
190 virtual const core::array<SJoint*>& getAllJoints() const = 0; 190 virtual const core::array<SJoint*>& getAllJoints() const = 0;
191 191
192 //! loaders should call this after populating the mesh 192 //! loaders should call this after populating the mesh
193 virtual void finalize() = 0; 193 virtual void finalize() = 0;
194 194
195 //! Adds a new meshbuffer to the mesh, access it as last one 195 //! Adds a new meshbuffer to the mesh, access it as last one
196 virtual SSkinMeshBuffer* addMeshBuffer() = 0; 196 virtual SSkinMeshBuffer* addMeshBuffer() = 0;
197 197
198 //! Adds a new joint to the mesh, access it as last one 198 //! Adds a new joint to the mesh, access it as last one
199 virtual SJoint* addJoint(SJoint *parent=0) = 0; 199 virtual SJoint* addJoint(SJoint *parent=0) = 0;
200 200
201 //! Adds a new weight to the mesh, access it as last one 201 //! Adds a new weight to the mesh, access it as last one
202 virtual SWeight* addWeight(SJoint *joint) = 0; 202 virtual SWeight* addWeight(SJoint *joint) = 0;
203 203
204 //! Adds a new position key to the mesh, access it as last one 204 //! Adds a new position key to the mesh, access it as last one
205 virtual SPositionKey* addPositionKey(SJoint *joint) = 0; 205 virtual SPositionKey* addPositionKey(SJoint *joint) = 0;
206 //! Adds a new scale key to the mesh, access it as last one 206 //! Adds a new scale key to the mesh, access it as last one
207 virtual SScaleKey* addScaleKey(SJoint *joint) = 0; 207 virtual SScaleKey* addScaleKey(SJoint *joint) = 0;
208 //! Adds a new rotation key to the mesh, access it as last one 208 //! Adds a new rotation key to the mesh, access it as last one
209 virtual SRotationKey* addRotationKey(SJoint *joint) = 0; 209 virtual SRotationKey* addRotationKey(SJoint *joint) = 0;
210 210
211 //! Check if the mesh is non-animated 211 //! Check if the mesh is non-animated
212 virtual bool isStatic()=0; 212 virtual bool isStatic()=0;
213 }; 213 };
214 214
215} // end namespace scene 215} // end namespace scene
216} // end namespace irr 216} // end namespace irr
217 217
218#endif 218#endif
219 219
diff --git a/libraries/irrlicht-1.8/include/ITerrainSceneNode.h b/libraries/irrlicht-1.8/include/ITerrainSceneNode.h
index 0706709..4802710 100644
--- a/libraries/irrlicht-1.8/include/ITerrainSceneNode.h
+++ b/libraries/irrlicht-1.8/include/ITerrainSceneNode.h
@@ -1,182 +1,182 @@
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// The code for the TerrainSceneNode is based on the terrain renderer by 5// The code for the TerrainSceneNode is based on the terrain renderer by
6// Soconne and the GeoMipMapSceneNode developed by Spintz. They made their 6// Soconne and the GeoMipMapSceneNode developed by Spintz. They made their
7// code available for Irrlicht and allowed it to be distributed under this 7// code available for Irrlicht and allowed it to be distributed under this
8// licence. I only modified some parts. A lot of thanks go to them. 8// licence. I only modified some parts. A lot of thanks go to them.
9 9
10#ifndef __I_TERRAIN_SCENE_NODE_H__ 10#ifndef __I_TERRAIN_SCENE_NODE_H__
11#define __I_TERRAIN_SCENE_NODE_H__ 11#define __I_TERRAIN_SCENE_NODE_H__
12 12
13#include "ETerrainElements.h" 13#include "ETerrainElements.h"
14#include "ISceneNode.h" 14#include "ISceneNode.h"
15#include "IDynamicMeshBuffer.h" 15#include "IDynamicMeshBuffer.h"
16#include "irrArray.h" 16#include "irrArray.h"
17 17
18namespace irr 18namespace irr
19{ 19{
20namespace io 20namespace io
21{ 21{
22 class IReadFile; 22 class IReadFile;
23} // end namespace io 23} // end namespace io
24namespace scene 24namespace scene
25{ 25{
26 class IMesh; 26 class IMesh;
27 27
28 //! A scene node for displaying terrain using the geo mip map algorithm. 28 //! A scene node for displaying terrain using the geo mip map algorithm.
29 /** The code for the TerrainSceneNode is based on the Terrain renderer by Soconne and 29 /** The code for the TerrainSceneNode is based on the Terrain renderer by Soconne and
30 * the GeoMipMapSceneNode developed by Spintz. They made their code available for Irrlicht 30 * the GeoMipMapSceneNode developed by Spintz. They made their code available for Irrlicht
31 * and allowed it to be distributed under this licence. I only modified some parts. 31 * and allowed it to be distributed under this licence. I only modified some parts.
32 * A lot of thanks go to them. 32 * A lot of thanks go to them.
33 * 33 *
34 * This scene node is capable of very quickly loading 34 * This scene node is capable of very quickly loading
35 * terrains and updating the indices at runtime to enable viewing very large terrains. It uses a 35 * terrains and updating the indices at runtime to enable viewing very large terrains. It uses a
36 * CLOD (Continuous Level of Detail) algorithm which updates the indices for each patch based on 36 * CLOD (Continuous Level of Detail) algorithm which updates the indices for each patch based on
37 * a LOD (Level of Detail) which is determined based on a patch's distance from the camera. 37 * a LOD (Level of Detail) which is determined based on a patch's distance from the camera.
38 * 38 *
39 * The Patch Size of the terrain must always be a size of ( 2^N+1, i.e. 8+1(9), 16+1(17), etc. ). 39 * The Patch Size of the terrain must always be a size of ( 2^N+1, i.e. 8+1(9), 16+1(17), etc. ).
40 * The MaxLOD available is directly dependent on the patch size of the terrain. LOD 0 contains all 40 * The MaxLOD available is directly dependent on the patch size of the terrain. LOD 0 contains all
41 * of the indices to draw all the triangles at the max detail for a patch. As each LOD goes up by 1 41 * of the indices to draw all the triangles at the max detail for a patch. As each LOD goes up by 1
42 * the step taken, in generating indices increases by - 2^LOD, so for LOD 1, the step taken is 2, for 42 * the step taken, in generating indices increases by - 2^LOD, so for LOD 1, the step taken is 2, for
43 * LOD 2, the step taken is 4, LOD 3 - 8, etc. The step can be no larger than the size of the patch, 43 * LOD 2, the step taken is 4, LOD 3 - 8, etc. The step can be no larger than the size of the patch,
44 * so having a LOD of 8, with a patch size of 17, is asking the algoritm to generate indices every 44 * so having a LOD of 8, with a patch size of 17, is asking the algoritm to generate indices every
45 * 2^8 ( 256 ) vertices, which is not possible with a patch size of 17. The maximum LOD for a patch 45 * 2^8 ( 256 ) vertices, which is not possible with a patch size of 17. The maximum LOD for a patch
46 * size of 17 is 2^4 ( 16 ). So, with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( every 46 * size of 17 is 2^4 ( 16 ). So, with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( every
47 * 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every 8 vertices ) and LOD 4 ( every 16 vertices ). 47 * 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every 8 vertices ) and LOD 4 ( every 16 vertices ).
48 **/ 48 **/
49 class ITerrainSceneNode : public ISceneNode 49 class ITerrainSceneNode : public ISceneNode
50 { 50 {
51 public: 51 public:
52 //! Constructor 52 //! Constructor
53 ITerrainSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 53 ITerrainSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
54 const core::vector3df& position = core::vector3df(0.0f, 0.0f, 0.0f), 54 const core::vector3df& position = core::vector3df(0.0f, 0.0f, 0.0f),
55 const core::vector3df& rotation = core::vector3df(0.0f, 0.0f, 0.0f), 55 const core::vector3df& rotation = core::vector3df(0.0f, 0.0f, 0.0f),
56 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f) ) 56 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f) )
57 : ISceneNode (parent, mgr, id, position, rotation, scale) {} 57 : ISceneNode (parent, mgr, id, position, rotation, scale) {}
58 58
59 //! Get the bounding box of the terrain. 59 //! Get the bounding box of the terrain.
60 /** \return The bounding box of the entire terrain. */ 60 /** \return The bounding box of the entire terrain. */
61 virtual const core::aabbox3d<f32>& getBoundingBox() const =0; 61 virtual const core::aabbox3d<f32>& getBoundingBox() const =0;
62 62
63 //! Get the bounding box of a patch 63 //! Get the bounding box of a patch
64 /** \return The bounding box of the chosen patch. */ 64 /** \return The bounding box of the chosen patch. */
65 virtual const core::aabbox3d<f32>& getBoundingBox(s32 patchX, s32 patchZ) const =0; 65 virtual const core::aabbox3d<f32>& getBoundingBox(s32 patchX, s32 patchZ) const =0;
66 66
67 //! Get the number of indices currently in the meshbuffer 67 //! Get the number of indices currently in the meshbuffer
68 /** \return The index count. */ 68 /** \return The index count. */
69 virtual u32 getIndexCount() const =0; 69 virtual u32 getIndexCount() const =0;
70 70
71 //! Get pointer to the mesh 71 //! Get pointer to the mesh
72 /** \return Pointer to the mesh. */ 72 /** \return Pointer to the mesh. */
73 virtual IMesh* getMesh() =0; 73 virtual IMesh* getMesh() =0;
74 74
75 //! Get pointer to the buffer used by the terrain (most users will not need this) 75 //! Get pointer to the buffer used by the terrain (most users will not need this)
76 virtual IMeshBuffer* getRenderBuffer() =0; 76 virtual IMeshBuffer* getRenderBuffer() =0;
77 77
78 78
79 //! Gets the meshbuffer data based on a specified level of detail. 79 //! Gets the meshbuffer data based on a specified level of detail.
80 /** \param mb A reference to an IDynamicMeshBuffer object 80 /** \param mb A reference to an IDynamicMeshBuffer object
81 \param LOD The level of detail you want the indices from. */ 81 \param LOD The level of detail you want the indices from. */
82 virtual void getMeshBufferForLOD(IDynamicMeshBuffer& mb, s32 LOD=0) const =0; 82 virtual void getMeshBufferForLOD(IDynamicMeshBuffer& mb, s32 LOD=0) const =0;
83 83
84 //! Gets the indices for a specified patch at a specified Level of Detail. 84 //! Gets the indices for a specified patch at a specified Level of Detail.
85 /** \param indices A reference to an array of u32 indices. 85 /** \param indices A reference to an array of u32 indices.
86 \param patchX Patch x coordinate. 86 \param patchX Patch x coordinate.
87 \param patchZ Patch z coordinate. 87 \param patchZ Patch z coordinate.
88 \param LOD The level of detail to get for that patch. If -1, 88 \param LOD The level of detail to get for that patch. If -1,
89 then get the CurrentLOD. If the CurrentLOD is set to -1, 89 then get the CurrentLOD. If the CurrentLOD is set to -1,
90 meaning it's not shown, then it will retrieve the triangles at 90 meaning it's not shown, then it will retrieve the triangles at
91 the highest LOD (0). 91 the highest LOD (0).
92 \return Number of indices put into the buffer. */ 92 \return Number of indices put into the buffer. */
93 virtual s32 getIndicesForPatch(core::array<u32>& indices, 93 virtual s32 getIndicesForPatch(core::array<u32>& indices,
94 s32 patchX, s32 patchZ, s32 LOD=0) =0; 94 s32 patchX, s32 patchZ, s32 LOD=0) =0;
95 95
96 //! Populates an array with the CurrentLOD of each patch. 96 //! Populates an array with the CurrentLOD of each patch.
97 /** \param LODs A reference to a core::array<s32> to hold the 97 /** \param LODs A reference to a core::array<s32> to hold the
98 values 98 values
99 \return Number of elements in the array */ 99 \return Number of elements in the array */
100 virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs) const =0; 100 virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs) const =0;
101 101
102 //! Manually sets the LOD of a patch 102 //! Manually sets the LOD of a patch
103 /** \param patchX Patch x coordinate. 103 /** \param patchX Patch x coordinate.
104 \param patchZ Patch z coordinate. 104 \param patchZ Patch z coordinate.
105 \param LOD The level of detail to set the patch to. */ 105 \param LOD The level of detail to set the patch to. */
106 virtual void setLODOfPatch(s32 patchX, s32 patchZ, s32 LOD=0) =0; 106 virtual void setLODOfPatch(s32 patchX, s32 patchZ, s32 LOD=0) =0;
107 107
108 //! Get center of terrain. 108 //! Get center of terrain.
109 virtual const core::vector3df& getTerrainCenter() const =0; 109 virtual const core::vector3df& getTerrainCenter() const =0;
110 110
111 //! Get height of a point of the terrain. 111 //! Get height of a point of the terrain.
112 virtual f32 getHeight(f32 x, f32 y) const =0; 112 virtual f32 getHeight(f32 x, f32 y) const =0;
113 113
114 //! Sets the movement camera threshold. 114 //! Sets the movement camera threshold.
115 /** It is used to determine when to recalculate 115 /** It is used to determine when to recalculate
116 indices for the scene node. The default value is 10.0f. */ 116 indices for the scene node. The default value is 10.0f. */
117 virtual void setCameraMovementDelta(f32 delta) =0; 117 virtual void setCameraMovementDelta(f32 delta) =0;
118 118
119 //! Sets the rotation camera threshold. 119 //! Sets the rotation camera threshold.
120 /** It is used to determine when to recalculate 120 /** It is used to determine when to recalculate
121 indices for the scene node. The default value is 1.0f. */ 121 indices for the scene node. The default value is 1.0f. */
122 virtual void setCameraRotationDelta(f32 delta) =0; 122 virtual void setCameraRotationDelta(f32 delta) =0;
123 123
124 //! Sets whether or not the node should dynamically update its associated selector when the geomipmap data changes. 124 //! Sets whether or not the node should dynamically update its associated selector when the geomipmap data changes.
125 /** \param bVal: Boolean value representing whether or not to update selector dynamically. */ 125 /** \param bVal: Boolean value representing whether or not to update selector dynamically. */
126 virtual void setDynamicSelectorUpdate(bool bVal) =0; 126 virtual void setDynamicSelectorUpdate(bool bVal) =0;
127 127
128 //! Override the default generation of distance thresholds. 128 //! Override the default generation of distance thresholds.
129 /** For determining the LOD a patch is rendered at. If any LOD 129 /** For determining the LOD a patch is rendered at. If any LOD
130 is overridden, then the scene node will no longer apply scaling 130 is overridden, then the scene node will no longer apply scaling
131 factors to these values. If you override these distances, and 131 factors to these values. If you override these distances, and
132 then apply a scale to the scene node, it is your responsibility 132 then apply a scale to the scene node, it is your responsibility
133 to update the new distances to work best with your new terrain 133 to update the new distances to work best with your new terrain
134 size. */ 134 size. */
135 virtual bool overrideLODDistance(s32 LOD, f64 newDistance) =0; 135 virtual bool overrideLODDistance(s32 LOD, f64 newDistance) =0;
136 136
137 //! Scales the base texture, similar to makePlanarTextureMapping. 137 //! Scales the base texture, similar to makePlanarTextureMapping.
138 /** \param scale The scaling amount. Values above 1.0 138 /** \param scale The scaling amount. Values above 1.0
139 increase the number of time the texture is drawn on the 139 increase the number of time the texture is drawn on the
140 terrain. Values below 0 will decrease the number of times the 140 terrain. Values below 0 will decrease the number of times the
141 texture is drawn on the terrain. Using negative values will 141 texture is drawn on the terrain. Using negative values will
142 flip the texture, as well as still scaling it. 142 flip the texture, as well as still scaling it.
143 \param scale2 If set to 0 (default value), this will set the 143 \param scale2 If set to 0 (default value), this will set the
144 second texture coordinate set to the same values as in the 144 second texture coordinate set to the same values as in the
145 first set. If this is another value than zero, it will scale 145 first set. If this is another value than zero, it will scale
146 the second texture coordinate set by this value. */ 146 the second texture coordinate set by this value. */
147 virtual void scaleTexture(f32 scale = 1.0f, f32 scale2=0.0f) =0; 147 virtual void scaleTexture(f32 scale = 1.0f, f32 scale2=0.0f) =0;
148 148
149 //! Initializes the terrain data. Loads the vertices from the heightMapFile. 149 //! Initializes the terrain data. Loads the vertices from the heightMapFile.
150 /** The file must contain a loadable image of the heightmap. The heightmap 150 /** The file must contain a loadable image of the heightmap. The heightmap
151 must be square. 151 must be square.
152 \param file The file to read the image from. File is not rewinded. 152 \param file The file to read the image from. File is not rewinded.
153 \param vertexColor Color of all vertices. 153 \param vertexColor Color of all vertices.
154 \param smoothFactor Number of smoothing passes. */ 154 \param smoothFactor Number of smoothing passes. */
155 virtual bool loadHeightMap(io::IReadFile* file, 155 virtual bool loadHeightMap(io::IReadFile* file,
156 video::SColor vertexColor=video::SColor(255,255,255,255), 156 video::SColor vertexColor=video::SColor(255,255,255,255),
157 s32 smoothFactor=0) =0; 157 s32 smoothFactor=0) =0;
158 158
159 //! Initializes the terrain data. Loads the vertices from the heightMapFile. 159 //! Initializes the terrain data. Loads the vertices from the heightMapFile.
160 /** The data is interpreted as (signed) integers of the given bit size or 160 /** The data is interpreted as (signed) integers of the given bit size or
161 floats (with 32bits, signed). Allowed bitsizes for integers are 161 floats (with 32bits, signed). Allowed bitsizes for integers are
162 8, 16, and 32. The heightmap must be square. 162 8, 16, and 32. The heightmap must be square.
163 \param file The file to read the RAW data from. File is not rewinded. 163 \param file The file to read the RAW data from. File is not rewinded.
164 \param bitsPerPixel Size of data if integers used, for floats always use 32. 164 \param bitsPerPixel Size of data if integers used, for floats always use 32.
165 \param signedData Whether we use signed or unsigned ints, ignored for floats. 165 \param signedData Whether we use signed or unsigned ints, ignored for floats.
166 \param floatVals Whether the data is float or int. 166 \param floatVals Whether the data is float or int.
167 \param width Width (and also Height, as it must be square) of the heightmap. Use 0 for autocalculating from the filesize. 167 \param width Width (and also Height, as it must be square) of the heightmap. Use 0 for autocalculating from the filesize.
168 \param vertexColor Color of all vertices. 168 \param vertexColor Color of all vertices.
169 \param smoothFactor Number of smoothing passes. */ 169 \param smoothFactor Number of smoothing passes. */
170 virtual bool loadHeightMapRAW(io::IReadFile* file, s32 bitsPerPixel=16, 170 virtual bool loadHeightMapRAW(io::IReadFile* file, s32 bitsPerPixel=16,
171 bool signedData=false, bool floatVals=false, s32 width=0, 171 bool signedData=false, bool floatVals=false, s32 width=0,
172 video::SColor vertexColor=video::SColor(255,255,255,255), 172 video::SColor vertexColor=video::SColor(255,255,255,255),
173 s32 smoothFactor=0) =0; 173 s32 smoothFactor=0) =0;
174 174
175 }; 175 };
176 176
177} // end namespace scene 177} // end namespace scene
178} // end namespace irr 178} // end namespace irr
179 179
180 180
181#endif // __I_TERRAIN_SCENE_NODE_H__ 181#endif // __I_TERRAIN_SCENE_NODE_H__
182 182
diff --git a/libraries/irrlicht-1.8/include/ITextSceneNode.h b/libraries/irrlicht-1.8/include/ITextSceneNode.h
index 540d7b7..e715a46 100644
--- a/libraries/irrlicht-1.8/include/ITextSceneNode.h
+++ b/libraries/irrlicht-1.8/include/ITextSceneNode.h
@@ -1,37 +1,37 @@
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#ifndef __I_TEXT_SCENE_NODE_H_INCLUDED__ 5#ifndef __I_TEXT_SCENE_NODE_H_INCLUDED__
6#define __I_TEXT_SCENE_NODE_H_INCLUDED__ 6#define __I_TEXT_SCENE_NODE_H_INCLUDED__
7 7
8#include "ISceneNode.h" 8#include "ISceneNode.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace scene 12namespace scene
13{ 13{
14 14
15//! A scene node for displaying 2d text at a position in three dimensional space 15//! A scene node for displaying 2d text at a position in three dimensional space
16class ITextSceneNode : public ISceneNode 16class ITextSceneNode : public ISceneNode
17{ 17{
18public: 18public:
19 19
20 //! constructor 20 //! constructor
21 ITextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 21 ITextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
22 const core::vector3df& position = core::vector3df(0,0,0)) 22 const core::vector3df& position = core::vector3df(0,0,0))
23 : ISceneNode(parent, mgr, id, position) {} 23 : ISceneNode(parent, mgr, id, position) {}
24 24
25 //! sets the text string 25 //! sets the text string
26 virtual void setText(const wchar_t* text) = 0; 26 virtual void setText(const wchar_t* text) = 0;
27 27
28 //! sets the color of the text 28 //! sets the color of the text
29 virtual void setTextColor(video::SColor color) = 0; 29 virtual void setTextColor(video::SColor color) = 0;
30}; 30};
31 31
32} // end namespace scene 32} // end namespace scene
33} // end namespace irr 33} // end namespace irr
34 34
35 35
36#endif 36#endif
37 37
diff --git a/libraries/irrlicht-1.8/include/ITexture.h b/libraries/irrlicht-1.8/include/ITexture.h
index 2f54437..66f039d 100644
--- a/libraries/irrlicht-1.8/include/ITexture.h
+++ b/libraries/irrlicht-1.8/include/ITexture.h
@@ -1,219 +1,219 @@
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#ifndef __I_TEXTURE_H_INCLUDED__ 5#ifndef __I_TEXTURE_H_INCLUDED__
6#define __I_TEXTURE_H_INCLUDED__ 6#define __I_TEXTURE_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "IImage.h" 9#include "IImage.h"
10#include "dimension2d.h" 10#include "dimension2d.h"
11#include "EDriverTypes.h" 11#include "EDriverTypes.h"
12#include "path.h" 12#include "path.h"
13#include "matrix4.h" 13#include "matrix4.h"
14 14
15namespace irr 15namespace irr
16{ 16{
17namespace video 17namespace video
18{ 18{
19 19
20 20
21//! Enumeration flags telling the video driver in which format textures should be created. 21//! Enumeration flags telling the video driver in which format textures should be created.
22enum E_TEXTURE_CREATION_FLAG 22enum E_TEXTURE_CREATION_FLAG
23{ 23{
24 /** Forces the driver to create 16 bit textures always, independent of 24 /** Forces the driver to create 16 bit textures always, independent of
25 which format the file on disk has. When choosing this you may lose 25 which format the file on disk has. When choosing this you may lose
26 some color detail, but gain much speed and memory. 16 bit textures can 26 some color detail, but gain much speed and memory. 16 bit textures can
27 be transferred twice as fast as 32 bit textures and only use half of 27 be transferred twice as fast as 32 bit textures and only use half of
28 the space in memory. 28 the space in memory.
29 When using this flag, it does not make sense to use the flags 29 When using this flag, it does not make sense to use the flags
30 ETCF_ALWAYS_32_BIT, ETCF_OPTIMIZED_FOR_QUALITY, or 30 ETCF_ALWAYS_32_BIT, ETCF_OPTIMIZED_FOR_QUALITY, or
31 ETCF_OPTIMIZED_FOR_SPEED at the same time. */ 31 ETCF_OPTIMIZED_FOR_SPEED at the same time. */
32 ETCF_ALWAYS_16_BIT = 0x00000001, 32 ETCF_ALWAYS_16_BIT = 0x00000001,
33 33
34 /** Forces the driver to create 32 bit textures always, independent of 34 /** Forces the driver to create 32 bit textures always, independent of
35 which format the file on disk has. Please note that some drivers (like 35 which format the file on disk has. Please note that some drivers (like
36 the software device) will ignore this, because they are only able to 36 the software device) will ignore this, because they are only able to
37 create and use 16 bit textures. 37 create and use 16 bit textures.
38 When using this flag, it does not make sense to use the flags 38 When using this flag, it does not make sense to use the flags
39 ETCF_ALWAYS_16_BIT, ETCF_OPTIMIZED_FOR_QUALITY, or 39 ETCF_ALWAYS_16_BIT, ETCF_OPTIMIZED_FOR_QUALITY, or
40 ETCF_OPTIMIZED_FOR_SPEED at the same time. */ 40 ETCF_OPTIMIZED_FOR_SPEED at the same time. */
41 ETCF_ALWAYS_32_BIT = 0x00000002, 41 ETCF_ALWAYS_32_BIT = 0x00000002,
42 42
43 /** Lets the driver decide in which format the textures are created and 43 /** Lets the driver decide in which format the textures are created and
44 tries to make the textures look as good as possible. Usually it simply 44 tries to make the textures look as good as possible. Usually it simply
45 chooses the format in which the texture was stored on disk. 45 chooses the format in which the texture was stored on disk.
46 When using this flag, it does not make sense to use the flags 46 When using this flag, it does not make sense to use the flags
47 ETCF_ALWAYS_16_BIT, ETCF_ALWAYS_32_BIT, or ETCF_OPTIMIZED_FOR_SPEED at 47 ETCF_ALWAYS_16_BIT, ETCF_ALWAYS_32_BIT, or ETCF_OPTIMIZED_FOR_SPEED at
48 the same time. */ 48 the same time. */
49 ETCF_OPTIMIZED_FOR_QUALITY = 0x00000004, 49 ETCF_OPTIMIZED_FOR_QUALITY = 0x00000004,
50 50
51 /** Lets the driver decide in which format the textures are created and 51 /** Lets the driver decide in which format the textures are created and
52 tries to create them maximizing render speed. 52 tries to create them maximizing render speed.
53 When using this flag, it does not make sense to use the flags 53 When using this flag, it does not make sense to use the flags
54 ETCF_ALWAYS_16_BIT, ETCF_ALWAYS_32_BIT, or ETCF_OPTIMIZED_FOR_QUALITY, 54 ETCF_ALWAYS_16_BIT, ETCF_ALWAYS_32_BIT, or ETCF_OPTIMIZED_FOR_QUALITY,
55 at the same time. */ 55 at the same time. */
56 ETCF_OPTIMIZED_FOR_SPEED = 0x00000008, 56 ETCF_OPTIMIZED_FOR_SPEED = 0x00000008,
57 57
58 /** Automatically creates mip map levels for the textures. */ 58 /** Automatically creates mip map levels for the textures. */
59 ETCF_CREATE_MIP_MAPS = 0x00000010, 59 ETCF_CREATE_MIP_MAPS = 0x00000010,
60 60
61 /** Discard any alpha layer and use non-alpha color format. */ 61 /** Discard any alpha layer and use non-alpha color format. */
62 ETCF_NO_ALPHA_CHANNEL = 0x00000020, 62 ETCF_NO_ALPHA_CHANNEL = 0x00000020,
63 63
64 //! Allow the Driver to use Non-Power-2-Textures 64 //! Allow the Driver to use Non-Power-2-Textures
65 /** BurningVideo can handle Non-Power-2 Textures in 2D (GUI), but not in 3D. */ 65 /** BurningVideo can handle Non-Power-2 Textures in 2D (GUI), but not in 3D. */
66 ETCF_ALLOW_NON_POWER_2 = 0x00000040, 66 ETCF_ALLOW_NON_POWER_2 = 0x00000040,
67 67
68 /** This flag is never used, it only forces the compiler to compile 68 /** This flag is never used, it only forces the compiler to compile
69 these enumeration values to 32 bit. */ 69 these enumeration values to 32 bit. */
70 ETCF_FORCE_32_BIT_DO_NOT_USE = 0x7fffffff 70 ETCF_FORCE_32_BIT_DO_NOT_USE = 0x7fffffff
71}; 71};
72 72
73//! Enum for the mode for texture locking. Read-Only, write-only or read/write. 73//! Enum for the mode for texture locking. Read-Only, write-only or read/write.
74enum E_TEXTURE_LOCK_MODE 74enum E_TEXTURE_LOCK_MODE
75{ 75{
76 //! The default mode. Texture can be read and written to. 76 //! The default mode. Texture can be read and written to.
77 ETLM_READ_WRITE = 0, 77 ETLM_READ_WRITE = 0,
78 78
79 //! Read only. The texture is downloaded, but not uploaded again. 79 //! Read only. The texture is downloaded, but not uploaded again.
80 /** Often used to read back shader generated textures. */ 80 /** Often used to read back shader generated textures. */
81 ETLM_READ_ONLY, 81 ETLM_READ_ONLY,
82 82
83 //! Write only. The texture is not downloaded and might be uninitialised. 83 //! Write only. The texture is not downloaded and might be uninitialised.
84 /** The updated texture is uploaded to the GPU. 84 /** The updated texture is uploaded to the GPU.
85 Used for initialising the shader from the CPU. */ 85 Used for initialising the shader from the CPU. */
86 ETLM_WRITE_ONLY 86 ETLM_WRITE_ONLY
87}; 87};
88 88
89//! Interface of a Video Driver dependent Texture. 89//! Interface of a Video Driver dependent Texture.
90/** An ITexture is created by an IVideoDriver by using IVideoDriver::addTexture 90/** An ITexture is created by an IVideoDriver by using IVideoDriver::addTexture
91or IVideoDriver::getTexture. After that, the texture may only be used by this 91or IVideoDriver::getTexture. After that, the texture may only be used by this
92VideoDriver. As you can imagine, textures of the DirectX and the OpenGL device 92VideoDriver. As you can imagine, textures of the DirectX and the OpenGL device
93will, e.g., not be compatible. An exception is the Software device and the 93will, e.g., not be compatible. An exception is the Software device and the
94NULL device, their textures are compatible. If you try to use a texture 94NULL device, their textures are compatible. If you try to use a texture
95created by one device with an other device, the device will refuse to do that 95created by one device with an other device, the device will refuse to do that
96and write a warning or an error message to the output buffer. 96and write a warning or an error message to the output buffer.
97*/ 97*/
98class ITexture : public virtual IReferenceCounted 98class ITexture : public virtual IReferenceCounted
99{ 99{
100public: 100public:
101 101
102 //! constructor 102 //! constructor
103 ITexture(const io::path& name) : NamedPath(name) 103 ITexture(const io::path& name) : NamedPath(name)
104 { 104 {
105 } 105 }
106 106
107 //! Lock function. 107 //! Lock function.
108 /** Locks the Texture and returns a pointer to access the 108 /** Locks the Texture and returns a pointer to access the
109 pixels. After lock() has been called and all operations on the pixels 109 pixels. After lock() has been called and all operations on the pixels
110 are done, you must call unlock(). 110 are done, you must call unlock().
111 Locks are not accumulating, hence one unlock will do for an arbitrary 111 Locks are not accumulating, hence one unlock will do for an arbitrary
112 number of previous locks. You should avoid locking different levels without 112 number of previous locks. You should avoid locking different levels without
113 unlocking inbetween, though, because only the last level locked will be 113 unlocking inbetween, though, because only the last level locked will be
114 unlocked. 114 unlocked.
115 The size of the i-th mipmap level is defined as max(getSize().Width>>i,1) 115 The size of the i-th mipmap level is defined as max(getSize().Width>>i,1)
116 and max(getSize().Height>>i,1) 116 and max(getSize().Height>>i,1)
117 \param mode Specifies what kind of changes to the locked texture are 117 \param mode Specifies what kind of changes to the locked texture are
118 allowed. Unspecified behavior will arise if texture is written in read 118 allowed. Unspecified behavior will arise if texture is written in read
119 only mode or read from in write only mode. 119 only mode or read from in write only mode.
120 Support for this feature depends on the driver, so don't rely on the 120 Support for this feature depends on the driver, so don't rely on the
121 texture being write-protected when locking with read-only, etc. 121 texture being write-protected when locking with read-only, etc.
122 \param mipmapLevel Number of the mipmapLevel to lock. 0 is main texture. 122 \param mipmapLevel Number of the mipmapLevel to lock. 0 is main texture.
123 Non-existing levels will silently fail and return 0. 123 Non-existing levels will silently fail and return 0.
124 \return Returns a pointer to the pixel data. The format of the pixel can 124 \return Returns a pointer to the pixel data. The format of the pixel can
125 be determined by using getColorFormat(). 0 is returned, if 125 be determined by using getColorFormat(). 0 is returned, if
126 the texture cannot be locked. */ 126 the texture cannot be locked. */
127 virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) = 0; 127 virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) = 0;
128 128
129 //! Unlock function. Must be called after a lock() to the texture. 129 //! Unlock function. Must be called after a lock() to the texture.
130 /** One should avoid to call unlock more than once before another lock. 130 /** One should avoid to call unlock more than once before another lock.
131 The last locked mip level will be unlocked. */ 131 The last locked mip level will be unlocked. */
132 virtual void unlock() = 0; 132 virtual void unlock() = 0;
133 133
134 //! Get original size of the texture. 134 //! Get original size of the texture.
135 /** The texture is usually scaled, if it was created with an unoptimal 135 /** The texture is usually scaled, if it was created with an unoptimal
136 size. For example if the size was not a power of two. This method 136 size. For example if the size was not a power of two. This method
137 returns the size of the texture it had before it was scaled. Can be 137 returns the size of the texture it had before it was scaled. Can be
138 useful when drawing 2d images on the screen, which should have the 138 useful when drawing 2d images on the screen, which should have the
139 exact size of the original texture. Use ITexture::getSize() if you want 139 exact size of the original texture. Use ITexture::getSize() if you want
140 to know the real size it has now stored in the system. 140 to know the real size it has now stored in the system.
141 \return The original size of the texture. */ 141 \return The original size of the texture. */
142 virtual const core::dimension2d<u32>& getOriginalSize() const = 0; 142 virtual const core::dimension2d<u32>& getOriginalSize() const = 0;
143 143
144 //! Get dimension (=size) of the texture. 144 //! Get dimension (=size) of the texture.
145 /** \return The size of the texture. */ 145 /** \return The size of the texture. */
146 virtual const core::dimension2d<u32>& getSize() const = 0; 146 virtual const core::dimension2d<u32>& getSize() const = 0;
147 147
148 //! Get driver type of texture. 148 //! Get driver type of texture.
149 /** This is the driver, which created the texture. This method is used 149 /** This is the driver, which created the texture. This method is used
150 internally by the video devices, to check, if they may use a texture 150 internally by the video devices, to check, if they may use a texture
151 because textures may be incompatible between different devices. 151 because textures may be incompatible between different devices.
152 \return Driver type of texture. */ 152 \return Driver type of texture. */
153 virtual E_DRIVER_TYPE getDriverType() const = 0; 153 virtual E_DRIVER_TYPE getDriverType() const = 0;
154 154
155 //! Get the color format of texture. 155 //! Get the color format of texture.
156 /** \return The color format of texture. */ 156 /** \return The color format of texture. */
157 virtual ECOLOR_FORMAT getColorFormat() const = 0; 157 virtual ECOLOR_FORMAT getColorFormat() const = 0;
158 158
159 //! Get pitch of the main texture (in bytes). 159 //! Get pitch of the main texture (in bytes).
160 /** The pitch is the amount of bytes used for a row of pixels in a 160 /** The pitch is the amount of bytes used for a row of pixels in a
161 texture. 161 texture.
162 \return Pitch of texture in bytes. */ 162 \return Pitch of texture in bytes. */
163 virtual u32 getPitch() const = 0; 163 virtual u32 getPitch() const = 0;
164 164
165 //! Check whether the texture has MipMaps 165 //! Check whether the texture has MipMaps
166 /** \return True if texture has MipMaps, else false. */ 166 /** \return True if texture has MipMaps, else false. */
167 virtual bool hasMipMaps() const { return false; } 167 virtual bool hasMipMaps() const { return false; }
168 168
169 //! Returns if the texture has an alpha channel 169 //! Returns if the texture has an alpha channel
170 virtual bool hasAlpha() const { 170 virtual bool hasAlpha() const {
171 return getColorFormat () == video::ECF_A8R8G8B8 || getColorFormat () == video::ECF_A1R5G5B5; 171 return getColorFormat () == video::ECF_A8R8G8B8 || getColorFormat () == video::ECF_A1R5G5B5;
172 } 172 }
173 173
174 //! Regenerates the mip map levels of the texture. 174 //! Regenerates the mip map levels of the texture.
175 /** Required after modifying the texture, usually after calling unlock(). 175 /** Required after modifying the texture, usually after calling unlock().
176 \param mipmapData Optional parameter to pass in image data which will be 176 \param mipmapData Optional parameter to pass in image data which will be
177 used instead of the previously stored or automatically generated mipmap 177 used instead of the previously stored or automatically generated mipmap
178 data. The data has to be a continuous pixel data for all mipmaps until 178 data. The data has to be a continuous pixel data for all mipmaps until
179 1x1 pixel. Each mipmap has to be half the width and height of the previous 179 1x1 pixel. Each mipmap has to be half the width and height of the previous
180 level. At least one pixel will be always kept.*/ 180 level. At least one pixel will be always kept.*/
181 virtual void regenerateMipMapLevels(void* mipmapData=0) = 0; 181 virtual void regenerateMipMapLevels(void* mipmapData=0) = 0;
182 182
183 //! Check whether the texture is a render target 183 //! Check whether the texture is a render target
184 /** Render targets can be set as such in the video driver, in order to 184 /** Render targets can be set as such in the video driver, in order to
185 render a scene into the texture. Once unbound as render target, they can 185 render a scene into the texture. Once unbound as render target, they can
186 be used just as usual textures again. 186 be used just as usual textures again.
187 \return True if this is a render target, otherwise false. */ 187 \return True if this is a render target, otherwise false. */
188 virtual bool isRenderTarget() const { return false; } 188 virtual bool isRenderTarget() const { return false; }
189 189
190 //! Get name of texture (in most cases this is the filename) 190 //! Get name of texture (in most cases this is the filename)
191 const io::SNamedPath& getName() const { return NamedPath; } 191 const io::SNamedPath& getName() const { return NamedPath; }
192 192
193protected: 193protected:
194 194
195 //! Helper function, helps to get the desired texture creation format from the flags. 195 //! Helper function, helps to get the desired texture creation format from the flags.
196 /** \return Either ETCF_ALWAYS_32_BIT, ETCF_ALWAYS_16_BIT, 196 /** \return Either ETCF_ALWAYS_32_BIT, ETCF_ALWAYS_16_BIT,
197 ETCF_OPTIMIZED_FOR_QUALITY, or ETCF_OPTIMIZED_FOR_SPEED. */ 197 ETCF_OPTIMIZED_FOR_QUALITY, or ETCF_OPTIMIZED_FOR_SPEED. */
198 inline E_TEXTURE_CREATION_FLAG getTextureFormatFromFlags(u32 flags) 198 inline E_TEXTURE_CREATION_FLAG getTextureFormatFromFlags(u32 flags)
199 { 199 {
200 if (flags & ETCF_OPTIMIZED_FOR_SPEED) 200 if (flags & ETCF_OPTIMIZED_FOR_SPEED)
201 return ETCF_OPTIMIZED_FOR_SPEED; 201 return ETCF_OPTIMIZED_FOR_SPEED;
202 if (flags & ETCF_ALWAYS_16_BIT) 202 if (flags & ETCF_ALWAYS_16_BIT)
203 return ETCF_ALWAYS_16_BIT; 203 return ETCF_ALWAYS_16_BIT;
204 if (flags & ETCF_ALWAYS_32_BIT) 204 if (flags & ETCF_ALWAYS_32_BIT)
205 return ETCF_ALWAYS_32_BIT; 205 return ETCF_ALWAYS_32_BIT;
206 if (flags & ETCF_OPTIMIZED_FOR_QUALITY) 206 if (flags & ETCF_OPTIMIZED_FOR_QUALITY)
207 return ETCF_OPTIMIZED_FOR_QUALITY; 207 return ETCF_OPTIMIZED_FOR_QUALITY;
208 return ETCF_OPTIMIZED_FOR_SPEED; 208 return ETCF_OPTIMIZED_FOR_SPEED;
209 } 209 }
210 210
211 io::SNamedPath NamedPath; 211 io::SNamedPath NamedPath;
212}; 212};
213 213
214 214
215} // end namespace video 215} // end namespace video
216} // end namespace irr 216} // end namespace irr
217 217
218#endif 218#endif
219 219
diff --git a/libraries/irrlicht-1.8/include/ITimer.h b/libraries/irrlicht-1.8/include/ITimer.h
index 815ebd6..610d6fa 100644
--- a/libraries/irrlicht-1.8/include/ITimer.h
+++ b/libraries/irrlicht-1.8/include/ITimer.h
@@ -1,103 +1,103 @@
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#ifndef __I_TIMER_H_INCLUDED__ 5#ifndef __I_TIMER_H_INCLUDED__
6#define __I_TIMER_H_INCLUDED__ 6#define __I_TIMER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12 12
13//! Interface for getting and manipulating the virtual time 13//! Interface for getting and manipulating the virtual time
14class ITimer : public virtual IReferenceCounted 14class ITimer : public virtual IReferenceCounted
15{ 15{
16public: 16public:
17 //! Returns current real time in milliseconds of the system. 17 //! Returns current real time in milliseconds of the system.
18 /** This value does not start with 0 when the application starts. 18 /** This value does not start with 0 when the application starts.
19 For example in one implementation the value returned could be the 19 For example in one implementation the value returned could be the
20 amount of milliseconds which have elapsed since the system was started. 20 amount of milliseconds which have elapsed since the system was started.
21 */ 21 */
22 virtual u32 getRealTime() const = 0; 22 virtual u32 getRealTime() const = 0;
23 23
24 enum EWeekday 24 enum EWeekday
25 { 25 {
26 EWD_SUNDAY=0, 26 EWD_SUNDAY=0,
27 EWD_MONDAY, 27 EWD_MONDAY,
28 EWD_TUESDAY, 28 EWD_TUESDAY,
29 EWD_WEDNESDAY, 29 EWD_WEDNESDAY,
30 EWD_THURSDAY, 30 EWD_THURSDAY,
31 EWD_FRIDAY, 31 EWD_FRIDAY,
32 EWD_SATURDAY 32 EWD_SATURDAY
33 }; 33 };
34 34
35 struct RealTimeDate 35 struct RealTimeDate
36 { 36 {
37 // Hour of the day, from 0 to 23 37 // Hour of the day, from 0 to 23
38 u32 Hour; 38 u32 Hour;
39 // Minute of the hour, from 0 to 59 39 // Minute of the hour, from 0 to 59
40 u32 Minute; 40 u32 Minute;
41 // Second of the minute, due to extra seconds from 0 to 61 41 // Second of the minute, due to extra seconds from 0 to 61
42 u32 Second; 42 u32 Second;
43 // Year of the gregorian calender 43 // Year of the gregorian calender
44 s32 Year; 44 s32 Year;
45 // Month of the year, from 1 to 12 45 // Month of the year, from 1 to 12
46 u32 Month; 46 u32 Month;
47 // Day of the month, from 1 to 31 47 // Day of the month, from 1 to 31
48 u32 Day; 48 u32 Day;
49 // Weekday for the current day 49 // Weekday for the current day
50 EWeekday Weekday; 50 EWeekday Weekday;
51 // Day of the year, from 1 to 366 51 // Day of the year, from 1 to 366
52 u32 Yearday; 52 u32 Yearday;
53 // Whether daylight saving is on 53 // Whether daylight saving is on
54 bool IsDST; 54 bool IsDST;
55 }; 55 };
56 56
57 virtual RealTimeDate getRealTimeAndDate() const = 0; 57 virtual RealTimeDate getRealTimeAndDate() const = 0;
58 58
59 //! Returns current virtual time in milliseconds. 59 //! Returns current virtual time in milliseconds.
60 /** This value starts with 0 and can be manipulated using setTime(), 60 /** This value starts with 0 and can be manipulated using setTime(),
61 stopTimer(), startTimer(), etc. This value depends on the set speed of 61 stopTimer(), startTimer(), etc. This value depends on the set speed of
62 the timer if the timer is stopped, etc. If you need the system time, 62 the timer if the timer is stopped, etc. If you need the system time,
63 use getRealTime() */ 63 use getRealTime() */
64 virtual u32 getTime() const = 0; 64 virtual u32 getTime() const = 0;
65 65
66 //! sets current virtual time 66 //! sets current virtual time
67 virtual void setTime(u32 time) = 0; 67 virtual void setTime(u32 time) = 0;
68 68
69 //! Stops the virtual timer. 69 //! Stops the virtual timer.
70 /** The timer is reference counted, which means everything which calls 70 /** The timer is reference counted, which means everything which calls
71 stop() will also have to call start(), otherwise the timer may not 71 stop() will also have to call start(), otherwise the timer may not
72 start/stop correctly again. */ 72 start/stop correctly again. */
73 virtual void stop() = 0; 73 virtual void stop() = 0;
74 74
75 //! Starts the virtual timer. 75 //! Starts the virtual timer.
76 /** The timer is reference counted, which means everything which calls 76 /** The timer is reference counted, which means everything which calls
77 stop() will also have to call start(), otherwise the timer may not 77 stop() will also have to call start(), otherwise the timer may not
78 start/stop correctly again. */ 78 start/stop correctly again. */
79 virtual void start() = 0; 79 virtual void start() = 0;
80 80
81 //! Sets the speed of the timer 81 //! Sets the speed of the timer
82 /** The speed is the factor with which the time is running faster or 82 /** The speed is the factor with which the time is running faster or
83 slower then the real system time. */ 83 slower then the real system time. */
84 virtual void setSpeed(f32 speed = 1.0f) = 0; 84 virtual void setSpeed(f32 speed = 1.0f) = 0;
85 85
86 //! Returns current speed of the timer 86 //! Returns current speed of the timer
87 /** The speed is the factor with which the time is running faster or 87 /** The speed is the factor with which the time is running faster or
88 slower then the real system time. */ 88 slower then the real system time. */
89 virtual f32 getSpeed() const = 0; 89 virtual f32 getSpeed() const = 0;
90 90
91 //! Returns if the virtual timer is currently stopped 91 //! Returns if the virtual timer is currently stopped
92 virtual bool isStopped() const = 0; 92 virtual bool isStopped() const = 0;
93 93
94 //! Advances the virtual time 94 //! Advances the virtual time
95 /** Makes the virtual timer update the time value based on the real 95 /** Makes the virtual timer update the time value based on the real
96 time. This is called automatically when calling IrrlichtDevice::run(), 96 time. This is called automatically when calling IrrlichtDevice::run(),
97 but you can call it manually if you don't use this method. */ 97 but you can call it manually if you don't use this method. */
98 virtual void tick() = 0; 98 virtual void tick() = 0;
99}; 99};
100 100
101} // end namespace irr 101} // end namespace irr
102 102
103#endif 103#endif
diff --git a/libraries/irrlicht-1.8/include/ITriangleSelector.h b/libraries/irrlicht-1.8/include/ITriangleSelector.h
index e2a2256..9d038df 100644
--- a/libraries/irrlicht-1.8/include/ITriangleSelector.h
+++ b/libraries/irrlicht-1.8/include/ITriangleSelector.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#ifndef __I_TRIANGLE_SELECTOR_H_INCLUDED__ 5#ifndef __I_TRIANGLE_SELECTOR_H_INCLUDED__
6#define __I_TRIANGLE_SELECTOR_H_INCLUDED__ 6#define __I_TRIANGLE_SELECTOR_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "triangle3d.h" 9#include "triangle3d.h"
10#include "aabbox3d.h" 10#include "aabbox3d.h"
11#include "matrix4.h" 11#include "matrix4.h"
12#include "line3d.h" 12#include "line3d.h"
13 13
14namespace irr 14namespace irr
15{ 15{
16namespace scene 16namespace scene
17{ 17{
18 18
19class ISceneNode; 19class ISceneNode;
20 20
21//! Interface to return triangles with specific properties. 21//! Interface to return triangles with specific properties.
22/** Every ISceneNode may have a triangle selector, available with 22/** Every ISceneNode may have a triangle selector, available with
23ISceneNode::getTriangleScelector() or ISceneManager::createTriangleSelector. 23ISceneNode::getTriangleScelector() or ISceneManager::createTriangleSelector.
24This is used for doing collision detection: For example if you know, that a 24This is used for doing collision detection: For example if you know, that a
25collision may have happened in the area between (1,1,1) and (10,10,10), you 25collision may have happened in the area between (1,1,1) and (10,10,10), you
26can get all triangles of the scene node in this area with the 26can get all triangles of the scene node in this area with the
27ITriangleSelector easily and check every triangle if it collided. */ 27ITriangleSelector easily and check every triangle if it collided. */
28class ITriangleSelector : public virtual IReferenceCounted 28class ITriangleSelector : public virtual IReferenceCounted
29{ 29{
30public: 30public:
31 31
32 //! Get amount of all available triangles in this selector 32 //! Get amount of all available triangles in this selector
33 virtual s32 getTriangleCount() const = 0; 33 virtual s32 getTriangleCount() const = 0;
34 34
35 //! Gets the triangles for one associated node. 35 //! Gets the triangles for one associated node.
36 /** 36 /**
37 This returns all triangles for one scene node associated with this 37 This returns all triangles for one scene node associated with this
38 selector. If there is more than one scene node associated (e.g. for 38 selector. If there is more than one scene node associated (e.g. for
39 an IMetaTriangleSelector) this this function may be called multiple 39 an IMetaTriangleSelector) this this function may be called multiple
40 times to retrieve all triangles. 40 times to retrieve all triangles.
41 \param triangles Array where the resulting triangles will be 41 \param triangles Array where the resulting triangles will be
42 written to. 42 written to.
43 \param arraySize Size of the target array. 43 \param arraySize Size of the target array.
44 \param outTriangleCount: Amount of triangles which have been written 44 \param outTriangleCount: Amount of triangles which have been written
45 into the array. 45 into the array.
46 \param transform Pointer to matrix for transforming the triangles 46 \param transform Pointer to matrix for transforming the triangles
47 before they are returned. Useful for example to scale all triangles 47 before they are returned. Useful for example to scale all triangles
48 down into an ellipsoid space. If this pointer is null, no 48 down into an ellipsoid space. If this pointer is null, no
49 transformation will be done. */ 49 transformation will be done. */
50 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, 50 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
51 s32& outTriangleCount, const core::matrix4* transform=0) const = 0; 51 s32& outTriangleCount, const core::matrix4* transform=0) const = 0;
52 52
53 //! Gets the triangles for one associated node which may lie within a specific bounding box. 53 //! Gets the triangles for one associated node which may lie within a specific bounding box.
54 /** 54 /**
55 This returns all triangles for one scene node associated with this 55 This returns all triangles for one scene node associated with this
56 selector. If there is more than one scene node associated (e.g. for 56 selector. If there is more than one scene node associated (e.g. for
57 an IMetaTriangleSelector) this this function may be called multiple 57 an IMetaTriangleSelector) this this function may be called multiple
58 times to retrieve all triangles. 58 times to retrieve all triangles.
59 59
60 This method will return at least the triangles that intersect the box, 60 This method will return at least the triangles that intersect the box,
61 but may return other triangles as well. 61 but may return other triangles as well.
62 \param triangles Array where the resulting triangles will be written 62 \param triangles Array where the resulting triangles will be written
63 to. 63 to.
64 \param arraySize Size of the target array. 64 \param arraySize Size of the target array.
65 \param outTriangleCount Amount of triangles which have been written 65 \param outTriangleCount Amount of triangles which have been written
66 into the array. 66 into the array.
67 \param box Only triangles which are in this axis aligned bounding box 67 \param box Only triangles which are in this axis aligned bounding box
68 will be written into the array. 68 will be written into the array.
69 \param transform Pointer to matrix for transforming the triangles 69 \param transform Pointer to matrix for transforming the triangles
70 before they are returned. Useful for example to scale all triangles 70 before they are returned. Useful for example to scale all triangles
71 down into an ellipsoid space. If this pointer is null, no 71 down into an ellipsoid space. If this pointer is null, no
72 transformation will be done. */ 72 transformation will be done. */
73 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, 73 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
74 s32& outTriangleCount, const core::aabbox3d<f32>& box, 74 s32& outTriangleCount, const core::aabbox3d<f32>& box,
75 const core::matrix4* transform=0) const = 0; 75 const core::matrix4* transform=0) const = 0;
76 76
77 //! Gets the triangles for one associated node which have or may have contact with a 3d line. 77 //! Gets the triangles for one associated node which have or may have contact with a 3d line.
78 /** 78 /**
79 This returns all triangles for one scene node associated with this 79 This returns all triangles for one scene node associated with this
80 selector. If there is more than one scene node associated (e.g. for 80 selector. If there is more than one scene node associated (e.g. for
81 an IMetaTriangleSelector) this this function may be called multiple 81 an IMetaTriangleSelector) this this function may be called multiple
82 times to retrieve all triangles. 82 times to retrieve all triangles.
83 83
84 Please note that unoptimized triangle selectors also may return 84 Please note that unoptimized triangle selectors also may return
85 triangles which are not in contact at all with the 3d line. 85 triangles which are not in contact at all with the 3d line.
86 \param triangles Array where the resulting triangles will be written 86 \param triangles Array where the resulting triangles will be written
87 to. 87 to.
88 \param arraySize Size of the target array. 88 \param arraySize Size of the target array.
89 \param outTriangleCount Amount of triangles which have been written 89 \param outTriangleCount Amount of triangles which have been written
90 into the array. 90 into the array.
91 \param line Only triangles which may be in contact with this 3d line 91 \param line Only triangles which may be in contact with this 3d line
92 will be written into the array. 92 will be written into the array.
93 \param transform Pointer to matrix for transforming the triangles 93 \param transform Pointer to matrix for transforming the triangles
94 before they are returned. Useful for example to scale all triangles 94 before they are returned. Useful for example to scale all triangles
95 down into an ellipsoid space. If this pointer is null, no 95 down into an ellipsoid space. If this pointer is null, no
96 transformation will be done. */ 96 transformation will be done. */
97 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, 97 virtual void getTriangles(core::triangle3df* triangles, s32 arraySize,
98 s32& outTriangleCount, const core::line3d<f32>& line, 98 s32& outTriangleCount, const core::line3d<f32>& line,
99 const core::matrix4* transform=0) const = 0; 99 const core::matrix4* transform=0) const = 0;
100 100
101 //! Get scene node associated with a given triangle. 101 //! Get scene node associated with a given triangle.
102 /** 102 /**
103 This allows to find which scene node (potentially of several) is 103 This allows to find which scene node (potentially of several) is
104 associated with a specific triangle. 104 associated with a specific triangle.
105 105
106 \param triangleIndex: the index of the triangle for which you want to find 106 \param triangleIndex: the index of the triangle for which you want to find
107 the associated scene node. 107 the associated scene node.
108 \return The scene node associated with that triangle. 108 \return The scene node associated with that triangle.
109 */ 109 */
110 virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const = 0; 110 virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const = 0;
111 111
112 //! Get number of TriangleSelectors that are part of this one 112 //! Get number of TriangleSelectors that are part of this one
113 /** Only useful for MetaTriangleSelector, others return 1 113 /** Only useful for MetaTriangleSelector, others return 1
114 */ 114 */
115 virtual u32 getSelectorCount() const = 0; 115 virtual u32 getSelectorCount() const = 0;
116 116
117 //! Get TriangleSelector based on index based on getSelectorCount 117 //! Get TriangleSelector based on index based on getSelectorCount
118 /** Only useful for MetaTriangleSelector, others return 'this' or 0 118 /** Only useful for MetaTriangleSelector, others return 'this' or 0
119 */ 119 */
120 virtual ITriangleSelector* getSelector(u32 index) = 0; 120 virtual ITriangleSelector* getSelector(u32 index) = 0;
121 121
122 //! Get TriangleSelector based on index based on getSelectorCount 122 //! Get TriangleSelector based on index based on getSelectorCount
123 /** Only useful for MetaTriangleSelector, others return 'this' or 0 123 /** Only useful for MetaTriangleSelector, others return 'this' or 0
124 */ 124 */
125 virtual const ITriangleSelector* getSelector(u32 index) const = 0; 125 virtual const ITriangleSelector* getSelector(u32 index) const = 0;
126}; 126};
127 127
128} // end namespace scene 128} // end namespace scene
129} // end namespace irr 129} // end namespace irr
130 130
131#endif 131#endif
diff --git a/libraries/irrlicht-1.8/include/IVertexBuffer.h b/libraries/irrlicht-1.8/include/IVertexBuffer.h
index 87603de..04606b2 100644
--- a/libraries/irrlicht-1.8/include/IVertexBuffer.h
+++ b/libraries/irrlicht-1.8/include/IVertexBuffer.h
@@ -1,52 +1,52 @@
1// Copyright (C) 2008-2012 Nikolaus Gebhardt 1// Copyright (C) 2008-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#ifndef __I_VERTEX_BUFFER_H_INCLUDED__ 5#ifndef __I_VERTEX_BUFFER_H_INCLUDED__
6#define __I_VERTEX_BUFFER_H_INCLUDED__ 6#define __I_VERTEX_BUFFER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "irrArray.h" 9#include "irrArray.h"
10#include "S3DVertex.h" 10#include "S3DVertex.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace scene 14namespace scene
15{ 15{
16 16
17 class IVertexBuffer : public virtual IReferenceCounted 17 class IVertexBuffer : public virtual IReferenceCounted
18 { 18 {
19 public: 19 public:
20 virtual void* getData() =0; 20 virtual void* getData() =0;
21 virtual video::E_VERTEX_TYPE getType() const =0; 21 virtual video::E_VERTEX_TYPE getType() const =0;
22 virtual void setType(video::E_VERTEX_TYPE vertexType) =0; 22 virtual void setType(video::E_VERTEX_TYPE vertexType) =0;
23 virtual u32 stride() const =0; 23 virtual u32 stride() const =0;
24 virtual u32 size() const =0; 24 virtual u32 size() const =0;
25 virtual void push_back(const video::S3DVertex &element) =0; 25 virtual void push_back(const video::S3DVertex &element) =0;
26 virtual video::S3DVertex& operator [](const u32 index) const =0; 26 virtual video::S3DVertex& operator [](const u32 index) const =0;
27 virtual video::S3DVertex& getLast() =0; 27 virtual video::S3DVertex& getLast() =0;
28 virtual void set_used(u32 usedNow) =0; 28 virtual void set_used(u32 usedNow) =0;
29 virtual void reallocate(u32 new_size) =0; 29 virtual void reallocate(u32 new_size) =0;
30 virtual u32 allocated_size() const =0; 30 virtual u32 allocated_size() const =0;
31 virtual video::S3DVertex* pointer() =0; 31 virtual video::S3DVertex* pointer() =0;
32 32
33 //! get the current hardware mapping hint 33 //! get the current hardware mapping hint
34 virtual E_HARDWARE_MAPPING getHardwareMappingHint() const =0; 34 virtual E_HARDWARE_MAPPING getHardwareMappingHint() const =0;
35 35
36 //! set the hardware mapping hint, for driver 36 //! set the hardware mapping hint, for driver
37 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) =0; 37 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) =0;
38 38
39 //! flags the meshbuffer as changed, reloads hardware buffers 39 //! flags the meshbuffer as changed, reloads hardware buffers
40 virtual void setDirty() =0; 40 virtual void setDirty() =0;
41 41
42 //! Get the currently used ID for identification of changes. 42 //! Get the currently used ID for identification of changes.
43 /** This shouldn't be used for anything outside the VideoDriver. */ 43 /** This shouldn't be used for anything outside the VideoDriver. */
44 virtual u32 getChangedID() const = 0; 44 virtual u32 getChangedID() const = 0;
45 }; 45 };
46 46
47 47
48} // end namespace scene 48} // end namespace scene
49} // end namespace irr 49} // end namespace irr
50 50
51#endif 51#endif
52 52
diff --git a/libraries/irrlicht-1.8/include/IVideoDriver.h b/libraries/irrlicht-1.8/include/IVideoDriver.h
index 8af6607..6e788f9 100644
--- a/libraries/irrlicht-1.8/include/IVideoDriver.h
+++ b/libraries/irrlicht-1.8/include/IVideoDriver.h
@@ -1,1471 +1,1471 @@
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#ifndef __IRR_I_VIDEO_DRIVER_H_INCLUDED__ 5#ifndef __IRR_I_VIDEO_DRIVER_H_INCLUDED__
6#define __IRR_I_VIDEO_DRIVER_H_INCLUDED__ 6#define __IRR_I_VIDEO_DRIVER_H_INCLUDED__
7 7
8#include "rect.h" 8#include "rect.h"
9#include "SColor.h" 9#include "SColor.h"
10#include "ITexture.h" 10#include "ITexture.h"
11#include "irrArray.h" 11#include "irrArray.h"
12#include "matrix4.h" 12#include "matrix4.h"
13#include "plane3d.h" 13#include "plane3d.h"
14#include "dimension2d.h" 14#include "dimension2d.h"
15#include "position2d.h" 15#include "position2d.h"
16#include "SMaterial.h" 16#include "SMaterial.h"
17#include "IMeshBuffer.h" 17#include "IMeshBuffer.h"
18#include "triangle3d.h" 18#include "triangle3d.h"
19#include "EDriverTypes.h" 19#include "EDriverTypes.h"
20#include "EDriverFeatures.h" 20#include "EDriverFeatures.h"
21#include "SExposedVideoData.h" 21#include "SExposedVideoData.h"
22 22
23namespace irr 23namespace irr
24{ 24{
25namespace io 25namespace io
26{ 26{
27 class IAttributes; 27 class IAttributes;
28 struct SAttributeReadWriteOptions; 28 struct SAttributeReadWriteOptions;
29 class IReadFile; 29 class IReadFile;
30 class IWriteFile; 30 class IWriteFile;
31} // end namespace io 31} // end namespace io
32namespace scene 32namespace scene
33{ 33{
34 class IMeshBuffer; 34 class IMeshBuffer;
35 class IMesh; 35 class IMesh;
36 class IMeshManipulator; 36 class IMeshManipulator;
37 class ISceneNode; 37 class ISceneNode;
38} // end namespace scene 38} // end namespace scene
39 39
40namespace video 40namespace video
41{ 41{
42 struct S3DVertex; 42 struct S3DVertex;
43 struct S3DVertex2TCoords; 43 struct S3DVertex2TCoords;
44 struct S3DVertexTangents; 44 struct S3DVertexTangents;
45 struct SLight; 45 struct SLight;
46 class IImageLoader; 46 class IImageLoader;
47 class IImageWriter; 47 class IImageWriter;
48 class IMaterialRenderer; 48 class IMaterialRenderer;
49 class IGPUProgrammingServices; 49 class IGPUProgrammingServices;
50 50
51 //! enumeration for geometry transformation states 51 //! enumeration for geometry transformation states
52 enum E_TRANSFORMATION_STATE 52 enum E_TRANSFORMATION_STATE
53 { 53 {
54 //! View transformation 54 //! View transformation
55 ETS_VIEW = 0, 55 ETS_VIEW = 0,
56 //! World transformation 56 //! World transformation
57 ETS_WORLD, 57 ETS_WORLD,
58 //! Projection transformation 58 //! Projection transformation
59 ETS_PROJECTION, 59 ETS_PROJECTION,
60 //! Texture transformation 60 //! Texture transformation
61 ETS_TEXTURE_0, 61 ETS_TEXTURE_0,
62 //! Texture transformation 62 //! Texture transformation
63 ETS_TEXTURE_1, 63 ETS_TEXTURE_1,
64 //! Texture transformation 64 //! Texture transformation
65 ETS_TEXTURE_2, 65 ETS_TEXTURE_2,
66 //! Texture transformation 66 //! Texture transformation
67 ETS_TEXTURE_3, 67 ETS_TEXTURE_3,
68#if _IRR_MATERIAL_MAX_TEXTURES_>4 68#if _IRR_MATERIAL_MAX_TEXTURES_>4
69 //! Texture transformation 69 //! Texture transformation
70 ETS_TEXTURE_4, 70 ETS_TEXTURE_4,
71#if _IRR_MATERIAL_MAX_TEXTURES_>5 71#if _IRR_MATERIAL_MAX_TEXTURES_>5
72 //! Texture transformation 72 //! Texture transformation
73 ETS_TEXTURE_5, 73 ETS_TEXTURE_5,
74#if _IRR_MATERIAL_MAX_TEXTURES_>6 74#if _IRR_MATERIAL_MAX_TEXTURES_>6
75 //! Texture transformation 75 //! Texture transformation
76 ETS_TEXTURE_6, 76 ETS_TEXTURE_6,
77#if _IRR_MATERIAL_MAX_TEXTURES_>7 77#if _IRR_MATERIAL_MAX_TEXTURES_>7
78 //! Texture transformation 78 //! Texture transformation
79 ETS_TEXTURE_7, 79 ETS_TEXTURE_7,
80#endif 80#endif
81#endif 81#endif
82#endif 82#endif
83#endif 83#endif
84 //! Not used 84 //! Not used
85 ETS_COUNT 85 ETS_COUNT
86 }; 86 };
87 87
88 //! enumeration for signaling resources which were lost after the last render cycle 88 //! enumeration for signaling resources which were lost after the last render cycle
89 /** These values can be signaled by the driver, telling the app that some resources 89 /** These values can be signaled by the driver, telling the app that some resources
90 were lost and need to be recreated. Irrlicht will sometimes recreate the actual objects, 90 were lost and need to be recreated. Irrlicht will sometimes recreate the actual objects,
91 but the content needs to be recreated by the application. */ 91 but the content needs to be recreated by the application. */
92 enum E_LOST_RESOURCE 92 enum E_LOST_RESOURCE
93 { 93 {
94 //! The whole device/driver is lost 94 //! The whole device/driver is lost
95 ELR_DEVICE = 1, 95 ELR_DEVICE = 1,
96 //! All texture are lost, rare problem 96 //! All texture are lost, rare problem
97 ELR_TEXTURES = 2, 97 ELR_TEXTURES = 2,
98 //! The Render Target Textures are lost, typical problem for D3D 98 //! The Render Target Textures are lost, typical problem for D3D
99 ELR_RTTS = 4, 99 ELR_RTTS = 4,
100 //! The HW buffers are lost, will be recreated automatically, but might require some more time this frame 100 //! The HW buffers are lost, will be recreated automatically, but might require some more time this frame
101 ELR_HW_BUFFERS = 8 101 ELR_HW_BUFFERS = 8
102 }; 102 };
103 103
104 //! Special render targets, which usually map to dedicated hardware 104 //! Special render targets, which usually map to dedicated hardware
105 /** These render targets (besides 0 and 1) need not be supported by gfx cards */ 105 /** These render targets (besides 0 and 1) need not be supported by gfx cards */
106 enum E_RENDER_TARGET 106 enum E_RENDER_TARGET
107 { 107 {
108 //! Render target is the main color frame buffer 108 //! Render target is the main color frame buffer
109 ERT_FRAME_BUFFER=0, 109 ERT_FRAME_BUFFER=0,
110 //! Render target is a render texture 110 //! Render target is a render texture
111 ERT_RENDER_TEXTURE, 111 ERT_RENDER_TEXTURE,
112 //! Multi-Render target textures 112 //! Multi-Render target textures
113 ERT_MULTI_RENDER_TEXTURES, 113 ERT_MULTI_RENDER_TEXTURES,
114 //! Render target is the main color frame buffer 114 //! Render target is the main color frame buffer
115 ERT_STEREO_LEFT_BUFFER, 115 ERT_STEREO_LEFT_BUFFER,
116 //! Render target is the right color buffer (left is the main buffer) 116 //! Render target is the right color buffer (left is the main buffer)
117 ERT_STEREO_RIGHT_BUFFER, 117 ERT_STEREO_RIGHT_BUFFER,
118 //! Render to both stereo buffers at once 118 //! Render to both stereo buffers at once
119 ERT_STEREO_BOTH_BUFFERS, 119 ERT_STEREO_BOTH_BUFFERS,
120 //! Auxiliary buffer 0 120 //! Auxiliary buffer 0
121 ERT_AUX_BUFFER0, 121 ERT_AUX_BUFFER0,
122 //! Auxiliary buffer 1 122 //! Auxiliary buffer 1
123 ERT_AUX_BUFFER1, 123 ERT_AUX_BUFFER1,
124 //! Auxiliary buffer 2 124 //! Auxiliary buffer 2
125 ERT_AUX_BUFFER2, 125 ERT_AUX_BUFFER2,
126 //! Auxiliary buffer 3 126 //! Auxiliary buffer 3
127 ERT_AUX_BUFFER3, 127 ERT_AUX_BUFFER3,
128 //! Auxiliary buffer 4 128 //! Auxiliary buffer 4
129 ERT_AUX_BUFFER4 129 ERT_AUX_BUFFER4
130 }; 130 };
131 131
132 //! Enum for the types of fog distributions to choose from 132 //! Enum for the types of fog distributions to choose from
133 enum E_FOG_TYPE 133 enum E_FOG_TYPE
134 { 134 {
135 EFT_FOG_EXP=0, 135 EFT_FOG_EXP=0,
136 EFT_FOG_LINEAR, 136 EFT_FOG_LINEAR,
137 EFT_FOG_EXP2 137 EFT_FOG_EXP2
138 }; 138 };
139 139
140 const c8* const FogTypeNames[] = 140 const c8* const FogTypeNames[] =
141 { 141 {
142 "FogExp", 142 "FogExp",
143 "FogLinear", 143 "FogLinear",
144 "FogExp2", 144 "FogExp2",
145 0 145 0
146 }; 146 };
147 147
148 struct SOverrideMaterial 148 struct SOverrideMaterial
149 { 149 {
150 //! The Material values 150 //! The Material values
151 SMaterial Material; 151 SMaterial Material;
152 //! Which values are taken for override 152 //! Which values are taken for override
153 /** OR'ed values from E_MATERIAL_FLAGS. */ 153 /** OR'ed values from E_MATERIAL_FLAGS. */
154 u32 EnableFlags; 154 u32 EnableFlags;
155 //! Set in which render passes the material override is active. 155 //! Set in which render passes the material override is active.
156 /** OR'ed values from E_SCENE_NODE_RENDER_PASS. */ 156 /** OR'ed values from E_SCENE_NODE_RENDER_PASS. */
157 u16 EnablePasses; 157 u16 EnablePasses;
158 //! Global enable flag, overwritten by the SceneManager in each pass 158 //! Global enable flag, overwritten by the SceneManager in each pass
159 /** The Scenemanager uses the EnablePass array and sets Enabled to 159 /** The Scenemanager uses the EnablePass array and sets Enabled to
160 true if the Override material is enabled in the current pass. */ 160 true if the Override material is enabled in the current pass. */
161 bool Enabled; 161 bool Enabled;
162 162
163 //! Default constructor 163 //! Default constructor
164 SOverrideMaterial() : EnableFlags(0), EnablePasses(0), Enabled(false) {} 164 SOverrideMaterial() : EnableFlags(0), EnablePasses(0), Enabled(false) {}
165 165
166 //! Apply the enabled overrides 166 //! Apply the enabled overrides
167 void apply(SMaterial& material) 167 void apply(SMaterial& material)
168 { 168 {
169 if (Enabled) 169 if (Enabled)
170 { 170 {
171 for (u32 i=0; i<32; ++i) 171 for (u32 i=0; i<32; ++i)
172 { 172 {
173 const u32 num=(1<<i); 173 const u32 num=(1<<i);
174 if (EnableFlags & num) 174 if (EnableFlags & num)
175 { 175 {
176 switch (num) 176 switch (num)
177 { 177 {
178 case EMF_WIREFRAME: material.Wireframe = Material.Wireframe; break; 178 case EMF_WIREFRAME: material.Wireframe = Material.Wireframe; break;
179 case EMF_POINTCLOUD: material.PointCloud = Material.PointCloud; break; 179 case EMF_POINTCLOUD: material.PointCloud = Material.PointCloud; break;
180 case EMF_GOURAUD_SHADING: material.GouraudShading = Material.GouraudShading; break; 180 case EMF_GOURAUD_SHADING: material.GouraudShading = Material.GouraudShading; break;
181 case EMF_LIGHTING: material.Lighting = Material.Lighting; break; 181 case EMF_LIGHTING: material.Lighting = Material.Lighting; break;
182 case EMF_ZBUFFER: material.ZBuffer = Material.ZBuffer; break; 182 case EMF_ZBUFFER: material.ZBuffer = Material.ZBuffer; break;
183 case EMF_ZWRITE_ENABLE: material.ZWriteEnable = Material.ZWriteEnable; break; 183 case EMF_ZWRITE_ENABLE: material.ZWriteEnable = Material.ZWriteEnable; break;
184 case EMF_BACK_FACE_CULLING: material.BackfaceCulling = Material.BackfaceCulling; break; 184 case EMF_BACK_FACE_CULLING: material.BackfaceCulling = Material.BackfaceCulling; break;
185 case EMF_FRONT_FACE_CULLING: material.FrontfaceCulling = Material.FrontfaceCulling; break; 185 case EMF_FRONT_FACE_CULLING: material.FrontfaceCulling = Material.FrontfaceCulling; break;
186 case EMF_BILINEAR_FILTER: material.TextureLayer[0].BilinearFilter = Material.TextureLayer[0].BilinearFilter; break; 186 case EMF_BILINEAR_FILTER: material.TextureLayer[0].BilinearFilter = Material.TextureLayer[0].BilinearFilter; break;
187 case EMF_TRILINEAR_FILTER: material.TextureLayer[0].TrilinearFilter = Material.TextureLayer[0].TrilinearFilter; break; 187 case EMF_TRILINEAR_FILTER: material.TextureLayer[0].TrilinearFilter = Material.TextureLayer[0].TrilinearFilter; break;
188 case EMF_ANISOTROPIC_FILTER: material.TextureLayer[0].AnisotropicFilter = Material.TextureLayer[0].AnisotropicFilter; break; 188 case EMF_ANISOTROPIC_FILTER: material.TextureLayer[0].AnisotropicFilter = Material.TextureLayer[0].AnisotropicFilter; break;
189 case EMF_FOG_ENABLE: material.FogEnable = Material.FogEnable; break; 189 case EMF_FOG_ENABLE: material.FogEnable = Material.FogEnable; break;
190 case EMF_NORMALIZE_NORMALS: material.NormalizeNormals = Material.NormalizeNormals; break; 190 case EMF_NORMALIZE_NORMALS: material.NormalizeNormals = Material.NormalizeNormals; break;
191 case EMF_TEXTURE_WRAP: 191 case EMF_TEXTURE_WRAP:
192 material.TextureLayer[0].TextureWrapU = Material.TextureLayer[0].TextureWrapU; 192 material.TextureLayer[0].TextureWrapU = Material.TextureLayer[0].TextureWrapU;
193 material.TextureLayer[0].TextureWrapV = Material.TextureLayer[0].TextureWrapV; 193 material.TextureLayer[0].TextureWrapV = Material.TextureLayer[0].TextureWrapV;
194 break; 194 break;
195 case EMF_ANTI_ALIASING: material.AntiAliasing = Material.AntiAliasing; break; 195 case EMF_ANTI_ALIASING: material.AntiAliasing = Material.AntiAliasing; break;
196 case EMF_COLOR_MASK: material.ColorMask = Material.ColorMask; break; 196 case EMF_COLOR_MASK: material.ColorMask = Material.ColorMask; break;
197 case EMF_COLOR_MATERIAL: material.ColorMaterial = Material.ColorMaterial; break; 197 case EMF_COLOR_MATERIAL: material.ColorMaterial = Material.ColorMaterial; break;
198 case EMF_USE_MIP_MAPS: material.UseMipMaps = Material.UseMipMaps; break; 198 case EMF_USE_MIP_MAPS: material.UseMipMaps = Material.UseMipMaps; break;
199 case EMF_BLEND_OPERATION: material.BlendOperation = Material.BlendOperation; break; 199 case EMF_BLEND_OPERATION: material.BlendOperation = Material.BlendOperation; break;
200 case EMF_POLYGON_OFFSET: 200 case EMF_POLYGON_OFFSET:
201 material.PolygonOffsetDirection = Material.PolygonOffsetDirection; 201 material.PolygonOffsetDirection = Material.PolygonOffsetDirection;
202 material.PolygonOffsetFactor = Material.PolygonOffsetFactor; break; 202 material.PolygonOffsetFactor = Material.PolygonOffsetFactor; break;
203 } 203 }
204 } 204 }
205 } 205 }
206 } 206 }
207 } 207 }
208 208
209 }; 209 };
210 210
211 struct IRenderTarget 211 struct IRenderTarget
212 { 212 {
213 IRenderTarget(ITexture* texture, 213 IRenderTarget(ITexture* texture,
214 E_COLOR_PLANE colorMask=ECP_ALL, 214 E_COLOR_PLANE colorMask=ECP_ALL,
215 E_BLEND_FACTOR blendFuncSrc=EBF_ONE, 215 E_BLEND_FACTOR blendFuncSrc=EBF_ONE,
216 E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA, 216 E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA,
217 E_BLEND_OPERATION blendOp=EBO_NONE) : 217 E_BLEND_OPERATION blendOp=EBO_NONE) :
218 RenderTexture(texture), 218 RenderTexture(texture),
219 TargetType(ERT_RENDER_TEXTURE), ColorMask(colorMask), 219 TargetType(ERT_RENDER_TEXTURE), ColorMask(colorMask),
220 BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst), 220 BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst),
221 BlendOp(blendOp) {} 221 BlendOp(blendOp) {}
222 IRenderTarget(E_RENDER_TARGET target, 222 IRenderTarget(E_RENDER_TARGET target,
223 E_COLOR_PLANE colorMask=ECP_ALL, 223 E_COLOR_PLANE colorMask=ECP_ALL,
224 E_BLEND_FACTOR blendFuncSrc=EBF_ONE, 224 E_BLEND_FACTOR blendFuncSrc=EBF_ONE,
225 E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA, 225 E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA,
226 E_BLEND_OPERATION blendOp=EBO_NONE) : 226 E_BLEND_OPERATION blendOp=EBO_NONE) :
227 RenderTexture(0), 227 RenderTexture(0),
228 TargetType(target), ColorMask(colorMask), 228 TargetType(target), ColorMask(colorMask),
229 BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst), 229 BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst),
230 BlendOp(blendOp) {} 230 BlendOp(blendOp) {}
231 bool operator!=(const IRenderTarget& other) const 231 bool operator!=(const IRenderTarget& other) const
232 { 232 {
233 return ((RenderTexture != other.RenderTexture) || 233 return ((RenderTexture != other.RenderTexture) ||
234 (TargetType != other.TargetType) || 234 (TargetType != other.TargetType) ||
235 (ColorMask != other.ColorMask) || 235 (ColorMask != other.ColorMask) ||
236 (BlendFuncSrc != other.BlendFuncSrc) || 236 (BlendFuncSrc != other.BlendFuncSrc) ||
237 (BlendFuncDst != other.BlendFuncDst) || 237 (BlendFuncDst != other.BlendFuncDst) ||
238 (BlendOp != other.BlendOp)); 238 (BlendOp != other.BlendOp));
239 } 239 }
240 ITexture* RenderTexture; 240 ITexture* RenderTexture;
241 E_RENDER_TARGET TargetType:8; 241 E_RENDER_TARGET TargetType:8;
242 E_COLOR_PLANE ColorMask:8; 242 E_COLOR_PLANE ColorMask:8;
243 E_BLEND_FACTOR BlendFuncSrc:4; 243 E_BLEND_FACTOR BlendFuncSrc:4;
244 E_BLEND_FACTOR BlendFuncDst:4; 244 E_BLEND_FACTOR BlendFuncDst:4;
245 E_BLEND_OPERATION BlendOp:4; 245 E_BLEND_OPERATION BlendOp:4;
246 }; 246 };
247 247
248 //! Interface to driver which is able to perform 2d and 3d graphics functions. 248 //! Interface to driver which is able to perform 2d and 3d graphics functions.
249 /** This interface is one of the most important interfaces of 249 /** This interface is one of the most important interfaces of
250 the Irrlicht Engine: All rendering and texture manipulation is done with 250 the Irrlicht Engine: All rendering and texture manipulation is done with
251 this interface. You are able to use the Irrlicht Engine by only 251 this interface. You are able to use the Irrlicht Engine by only
252 invoking methods of this interface if you like to, although the 252 invoking methods of this interface if you like to, although the
253 irr::scene::ISceneManager interface provides a lot of powerful classes 253 irr::scene::ISceneManager interface provides a lot of powerful classes
254 and methods to make the programmer's life easier. 254 and methods to make the programmer's life easier.
255 */ 255 */
256 class IVideoDriver : public virtual IReferenceCounted 256 class IVideoDriver : public virtual IReferenceCounted
257 { 257 {
258 public: 258 public:
259 259
260 //! Applications must call this method before performing any rendering. 260 //! Applications must call this method before performing any rendering.
261 /** This method can clear the back- and the z-buffer. 261 /** This method can clear the back- and the z-buffer.
262 \param backBuffer Specifies if the back buffer should be 262 \param backBuffer Specifies if the back buffer should be
263 cleared, which means that the screen is filled with the color 263 cleared, which means that the screen is filled with the color
264 specified. If this parameter is false, the back buffer will 264 specified. If this parameter is false, the back buffer will
265 not be cleared and the color parameter is ignored. 265 not be cleared and the color parameter is ignored.
266 \param zBuffer Specifies if the depth buffer (z buffer) should 266 \param zBuffer Specifies if the depth buffer (z buffer) should
267 be cleared. It is not nesesarry to do so if only 2d drawing is 267 be cleared. It is not nesesarry to do so if only 2d drawing is
268 used. 268 used.
269 \param color The color used for back buffer clearing 269 \param color The color used for back buffer clearing
270 \param videoData Handle of another window, if you want the 270 \param videoData Handle of another window, if you want the
271 bitmap to be displayed on another window. If this is an empty 271 bitmap to be displayed on another window. If this is an empty
272 element, everything will be displayed in the default window. 272 element, everything will be displayed in the default window.
273 Note: This feature is not fully implemented for all devices. 273 Note: This feature is not fully implemented for all devices.
274 \param sourceRect Pointer to a rectangle defining the source 274 \param sourceRect Pointer to a rectangle defining the source
275 rectangle of the area to be presented. Set to null to present 275 rectangle of the area to be presented. Set to null to present
276 everything. Note: not implemented in all devices. 276 everything. Note: not implemented in all devices.
277 \return False if failed. */ 277 \return False if failed. */
278 virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, 278 virtual bool beginScene(bool backBuffer=true, bool zBuffer=true,
279 SColor color=SColor(255,0,0,0), 279 SColor color=SColor(255,0,0,0),
280 const SExposedVideoData& videoData=SExposedVideoData(), 280 const SExposedVideoData& videoData=SExposedVideoData(),
281 core::rect<s32>* sourceRect=0) =0; 281 core::rect<s32>* sourceRect=0) =0;
282 282
283 //! Presents the rendered image to the screen. 283 //! Presents the rendered image to the screen.
284 /** Applications must call this method after performing any 284 /** Applications must call this method after performing any
285 rendering. 285 rendering.
286 \return False if failed and true if succeeded. */ 286 \return False if failed and true if succeeded. */
287 virtual bool endScene() =0; 287 virtual bool endScene() =0;
288 288
289 //! Queries the features of the driver. 289 //! Queries the features of the driver.
290 /** Returns true if a feature is available 290 /** Returns true if a feature is available
291 \param feature Feature to query. 291 \param feature Feature to query.
292 \return True if the feature is available, false if not. */ 292 \return True if the feature is available, false if not. */
293 virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const =0; 293 virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const =0;
294 294
295 //! Disable a feature of the driver. 295 //! Disable a feature of the driver.
296 /** Can also be used to enable the features again. It is not 296 /** Can also be used to enable the features again. It is not
297 possible to enable unsupported features this way, though. 297 possible to enable unsupported features this way, though.
298 \param feature Feature to disable. 298 \param feature Feature to disable.
299 \param flag When true the feature is disabled, otherwise it is enabled. */ 299 \param flag When true the feature is disabled, otherwise it is enabled. */
300 virtual void disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag=true) =0; 300 virtual void disableFeature(E_VIDEO_DRIVER_FEATURE feature, bool flag=true) =0;
301 301
302 //! Get attributes of the actual video driver 302 //! Get attributes of the actual video driver
303 /** The following names can be queried for the given types: 303 /** The following names can be queried for the given types:
304 MaxTextures (int) The maximum number of simultaneous textures supported by the driver. This can be less than the supported number of textures of the driver. Use _IRR_MATERIAL_MAX_TEXTURES_ to adapt the number. 304 MaxTextures (int) The maximum number of simultaneous textures supported by the driver. This can be less than the supported number of textures of the driver. Use _IRR_MATERIAL_MAX_TEXTURES_ to adapt the number.
305 MaxSupportedTextures (int) The maximum number of simultaneous textures supported by the fixed function pipeline of the (hw) driver. The actual supported number of textures supported by the engine can be lower. 305 MaxSupportedTextures (int) The maximum number of simultaneous textures supported by the fixed function pipeline of the (hw) driver. The actual supported number of textures supported by the engine can be lower.
306 MaxLights (int) Number of hardware lights supported in the fixed function pipieline of the driver, typically 6-8. Use light manager or deferred shading for more. 306 MaxLights (int) Number of hardware lights supported in the fixed function pipieline of the driver, typically 6-8. Use light manager or deferred shading for more.
307 MaxAnisotropy (int) Number of anisotropy levels supported for filtering. At least 1, max is typically at 16 or 32. 307 MaxAnisotropy (int) Number of anisotropy levels supported for filtering. At least 1, max is typically at 16 or 32.
308 MaxUserClipPlanes (int) Number of additional clip planes, which can be set by the user via dedicated driver methods. 308 MaxUserClipPlanes (int) Number of additional clip planes, which can be set by the user via dedicated driver methods.
309 MaxAuxBuffers (int) Special render buffers, which are currently not really usable inside Irrlicht. Only supported by OpenGL 309 MaxAuxBuffers (int) Special render buffers, which are currently not really usable inside Irrlicht. Only supported by OpenGL
310 MaxMultipleRenderTargets (int) Number of render targets which can be bound simultaneously. Rendering to MRTs is done via shaders. 310 MaxMultipleRenderTargets (int) Number of render targets which can be bound simultaneously. Rendering to MRTs is done via shaders.
311 MaxIndices (int) Number of indices which can be used in one render call (i.e. one mesh buffer). 311 MaxIndices (int) Number of indices which can be used in one render call (i.e. one mesh buffer).
312 MaxTextureSize (int) Dimension that a texture may have, both in width and height. 312 MaxTextureSize (int) Dimension that a texture may have, both in width and height.
313 MaxGeometryVerticesOut (int) Number of vertices the geometry shader can output in one pass. Only OpenGL so far. 313 MaxGeometryVerticesOut (int) Number of vertices the geometry shader can output in one pass. Only OpenGL so far.
314 MaxTextureLODBias (float) Maximum value for LOD bias. Is usually at around 16, but can be lower on some systems. 314 MaxTextureLODBias (float) Maximum value for LOD bias. Is usually at around 16, but can be lower on some systems.
315 Version (int) Version of the driver. Should be Major*100+Minor 315 Version (int) Version of the driver. Should be Major*100+Minor
316 ShaderLanguageVersion (int) Version of the high level shader language. Should be Major*100+Minor. 316 ShaderLanguageVersion (int) Version of the high level shader language. Should be Major*100+Minor.
317 AntiAlias (int) Number of Samples the driver uses for each pixel. 0 and 1 means anti aliasing is off, typical values are 2,4,8,16,32 317 AntiAlias (int) Number of Samples the driver uses for each pixel. 0 and 1 means anti aliasing is off, typical values are 2,4,8,16,32
318 */ 318 */
319 virtual const io::IAttributes& getDriverAttributes() const=0; 319 virtual const io::IAttributes& getDriverAttributes() const=0;
320 320
321 //! Check if the driver was recently reset. 321 //! Check if the driver was recently reset.
322 /** For d3d devices you will need to recreate the RTTs if the 322 /** For d3d devices you will need to recreate the RTTs if the
323 driver was reset. Should be queried right after beginScene(). 323 driver was reset. Should be queried right after beginScene().
324 */ 324 */
325 virtual bool checkDriverReset() =0; 325 virtual bool checkDriverReset() =0;
326 326
327 //! Sets transformation matrices. 327 //! Sets transformation matrices.
328 /** \param state Transformation type to be set, e.g. view, 328 /** \param state Transformation type to be set, e.g. view,
329 world, or projection. 329 world, or projection.
330 \param mat Matrix describing the transformation. */ 330 \param mat Matrix describing the transformation. */
331 virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) =0; 331 virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) =0;
332 332
333 //! Returns the transformation set by setTransform 333 //! Returns the transformation set by setTransform
334 /** \param state Transformation type to query 334 /** \param state Transformation type to query
335 \return Matrix describing the transformation. */ 335 \return Matrix describing the transformation. */
336 virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const =0; 336 virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const =0;
337 337
338 //! Retrieve the number of image loaders 338 //! Retrieve the number of image loaders
339 /** \return Number of image loaders */ 339 /** \return Number of image loaders */
340 virtual u32 getImageLoaderCount() const = 0; 340 virtual u32 getImageLoaderCount() const = 0;
341 341
342 //! Retrieve the given image loader 342 //! Retrieve the given image loader
343 /** \param n The index of the loader to retrieve. This parameter is an 0-based 343 /** \param n The index of the loader to retrieve. This parameter is an 0-based
344 array index. 344 array index.
345 \return A pointer to the specified loader, 0 if the index is incorrect. */ 345 \return A pointer to the specified loader, 0 if the index is incorrect. */
346 virtual IImageLoader* getImageLoader(u32 n) = 0; 346 virtual IImageLoader* getImageLoader(u32 n) = 0;
347 347
348 //! Retrieve the number of image writers 348 //! Retrieve the number of image writers
349 /** \return Number of image writers */ 349 /** \return Number of image writers */
350 virtual u32 getImageWriterCount() const = 0; 350 virtual u32 getImageWriterCount() const = 0;
351 351
352 //! Retrieve the given image writer 352 //! Retrieve the given image writer
353 /** \param n The index of the writer to retrieve. This parameter is an 0-based 353 /** \param n The index of the writer to retrieve. This parameter is an 0-based
354 array index. 354 array index.
355 \return A pointer to the specified writer, 0 if the index is incorrect. */ 355 \return A pointer to the specified writer, 0 if the index is incorrect. */
356 virtual IImageWriter* getImageWriter(u32 n) = 0; 356 virtual IImageWriter* getImageWriter(u32 n) = 0;
357 357
358 //! Sets a material. 358 //! Sets a material.
359 /** All 3d drawing functions will draw geometry using this material thereafter. 359 /** All 3d drawing functions will draw geometry using this material thereafter.
360 \param material: Material to be used from now on. */ 360 \param material: Material to be used from now on. */
361 virtual void setMaterial(const SMaterial& material) =0; 361 virtual void setMaterial(const SMaterial& material) =0;
362 362
363 //! Get access to a named texture. 363 //! Get access to a named texture.
364 /** Loads the texture from disk if it is not 364 /** Loads the texture from disk if it is not
365 already loaded and generates mipmap levels if desired. 365 already loaded and generates mipmap levels if desired.
366 Texture loading can be influenced using the 366 Texture loading can be influenced using the
367 setTextureCreationFlag() method. The texture can be in several 367 setTextureCreationFlag() method. The texture can be in several
368 imageformats, such as BMP, JPG, TGA, PCX, PNG, and PSD. 368 imageformats, such as BMP, JPG, TGA, PCX, PNG, and PSD.
369 \param filename Filename of the texture to be loaded. 369 \param filename Filename of the texture to be loaded.
370 \return Pointer to the texture, or 0 if the texture 370 \return Pointer to the texture, or 0 if the texture
371 could not be loaded. This pointer should not be dropped. See 371 could not be loaded. This pointer should not be dropped. See
372 IReferenceCounted::drop() for more information. */ 372 IReferenceCounted::drop() for more information. */
373 virtual ITexture* getTexture(const io::path& filename) = 0; 373 virtual ITexture* getTexture(const io::path& filename) = 0;
374 374
375 //! Get access to a named texture. 375 //! Get access to a named texture.
376 /** Loads the texture from disk if it is not 376 /** Loads the texture from disk if it is not
377 already loaded and generates mipmap levels if desired. 377 already loaded and generates mipmap levels if desired.
378 Texture loading can be influenced using the 378 Texture loading can be influenced using the
379 setTextureCreationFlag() method. The texture can be in several 379 setTextureCreationFlag() method. The texture can be in several
380 imageformats, such as BMP, JPG, TGA, PCX, PNG, and PSD. 380 imageformats, such as BMP, JPG, TGA, PCX, PNG, and PSD.
381 \param file Pointer to an already opened file. 381 \param file Pointer to an already opened file.
382 \return Pointer to the texture, or 0 if the texture 382 \return Pointer to the texture, or 0 if the texture
383 could not be loaded. This pointer should not be dropped. See 383 could not be loaded. This pointer should not be dropped. See
384 IReferenceCounted::drop() for more information. */ 384 IReferenceCounted::drop() for more information. */
385 virtual ITexture* getTexture(io::IReadFile* file) =0; 385 virtual ITexture* getTexture(io::IReadFile* file) =0;
386 386
387 //! Returns a texture by index 387 //! Returns a texture by index
388 /** \param index: Index of the texture, must be smaller than 388 /** \param index: Index of the texture, must be smaller than
389 getTextureCount() Please note that this index might change when 389 getTextureCount() Please note that this index might change when
390 adding or removing textures 390 adding or removing textures
391 \return Pointer to the texture, or 0 if the texture was not 391 \return Pointer to the texture, or 0 if the texture was not
392 set or index is out of bounds. This pointer should not be 392 set or index is out of bounds. This pointer should not be
393 dropped. See IReferenceCounted::drop() for more information. */ 393 dropped. See IReferenceCounted::drop() for more information. */
394 virtual ITexture* getTextureByIndex(u32 index) =0; 394 virtual ITexture* getTextureByIndex(u32 index) =0;
395 395
396 //! Returns amount of textures currently loaded 396 //! Returns amount of textures currently loaded
397 /** \return Amount of textures currently loaded */ 397 /** \return Amount of textures currently loaded */
398 virtual u32 getTextureCount() const = 0; 398 virtual u32 getTextureCount() const = 0;
399 399
400 //! Renames a texture 400 //! Renames a texture
401 /** \param texture Pointer to the texture to rename. 401 /** \param texture Pointer to the texture to rename.
402 \param newName New name for the texture. This should be a unique name. */ 402 \param newName New name for the texture. This should be a unique name. */
403 virtual void renameTexture(ITexture* texture, const io::path& newName) = 0; 403 virtual void renameTexture(ITexture* texture, const io::path& newName) = 0;
404 404
405 //! Creates an empty texture of specified size. 405 //! Creates an empty texture of specified size.
406 /** \param size: Size of the texture. 406 /** \param size: Size of the texture.
407 \param name A name for the texture. Later calls to 407 \param name A name for the texture. Later calls to
408 getTexture() with this name will return this texture 408 getTexture() with this name will return this texture
409 \param format Desired color format of the texture. Please note 409 \param format Desired color format of the texture. Please note
410 that the driver may choose to create the texture in another 410 that the driver may choose to create the texture in another
411 color format. 411 color format.
412 \return Pointer to the newly created texture. This pointer 412 \return Pointer to the newly created texture. This pointer
413 should not be dropped. See IReferenceCounted::drop() for more 413 should not be dropped. See IReferenceCounted::drop() for more
414 information. */ 414 information. */
415 virtual ITexture* addTexture(const core::dimension2d<u32>& size, 415 virtual ITexture* addTexture(const core::dimension2d<u32>& size,
416 const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0; 416 const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0;
417 417
418 //! Creates a texture from an IImage. 418 //! Creates a texture from an IImage.
419 /** \param name A name for the texture. Later calls of 419 /** \param name A name for the texture. Later calls of
420 getTexture() with this name will return this texture 420 getTexture() with this name will return this texture
421 \param image Image the texture is created from. 421 \param image Image the texture is created from.
422 \param mipmapData Optional pointer to a set of images which 422 \param mipmapData Optional pointer to a set of images which
423 build up the whole mipmap set. Must be images of the same color 423 build up the whole mipmap set. Must be images of the same color
424 type as image. If this parameter is not given, the mipmaps are 424 type as image. If this parameter is not given, the mipmaps are
425 derived from image. 425 derived from image.
426 \return Pointer to the newly created texture. This pointer 426 \return Pointer to the newly created texture. This pointer
427 should not be dropped. See IReferenceCounted::drop() for more 427 should not be dropped. See IReferenceCounted::drop() for more
428 information. */ 428 information. */
429 virtual ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData=0) = 0; 429 virtual ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData=0) = 0;
430 430
431 //! Adds a new render target texture to the texture cache. 431 //! Adds a new render target texture to the texture cache.
432 /** \param size Size of the texture, in pixels. Width and 432 /** \param size Size of the texture, in pixels. Width and
433 height should be a power of two (e.g. 64, 128, 256, 512, ...) 433 height should be a power of two (e.g. 64, 128, 256, 512, ...)
434 and it should not be bigger than the backbuffer, because it 434 and it should not be bigger than the backbuffer, because it
435 shares the zbuffer with the screen buffer. 435 shares the zbuffer with the screen buffer.
436 \param name An optional name for the RTT. 436 \param name An optional name for the RTT.
437 \param format The color format of the render target. Floating point formats are supported. 437 \param format The color format of the render target. Floating point formats are supported.
438 \return Pointer to the created texture or 0 if the texture 438 \return Pointer to the created texture or 0 if the texture
439 could not be created. This pointer should not be dropped. See 439 could not be created. This pointer should not be dropped. See
440 IReferenceCounted::drop() for more information. */ 440 IReferenceCounted::drop() for more information. */
441 virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size, 441 virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
442 const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0; 442 const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0;
443 443
444 //! Removes a texture from the texture cache and deletes it. 444 //! Removes a texture from the texture cache and deletes it.
445 /** This method can free a lot of memory! 445 /** This method can free a lot of memory!
446 Please note that after calling this, the pointer to the 446 Please note that after calling this, the pointer to the
447 ITexture may no longer be valid, if it was not grabbed before 447 ITexture may no longer be valid, if it was not grabbed before
448 by other parts of the engine for storing it longer. So it is a 448 by other parts of the engine for storing it longer. So it is a
449 good idea to set all materials which are using this texture to 449 good idea to set all materials which are using this texture to
450 0 or another texture first. 450 0 or another texture first.
451 \param texture Texture to delete from the engine cache. */ 451 \param texture Texture to delete from the engine cache. */
452 virtual void removeTexture(ITexture* texture) =0; 452 virtual void removeTexture(ITexture* texture) =0;
453 453
454 //! Removes all textures from the texture cache and deletes them. 454 //! Removes all textures from the texture cache and deletes them.
455 /** This method can free a lot of memory! 455 /** This method can free a lot of memory!
456 Please note that after calling this, the pointer to the 456 Please note that after calling this, the pointer to the
457 ITexture may no longer be valid, if it was not grabbed before 457 ITexture may no longer be valid, if it was not grabbed before
458 by other parts of the engine for storing it longer. So it is a 458 by other parts of the engine for storing it longer. So it is a
459 good idea to set all materials which are using this texture to 459 good idea to set all materials which are using this texture to
460 0 or another texture first. */ 460 0 or another texture first. */
461 virtual void removeAllTextures() =0; 461 virtual void removeAllTextures() =0;
462 462
463 //! Remove hardware buffer 463 //! Remove hardware buffer
464 virtual void removeHardwareBuffer(const scene::IMeshBuffer* mb) =0; 464 virtual void removeHardwareBuffer(const scene::IMeshBuffer* mb) =0;
465 465
466 //! Remove all hardware buffers 466 //! Remove all hardware buffers
467 virtual void removeAllHardwareBuffers() =0; 467 virtual void removeAllHardwareBuffers() =0;
468 468
469 //! Create occlusion query. 469 //! Create occlusion query.
470 /** Use node for identification and mesh for occlusion test. */ 470 /** Use node for identification and mesh for occlusion test. */
471 virtual void addOcclusionQuery(scene::ISceneNode* node, 471 virtual void addOcclusionQuery(scene::ISceneNode* node,
472 const scene::IMesh* mesh=0) =0; 472 const scene::IMesh* mesh=0) =0;
473 473
474 //! Remove occlusion query. 474 //! Remove occlusion query.
475 virtual void removeOcclusionQuery(scene::ISceneNode* node) =0; 475 virtual void removeOcclusionQuery(scene::ISceneNode* node) =0;
476 476
477 //! Remove all occlusion queries. 477 //! Remove all occlusion queries.
478 virtual void removeAllOcclusionQueries() =0; 478 virtual void removeAllOcclusionQueries() =0;
479 479
480 //! Run occlusion query. Draws mesh stored in query. 480 //! Run occlusion query. Draws mesh stored in query.
481 /** If the mesh shall not be rendered visible, use 481 /** If the mesh shall not be rendered visible, use
482 overrideMaterial to disable the color and depth buffer. */ 482 overrideMaterial to disable the color and depth buffer. */
483 virtual void runOcclusionQuery(scene::ISceneNode* node, bool visible=false) =0; 483 virtual void runOcclusionQuery(scene::ISceneNode* node, bool visible=false) =0;
484 484
485 //! Run all occlusion queries. Draws all meshes stored in queries. 485 //! Run all occlusion queries. Draws all meshes stored in queries.
486 /** If the meshes shall not be rendered visible, use 486 /** If the meshes shall not be rendered visible, use
487 overrideMaterial to disable the color and depth buffer. */ 487 overrideMaterial to disable the color and depth buffer. */
488 virtual void runAllOcclusionQueries(bool visible=false) =0; 488 virtual void runAllOcclusionQueries(bool visible=false) =0;
489 489
490 //! Update occlusion query. Retrieves results from GPU. 490 //! Update occlusion query. Retrieves results from GPU.
491 /** If the query shall not block, set the flag to false. 491 /** If the query shall not block, set the flag to false.
492 Update might not occur in this case, though */ 492 Update might not occur in this case, though */
493 virtual void updateOcclusionQuery(scene::ISceneNode* node, bool block=true) =0; 493 virtual void updateOcclusionQuery(scene::ISceneNode* node, bool block=true) =0;
494 494
495 //! Update all occlusion queries. Retrieves results from GPU. 495 //! Update all occlusion queries. Retrieves results from GPU.
496 /** If the query shall not block, set the flag to false. 496 /** If the query shall not block, set the flag to false.
497 Update might not occur in this case, though */ 497 Update might not occur in this case, though */
498 virtual void updateAllOcclusionQueries(bool block=true) =0; 498 virtual void updateAllOcclusionQueries(bool block=true) =0;
499 499
500 //! Return query result. 500 //! Return query result.
501 /** Return value is the number of visible pixels/fragments. 501 /** Return value is the number of visible pixels/fragments.
502 The value is a safe approximation, i.e. can be larger than the 502 The value is a safe approximation, i.e. can be larger than the
503 actual value of pixels. */ 503 actual value of pixels. */
504 virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const =0; 504 virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const =0;
505 505
506 //! Sets a boolean alpha channel on the texture based on a color key. 506 //! Sets a boolean alpha channel on the texture based on a color key.
507 /** This makes the texture fully transparent at the texels where 507 /** This makes the texture fully transparent at the texels where
508 this color key can be found when using for example draw2DImage 508 this color key can be found when using for example draw2DImage
509 with useAlphachannel==true. The alpha of other texels is not modified. 509 with useAlphachannel==true. The alpha of other texels is not modified.
510 \param texture Texture whose alpha channel is modified. 510 \param texture Texture whose alpha channel is modified.
511 \param color Color key color. Every texel with this color will 511 \param color Color key color. Every texel with this color will
512 become fully transparent as described above. Please note that the 512 become fully transparent as described above. Please note that the
513 colors of a texture may be converted when loading it, so the 513 colors of a texture may be converted when loading it, so the
514 color values may not be exactly the same in the engine and for 514 color values may not be exactly the same in the engine and for
515 example in picture edit programs. To avoid this problem, you 515 example in picture edit programs. To avoid this problem, you
516 could use the makeColorKeyTexture method, which takes the 516 could use the makeColorKeyTexture method, which takes the
517 position of a pixel instead a color value. 517 position of a pixel instead a color value.
518 \param zeroTexels \deprecated If set to true, then any texels that match 518 \param zeroTexels \deprecated If set to true, then any texels that match
519 the color key will have their color, as well as their alpha, set to zero 519 the color key will have their color, as well as their alpha, set to zero
520 (i.e. black). This behavior matches the legacy (buggy) behavior prior 520 (i.e. black). This behavior matches the legacy (buggy) behavior prior
521 to release 1.5 and is provided for backwards compatibility only. 521 to release 1.5 and is provided for backwards compatibility only.
522 This parameter may be removed by Irrlicht 1.9. */ 522 This parameter may be removed by Irrlicht 1.9. */
523 virtual void makeColorKeyTexture(video::ITexture* texture, 523 virtual void makeColorKeyTexture(video::ITexture* texture,
524 video::SColor color, 524 video::SColor color,
525 bool zeroTexels = false) const =0; 525 bool zeroTexels = false) const =0;
526 526
527 //! Sets a boolean alpha channel on the texture based on the color at a position. 527 //! Sets a boolean alpha channel on the texture based on the color at a position.
528 /** This makes the texture fully transparent at the texels where 528 /** This makes the texture fully transparent at the texels where
529 the color key can be found when using for example draw2DImage 529 the color key can be found when using for example draw2DImage
530 with useAlphachannel==true. The alpha of other texels is not modified. 530 with useAlphachannel==true. The alpha of other texels is not modified.
531 \param texture Texture whose alpha channel is modified. 531 \param texture Texture whose alpha channel is modified.
532 \param colorKeyPixelPos Position of a pixel with the color key 532 \param colorKeyPixelPos Position of a pixel with the color key
533 color. Every texel with this color will become fully transparent as 533 color. Every texel with this color will become fully transparent as
534 described above. 534 described above.
535 \param zeroTexels \deprecated If set to true, then any texels that match 535 \param zeroTexels \deprecated If set to true, then any texels that match
536 the color key will have their color, as well as their alpha, set to zero 536 the color key will have their color, as well as their alpha, set to zero
537 (i.e. black). This behavior matches the legacy (buggy) behavior prior 537 (i.e. black). This behavior matches the legacy (buggy) behavior prior
538 to release 1.5 and is provided for backwards compatibility only. 538 to release 1.5 and is provided for backwards compatibility only.
539 This parameter may be removed by Irrlicht 1.9. */ 539 This parameter may be removed by Irrlicht 1.9. */
540 virtual void makeColorKeyTexture(video::ITexture* texture, 540 virtual void makeColorKeyTexture(video::ITexture* texture,
541 core::position2d<s32> colorKeyPixelPos, 541 core::position2d<s32> colorKeyPixelPos,
542 bool zeroTexels = false) const =0; 542 bool zeroTexels = false) const =0;
543 543
544 //! Creates a normal map from a height map texture. 544 //! Creates a normal map from a height map texture.
545 /** If the target texture has 32 bit, the height value is 545 /** If the target texture has 32 bit, the height value is
546 stored in the alpha component of the texture as addition. This 546 stored in the alpha component of the texture as addition. This
547 value is used by the video::EMT_PARALLAX_MAP_SOLID material and 547 value is used by the video::EMT_PARALLAX_MAP_SOLID material and
548 similar materials. 548 similar materials.
549 \param texture Texture whose alpha channel is modified. 549 \param texture Texture whose alpha channel is modified.
550 \param amplitude Constant value by which the height 550 \param amplitude Constant value by which the height
551 information is multiplied.*/ 551 information is multiplied.*/
552 virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const =0; 552 virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const =0;
553 553
554 //! Sets a new render target. 554 //! Sets a new render target.
555 /** This will only work if the driver supports the 555 /** This will only work if the driver supports the
556 EVDF_RENDER_TO_TARGET feature, which can be queried with 556 EVDF_RENDER_TO_TARGET feature, which can be queried with
557 queryFeature(). Usually, rendering to textures is done in this 557 queryFeature(). Usually, rendering to textures is done in this
558 way: 558 way:
559 \code 559 \code
560 // create render target 560 // create render target
561 ITexture* target = driver->addRenderTargetTexture(core::dimension2d<u32>(128,128), "rtt1"); 561 ITexture* target = driver->addRenderTargetTexture(core::dimension2d<u32>(128,128), "rtt1");
562 562
563 // ... 563 // ...
564 564
565 driver->setRenderTarget(target); // set render target 565 driver->setRenderTarget(target); // set render target
566 // .. draw stuff here 566 // .. draw stuff here
567 driver->setRenderTarget(0); // set previous render target 567 driver->setRenderTarget(0); // set previous render target
568 \endcode 568 \endcode
569 Please note that you cannot render 3D or 2D geometry with a 569 Please note that you cannot render 3D or 2D geometry with a
570 render target as texture on it when you are rendering the scene 570 render target as texture on it when you are rendering the scene
571 into this render target at the same time. It is usually only 571 into this render target at the same time. It is usually only
572 possible to render into a texture between the 572 possible to render into a texture between the
573 IVideoDriver::beginScene() and endScene() method calls. 573 IVideoDriver::beginScene() and endScene() method calls.
574 \param texture New render target. Must be a texture created with 574 \param texture New render target. Must be a texture created with
575 IVideoDriver::addRenderTargetTexture(). If set to 0, it sets 575 IVideoDriver::addRenderTargetTexture(). If set to 0, it sets
576 the previous render target which was set before the last 576 the previous render target which was set before the last
577 setRenderTarget() call. 577 setRenderTarget() call.
578 \param clearBackBuffer Clears the backbuffer of the render 578 \param clearBackBuffer Clears the backbuffer of the render
579 target with the color parameter 579 target with the color parameter
580 \param clearZBuffer Clears the zBuffer of the rendertarget. 580 \param clearZBuffer Clears the zBuffer of the rendertarget.
581 Note that because the frame buffer may share the zbuffer with 581 Note that because the frame buffer may share the zbuffer with
582 the rendertarget, its zbuffer might be partially cleared too 582 the rendertarget, its zbuffer might be partially cleared too
583 by this. 583 by this.
584 \param color The background color for the render target. 584 \param color The background color for the render target.
585 \return True if sucessful and false if not. */ 585 \return True if sucessful and false if not. */
586 virtual bool setRenderTarget(video::ITexture* texture, 586 virtual bool setRenderTarget(video::ITexture* texture,
587 bool clearBackBuffer=true, bool clearZBuffer=true, 587 bool clearBackBuffer=true, bool clearZBuffer=true,
588 SColor color=video::SColor(0,0,0,0)) =0; 588 SColor color=video::SColor(0,0,0,0)) =0;
589 589
590 //! set or reset special render targets 590 //! set or reset special render targets
591 /** This method enables access to special color buffers such as 591 /** This method enables access to special color buffers such as
592 stereoscopic buffers or auxiliary buffers. 592 stereoscopic buffers or auxiliary buffers.
593 \param target Enum value for the render target 593 \param target Enum value for the render target
594 \param clearTarget Clears the target buffer with the color 594 \param clearTarget Clears the target buffer with the color
595 parameter 595 parameter
596 \param clearZBuffer Clears the zBuffer of the rendertarget. 596 \param clearZBuffer Clears the zBuffer of the rendertarget.
597 Note that because the main frame buffer may share the zbuffer with 597 Note that because the main frame buffer may share the zbuffer with
598 the rendertarget, its zbuffer might be partially cleared too 598 the rendertarget, its zbuffer might be partially cleared too
599 by this. 599 by this.
600 \param color The background color for the render target. 600 \param color The background color for the render target.
601 \return True if sucessful and false if not. */ 601 \return True if sucessful and false if not. */
602 virtual bool setRenderTarget(E_RENDER_TARGET target, bool clearTarget=true, 602 virtual bool setRenderTarget(E_RENDER_TARGET target, bool clearTarget=true,
603 bool clearZBuffer=true, 603 bool clearZBuffer=true,
604 SColor color=video::SColor(0,0,0,0)) =0; 604 SColor color=video::SColor(0,0,0,0)) =0;
605 605
606 //! Sets new multiple render targets. 606 //! Sets new multiple render targets.
607 virtual bool setRenderTarget(const core::array<video::IRenderTarget>& texture, 607 virtual bool setRenderTarget(const core::array<video::IRenderTarget>& texture,
608 bool clearBackBuffer=true, bool clearZBuffer=true, 608 bool clearBackBuffer=true, bool clearZBuffer=true,
609 SColor color=video::SColor(0,0,0,0)) =0; 609 SColor color=video::SColor(0,0,0,0)) =0;
610 610
611 //! Sets a new viewport. 611 //! Sets a new viewport.
612 /** Every rendering operation is done into this new area. 612 /** Every rendering operation is done into this new area.
613 \param area: Rectangle defining the new area of rendering 613 \param area: Rectangle defining the new area of rendering
614 operations. */ 614 operations. */
615 virtual void setViewPort(const core::rect<s32>& area) =0; 615 virtual void setViewPort(const core::rect<s32>& area) =0;
616 616
617 //! Gets the area of the current viewport. 617 //! Gets the area of the current viewport.
618 /** \return Rectangle of the current viewport. */ 618 /** \return Rectangle of the current viewport. */
619 virtual const core::rect<s32>& getViewPort() const =0; 619 virtual const core::rect<s32>& getViewPort() const =0;
620 620
621 //! Draws a vertex primitive list 621 //! Draws a vertex primitive list
622 /** Note that, depending on the index type, some vertices might be not 622 /** Note that, depending on the index type, some vertices might be not
623 accessible through the index list. The limit is at 65535 vertices for 16bit 623 accessible through the index list. The limit is at 65535 vertices for 16bit
624 indices. Please note that currently not all primitives are available for 624 indices. Please note that currently not all primitives are available for
625 all drivers, and some might be emulated via triangle renders. 625 all drivers, and some might be emulated via triangle renders.
626 \param vertices Pointer to array of vertices. 626 \param vertices Pointer to array of vertices.
627 \param vertexCount Amount of vertices in the array. 627 \param vertexCount Amount of vertices in the array.
628 \param indexList Pointer to array of indices. These define the vertices used 628 \param indexList Pointer to array of indices. These define the vertices used
629 for each primitive. Depending on the pType, indices are interpreted as single 629 for each primitive. Depending on the pType, indices are interpreted as single
630 objects (for point like primitives), pairs (for lines), triplets (for 630 objects (for point like primitives), pairs (for lines), triplets (for
631 triangles), or quads. 631 triangles), or quads.
632 \param primCount Amount of Primitives 632 \param primCount Amount of Primitives
633 \param vType Vertex type, e.g. video::EVT_STANDARD for S3DVertex. 633 \param vType Vertex type, e.g. video::EVT_STANDARD for S3DVertex.
634 \param pType Primitive type, e.g. scene::EPT_TRIANGLE_FAN for a triangle fan. 634 \param pType Primitive type, e.g. scene::EPT_TRIANGLE_FAN for a triangle fan.
635 \param iType Index type, e.g. video::EIT_16BIT for 16bit indices. */ 635 \param iType Index type, e.g. video::EIT_16BIT for 16bit indices. */
636 virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, 636 virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
637 const void* indexList, u32 primCount, 637 const void* indexList, u32 primCount,
638 E_VERTEX_TYPE vType=EVT_STANDARD, 638 E_VERTEX_TYPE vType=EVT_STANDARD,
639 scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES, 639 scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES,
640 E_INDEX_TYPE iType=EIT_16BIT) =0; 640 E_INDEX_TYPE iType=EIT_16BIT) =0;
641 641
642 //! Draws a vertex primitive list in 2d 642 //! Draws a vertex primitive list in 2d
643 /** Compared to the general (3d) version of this method, this 643 /** Compared to the general (3d) version of this method, this
644 one sets up a 2d render mode, and uses only x and y of vectors. 644 one sets up a 2d render mode, and uses only x and y of vectors.
645 Note that, depending on the index type, some vertices might be 645 Note that, depending on the index type, some vertices might be
646 not accessible through the index list. The limit is at 65535 646 not accessible through the index list. The limit is at 65535
647 vertices for 16bit indices. Please note that currently not all 647 vertices for 16bit indices. Please note that currently not all
648 primitives are available for all drivers, and some might be 648 primitives are available for all drivers, and some might be
649 emulated via triangle renders. This function is not available 649 emulated via triangle renders. This function is not available
650 for the sw drivers. 650 for the sw drivers.
651 \param vertices Pointer to array of vertices. 651 \param vertices Pointer to array of vertices.
652 \param vertexCount Amount of vertices in the array. 652 \param vertexCount Amount of vertices in the array.
653 \param indexList Pointer to array of indices. These define the 653 \param indexList Pointer to array of indices. These define the
654 vertices used for each primitive. Depending on the pType, 654 vertices used for each primitive. Depending on the pType,
655 indices are interpreted as single objects (for point like 655 indices are interpreted as single objects (for point like
656 primitives), pairs (for lines), triplets (for triangles), or 656 primitives), pairs (for lines), triplets (for triangles), or
657 quads. 657 quads.
658 \param primCount Amount of Primitives 658 \param primCount Amount of Primitives
659 \param vType Vertex type, e.g. video::EVT_STANDARD for S3DVertex. 659 \param vType Vertex type, e.g. video::EVT_STANDARD for S3DVertex.
660 \param pType Primitive type, e.g. scene::EPT_TRIANGLE_FAN for a triangle fan. 660 \param pType Primitive type, e.g. scene::EPT_TRIANGLE_FAN for a triangle fan.
661 \param iType Index type, e.g. video::EIT_16BIT for 16bit indices. */ 661 \param iType Index type, e.g. video::EIT_16BIT for 16bit indices. */
662 virtual void draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount, 662 virtual void draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount,
663 const void* indexList, u32 primCount, 663 const void* indexList, u32 primCount,
664 E_VERTEX_TYPE vType=EVT_STANDARD, 664 E_VERTEX_TYPE vType=EVT_STANDARD,
665 scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES, 665 scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES,
666 E_INDEX_TYPE iType=EIT_16BIT) =0; 666 E_INDEX_TYPE iType=EIT_16BIT) =0;
667 667
668 //! Draws an indexed triangle list. 668 //! Draws an indexed triangle list.
669 /** Note that there may be at maximum 65536 vertices, because 669 /** Note that there may be at maximum 65536 vertices, because
670 the index list is an array of 16 bit values each with a maximum 670 the index list is an array of 16 bit values each with a maximum
671 value of 65536. If there are more than 65536 vertices in the 671 value of 65536. If there are more than 65536 vertices in the
672 list, results of this operation are not defined. 672 list, results of this operation are not defined.
673 \param vertices Pointer to array of vertices. 673 \param vertices Pointer to array of vertices.
674 \param vertexCount Amount of vertices in the array. 674 \param vertexCount Amount of vertices in the array.
675 \param indexList Pointer to array of indices. 675 \param indexList Pointer to array of indices.
676 \param triangleCount Amount of Triangles. Usually amount of indices / 3. */ 676 \param triangleCount Amount of Triangles. Usually amount of indices / 3. */
677 void drawIndexedTriangleList(const S3DVertex* vertices, 677 void drawIndexedTriangleList(const S3DVertex* vertices,
678 u32 vertexCount, const u16* indexList, u32 triangleCount) 678 u32 vertexCount, const u16* indexList, u32 triangleCount)
679 { 679 {
680 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT); 680 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT);
681 } 681 }
682 682
683 //! Draws an indexed triangle list. 683 //! Draws an indexed triangle list.
684 /** Note that there may be at maximum 65536 vertices, because 684 /** Note that there may be at maximum 65536 vertices, because
685 the index list is an array of 16 bit values each with a maximum 685 the index list is an array of 16 bit values each with a maximum
686 value of 65536. If there are more than 65536 vertices in the 686 value of 65536. If there are more than 65536 vertices in the
687 list, results of this operation are not defined. 687 list, results of this operation are not defined.
688 \param vertices Pointer to array of vertices. 688 \param vertices Pointer to array of vertices.
689 \param vertexCount Amount of vertices in the array. 689 \param vertexCount Amount of vertices in the array.
690 \param indexList Pointer to array of indices. 690 \param indexList Pointer to array of indices.
691 \param triangleCount Amount of Triangles. Usually amount of indices / 3. */ 691 \param triangleCount Amount of Triangles. Usually amount of indices / 3. */
692 void drawIndexedTriangleList(const S3DVertex2TCoords* vertices, 692 void drawIndexedTriangleList(const S3DVertex2TCoords* vertices,
693 u32 vertexCount, const u16* indexList, u32 triangleCount) 693 u32 vertexCount, const u16* indexList, u32 triangleCount)
694 { 694 {
695 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLES, EIT_16BIT); 695 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLES, EIT_16BIT);
696 } 696 }
697 697
698 //! Draws an indexed triangle list. 698 //! Draws an indexed triangle list.
699 /** Note that there may be at maximum 65536 vertices, because 699 /** Note that there may be at maximum 65536 vertices, because
700 the index list is an array of 16 bit values each with a maximum 700 the index list is an array of 16 bit values each with a maximum
701 value of 65536. If there are more than 65536 vertices in the 701 value of 65536. If there are more than 65536 vertices in the
702 list, results of this operation are not defined. 702 list, results of this operation are not defined.
703 \param vertices Pointer to array of vertices. 703 \param vertices Pointer to array of vertices.
704 \param vertexCount Amount of vertices in the array. 704 \param vertexCount Amount of vertices in the array.
705 \param indexList Pointer to array of indices. 705 \param indexList Pointer to array of indices.
706 \param triangleCount Amount of Triangles. Usually amount of indices / 3. */ 706 \param triangleCount Amount of Triangles. Usually amount of indices / 3. */
707 void drawIndexedTriangleList(const S3DVertexTangents* vertices, 707 void drawIndexedTriangleList(const S3DVertexTangents* vertices,
708 u32 vertexCount, const u16* indexList, u32 triangleCount) 708 u32 vertexCount, const u16* indexList, u32 triangleCount)
709 { 709 {
710 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLES, EIT_16BIT); 710 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLES, EIT_16BIT);
711 } 711 }
712 712
713 //! Draws an indexed triangle fan. 713 //! Draws an indexed triangle fan.
714 /** Note that there may be at maximum 65536 vertices, because 714 /** Note that there may be at maximum 65536 vertices, because
715 the index list is an array of 16 bit values each with a maximum 715 the index list is an array of 16 bit values each with a maximum
716 value of 65536. If there are more than 65536 vertices in the 716 value of 65536. If there are more than 65536 vertices in the
717 list, results of this operation are not defined. 717 list, results of this operation are not defined.
718 \param vertices Pointer to array of vertices. 718 \param vertices Pointer to array of vertices.
719 \param vertexCount Amount of vertices in the array. 719 \param vertexCount Amount of vertices in the array.
720 \param indexList Pointer to array of indices. 720 \param indexList Pointer to array of indices.
721 \param triangleCount Amount of Triangles. Usually amount of indices - 2. */ 721 \param triangleCount Amount of Triangles. Usually amount of indices - 2. */
722 void drawIndexedTriangleFan(const S3DVertex* vertices, 722 void drawIndexedTriangleFan(const S3DVertex* vertices,
723 u32 vertexCount, const u16* indexList, u32 triangleCount) 723 u32 vertexCount, const u16* indexList, u32 triangleCount)
724 { 724 {
725 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLE_FAN, EIT_16BIT); 725 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_STANDARD, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
726 } 726 }
727 727
728 //! Draws an indexed triangle fan. 728 //! Draws an indexed triangle fan.
729 /** Note that there may be at maximum 65536 vertices, because 729 /** Note that there may be at maximum 65536 vertices, because
730 the index list is an array of 16 bit values each with a maximum 730 the index list is an array of 16 bit values each with a maximum
731 value of 65536. If there are more than 65536 vertices in the 731 value of 65536. If there are more than 65536 vertices in the
732 list, results of this operation are not defined. 732 list, results of this operation are not defined.
733 \param vertices Pointer to array of vertices. 733 \param vertices Pointer to array of vertices.
734 \param vertexCount Amount of vertices in the array. 734 \param vertexCount Amount of vertices in the array.
735 \param indexList Pointer to array of indices. 735 \param indexList Pointer to array of indices.
736 \param triangleCount Amount of Triangles. Usually amount of indices - 2. */ 736 \param triangleCount Amount of Triangles. Usually amount of indices - 2. */
737 void drawIndexedTriangleFan(const S3DVertex2TCoords* vertices, 737 void drawIndexedTriangleFan(const S3DVertex2TCoords* vertices,
738 u32 vertexCount, const u16* indexList, u32 triangleCount) 738 u32 vertexCount, const u16* indexList, u32 triangleCount)
739 { 739 {
740 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLE_FAN, EIT_16BIT); 740 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_2TCOORDS, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
741 } 741 }
742 742
743 //! Draws an indexed triangle fan. 743 //! Draws an indexed triangle fan.
744 /** Note that there may be at maximum 65536 vertices, because 744 /** Note that there may be at maximum 65536 vertices, because
745 the index list is an array of 16 bit values each with a maximum 745 the index list is an array of 16 bit values each with a maximum
746 value of 65536. If there are more than 65536 vertices in the 746 value of 65536. If there are more than 65536 vertices in the
747 list, results of this operation are not defined. 747 list, results of this operation are not defined.
748 \param vertices Pointer to array of vertices. 748 \param vertices Pointer to array of vertices.
749 \param vertexCount Amount of vertices in the array. 749 \param vertexCount Amount of vertices in the array.
750 \param indexList Pointer to array of indices. 750 \param indexList Pointer to array of indices.
751 \param triangleCount Amount of Triangles. Usually amount of indices - 2. */ 751 \param triangleCount Amount of Triangles. Usually amount of indices - 2. */
752 void drawIndexedTriangleFan(const S3DVertexTangents* vertices, 752 void drawIndexedTriangleFan(const S3DVertexTangents* vertices,
753 u32 vertexCount, const u16* indexList, u32 triangleCount) 753 u32 vertexCount, const u16* indexList, u32 triangleCount)
754 { 754 {
755 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLE_FAN, EIT_16BIT); 755 drawVertexPrimitiveList(vertices, vertexCount, indexList, triangleCount, EVT_TANGENTS, scene::EPT_TRIANGLE_FAN, EIT_16BIT);
756 } 756 }
757 757
758 //! Draws a 3d line. 758 //! Draws a 3d line.
759 /** For some implementations, this method simply calls 759 /** For some implementations, this method simply calls
760 drawVertexPrimitiveList for some triangles. 760 drawVertexPrimitiveList for some triangles.
761 Note that the line is drawn using the current transformation 761 Note that the line is drawn using the current transformation
762 matrix and material. So if you need to draw the 3D line 762 matrix and material. So if you need to draw the 3D line
763 independently of the current transformation, use 763 independently of the current transformation, use
764 \code 764 \code
765 driver->setMaterial(someMaterial); 765 driver->setMaterial(someMaterial);
766 driver->setTransform(video::ETS_WORLD, core::IdentityMatrix); 766 driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
767 \endcode 767 \endcode
768 for some properly set up material before drawing the line. 768 for some properly set up material before drawing the line.
769 Some drivers support line thickness set in the material. 769 Some drivers support line thickness set in the material.
770 \param start Start of the 3d line. 770 \param start Start of the 3d line.
771 \param end End of the 3d line. 771 \param end End of the 3d line.
772 \param color Color of the line. */ 772 \param color Color of the line. */
773 virtual void draw3DLine(const core::vector3df& start, 773 virtual void draw3DLine(const core::vector3df& start,
774 const core::vector3df& end, SColor color = SColor(255,255,255,255)) =0; 774 const core::vector3df& end, SColor color = SColor(255,255,255,255)) =0;
775 775
776 //! Draws a 3d triangle. 776 //! Draws a 3d triangle.
777 /** This method calls drawVertexPrimitiveList for some triangles. 777 /** This method calls drawVertexPrimitiveList for some triangles.
778 This method works with all drivers because it simply calls 778 This method works with all drivers because it simply calls
779 drawVertexPrimitiveList, but it is hence not very fast. 779 drawVertexPrimitiveList, but it is hence not very fast.
780 Note that the triangle is drawn using the current 780 Note that the triangle is drawn using the current
781 transformation matrix and material. So if you need to draw it 781 transformation matrix and material. So if you need to draw it
782 independently of the current transformation, use 782 independently of the current transformation, use
783 \code 783 \code
784 driver->setMaterial(someMaterial); 784 driver->setMaterial(someMaterial);
785 driver->setTransform(video::ETS_WORLD, core::IdentityMatrix); 785 driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
786 \endcode 786 \endcode
787 for some properly set up material before drawing the triangle. 787 for some properly set up material before drawing the triangle.
788 \param triangle The triangle to draw. 788 \param triangle The triangle to draw.
789 \param color Color of the line. */ 789 \param color Color of the line. */
790 virtual void draw3DTriangle(const core::triangle3df& triangle, 790 virtual void draw3DTriangle(const core::triangle3df& triangle,
791 SColor color = SColor(255,255,255,255)) =0; 791 SColor color = SColor(255,255,255,255)) =0;
792 792
793 //! Draws a 3d axis aligned box. 793 //! Draws a 3d axis aligned box.
794 /** This method simply calls draw3DLine for the edges of the 794 /** This method simply calls draw3DLine for the edges of the
795 box. Note that the box is drawn using the current transformation 795 box. Note that the box is drawn using the current transformation
796 matrix and material. So if you need to draw it independently of 796 matrix and material. So if you need to draw it independently of
797 the current transformation, use 797 the current transformation, use
798 \code 798 \code
799 driver->setMaterial(someMaterial); 799 driver->setMaterial(someMaterial);
800 driver->setTransform(video::ETS_WORLD, core::IdentityMatrix); 800 driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
801 \endcode 801 \endcode
802 for some properly set up material before drawing the box. 802 for some properly set up material before drawing the box.
803 \param box The axis aligned box to draw 803 \param box The axis aligned box to draw
804 \param color Color to use while drawing the box. */ 804 \param color Color to use while drawing the box. */
805 virtual void draw3DBox(const core::aabbox3d<f32>& box, 805 virtual void draw3DBox(const core::aabbox3d<f32>& box,
806 SColor color = SColor(255,255,255,255)) =0; 806 SColor color = SColor(255,255,255,255)) =0;
807 807
808 //! Draws a 2d image without any special effects 808 //! Draws a 2d image without any special effects
809 /** \param texture Pointer to texture to use. 809 /** \param texture Pointer to texture to use.
810 \param destPos Upper left 2d destination position where the 810 \param destPos Upper left 2d destination position where the
811 image will be drawn. */ 811 image will be drawn. */
812 virtual void draw2DImage(const video::ITexture* texture, 812 virtual void draw2DImage(const video::ITexture* texture,
813 const core::position2d<s32>& destPos) =0; 813 const core::position2d<s32>& destPos) =0;
814 814
815 //! Draws a 2d image using a color 815 //! Draws a 2d image using a color
816 /** (if color is other than 816 /** (if color is other than
817 Color(255,255,255,255)) and the alpha channel of the texture. 817 Color(255,255,255,255)) and the alpha channel of the texture.
818 \param texture Texture to be drawn. 818 \param texture Texture to be drawn.
819 \param destPos Upper left 2d destination position where the 819 \param destPos Upper left 2d destination position where the
820 image will be drawn. 820 image will be drawn.
821 \param sourceRect Source rectangle in the image. 821 \param sourceRect Source rectangle in the image.
822 \param clipRect Pointer to rectangle on the screen where the 822 \param clipRect Pointer to rectangle on the screen where the
823 image is clipped to. 823 image is clipped to.
824 If this pointer is NULL the image is not clipped. 824 If this pointer is NULL the image is not clipped.
825 \param color Color with which the image is drawn. If the color 825 \param color Color with which the image is drawn. If the color
826 equals Color(255,255,255,255) it is ignored. Note that the 826 equals Color(255,255,255,255) it is ignored. Note that the
827 alpha component is used: If alpha is other than 255, the image 827 alpha component is used: If alpha is other than 255, the image
828 will be transparent. 828 will be transparent.
829 \param useAlphaChannelOfTexture: If true, the alpha channel of 829 \param useAlphaChannelOfTexture: If true, the alpha channel of
830 the texture is used to draw the image.*/ 830 the texture is used to draw the image.*/
831 virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, 831 virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
832 const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0, 832 const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
833 SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) =0; 833 SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) =0;
834 834
835 //! Draws a set of 2d images, using a color and the alpha channel of the texture. 835 //! Draws a set of 2d images, using a color and the alpha channel of the texture.
836 /** The images are drawn beginning at pos and concatenated in 836 /** The images are drawn beginning at pos and concatenated in
837 one line. All drawings are clipped against clipRect (if != 0). 837 one line. All drawings are clipped against clipRect (if != 0).
838 The subtextures are defined by the array of sourceRects and are 838 The subtextures are defined by the array of sourceRects and are
839 chosen by the indices given. 839 chosen by the indices given.
840 \param texture Texture to be drawn. 840 \param texture Texture to be drawn.
841 \param pos Upper left 2d destination position where the image 841 \param pos Upper left 2d destination position where the image
842 will be drawn. 842 will be drawn.
843 \param sourceRects Source rectangles of the image. 843 \param sourceRects Source rectangles of the image.
844 \param indices List of indices which choose the actual 844 \param indices List of indices which choose the actual
845 rectangle used each time. 845 rectangle used each time.
846 \param kerningWidth Offset to Position on X 846 \param kerningWidth Offset to Position on X
847 \param clipRect Pointer to rectangle on the screen where the 847 \param clipRect Pointer to rectangle on the screen where the
848 image is clipped to. 848 image is clipped to.
849 If this pointer is 0 then the image is not clipped. 849 If this pointer is 0 then the image is not clipped.
850 \param color Color with which the image is drawn. 850 \param color Color with which the image is drawn.
851 Note that the alpha component is used. If alpha is other than 851 Note that the alpha component is used. If alpha is other than
852 255, the image will be transparent. 852 255, the image will be transparent.
853 \param useAlphaChannelOfTexture: If true, the alpha channel of 853 \param useAlphaChannelOfTexture: If true, the alpha channel of
854 the texture is used to draw the image. */ 854 the texture is used to draw the image. */
855 virtual void draw2DImageBatch(const video::ITexture* texture, 855 virtual void draw2DImageBatch(const video::ITexture* texture,
856 const core::position2d<s32>& pos, 856 const core::position2d<s32>& pos,
857 const core::array<core::rect<s32> >& sourceRects, 857 const core::array<core::rect<s32> >& sourceRects,
858 const core::array<s32>& indices, 858 const core::array<s32>& indices,
859 s32 kerningWidth=0, 859 s32 kerningWidth=0,
860 const core::rect<s32>* clipRect=0, 860 const core::rect<s32>* clipRect=0,
861 SColor color=SColor(255,255,255,255), 861 SColor color=SColor(255,255,255,255),
862 bool useAlphaChannelOfTexture=false) =0; 862 bool useAlphaChannelOfTexture=false) =0;
863 863
864 //! Draws a set of 2d images, using a color and the alpha channel of the texture. 864 //! Draws a set of 2d images, using a color and the alpha channel of the texture.
865 /** All drawings are clipped against clipRect (if != 0). 865 /** All drawings are clipped against clipRect (if != 0).
866 The subtextures are defined by the array of sourceRects and are 866 The subtextures are defined by the array of sourceRects and are
867 positioned using the array of positions. 867 positioned using the array of positions.
868 \param texture Texture to be drawn. 868 \param texture Texture to be drawn.
869 \param positions Array of upper left 2d destinations where the 869 \param positions Array of upper left 2d destinations where the
870 images will be drawn. 870 images will be drawn.
871 \param sourceRects Source rectangles of the image. 871 \param sourceRects Source rectangles of the image.
872 \param clipRect Pointer to rectangle on the screen where the 872 \param clipRect Pointer to rectangle on the screen where the
873 images are clipped to. 873 images are clipped to.
874 If this pointer is 0 then the image is not clipped. 874 If this pointer is 0 then the image is not clipped.
875 \param color Color with which the image is drawn. 875 \param color Color with which the image is drawn.
876 Note that the alpha component is used. If alpha is other than 876 Note that the alpha component is used. If alpha is other than
877 255, the image will be transparent. 877 255, the image will be transparent.
878 \param useAlphaChannelOfTexture: If true, the alpha channel of 878 \param useAlphaChannelOfTexture: If true, the alpha channel of
879 the texture is used to draw the image. */ 879 the texture is used to draw the image. */
880 virtual void draw2DImageBatch(const video::ITexture* texture, 880 virtual void draw2DImageBatch(const video::ITexture* texture,
881 const core::array<core::position2d<s32> >& positions, 881 const core::array<core::position2d<s32> >& positions,
882 const core::array<core::rect<s32> >& sourceRects, 882 const core::array<core::rect<s32> >& sourceRects,
883 const core::rect<s32>* clipRect=0, 883 const core::rect<s32>* clipRect=0,
884 SColor color=SColor(255,255,255,255), 884 SColor color=SColor(255,255,255,255),
885 bool useAlphaChannelOfTexture=false) =0; 885 bool useAlphaChannelOfTexture=false) =0;
886 886
887 //! Draws a part of the texture into the rectangle. Note that colors must be an array of 4 colors if used. 887 //! Draws a part of the texture into the rectangle. Note that colors must be an array of 4 colors if used.
888 /** Suggested and first implemented by zola. 888 /** Suggested and first implemented by zola.
889 \param texture The texture to draw from 889 \param texture The texture to draw from
890 \param destRect The rectangle to draw into 890 \param destRect The rectangle to draw into
891 \param sourceRect The rectangle denoting a part of the texture 891 \param sourceRect The rectangle denoting a part of the texture
892 \param clipRect Clips the destination rectangle (may be 0) 892 \param clipRect Clips the destination rectangle (may be 0)
893 \param colors Array of 4 colors denoting the color values of 893 \param colors Array of 4 colors denoting the color values of
894 the corners of the destRect 894 the corners of the destRect
895 \param useAlphaChannelOfTexture True if alpha channel will be 895 \param useAlphaChannelOfTexture True if alpha channel will be
896 blended. */ 896 blended. */
897 virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect, 897 virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
898 const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0, 898 const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
899 const video::SColor * const colors=0, bool useAlphaChannelOfTexture=false) =0; 899 const video::SColor * const colors=0, bool useAlphaChannelOfTexture=false) =0;
900 900
901 //! Draws a 2d rectangle. 901 //! Draws a 2d rectangle.
902 /** \param color Color of the rectangle to draw. The alpha 902 /** \param color Color of the rectangle to draw. The alpha
903 component will not be ignored and specifies how transparent the 903 component will not be ignored and specifies how transparent the
904 rectangle will be. 904 rectangle will be.
905 \param pos Position of the rectangle. 905 \param pos Position of the rectangle.
906 \param clip Pointer to rectangle against which the rectangle 906 \param clip Pointer to rectangle against which the rectangle
907 will be clipped. If the pointer is null, no clipping will be 907 will be clipped. If the pointer is null, no clipping will be
908 performed. */ 908 performed. */
909 virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos, 909 virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos,
910 const core::rect<s32>* clip =0) =0; 910 const core::rect<s32>* clip =0) =0;
911 911
912 //! Draws a 2d rectangle with a gradient. 912 //! Draws a 2d rectangle with a gradient.
913 /** \param colorLeftUp Color of the upper left corner to draw. 913 /** \param colorLeftUp Color of the upper left corner to draw.
914 The alpha component will not be ignored and specifies how 914 The alpha component will not be ignored and specifies how
915 transparent the rectangle will be. 915 transparent the rectangle will be.
916 \param colorRightUp Color of the upper right corner to draw. 916 \param colorRightUp Color of the upper right corner to draw.
917 The alpha component will not be ignored and specifies how 917 The alpha component will not be ignored and specifies how
918 transparent the rectangle will be. 918 transparent the rectangle will be.
919 \param colorLeftDown Color of the lower left corner to draw. 919 \param colorLeftDown Color of the lower left corner to draw.
920 The alpha component will not be ignored and specifies how 920 The alpha component will not be ignored and specifies how
921 transparent the rectangle will be. 921 transparent the rectangle will be.
922 \param colorRightDown Color of the lower right corner to draw. 922 \param colorRightDown Color of the lower right corner to draw.
923 The alpha component will not be ignored and specifies how 923 The alpha component will not be ignored and specifies how
924 transparent the rectangle will be. 924 transparent the rectangle will be.
925 \param pos Position of the rectangle. 925 \param pos Position of the rectangle.
926 \param clip Pointer to rectangle against which the rectangle 926 \param clip Pointer to rectangle against which the rectangle
927 will be clipped. If the pointer is null, no clipping will be 927 will be clipped. If the pointer is null, no clipping will be
928 performed. */ 928 performed. */
929 virtual void draw2DRectangle(const core::rect<s32>& pos, 929 virtual void draw2DRectangle(const core::rect<s32>& pos,
930 SColor colorLeftUp, SColor colorRightUp, 930 SColor colorLeftUp, SColor colorRightUp,
931 SColor colorLeftDown, SColor colorRightDown, 931 SColor colorLeftDown, SColor colorRightDown,
932 const core::rect<s32>* clip =0) =0; 932 const core::rect<s32>* clip =0) =0;
933 933
934 //! Draws the outline of a 2D rectangle. 934 //! Draws the outline of a 2D rectangle.
935 /** \param pos Position of the rectangle. 935 /** \param pos Position of the rectangle.
936 \param color Color of the rectangle to draw. The alpha component 936 \param color Color of the rectangle to draw. The alpha component
937 specifies how transparent the rectangle outline will be. */ 937 specifies how transparent the rectangle outline will be. */
938 virtual void draw2DRectangleOutline(const core::recti& pos, 938 virtual void draw2DRectangleOutline(const core::recti& pos,
939 SColor color=SColor(255,255,255,255)) =0; 939 SColor color=SColor(255,255,255,255)) =0;
940 940
941 //! Draws a 2d line. Both start and end will be included in coloring. 941 //! Draws a 2d line. Both start and end will be included in coloring.
942 /** \param start Screen coordinates of the start of the line 942 /** \param start Screen coordinates of the start of the line
943 in pixels. 943 in pixels.
944 \param end Screen coordinates of the start of the line in 944 \param end Screen coordinates of the start of the line in
945 pixels. 945 pixels.
946 \param color Color of the line to draw. */ 946 \param color Color of the line to draw. */
947 virtual void draw2DLine(const core::position2d<s32>& start, 947 virtual void draw2DLine(const core::position2d<s32>& start,
948 const core::position2d<s32>& end, 948 const core::position2d<s32>& end,
949 SColor color=SColor(255,255,255,255)) =0; 949 SColor color=SColor(255,255,255,255)) =0;
950 950
951 //! Draws a pixel. 951 //! Draws a pixel.
952 /** \param x The x-position of the pixel. 952 /** \param x The x-position of the pixel.
953 \param y The y-position of the pixel. 953 \param y The y-position of the pixel.
954 \param color Color of the pixel to draw. */ 954 \param color Color of the pixel to draw. */
955 virtual void drawPixel(u32 x, u32 y, const SColor& color) =0; 955 virtual void drawPixel(u32 x, u32 y, const SColor& color) =0;
956 956
957 //! Draws a non filled concyclic regular 2d polyon. 957 //! Draws a non filled concyclic regular 2d polyon.
958 /** This method can be used to draw circles, but also 958 /** This method can be used to draw circles, but also
959 triangles, tetragons, pentagons, hexagons, heptagons, octagons, 959 triangles, tetragons, pentagons, hexagons, heptagons, octagons,
960 enneagons, decagons, hendecagons, dodecagon, triskaidecagons, 960 enneagons, decagons, hendecagons, dodecagon, triskaidecagons,
961 etc. I think you'll got it now. And all this by simply 961 etc. I think you'll got it now. And all this by simply
962 specifying the vertex count. Welcome to the wonders of 962 specifying the vertex count. Welcome to the wonders of
963 geometry. 963 geometry.
964 \param center Position of center of circle (pixels). 964 \param center Position of center of circle (pixels).
965 \param radius Radius of circle in pixels. 965 \param radius Radius of circle in pixels.
966 \param color Color of the circle. 966 \param color Color of the circle.
967 \param vertexCount Amount of vertices of the polygon. Specify 2 967 \param vertexCount Amount of vertices of the polygon. Specify 2
968 to draw a line, 3 to draw a triangle, 4 for tetragons and a lot 968 to draw a line, 3 to draw a triangle, 4 for tetragons and a lot
969 (>10) for nearly a circle. */ 969 (>10) for nearly a circle. */
970 virtual void draw2DPolygon(core::position2d<s32> center, 970 virtual void draw2DPolygon(core::position2d<s32> center,
971 f32 radius, 971 f32 radius,
972 video::SColor color=SColor(100,255,255,255), 972 video::SColor color=SColor(100,255,255,255),
973 s32 vertexCount=10) =0; 973 s32 vertexCount=10) =0;
974 974
975 //! Draws a shadow volume into the stencil buffer. 975 //! Draws a shadow volume into the stencil buffer.
976 /** To draw a stencil shadow, do this: First, draw all geometry. 976 /** To draw a stencil shadow, do this: First, draw all geometry.
977 Then use this method, to draw the shadow volume. Then, use 977 Then use this method, to draw the shadow volume. Then, use
978 IVideoDriver::drawStencilShadow() to visualize the shadow. 978 IVideoDriver::drawStencilShadow() to visualize the shadow.
979 Please note that the code for the opengl version of the method 979 Please note that the code for the opengl version of the method
980 is based on free code sent in by Philipp Dortmann, lots of 980 is based on free code sent in by Philipp Dortmann, lots of
981 thanks go to him! 981 thanks go to him!
982 \param triangles Array of 3d vectors, specifying the shadow 982 \param triangles Array of 3d vectors, specifying the shadow
983 volume. 983 volume.
984 \param zfail If set to true, zfail method is used, otherwise 984 \param zfail If set to true, zfail method is used, otherwise
985 zpass. 985 zpass.
986 \param debugDataVisible The debug data that is enabled for this 986 \param debugDataVisible The debug data that is enabled for this
987 shadow node 987 shadow node
988 */ 988 */
989 virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0) =0; 989 virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0) =0;
990 990
991 //! Fills the stencil shadow with color. 991 //! Fills the stencil shadow with color.
992 /** After the shadow volume has been drawn into the stencil 992 /** After the shadow volume has been drawn into the stencil
993 buffer using IVideoDriver::drawStencilShadowVolume(), use this 993 buffer using IVideoDriver::drawStencilShadowVolume(), use this
994 to draw the color of the shadow. 994 to draw the color of the shadow.
995 Please note that the code for the opengl version of the method 995 Please note that the code for the opengl version of the method
996 is based on free code sent in by Philipp Dortmann, lots of 996 is based on free code sent in by Philipp Dortmann, lots of
997 thanks go to him! 997 thanks go to him!
998 \param clearStencilBuffer Set this to false, if you want to 998 \param clearStencilBuffer Set this to false, if you want to
999 draw every shadow with the same color, and only want to call 999 draw every shadow with the same color, and only want to call
1000 drawStencilShadow() once after all shadow volumes have been 1000 drawStencilShadow() once after all shadow volumes have been
1001 drawn. Set this to true, if you want to paint every shadow with 1001 drawn. Set this to true, if you want to paint every shadow with
1002 its own color. 1002 its own color.
1003 \param leftUpEdge Color of the shadow in the upper left corner 1003 \param leftUpEdge Color of the shadow in the upper left corner
1004 of screen. 1004 of screen.
1005 \param rightUpEdge Color of the shadow in the upper right 1005 \param rightUpEdge Color of the shadow in the upper right
1006 corner of screen. 1006 corner of screen.
1007 \param leftDownEdge Color of the shadow in the lower left 1007 \param leftDownEdge Color of the shadow in the lower left
1008 corner of screen. 1008 corner of screen.
1009 \param rightDownEdge Color of the shadow in the lower right 1009 \param rightDownEdge Color of the shadow in the lower right
1010 corner of screen. */ 1010 corner of screen. */
1011 virtual void drawStencilShadow(bool clearStencilBuffer=false, 1011 virtual void drawStencilShadow(bool clearStencilBuffer=false,
1012 video::SColor leftUpEdge = video::SColor(255,0,0,0), 1012 video::SColor leftUpEdge = video::SColor(255,0,0,0),
1013 video::SColor rightUpEdge = video::SColor(255,0,0,0), 1013 video::SColor rightUpEdge = video::SColor(255,0,0,0),
1014 video::SColor leftDownEdge = video::SColor(255,0,0,0), 1014 video::SColor leftDownEdge = video::SColor(255,0,0,0),
1015 video::SColor rightDownEdge = video::SColor(255,0,0,0)) =0; 1015 video::SColor rightDownEdge = video::SColor(255,0,0,0)) =0;
1016 1016
1017 //! Draws a mesh buffer 1017 //! Draws a mesh buffer
1018 /** \param mb Buffer to draw */ 1018 /** \param mb Buffer to draw */
1019 virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) =0; 1019 virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) =0;
1020 1020
1021 //! Draws normals of a mesh buffer 1021 //! Draws normals of a mesh buffer
1022 /** \param mb Buffer to draw the normals of 1022 /** \param mb Buffer to draw the normals of
1023 \param length length scale factor of the normals 1023 \param length length scale factor of the normals
1024 \param color Color the normals are rendered with 1024 \param color Color the normals are rendered with
1025 */ 1025 */
1026 virtual void drawMeshBufferNormals(const scene::IMeshBuffer* mb, f32 length=10.f, SColor color=0xffffffff) =0; 1026 virtual void drawMeshBufferNormals(const scene::IMeshBuffer* mb, f32 length=10.f, SColor color=0xffffffff) =0;
1027 1027
1028 //! Sets the fog mode. 1028 //! Sets the fog mode.
1029 /** These are global values attached to each 3d object rendered, 1029 /** These are global values attached to each 3d object rendered,
1030 which has the fog flag enabled in its material. 1030 which has the fog flag enabled in its material.
1031 \param color Color of the fog 1031 \param color Color of the fog
1032 \param fogType Type of fog used 1032 \param fogType Type of fog used
1033 \param start Only used in linear fog mode (linearFog=true). 1033 \param start Only used in linear fog mode (linearFog=true).
1034 Specifies where fog starts. 1034 Specifies where fog starts.
1035 \param end Only used in linear fog mode (linearFog=true). 1035 \param end Only used in linear fog mode (linearFog=true).
1036 Specifies where fog ends. 1036 Specifies where fog ends.
1037 \param density Only used in exponential fog mode 1037 \param density Only used in exponential fog mode
1038 (linearFog=false). Must be a value between 0 and 1. 1038 (linearFog=false). Must be a value between 0 and 1.
1039 \param pixelFog Set this to false for vertex fog, and true if 1039 \param pixelFog Set this to false for vertex fog, and true if
1040 you want per-pixel fog. 1040 you want per-pixel fog.
1041 \param rangeFog Set this to true to enable range-based vertex 1041 \param rangeFog Set this to true to enable range-based vertex
1042 fog. The distance from the viewer is used to compute the fog, 1042 fog. The distance from the viewer is used to compute the fog,
1043 not the z-coordinate. This is better, but slower. This might not 1043 not the z-coordinate. This is better, but slower. This might not
1044 be available with all drivers and fog settings. */ 1044 be available with all drivers and fog settings. */
1045 virtual void setFog(SColor color=SColor(0,255,255,255), 1045 virtual void setFog(SColor color=SColor(0,255,255,255),
1046 E_FOG_TYPE fogType=EFT_FOG_LINEAR, 1046 E_FOG_TYPE fogType=EFT_FOG_LINEAR,
1047 f32 start=50.0f, f32 end=100.0f, f32 density=0.01f, 1047 f32 start=50.0f, f32 end=100.0f, f32 density=0.01f,
1048 bool pixelFog=false, bool rangeFog=false) =0; 1048 bool pixelFog=false, bool rangeFog=false) =0;
1049 1049
1050 //! Gets the fog mode. 1050 //! Gets the fog mode.
1051 virtual void getFog(SColor& color, E_FOG_TYPE& fogType, 1051 virtual void getFog(SColor& color, E_FOG_TYPE& fogType,
1052 f32& start, f32& end, f32& density, 1052 f32& start, f32& end, f32& density,
1053 bool& pixelFog, bool& rangeFog) = 0; 1053 bool& pixelFog, bool& rangeFog) = 0;
1054 1054
1055 //! Get the current color format of the color buffer 1055 //! Get the current color format of the color buffer
1056 /** \return Color format of the color buffer. */ 1056 /** \return Color format of the color buffer. */
1057 virtual ECOLOR_FORMAT getColorFormat() const =0; 1057 virtual ECOLOR_FORMAT getColorFormat() const =0;
1058 1058
1059 //! Get the size of the screen or render window. 1059 //! Get the size of the screen or render window.
1060 /** \return Size of screen or render window. */ 1060 /** \return Size of screen or render window. */
1061 virtual const core::dimension2d<u32>& getScreenSize() const =0; 1061 virtual const core::dimension2d<u32>& getScreenSize() const =0;
1062 1062
1063 //! Get the size of the current render target 1063 //! Get the size of the current render target
1064 /** This method will return the screen size if the driver 1064 /** This method will return the screen size if the driver
1065 doesn't support render to texture, or if the current render 1065 doesn't support render to texture, or if the current render
1066 target is the screen. 1066 target is the screen.
1067 \return Size of render target or screen/window */ 1067 \return Size of render target or screen/window */
1068 virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const =0; 1068 virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const =0;
1069 1069
1070 //! Returns current frames per second value. 1070 //! Returns current frames per second value.
1071 /** This value is updated approximately every 1.5 seconds and 1071 /** This value is updated approximately every 1.5 seconds and
1072 is only intended to provide a rough guide to the average frame 1072 is only intended to provide a rough guide to the average frame
1073 rate. It is not suitable for use in performing timing 1073 rate. It is not suitable for use in performing timing
1074 calculations or framerate independent movement. 1074 calculations or framerate independent movement.
1075 \return Approximate amount of frames per second drawn. */ 1075 \return Approximate amount of frames per second drawn. */
1076 virtual s32 getFPS() const =0; 1076 virtual s32 getFPS() const =0;
1077 1077
1078 //! Returns amount of primitives (mostly triangles) which were drawn in the last frame. 1078 //! Returns amount of primitives (mostly triangles) which were drawn in the last frame.
1079 /** Together with getFPS() very useful method for statistics. 1079 /** Together with getFPS() very useful method for statistics.
1080 \param mode Defines if the primitives drawn are accumulated or 1080 \param mode Defines if the primitives drawn are accumulated or
1081 counted per frame. 1081 counted per frame.
1082 \return Amount of primitives drawn in the last frame. */ 1082 \return Amount of primitives drawn in the last frame. */
1083 virtual u32 getPrimitiveCountDrawn( u32 mode =0 ) const =0; 1083 virtual u32 getPrimitiveCountDrawn( u32 mode =0 ) const =0;
1084 1084
1085 //! Deletes all dynamic lights which were previously added with addDynamicLight(). 1085 //! Deletes all dynamic lights which were previously added with addDynamicLight().
1086 virtual void deleteAllDynamicLights() =0; 1086 virtual void deleteAllDynamicLights() =0;
1087 1087
1088 //! adds a dynamic light, returning an index to the light 1088 //! adds a dynamic light, returning an index to the light
1089 //! \param light: the light data to use to create the light 1089 //! \param light: the light data to use to create the light
1090 //! \return An index to the light, or -1 if an error occurs 1090 //! \return An index to the light, or -1 if an error occurs
1091 virtual s32 addDynamicLight(const SLight& light) =0; 1091 virtual s32 addDynamicLight(const SLight& light) =0;
1092 1092
1093 //! Returns the maximal amount of dynamic lights the device can handle 1093 //! Returns the maximal amount of dynamic lights the device can handle
1094 /** \return Maximal amount of dynamic lights. */ 1094 /** \return Maximal amount of dynamic lights. */
1095 virtual u32 getMaximalDynamicLightAmount() const =0; 1095 virtual u32 getMaximalDynamicLightAmount() const =0;
1096 1096
1097 //! Returns amount of dynamic lights currently set 1097 //! Returns amount of dynamic lights currently set
1098 /** \return Amount of dynamic lights currently set */ 1098 /** \return Amount of dynamic lights currently set */
1099 virtual u32 getDynamicLightCount() const =0; 1099 virtual u32 getDynamicLightCount() const =0;
1100 1100
1101 //! Returns light data which was previously set by IVideoDriver::addDynamicLight(). 1101 //! Returns light data which was previously set by IVideoDriver::addDynamicLight().
1102 /** \param idx Zero based index of the light. Must be 0 or 1102 /** \param idx Zero based index of the light. Must be 0 or
1103 greater and smaller than IVideoDriver::getDynamicLightCount. 1103 greater and smaller than IVideoDriver::getDynamicLightCount.
1104 \return Light data. */ 1104 \return Light data. */
1105 virtual const SLight& getDynamicLight(u32 idx) const =0; 1105 virtual const SLight& getDynamicLight(u32 idx) const =0;
1106 1106
1107 //! Turns a dynamic light on or off 1107 //! Turns a dynamic light on or off
1108 //! \param lightIndex: the index returned by addDynamicLight 1108 //! \param lightIndex: the index returned by addDynamicLight
1109 //! \param turnOn: true to turn the light on, false to turn it off 1109 //! \param turnOn: true to turn the light on, false to turn it off
1110 virtual void turnLightOn(s32 lightIndex, bool turnOn) =0; 1110 virtual void turnLightOn(s32 lightIndex, bool turnOn) =0;
1111 1111
1112 //! Gets name of this video driver. 1112 //! Gets name of this video driver.
1113 /** \return Returns the name of the video driver, e.g. in case 1113 /** \return Returns the name of the video driver, e.g. in case
1114 of the Direct3D8 driver, it would return "Direct3D 8.1". */ 1114 of the Direct3D8 driver, it would return "Direct3D 8.1". */
1115 virtual const wchar_t* getName() const =0; 1115 virtual const wchar_t* getName() const =0;
1116 1116
1117 //! Adds an external image loader to the engine. 1117 //! Adds an external image loader to the engine.
1118 /** This is useful if the Irrlicht Engine should be able to load 1118 /** This is useful if the Irrlicht Engine should be able to load
1119 textures of currently unsupported file formats (e.g. gif). The 1119 textures of currently unsupported file formats (e.g. gif). The
1120 IImageLoader only needs to be implemented for loading this file 1120 IImageLoader only needs to be implemented for loading this file
1121 format. A pointer to the implementation can be passed to the 1121 format. A pointer to the implementation can be passed to the
1122 engine using this method. 1122 engine using this method.
1123 \param loader Pointer to the external loader created. */ 1123 \param loader Pointer to the external loader created. */
1124 virtual void addExternalImageLoader(IImageLoader* loader) =0; 1124 virtual void addExternalImageLoader(IImageLoader* loader) =0;
1125 1125
1126 //! Adds an external image writer to the engine. 1126 //! Adds an external image writer to the engine.
1127 /** This is useful if the Irrlicht Engine should be able to 1127 /** This is useful if the Irrlicht Engine should be able to
1128 write textures of currently unsupported file formats (e.g 1128 write textures of currently unsupported file formats (e.g
1129 .gif). The IImageWriter only needs to be implemented for 1129 .gif). The IImageWriter only needs to be implemented for
1130 writing this file format. A pointer to the implementation can 1130 writing this file format. A pointer to the implementation can
1131 be passed to the engine using this method. 1131 be passed to the engine using this method.
1132 \param writer: Pointer to the external writer created. */ 1132 \param writer: Pointer to the external writer created. */
1133 virtual void addExternalImageWriter(IImageWriter* writer) =0; 1133 virtual void addExternalImageWriter(IImageWriter* writer) =0;
1134 1134
1135 //! Returns the maximum amount of primitives 1135 //! Returns the maximum amount of primitives
1136 /** (mostly vertices) which the device is able to render with 1136 /** (mostly vertices) which the device is able to render with
1137 one drawVertexPrimitiveList call. 1137 one drawVertexPrimitiveList call.
1138 \return Maximum amount of primitives. */ 1138 \return Maximum amount of primitives. */
1139 virtual u32 getMaximalPrimitiveCount() const =0; 1139 virtual u32 getMaximalPrimitiveCount() const =0;
1140 1140
1141 //! Enables or disables a texture creation flag. 1141 //! Enables or disables a texture creation flag.
1142 /** These flags define how textures should be created. By 1142 /** These flags define how textures should be created. By
1143 changing this value, you can influence for example the speed of 1143 changing this value, you can influence for example the speed of
1144 rendering a lot. But please note that the video drivers take 1144 rendering a lot. But please note that the video drivers take
1145 this value only as recommendation. It could happen that you 1145 this value only as recommendation. It could happen that you
1146 enable the ETCF_ALWAYS_16_BIT mode, but the driver still creates 1146 enable the ETCF_ALWAYS_16_BIT mode, but the driver still creates
1147 32 bit textures. 1147 32 bit textures.
1148 \param flag Texture creation flag. 1148 \param flag Texture creation flag.
1149 \param enabled Specifies if the given flag should be enabled or 1149 \param enabled Specifies if the given flag should be enabled or
1150 disabled. */ 1150 disabled. */
1151 virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled=true) =0; 1151 virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled=true) =0;
1152 1152
1153 //! Returns if a texture creation flag is enabled or disabled. 1153 //! Returns if a texture creation flag is enabled or disabled.
1154 /** You can change this value using setTextureCreationFlag(). 1154 /** You can change this value using setTextureCreationFlag().
1155 \param flag Texture creation flag. 1155 \param flag Texture creation flag.
1156 \return The current texture creation flag enabled mode. */ 1156 \return The current texture creation flag enabled mode. */
1157 virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const =0; 1157 virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const =0;
1158 1158
1159 //! Creates a software image from a file. 1159 //! Creates a software image from a file.
1160 /** No hardware texture will be created for this image. This 1160 /** No hardware texture will be created for this image. This
1161 method is useful for example if you want to read a heightmap 1161 method is useful for example if you want to read a heightmap
1162 for a terrain renderer. 1162 for a terrain renderer.
1163 \param filename Name of the file from which the image is 1163 \param filename Name of the file from which the image is
1164 created. 1164 created.
1165 \return The created image. 1165 \return The created image.
1166 If you no longer need the image, you should call IImage::drop(). 1166 If you no longer need the image, you should call IImage::drop().
1167 See IReferenceCounted::drop() for more information. */ 1167 See IReferenceCounted::drop() for more information. */
1168 virtual IImage* createImageFromFile(const io::path& filename) = 0; 1168 virtual IImage* createImageFromFile(const io::path& filename) = 0;
1169 1169
1170 //! Creates a software image from a file. 1170 //! Creates a software image from a file.
1171 /** No hardware texture will be created for this image. This 1171 /** No hardware texture will be created for this image. This
1172 method is useful for example if you want to read a heightmap 1172 method is useful for example if you want to read a heightmap
1173 for a terrain renderer. 1173 for a terrain renderer.
1174 \param file File from which the image is created. 1174 \param file File from which the image is created.
1175 \return The created image. 1175 \return The created image.
1176 If you no longer need the image, you should call IImage::drop(). 1176 If you no longer need the image, you should call IImage::drop().
1177 See IReferenceCounted::drop() for more information. */ 1177 See IReferenceCounted::drop() for more information. */
1178 virtual IImage* createImageFromFile(io::IReadFile* file) =0; 1178 virtual IImage* createImageFromFile(io::IReadFile* file) =0;
1179 1179
1180 //! Writes the provided image to a file. 1180 //! Writes the provided image to a file.
1181 /** Requires that there is a suitable image writer registered 1181 /** Requires that there is a suitable image writer registered
1182 for writing the image. 1182 for writing the image.
1183 \param image Image to write. 1183 \param image Image to write.
1184 \param filename Name of the file to write. 1184 \param filename Name of the file to write.
1185 \param param Control parameter for the backend (e.g. compression 1185 \param param Control parameter for the backend (e.g. compression
1186 level). 1186 level).
1187 \return True on successful write. */ 1187 \return True on successful write. */
1188 virtual bool writeImageToFile(IImage* image, const io::path& filename, u32 param = 0) = 0; 1188 virtual bool writeImageToFile(IImage* image, const io::path& filename, u32 param = 0) = 0;
1189 1189
1190 //! Writes the provided image to a file. 1190 //! Writes the provided image to a file.
1191 /** Requires that there is a suitable image writer registered 1191 /** Requires that there is a suitable image writer registered
1192 for writing the image. 1192 for writing the image.
1193 \param image Image to write. 1193 \param image Image to write.
1194 \param file An already open io::IWriteFile object. The name 1194 \param file An already open io::IWriteFile object. The name
1195 will be used to determine the appropriate image writer to use. 1195 will be used to determine the appropriate image writer to use.
1196 \param param Control parameter for the backend (e.g. compression 1196 \param param Control parameter for the backend (e.g. compression
1197 level). 1197 level).
1198 \return True on successful write. */ 1198 \return True on successful write. */
1199 virtual bool writeImageToFile(IImage* image, io::IWriteFile* file, u32 param =0) =0; 1199 virtual bool writeImageToFile(IImage* image, io::IWriteFile* file, u32 param =0) =0;
1200 1200
1201 //! Creates a software image from a byte array. 1201 //! Creates a software image from a byte array.
1202 /** No hardware texture will be created for this image. This 1202 /** No hardware texture will be created for this image. This
1203 method is useful for example if you want to read a heightmap 1203 method is useful for example if you want to read a heightmap
1204 for a terrain renderer. 1204 for a terrain renderer.
1205 \param format Desired color format of the texture 1205 \param format Desired color format of the texture
1206 \param size Desired size of the image 1206 \param size Desired size of the image
1207 \param data A byte array with pixel color information 1207 \param data A byte array with pixel color information
1208 \param ownForeignMemory If true, the image will use the data 1208 \param ownForeignMemory If true, the image will use the data
1209 pointer directly and own it afterwards. If false, the memory 1209 pointer directly and own it afterwards. If false, the memory
1210 will by copied internally. 1210 will by copied internally.
1211 \param deleteMemory Whether the memory is deallocated upon 1211 \param deleteMemory Whether the memory is deallocated upon
1212 destruction. 1212 destruction.
1213 \return The created image. 1213 \return The created image.
1214 If you no longer need the image, you should call IImage::drop(). 1214 If you no longer need the image, you should call IImage::drop().
1215 See IReferenceCounted::drop() for more information. */ 1215 See IReferenceCounted::drop() for more information. */
1216 virtual IImage* createImageFromData(ECOLOR_FORMAT format, 1216 virtual IImage* createImageFromData(ECOLOR_FORMAT format,
1217 const core::dimension2d<u32>& size, void *data, 1217 const core::dimension2d<u32>& size, void *data,
1218 bool ownForeignMemory=false, 1218 bool ownForeignMemory=false,
1219 bool deleteMemory = true) =0; 1219 bool deleteMemory = true) =0;
1220 1220
1221 //! Creates an empty software image. 1221 //! Creates an empty software image.
1222 /** 1222 /**
1223 \param format Desired color format of the image. 1223 \param format Desired color format of the image.
1224 \param size Size of the image to create. 1224 \param size Size of the image to create.
1225 \return The created image. 1225 \return The created image.
1226 If you no longer need the image, you should call IImage::drop(). 1226 If you no longer need the image, you should call IImage::drop().
1227 See IReferenceCounted::drop() for more information. */ 1227 See IReferenceCounted::drop() for more information. */
1228 virtual IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) =0; 1228 virtual IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) =0;
1229 1229
1230 //! Creates a software image by converting it to given format from another image. 1230 //! Creates a software image by converting it to given format from another image.
1231 /** \deprecated Create an empty image and use copyTo(). This method may be removed by Irrlicht 1.9. 1231 /** \deprecated Create an empty image and use copyTo(). This method may be removed by Irrlicht 1.9.
1232 \param format Desired color format of the image. 1232 \param format Desired color format of the image.
1233 \param imageToCopy Image to copy to the new image. 1233 \param imageToCopy Image to copy to the new image.
1234 \return The created image. 1234 \return The created image.
1235 If you no longer need the image, you should call IImage::drop(). 1235 If you no longer need the image, you should call IImage::drop().
1236 See IReferenceCounted::drop() for more information. */ 1236 See IReferenceCounted::drop() for more information. */
1237 _IRR_DEPRECATED_ virtual IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) =0; 1237 _IRR_DEPRECATED_ virtual IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) =0;
1238 1238
1239 //! Creates a software image from a part of another image. 1239 //! Creates a software image from a part of another image.
1240 /** \deprecated Create an empty image and use copyTo(). This method may be removed by Irrlicht 1.9. 1240 /** \deprecated Create an empty image and use copyTo(). This method may be removed by Irrlicht 1.9.
1241 \param imageToCopy Image to copy to the new image in part. 1241 \param imageToCopy Image to copy to the new image in part.
1242 \param pos Position of rectangle to copy. 1242 \param pos Position of rectangle to copy.
1243 \param size Extents of rectangle to copy. 1243 \param size Extents of rectangle to copy.
1244 \return The created image. 1244 \return The created image.
1245 If you no longer need the image, you should call IImage::drop(). 1245 If you no longer need the image, you should call IImage::drop().
1246 See IReferenceCounted::drop() for more information. */ 1246 See IReferenceCounted::drop() for more information. */
1247 _IRR_DEPRECATED_ virtual IImage* createImage(IImage* imageToCopy, 1247 _IRR_DEPRECATED_ virtual IImage* createImage(IImage* imageToCopy,
1248 const core::position2d<s32>& pos, 1248 const core::position2d<s32>& pos,
1249 const core::dimension2d<u32>& size) =0; 1249 const core::dimension2d<u32>& size) =0;
1250 1250
1251 //! Creates a software image from a part of a texture. 1251 //! Creates a software image from a part of a texture.
1252 /** 1252 /**
1253 \param texture Texture to copy to the new image in part. 1253 \param texture Texture to copy to the new image in part.
1254 \param pos Position of rectangle to copy. 1254 \param pos Position of rectangle to copy.
1255 \param size Extents of rectangle to copy. 1255 \param size Extents of rectangle to copy.
1256 \return The created image. 1256 \return The created image.
1257 If you no longer need the image, you should call IImage::drop(). 1257 If you no longer need the image, you should call IImage::drop().
1258 See IReferenceCounted::drop() for more information. */ 1258 See IReferenceCounted::drop() for more information. */
1259 virtual IImage* createImage(ITexture* texture, 1259 virtual IImage* createImage(ITexture* texture,
1260 const core::position2d<s32>& pos, 1260 const core::position2d<s32>& pos,
1261 const core::dimension2d<u32>& size) =0; 1261 const core::dimension2d<u32>& size) =0;
1262 1262
1263 //! Event handler for resize events. Only used by the engine internally. 1263 //! Event handler for resize events. Only used by the engine internally.
1264 /** Used to notify the driver that the window was resized. 1264 /** Used to notify the driver that the window was resized.
1265 Usually, there is no need to call this method. */ 1265 Usually, there is no need to call this method. */
1266 virtual void OnResize(const core::dimension2d<u32>& size) =0; 1266 virtual void OnResize(const core::dimension2d<u32>& size) =0;
1267 1267
1268 //! Adds a new material renderer to the video device. 1268 //! Adds a new material renderer to the video device.
1269 /** Use this method to extend the VideoDriver with new material 1269 /** Use this method to extend the VideoDriver with new material
1270 types. To extend the engine using this method do the following: 1270 types. To extend the engine using this method do the following:
1271 Derive a class from IMaterialRenderer and override the methods 1271 Derive a class from IMaterialRenderer and override the methods
1272 you need. For setting the right renderstates, you can try to 1272 you need. For setting the right renderstates, you can try to
1273 get a pointer to the real rendering device using 1273 get a pointer to the real rendering device using
1274 IVideoDriver::getExposedVideoData(). Add your class with 1274 IVideoDriver::getExposedVideoData(). Add your class with
1275 IVideoDriver::addMaterialRenderer(). To use an object being 1275 IVideoDriver::addMaterialRenderer(). To use an object being
1276 displayed with your new material, set the MaterialType member of 1276 displayed with your new material, set the MaterialType member of
1277 the SMaterial struct to the value returned by this method. 1277 the SMaterial struct to the value returned by this method.
1278 If you simply want to create a new material using vertex and/or 1278 If you simply want to create a new material using vertex and/or
1279 pixel shaders it would be easier to use the 1279 pixel shaders it would be easier to use the
1280 video::IGPUProgrammingServices interface which you can get 1280 video::IGPUProgrammingServices interface which you can get
1281 using the getGPUProgrammingServices() method. 1281 using the getGPUProgrammingServices() method.
1282 \param renderer A pointer to the new renderer. 1282 \param renderer A pointer to the new renderer.
1283 \param name Optional name for the material renderer entry. 1283 \param name Optional name for the material renderer entry.
1284 \return The number of the material type which can be set in 1284 \return The number of the material type which can be set in
1285 SMaterial::MaterialType to use the renderer. -1 is returned if 1285 SMaterial::MaterialType to use the renderer. -1 is returned if
1286 an error occured. For example if you tried to add an material 1286 an error occured. For example if you tried to add an material
1287 renderer to the software renderer or the null device, which do 1287 renderer to the software renderer or the null device, which do
1288 not accept material renderers. */ 1288 not accept material renderers. */
1289 virtual s32 addMaterialRenderer(IMaterialRenderer* renderer, const c8* name =0) =0; 1289 virtual s32 addMaterialRenderer(IMaterialRenderer* renderer, const c8* name =0) =0;
1290 1290
1291 //! Get access to a material renderer by index. 1291 //! Get access to a material renderer by index.
1292 /** \param idx Id of the material renderer. Can be a value of 1292 /** \param idx Id of the material renderer. Can be a value of
1293 the E_MATERIAL_TYPE enum or a value which was returned by 1293 the E_MATERIAL_TYPE enum or a value which was returned by
1294 addMaterialRenderer(). 1294 addMaterialRenderer().
1295 \return Pointer to material renderer or null if not existing. */ 1295 \return Pointer to material renderer or null if not existing. */
1296 virtual IMaterialRenderer* getMaterialRenderer(u32 idx) =0; 1296 virtual IMaterialRenderer* getMaterialRenderer(u32 idx) =0;
1297 1297
1298 //! Get amount of currently available material renderers. 1298 //! Get amount of currently available material renderers.
1299 /** \return Amount of currently available material renderers. */ 1299 /** \return Amount of currently available material renderers. */
1300 virtual u32 getMaterialRendererCount() const =0; 1300 virtual u32 getMaterialRendererCount() const =0;
1301 1301
1302 //! Get name of a material renderer 1302 //! Get name of a material renderer
1303 /** This string can, e.g., be used to test if a specific 1303 /** This string can, e.g., be used to test if a specific
1304 renderer already has been registered/created, or use this 1304 renderer already has been registered/created, or use this
1305 string to store data about materials: This returned name will 1305 string to store data about materials: This returned name will
1306 be also used when serializing materials. 1306 be also used when serializing materials.
1307 \param idx Id of the material renderer. Can be a value of the 1307 \param idx Id of the material renderer. Can be a value of the
1308 E_MATERIAL_TYPE enum or a value which was returned by 1308 E_MATERIAL_TYPE enum or a value which was returned by
1309 addMaterialRenderer(). 1309 addMaterialRenderer().
1310 \return String with the name of the renderer, or 0 if not 1310 \return String with the name of the renderer, or 0 if not
1311 exisiting */ 1311 exisiting */
1312 virtual const c8* getMaterialRendererName(u32 idx) const =0; 1312 virtual const c8* getMaterialRendererName(u32 idx) const =0;
1313 1313
1314 //! Sets the name of a material renderer. 1314 //! Sets the name of a material renderer.
1315 /** Will have no effect on built-in material renderers. 1315 /** Will have no effect on built-in material renderers.
1316 \param idx: Id of the material renderer. Can be a value of the 1316 \param idx: Id of the material renderer. Can be a value of the
1317 E_MATERIAL_TYPE enum or a value which was returned by 1317 E_MATERIAL_TYPE enum or a value which was returned by
1318 addMaterialRenderer(). 1318 addMaterialRenderer().
1319 \param name: New name of the material renderer. */ 1319 \param name: New name of the material renderer. */
1320 virtual void setMaterialRendererName(s32 idx, const c8* name) =0; 1320 virtual void setMaterialRendererName(s32 idx, const c8* name) =0;
1321 1321
1322 //! Creates material attributes list from a material 1322 //! Creates material attributes list from a material
1323 /** This method is useful for serialization and more. 1323 /** This method is useful for serialization and more.
1324 Please note that the video driver will use the material 1324 Please note that the video driver will use the material
1325 renderer names from getMaterialRendererName() to write out the 1325 renderer names from getMaterialRendererName() to write out the
1326 material type name, so they should be set before. 1326 material type name, so they should be set before.
1327 \param material The material to serialize. 1327 \param material The material to serialize.
1328 \param options Additional options which might influence the 1328 \param options Additional options which might influence the
1329 serialization. 1329 serialization.
1330 \return The io::IAttributes container holding the material 1330 \return The io::IAttributes container holding the material
1331 properties. */ 1331 properties. */
1332 virtual io::IAttributes* createAttributesFromMaterial(const video::SMaterial& material, 1332 virtual io::IAttributes* createAttributesFromMaterial(const video::SMaterial& material,
1333 io::SAttributeReadWriteOptions* options=0) =0; 1333 io::SAttributeReadWriteOptions* options=0) =0;
1334 1334
1335 //! Fills an SMaterial structure from attributes. 1335 //! Fills an SMaterial structure from attributes.
1336 /** Please note that for setting material types of the 1336 /** Please note that for setting material types of the
1337 material, the video driver will need to query the material 1337 material, the video driver will need to query the material
1338 renderers for their names, so all non built-in materials must 1338 renderers for their names, so all non built-in materials must
1339 have been created before calling this method. 1339 have been created before calling this method.
1340 \param outMaterial The material to set the properties for. 1340 \param outMaterial The material to set the properties for.
1341 \param attributes The attributes to read from. */ 1341 \param attributes The attributes to read from. */
1342 virtual void fillMaterialStructureFromAttributes(video::SMaterial& outMaterial, io::IAttributes* attributes) =0; 1342 virtual void fillMaterialStructureFromAttributes(video::SMaterial& outMaterial, io::IAttributes* attributes) =0;
1343 1343
1344 //! Returns driver and operating system specific data about the IVideoDriver. 1344 //! Returns driver and operating system specific data about the IVideoDriver.
1345 /** This method should only be used if the engine should be 1345 /** This method should only be used if the engine should be
1346 extended without having to modify the source of the engine. 1346 extended without having to modify the source of the engine.
1347 \return Collection of device dependent pointers. */ 1347 \return Collection of device dependent pointers. */
1348 virtual const SExposedVideoData& getExposedVideoData() =0; 1348 virtual const SExposedVideoData& getExposedVideoData() =0;
1349 1349
1350 //! Get type of video driver 1350 //! Get type of video driver
1351 /** \return Type of driver. */ 1351 /** \return Type of driver. */
1352 virtual E_DRIVER_TYPE getDriverType() const =0; 1352 virtual E_DRIVER_TYPE getDriverType() const =0;
1353 1353
1354 //! Gets the IGPUProgrammingServices interface. 1354 //! Gets the IGPUProgrammingServices interface.
1355 /** \return Pointer to the IGPUProgrammingServices. Returns 0 1355 /** \return Pointer to the IGPUProgrammingServices. Returns 0
1356 if the video driver does not support this. For example the 1356 if the video driver does not support this. For example the
1357 Software driver and the Null driver will always return 0. */ 1357 Software driver and the Null driver will always return 0. */
1358 virtual IGPUProgrammingServices* getGPUProgrammingServices() =0; 1358 virtual IGPUProgrammingServices* getGPUProgrammingServices() =0;
1359 1359
1360 //! Returns a pointer to the mesh manipulator. 1360 //! Returns a pointer to the mesh manipulator.
1361 virtual scene::IMeshManipulator* getMeshManipulator() =0; 1361 virtual scene::IMeshManipulator* getMeshManipulator() =0;
1362 1362
1363 //! Clears the ZBuffer. 1363 //! Clears the ZBuffer.
1364 /** Note that you usually need not to call this method, as it 1364 /** Note that you usually need not to call this method, as it
1365 is automatically done in IVideoDriver::beginScene() or 1365 is automatically done in IVideoDriver::beginScene() or
1366 IVideoDriver::setRenderTarget() if you enable zBuffer. But if 1366 IVideoDriver::setRenderTarget() if you enable zBuffer. But if
1367 you have to render some special things, you can clear the 1367 you have to render some special things, you can clear the
1368 zbuffer during the rendering process with this method any time. 1368 zbuffer during the rendering process with this method any time.
1369 */ 1369 */
1370 virtual void clearZBuffer() =0; 1370 virtual void clearZBuffer() =0;
1371 1371
1372 //! Make a screenshot of the last rendered frame. 1372 //! Make a screenshot of the last rendered frame.
1373 /** \return An image created from the last rendered frame. */ 1373 /** \return An image created from the last rendered frame. */
1374 virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) =0; 1374 virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) =0;
1375 1375
1376 //! Check if the image is already loaded. 1376 //! Check if the image is already loaded.
1377 /** Works similar to getTexture(), but does not load the texture 1377 /** Works similar to getTexture(), but does not load the texture
1378 if it is not currently loaded. 1378 if it is not currently loaded.
1379 \param filename Name of the texture. 1379 \param filename Name of the texture.
1380 \return Pointer to loaded texture, or 0 if not found. */ 1380 \return Pointer to loaded texture, or 0 if not found. */
1381 virtual video::ITexture* findTexture(const io::path& filename) = 0; 1381 virtual video::ITexture* findTexture(const io::path& filename) = 0;
1382 1382
1383 //! Set or unset a clipping plane. 1383 //! Set or unset a clipping plane.
1384 /** There are at least 6 clipping planes available for the user 1384 /** There are at least 6 clipping planes available for the user
1385 to set at will. 1385 to set at will.
1386 \param index The plane index. Must be between 0 and 1386 \param index The plane index. Must be between 0 and
1387 MaxUserClipPlanes. 1387 MaxUserClipPlanes.
1388 \param plane The plane itself. 1388 \param plane The plane itself.
1389 \param enable If true, enable the clipping plane else disable 1389 \param enable If true, enable the clipping plane else disable
1390 it. 1390 it.
1391 \return True if the clipping plane is usable. */ 1391 \return True if the clipping plane is usable. */
1392 virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) =0; 1392 virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) =0;
1393 1393
1394 //! Enable or disable a clipping plane. 1394 //! Enable or disable a clipping plane.
1395 /** There are at least 6 clipping planes available for the user 1395 /** There are at least 6 clipping planes available for the user
1396 to set at will. 1396 to set at will.
1397 \param index The plane index. Must be between 0 and 1397 \param index The plane index. Must be between 0 and
1398 MaxUserClipPlanes. 1398 MaxUserClipPlanes.
1399 \param enable If true, enable the clipping plane else disable 1399 \param enable If true, enable the clipping plane else disable
1400 it. */ 1400 it. */
1401 virtual void enableClipPlane(u32 index, bool enable) =0; 1401 virtual void enableClipPlane(u32 index, bool enable) =0;
1402 1402
1403 //! Set the minimum number of vertices for which a hw buffer will be created 1403 //! Set the minimum number of vertices for which a hw buffer will be created
1404 /** \param count Number of vertices to set as minimum. */ 1404 /** \param count Number of vertices to set as minimum. */
1405 virtual void setMinHardwareBufferVertexCount(u32 count) =0; 1405 virtual void setMinHardwareBufferVertexCount(u32 count) =0;
1406 1406
1407 //! Get the global Material, which might override local materials. 1407 //! Get the global Material, which might override local materials.
1408 /** Depending on the enable flags, values from this Material 1408 /** Depending on the enable flags, values from this Material
1409 are used to override those of local materials of some 1409 are used to override those of local materials of some
1410 meshbuffer being rendered. 1410 meshbuffer being rendered.
1411 \return Reference to the Override Material. */ 1411 \return Reference to the Override Material. */
1412 virtual SOverrideMaterial& getOverrideMaterial() =0; 1412 virtual SOverrideMaterial& getOverrideMaterial() =0;
1413 1413
1414 //! Get the 2d override material for altering its values 1414 //! Get the 2d override material for altering its values
1415 /** The 2d override materual allows to alter certain render 1415 /** The 2d override materual allows to alter certain render
1416 states of the 2d methods. Not all members of SMaterial are 1416 states of the 2d methods. Not all members of SMaterial are
1417 honored, especially not MaterialType and Textures. Moreover, 1417 honored, especially not MaterialType and Textures. Moreover,
1418 the zbuffer is always ignored, and lighting is always off. All 1418 the zbuffer is always ignored, and lighting is always off. All
1419 other flags can be changed, though some might have to effect 1419 other flags can be changed, though some might have to effect
1420 in most cases. 1420 in most cases.
1421 Please note that you have to enable/disable this effect with 1421 Please note that you have to enable/disable this effect with
1422 enableInitMaterial2D(). This effect is costly, as it increases 1422 enableInitMaterial2D(). This effect is costly, as it increases
1423 the number of state changes considerably. Always reset the 1423 the number of state changes considerably. Always reset the
1424 values when done. 1424 values when done.
1425 \return Material reference which should be altered to reflect 1425 \return Material reference which should be altered to reflect
1426 the new settings. 1426 the new settings.
1427 */ 1427 */
1428 virtual SMaterial& getMaterial2D() =0; 1428 virtual SMaterial& getMaterial2D() =0;
1429 1429
1430 //! Enable the 2d override material 1430 //! Enable the 2d override material
1431 /** \param enable Flag which tells whether the material shall be 1431 /** \param enable Flag which tells whether the material shall be
1432 enabled or disabled. */ 1432 enabled or disabled. */
1433 virtual void enableMaterial2D(bool enable=true) =0; 1433 virtual void enableMaterial2D(bool enable=true) =0;
1434 1434
1435 //! Get the graphics card vendor name. 1435 //! Get the graphics card vendor name.
1436 virtual core::stringc getVendorInfo() =0; 1436 virtual core::stringc getVendorInfo() =0;
1437 1437
1438 //! Only used by the engine internally. 1438 //! Only used by the engine internally.
1439 /** The ambient color is set in the scene manager, see 1439 /** The ambient color is set in the scene manager, see
1440 scene::ISceneManager::setAmbientLight(). 1440 scene::ISceneManager::setAmbientLight().
1441 \param color New color of the ambient light. */ 1441 \param color New color of the ambient light. */
1442 virtual void setAmbientLight(const SColorf& color) =0; 1442 virtual void setAmbientLight(const SColorf& color) =0;
1443 1443
1444 //! Only used by the engine internally. 1444 //! Only used by the engine internally.
1445 /** Passes the global material flag AllowZWriteOnTransparent. 1445 /** Passes the global material flag AllowZWriteOnTransparent.
1446 Use the SceneManager attribute to set this value from your app. 1446 Use the SceneManager attribute to set this value from your app.
1447 \param flag Default behavior is to disable ZWrite, i.e. false. */ 1447 \param flag Default behavior is to disable ZWrite, i.e. false. */
1448 virtual void setAllowZWriteOnTransparent(bool flag) =0; 1448 virtual void setAllowZWriteOnTransparent(bool flag) =0;
1449 1449
1450 //! Get the maximum texture size supported. 1450 //! Get the maximum texture size supported.
1451 virtual core::dimension2du getMaxTextureSize() const =0; 1451 virtual core::dimension2du getMaxTextureSize() const =0;
1452 1452
1453 //! Color conversion convenience function 1453 //! Color conversion convenience function
1454 /** Convert an image (as array of pixels) from source to destination 1454 /** Convert an image (as array of pixels) from source to destination
1455 array, thereby converting the color format. The pixel size is 1455 array, thereby converting the color format. The pixel size is
1456 determined by the color formats. 1456 determined by the color formats.
1457 \param sP Pointer to source 1457 \param sP Pointer to source
1458 \param sF Color format of source 1458 \param sF Color format of source
1459 \param sN Number of pixels to convert, both array must be large enough 1459 \param sN Number of pixels to convert, both array must be large enough
1460 \param dP Pointer to destination 1460 \param dP Pointer to destination
1461 \param dF Color format of destination 1461 \param dF Color format of destination
1462 */ 1462 */
1463 virtual void convertColor(const void* sP, ECOLOR_FORMAT sF, s32 sN, 1463 virtual void convertColor(const void* sP, ECOLOR_FORMAT sF, s32 sN,
1464 void* dP, ECOLOR_FORMAT dF) const =0; 1464 void* dP, ECOLOR_FORMAT dF) const =0;
1465 }; 1465 };
1466 1466
1467} // end namespace video 1467} // end namespace video
1468} // end namespace irr 1468} // end namespace irr
1469 1469
1470 1470
1471#endif 1471#endif
diff --git a/libraries/irrlicht-1.8/include/IVideoModeList.h b/libraries/irrlicht-1.8/include/IVideoModeList.h
index 4fe2e69..aef0f5a 100644
--- a/libraries/irrlicht-1.8/include/IVideoModeList.h
+++ b/libraries/irrlicht-1.8/include/IVideoModeList.h
@@ -1,62 +1,62 @@
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#ifndef __IRR_I_VIDEO_MODE_LIST_H_INCLUDED__ 5#ifndef __IRR_I_VIDEO_MODE_LIST_H_INCLUDED__
6#define __IRR_I_VIDEO_MODE_LIST_H_INCLUDED__ 6#define __IRR_I_VIDEO_MODE_LIST_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "dimension2d.h" 9#include "dimension2d.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace video 13namespace video
14{ 14{
15 15
16 //! A list of all available video modes. 16 //! A list of all available video modes.
17 /** You can get a list via IrrlichtDevice::getVideoModeList(). If you are confused 17 /** You can get a list via IrrlichtDevice::getVideoModeList(). If you are confused
18 now, because you think you have to create an Irrlicht Device with a video 18 now, because you think you have to create an Irrlicht Device with a video
19 mode before being able to get the video mode list, let me tell you that 19 mode before being able to get the video mode list, let me tell you that
20 there is no need to start up an Irrlicht Device with EDT_DIRECT3D8, EDT_OPENGL or 20 there is no need to start up an Irrlicht Device with EDT_DIRECT3D8, EDT_OPENGL or
21 EDT_SOFTWARE: For this (and for lots of other reasons) the null device, 21 EDT_SOFTWARE: For this (and for lots of other reasons) the null device,
22 EDT_NULL exists.*/ 22 EDT_NULL exists.*/
23 class IVideoModeList : public virtual IReferenceCounted 23 class IVideoModeList : public virtual IReferenceCounted
24 { 24 {
25 public: 25 public:
26 26
27 //! Gets amount of video modes in the list. 27 //! Gets amount of video modes in the list.
28 /** \return Returns amount of video modes. */ 28 /** \return Returns amount of video modes. */
29 virtual s32 getVideoModeCount() const = 0; 29 virtual s32 getVideoModeCount() const = 0;
30 30
31 //! Get the screen size of a video mode in pixels. 31 //! Get the screen size of a video mode in pixels.
32 /** \param modeNumber: zero based index of the video mode. 32 /** \param modeNumber: zero based index of the video mode.
33 \return Size of screen in pixels of the specified video mode. */ 33 \return Size of screen in pixels of the specified video mode. */
34 virtual core::dimension2d<u32> getVideoModeResolution(s32 modeNumber) const = 0; 34 virtual core::dimension2d<u32> getVideoModeResolution(s32 modeNumber) const = 0;
35 35
36 //! Get a supported screen size with certain constraints. 36 //! Get a supported screen size with certain constraints.
37 /** \param minSize: Minimum dimensions required. 37 /** \param minSize: Minimum dimensions required.
38 \param maxSize: Maximum dimensions allowed. 38 \param maxSize: Maximum dimensions allowed.
39 \return Size of screen in pixels which matches the requirements. 39 \return Size of screen in pixels which matches the requirements.
40 as good as possible. */ 40 as good as possible. */
41 virtual core::dimension2d<u32> getVideoModeResolution(const core::dimension2d<u32>& minSize, const core::dimension2d<u32>& maxSize) const = 0; 41 virtual core::dimension2d<u32> getVideoModeResolution(const core::dimension2d<u32>& minSize, const core::dimension2d<u32>& maxSize) const = 0;
42 42
43 //! Get the pixel depth of a video mode in bits. 43 //! Get the pixel depth of a video mode in bits.
44 /** \param modeNumber: zero based index of the video mode. 44 /** \param modeNumber: zero based index of the video mode.
45 \return Size of each pixel of the specified video mode in bits. */ 45 \return Size of each pixel of the specified video mode in bits. */
46 virtual s32 getVideoModeDepth(s32 modeNumber) const = 0; 46 virtual s32 getVideoModeDepth(s32 modeNumber) const = 0;
47 47
48 //! Get current desktop screen resolution. 48 //! Get current desktop screen resolution.
49 /** \return Size of screen in pixels of the current desktop video mode. */ 49 /** \return Size of screen in pixels of the current desktop video mode. */
50 virtual const core::dimension2d<u32>& getDesktopResolution() const = 0; 50 virtual const core::dimension2d<u32>& getDesktopResolution() const = 0;
51 51
52 //! Get the pixel depth of a video mode in bits. 52 //! Get the pixel depth of a video mode in bits.
53 /** \return Size of each pixel of the current desktop video mode in bits. */ 53 /** \return Size of each pixel of the current desktop video mode in bits. */
54 virtual s32 getDesktopDepth() const = 0; 54 virtual s32 getDesktopDepth() const = 0;
55 }; 55 };
56 56
57} // end namespace video 57} // end namespace video
58} // end namespace irr 58} // end namespace irr
59 59
60 60
61#endif 61#endif
62 62
diff --git a/libraries/irrlicht-1.8/include/IVolumeLightSceneNode.h b/libraries/irrlicht-1.8/include/IVolumeLightSceneNode.h
index 6386112..8ae2d17 100644
--- a/libraries/irrlicht-1.8/include/IVolumeLightSceneNode.h
+++ b/libraries/irrlicht-1.8/include/IVolumeLightSceneNode.h
@@ -1,60 +1,60 @@
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// created by Dean Wadsworth aka Varmint Dec 31 2007 5// created by Dean Wadsworth aka Varmint Dec 31 2007
6 6
7#ifndef __I_VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__ 7#ifndef __I_VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__
8#define __I_VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__ 8#define __I_VOLUME_LIGHT_SCENE_NODE_H_INCLUDED__
9 9
10#include "ISceneNode.h" 10#include "ISceneNode.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace scene 14namespace scene
15{ 15{
16 class IMeshBuffer; 16 class IMeshBuffer;
17 17
18 class IVolumeLightSceneNode : public ISceneNode 18 class IVolumeLightSceneNode : public ISceneNode
19 { 19 {
20 public: 20 public:
21 21
22 //! constructor 22 //! constructor
23 IVolumeLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 23 IVolumeLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
24 const core::vector3df& position, 24 const core::vector3df& position,
25 const core::vector3df& rotation, 25 const core::vector3df& rotation,
26 const core::vector3df& scale) 26 const core::vector3df& scale)
27 : ISceneNode(parent, mgr, id, position, rotation, scale) {}; 27 : ISceneNode(parent, mgr, id, position, rotation, scale) {};
28 28
29 //! Returns type of the scene node 29 //! Returns type of the scene node
30 virtual ESCENE_NODE_TYPE getType() const { return ESNT_VOLUME_LIGHT; } 30 virtual ESCENE_NODE_TYPE getType() const { return ESNT_VOLUME_LIGHT; }
31 31
32 //! Sets the number of segments across the U axis 32 //! Sets the number of segments across the U axis
33 virtual void setSubDivideU(const u32 inU) =0; 33 virtual void setSubDivideU(const u32 inU) =0;
34 34
35 //! Sets the number of segments across the V axis 35 //! Sets the number of segments across the V axis
36 virtual void setSubDivideV(const u32 inV) =0; 36 virtual void setSubDivideV(const u32 inV) =0;
37 37
38 //! Returns the number of segments across the U axis 38 //! Returns the number of segments across the U axis
39 virtual u32 getSubDivideU() const =0; 39 virtual u32 getSubDivideU() const =0;
40 40
41 //! Returns the number of segments across the V axis 41 //! Returns the number of segments across the V axis
42 virtual u32 getSubDivideV() const =0; 42 virtual u32 getSubDivideV() const =0;
43 43
44 //! Sets the color of the base of the light 44 //! Sets the color of the base of the light
45 virtual void setFootColor(const video::SColor inColor) =0; 45 virtual void setFootColor(const video::SColor inColor) =0;
46 46
47 //! Sets the color of the tip of the light 47 //! Sets the color of the tip of the light
48 virtual void setTailColor(const video::SColor inColor) =0; 48 virtual void setTailColor(const video::SColor inColor) =0;
49 49
50 //! Returns the color of the base of the light 50 //! Returns the color of the base of the light
51 virtual video::SColor getFootColor() const =0; 51 virtual video::SColor getFootColor() const =0;
52 52
53 //! Returns the color of the tip of the light 53 //! Returns the color of the tip of the light
54 virtual video::SColor getTailColor() const =0; 54 virtual video::SColor getTailColor() const =0;
55 }; 55 };
56 56
57} // end namespace scene 57} // end namespace scene
58} // end namespace irr 58} // end namespace irr
59 59
60#endif 60#endif
diff --git a/libraries/irrlicht-1.8/include/IWriteFile.h b/libraries/irrlicht-1.8/include/IWriteFile.h
index 5944318..7bc9f20 100644
--- a/libraries/irrlicht-1.8/include/IWriteFile.h
+++ b/libraries/irrlicht-1.8/include/IWriteFile.h
@@ -1,50 +1,50 @@
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#ifndef __I_WRITE_FILE_H_INCLUDED__ 5#ifndef __I_WRITE_FILE_H_INCLUDED__
6#define __I_WRITE_FILE_H_INCLUDED__ 6#define __I_WRITE_FILE_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "path.h" 9#include "path.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace io 13namespace io
14{ 14{
15 15
16 //! Interface providing write access to a file. 16 //! Interface providing write access to a file.
17 class IWriteFile : public virtual IReferenceCounted 17 class IWriteFile : public virtual IReferenceCounted
18 { 18 {
19 public: 19 public:
20 //! Writes an amount of bytes to the file. 20 //! Writes an amount of bytes to the file.
21 /** \param buffer Pointer to buffer of bytes to write. 21 /** \param buffer Pointer to buffer of bytes to write.
22 \param sizeToWrite Amount of bytes to write to the file. 22 \param sizeToWrite Amount of bytes to write to the file.
23 \return How much bytes were written. */ 23 \return How much bytes were written. */
24 virtual s32 write(const void* buffer, u32 sizeToWrite) = 0; 24 virtual s32 write(const void* buffer, u32 sizeToWrite) = 0;
25 25
26 //! Changes position in file 26 //! Changes position in file
27 /** \param finalPos Destination position in the file. 27 /** \param finalPos Destination position in the file.
28 \param relativeMovement If set to true, the position in the file is 28 \param relativeMovement If set to true, the position in the file is
29 changed relative to current position. Otherwise the position is changed 29 changed relative to current position. Otherwise the position is changed
30 from begin of file. 30 from begin of file.
31 \return True if successful, otherwise false. */ 31 \return True if successful, otherwise false. */
32 virtual bool seek(long finalPos, bool relativeMovement = false) = 0; 32 virtual bool seek(long finalPos, bool relativeMovement = false) = 0;
33 33
34 //! Get the current position in the file. 34 //! Get the current position in the file.
35 /** \return Current position in the file in bytes. */ 35 /** \return Current position in the file in bytes. */
36 virtual long getPos() const = 0; 36 virtual long getPos() const = 0;
37 37
38 //! Get name of file. 38 //! Get name of file.
39 /** \return File name as zero terminated character string. */ 39 /** \return File name as zero terminated character string. */
40 virtual const path& getFileName() const = 0; 40 virtual const path& getFileName() const = 0;
41 }; 41 };
42 42
43 //! Internal function, please do not use. 43 //! Internal function, please do not use.
44 IWriteFile* createWriteFile(const io::path& fileName, bool append); 44 IWriteFile* createWriteFile(const io::path& fileName, bool append);
45 45
46} // end namespace io 46} // end namespace io
47} // end namespace irr 47} // end namespace irr
48 48
49#endif 49#endif
50 50
diff --git a/libraries/irrlicht-1.8/include/IXMLReader.h b/libraries/irrlicht-1.8/include/IXMLReader.h
index 3f34cb8..ec47c00 100644
--- a/libraries/irrlicht-1.8/include/IXMLReader.h
+++ b/libraries/irrlicht-1.8/include/IXMLReader.h
@@ -1,31 +1,31 @@
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#ifndef __I_XML_READER_H_INCLUDED__ 5#ifndef __I_XML_READER_H_INCLUDED__
6#define __I_XML_READER_H_INCLUDED__ 6#define __I_XML_READER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "irrXML.h" 9#include "irrXML.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace io 13namespace io
14{ 14{
15 //! An xml reader for wide characters, derived from IReferenceCounted. 15 //! An xml reader for wide characters, derived from IReferenceCounted.
16 /** This XML Parser can read any type of text files from any source 16 /** This XML Parser can read any type of text files from any source
17 Irrlicht can read. Just call IFileSystem::createXMLReader(). For more 17 Irrlicht can read. Just call IFileSystem::createXMLReader(). For more
18 informations on how to use the parser, see IIrrXMLReader */ 18 informations on how to use the parser, see IIrrXMLReader */
19 typedef IIrrXMLReader<wchar_t, IReferenceCounted> IXMLReader; 19 typedef IIrrXMLReader<wchar_t, IReferenceCounted> IXMLReader;
20 20
21 //! An xml reader for ASCII or UTF-8 characters, derived from IReferenceCounted. 21 //! An xml reader for ASCII or UTF-8 characters, derived from IReferenceCounted.
22 /** This XML Parser can read any type of text files from any source 22 /** This XML Parser can read any type of text files from any source
23 Irrlicht can read. Just call IFileSystem::createXMLReaderUTF8(). For 23 Irrlicht can read. Just call IFileSystem::createXMLReaderUTF8(). For
24 more informations on how to use the parser, see IIrrXMLReader */ 24 more informations on how to use the parser, see IIrrXMLReader */
25 typedef IIrrXMLReader<c8, IReferenceCounted> IXMLReaderUTF8; 25 typedef IIrrXMLReader<c8, IReferenceCounted> IXMLReaderUTF8;
26 26
27} // end namespace io 27} // end namespace io
28} // end namespace irr 28} // end namespace irr
29 29
30#endif 30#endif
31 31
diff --git a/libraries/irrlicht-1.8/include/IXMLWriter.h b/libraries/irrlicht-1.8/include/IXMLWriter.h
index bb6901e..8b43bc9 100644
--- a/libraries/irrlicht-1.8/include/IXMLWriter.h
+++ b/libraries/irrlicht-1.8/include/IXMLWriter.h
@@ -1,77 +1,77 @@
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#ifndef __I_XML_WRITER_H_INCLUDED__ 5#ifndef __I_XML_WRITER_H_INCLUDED__
6#define __I_XML_WRITER_H_INCLUDED__ 6#define __I_XML_WRITER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "irrArray.h" 9#include "irrArray.h"
10#include "irrString.h" 10#include "irrString.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace io 14namespace io
15{ 15{
16 16
17 //! Interface providing methods for making it easier to write XML files. 17 //! Interface providing methods for making it easier to write XML files.
18 /** This XML Writer writes xml files using in the platform dependent 18 /** This XML Writer writes xml files using in the platform dependent
19 wchar_t format and sets the xml-encoding correspondingly. */ 19 wchar_t format and sets the xml-encoding correspondingly. */
20 class IXMLWriter : public virtual IReferenceCounted 20 class IXMLWriter : public virtual IReferenceCounted
21 { 21 {
22 public: 22 public:
23 //! Writes an xml 1.0 header. 23 //! Writes an xml 1.0 header.
24 /** Looks like &lt;?xml version="1.0"?&gt;. This should always 24 /** Looks like &lt;?xml version="1.0"?&gt;. This should always
25 be called before writing anything other, because also the text 25 be called before writing anything other, because also the text
26 file header for unicode texts is written out with this method. */ 26 file header for unicode texts is written out with this method. */
27 virtual void writeXMLHeader() = 0; 27 virtual void writeXMLHeader() = 0;
28 28
29 //! Writes an xml element with maximal 5 attributes like "<foo />" or 29 //! Writes an xml element with maximal 5 attributes like "<foo />" or
30 //! &lt;foo optAttr="value" /&gt;. 30 //! &lt;foo optAttr="value" /&gt;.
31 /** The element can be empty or not. 31 /** The element can be empty or not.
32 \param name: Name of the element 32 \param name: Name of the element
33 \param empty: Specifies if the element should be empty. Like 33 \param empty: Specifies if the element should be empty. Like
34 "<foo />". If You set this to false, something like this is 34 "<foo />". If You set this to false, something like this is
35 written instead: "<foo>". 35 written instead: "<foo>".
36 \param attr1Name: 1st attributes name 36 \param attr1Name: 1st attributes name
37 \param attr1Value: 1st attributes value 37 \param attr1Value: 1st attributes value
38 \param attr2Name: 2nd attributes name 38 \param attr2Name: 2nd attributes name
39 \param attr2Value: 2nd attributes value 39 \param attr2Value: 2nd attributes value
40 \param attr3Name: 3rd attributes name 40 \param attr3Name: 3rd attributes name
41 \param attr3Value: 3rd attributes value 41 \param attr3Value: 3rd attributes value
42 \param attr4Name: 4th attributes name 42 \param attr4Name: 4th attributes name
43 \param attr4Value: 4th attributes value 43 \param attr4Value: 4th attributes value
44 \param attr5Name: 5th attributes name 44 \param attr5Name: 5th attributes name
45 \param attr5Value: 5th attributes value */ 45 \param attr5Value: 5th attributes value */
46 virtual void writeElement(const wchar_t* name, bool empty=false, 46 virtual void writeElement(const wchar_t* name, bool empty=false,
47 const wchar_t* attr1Name = 0, const wchar_t* attr1Value = 0, 47 const wchar_t* attr1Name = 0, const wchar_t* attr1Value = 0,
48 const wchar_t* attr2Name = 0, const wchar_t* attr2Value = 0, 48 const wchar_t* attr2Name = 0, const wchar_t* attr2Value = 0,
49 const wchar_t* attr3Name = 0, const wchar_t* attr3Value = 0, 49 const wchar_t* attr3Name = 0, const wchar_t* attr3Value = 0,
50 const wchar_t* attr4Name = 0, const wchar_t* attr4Value = 0, 50 const wchar_t* attr4Name = 0, const wchar_t* attr4Value = 0,
51 const wchar_t* attr5Name = 0, const wchar_t* attr5Value = 0) = 0; 51 const wchar_t* attr5Name = 0, const wchar_t* attr5Value = 0) = 0;
52 52
53 //! Writes an xml element with any number of attributes 53 //! Writes an xml element with any number of attributes
54 virtual void writeElement(const wchar_t* name, bool empty, 54 virtual void writeElement(const wchar_t* name, bool empty,
55 core::array<core::stringw> &names, core::array<core::stringw> &values) = 0; 55 core::array<core::stringw> &names, core::array<core::stringw> &values) = 0;
56 56
57 //! Writes a comment into the xml file 57 //! Writes a comment into the xml file
58 virtual void writeComment(const wchar_t* comment) = 0; 58 virtual void writeComment(const wchar_t* comment) = 0;
59 59
60 //! Writes the closing tag for an element. Like "</foo>" 60 //! Writes the closing tag for an element. Like "</foo>"
61 virtual void writeClosingTag(const wchar_t* name) = 0; 61 virtual void writeClosingTag(const wchar_t* name) = 0;
62 62
63 //! Writes a text into the file. 63 //! Writes a text into the file.
64 /** All occurrences of special characters such as 64 /** All occurrences of special characters such as
65 & (&amp;), < (&lt;), > (&gt;), and " (&quot;) are automaticly 65 & (&amp;), < (&lt;), > (&gt;), and " (&quot;) are automaticly
66 replaced. */ 66 replaced. */
67 virtual void writeText(const wchar_t* text) = 0; 67 virtual void writeText(const wchar_t* text) = 0;
68 68
69 //! Writes a line break 69 //! Writes a line break
70 virtual void writeLineBreak() = 0; 70 virtual void writeLineBreak() = 0;
71 }; 71 };
72 72
73} // end namespace io 73} // end namespace io
74} // end namespace irr 74} // end namespace irr
75 75
76#endif 76#endif
77 77
diff --git a/libraries/irrlicht-1.8/include/IrrCompileConfig.h b/libraries/irrlicht-1.8/include/IrrCompileConfig.h
index 9aee833..f50d985 100644
--- a/libraries/irrlicht-1.8/include/IrrCompileConfig.h
+++ b/libraries/irrlicht-1.8/include/IrrCompileConfig.h
@@ -1,796 +1,796 @@
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#ifndef __IRR_COMPILE_CONFIG_H_INCLUDED__ 5#ifndef __IRR_COMPILE_CONFIG_H_INCLUDED__
6#define __IRR_COMPILE_CONFIG_H_INCLUDED__ 6#define __IRR_COMPILE_CONFIG_H_INCLUDED__
7 7
8//! Irrlicht SDK Version 8//! Irrlicht SDK Version
9#define IRRLICHT_VERSION_MAJOR 1 9#define IRRLICHT_VERSION_MAJOR 1
10#define IRRLICHT_VERSION_MINOR 8 10#define IRRLICHT_VERSION_MINOR 8
11#define IRRLICHT_VERSION_REVISION 0 11#define IRRLICHT_VERSION_REVISION 0
12// This flag will be defined only in SVN, the official release code will have 12// This flag will be defined only in SVN, the official release code will have
13// it undefined 13// it undefined
14//#define IRRLICHT_VERSION_SVN -alpha 14//#define IRRLICHT_VERSION_SVN -alpha
15#define IRRLICHT_SDK_VERSION "1.8.0" 15#define IRRLICHT_SDK_VERSION "1.8.0"
16 16
17#include <stdio.h> // TODO: Although included elsewhere this is required at least for mingw 17#include <stdio.h> // TODO: Although included elsewhere this is required at least for mingw
18 18
19//! The defines for different operating system are: 19//! The defines for different operating system are:
20//! _IRR_XBOX_PLATFORM_ for XBox 20//! _IRR_XBOX_PLATFORM_ for XBox
21//! _IRR_WINDOWS_ for all irrlicht supported Windows versions 21//! _IRR_WINDOWS_ for all irrlicht supported Windows versions
22//! _IRR_WINDOWS_CE_PLATFORM_ for Windows CE 22//! _IRR_WINDOWS_CE_PLATFORM_ for Windows CE
23//! _IRR_WINDOWS_API_ for Windows or XBox 23//! _IRR_WINDOWS_API_ for Windows or XBox
24//! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined) 24//! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined)
25//! _IRR_SOLARIS_PLATFORM_ for Solaris 25//! _IRR_SOLARIS_PLATFORM_ for Solaris
26//! _IRR_OSX_PLATFORM_ for Apple systems running OSX 26//! _IRR_OSX_PLATFORM_ for Apple systems running OSX
27//! _IRR_POSIX_API_ for Posix compatible systems 27//! _IRR_POSIX_API_ for Posix compatible systems
28//! Note: PLATFORM defines the OS specific layer, API can group several platforms 28//! Note: PLATFORM defines the OS specific layer, API can group several platforms
29 29
30//! DEVICE is the windowing system used, several PLATFORMs support more than one DEVICE 30//! DEVICE is the windowing system used, several PLATFORMs support more than one DEVICE
31//! Irrlicht can be compiled with more than one device 31//! Irrlicht can be compiled with more than one device
32//! _IRR_COMPILE_WITH_WINDOWS_DEVICE_ for Windows API based device 32//! _IRR_COMPILE_WITH_WINDOWS_DEVICE_ for Windows API based device
33//! _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ for Windows CE API based device 33//! _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ for Windows CE API based device
34//! _IRR_COMPILE_WITH_OSX_DEVICE_ for Cocoa native windowing on OSX 34//! _IRR_COMPILE_WITH_OSX_DEVICE_ for Cocoa native windowing on OSX
35//! _IRR_COMPILE_WITH_X11_DEVICE_ for Linux X11 based device 35//! _IRR_COMPILE_WITH_X11_DEVICE_ for Linux X11 based device
36//! _IRR_COMPILE_WITH_SDL_DEVICE_ for platform independent SDL framework 36//! _IRR_COMPILE_WITH_SDL_DEVICE_ for platform independent SDL framework
37//! _IRR_COMPILE_WITH_CONSOLE_DEVICE_ for no windowing system, used as a fallback 37//! _IRR_COMPILE_WITH_CONSOLE_DEVICE_ for no windowing system, used as a fallback
38//! _IRR_COMPILE_WITH_FB_DEVICE_ for framebuffer systems 38//! _IRR_COMPILE_WITH_FB_DEVICE_ for framebuffer systems
39 39
40//! Passing defines to the compiler which have NO in front of the _IRR definename is an alternative 40//! Passing defines to the compiler which have NO in front of the _IRR definename is an alternative
41//! way which can be used to disable defines (instead of outcommenting them in this header). 41//! way which can be used to disable defines (instead of outcommenting them in this header).
42//! So defines can be controlled from Makefiles or Projectfiles which allows building 42//! So defines can be controlled from Makefiles or Projectfiles which allows building
43//! different library versions without having to change the sources. 43//! different library versions without having to change the sources.
44//! Example: NO_IRR_COMPILE_WITH_X11_ would disable X11 44//! Example: NO_IRR_COMPILE_WITH_X11_ would disable X11
45 45
46 46
47//! Uncomment this line to compile with the SDL device 47//! Uncomment this line to compile with the SDL device
48//#define _IRR_COMPILE_WITH_SDL_DEVICE_ 48//#define _IRR_COMPILE_WITH_SDL_DEVICE_
49#ifdef NO_IRR_COMPILE_WITH_SDL_DEVICE_ 49#ifdef NO_IRR_COMPILE_WITH_SDL_DEVICE_
50#undef _IRR_COMPILE_WITH_SDL_DEVICE_ 50#undef _IRR_COMPILE_WITH_SDL_DEVICE_
51#endif 51#endif
52 52
53//! Comment this line to compile without the fallback console device. 53//! Comment this line to compile without the fallback console device.
54#define _IRR_COMPILE_WITH_CONSOLE_DEVICE_ 54#define _IRR_COMPILE_WITH_CONSOLE_DEVICE_
55#ifdef NO_IRR_COMPILE_WITH_CONSOLE_DEVICE_ 55#ifdef NO_IRR_COMPILE_WITH_CONSOLE_DEVICE_
56#undef _IRR_COMPILE_WITH_CONSOLE_DEVICE_ 56#undef _IRR_COMPILE_WITH_CONSOLE_DEVICE_
57#endif 57#endif
58 58
59//! WIN32 for Windows32 59//! WIN32 for Windows32
60//! WIN64 for Windows64 60//! WIN64 for Windows64
61// The windows platform and API support SDL and WINDOW device 61// The windows platform and API support SDL and WINDOW device
62#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64) 62#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64)
63#define _IRR_WINDOWS_ 63#define _IRR_WINDOWS_
64#define _IRR_WINDOWS_API_ 64#define _IRR_WINDOWS_API_
65#define _IRR_COMPILE_WITH_WINDOWS_DEVICE_ 65#define _IRR_COMPILE_WITH_WINDOWS_DEVICE_
66#endif 66#endif
67 67
68//! WINCE is a very restricted environment for mobile devices 68//! WINCE is a very restricted environment for mobile devices
69#if defined(_WIN32_WCE) 69#if defined(_WIN32_WCE)
70#define _IRR_WINDOWS_ 70#define _IRR_WINDOWS_
71#define _IRR_WINDOWS_API_ 71#define _IRR_WINDOWS_API_
72#define _IRR_WINDOWS_CE_PLATFORM_ 72#define _IRR_WINDOWS_CE_PLATFORM_
73#define _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ 73#define _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_
74#endif 74#endif
75 75
76#if defined(_MSC_VER) && (_MSC_VER < 1300) 76#if defined(_MSC_VER) && (_MSC_VER < 1300)
77# error "Only Microsoft Visual Studio 7.0 and later are supported." 77# error "Only Microsoft Visual Studio 7.0 and later are supported."
78#endif 78#endif
79 79
80// XBox only suppots the native Window stuff 80// XBox only suppots the native Window stuff
81#if defined(_XBOX) 81#if defined(_XBOX)
82 #undef _IRR_WINDOWS_ 82 #undef _IRR_WINDOWS_
83 #define _IRR_XBOX_PLATFORM_ 83 #define _IRR_XBOX_PLATFORM_
84 #define _IRR_WINDOWS_API_ 84 #define _IRR_WINDOWS_API_
85 //#define _IRR_COMPILE_WITH_WINDOWS_DEVICE_ 85 //#define _IRR_COMPILE_WITH_WINDOWS_DEVICE_
86 #undef _IRR_COMPILE_WITH_WINDOWS_DEVICE_ 86 #undef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
87 //#define _IRR_COMPILE_WITH_SDL_DEVICE_ 87 //#define _IRR_COMPILE_WITH_SDL_DEVICE_
88 88
89 #include <xtl.h> 89 #include <xtl.h>
90#endif 90#endif
91 91
92#if defined(__APPLE__) || defined(MACOSX) 92#if defined(__APPLE__) || defined(MACOSX)
93#if !defined(MACOSX) 93#if !defined(MACOSX)
94#define MACOSX // legacy support 94#define MACOSX // legacy support
95#endif 95#endif
96#define _IRR_OSX_PLATFORM_ 96#define _IRR_OSX_PLATFORM_
97#define _IRR_COMPILE_WITH_OSX_DEVICE_ 97#define _IRR_COMPILE_WITH_OSX_DEVICE_
98#endif 98#endif
99 99
100#if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_) 100#if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_)
101#ifndef _IRR_SOLARIS_PLATFORM_ 101#ifndef _IRR_SOLARIS_PLATFORM_
102#define _IRR_LINUX_PLATFORM_ 102#define _IRR_LINUX_PLATFORM_
103#endif 103#endif
104#define _IRR_POSIX_API_ 104#define _IRR_POSIX_API_
105#define _IRR_COMPILE_WITH_X11_DEVICE_ 105#define _IRR_COMPILE_WITH_X11_DEVICE_
106#endif 106#endif
107 107
108 108
109//! Define _IRR_COMPILE_WITH_JOYSTICK_SUPPORT_ if you want joystick events. 109//! Define _IRR_COMPILE_WITH_JOYSTICK_SUPPORT_ if you want joystick events.
110#define _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ 110#define _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
111#ifdef NO_IRR_COMPILE_WITH_JOYSTICK_EVENTS_ 111#ifdef NO_IRR_COMPILE_WITH_JOYSTICK_EVENTS_
112#undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ 112#undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
113#endif 113#endif
114 114
115 115
116//! Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht. 116//! Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht.
117#define _IRR_MATERIAL_MAX_TEXTURES_ 4 117#define _IRR_MATERIAL_MAX_TEXTURES_ 4
118 118
119//! Define _IRR_COMPILE_WITH_DIRECT3D_8_ and _IRR_COMPILE_WITH_DIRECT3D_9_ to 119//! Define _IRR_COMPILE_WITH_DIRECT3D_8_ and _IRR_COMPILE_WITH_DIRECT3D_9_ to
120//! compile the Irrlicht engine with Direct3D8 and/or DIRECT3D9. 120//! compile the Irrlicht engine with Direct3D8 and/or DIRECT3D9.
121/** If you only want to use the software device or opengl you can disable those defines. 121/** If you only want to use the software device or opengl you can disable those defines.
122This switch is mostly disabled because people do not get the g++ compiler compile 122This switch is mostly disabled because people do not get the g++ compiler compile
123directX header files, and directX is only available on Windows platforms. If you 123directX header files, and directX is only available on Windows platforms. If you
124are using Dev-Cpp, and want to compile this using a DX dev pack, you can define 124are using Dev-Cpp, and want to compile this using a DX dev pack, you can define
125_IRR_COMPILE_WITH_DX9_DEV_PACK_. So you simply need to add something like this 125_IRR_COMPILE_WITH_DX9_DEV_PACK_. So you simply need to add something like this
126to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK 126to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK
127and this to the linker settings: -ld3dx9 -ld3dx8 127and this to the linker settings: -ld3dx9 -ld3dx8
128 128
129Microsoft have chosen to remove D3D8 headers from their recent DXSDKs, and 129Microsoft have chosen to remove D3D8 headers from their recent DXSDKs, and
130so D3D8 support is now disabled by default. If you really want to build 130so D3D8 support is now disabled by default. If you really want to build
131with D3D8 support, then you will have to source a DXSDK with the appropriate 131with D3D8 support, then you will have to source a DXSDK with the appropriate
132headers, e.g. Summer 2004. This is a Microsoft issue, not an Irrlicht one. 132headers, e.g. Summer 2004. This is a Microsoft issue, not an Irrlicht one.
133*/ 133*/
134#if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK)) 134#if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK))
135 135
136//! Define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ if you want to use DirectInput for joystick handling. 136//! Define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ if you want to use DirectInput for joystick handling.
137/** This only applies to Windows devices, currently only supported under Win32 device. 137/** This only applies to Windows devices, currently only supported under Win32 device.
138If not defined, Windows Multimedia library is used, which offers also broad support for joystick devices. */ 138If not defined, Windows Multimedia library is used, which offers also broad support for joystick devices. */
139#define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ 139#define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
140#ifdef NO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ 140#ifdef NO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
141#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ 141#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
142#endif 142#endif
143 143
144//! Only define _IRR_COMPILE_WITH_DIRECT3D_8_ if you have an appropriate DXSDK, e.g. Summer 2004 144//! Only define _IRR_COMPILE_WITH_DIRECT3D_8_ if you have an appropriate DXSDK, e.g. Summer 2004
145// #define _IRR_COMPILE_WITH_DIRECT3D_8_ 145// #define _IRR_COMPILE_WITH_DIRECT3D_8_
146#define _IRR_COMPILE_WITH_DIRECT3D_9_ 146#define _IRR_COMPILE_WITH_DIRECT3D_9_
147 147
148#ifdef NO_IRR_COMPILE_WITH_DIRECT3D_8_ 148#ifdef NO_IRR_COMPILE_WITH_DIRECT3D_8_
149#undef _IRR_COMPILE_WITH_DIRECT3D_8_ 149#undef _IRR_COMPILE_WITH_DIRECT3D_8_
150#endif 150#endif
151#ifdef NO_IRR_COMPILE_WITH_DIRECT3D_9_ 151#ifdef NO_IRR_COMPILE_WITH_DIRECT3D_9_
152#undef _IRR_COMPILE_WITH_DIRECT3D_9_ 152#undef _IRR_COMPILE_WITH_DIRECT3D_9_
153#endif 153#endif
154 154
155#endif 155#endif
156 156
157//! Define _IRR_COMPILE_WITH_OPENGL_ to compile the Irrlicht engine with OpenGL. 157//! Define _IRR_COMPILE_WITH_OPENGL_ to compile the Irrlicht engine with OpenGL.
158/** If you do not wish the engine to be compiled with OpenGL, comment this 158/** If you do not wish the engine to be compiled with OpenGL, comment this
159define out. */ 159define out. */
160#define _IRR_COMPILE_WITH_OPENGL_ 160#define _IRR_COMPILE_WITH_OPENGL_
161#ifdef NO_IRR_COMPILE_WITH_OPENGL_ 161#ifdef NO_IRR_COMPILE_WITH_OPENGL_
162#undef _IRR_COMPILE_WITH_OPENGL_ 162#undef _IRR_COMPILE_WITH_OPENGL_
163#endif 163#endif
164 164
165//! Define _IRR_COMPILE_WITH_SOFTWARE_ to compile the Irrlicht engine with software driver 165//! Define _IRR_COMPILE_WITH_SOFTWARE_ to compile the Irrlicht engine with software driver
166/** If you do not need the software driver, or want to use Burning's Video instead, 166/** If you do not need the software driver, or want to use Burning's Video instead,
167comment this define out */ 167comment this define out */
168#define _IRR_COMPILE_WITH_SOFTWARE_ 168#define _IRR_COMPILE_WITH_SOFTWARE_
169#ifdef NO_IRR_COMPILE_WITH_SOFTWARE_ 169#ifdef NO_IRR_COMPILE_WITH_SOFTWARE_
170#undef _IRR_COMPILE_WITH_SOFTWARE_ 170#undef _IRR_COMPILE_WITH_SOFTWARE_
171#endif 171#endif
172 172
173//! Define _IRR_COMPILE_WITH_BURNINGSVIDEO_ to compile the Irrlicht engine with Burning's video driver 173//! Define _IRR_COMPILE_WITH_BURNINGSVIDEO_ to compile the Irrlicht engine with Burning's video driver
174/** If you do not need this software driver, you can comment this define out. */ 174/** If you do not need this software driver, you can comment this define out. */
175#define _IRR_COMPILE_WITH_BURNINGSVIDEO_ 175#define _IRR_COMPILE_WITH_BURNINGSVIDEO_
176#ifdef NO_IRR_COMPILE_WITH_BURNINGSVIDEO_ 176#ifdef NO_IRR_COMPILE_WITH_BURNINGSVIDEO_
177#undef _IRR_COMPILE_WITH_BURNINGSVIDEO_ 177#undef _IRR_COMPILE_WITH_BURNINGSVIDEO_
178#endif 178#endif
179 179
180//! Define _IRR_COMPILE_WITH_X11_ to compile the Irrlicht engine with X11 support. 180//! Define _IRR_COMPILE_WITH_X11_ to compile the Irrlicht engine with X11 support.
181/** If you do not wish the engine to be compiled with X11, comment this 181/** If you do not wish the engine to be compiled with X11, comment this
182define out. */ 182define out. */
183// Only used in LinuxDevice. 183// Only used in LinuxDevice.
184#define _IRR_COMPILE_WITH_X11_ 184#define _IRR_COMPILE_WITH_X11_
185#ifdef NO_IRR_COMPILE_WITH_X11_ 185#ifdef NO_IRR_COMPILE_WITH_X11_
186#undef _IRR_COMPILE_WITH_X11_ 186#undef _IRR_COMPILE_WITH_X11_
187#endif 187#endif
188 188
189//! Define _IRR_OPENGL_USE_EXTPOINTER_ if the OpenGL renderer should use OpenGL extensions via function pointers. 189//! Define _IRR_OPENGL_USE_EXTPOINTER_ if the OpenGL renderer should use OpenGL extensions via function pointers.
190/** On some systems there is no support for the dynamic extension of OpenGL 190/** On some systems there is no support for the dynamic extension of OpenGL
191 via function pointers such that this has to be undef'ed. */ 191 via function pointers such that this has to be undef'ed. */
192#if !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_SOLARIS_PLATFORM_) 192#if !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_SOLARIS_PLATFORM_)
193#define _IRR_OPENGL_USE_EXTPOINTER_ 193#define _IRR_OPENGL_USE_EXTPOINTER_
194#endif 194#endif
195 195
196//! On some Linux systems the XF86 vidmode extension or X11 RandR are missing. Use these flags 196//! On some Linux systems the XF86 vidmode extension or X11 RandR are missing. Use these flags
197//! to remove the dependencies such that Irrlicht will compile on those systems, too. 197//! to remove the dependencies such that Irrlicht will compile on those systems, too.
198//! If you don't need colored cursors you can also disable the Xcursor extension 198//! If you don't need colored cursors you can also disable the Xcursor extension
199#if defined(_IRR_LINUX_PLATFORM_) && defined(_IRR_COMPILE_WITH_X11_) 199#if defined(_IRR_LINUX_PLATFORM_) && defined(_IRR_COMPILE_WITH_X11_)
200#define _IRR_LINUX_X11_VIDMODE_ 200#define _IRR_LINUX_X11_VIDMODE_
201//#define _IRR_LINUX_X11_RANDR_ 201//#define _IRR_LINUX_X11_RANDR_
202#ifdef NO_IRR_LINUX_X11_VIDMODE_ 202#ifdef NO_IRR_LINUX_X11_VIDMODE_
203#undef _IRR_LINUX_X11_VIDMODE_ 203#undef _IRR_LINUX_X11_VIDMODE_
204#endif 204#endif
205#ifdef NO_IRR_LINUX_X11_RANDR_ 205#ifdef NO_IRR_LINUX_X11_RANDR_
206#undef _IRR_LINUX_X11_RANDR_ 206#undef _IRR_LINUX_X11_RANDR_
207#endif 207#endif
208 208
209//! X11 has by default only monochrome cursors, but using the Xcursor library we can also get color cursor support. 209//! X11 has by default only monochrome cursors, but using the Xcursor library we can also get color cursor support.
210//! If you have the need for custom color cursors on X11 then enable this and make sure you also link 210//! If you have the need for custom color cursors on X11 then enable this and make sure you also link
211//! to the Xcursor library in your Makefile/Projectfile. 211//! to the Xcursor library in your Makefile/Projectfile.
212//#define _IRR_LINUX_XCURSOR_ 212//#define _IRR_LINUX_XCURSOR_
213#ifdef NO_IRR_LINUX_XCURSOR_ 213#ifdef NO_IRR_LINUX_XCURSOR_
214#undef _IRR_LINUX_XCURSOR_ 214#undef _IRR_LINUX_XCURSOR_
215#endif 215#endif
216 216
217#endif 217#endif
218 218
219//! Define _IRR_COMPILE_WITH_GUI_ to compile the engine with the built-in GUI 219//! Define _IRR_COMPILE_WITH_GUI_ to compile the engine with the built-in GUI
220/** Disable this if you are using an external library to draw the GUI. If you disable this then 220/** Disable this if you are using an external library to draw the GUI. If you disable this then
221you will not be able to use anything provided by the GUI Environment, including loading fonts. */ 221you will not be able to use anything provided by the GUI Environment, including loading fonts. */
222#define _IRR_COMPILE_WITH_GUI_ 222#define _IRR_COMPILE_WITH_GUI_
223#ifdef NO_IRR_COMPILE_WITH_GUI_ 223#ifdef NO_IRR_COMPILE_WITH_GUI_
224#undef _IRR_COMPILE_WITH_GUI_ 224#undef _IRR_COMPILE_WITH_GUI_
225#endif 225#endif
226 226
227//! Define _IRR_WCHAR_FILESYSTEM to enable unicode filesystem support for the engine. 227//! Define _IRR_WCHAR_FILESYSTEM to enable unicode filesystem support for the engine.
228/** This enables the engine to read/write from unicode filesystem. If you 228/** This enables the engine to read/write from unicode filesystem. If you
229disable this feature, the engine behave as before (ansi). This is currently only supported 229disable this feature, the engine behave as before (ansi). This is currently only supported
230for Windows based systems. You also have to set #define UNICODE for this to compile. 230for Windows based systems. You also have to set #define UNICODE for this to compile.
231*/ 231*/
232//#define _IRR_WCHAR_FILESYSTEM 232//#define _IRR_WCHAR_FILESYSTEM
233#ifdef NO_IRR_WCHAR_FILESYSTEM 233#ifdef NO_IRR_WCHAR_FILESYSTEM
234#undef _IRR_WCHAR_FILESYSTEM 234#undef _IRR_WCHAR_FILESYSTEM
235#endif 235#endif
236 236
237//! Define _IRR_COMPILE_WITH_JPEGLIB_ to enable compiling the engine using libjpeg. 237//! Define _IRR_COMPILE_WITH_JPEGLIB_ to enable compiling the engine using libjpeg.
238/** This enables the engine to read jpeg images. If you comment this out, 238/** This enables the engine to read jpeg images. If you comment this out,
239the engine will no longer read .jpeg images. */ 239the engine will no longer read .jpeg images. */
240#define _IRR_COMPILE_WITH_LIBJPEG_ 240#define _IRR_COMPILE_WITH_LIBJPEG_
241#ifdef NO_IRR_COMPILE_WITH_LIBJPEG_ 241#ifdef NO_IRR_COMPILE_WITH_LIBJPEG_
242#undef _IRR_COMPILE_WITH_LIBJPEG_ 242#undef _IRR_COMPILE_WITH_LIBJPEG_
243#endif 243#endif
244 244
245//! Define _IRR_USE_NON_SYSTEM_JPEG_LIB_ to let irrlicht use the jpeglib which comes with irrlicht. 245//! Define _IRR_USE_NON_SYSTEM_JPEG_LIB_ to let irrlicht use the jpeglib which comes with irrlicht.
246/** If this is commented out, Irrlicht will try to compile using the jpeg lib installed in the system. 246/** If this is commented out, Irrlicht will try to compile using the jpeg lib installed in the system.
247 This is only used when _IRR_COMPILE_WITH_LIBJPEG_ is defined. */ 247 This is only used when _IRR_COMPILE_WITH_LIBJPEG_ is defined. */
248#define _IRR_USE_NON_SYSTEM_JPEG_LIB_ 248#define _IRR_USE_NON_SYSTEM_JPEG_LIB_
249#ifdef NO_IRR_USE_NON_SYSTEM_JPEG_LIB_ 249#ifdef NO_IRR_USE_NON_SYSTEM_JPEG_LIB_
250#undef _IRR_USE_NON_SYSTEM_JPEG_LIB_ 250#undef _IRR_USE_NON_SYSTEM_JPEG_LIB_
251#endif 251#endif
252 252
253//! Define _IRR_COMPILE_WITH_LIBPNG_ to enable compiling the engine using libpng. 253//! Define _IRR_COMPILE_WITH_LIBPNG_ to enable compiling the engine using libpng.
254/** This enables the engine to read png images. If you comment this out, 254/** This enables the engine to read png images. If you comment this out,
255the engine will no longer read .png images. */ 255the engine will no longer read .png images. */
256#define _IRR_COMPILE_WITH_LIBPNG_ 256#define _IRR_COMPILE_WITH_LIBPNG_
257#ifdef NO_IRR_COMPILE_WITH_LIBPNG_ 257#ifdef NO_IRR_COMPILE_WITH_LIBPNG_
258#undef _IRR_COMPILE_WITH_LIBPNG_ 258#undef _IRR_COMPILE_WITH_LIBPNG_
259#endif 259#endif
260 260
261//! Define _IRR_USE_NON_SYSTEM_LIBPNG_ to let irrlicht use the libpng which comes with irrlicht. 261//! Define _IRR_USE_NON_SYSTEM_LIBPNG_ to let irrlicht use the libpng which comes with irrlicht.
262/** If this is commented out, Irrlicht will try to compile using the libpng installed in the system. 262/** If this is commented out, Irrlicht will try to compile using the libpng installed in the system.
263 This is only used when _IRR_COMPILE_WITH_LIBPNG_ is defined. */ 263 This is only used when _IRR_COMPILE_WITH_LIBPNG_ is defined. */
264#define _IRR_USE_NON_SYSTEM_LIB_PNG_ 264#define _IRR_USE_NON_SYSTEM_LIB_PNG_
265#ifdef NO_IRR_USE_NON_SYSTEM_LIB_PNG_ 265#ifdef NO_IRR_USE_NON_SYSTEM_LIB_PNG_
266#undef _IRR_USE_NON_SYSTEM_LIB_PNG_ 266#undef _IRR_USE_NON_SYSTEM_LIB_PNG_
267#endif 267#endif
268 268
269//! Define _IRR_D3D_NO_SHADER_DEBUGGING to disable shader debugging in D3D9 269//! Define _IRR_D3D_NO_SHADER_DEBUGGING to disable shader debugging in D3D9
270/** If _IRR_D3D_NO_SHADER_DEBUGGING is undefined in IrrCompileConfig.h, 270/** If _IRR_D3D_NO_SHADER_DEBUGGING is undefined in IrrCompileConfig.h,
271it is possible to debug all D3D9 shaders in VisualStudio. All shaders 271it is possible to debug all D3D9 shaders in VisualStudio. All shaders
272(which have been generated in memory or read from archives for example) will be emitted 272(which have been generated in memory or read from archives for example) will be emitted
273into a temporary file at runtime for this purpose. To debug your shaders, choose 273into a temporary file at runtime for this purpose. To debug your shaders, choose
274Debug->Direct3D->StartWithDirect3DDebugging in Visual Studio, and for every shader a 274Debug->Direct3D->StartWithDirect3DDebugging in Visual Studio, and for every shader a
275file named 'irr_dbg_shader_%%.vsh' or 'irr_dbg_shader_%%.psh' will be created. Drag'n'drop 275file named 'irr_dbg_shader_%%.vsh' or 'irr_dbg_shader_%%.psh' will be created. Drag'n'drop
276the file you want to debug into visual studio. That's it. You can now set breakpoints and 276the file you want to debug into visual studio. That's it. You can now set breakpoints and
277watch registers, variables etc. This works with ASM, HLSL, and both with pixel and vertex shaders. 277watch registers, variables etc. This works with ASM, HLSL, and both with pixel and vertex shaders.
278Note that the engine will run in D3D REF for this, which is a lot slower than HAL. */ 278Note that the engine will run in D3D REF for this, which is a lot slower than HAL. */
279#define _IRR_D3D_NO_SHADER_DEBUGGING 279#define _IRR_D3D_NO_SHADER_DEBUGGING
280#ifdef NO_IRR_D3D_NO_SHADER_DEBUGGING 280#ifdef NO_IRR_D3D_NO_SHADER_DEBUGGING
281#undef _IRR_D3D_NO_SHADER_DEBUGGING 281#undef _IRR_D3D_NO_SHADER_DEBUGGING
282#endif 282#endif
283 283
284//! Define _IRR_D3D_USE_LEGACY_HLSL_COMPILER to enable the old HLSL compiler in recent DX SDKs 284//! Define _IRR_D3D_USE_LEGACY_HLSL_COMPILER to enable the old HLSL compiler in recent DX SDKs
285/** This enables support for ps_1_x shaders for recent DX SDKs. Otherwise, support 285/** This enables support for ps_1_x shaders for recent DX SDKs. Otherwise, support
286for this shader model is not available anymore in SDKs after Oct2006. You need to 286for this shader model is not available anymore in SDKs after Oct2006. You need to
287distribute the OCT2006_d3dx9_31_x86.cab or OCT2006_d3dx9_31_x64.cab though, in order 287distribute the OCT2006_d3dx9_31_x86.cab or OCT2006_d3dx9_31_x64.cab though, in order
288to provide the user with the proper DLL. That's why it's disabled by default. */ 288to provide the user with the proper DLL. That's why it's disabled by default. */
289//#define _IRR_D3D_USE_LEGACY_HLSL_COMPILER 289//#define _IRR_D3D_USE_LEGACY_HLSL_COMPILER
290#ifdef NO_IRR_D3D_USE_LEGACY_HLSL_COMPILER 290#ifdef NO_IRR_D3D_USE_LEGACY_HLSL_COMPILER
291#undef _IRR_D3D_USE_LEGACY_HLSL_COMPILER 291#undef _IRR_D3D_USE_LEGACY_HLSL_COMPILER
292#endif 292#endif
293 293
294//! Define _IRR_COMPILE_WITH_CG_ to enable Cg Shading Language support 294//! Define _IRR_COMPILE_WITH_CG_ to enable Cg Shading Language support
295//#define _IRR_COMPILE_WITH_CG_ 295//#define _IRR_COMPILE_WITH_CG_
296#ifdef NO_IRR_COMPILE_WITH_CG_ 296#ifdef NO_IRR_COMPILE_WITH_CG_
297#undef _IRR_COMPILE_WITH_CG_ 297#undef _IRR_COMPILE_WITH_CG_
298#endif 298#endif
299#if !defined(_IRR_COMPILE_WITH_OPENGL_) && !defined(_IRR_COMPILE_WITH_DIRECT3D_9_) 299#if !defined(_IRR_COMPILE_WITH_OPENGL_) && !defined(_IRR_COMPILE_WITH_DIRECT3D_9_)
300#undef _IRR_COMPILE_WITH_CG_ 300#undef _IRR_COMPILE_WITH_CG_
301#endif 301#endif
302 302
303//! Define _IRR_USE_NVIDIA_PERFHUD_ to opt-in to using the nVidia PerHUD tool 303//! Define _IRR_USE_NVIDIA_PERFHUD_ to opt-in to using the nVidia PerHUD tool
304/** Enable, by opting-in, to use the nVidia PerfHUD performance analysis driver 304/** Enable, by opting-in, to use the nVidia PerfHUD performance analysis driver
305tool <http://developer.nvidia.com/object/nvperfhud_home.html>. */ 305tool <http://developer.nvidia.com/object/nvperfhud_home.html>. */
306#undef _IRR_USE_NVIDIA_PERFHUD_ 306#undef _IRR_USE_NVIDIA_PERFHUD_
307 307
308//! Define one of the three setting for Burning's Video Software Rasterizer 308//! Define one of the three setting for Burning's Video Software Rasterizer
309/** So if we were marketing guys we could say Irrlicht has 4 Software-Rasterizers. 309/** So if we were marketing guys we could say Irrlicht has 4 Software-Rasterizers.
310 In a Nutshell: 310 In a Nutshell:
311 All Burnings Rasterizers use 32 Bit Backbuffer, 32Bit Texture & 32 Bit Z or WBuffer, 311 All Burnings Rasterizers use 32 Bit Backbuffer, 32Bit Texture & 32 Bit Z or WBuffer,
312 16 Bit/32 Bit can be adjusted on a global flag. 312 16 Bit/32 Bit can be adjusted on a global flag.
313 313
314 BURNINGVIDEO_RENDERER_BEAUTIFUL 314 BURNINGVIDEO_RENDERER_BEAUTIFUL
315 32 Bit + Vertexcolor + Lighting + Per Pixel Perspective Correct + SubPixel/SubTexel Correct + 315 32 Bit + Vertexcolor + Lighting + Per Pixel Perspective Correct + SubPixel/SubTexel Correct +
316 Bilinear Texturefiltering + WBuffer 316 Bilinear Texturefiltering + WBuffer
317 317
318 BURNINGVIDEO_RENDERER_FAST 318 BURNINGVIDEO_RENDERER_FAST
319 32 Bit + Per Pixel Perspective Correct + SubPixel/SubTexel Correct + WBuffer + 319 32 Bit + Per Pixel Perspective Correct + SubPixel/SubTexel Correct + WBuffer +
320 Bilinear Dithering TextureFiltering + WBuffer 320 Bilinear Dithering TextureFiltering + WBuffer
321 321
322 BURNINGVIDEO_RENDERER_ULTRA_FAST 322 BURNINGVIDEO_RENDERER_ULTRA_FAST
323 16Bit + SubPixel/SubTexel Correct + ZBuffer 323 16Bit + SubPixel/SubTexel Correct + ZBuffer
324*/ 324*/
325 325
326#define BURNINGVIDEO_RENDERER_BEAUTIFUL 326#define BURNINGVIDEO_RENDERER_BEAUTIFUL
327//#define BURNINGVIDEO_RENDERER_FAST 327//#define BURNINGVIDEO_RENDERER_FAST
328//#define BURNINGVIDEO_RENDERER_ULTRA_FAST 328//#define BURNINGVIDEO_RENDERER_ULTRA_FAST
329//#define BURNINGVIDEO_RENDERER_CE 329//#define BURNINGVIDEO_RENDERER_CE
330 330
331//! Uncomment the following line if you want to ignore the deprecated warnings 331//! Uncomment the following line if you want to ignore the deprecated warnings
332//#define IGNORE_DEPRECATED_WARNING 332//#define IGNORE_DEPRECATED_WARNING
333 333
334//! Define _IRR_COMPILE_WITH_IRR_SCENE_LOADER_ if you want to be able to load 334//! Define _IRR_COMPILE_WITH_IRR_SCENE_LOADER_ if you want to be able to load
335/** .irr scenes using ISceneManager::loadScene */ 335/** .irr scenes using ISceneManager::loadScene */
336#define _IRR_COMPILE_WITH_IRR_SCENE_LOADER_ 336#define _IRR_COMPILE_WITH_IRR_SCENE_LOADER_
337#ifdef NO_IRR_COMPILE_WITH_IRR_SCENE_LOADER_ 337#ifdef NO_IRR_COMPILE_WITH_IRR_SCENE_LOADER_
338#undef _IRR_COMPILE_WITH_IRR_SCENE_LOADER_ 338#undef _IRR_COMPILE_WITH_IRR_SCENE_LOADER_
339#endif 339#endif
340 340
341//! Define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ if you want to use bone based 341//! Define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ if you want to use bone based
342/** animated meshes. If you compile without this, you will be unable to load 342/** animated meshes. If you compile without this, you will be unable to load
343B3D, MS3D or X meshes */ 343B3D, MS3D or X meshes */
344#define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ 344#define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
345#ifdef NO_IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ 345#ifdef NO_IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
346#undef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ 346#undef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
347#endif 347#endif
348 348
349#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ 349#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
350//! Define _IRR_COMPILE_WITH_B3D_LOADER_ if you want to use Blitz3D files 350//! Define _IRR_COMPILE_WITH_B3D_LOADER_ if you want to use Blitz3D files
351#define _IRR_COMPILE_WITH_B3D_LOADER_ 351#define _IRR_COMPILE_WITH_B3D_LOADER_
352#ifdef NO_IRR_COMPILE_WITH_B3D_LOADER_ 352#ifdef NO_IRR_COMPILE_WITH_B3D_LOADER_
353#undef _IRR_COMPILE_WITH_B3D_LOADER_ 353#undef _IRR_COMPILE_WITH_B3D_LOADER_
354#endif 354#endif
355//! Define _IRR_COMPILE_WITH_MS3D_LOADER_ if you want to Milkshape files 355//! Define _IRR_COMPILE_WITH_MS3D_LOADER_ if you want to Milkshape files
356#define _IRR_COMPILE_WITH_MS3D_LOADER_ 356#define _IRR_COMPILE_WITH_MS3D_LOADER_
357#ifdef NO_IRR_COMPILE_WITH_MS3D_LOADER_ 357#ifdef NO_IRR_COMPILE_WITH_MS3D_LOADER_
358#undef _IRR_COMPILE_WITH_MS3D_LOADER_ 358#undef _IRR_COMPILE_WITH_MS3D_LOADER_
359#endif 359#endif
360//! Define _IRR_COMPILE_WITH_X_LOADER_ if you want to use Microsoft X files 360//! Define _IRR_COMPILE_WITH_X_LOADER_ if you want to use Microsoft X files
361#define _IRR_COMPILE_WITH_X_LOADER_ 361#define _IRR_COMPILE_WITH_X_LOADER_
362#ifdef NO_IRR_COMPILE_WITH_X_LOADER_ 362#ifdef NO_IRR_COMPILE_WITH_X_LOADER_
363#undef _IRR_COMPILE_WITH_X_LOADER_ 363#undef _IRR_COMPILE_WITH_X_LOADER_
364#endif 364#endif
365//! Define _IRR_COMPILE_WITH_OGRE_LOADER_ if you want to load Ogre 3D files 365//! Define _IRR_COMPILE_WITH_OGRE_LOADER_ if you want to load Ogre 3D files
366#define _IRR_COMPILE_WITH_OGRE_LOADER_ 366#define _IRR_COMPILE_WITH_OGRE_LOADER_
367#ifdef NO_IRR_COMPILE_WITH_OGRE_LOADER_ 367#ifdef NO_IRR_COMPILE_WITH_OGRE_LOADER_
368#undef _IRR_COMPILE_WITH_OGRE_LOADER_ 368#undef _IRR_COMPILE_WITH_OGRE_LOADER_
369#endif 369#endif
370#endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ 370#endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
371 371
372//! Define _IRR_COMPILE_WITH_IRR_MESH_LOADER_ if you want to load Irrlicht Engine .irrmesh files 372//! Define _IRR_COMPILE_WITH_IRR_MESH_LOADER_ if you want to load Irrlicht Engine .irrmesh files
373#define _IRR_COMPILE_WITH_IRR_MESH_LOADER_ 373#define _IRR_COMPILE_WITH_IRR_MESH_LOADER_
374#ifdef NO_IRR_COMPILE_WITH_IRR_MESH_LOADER_ 374#ifdef NO_IRR_COMPILE_WITH_IRR_MESH_LOADER_
375#undef _IRR_COMPILE_WITH_IRR_MESH_LOADER_ 375#undef _IRR_COMPILE_WITH_IRR_MESH_LOADER_
376#endif 376#endif
377//! Define _IRR_COMPILE_WITH_HALFLIFE_LOADER_ if you want to load Halflife animated files 377//! Define _IRR_COMPILE_WITH_HALFLIFE_LOADER_ if you want to load Halflife animated files
378#define _IRR_COMPILE_WITH_HALFLIFE_LOADER_ 378#define _IRR_COMPILE_WITH_HALFLIFE_LOADER_
379#ifdef NO_IRR_COMPILE_WITH_HALFLIFE_LOADER_ 379#ifdef NO_IRR_COMPILE_WITH_HALFLIFE_LOADER_
380#undef _IRR_COMPILE_WITH_HALFLIFE_LOADER_ 380#undef _IRR_COMPILE_WITH_HALFLIFE_LOADER_
381#endif 381#endif
382//! Define _IRR_COMPILE_WITH_MD2_LOADER_ if you want to load Quake 2 animated files 382//! Define _IRR_COMPILE_WITH_MD2_LOADER_ if you want to load Quake 2 animated files
383#define _IRR_COMPILE_WITH_MD2_LOADER_ 383#define _IRR_COMPILE_WITH_MD2_LOADER_
384#ifdef NO_IRR_COMPILE_WITH_MD2_LOADER_ 384#ifdef NO_IRR_COMPILE_WITH_MD2_LOADER_
385#undef _IRR_COMPILE_WITH_MD2_LOADER_ 385#undef _IRR_COMPILE_WITH_MD2_LOADER_
386#endif 386#endif
387//! Define _IRR_COMPILE_WITH_MD3_LOADER_ if you want to load Quake 3 animated files 387//! Define _IRR_COMPILE_WITH_MD3_LOADER_ if you want to load Quake 3 animated files
388#define _IRR_COMPILE_WITH_MD3_LOADER_ 388#define _IRR_COMPILE_WITH_MD3_LOADER_
389#ifdef NO_IRR_COMPILE_WITH_MD3_LOADER_ 389#ifdef NO_IRR_COMPILE_WITH_MD3_LOADER_
390#undef _IRR_COMPILE_WITH_MD3_LOADER_ 390#undef _IRR_COMPILE_WITH_MD3_LOADER_
391#endif 391#endif
392//! Define _IRR_COMPILE_WITH_3DS_LOADER_ if you want to load 3D Studio Max files 392//! Define _IRR_COMPILE_WITH_3DS_LOADER_ if you want to load 3D Studio Max files
393#define _IRR_COMPILE_WITH_3DS_LOADER_ 393#define _IRR_COMPILE_WITH_3DS_LOADER_
394#ifdef NO_IRR_COMPILE_WITH_3DS_LOADER_ 394#ifdef NO_IRR_COMPILE_WITH_3DS_LOADER_
395#undef _IRR_COMPILE_WITH_3DS_LOADER_ 395#undef _IRR_COMPILE_WITH_3DS_LOADER_
396#endif 396#endif
397//! Define _IRR_COMPILE_WITH_COLLADA_LOADER_ if you want to load Collada files 397//! Define _IRR_COMPILE_WITH_COLLADA_LOADER_ if you want to load Collada files
398#define _IRR_COMPILE_WITH_COLLADA_LOADER_ 398#define _IRR_COMPILE_WITH_COLLADA_LOADER_
399#ifdef NO_IRR_COMPILE_WITH_COLLADA_LOADER_ 399#ifdef NO_IRR_COMPILE_WITH_COLLADA_LOADER_
400#undef _IRR_COMPILE_WITH_COLLADA_LOADER_ 400#undef _IRR_COMPILE_WITH_COLLADA_LOADER_
401#endif 401#endif
402//! Define _IRR_COMPILE_WITH_CSM_LOADER_ if you want to load Cartography Shop files 402//! Define _IRR_COMPILE_WITH_CSM_LOADER_ if you want to load Cartography Shop files
403#define _IRR_COMPILE_WITH_CSM_LOADER_ 403#define _IRR_COMPILE_WITH_CSM_LOADER_
404#ifdef NO_IRR_COMPILE_WITH_CSM_LOADER_ 404#ifdef NO_IRR_COMPILE_WITH_CSM_LOADER_
405#undef _IRR_COMPILE_WITH_CSM_LOADER_ 405#undef _IRR_COMPILE_WITH_CSM_LOADER_
406#endif 406#endif
407//! Define _IRR_COMPILE_WITH_BSP_LOADER_ if you want to load Quake 3 BSP files 407//! Define _IRR_COMPILE_WITH_BSP_LOADER_ if you want to load Quake 3 BSP files
408#define _IRR_COMPILE_WITH_BSP_LOADER_ 408#define _IRR_COMPILE_WITH_BSP_LOADER_
409#ifdef NO_IRR_COMPILE_WITH_BSP_LOADER_ 409#ifdef NO_IRR_COMPILE_WITH_BSP_LOADER_
410#undef _IRR_COMPILE_WITH_BSP_LOADER_ 410#undef _IRR_COMPILE_WITH_BSP_LOADER_
411#endif 411#endif
412//! Define _IRR_COMPILE_WITH_DMF_LOADER_ if you want to load DeleD files 412//! Define _IRR_COMPILE_WITH_DMF_LOADER_ if you want to load DeleD files
413#define _IRR_COMPILE_WITH_DMF_LOADER_ 413#define _IRR_COMPILE_WITH_DMF_LOADER_
414#ifdef NO_IRR_COMPILE_WITH_DMF_LOADER_ 414#ifdef NO_IRR_COMPILE_WITH_DMF_LOADER_
415#undef _IRR_COMPILE_WITH_DMF_LOADER_ 415#undef _IRR_COMPILE_WITH_DMF_LOADER_
416#endif 416#endif
417//! Define _IRR_COMPILE_WITH_LMTS_LOADER_ if you want to load LMTools files 417//! Define _IRR_COMPILE_WITH_LMTS_LOADER_ if you want to load LMTools files
418#define _IRR_COMPILE_WITH_LMTS_LOADER_ 418#define _IRR_COMPILE_WITH_LMTS_LOADER_
419#ifdef NO_IRR_COMPILE_WITH_LMTS_LOADER_ 419#ifdef NO_IRR_COMPILE_WITH_LMTS_LOADER_
420#undef _IRR_COMPILE_WITH_LMTS_LOADER_ 420#undef _IRR_COMPILE_WITH_LMTS_LOADER_
421#endif 421#endif
422//! Define _IRR_COMPILE_WITH_MY3D_LOADER_ if you want to load MY3D files 422//! Define _IRR_COMPILE_WITH_MY3D_LOADER_ if you want to load MY3D files
423#define _IRR_COMPILE_WITH_MY3D_LOADER_ 423#define _IRR_COMPILE_WITH_MY3D_LOADER_
424#ifdef NO_IRR_COMPILE_WITH_MY3D_LOADER_ 424#ifdef NO_IRR_COMPILE_WITH_MY3D_LOADER_
425#undef _IRR_COMPILE_WITH_MY3D_LOADER_ 425#undef _IRR_COMPILE_WITH_MY3D_LOADER_
426#endif 426#endif
427//! Define _IRR_COMPILE_WITH_OBJ_LOADER_ if you want to load Wavefront OBJ files 427//! Define _IRR_COMPILE_WITH_OBJ_LOADER_ if you want to load Wavefront OBJ files
428#define _IRR_COMPILE_WITH_OBJ_LOADER_ 428#define _IRR_COMPILE_WITH_OBJ_LOADER_
429#ifdef NO_IRR_COMPILE_WITH_OBJ_LOADER_ 429#ifdef NO_IRR_COMPILE_WITH_OBJ_LOADER_
430#undef _IRR_COMPILE_WITH_OBJ_LOADER_ 430#undef _IRR_COMPILE_WITH_OBJ_LOADER_
431#endif 431#endif
432//! Define _IRR_COMPILE_WITH_OCT_LOADER_ if you want to load FSRad OCT files 432//! Define _IRR_COMPILE_WITH_OCT_LOADER_ if you want to load FSRad OCT files
433#define _IRR_COMPILE_WITH_OCT_LOADER_ 433#define _IRR_COMPILE_WITH_OCT_LOADER_
434#ifdef NO_IRR_COMPILE_WITH_OCT_LOADER_ 434#ifdef NO_IRR_COMPILE_WITH_OCT_LOADER_
435#undef _IRR_COMPILE_WITH_OCT_LOADER_ 435#undef _IRR_COMPILE_WITH_OCT_LOADER_
436#endif 436#endif
437//! Define _IRR_COMPILE_WITH_LWO_LOADER_ if you want to load Lightwave3D files 437//! Define _IRR_COMPILE_WITH_LWO_LOADER_ if you want to load Lightwave3D files
438#define _IRR_COMPILE_WITH_LWO_LOADER_ 438#define _IRR_COMPILE_WITH_LWO_LOADER_
439#ifdef NO_IRR_COMPILE_WITH_LWO_LOADER_ 439#ifdef NO_IRR_COMPILE_WITH_LWO_LOADER_
440#undef _IRR_COMPILE_WITH_LWO_LOADER_ 440#undef _IRR_COMPILE_WITH_LWO_LOADER_
441#endif 441#endif
442//! Define _IRR_COMPILE_WITH_STL_LOADER_ if you want to load stereolithography files 442//! Define _IRR_COMPILE_WITH_STL_LOADER_ if you want to load stereolithography files
443#define _IRR_COMPILE_WITH_STL_LOADER_ 443#define _IRR_COMPILE_WITH_STL_LOADER_
444#ifdef NO_IRR_COMPILE_WITH_STL_LOADER_ 444#ifdef NO_IRR_COMPILE_WITH_STL_LOADER_
445#undef _IRR_COMPILE_WITH_STL_LOADER_ 445#undef _IRR_COMPILE_WITH_STL_LOADER_
446#endif 446#endif
447//! Define _IRR_COMPILE_WITH_PLY_LOADER_ if you want to load Polygon (Stanford Triangle) files 447//! Define _IRR_COMPILE_WITH_PLY_LOADER_ if you want to load Polygon (Stanford Triangle) files
448#define _IRR_COMPILE_WITH_PLY_LOADER_ 448#define _IRR_COMPILE_WITH_PLY_LOADER_
449#ifdef NO_IRR_COMPILE_WITH_PLY_LOADER_ 449#ifdef NO_IRR_COMPILE_WITH_PLY_LOADER_
450#undef _IRR_COMPILE_WITH_PLY_LOADER_ 450#undef _IRR_COMPILE_WITH_PLY_LOADER_
451#endif 451#endif
452//! Define _IRR_COMPILE_WITH_SMF_LOADER_ if you want to load 3D World Studio mesh files 452//! Define _IRR_COMPILE_WITH_SMF_LOADER_ if you want to load 3D World Studio mesh files
453#define _IRR_COMPILE_WITH_SMF_LOADER_ 453#define _IRR_COMPILE_WITH_SMF_LOADER_
454#ifdef NO_IRR_COMPILE_WITH_SMF_LOADER_ 454#ifdef NO_IRR_COMPILE_WITH_SMF_LOADER_
455#undef _IRR_COMPILE_WITH_SMF_LOADER_ 455#undef _IRR_COMPILE_WITH_SMF_LOADER_
456#endif 456#endif
457 457
458//! Define _IRR_COMPILE_WITH_IRR_WRITER_ if you want to write static .irrMesh files 458//! Define _IRR_COMPILE_WITH_IRR_WRITER_ if you want to write static .irrMesh files
459#define _IRR_COMPILE_WITH_IRR_WRITER_ 459#define _IRR_COMPILE_WITH_IRR_WRITER_
460#ifdef NO_IRR_COMPILE_WITH_IRR_WRITER_ 460#ifdef NO_IRR_COMPILE_WITH_IRR_WRITER_
461#undef _IRR_COMPILE_WITH_IRR_WRITER_ 461#undef _IRR_COMPILE_WITH_IRR_WRITER_
462#endif 462#endif
463//! Define _IRR_COMPILE_WITH_COLLADA_WRITER_ if you want to write Collada files 463//! Define _IRR_COMPILE_WITH_COLLADA_WRITER_ if you want to write Collada files
464#define _IRR_COMPILE_WITH_COLLADA_WRITER_ 464#define _IRR_COMPILE_WITH_COLLADA_WRITER_
465#ifdef NO_IRR_COMPILE_WITH_COLLADA_WRITER_ 465#ifdef NO_IRR_COMPILE_WITH_COLLADA_WRITER_
466#undef _IRR_COMPILE_WITH_COLLADA_WRITER_ 466#undef _IRR_COMPILE_WITH_COLLADA_WRITER_
467#endif 467#endif
468//! Define _IRR_COMPILE_WITH_STL_WRITER_ if you want to write .stl files 468//! Define _IRR_COMPILE_WITH_STL_WRITER_ if you want to write .stl files
469#define _IRR_COMPILE_WITH_STL_WRITER_ 469#define _IRR_COMPILE_WITH_STL_WRITER_
470#ifdef NO_IRR_COMPILE_WITH_STL_WRITER_ 470#ifdef NO_IRR_COMPILE_WITH_STL_WRITER_
471#undef _IRR_COMPILE_WITH_STL_WRITER_ 471#undef _IRR_COMPILE_WITH_STL_WRITER_
472#endif 472#endif
473//! Define _IRR_COMPILE_WITH_OBJ_WRITER_ if you want to write .obj files 473//! Define _IRR_COMPILE_WITH_OBJ_WRITER_ if you want to write .obj files
474#define _IRR_COMPILE_WITH_OBJ_WRITER_ 474#define _IRR_COMPILE_WITH_OBJ_WRITER_
475#ifdef NO_IRR_COMPILE_WITH_OBJ_WRITER_ 475#ifdef NO_IRR_COMPILE_WITH_OBJ_WRITER_
476#undef _IRR_COMPILE_WITH_OBJ_WRITER_ 476#undef _IRR_COMPILE_WITH_OBJ_WRITER_
477#endif 477#endif
478//! Define _IRR_COMPILE_WITH_PLY_WRITER_ if you want to write .ply files 478//! Define _IRR_COMPILE_WITH_PLY_WRITER_ if you want to write .ply files
479#define _IRR_COMPILE_WITH_PLY_WRITER_ 479#define _IRR_COMPILE_WITH_PLY_WRITER_
480#ifdef NO_IRR_COMPILE_WITH_PLY_WRITER_ 480#ifdef NO_IRR_COMPILE_WITH_PLY_WRITER_
481#undef _IRR_COMPILE_WITH_PLY_WRITER_ 481#undef _IRR_COMPILE_WITH_PLY_WRITER_
482#endif 482#endif
483 483
484//! Define _IRR_COMPILE_WITH_BMP_LOADER_ if you want to load .bmp files 484//! Define _IRR_COMPILE_WITH_BMP_LOADER_ if you want to load .bmp files
485//! Disabling this loader will also disable the built-in font 485//! Disabling this loader will also disable the built-in font
486#define _IRR_COMPILE_WITH_BMP_LOADER_ 486#define _IRR_COMPILE_WITH_BMP_LOADER_
487#ifdef NO_IRR_COMPILE_WITH_BMP_LOADER_ 487#ifdef NO_IRR_COMPILE_WITH_BMP_LOADER_
488#undef _IRR_COMPILE_WITH_BMP_LOADER_ 488#undef _IRR_COMPILE_WITH_BMP_LOADER_
489#endif 489#endif
490//! Define _IRR_COMPILE_WITH_JPG_LOADER_ if you want to load .jpg files 490//! Define _IRR_COMPILE_WITH_JPG_LOADER_ if you want to load .jpg files
491#define _IRR_COMPILE_WITH_JPG_LOADER_ 491#define _IRR_COMPILE_WITH_JPG_LOADER_
492#ifdef NO_IRR_COMPILE_WITH_JPG_LOADER_ 492#ifdef NO_IRR_COMPILE_WITH_JPG_LOADER_
493#undef _IRR_COMPILE_WITH_JPG_LOADER_ 493#undef _IRR_COMPILE_WITH_JPG_LOADER_
494#endif 494#endif
495//! Define _IRR_COMPILE_WITH_PCX_LOADER_ if you want to load .pcx files 495//! Define _IRR_COMPILE_WITH_PCX_LOADER_ if you want to load .pcx files
496#define _IRR_COMPILE_WITH_PCX_LOADER_ 496#define _IRR_COMPILE_WITH_PCX_LOADER_
497#ifdef NO_IRR_COMPILE_WITH_PCX_LOADER_ 497#ifdef NO_IRR_COMPILE_WITH_PCX_LOADER_
498#undef _IRR_COMPILE_WITH_PCX_LOADER_ 498#undef _IRR_COMPILE_WITH_PCX_LOADER_
499#endif 499#endif
500//! Define _IRR_COMPILE_WITH_PNG_LOADER_ if you want to load .png files 500//! Define _IRR_COMPILE_WITH_PNG_LOADER_ if you want to load .png files
501#define _IRR_COMPILE_WITH_PNG_LOADER_ 501#define _IRR_COMPILE_WITH_PNG_LOADER_
502#ifdef NO_IRR_COMPILE_WITH_PNG_LOADER_ 502#ifdef NO_IRR_COMPILE_WITH_PNG_LOADER_
503#undef _IRR_COMPILE_WITH_PNG_LOADER_ 503#undef _IRR_COMPILE_WITH_PNG_LOADER_
504#endif 504#endif
505//! Define _IRR_COMPILE_WITH_PPM_LOADER_ if you want to load .ppm/.pgm/.pbm files 505//! Define _IRR_COMPILE_WITH_PPM_LOADER_ if you want to load .ppm/.pgm/.pbm files
506#define _IRR_COMPILE_WITH_PPM_LOADER_ 506#define _IRR_COMPILE_WITH_PPM_LOADER_
507#ifdef NO_IRR_COMPILE_WITH_PPM_LOADER_ 507#ifdef NO_IRR_COMPILE_WITH_PPM_LOADER_
508#undef _IRR_COMPILE_WITH_PPM_LOADER_ 508#undef _IRR_COMPILE_WITH_PPM_LOADER_
509#endif 509#endif
510//! Define _IRR_COMPILE_WITH_PSD_LOADER_ if you want to load .psd files 510//! Define _IRR_COMPILE_WITH_PSD_LOADER_ if you want to load .psd files
511#define _IRR_COMPILE_WITH_PSD_LOADER_ 511#define _IRR_COMPILE_WITH_PSD_LOADER_
512#ifdef NO_IRR_COMPILE_WITH_PSD_LOADER_ 512#ifdef NO_IRR_COMPILE_WITH_PSD_LOADER_
513#undef _IRR_COMPILE_WITH_PSD_LOADER_ 513#undef _IRR_COMPILE_WITH_PSD_LOADER_
514#endif 514#endif
515//! Define _IRR_COMPILE_WITH_DDS_LOADER_ if you want to load .dds files 515//! Define _IRR_COMPILE_WITH_DDS_LOADER_ if you want to load .dds files
516// Outcommented because 516// Outcommented because
517// a) it doesn't compile on 64-bit currently 517// a) it doesn't compile on 64-bit currently
518// b) anyone enabling it should be aware that S3TC compression algorithm which might be used in that loader 518// b) anyone enabling it should be aware that S3TC compression algorithm which might be used in that loader
519// is patented in the US by S3 and they do collect license fees when it's used in applications. 519// is patented in the US by S3 and they do collect license fees when it's used in applications.
520// So if you are unfortunate enough to develop applications for US market and their broken patent system be careful. 520// So if you are unfortunate enough to develop applications for US market and their broken patent system be careful.
521// #define _IRR_COMPILE_WITH_DDS_LOADER_ 521// #define _IRR_COMPILE_WITH_DDS_LOADER_
522#ifdef NO_IRR_COMPILE_WITH_DDS_LOADER_ 522#ifdef NO_IRR_COMPILE_WITH_DDS_LOADER_
523#undef _IRR_COMPILE_WITH_DDS_LOADER_ 523#undef _IRR_COMPILE_WITH_DDS_LOADER_
524#endif 524#endif
525//! Define _IRR_COMPILE_WITH_TGA_LOADER_ if you want to load .tga files 525//! Define _IRR_COMPILE_WITH_TGA_LOADER_ if you want to load .tga files
526#define _IRR_COMPILE_WITH_TGA_LOADER_ 526#define _IRR_COMPILE_WITH_TGA_LOADER_
527#ifdef NO_IRR_COMPILE_WITH_TGA_LOADER_ 527#ifdef NO_IRR_COMPILE_WITH_TGA_LOADER_
528#undef _IRR_COMPILE_WITH_TGA_LOADER_ 528#undef _IRR_COMPILE_WITH_TGA_LOADER_
529#endif 529#endif
530//! Define _IRR_COMPILE_WITH_WAL_LOADER_ if you want to load .wal files 530//! Define _IRR_COMPILE_WITH_WAL_LOADER_ if you want to load .wal files
531#define _IRR_COMPILE_WITH_WAL_LOADER_ 531#define _IRR_COMPILE_WITH_WAL_LOADER_
532#ifdef NO_IRR_COMPILE_WITH_WAL_LOADER_ 532#ifdef NO_IRR_COMPILE_WITH_WAL_LOADER_
533#undef _IRR_COMPILE_WITH_WAL_LOADER_ 533#undef _IRR_COMPILE_WITH_WAL_LOADER_
534#endif 534#endif
535//! Define _IRR_COMPILE_WITH_LMP_LOADER_ if you want to load .lmp files 535//! Define _IRR_COMPILE_WITH_LMP_LOADER_ if you want to load .lmp files
536#define _IRR_COMPILE_WITH_LMP_LOADER_ 536#define _IRR_COMPILE_WITH_LMP_LOADER_
537#ifdef NO_IRR_COMPILE_WITH_LMP_LOADER_ 537#ifdef NO_IRR_COMPILE_WITH_LMP_LOADER_
538#undef _IRR_COMPILE_WITH_LMP_LOADER_ 538#undef _IRR_COMPILE_WITH_LMP_LOADER_
539#endif 539#endif
540//! Define _IRR_COMPILE_WITH_RGB_LOADER_ if you want to load Silicon Graphics .rgb/.rgba/.sgi/.int/.inta/.bw files 540//! Define _IRR_COMPILE_WITH_RGB_LOADER_ if you want to load Silicon Graphics .rgb/.rgba/.sgi/.int/.inta/.bw files
541#define _IRR_COMPILE_WITH_RGB_LOADER_ 541#define _IRR_COMPILE_WITH_RGB_LOADER_
542#ifdef NO_IRR_COMPILE_WITH_RGB_LOADER_ 542#ifdef NO_IRR_COMPILE_WITH_RGB_LOADER_
543#undef _IRR_COMPILE_WITH_RGB_LOADER_ 543#undef _IRR_COMPILE_WITH_RGB_LOADER_
544#endif 544#endif
545 545
546//! Define _IRR_COMPILE_WITH_BMP_WRITER_ if you want to write .bmp files 546//! Define _IRR_COMPILE_WITH_BMP_WRITER_ if you want to write .bmp files
547#define _IRR_COMPILE_WITH_BMP_WRITER_ 547#define _IRR_COMPILE_WITH_BMP_WRITER_
548#ifdef NO_IRR_COMPILE_WITH_BMP_WRITER_ 548#ifdef NO_IRR_COMPILE_WITH_BMP_WRITER_
549#undef _IRR_COMPILE_WITH_BMP_WRITER_ 549#undef _IRR_COMPILE_WITH_BMP_WRITER_
550#endif 550#endif
551//! Define _IRR_COMPILE_WITH_JPG_WRITER_ if you want to write .jpg files 551//! Define _IRR_COMPILE_WITH_JPG_WRITER_ if you want to write .jpg files
552#define _IRR_COMPILE_WITH_JPG_WRITER_ 552#define _IRR_COMPILE_WITH_JPG_WRITER_
553#ifdef NO_IRR_COMPILE_WITH_JPG_WRITER_ 553#ifdef NO_IRR_COMPILE_WITH_JPG_WRITER_
554#undef _IRR_COMPILE_WITH_JPG_WRITER_ 554#undef _IRR_COMPILE_WITH_JPG_WRITER_
555#endif 555#endif
556//! Define _IRR_COMPILE_WITH_PCX_WRITER_ if you want to write .pcx files 556//! Define _IRR_COMPILE_WITH_PCX_WRITER_ if you want to write .pcx files
557#define _IRR_COMPILE_WITH_PCX_WRITER_ 557#define _IRR_COMPILE_WITH_PCX_WRITER_
558#ifdef NO_IRR_COMPILE_WITH_PCX_WRITER_ 558#ifdef NO_IRR_COMPILE_WITH_PCX_WRITER_
559#undef _IRR_COMPILE_WITH_PCX_WRITER_ 559#undef _IRR_COMPILE_WITH_PCX_WRITER_
560#endif 560#endif
561//! Define _IRR_COMPILE_WITH_PNG_WRITER_ if you want to write .png files 561//! Define _IRR_COMPILE_WITH_PNG_WRITER_ if you want to write .png files
562#define _IRR_COMPILE_WITH_PNG_WRITER_ 562#define _IRR_COMPILE_WITH_PNG_WRITER_
563#ifdef NO_IRR_COMPILE_WITH_PNG_WRITER_ 563#ifdef NO_IRR_COMPILE_WITH_PNG_WRITER_
564#undef _IRR_COMPILE_WITH_PNG_WRITER_ 564#undef _IRR_COMPILE_WITH_PNG_WRITER_
565#endif 565#endif
566//! Define _IRR_COMPILE_WITH_PPM_WRITER_ if you want to write .ppm files 566//! Define _IRR_COMPILE_WITH_PPM_WRITER_ if you want to write .ppm files
567#define _IRR_COMPILE_WITH_PPM_WRITER_ 567#define _IRR_COMPILE_WITH_PPM_WRITER_
568#ifdef NO_IRR_COMPILE_WITH_PPM_WRITER_ 568#ifdef NO_IRR_COMPILE_WITH_PPM_WRITER_
569#undef _IRR_COMPILE_WITH_PPM_WRITER_ 569#undef _IRR_COMPILE_WITH_PPM_WRITER_
570#endif 570#endif
571//! Define _IRR_COMPILE_WITH_PSD_WRITER_ if you want to write .psd files 571//! Define _IRR_COMPILE_WITH_PSD_WRITER_ if you want to write .psd files
572#define _IRR_COMPILE_WITH_PSD_WRITER_ 572#define _IRR_COMPILE_WITH_PSD_WRITER_
573#ifdef NO_IRR_COMPILE_WITH_PSD_WRITER_ 573#ifdef NO_IRR_COMPILE_WITH_PSD_WRITER_
574#undef _IRR_COMPILE_WITH_PSD_WRITER_ 574#undef _IRR_COMPILE_WITH_PSD_WRITER_
575#endif 575#endif
576//! Define _IRR_COMPILE_WITH_TGA_WRITER_ if you want to write .tga files 576//! Define _IRR_COMPILE_WITH_TGA_WRITER_ if you want to write .tga files
577#define _IRR_COMPILE_WITH_TGA_WRITER_ 577#define _IRR_COMPILE_WITH_TGA_WRITER_
578#ifdef NO_IRR_COMPILE_WITH_TGA_WRITER_ 578#ifdef NO_IRR_COMPILE_WITH_TGA_WRITER_
579#undef _IRR_COMPILE_WITH_TGA_WRITER_ 579#undef _IRR_COMPILE_WITH_TGA_WRITER_
580#endif 580#endif
581 581
582//! Define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ if you want to open ZIP and GZIP archives 582//! Define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ if you want to open ZIP and GZIP archives
583/** ZIP reading has several more options below to configure. */ 583/** ZIP reading has several more options below to configure. */
584#define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ 584#define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
585#ifdef NO__IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ 585#ifdef NO__IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
586#undef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ 586#undef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
587#endif 587#endif
588#ifdef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ 588#ifdef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
589//! Define _IRR_COMPILE_WITH_ZLIB_ to enable compiling the engine using zlib. 589//! Define _IRR_COMPILE_WITH_ZLIB_ to enable compiling the engine using zlib.
590/** This enables the engine to read from compressed .zip archives. If you 590/** This enables the engine to read from compressed .zip archives. If you
591disable this feature, the engine can still read archives, but only uncompressed 591disable this feature, the engine can still read archives, but only uncompressed
592ones. */ 592ones. */
593#define _IRR_COMPILE_WITH_ZLIB_ 593#define _IRR_COMPILE_WITH_ZLIB_
594#ifdef NO_IRR_COMPILE_WITH_ZLIB_ 594#ifdef NO_IRR_COMPILE_WITH_ZLIB_
595#undef _IRR_COMPILE_WITH_ZLIB_ 595#undef _IRR_COMPILE_WITH_ZLIB_
596#endif 596#endif
597//! Define _IRR_USE_NON_SYSTEM_ZLIB_ to let irrlicht use the zlib which comes with irrlicht. 597//! Define _IRR_USE_NON_SYSTEM_ZLIB_ to let irrlicht use the zlib which comes with irrlicht.
598/** If this is commented out, Irrlicht will try to compile using the zlib 598/** If this is commented out, Irrlicht will try to compile using the zlib
599installed on the system. This is only used when _IRR_COMPILE_WITH_ZLIB_ is 599installed on the system. This is only used when _IRR_COMPILE_WITH_ZLIB_ is
600defined. */ 600defined. */
601#define _IRR_USE_NON_SYSTEM_ZLIB_ 601#define _IRR_USE_NON_SYSTEM_ZLIB_
602#ifdef NO_IRR_USE_NON_SYSTEM_ZLIB_ 602#ifdef NO_IRR_USE_NON_SYSTEM_ZLIB_
603#undef _IRR_USE_NON_SYSTEM_ZLIB_ 603#undef _IRR_USE_NON_SYSTEM_ZLIB_
604#endif 604#endif
605//! Define _IRR_COMPILE_WITH_ZIP_ENCRYPTION_ if you want to read AES-encrypted ZIP archives 605//! Define _IRR_COMPILE_WITH_ZIP_ENCRYPTION_ if you want to read AES-encrypted ZIP archives
606#define _IRR_COMPILE_WITH_ZIP_ENCRYPTION_ 606#define _IRR_COMPILE_WITH_ZIP_ENCRYPTION_
607#ifdef NO_IRR_COMPILE_WITH_ZIP_ENCRYPTION_ 607#ifdef NO_IRR_COMPILE_WITH_ZIP_ENCRYPTION_
608#undef _IRR_COMPILE_WITH_ZIP_ENCRYPTION_ 608#undef _IRR_COMPILE_WITH_ZIP_ENCRYPTION_
609#endif 609#endif
610//! Define _IRR_COMPILE_WITH_BZIP2_ if you want to support bzip2 compressed zip archives 610//! Define _IRR_COMPILE_WITH_BZIP2_ if you want to support bzip2 compressed zip archives
611/** bzip2 is superior to the original zip file compression modes, but requires 611/** bzip2 is superior to the original zip file compression modes, but requires
612a certain amount of memory for decompression and adds several files to the 612a certain amount of memory for decompression and adds several files to the
613library. */ 613library. */
614#define _IRR_COMPILE_WITH_BZIP2_ 614#define _IRR_COMPILE_WITH_BZIP2_
615#ifdef NO_IRR_COMPILE_WITH_BZIP2_ 615#ifdef NO_IRR_COMPILE_WITH_BZIP2_
616#undef _IRR_COMPILE_WITH_BZIP2_ 616#undef _IRR_COMPILE_WITH_BZIP2_
617#endif 617#endif
618//! Define _IRR_USE_NON_SYSTEM_BZLIB_ to let irrlicht use the bzlib which comes with irrlicht. 618//! Define _IRR_USE_NON_SYSTEM_BZLIB_ to let irrlicht use the bzlib which comes with irrlicht.
619/** If this is commented out, Irrlicht will try to compile using the bzlib 619/** If this is commented out, Irrlicht will try to compile using the bzlib
620installed on the system. This is only used when _IRR_COMPILE_WITH_BZLIB_ is 620installed on the system. This is only used when _IRR_COMPILE_WITH_BZLIB_ is
621defined. */ 621defined. */
622#define _IRR_USE_NON_SYSTEM_BZLIB_ 622#define _IRR_USE_NON_SYSTEM_BZLIB_
623#ifdef NO_IRR_USE_NON_SYSTEM_BZLIB_ 623#ifdef NO_IRR_USE_NON_SYSTEM_BZLIB_
624#undef _IRR_USE_NON_SYSTEM_BZLIB_ 624#undef _IRR_USE_NON_SYSTEM_BZLIB_
625#endif 625#endif
626//! Define _IRR_COMPILE_WITH_LZMA_ if you want to use LZMA compressed zip files. 626//! Define _IRR_COMPILE_WITH_LZMA_ if you want to use LZMA compressed zip files.
627/** LZMA is a very efficient compression code, known from 7zip. Irrlicht 627/** LZMA is a very efficient compression code, known from 7zip. Irrlicht
628currently only supports zip archives, though. */ 628currently only supports zip archives, though. */
629#define _IRR_COMPILE_WITH_LZMA_ 629#define _IRR_COMPILE_WITH_LZMA_
630#ifdef NO_IRR_COMPILE_WITH_LZMA_ 630#ifdef NO_IRR_COMPILE_WITH_LZMA_
631#undef _IRR_COMPILE_WITH_LZMA_ 631#undef _IRR_COMPILE_WITH_LZMA_
632#endif 632#endif
633#endif 633#endif
634 634
635//! Define __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ if you want to mount folders as archives 635//! Define __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ if you want to mount folders as archives
636#define __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ 636#define __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
637#ifdef NO__IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ 637#ifdef NO__IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
638#undef __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ 638#undef __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
639#endif 639#endif
640//! Define __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ if you want to open ID software PAK archives 640//! Define __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ if you want to open ID software PAK archives
641#define __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ 641#define __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_
642#ifdef NO__IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ 642#ifdef NO__IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_
643#undef __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_ 643#undef __IRR_COMPILE_WITH_PAK_ARCHIVE_LOADER_
644#endif 644#endif
645//! Define __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ if you want to open Nebula Device NPK archives 645//! Define __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ if you want to open Nebula Device NPK archives
646#define __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ 646#define __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_
647#ifdef NO__IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ 647#ifdef NO__IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_
648#undef __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_ 648#undef __IRR_COMPILE_WITH_NPK_ARCHIVE_LOADER_
649#endif 649#endif
650//! Define __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ if you want to open TAR archives 650//! Define __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ if you want to open TAR archives
651#define __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ 651#define __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_
652#ifdef NO__IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ 652#ifdef NO__IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_
653#undef __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_ 653#undef __IRR_COMPILE_WITH_TAR_ARCHIVE_LOADER_
654#endif 654#endif
655//! Define __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ if you want to open WAD archives 655//! Define __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ if you want to open WAD archives
656#define __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ 656#define __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_
657#ifdef NO__IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ 657#ifdef NO__IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_
658#undef __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_ 658#undef __IRR_COMPILE_WITH_WAD_ARCHIVE_LOADER_
659#endif 659#endif
660 660
661//! Set FPU settings 661//! Set FPU settings
662/** Irrlicht should use approximate float and integer fpu techniques 662/** Irrlicht should use approximate float and integer fpu techniques
663precision will be lower but speed higher. currently X86 only 663precision will be lower but speed higher. currently X86 only
664*/ 664*/
665#if !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_SOLARIS_PLATFORM_) 665#if !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_SOLARIS_PLATFORM_)
666 //#define IRRLICHT_FAST_MATH 666 //#define IRRLICHT_FAST_MATH
667 #ifdef NO_IRRLICHT_FAST_MATH 667 #ifdef NO_IRRLICHT_FAST_MATH
668 #undef IRRLICHT_FAST_MATH 668 #undef IRRLICHT_FAST_MATH
669 #endif 669 #endif
670#endif 670#endif
671 671
672// Some cleanup and standard stuff 672// Some cleanup and standard stuff
673 673
674#ifdef _IRR_WINDOWS_API_ 674#ifdef _IRR_WINDOWS_API_
675 675
676// To build Irrlicht as a static library, you must define _IRR_STATIC_LIB_ in both the 676// To build Irrlicht as a static library, you must define _IRR_STATIC_LIB_ in both the
677// Irrlicht build, *and* in the user application, before #including <irrlicht.h> 677// Irrlicht build, *and* in the user application, before #including <irrlicht.h>
678#ifndef _IRR_STATIC_LIB_ 678#ifndef _IRR_STATIC_LIB_
679#ifdef IRRLICHT_EXPORTS 679#ifdef IRRLICHT_EXPORTS
680#define IRRLICHT_API __declspec(dllexport) 680#define IRRLICHT_API __declspec(dllexport)
681#else 681#else
682#define IRRLICHT_API __declspec(dllimport) 682#define IRRLICHT_API __declspec(dllimport)
683#endif // IRRLICHT_EXPORT 683#endif // IRRLICHT_EXPORT
684#else 684#else
685#define IRRLICHT_API 685#define IRRLICHT_API
686#endif // _IRR_STATIC_LIB_ 686#endif // _IRR_STATIC_LIB_
687 687
688// Declare the calling convention. 688// Declare the calling convention.
689#if defined(_STDCALL_SUPPORTED) 689#if defined(_STDCALL_SUPPORTED)
690#define IRRCALLCONV __stdcall 690#define IRRCALLCONV __stdcall
691#else 691#else
692#define IRRCALLCONV __cdecl 692#define IRRCALLCONV __cdecl
693#endif // STDCALL_SUPPORTED 693#endif // STDCALL_SUPPORTED
694 694
695#else // _IRR_WINDOWS_API_ 695#else // _IRR_WINDOWS_API_
696 696
697// Force symbol export in shared libraries built with gcc. 697// Force symbol export in shared libraries built with gcc.
698#if (__GNUC__ >= 4) && !defined(_IRR_STATIC_LIB_) && defined(IRRLICHT_EXPORTS) 698#if (__GNUC__ >= 4) && !defined(_IRR_STATIC_LIB_) && defined(IRRLICHT_EXPORTS)
699#define IRRLICHT_API __attribute__ ((visibility("default"))) 699#define IRRLICHT_API __attribute__ ((visibility("default")))
700#else 700#else
701#define IRRLICHT_API 701#define IRRLICHT_API
702#endif 702#endif
703 703
704#define IRRCALLCONV 704#define IRRCALLCONV
705 705
706#endif // _IRR_WINDOWS_API_ 706#endif // _IRR_WINDOWS_API_
707 707
708// We need to disable DIRECT3D9 support for Visual Studio 6.0 because 708// We need to disable DIRECT3D9 support for Visual Studio 6.0 because
709// those $%&$!! disabled support for it since Dec. 2004 and users are complaining 709// those $%&$!! disabled support for it since Dec. 2004 and users are complaining
710// about linker errors. Comment this out only if you are knowing what you are 710// about linker errors. Comment this out only if you are knowing what you are
711// doing. (Which means you have an old DX9 SDK and VisualStudio6). 711// doing. (Which means you have an old DX9 SDK and VisualStudio6).
712#ifdef _MSC_VER 712#ifdef _MSC_VER
713#if (_MSC_VER < 1300 && !defined(__GNUC__)) 713#if (_MSC_VER < 1300 && !defined(__GNUC__))
714#undef _IRR_COMPILE_WITH_DIRECT3D_9_ 714#undef _IRR_COMPILE_WITH_DIRECT3D_9_
715#pragma message("Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.") 715#pragma message("Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.")
716#endif 716#endif
717#endif 717#endif
718 718
719// XBox does not have OpenGL or DirectX9 719// XBox does not have OpenGL or DirectX9
720#if defined(_IRR_XBOX_PLATFORM_) 720#if defined(_IRR_XBOX_PLATFORM_)
721 #undef _IRR_COMPILE_WITH_OPENGL_ 721 #undef _IRR_COMPILE_WITH_OPENGL_
722 #undef _IRR_COMPILE_WITH_DIRECT3D_9_ 722 #undef _IRR_COMPILE_WITH_DIRECT3D_9_
723#endif 723#endif
724 724
725//! WinCE does not have OpenGL or DirectX9. use minimal loaders 725//! WinCE does not have OpenGL or DirectX9. use minimal loaders
726#if defined(_WIN32_WCE) 726#if defined(_WIN32_WCE)
727 #undef _IRR_COMPILE_WITH_OPENGL_ 727 #undef _IRR_COMPILE_WITH_OPENGL_
728 #undef _IRR_COMPILE_WITH_DIRECT3D_8_ 728 #undef _IRR_COMPILE_WITH_DIRECT3D_8_
729 #undef _IRR_COMPILE_WITH_DIRECT3D_9_ 729 #undef _IRR_COMPILE_WITH_DIRECT3D_9_
730 730
731 #undef BURNINGVIDEO_RENDERER_BEAUTIFUL 731 #undef BURNINGVIDEO_RENDERER_BEAUTIFUL
732 #undef BURNINGVIDEO_RENDERER_FAST 732 #undef BURNINGVIDEO_RENDERER_FAST
733 #undef BURNINGVIDEO_RENDERER_ULTRA_FAST 733 #undef BURNINGVIDEO_RENDERER_ULTRA_FAST
734 #define BURNINGVIDEO_RENDERER_CE 734 #define BURNINGVIDEO_RENDERER_CE
735 735
736 #undef _IRR_COMPILE_WITH_WINDOWS_DEVICE_ 736 #undef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
737 #define _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ 737 #define _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_
738 //#define _IRR_WCHAR_FILESYSTEM 738 //#define _IRR_WCHAR_FILESYSTEM
739 739
740 #undef _IRR_COMPILE_WITH_IRR_MESH_LOADER_ 740 #undef _IRR_COMPILE_WITH_IRR_MESH_LOADER_
741 //#undef _IRR_COMPILE_WITH_MD2_LOADER_ 741 //#undef _IRR_COMPILE_WITH_MD2_LOADER_
742 #undef _IRR_COMPILE_WITH_MD3_LOADER_ 742 #undef _IRR_COMPILE_WITH_MD3_LOADER_
743 #undef _IRR_COMPILE_WITH_3DS_LOADER_ 743 #undef _IRR_COMPILE_WITH_3DS_LOADER_
744 #undef _IRR_COMPILE_WITH_COLLADA_LOADER_ 744 #undef _IRR_COMPILE_WITH_COLLADA_LOADER_
745 #undef _IRR_COMPILE_WITH_CSM_LOADER_ 745 #undef _IRR_COMPILE_WITH_CSM_LOADER_
746 #undef _IRR_COMPILE_WITH_BSP_LOADER_ 746 #undef _IRR_COMPILE_WITH_BSP_LOADER_
747 #undef _IRR_COMPILE_WITH_DMF_LOADER_ 747 #undef _IRR_COMPILE_WITH_DMF_LOADER_
748 #undef _IRR_COMPILE_WITH_LMTS_LOADER_ 748 #undef _IRR_COMPILE_WITH_LMTS_LOADER_
749 #undef _IRR_COMPILE_WITH_MY3D_LOADER_ 749 #undef _IRR_COMPILE_WITH_MY3D_LOADER_
750 #undef _IRR_COMPILE_WITH_OBJ_LOADER_ 750 #undef _IRR_COMPILE_WITH_OBJ_LOADER_
751 #undef _IRR_COMPILE_WITH_OCT_LOADER_ 751 #undef _IRR_COMPILE_WITH_OCT_LOADER_
752 #undef _IRR_COMPILE_WITH_OGRE_LOADER_ 752 #undef _IRR_COMPILE_WITH_OGRE_LOADER_
753 #undef _IRR_COMPILE_WITH_LWO_LOADER_ 753 #undef _IRR_COMPILE_WITH_LWO_LOADER_
754 #undef _IRR_COMPILE_WITH_STL_LOADER_ 754 #undef _IRR_COMPILE_WITH_STL_LOADER_
755 #undef _IRR_COMPILE_WITH_IRR_WRITER_ 755 #undef _IRR_COMPILE_WITH_IRR_WRITER_
756 #undef _IRR_COMPILE_WITH_COLLADA_WRITER_ 756 #undef _IRR_COMPILE_WITH_COLLADA_WRITER_
757 #undef _IRR_COMPILE_WITH_STL_WRITER_ 757 #undef _IRR_COMPILE_WITH_STL_WRITER_
758 #undef _IRR_COMPILE_WITH_OBJ_WRITER_ 758 #undef _IRR_COMPILE_WITH_OBJ_WRITER_
759 //#undef _IRR_COMPILE_WITH_BMP_LOADER_ 759 //#undef _IRR_COMPILE_WITH_BMP_LOADER_
760 //#undef _IRR_COMPILE_WITH_JPG_LOADER_ 760 //#undef _IRR_COMPILE_WITH_JPG_LOADER_
761 #undef _IRR_COMPILE_WITH_PCX_LOADER_ 761 #undef _IRR_COMPILE_WITH_PCX_LOADER_
762 //#undef _IRR_COMPILE_WITH_PNG_LOADER_ 762 //#undef _IRR_COMPILE_WITH_PNG_LOADER_
763 #undef _IRR_COMPILE_WITH_PPM_LOADER_ 763 #undef _IRR_COMPILE_WITH_PPM_LOADER_
764 #undef _IRR_COMPILE_WITH_PSD_LOADER_ 764 #undef _IRR_COMPILE_WITH_PSD_LOADER_
765 //#undef _IRR_COMPILE_WITH_TGA_LOADER_ 765 //#undef _IRR_COMPILE_WITH_TGA_LOADER_
766 #undef _IRR_COMPILE_WITH_WAL_LOADER_ 766 #undef _IRR_COMPILE_WITH_WAL_LOADER_
767 #undef _IRR_COMPILE_WITH_BMP_WRITER_ 767 #undef _IRR_COMPILE_WITH_BMP_WRITER_
768 #undef _IRR_COMPILE_WITH_JPG_WRITER_ 768 #undef _IRR_COMPILE_WITH_JPG_WRITER_
769 #undef _IRR_COMPILE_WITH_PCX_WRITER_ 769 #undef _IRR_COMPILE_WITH_PCX_WRITER_
770 #undef _IRR_COMPILE_WITH_PNG_WRITER_ 770 #undef _IRR_COMPILE_WITH_PNG_WRITER_
771 #undef _IRR_COMPILE_WITH_PPM_WRITER_ 771 #undef _IRR_COMPILE_WITH_PPM_WRITER_
772 #undef _IRR_COMPILE_WITH_PSD_WRITER_ 772 #undef _IRR_COMPILE_WITH_PSD_WRITER_
773 #undef _IRR_COMPILE_WITH_TGA_WRITER_ 773 #undef _IRR_COMPILE_WITH_TGA_WRITER_
774 774
775#endif 775#endif
776 776
777#ifndef _IRR_WINDOWS_API_ 777#ifndef _IRR_WINDOWS_API_
778 #undef _IRR_WCHAR_FILESYSTEM 778 #undef _IRR_WCHAR_FILESYSTEM
779#endif 779#endif
780 780
781#if defined(__sparc__) || defined(__sun__) 781#if defined(__sparc__) || defined(__sun__)
782#define __BIG_ENDIAN__ 782#define __BIG_ENDIAN__
783#endif 783#endif
784 784
785#if defined(_IRR_SOLARIS_PLATFORM_) 785#if defined(_IRR_SOLARIS_PLATFORM_)
786 #undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ 786 #undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
787#endif 787#endif
788 788
789//! Define __IRR_HAS_S64 if the irr::s64 type should be enable (needs long long, available on most platforms, but not part of ISO C++ 98) 789//! Define __IRR_HAS_S64 if the irr::s64 type should be enable (needs long long, available on most platforms, but not part of ISO C++ 98)
790#define __IRR_HAS_S64 790#define __IRR_HAS_S64
791#ifdef NO__IRR_HAS_S64 791#ifdef NO__IRR_HAS_S64
792#undef __IRR_HAS_S64 792#undef __IRR_HAS_S64
793#endif 793#endif
794 794
795#endif // __IRR_COMPILE_CONFIG_H_INCLUDED__ 795#endif // __IRR_COMPILE_CONFIG_H_INCLUDED__
796 796
diff --git a/libraries/irrlicht-1.8/include/IrrlichtDevice.h b/libraries/irrlicht-1.8/include/IrrlichtDevice.h
index 9d4031e..536e10b 100644
--- a/libraries/irrlicht-1.8/include/IrrlichtDevice.h
+++ b/libraries/irrlicht-1.8/include/IrrlichtDevice.h
@@ -1,322 +1,322 @@
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#ifndef __I_IRRLICHT_DEVICE_H_INCLUDED__ 5#ifndef __I_IRRLICHT_DEVICE_H_INCLUDED__
6#define __I_IRRLICHT_DEVICE_H_INCLUDED__ 6#define __I_IRRLICHT_DEVICE_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "dimension2d.h" 9#include "dimension2d.h"
10#include "IVideoDriver.h" 10#include "IVideoDriver.h"
11#include "EDriverTypes.h" 11#include "EDriverTypes.h"
12#include "EDeviceTypes.h" 12#include "EDeviceTypes.h"
13#include "IEventReceiver.h" 13#include "IEventReceiver.h"
14#include "ICursorControl.h" 14#include "ICursorControl.h"
15#include "IVideoModeList.h" 15#include "IVideoModeList.h"
16#include "ITimer.h" 16#include "ITimer.h"
17#include "IOSOperator.h" 17#include "IOSOperator.h"
18 18
19namespace irr 19namespace irr
20{ 20{
21 class ILogger; 21 class ILogger;
22 class IEventReceiver; 22 class IEventReceiver;
23 class IRandomizer; 23 class IRandomizer;
24 24
25 namespace io { 25 namespace io {
26 class IFileSystem; 26 class IFileSystem;
27 } // end namespace io 27 } // end namespace io
28 28
29 namespace gui { 29 namespace gui {
30 class IGUIEnvironment; 30 class IGUIEnvironment;
31 } // end namespace gui 31 } // end namespace gui
32 32
33 namespace scene { 33 namespace scene {
34 class ISceneManager; 34 class ISceneManager;
35 } // end namespace scene 35 } // end namespace scene
36 36
37 //! The Irrlicht device. You can create it with createDevice() or createDeviceEx(). 37 //! The Irrlicht device. You can create it with createDevice() or createDeviceEx().
38 /** This is the most important class of the Irrlicht Engine. You can 38 /** This is the most important class of the Irrlicht Engine. You can
39 access everything in the engine if you have a pointer to an instance of 39 access everything in the engine if you have a pointer to an instance of
40 this class. There should be only one instance of this class at any 40 this class. There should be only one instance of this class at any
41 time. 41 time.
42 */ 42 */
43 class IrrlichtDevice : public virtual IReferenceCounted 43 class IrrlichtDevice : public virtual IReferenceCounted
44 { 44 {
45 public: 45 public:
46 46
47 //! Runs the device. 47 //! Runs the device.
48 /** Also increments the virtual timer by calling 48 /** Also increments the virtual timer by calling
49 ITimer::tick();. You can prevent this 49 ITimer::tick();. You can prevent this
50 by calling ITimer::stop(); before and ITimer::start() after 50 by calling ITimer::stop(); before and ITimer::start() after
51 calling IrrlichtDevice::run(). Returns false if device wants 51 calling IrrlichtDevice::run(). Returns false if device wants
52 to be deleted. Use it in this way: 52 to be deleted. Use it in this way:
53 \code 53 \code
54 while(device->run()) 54 while(device->run())
55 { 55 {
56 // draw everything here 56 // draw everything here
57 } 57 }
58 \endcode 58 \endcode
59 If you want the device to do nothing if the window is inactive 59 If you want the device to do nothing if the window is inactive
60 (recommended), use the slightly enhanced code shown at isWindowActive(). 60 (recommended), use the slightly enhanced code shown at isWindowActive().
61 61
62 Note if you are running Irrlicht inside an external, custom 62 Note if you are running Irrlicht inside an external, custom
63 created window: Calling Device->run() will cause Irrlicht to 63 created window: Calling Device->run() will cause Irrlicht to
64 dispatch windows messages internally. 64 dispatch windows messages internally.
65 If you are running Irrlicht in your own custom window, you can 65 If you are running Irrlicht in your own custom window, you can
66 also simply use your own message loop using GetMessage, 66 also simply use your own message loop using GetMessage,
67 DispatchMessage and whatever and simply don't use this method. 67 DispatchMessage and whatever and simply don't use this method.
68 But note that Irrlicht will not be able to fetch user input 68 But note that Irrlicht will not be able to fetch user input
69 then. See irr::SIrrlichtCreationParameters::WindowId for more 69 then. See irr::SIrrlichtCreationParameters::WindowId for more
70 informations and example code. 70 informations and example code.
71 */ 71 */
72 virtual bool run() = 0; 72 virtual bool run() = 0;
73 73
74 //! Cause the device to temporarily pause execution and let other processes run. 74 //! Cause the device to temporarily pause execution and let other processes run.
75 /** This should bring down processor usage without major 75 /** This should bring down processor usage without major
76 performance loss for Irrlicht */ 76 performance loss for Irrlicht */
77 virtual void yield() = 0; 77 virtual void yield() = 0;
78 78
79 //! Pause execution and let other processes to run for a specified amount of time. 79 //! Pause execution and let other processes to run for a specified amount of time.
80 /** It may not wait the full given time, as sleep may be interrupted 80 /** It may not wait the full given time, as sleep may be interrupted
81 \param timeMs: Time to sleep for in milisecs. 81 \param timeMs: Time to sleep for in milisecs.
82 \param pauseTimer: If true, pauses the device timer while sleeping 82 \param pauseTimer: If true, pauses the device timer while sleeping
83 */ 83 */
84 virtual void sleep(u32 timeMs, bool pauseTimer=false) = 0; 84 virtual void sleep(u32 timeMs, bool pauseTimer=false) = 0;
85 85
86 //! Provides access to the video driver for drawing 3d and 2d geometry. 86 //! Provides access to the video driver for drawing 3d and 2d geometry.
87 /** \return Pointer the video driver. */ 87 /** \return Pointer the video driver. */
88 virtual video::IVideoDriver* getVideoDriver() = 0; 88 virtual video::IVideoDriver* getVideoDriver() = 0;
89 89
90 //! Provides access to the virtual file system. 90 //! Provides access to the virtual file system.
91 /** \return Pointer to the file system. */ 91 /** \return Pointer to the file system. */
92 virtual io::IFileSystem* getFileSystem() = 0; 92 virtual io::IFileSystem* getFileSystem() = 0;
93 93
94 //! Provides access to the 2d user interface environment. 94 //! Provides access to the 2d user interface environment.
95 /** \return Pointer to the gui environment. */ 95 /** \return Pointer to the gui environment. */
96 virtual gui::IGUIEnvironment* getGUIEnvironment() = 0; 96 virtual gui::IGUIEnvironment* getGUIEnvironment() = 0;
97 97
98 //! Provides access to the scene manager. 98 //! Provides access to the scene manager.
99 /** \return Pointer to the scene manager. */ 99 /** \return Pointer to the scene manager. */
100 virtual scene::ISceneManager* getSceneManager() = 0; 100 virtual scene::ISceneManager* getSceneManager() = 0;
101 101
102 //! Provides access to the cursor control. 102 //! Provides access to the cursor control.
103 /** \return Pointer to the mouse cursor control interface. */ 103 /** \return Pointer to the mouse cursor control interface. */
104 virtual gui::ICursorControl* getCursorControl() = 0; 104 virtual gui::ICursorControl* getCursorControl() = 0;
105 105
106 //! Provides access to the message logger. 106 //! Provides access to the message logger.
107 /** \return Pointer to the logger. */ 107 /** \return Pointer to the logger. */
108 virtual ILogger* getLogger() = 0; 108 virtual ILogger* getLogger() = 0;
109 109
110 //! Gets a list with all video modes available. 110 //! Gets a list with all video modes available.
111 /** If you are confused now, because you think you have to 111 /** If you are confused now, because you think you have to
112 create an Irrlicht Device with a video mode before being able 112 create an Irrlicht Device with a video mode before being able
113 to get the video mode list, let me tell you that there is no 113 to get the video mode list, let me tell you that there is no
114 need to start up an Irrlicht Device with EDT_DIRECT3D8, 114 need to start up an Irrlicht Device with EDT_DIRECT3D8,
115 EDT_OPENGL or EDT_SOFTWARE: For this (and for lots of other 115 EDT_OPENGL or EDT_SOFTWARE: For this (and for lots of other
116 reasons) the null driver, EDT_NULL exists. 116 reasons) the null driver, EDT_NULL exists.
117 \return Pointer to a list with all video modes supported 117 \return Pointer to a list with all video modes supported
118 by the gfx adapter. */ 118 by the gfx adapter. */
119 virtual video::IVideoModeList* getVideoModeList() = 0; 119 virtual video::IVideoModeList* getVideoModeList() = 0;
120 120
121 //! Provides access to the operation system operator object. 121 //! Provides access to the operation system operator object.
122 /** The OS operator provides methods for 122 /** The OS operator provides methods for
123 getting system specific informations and doing system 123 getting system specific informations and doing system
124 specific operations, such as exchanging data with the clipboard 124 specific operations, such as exchanging data with the clipboard
125 or reading the operation system version. 125 or reading the operation system version.
126 \return Pointer to the OS operator. */ 126 \return Pointer to the OS operator. */
127 virtual IOSOperator* getOSOperator() = 0; 127 virtual IOSOperator* getOSOperator() = 0;
128 128
129 //! Provides access to the engine's timer. 129 //! Provides access to the engine's timer.
130 /** The system time can be retrieved by it as 130 /** The system time can be retrieved by it as
131 well as the virtual time, which also can be manipulated. 131 well as the virtual time, which also can be manipulated.
132 \return Pointer to the ITimer object. */ 132 \return Pointer to the ITimer object. */
133 virtual ITimer* getTimer() = 0; 133 virtual ITimer* getTimer() = 0;
134 134
135 //! Provides access to the engine's currently set randomizer. 135 //! Provides access to the engine's currently set randomizer.
136 /** \return Pointer to the IRandomizer object. */ 136 /** \return Pointer to the IRandomizer object. */
137 virtual IRandomizer* getRandomizer() const =0; 137 virtual IRandomizer* getRandomizer() const =0;
138 138
139 //! Sets a new randomizer. 139 //! Sets a new randomizer.
140 /** \param r Pointer to the new IRandomizer object. This object is 140 /** \param r Pointer to the new IRandomizer object. This object is
141 grab()'ed by the engine and will be released upon the next setRandomizer 141 grab()'ed by the engine and will be released upon the next setRandomizer
142 call or upon device destruction. */ 142 call or upon device destruction. */
143 virtual void setRandomizer(IRandomizer* r) =0; 143 virtual void setRandomizer(IRandomizer* r) =0;
144 144
145 //! Creates a new default randomizer. 145 //! Creates a new default randomizer.
146 /** The default randomizer provides the random sequence known from previous 146 /** The default randomizer provides the random sequence known from previous
147 Irrlicht versions and is the initial randomizer set on device creation. 147 Irrlicht versions and is the initial randomizer set on device creation.
148 \return Pointer to the default IRandomizer object. */ 148 \return Pointer to the default IRandomizer object. */
149 virtual IRandomizer* createDefaultRandomizer() const =0; 149 virtual IRandomizer* createDefaultRandomizer() const =0;
150 150
151 //! Sets the caption of the window. 151 //! Sets the caption of the window.
152 /** \param text: New text of the window caption. */ 152 /** \param text: New text of the window caption. */
153 virtual void setWindowCaption(const wchar_t* text) = 0; 153 virtual void setWindowCaption(const wchar_t* text) = 0;
154 154
155 //! Returns if the window is active. 155 //! Returns if the window is active.
156 /** If the window is inactive, 156 /** If the window is inactive,
157 nothing needs to be drawn. So if you don't want to draw anything 157 nothing needs to be drawn. So if you don't want to draw anything
158 when the window is inactive, create your drawing loop this way: 158 when the window is inactive, create your drawing loop this way:
159 \code 159 \code
160 while(device->run()) 160 while(device->run())
161 { 161 {
162 if (device->isWindowActive()) 162 if (device->isWindowActive())
163 { 163 {
164 // draw everything here 164 // draw everything here
165 } 165 }
166 else 166 else
167 device->yield(); 167 device->yield();
168 } 168 }
169 \endcode 169 \endcode
170 \return True if window is active. */ 170 \return True if window is active. */
171 virtual bool isWindowActive() const = 0; 171 virtual bool isWindowActive() const = 0;
172 172
173 //! Checks if the Irrlicht window has focus 173 //! Checks if the Irrlicht window has focus
174 /** \return True if window has focus. */ 174 /** \return True if window has focus. */
175 virtual bool isWindowFocused() const = 0; 175 virtual bool isWindowFocused() const = 0;
176 176
177 //! Checks if the Irrlicht window is minimized 177 //! Checks if the Irrlicht window is minimized
178 /** \return True if window is minimized. */ 178 /** \return True if window is minimized. */
179 virtual bool isWindowMinimized() const = 0; 179 virtual bool isWindowMinimized() const = 0;
180 180
181 //! Checks if the Irrlicht window is running in fullscreen mode 181 //! Checks if the Irrlicht window is running in fullscreen mode
182 /** \return True if window is fullscreen. */ 182 /** \return True if window is fullscreen. */
183 virtual bool isFullscreen() const = 0; 183 virtual bool isFullscreen() const = 0;
184 184
185 //! Get the current color format of the window 185 //! Get the current color format of the window
186 /** \return Color format of the window. */ 186 /** \return Color format of the window. */
187 virtual video::ECOLOR_FORMAT getColorFormat() const = 0; 187 virtual video::ECOLOR_FORMAT getColorFormat() const = 0;
188 188
189 //! Notifies the device that it should close itself. 189 //! Notifies the device that it should close itself.
190 /** IrrlichtDevice::run() will always return false after closeDevice() was called. */ 190 /** IrrlichtDevice::run() will always return false after closeDevice() was called. */
191 virtual void closeDevice() = 0; 191 virtual void closeDevice() = 0;
192 192
193 //! Get the version of the engine. 193 //! Get the version of the engine.
194 /** The returned string 194 /** The returned string
195 will look like this: "1.2.3" or this: "1.2". 195 will look like this: "1.2.3" or this: "1.2".
196 \return String which contains the version. */ 196 \return String which contains the version. */
197 virtual const c8* getVersion() const = 0; 197 virtual const c8* getVersion() const = 0;
198 198
199 //! Sets a new user event receiver which will receive events from the engine. 199 //! Sets a new user event receiver which will receive events from the engine.
200 /** Return true in IEventReceiver::OnEvent to prevent the event from continuing along 200 /** Return true in IEventReceiver::OnEvent to prevent the event from continuing along
201 the chain of event receivers. The path that an event takes through the system depends 201 the chain of event receivers. The path that an event takes through the system depends
202 on its type. See irr::EEVENT_TYPE for details. 202 on its type. See irr::EEVENT_TYPE for details.
203 \param receiver New receiver to be used. */ 203 \param receiver New receiver to be used. */
204 virtual void setEventReceiver(IEventReceiver* receiver) = 0; 204 virtual void setEventReceiver(IEventReceiver* receiver) = 0;
205 205
206 //! Provides access to the current event receiver. 206 //! Provides access to the current event receiver.
207 /** \return Pointer to the current event receiver. Returns 0 if there is none. */ 207 /** \return Pointer to the current event receiver. Returns 0 if there is none. */
208 virtual IEventReceiver* getEventReceiver() = 0; 208 virtual IEventReceiver* getEventReceiver() = 0;
209 209
210 //! Sends a user created event to the engine. 210 //! Sends a user created event to the engine.
211 /** Is is usually not necessary to use this. However, if you 211 /** Is is usually not necessary to use this. However, if you
212 are using an own input library for example for doing joystick 212 are using an own input library for example for doing joystick
213 input, you can use this to post key or mouse input events to 213 input, you can use this to post key or mouse input events to
214 the engine. Internally, this method only delegates the events 214 the engine. Internally, this method only delegates the events
215 further to the scene manager and the GUI environment. */ 215 further to the scene manager and the GUI environment. */
216 virtual bool postEventFromUser(const SEvent& event) = 0; 216 virtual bool postEventFromUser(const SEvent& event) = 0;
217 217
218 //! Sets the input receiving scene manager. 218 //! Sets the input receiving scene manager.
219 /** If set to null, the main scene manager (returned by 219 /** If set to null, the main scene manager (returned by
220 GetSceneManager()) will receive the input 220 GetSceneManager()) will receive the input
221 \param sceneManager New scene manager to be used. */ 221 \param sceneManager New scene manager to be used. */
222 virtual void setInputReceivingSceneManager(scene::ISceneManager* sceneManager) = 0; 222 virtual void setInputReceivingSceneManager(scene::ISceneManager* sceneManager) = 0;
223 223
224 //! Sets if the window should be resizable in windowed mode. 224 //! Sets if the window should be resizable in windowed mode.
225 /** The default is false. This method only works in windowed 225 /** The default is false. This method only works in windowed
226 mode. 226 mode.
227 \param resize Flag whether the window should be resizable. */ 227 \param resize Flag whether the window should be resizable. */
228 virtual void setResizable(bool resize=false) = 0; 228 virtual void setResizable(bool resize=false) = 0;
229 229
230 //! Minimizes the window if possible. 230 //! Minimizes the window if possible.
231 virtual void minimizeWindow() =0; 231 virtual void minimizeWindow() =0;
232 232
233 //! Maximizes the window if possible. 233 //! Maximizes the window if possible.
234 virtual void maximizeWindow() =0; 234 virtual void maximizeWindow() =0;
235 235
236 //! Restore the window to normal size if possible. 236 //! Restore the window to normal size if possible.
237 virtual void restoreWindow() =0; 237 virtual void restoreWindow() =0;
238 238
239 //! Activate any joysticks, and generate events for them. 239 //! Activate any joysticks, and generate events for them.
240 /** Irrlicht contains support for joysticks, but does not generate joystick events by default, 240 /** Irrlicht contains support for joysticks, but does not generate joystick events by default,
241 as this would consume joystick info that 3rd party libraries might rely on. Call this method to 241 as this would consume joystick info that 3rd party libraries might rely on. Call this method to
242 activate joystick support in Irrlicht and to receive irr::SJoystickEvent events. 242 activate joystick support in Irrlicht and to receive irr::SJoystickEvent events.
243 \param joystickInfo On return, this will contain an array of each joystick that was found and activated. 243 \param joystickInfo On return, this will contain an array of each joystick that was found and activated.
244 \return true if joysticks are supported on this device and _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ 244 \return true if joysticks are supported on this device and _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
245 is defined, false if joysticks are not supported or support is compiled out. 245 is defined, false if joysticks are not supported or support is compiled out.
246 */ 246 */
247 virtual bool activateJoysticks(core::array<SJoystickInfo>& joystickInfo) =0; 247 virtual bool activateJoysticks(core::array<SJoystickInfo>& joystickInfo) =0;
248 248
249 //! Set the current Gamma Value for the Display 249 //! Set the current Gamma Value for the Display
250 virtual bool setGammaRamp(f32 red, f32 green, f32 blue, 250 virtual bool setGammaRamp(f32 red, f32 green, f32 blue,
251 f32 relativebrightness, f32 relativecontrast) =0; 251 f32 relativebrightness, f32 relativecontrast) =0;
252 252
253 //! Get the current Gamma Value for the Display 253 //! Get the current Gamma Value for the Display
254 virtual bool getGammaRamp(f32 &red, f32 &green, f32 &blue, 254 virtual bool getGammaRamp(f32 &red, f32 &green, f32 &blue,
255 f32 &brightness, f32 &contrast) =0; 255 f32 &brightness, f32 &contrast) =0;
256 256
257 //! Remove messages pending in the system message loop 257 //! Remove messages pending in the system message loop
258 /** This function is usually used after messages have been buffered for a longer time, for example 258 /** This function is usually used after messages have been buffered for a longer time, for example
259 when loading a large scene. Clearing the message loop prevents that mouse- or buttonclicks which users 259 when loading a large scene. Clearing the message loop prevents that mouse- or buttonclicks which users
260 have pressed in the meantime will now trigger unexpected actions in the gui. <br> 260 have pressed in the meantime will now trigger unexpected actions in the gui. <br>
261 So far the following messages are cleared:<br> 261 So far the following messages are cleared:<br>
262 Win32: All keyboard and mouse messages<br> 262 Win32: All keyboard and mouse messages<br>
263 Linux: All keyboard and mouse messages<br> 263 Linux: All keyboard and mouse messages<br>
264 All other devices are not yet supported here.<br> 264 All other devices are not yet supported here.<br>
265 The function is still somewhat experimental, as the kind of messages we clear is based on just a few use-cases. 265 The function is still somewhat experimental, as the kind of messages we clear is based on just a few use-cases.
266 If you think further messages should be cleared, or some messages should not be cleared here, then please tell us. */ 266 If you think further messages should be cleared, or some messages should not be cleared here, then please tell us. */
267 virtual void clearSystemMessages() = 0; 267 virtual void clearSystemMessages() = 0;
268 268
269 //! Get the type of the device. 269 //! Get the type of the device.
270 /** This allows the user to check which windowing system is currently being 270 /** This allows the user to check which windowing system is currently being
271 used. */ 271 used. */
272 virtual E_DEVICE_TYPE getType() const = 0; 272 virtual E_DEVICE_TYPE getType() const = 0;
273 273
274 //! Check if a driver type is supported by the engine. 274 //! Check if a driver type is supported by the engine.
275 /** Even if true is returned the driver may not be available 275 /** Even if true is returned the driver may not be available
276 for a configuration requested when creating the device. */ 276 for a configuration requested when creating the device. */
277 static bool isDriverSupported(video::E_DRIVER_TYPE driver) 277 static bool isDriverSupported(video::E_DRIVER_TYPE driver)
278 { 278 {
279 switch (driver) 279 switch (driver)
280 { 280 {
281 case video::EDT_NULL: 281 case video::EDT_NULL:
282 return true; 282 return true;
283 case video::EDT_SOFTWARE: 283 case video::EDT_SOFTWARE:
284#ifdef _IRR_COMPILE_WITH_SOFTWARE_ 284#ifdef _IRR_COMPILE_WITH_SOFTWARE_
285 return true; 285 return true;
286#else 286#else
287 return false; 287 return false;
288#endif 288#endif
289 case video::EDT_BURNINGSVIDEO: 289 case video::EDT_BURNINGSVIDEO:
290#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ 290#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
291 return true; 291 return true;
292#else 292#else
293 return false; 293 return false;
294#endif 294#endif
295 case video::EDT_DIRECT3D8: 295 case video::EDT_DIRECT3D8:
296#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ 296#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_
297 return true; 297 return true;
298#else 298#else
299 return false; 299 return false;
300#endif 300#endif
301 case video::EDT_DIRECT3D9: 301 case video::EDT_DIRECT3D9:
302#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ 302#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
303 return true; 303 return true;
304#else 304#else
305 return false; 305 return false;
306#endif 306#endif
307 case video::EDT_OPENGL: 307 case video::EDT_OPENGL:
308#ifdef _IRR_COMPILE_WITH_OPENGL_ 308#ifdef _IRR_COMPILE_WITH_OPENGL_
309 return true; 309 return true;
310#else 310#else
311 return false; 311 return false;
312#endif 312#endif
313 default: 313 default:
314 return false; 314 return false;
315 } 315 }
316 } 316 }
317 }; 317 };
318 318
319} // end namespace irr 319} // end namespace irr
320 320
321#endif 321#endif
322 322
diff --git a/libraries/irrlicht-1.8/include/Keycodes.h b/libraries/irrlicht-1.8/include/Keycodes.h
index 2e95c8c..e56eca1 100644
--- a/libraries/irrlicht-1.8/include/Keycodes.h
+++ b/libraries/irrlicht-1.8/include/Keycodes.h
@@ -1,173 +1,173 @@
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#ifndef __IRR_KEY_CODES_H_INCLUDED__ 5#ifndef __IRR_KEY_CODES_H_INCLUDED__
6#define __IRR_KEY_CODES_H_INCLUDED__ 6#define __IRR_KEY_CODES_H_INCLUDED__
7 7
8namespace irr 8namespace irr
9{ 9{
10 10
11 enum EKEY_CODE 11 enum EKEY_CODE
12 { 12 {
13 KEY_LBUTTON = 0x01, // Left mouse button 13 KEY_LBUTTON = 0x01, // Left mouse button
14 KEY_RBUTTON = 0x02, // Right mouse button 14 KEY_RBUTTON = 0x02, // Right mouse button
15 KEY_CANCEL = 0x03, // Control-break processing 15 KEY_CANCEL = 0x03, // Control-break processing
16 KEY_MBUTTON = 0x04, // Middle mouse button (three-button mouse) 16 KEY_MBUTTON = 0x04, // Middle mouse button (three-button mouse)
17 KEY_XBUTTON1 = 0x05, // Windows 2000/XP: X1 mouse button 17 KEY_XBUTTON1 = 0x05, // Windows 2000/XP: X1 mouse button
18 KEY_XBUTTON2 = 0x06, // Windows 2000/XP: X2 mouse button 18 KEY_XBUTTON2 = 0x06, // Windows 2000/XP: X2 mouse button
19 KEY_BACK = 0x08, // BACKSPACE key 19 KEY_BACK = 0x08, // BACKSPACE key
20 KEY_TAB = 0x09, // TAB key 20 KEY_TAB = 0x09, // TAB key
21 KEY_CLEAR = 0x0C, // CLEAR key 21 KEY_CLEAR = 0x0C, // CLEAR key
22 KEY_RETURN = 0x0D, // ENTER key 22 KEY_RETURN = 0x0D, // ENTER key
23 KEY_SHIFT = 0x10, // SHIFT key 23 KEY_SHIFT = 0x10, // SHIFT key
24 KEY_CONTROL = 0x11, // CTRL key 24 KEY_CONTROL = 0x11, // CTRL key
25 KEY_MENU = 0x12, // ALT key 25 KEY_MENU = 0x12, // ALT key
26 KEY_PAUSE = 0x13, // PAUSE key 26 KEY_PAUSE = 0x13, // PAUSE key
27 KEY_CAPITAL = 0x14, // CAPS LOCK key 27 KEY_CAPITAL = 0x14, // CAPS LOCK key
28 KEY_KANA = 0x15, // IME Kana mode 28 KEY_KANA = 0x15, // IME Kana mode
29 KEY_HANGUEL = 0x15, // IME Hanguel mode (maintained for compatibility use KEY_HANGUL) 29 KEY_HANGUEL = 0x15, // IME Hanguel mode (maintained for compatibility use KEY_HANGUL)
30 KEY_HANGUL = 0x15, // IME Hangul mode 30 KEY_HANGUL = 0x15, // IME Hangul mode
31 KEY_JUNJA = 0x17, // IME Junja mode 31 KEY_JUNJA = 0x17, // IME Junja mode
32 KEY_FINAL = 0x18, // IME final mode 32 KEY_FINAL = 0x18, // IME final mode
33 KEY_HANJA = 0x19, // IME Hanja mode 33 KEY_HANJA = 0x19, // IME Hanja mode
34 KEY_KANJI = 0x19, // IME Kanji mode 34 KEY_KANJI = 0x19, // IME Kanji mode
35 KEY_ESCAPE = 0x1B, // ESC key 35 KEY_ESCAPE = 0x1B, // ESC key
36 KEY_CONVERT = 0x1C, // IME convert 36 KEY_CONVERT = 0x1C, // IME convert
37 KEY_NONCONVERT = 0x1D, // IME nonconvert 37 KEY_NONCONVERT = 0x1D, // IME nonconvert
38 KEY_ACCEPT = 0x1E, // IME accept 38 KEY_ACCEPT = 0x1E, // IME accept
39 KEY_MODECHANGE = 0x1F, // IME mode change request 39 KEY_MODECHANGE = 0x1F, // IME mode change request
40 KEY_SPACE = 0x20, // SPACEBAR 40 KEY_SPACE = 0x20, // SPACEBAR
41 KEY_PRIOR = 0x21, // PAGE UP key 41 KEY_PRIOR = 0x21, // PAGE UP key
42 KEY_NEXT = 0x22, // PAGE DOWN key 42 KEY_NEXT = 0x22, // PAGE DOWN key
43 KEY_END = 0x23, // END key 43 KEY_END = 0x23, // END key
44 KEY_HOME = 0x24, // HOME key 44 KEY_HOME = 0x24, // HOME key
45 KEY_LEFT = 0x25, // LEFT ARROW key 45 KEY_LEFT = 0x25, // LEFT ARROW key
46 KEY_UP = 0x26, // UP ARROW key 46 KEY_UP = 0x26, // UP ARROW key
47 KEY_RIGHT = 0x27, // RIGHT ARROW key 47 KEY_RIGHT = 0x27, // RIGHT ARROW key
48 KEY_DOWN = 0x28, // DOWN ARROW key 48 KEY_DOWN = 0x28, // DOWN ARROW key
49 KEY_SELECT = 0x29, // SELECT key 49 KEY_SELECT = 0x29, // SELECT key
50 KEY_PRINT = 0x2A, // PRINT key 50 KEY_PRINT = 0x2A, // PRINT key
51 KEY_EXECUT = 0x2B, // EXECUTE key 51 KEY_EXECUT = 0x2B, // EXECUTE key
52 KEY_SNAPSHOT = 0x2C, // PRINT SCREEN key 52 KEY_SNAPSHOT = 0x2C, // PRINT SCREEN key
53 KEY_INSERT = 0x2D, // INS key 53 KEY_INSERT = 0x2D, // INS key
54 KEY_DELETE = 0x2E, // DEL key 54 KEY_DELETE = 0x2E, // DEL key
55 KEY_HELP = 0x2F, // HELP key 55 KEY_HELP = 0x2F, // HELP key
56 KEY_KEY_0 = 0x30, // 0 key 56 KEY_KEY_0 = 0x30, // 0 key
57 KEY_KEY_1 = 0x31, // 1 key 57 KEY_KEY_1 = 0x31, // 1 key
58 KEY_KEY_2 = 0x32, // 2 key 58 KEY_KEY_2 = 0x32, // 2 key
59 KEY_KEY_3 = 0x33, // 3 key 59 KEY_KEY_3 = 0x33, // 3 key
60 KEY_KEY_4 = 0x34, // 4 key 60 KEY_KEY_4 = 0x34, // 4 key
61 KEY_KEY_5 = 0x35, // 5 key 61 KEY_KEY_5 = 0x35, // 5 key
62 KEY_KEY_6 = 0x36, // 6 key 62 KEY_KEY_6 = 0x36, // 6 key
63 KEY_KEY_7 = 0x37, // 7 key 63 KEY_KEY_7 = 0x37, // 7 key
64 KEY_KEY_8 = 0x38, // 8 key 64 KEY_KEY_8 = 0x38, // 8 key
65 KEY_KEY_9 = 0x39, // 9 key 65 KEY_KEY_9 = 0x39, // 9 key
66 KEY_KEY_A = 0x41, // A key 66 KEY_KEY_A = 0x41, // A key
67 KEY_KEY_B = 0x42, // B key 67 KEY_KEY_B = 0x42, // B key
68 KEY_KEY_C = 0x43, // C key 68 KEY_KEY_C = 0x43, // C key
69 KEY_KEY_D = 0x44, // D key 69 KEY_KEY_D = 0x44, // D key
70 KEY_KEY_E = 0x45, // E key 70 KEY_KEY_E = 0x45, // E key
71 KEY_KEY_F = 0x46, // F key 71 KEY_KEY_F = 0x46, // F key
72 KEY_KEY_G = 0x47, // G key 72 KEY_KEY_G = 0x47, // G key
73 KEY_KEY_H = 0x48, // H key 73 KEY_KEY_H = 0x48, // H key
74 KEY_KEY_I = 0x49, // I key 74 KEY_KEY_I = 0x49, // I key
75 KEY_KEY_J = 0x4A, // J key 75 KEY_KEY_J = 0x4A, // J key
76 KEY_KEY_K = 0x4B, // K key 76 KEY_KEY_K = 0x4B, // K key
77 KEY_KEY_L = 0x4C, // L key 77 KEY_KEY_L = 0x4C, // L key
78 KEY_KEY_M = 0x4D, // M key 78 KEY_KEY_M = 0x4D, // M key
79 KEY_KEY_N = 0x4E, // N key 79 KEY_KEY_N = 0x4E, // N key
80 KEY_KEY_O = 0x4F, // O key 80 KEY_KEY_O = 0x4F, // O key
81 KEY_KEY_P = 0x50, // P key 81 KEY_KEY_P = 0x50, // P key
82 KEY_KEY_Q = 0x51, // Q key 82 KEY_KEY_Q = 0x51, // Q key
83 KEY_KEY_R = 0x52, // R key 83 KEY_KEY_R = 0x52, // R key
84 KEY_KEY_S = 0x53, // S key 84 KEY_KEY_S = 0x53, // S key
85 KEY_KEY_T = 0x54, // T key 85 KEY_KEY_T = 0x54, // T key
86 KEY_KEY_U = 0x55, // U key 86 KEY_KEY_U = 0x55, // U key
87 KEY_KEY_V = 0x56, // V key 87 KEY_KEY_V = 0x56, // V key
88 KEY_KEY_W = 0x57, // W key 88 KEY_KEY_W = 0x57, // W key
89 KEY_KEY_X = 0x58, // X key 89 KEY_KEY_X = 0x58, // X key
90 KEY_KEY_Y = 0x59, // Y key 90 KEY_KEY_Y = 0x59, // Y key
91 KEY_KEY_Z = 0x5A, // Z key 91 KEY_KEY_Z = 0x5A, // Z key
92 KEY_LWIN = 0x5B, // Left Windows key (Microsoft® Natural® keyboard) 92 KEY_LWIN = 0x5B, // Left Windows key (Microsoft® Natural® keyboard)
93 KEY_RWIN = 0x5C, // Right Windows key (Natural keyboard) 93 KEY_RWIN = 0x5C, // Right Windows key (Natural keyboard)
94 KEY_APPS = 0x5D, // Applications key (Natural keyboard) 94 KEY_APPS = 0x5D, // Applications key (Natural keyboard)
95 KEY_SLEEP = 0x5F, // Computer Sleep key 95 KEY_SLEEP = 0x5F, // Computer Sleep key
96 KEY_NUMPAD0 = 0x60, // Numeric keypad 0 key 96 KEY_NUMPAD0 = 0x60, // Numeric keypad 0 key
97 KEY_NUMPAD1 = 0x61, // Numeric keypad 1 key 97 KEY_NUMPAD1 = 0x61, // Numeric keypad 1 key
98 KEY_NUMPAD2 = 0x62, // Numeric keypad 2 key 98 KEY_NUMPAD2 = 0x62, // Numeric keypad 2 key
99 KEY_NUMPAD3 = 0x63, // Numeric keypad 3 key 99 KEY_NUMPAD3 = 0x63, // Numeric keypad 3 key
100 KEY_NUMPAD4 = 0x64, // Numeric keypad 4 key 100 KEY_NUMPAD4 = 0x64, // Numeric keypad 4 key
101 KEY_NUMPAD5 = 0x65, // Numeric keypad 5 key 101 KEY_NUMPAD5 = 0x65, // Numeric keypad 5 key
102 KEY_NUMPAD6 = 0x66, // Numeric keypad 6 key 102 KEY_NUMPAD6 = 0x66, // Numeric keypad 6 key
103 KEY_NUMPAD7 = 0x67, // Numeric keypad 7 key 103 KEY_NUMPAD7 = 0x67, // Numeric keypad 7 key
104 KEY_NUMPAD8 = 0x68, // Numeric keypad 8 key 104 KEY_NUMPAD8 = 0x68, // Numeric keypad 8 key
105 KEY_NUMPAD9 = 0x69, // Numeric keypad 9 key 105 KEY_NUMPAD9 = 0x69, // Numeric keypad 9 key
106 KEY_MULTIPLY = 0x6A, // Multiply key 106 KEY_MULTIPLY = 0x6A, // Multiply key
107 KEY_ADD = 0x6B, // Add key 107 KEY_ADD = 0x6B, // Add key
108 KEY_SEPARATOR = 0x6C, // Separator key 108 KEY_SEPARATOR = 0x6C, // Separator key
109 KEY_SUBTRACT = 0x6D, // Subtract key 109 KEY_SUBTRACT = 0x6D, // Subtract key
110 KEY_DECIMAL = 0x6E, // Decimal key 110 KEY_DECIMAL = 0x6E, // Decimal key
111 KEY_DIVIDE = 0x6F, // Divide key 111 KEY_DIVIDE = 0x6F, // Divide key
112 KEY_F1 = 0x70, // F1 key 112 KEY_F1 = 0x70, // F1 key
113 KEY_F2 = 0x71, // F2 key 113 KEY_F2 = 0x71, // F2 key
114 KEY_F3 = 0x72, // F3 key 114 KEY_F3 = 0x72, // F3 key
115 KEY_F4 = 0x73, // F4 key 115 KEY_F4 = 0x73, // F4 key
116 KEY_F5 = 0x74, // F5 key 116 KEY_F5 = 0x74, // F5 key
117 KEY_F6 = 0x75, // F6 key 117 KEY_F6 = 0x75, // F6 key
118 KEY_F7 = 0x76, // F7 key 118 KEY_F7 = 0x76, // F7 key
119 KEY_F8 = 0x77, // F8 key 119 KEY_F8 = 0x77, // F8 key
120 KEY_F9 = 0x78, // F9 key 120 KEY_F9 = 0x78, // F9 key
121 KEY_F10 = 0x79, // F10 key 121 KEY_F10 = 0x79, // F10 key
122 KEY_F11 = 0x7A, // F11 key 122 KEY_F11 = 0x7A, // F11 key
123 KEY_F12 = 0x7B, // F12 key 123 KEY_F12 = 0x7B, // F12 key
124 KEY_F13 = 0x7C, // F13 key 124 KEY_F13 = 0x7C, // F13 key
125 KEY_F14 = 0x7D, // F14 key 125 KEY_F14 = 0x7D, // F14 key
126 KEY_F15 = 0x7E, // F15 key 126 KEY_F15 = 0x7E, // F15 key
127 KEY_F16 = 0x7F, // F16 key 127 KEY_F16 = 0x7F, // F16 key
128 KEY_F17 = 0x80, // F17 key 128 KEY_F17 = 0x80, // F17 key
129 KEY_F18 = 0x81, // F18 key 129 KEY_F18 = 0x81, // F18 key
130 KEY_F19 = 0x82, // F19 key 130 KEY_F19 = 0x82, // F19 key
131 KEY_F20 = 0x83, // F20 key 131 KEY_F20 = 0x83, // F20 key
132 KEY_F21 = 0x84, // F21 key 132 KEY_F21 = 0x84, // F21 key
133 KEY_F22 = 0x85, // F22 key 133 KEY_F22 = 0x85, // F22 key
134 KEY_F23 = 0x86, // F23 key 134 KEY_F23 = 0x86, // F23 key
135 KEY_F24 = 0x87, // F24 key 135 KEY_F24 = 0x87, // F24 key
136 KEY_NUMLOCK = 0x90, // NUM LOCK key 136 KEY_NUMLOCK = 0x90, // NUM LOCK key
137 KEY_SCROLL = 0x91, // SCROLL LOCK key 137 KEY_SCROLL = 0x91, // SCROLL LOCK key
138 KEY_LSHIFT = 0xA0, // Left SHIFT key 138 KEY_LSHIFT = 0xA0, // Left SHIFT key
139 KEY_RSHIFT = 0xA1, // Right SHIFT key 139 KEY_RSHIFT = 0xA1, // Right SHIFT key
140 KEY_LCONTROL = 0xA2, // Left CONTROL key 140 KEY_LCONTROL = 0xA2, // Left CONTROL key
141 KEY_RCONTROL = 0xA3, // Right CONTROL key 141 KEY_RCONTROL = 0xA3, // Right CONTROL key
142 KEY_LMENU = 0xA4, // Left MENU key 142 KEY_LMENU = 0xA4, // Left MENU key
143 KEY_RMENU = 0xA5, // Right MENU key 143 KEY_RMENU = 0xA5, // Right MENU key
144 KEY_OEM_1 = 0xBA, // for US ";:" 144 KEY_OEM_1 = 0xBA, // for US ";:"
145 KEY_PLUS = 0xBB, // Plus Key "+" 145 KEY_PLUS = 0xBB, // Plus Key "+"
146 KEY_COMMA = 0xBC, // Comma Key "," 146 KEY_COMMA = 0xBC, // Comma Key ","
147 KEY_MINUS = 0xBD, // Minus Key "-" 147 KEY_MINUS = 0xBD, // Minus Key "-"
148 KEY_PERIOD = 0xBE, // Period Key "." 148 KEY_PERIOD = 0xBE, // Period Key "."
149 KEY_OEM_2 = 0xBF, // for US "/?" 149 KEY_OEM_2 = 0xBF, // for US "/?"
150 KEY_OEM_3 = 0xC0, // for US "`~" 150 KEY_OEM_3 = 0xC0, // for US "`~"
151 KEY_OEM_4 = 0xDB, // for US "[{" 151 KEY_OEM_4 = 0xDB, // for US "[{"
152 KEY_OEM_5 = 0xDC, // for US "\|" 152 KEY_OEM_5 = 0xDC, // for US "\|"
153 KEY_OEM_6 = 0xDD, // for US "]}" 153 KEY_OEM_6 = 0xDD, // for US "]}"
154 KEY_OEM_7 = 0xDE, // for US "'"" 154 KEY_OEM_7 = 0xDE, // for US "'""
155 KEY_OEM_8 = 0xDF, // None 155 KEY_OEM_8 = 0xDF, // None
156 KEY_OEM_AX = 0xE1, // for Japan "AX" 156 KEY_OEM_AX = 0xE1, // for Japan "AX"
157 KEY_OEM_102 = 0xE2, // "<>" or "\|" 157 KEY_OEM_102 = 0xE2, // "<>" or "\|"
158 KEY_ATTN = 0xF6, // Attn key 158 KEY_ATTN = 0xF6, // Attn key
159 KEY_CRSEL = 0xF7, // CrSel key 159 KEY_CRSEL = 0xF7, // CrSel key
160 KEY_EXSEL = 0xF8, // ExSel key 160 KEY_EXSEL = 0xF8, // ExSel key
161 KEY_EREOF = 0xF9, // Erase EOF key 161 KEY_EREOF = 0xF9, // Erase EOF key
162 KEY_PLAY = 0xFA, // Play key 162 KEY_PLAY = 0xFA, // Play key
163 KEY_ZOOM = 0xFB, // Zoom key 163 KEY_ZOOM = 0xFB, // Zoom key
164 KEY_PA1 = 0xFD, // PA1 key 164 KEY_PA1 = 0xFD, // PA1 key
165 KEY_OEM_CLEAR = 0xFE, // Clear key 165 KEY_OEM_CLEAR = 0xFE, // Clear key
166 166
167 KEY_KEY_CODES_COUNT = 0xFF // this is not a key, but the amount of keycodes there are. 167 KEY_KEY_CODES_COUNT = 0xFF // this is not a key, but the amount of keycodes there are.
168 }; 168 };
169 169
170} // end namespace irr 170} // end namespace irr
171 171
172#endif 172#endif
173 173
diff --git a/libraries/irrlicht-1.8/include/S3DVertex.h b/libraries/irrlicht-1.8/include/S3DVertex.h
index bf0fd5b..706cf4b 100644
--- a/libraries/irrlicht-1.8/include/S3DVertex.h
+++ b/libraries/irrlicht-1.8/include/S3DVertex.h
@@ -1,274 +1,274 @@
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#ifndef __S_3D_VERTEX_H_INCLUDED__ 5#ifndef __S_3D_VERTEX_H_INCLUDED__
6#define __S_3D_VERTEX_H_INCLUDED__ 6#define __S_3D_VERTEX_H_INCLUDED__
7 7
8#include "vector3d.h" 8#include "vector3d.h"
9#include "vector2d.h" 9#include "vector2d.h"
10#include "SColor.h" 10#include "SColor.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace video 14namespace video
15{ 15{
16 16
17//! Enumeration for all vertex types there are. 17//! Enumeration for all vertex types there are.
18enum E_VERTEX_TYPE 18enum E_VERTEX_TYPE
19{ 19{
20 //! Standard vertex type used by the Irrlicht engine, video::S3DVertex. 20 //! Standard vertex type used by the Irrlicht engine, video::S3DVertex.
21 EVT_STANDARD = 0, 21 EVT_STANDARD = 0,
22 22
23 //! Vertex with two texture coordinates, video::S3DVertex2TCoords. 23 //! Vertex with two texture coordinates, video::S3DVertex2TCoords.
24 /** Usually used for geometry with lightmaps or other special materials. */ 24 /** Usually used for geometry with lightmaps or other special materials. */
25 EVT_2TCOORDS, 25 EVT_2TCOORDS,
26 26
27 //! Vertex with a tangent and binormal vector, video::S3DVertexTangents. 27 //! Vertex with a tangent and binormal vector, video::S3DVertexTangents.
28 /** Usually used for tangent space normal mapping. */ 28 /** Usually used for tangent space normal mapping. */
29 EVT_TANGENTS 29 EVT_TANGENTS
30}; 30};
31 31
32//! Array holding the built in vertex type names 32//! Array holding the built in vertex type names
33const char* const sBuiltInVertexTypeNames[] = 33const char* const sBuiltInVertexTypeNames[] =
34{ 34{
35 "standard", 35 "standard",
36 "2tcoords", 36 "2tcoords",
37 "tangents", 37 "tangents",
38 0 38 0
39}; 39};
40 40
41//! standard vertex used by the Irrlicht engine. 41//! standard vertex used by the Irrlicht engine.
42struct S3DVertex 42struct S3DVertex
43{ 43{
44 //! default constructor 44 //! default constructor
45 S3DVertex() {} 45 S3DVertex() {}
46 46
47 //! constructor 47 //! constructor
48 S3DVertex(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv) 48 S3DVertex(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv)
49 : Pos(x,y,z), Normal(nx,ny,nz), Color(c), TCoords(tu,tv) {} 49 : Pos(x,y,z), Normal(nx,ny,nz), Color(c), TCoords(tu,tv) {}
50 50
51 //! constructor 51 //! constructor
52 S3DVertex(const core::vector3df& pos, const core::vector3df& normal, 52 S3DVertex(const core::vector3df& pos, const core::vector3df& normal,
53 SColor color, const core::vector2d<f32>& tcoords) 53 SColor color, const core::vector2d<f32>& tcoords)
54 : Pos(pos), Normal(normal), Color(color), TCoords(tcoords) {} 54 : Pos(pos), Normal(normal), Color(color), TCoords(tcoords) {}
55 55
56 //! Position 56 //! Position
57 core::vector3df Pos; 57 core::vector3df Pos;
58 58
59 //! Normal vector 59 //! Normal vector
60 core::vector3df Normal; 60 core::vector3df Normal;
61 61
62 //! Color 62 //! Color
63 SColor Color; 63 SColor Color;
64 64
65 //! Texture coordinates 65 //! Texture coordinates
66 core::vector2d<f32> TCoords; 66 core::vector2d<f32> TCoords;
67 67
68 bool operator==(const S3DVertex& other) const 68 bool operator==(const S3DVertex& other) const
69 { 69 {
70 return ((Pos == other.Pos) && (Normal == other.Normal) && 70 return ((Pos == other.Pos) && (Normal == other.Normal) &&
71 (Color == other.Color) && (TCoords == other.TCoords)); 71 (Color == other.Color) && (TCoords == other.TCoords));
72 } 72 }
73 73
74 bool operator!=(const S3DVertex& other) const 74 bool operator!=(const S3DVertex& other) const
75 { 75 {
76 return ((Pos != other.Pos) || (Normal != other.Normal) || 76 return ((Pos != other.Pos) || (Normal != other.Normal) ||
77 (Color != other.Color) || (TCoords != other.TCoords)); 77 (Color != other.Color) || (TCoords != other.TCoords));
78 } 78 }
79 79
80 bool operator<(const S3DVertex& other) const 80 bool operator<(const S3DVertex& other) const
81 { 81 {
82 return ((Pos < other.Pos) || 82 return ((Pos < other.Pos) ||
83 ((Pos == other.Pos) && (Normal < other.Normal)) || 83 ((Pos == other.Pos) && (Normal < other.Normal)) ||
84 ((Pos == other.Pos) && (Normal == other.Normal) && (Color < other.Color)) || 84 ((Pos == other.Pos) && (Normal == other.Normal) && (Color < other.Color)) ||
85 ((Pos == other.Pos) && (Normal == other.Normal) && (Color == other.Color) && (TCoords < other.TCoords))); 85 ((Pos == other.Pos) && (Normal == other.Normal) && (Color == other.Color) && (TCoords < other.TCoords)));
86 } 86 }
87 87
88 E_VERTEX_TYPE getType() const 88 E_VERTEX_TYPE getType() const
89 { 89 {
90 return EVT_STANDARD; 90 return EVT_STANDARD;
91 } 91 }
92 92
93 S3DVertex getInterpolated(const S3DVertex& other, f32 d) 93 S3DVertex getInterpolated(const S3DVertex& other, f32 d)
94 { 94 {
95 d = core::clamp(d, 0.0f, 1.0f); 95 d = core::clamp(d, 0.0f, 1.0f);
96 return S3DVertex(Pos.getInterpolated(other.Pos, d), 96 return S3DVertex(Pos.getInterpolated(other.Pos, d),
97 Normal.getInterpolated(other.Normal, d), 97 Normal.getInterpolated(other.Normal, d),
98 Color.getInterpolated(other.Color, d), 98 Color.getInterpolated(other.Color, d),
99 TCoords.getInterpolated(other.TCoords, d)); 99 TCoords.getInterpolated(other.TCoords, d));
100 } 100 }
101}; 101};
102 102
103 103
104//! Vertex with two texture coordinates. 104//! Vertex with two texture coordinates.
105/** Usually used for geometry with lightmaps 105/** Usually used for geometry with lightmaps
106or other special materials. 106or other special materials.
107*/ 107*/
108struct S3DVertex2TCoords : public S3DVertex 108struct S3DVertex2TCoords : public S3DVertex
109{ 109{
110 //! default constructor 110 //! default constructor
111 S3DVertex2TCoords() : S3DVertex() {} 111 S3DVertex2TCoords() : S3DVertex() {}
112 112
113 //! constructor with two different texture coords, but no normal 113 //! constructor with two different texture coords, but no normal
114 S3DVertex2TCoords(f32 x, f32 y, f32 z, SColor c, f32 tu, f32 tv, f32 tu2, f32 tv2) 114 S3DVertex2TCoords(f32 x, f32 y, f32 z, SColor c, f32 tu, f32 tv, f32 tu2, f32 tv2)
115 : S3DVertex(x,y,z, 0.0f, 0.0f, 0.0f, c, tu,tv), TCoords2(tu2,tv2) {} 115 : S3DVertex(x,y,z, 0.0f, 0.0f, 0.0f, c, tu,tv), TCoords2(tu2,tv2) {}
116 116
117 //! constructor with two different texture coords, but no normal 117 //! constructor with two different texture coords, but no normal
118 S3DVertex2TCoords(const core::vector3df& pos, SColor color, 118 S3DVertex2TCoords(const core::vector3df& pos, SColor color,
119 const core::vector2d<f32>& tcoords, const core::vector2d<f32>& tcoords2) 119 const core::vector2d<f32>& tcoords, const core::vector2d<f32>& tcoords2)
120 : S3DVertex(pos, core::vector3df(), color, tcoords), TCoords2(tcoords2) {} 120 : S3DVertex(pos, core::vector3df(), color, tcoords), TCoords2(tcoords2) {}
121 121
122 //! constructor with all values 122 //! constructor with all values
123 S3DVertex2TCoords(const core::vector3df& pos, const core::vector3df& normal, const SColor& color, 123 S3DVertex2TCoords(const core::vector3df& pos, const core::vector3df& normal, const SColor& color,
124 const core::vector2d<f32>& tcoords, const core::vector2d<f32>& tcoords2) 124 const core::vector2d<f32>& tcoords, const core::vector2d<f32>& tcoords2)
125 : S3DVertex(pos, normal, color, tcoords), TCoords2(tcoords2) {} 125 : S3DVertex(pos, normal, color, tcoords), TCoords2(tcoords2) {}
126 126
127 //! constructor with all values 127 //! constructor with all values
128 S3DVertex2TCoords(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv, f32 tu2, f32 tv2) 128 S3DVertex2TCoords(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv, f32 tu2, f32 tv2)
129 : S3DVertex(x,y,z, nx,ny,nz, c, tu,tv), TCoords2(tu2,tv2) {} 129 : S3DVertex(x,y,z, nx,ny,nz, c, tu,tv), TCoords2(tu2,tv2) {}
130 130
131 //! constructor with the same texture coords and normal 131 //! constructor with the same texture coords and normal
132 S3DVertex2TCoords(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv) 132 S3DVertex2TCoords(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv)
133 : S3DVertex(x,y,z, nx,ny,nz, c, tu,tv), TCoords2(tu,tv) {} 133 : S3DVertex(x,y,z, nx,ny,nz, c, tu,tv), TCoords2(tu,tv) {}
134 134
135 //! constructor with the same texture coords and normal 135 //! constructor with the same texture coords and normal
136 S3DVertex2TCoords(const core::vector3df& pos, const core::vector3df& normal, 136 S3DVertex2TCoords(const core::vector3df& pos, const core::vector3df& normal,
137 SColor color, const core::vector2d<f32>& tcoords) 137 SColor color, const core::vector2d<f32>& tcoords)
138 : S3DVertex(pos, normal, color, tcoords), TCoords2(tcoords) {} 138 : S3DVertex(pos, normal, color, tcoords), TCoords2(tcoords) {}
139 139
140 //! constructor from S3DVertex 140 //! constructor from S3DVertex
141 S3DVertex2TCoords(S3DVertex& o) : S3DVertex(o) {} 141 S3DVertex2TCoords(S3DVertex& o) : S3DVertex(o) {}
142 142
143 //! Second set of texture coordinates 143 //! Second set of texture coordinates
144 core::vector2d<f32> TCoords2; 144 core::vector2d<f32> TCoords2;
145 145
146 //! Equality operator 146 //! Equality operator
147 bool operator==(const S3DVertex2TCoords& other) const 147 bool operator==(const S3DVertex2TCoords& other) const
148 { 148 {
149 return ((static_cast<S3DVertex>(*this)==other) && 149 return ((static_cast<S3DVertex>(*this)==other) &&
150 (TCoords2 == other.TCoords2)); 150 (TCoords2 == other.TCoords2));
151 } 151 }
152 152
153 //! Inequality operator 153 //! Inequality operator
154 bool operator!=(const S3DVertex2TCoords& other) const 154 bool operator!=(const S3DVertex2TCoords& other) const
155 { 155 {
156 return ((static_cast<S3DVertex>(*this)!=other) || 156 return ((static_cast<S3DVertex>(*this)!=other) ||
157 (TCoords2 != other.TCoords2)); 157 (TCoords2 != other.TCoords2));
158 } 158 }
159 159
160 bool operator<(const S3DVertex2TCoords& other) const 160 bool operator<(const S3DVertex2TCoords& other) const
161 { 161 {
162 return ((static_cast<S3DVertex>(*this) < other) || 162 return ((static_cast<S3DVertex>(*this) < other) ||
163 ((static_cast<S3DVertex>(*this) == other) && (TCoords2 < other.TCoords2))); 163 ((static_cast<S3DVertex>(*this) == other) && (TCoords2 < other.TCoords2)));
164 } 164 }
165 165
166 E_VERTEX_TYPE getType() const 166 E_VERTEX_TYPE getType() const
167 { 167 {
168 return EVT_2TCOORDS; 168 return EVT_2TCOORDS;
169 } 169 }
170 170
171 S3DVertex2TCoords getInterpolated(const S3DVertex2TCoords& other, f32 d) 171 S3DVertex2TCoords getInterpolated(const S3DVertex2TCoords& other, f32 d)
172 { 172 {
173 d = core::clamp(d, 0.0f, 1.0f); 173 d = core::clamp(d, 0.0f, 1.0f);
174 return S3DVertex2TCoords(Pos.getInterpolated(other.Pos, d), 174 return S3DVertex2TCoords(Pos.getInterpolated(other.Pos, d),
175 Normal.getInterpolated(other.Normal, d), 175 Normal.getInterpolated(other.Normal, d),
176 Color.getInterpolated(other.Color, d), 176 Color.getInterpolated(other.Color, d),
177 TCoords.getInterpolated(other.TCoords, d), 177 TCoords.getInterpolated(other.TCoords, d),
178 TCoords2.getInterpolated(other.TCoords2, d)); 178 TCoords2.getInterpolated(other.TCoords2, d));
179 } 179 }
180}; 180};
181 181
182 182
183//! Vertex with a tangent and binormal vector. 183//! Vertex with a tangent and binormal vector.
184/** Usually used for tangent space normal mapping. */ 184/** Usually used for tangent space normal mapping. */
185struct S3DVertexTangents : public S3DVertex 185struct S3DVertexTangents : public S3DVertex
186{ 186{
187 //! default constructor 187 //! default constructor
188 S3DVertexTangents() : S3DVertex() { } 188 S3DVertexTangents() : S3DVertex() { }
189 189
190 //! constructor 190 //! constructor
191 S3DVertexTangents(f32 x, f32 y, f32 z, f32 nx=0.0f, f32 ny=0.0f, f32 nz=0.0f, 191 S3DVertexTangents(f32 x, f32 y, f32 z, f32 nx=0.0f, f32 ny=0.0f, f32 nz=0.0f,
192 SColor c = 0xFFFFFFFF, f32 tu=0.0f, f32 tv=0.0f, 192 SColor c = 0xFFFFFFFF, f32 tu=0.0f, f32 tv=0.0f,
193 f32 tanx=0.0f, f32 tany=0.0f, f32 tanz=0.0f, 193 f32 tanx=0.0f, f32 tany=0.0f, f32 tanz=0.0f,
194 f32 bx=0.0f, f32 by=0.0f, f32 bz=0.0f) 194 f32 bx=0.0f, f32 by=0.0f, f32 bz=0.0f)
195 : S3DVertex(x,y,z, nx,ny,nz, c, tu,tv), Tangent(tanx,tany,tanz), Binormal(bx,by,bz) { } 195 : S3DVertex(x,y,z, nx,ny,nz, c, tu,tv), Tangent(tanx,tany,tanz), Binormal(bx,by,bz) { }
196 196
197 //! constructor 197 //! constructor
198 S3DVertexTangents(const core::vector3df& pos, SColor c, 198 S3DVertexTangents(const core::vector3df& pos, SColor c,
199 const core::vector2df& tcoords) 199 const core::vector2df& tcoords)
200 : S3DVertex(pos, core::vector3df(), c, tcoords) { } 200 : S3DVertex(pos, core::vector3df(), c, tcoords) { }
201 201
202 //! constructor 202 //! constructor
203 S3DVertexTangents(const core::vector3df& pos, 203 S3DVertexTangents(const core::vector3df& pos,
204 const core::vector3df& normal, SColor c, 204 const core::vector3df& normal, SColor c,
205 const core::vector2df& tcoords, 205 const core::vector2df& tcoords,
206 const core::vector3df& tangent=core::vector3df(), 206 const core::vector3df& tangent=core::vector3df(),
207 const core::vector3df& binormal=core::vector3df()) 207 const core::vector3df& binormal=core::vector3df())
208 : S3DVertex(pos, normal, c, tcoords), Tangent(tangent), Binormal(binormal) { } 208 : S3DVertex(pos, normal, c, tcoords), Tangent(tangent), Binormal(binormal) { }
209 209
210 //! Tangent vector along the x-axis of the texture 210 //! Tangent vector along the x-axis of the texture
211 core::vector3df Tangent; 211 core::vector3df Tangent;
212 212
213 //! Binormal vector (tangent x normal) 213 //! Binormal vector (tangent x normal)
214 core::vector3df Binormal; 214 core::vector3df Binormal;
215 215
216 bool operator==(const S3DVertexTangents& other) const 216 bool operator==(const S3DVertexTangents& other) const
217 { 217 {
218 return ((static_cast<S3DVertex>(*this)==other) && 218 return ((static_cast<S3DVertex>(*this)==other) &&
219 (Tangent == other.Tangent) && 219 (Tangent == other.Tangent) &&
220 (Binormal == other.Binormal)); 220 (Binormal == other.Binormal));
221 } 221 }
222 222
223 bool operator!=(const S3DVertexTangents& other) const 223 bool operator!=(const S3DVertexTangents& other) const
224 { 224 {
225 return ((static_cast<S3DVertex>(*this)!=other) || 225 return ((static_cast<S3DVertex>(*this)!=other) ||
226 (Tangent != other.Tangent) || 226 (Tangent != other.Tangent) ||
227 (Binormal != other.Binormal)); 227 (Binormal != other.Binormal));
228 } 228 }
229 229
230 bool operator<(const S3DVertexTangents& other) const 230 bool operator<(const S3DVertexTangents& other) const
231 { 231 {
232 return ((static_cast<S3DVertex>(*this) < other) || 232 return ((static_cast<S3DVertex>(*this) < other) ||
233 ((static_cast<S3DVertex>(*this) == other) && (Tangent < other.Tangent)) || 233 ((static_cast<S3DVertex>(*this) == other) && (Tangent < other.Tangent)) ||
234 ((static_cast<S3DVertex>(*this) == other) && (Tangent == other.Tangent) && (Binormal < other.Binormal))); 234 ((static_cast<S3DVertex>(*this) == other) && (Tangent == other.Tangent) && (Binormal < other.Binormal)));
235 } 235 }
236 236
237 E_VERTEX_TYPE getType() const 237 E_VERTEX_TYPE getType() const
238 { 238 {
239 return EVT_TANGENTS; 239 return EVT_TANGENTS;
240 } 240 }
241 241
242 S3DVertexTangents getInterpolated(const S3DVertexTangents& other, f32 d) 242 S3DVertexTangents getInterpolated(const S3DVertexTangents& other, f32 d)
243 { 243 {
244 d = core::clamp(d, 0.0f, 1.0f); 244 d = core::clamp(d, 0.0f, 1.0f);
245 return S3DVertexTangents(Pos.getInterpolated(other.Pos, d), 245 return S3DVertexTangents(Pos.getInterpolated(other.Pos, d),
246 Normal.getInterpolated(other.Normal, d), 246 Normal.getInterpolated(other.Normal, d),
247 Color.getInterpolated(other.Color, d), 247 Color.getInterpolated(other.Color, d),
248 TCoords.getInterpolated(other.TCoords, d), 248 TCoords.getInterpolated(other.TCoords, d),
249 Tangent.getInterpolated(other.Tangent, d), 249 Tangent.getInterpolated(other.Tangent, d),
250 Binormal.getInterpolated(other.Binormal, d)); 250 Binormal.getInterpolated(other.Binormal, d));
251 } 251 }
252}; 252};
253 253
254 254
255 255
256inline u32 getVertexPitchFromType(E_VERTEX_TYPE vertexType) 256inline u32 getVertexPitchFromType(E_VERTEX_TYPE vertexType)
257{ 257{
258 switch (vertexType) 258 switch (vertexType)
259 { 259 {
260 case video::EVT_2TCOORDS: 260 case video::EVT_2TCOORDS:
261 return sizeof(video::S3DVertex2TCoords); 261 return sizeof(video::S3DVertex2TCoords);
262 case video::EVT_TANGENTS: 262 case video::EVT_TANGENTS:
263 return sizeof(video::S3DVertexTangents); 263 return sizeof(video::S3DVertexTangents);
264 default: 264 default:
265 return sizeof(video::S3DVertex); 265 return sizeof(video::S3DVertex);
266 } 266 }
267} 267}
268 268
269 269
270} // end namespace video 270} // end namespace video
271} // end namespace irr 271} // end namespace irr
272 272
273#endif 273#endif
274 274
diff --git a/libraries/irrlicht-1.8/include/SAnimatedMesh.h b/libraries/irrlicht-1.8/include/SAnimatedMesh.h
index ced4060..f962f30 100644
--- a/libraries/irrlicht-1.8/include/SAnimatedMesh.h
+++ b/libraries/irrlicht-1.8/include/SAnimatedMesh.h
@@ -1,189 +1,189 @@
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#ifndef __S_ANIMATED_MESH_H_INCLUDED__ 5#ifndef __S_ANIMATED_MESH_H_INCLUDED__
6#define __S_ANIMATED_MESH_H_INCLUDED__ 6#define __S_ANIMATED_MESH_H_INCLUDED__
7 7
8#include "IAnimatedMesh.h" 8#include "IAnimatedMesh.h"
9#include "IMesh.h" 9#include "IMesh.h"
10#include "aabbox3d.h" 10#include "aabbox3d.h"
11#include "irrArray.h" 11#include "irrArray.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace scene 15namespace scene
16{ 16{
17 17
18 //! Simple implementation of the IAnimatedMesh interface. 18 //! Simple implementation of the IAnimatedMesh interface.
19 struct SAnimatedMesh : public IAnimatedMesh 19 struct SAnimatedMesh : public IAnimatedMesh
20 { 20 {
21 //! constructor 21 //! constructor
22 SAnimatedMesh(scene::IMesh* mesh=0, scene::E_ANIMATED_MESH_TYPE type=scene::EAMT_UNKNOWN) : IAnimatedMesh(), FramesPerSecond(25.f), Type(type) 22 SAnimatedMesh(scene::IMesh* mesh=0, scene::E_ANIMATED_MESH_TYPE type=scene::EAMT_UNKNOWN) : IAnimatedMesh(), FramesPerSecond(25.f), Type(type)
23 { 23 {
24 #ifdef _DEBUG 24 #ifdef _DEBUG
25 setDebugName("SAnimatedMesh"); 25 setDebugName("SAnimatedMesh");
26 #endif 26 #endif
27 addMesh(mesh); 27 addMesh(mesh);
28 recalculateBoundingBox(); 28 recalculateBoundingBox();
29 } 29 }
30 30
31 //! destructor 31 //! destructor
32 virtual ~SAnimatedMesh() 32 virtual ~SAnimatedMesh()
33 { 33 {
34 // drop meshes 34 // drop meshes
35 for (u32 i=0; i<Meshes.size(); ++i) 35 for (u32 i=0; i<Meshes.size(); ++i)
36 Meshes[i]->drop(); 36 Meshes[i]->drop();
37 } 37 }
38 38
39 //! Gets the frame count of the animated mesh. 39 //! Gets the frame count of the animated mesh.
40 /** \return Amount of frames. If the amount is 1, it is a static, non animated mesh. */ 40 /** \return Amount of frames. If the amount is 1, it is a static, non animated mesh. */
41 virtual u32 getFrameCount() const 41 virtual u32 getFrameCount() const
42 { 42 {
43 return Meshes.size(); 43 return Meshes.size();
44 } 44 }
45 45
46 //! Gets the default animation speed of the animated mesh. 46 //! Gets the default animation speed of the animated mesh.
47 /** \return Amount of frames per second. If the amount is 0, it is a static, non animated mesh. */ 47 /** \return Amount of frames per second. If the amount is 0, it is a static, non animated mesh. */
48 virtual f32 getAnimationSpeed() const 48 virtual f32 getAnimationSpeed() const
49 { 49 {
50 return FramesPerSecond; 50 return FramesPerSecond;
51 } 51 }
52 52
53 //! Gets the frame count of the animated mesh. 53 //! Gets the frame count of the animated mesh.
54 /** \param fps Frames per second to play the animation with. If the amount is 0, it is not animated. 54 /** \param fps Frames per second to play the animation with. If the amount is 0, it is not animated.
55 The actual speed is set in the scene node the mesh is instantiated in.*/ 55 The actual speed is set in the scene node the mesh is instantiated in.*/
56 virtual void setAnimationSpeed(f32 fps) 56 virtual void setAnimationSpeed(f32 fps)
57 { 57 {
58 FramesPerSecond=fps; 58 FramesPerSecond=fps;
59 } 59 }
60 60
61 //! Returns the IMesh interface for a frame. 61 //! Returns the IMesh interface for a frame.
62 /** \param frame: Frame number as zero based index. The maximum frame number is 62 /** \param frame: Frame number as zero based index. The maximum frame number is
63 getFrameCount() - 1; 63 getFrameCount() - 1;
64 \param detailLevel: Level of detail. 0 is the lowest, 64 \param detailLevel: Level of detail. 0 is the lowest,
65 255 the highest level of detail. Most meshes will ignore the detail level. 65 255 the highest level of detail. Most meshes will ignore the detail level.
66 \param startFrameLoop: start frame 66 \param startFrameLoop: start frame
67 \param endFrameLoop: end frame 67 \param endFrameLoop: end frame
68 \return The animated mesh based on a detail level. */ 68 \return The animated mesh based on a detail level. */
69 virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) 69 virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1)
70 { 70 {
71 if (Meshes.empty()) 71 if (Meshes.empty())
72 return 0; 72 return 0;
73 73
74 return Meshes[frame]; 74 return Meshes[frame];
75 } 75 }
76 76
77 //! adds a Mesh 77 //! adds a Mesh
78 void addMesh(IMesh* mesh) 78 void addMesh(IMesh* mesh)
79 { 79 {
80 if (mesh) 80 if (mesh)
81 { 81 {
82 mesh->grab(); 82 mesh->grab();
83 Meshes.push_back(mesh); 83 Meshes.push_back(mesh);
84 } 84 }
85 } 85 }
86 86
87 //! Returns an axis aligned bounding box of the mesh. 87 //! Returns an axis aligned bounding box of the mesh.
88 /** \return A bounding box of this mesh is returned. */ 88 /** \return A bounding box of this mesh is returned. */
89 virtual const core::aabbox3d<f32>& getBoundingBox() const 89 virtual const core::aabbox3d<f32>& getBoundingBox() const
90 { 90 {
91 return Box; 91 return Box;
92 } 92 }
93 93
94 //! set user axis aligned bounding box 94 //! set user axis aligned bounding box
95 virtual void setBoundingBox(const core::aabbox3df& box) 95 virtual void setBoundingBox(const core::aabbox3df& box)
96 { 96 {
97 Box = box; 97 Box = box;
98 } 98 }
99 99
100 //! Recalculates the bounding box. 100 //! Recalculates the bounding box.
101 void recalculateBoundingBox() 101 void recalculateBoundingBox()
102 { 102 {
103 Box.reset(0,0,0); 103 Box.reset(0,0,0);
104 104
105 if (Meshes.empty()) 105 if (Meshes.empty())
106 return; 106 return;
107 107
108 Box = Meshes[0]->getBoundingBox(); 108 Box = Meshes[0]->getBoundingBox();
109 109
110 for (u32 i=1; i<Meshes.size(); ++i) 110 for (u32 i=1; i<Meshes.size(); ++i)
111 Box.addInternalBox(Meshes[i]->getBoundingBox()); 111 Box.addInternalBox(Meshes[i]->getBoundingBox());
112 } 112 }
113 113
114 //! Returns the type of the animated mesh. 114 //! Returns the type of the animated mesh.
115 virtual E_ANIMATED_MESH_TYPE getMeshType() const 115 virtual E_ANIMATED_MESH_TYPE getMeshType() const
116 { 116 {
117 return Type; 117 return Type;
118 } 118 }
119 119
120 //! returns amount of mesh buffers. 120 //! returns amount of mesh buffers.
121 virtual u32 getMeshBufferCount() const 121 virtual u32 getMeshBufferCount() const
122 { 122 {
123 if (Meshes.empty()) 123 if (Meshes.empty())
124 return 0; 124 return 0;
125 125
126 return Meshes[0]->getMeshBufferCount(); 126 return Meshes[0]->getMeshBufferCount();
127 } 127 }
128 128
129 //! returns pointer to a mesh buffer 129 //! returns pointer to a mesh buffer
130 virtual IMeshBuffer* getMeshBuffer(u32 nr) const 130 virtual IMeshBuffer* getMeshBuffer(u32 nr) const
131 { 131 {
132 if (Meshes.empty()) 132 if (Meshes.empty())
133 return 0; 133 return 0;
134 134
135 return Meshes[0]->getMeshBuffer(nr); 135 return Meshes[0]->getMeshBuffer(nr);
136 } 136 }
137 137
138 //! Returns pointer to a mesh buffer which fits a material 138 //! Returns pointer to a mesh buffer which fits a material
139 /** \param material: material to search for 139 /** \param material: material to search for
140 \return Returns the pointer to the mesh buffer or 140 \return Returns the pointer to the mesh buffer or
141 NULL if there is no such mesh buffer. */ 141 NULL if there is no such mesh buffer. */
142 virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const 142 virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const
143 { 143 {
144 if (Meshes.empty()) 144 if (Meshes.empty())
145 return 0; 145 return 0;
146 146
147 return Meshes[0]->getMeshBuffer(material); 147 return Meshes[0]->getMeshBuffer(material);
148 } 148 }
149 149
150 //! Set a material flag for all meshbuffers of this mesh. 150 //! Set a material flag for all meshbuffers of this mesh.
151 virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) 151 virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
152 { 152 {
153 for (u32 i=0; i<Meshes.size(); ++i) 153 for (u32 i=0; i<Meshes.size(); ++i)
154 Meshes[i]->setMaterialFlag(flag, newvalue); 154 Meshes[i]->setMaterialFlag(flag, newvalue);
155 } 155 }
156 156
157 //! set the hardware mapping hint, for driver 157 //! set the hardware mapping hint, for driver
158 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) 158 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX )
159 { 159 {
160 for (u32 i=0; i<Meshes.size(); ++i) 160 for (u32 i=0; i<Meshes.size(); ++i)
161 Meshes[i]->setHardwareMappingHint(newMappingHint, buffer); 161 Meshes[i]->setHardwareMappingHint(newMappingHint, buffer);
162 } 162 }
163 163
164 //! flags the meshbuffer as changed, reloads hardware buffers 164 //! flags the meshbuffer as changed, reloads hardware buffers
165 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) 165 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX)
166 { 166 {
167 for (u32 i=0; i<Meshes.size(); ++i) 167 for (u32 i=0; i<Meshes.size(); ++i)
168 Meshes[i]->setDirty(buffer); 168 Meshes[i]->setDirty(buffer);
169 } 169 }
170 170
171 //! All meshes defining the animated mesh 171 //! All meshes defining the animated mesh
172 core::array<IMesh*> Meshes; 172 core::array<IMesh*> Meshes;
173 173
174 //! The bounding box of this mesh 174 //! The bounding box of this mesh
175 core::aabbox3d<f32> Box; 175 core::aabbox3d<f32> Box;
176 176
177 //! Default animation speed of this mesh. 177 //! Default animation speed of this mesh.
178 f32 FramesPerSecond; 178 f32 FramesPerSecond;
179 179
180 //! The type of the mesh. 180 //! The type of the mesh.
181 E_ANIMATED_MESH_TYPE Type; 181 E_ANIMATED_MESH_TYPE Type;
182 }; 182 };
183 183
184 184
185} // end namespace scene 185} // end namespace scene
186} // end namespace irr 186} // end namespace irr
187 187
188#endif 188#endif
189 189
diff --git a/libraries/irrlicht-1.8/include/SColor.h b/libraries/irrlicht-1.8/include/SColor.h
index b61bbef..f57b4a9 100644
--- a/libraries/irrlicht-1.8/include/SColor.h
+++ b/libraries/irrlicht-1.8/include/SColor.h
@@ -1,697 +1,697 @@
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#ifndef __COLOR_H_INCLUDED__ 5#ifndef __COLOR_H_INCLUDED__
6#define __COLOR_H_INCLUDED__ 6#define __COLOR_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include "irrMath.h" 9#include "irrMath.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace video 13namespace video
14{ 14{
15 //! An enum for the color format of textures used by the Irrlicht Engine. 15 //! An enum for the color format of textures used by the Irrlicht Engine.
16 /** A color format specifies how color information is stored. */ 16 /** A color format specifies how color information is stored. */
17 enum ECOLOR_FORMAT 17 enum ECOLOR_FORMAT
18 { 18 {
19 //! 16 bit color format used by the software driver. 19 //! 16 bit color format used by the software driver.
20 /** It is thus preferred by all other irrlicht engine video drivers. 20 /** It is thus preferred by all other irrlicht engine video drivers.
21 There are 5 bits for every color component, and a single bit is left 21 There are 5 bits for every color component, and a single bit is left
22 for alpha information. */ 22 for alpha information. */
23 ECF_A1R5G5B5 = 0, 23 ECF_A1R5G5B5 = 0,
24 24
25 //! Standard 16 bit color format. 25 //! Standard 16 bit color format.
26 ECF_R5G6B5, 26 ECF_R5G6B5,
27 27
28 //! 24 bit color, no alpha channel, but 8 bit for red, green and blue. 28 //! 24 bit color, no alpha channel, but 8 bit for red, green and blue.
29 ECF_R8G8B8, 29 ECF_R8G8B8,
30 30
31 //! Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha. 31 //! Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.
32 ECF_A8R8G8B8, 32 ECF_A8R8G8B8,
33 33
34 /** Floating Point formats. The following formats may only be used for render target textures. */ 34 /** Floating Point formats. The following formats may only be used for render target textures. */
35 35
36 //! 16 bit floating point format using 16 bits for the red channel. 36 //! 16 bit floating point format using 16 bits for the red channel.
37 ECF_R16F, 37 ECF_R16F,
38 38
39 //! 32 bit floating point format using 16 bits for the red channel and 16 bits for the green channel. 39 //! 32 bit floating point format using 16 bits for the red channel and 16 bits for the green channel.
40 ECF_G16R16F, 40 ECF_G16R16F,
41 41
42 //! 64 bit floating point format 16 bits are used for the red, green, blue and alpha channels. 42 //! 64 bit floating point format 16 bits are used for the red, green, blue and alpha channels.
43 ECF_A16B16G16R16F, 43 ECF_A16B16G16R16F,
44 44
45 //! 32 bit floating point format using 32 bits for the red channel. 45 //! 32 bit floating point format using 32 bits for the red channel.
46 ECF_R32F, 46 ECF_R32F,
47 47
48 //! 64 bit floating point format using 32 bits for the red channel and 32 bits for the green channel. 48 //! 64 bit floating point format using 32 bits for the red channel and 32 bits for the green channel.
49 ECF_G32R32F, 49 ECF_G32R32F,
50 50
51 //! 128 bit floating point format. 32 bits are used for the red, green, blue and alpha channels. 51 //! 128 bit floating point format. 32 bits are used for the red, green, blue and alpha channels.
52 ECF_A32B32G32R32F, 52 ECF_A32B32G32R32F,
53 53
54 //! Unknown color format: 54 //! Unknown color format:
55 ECF_UNKNOWN 55 ECF_UNKNOWN
56 }; 56 };
57 57
58 58
59 //! Creates a 16 bit A1R5G5B5 color 59 //! Creates a 16 bit A1R5G5B5 color
60 inline u16 RGBA16(u32 r, u32 g, u32 b, u32 a=0xFF) 60 inline u16 RGBA16(u32 r, u32 g, u32 b, u32 a=0xFF)
61 { 61 {
62 return (u16)((a & 0x80) << 8 | 62 return (u16)((a & 0x80) << 8 |
63 (r & 0xF8) << 7 | 63 (r & 0xF8) << 7 |
64 (g & 0xF8) << 2 | 64 (g & 0xF8) << 2 |
65 (b & 0xF8) >> 3); 65 (b & 0xF8) >> 3);
66 } 66 }
67 67
68 68
69 //! Creates a 16 bit A1R5G5B5 color 69 //! Creates a 16 bit A1R5G5B5 color
70 inline u16 RGB16(u32 r, u32 g, u32 b) 70 inline u16 RGB16(u32 r, u32 g, u32 b)
71 { 71 {
72 return RGBA16(r,g,b); 72 return RGBA16(r,g,b);
73 } 73 }
74 74
75 75
76 //! Creates a 16bit A1R5G5B5 color, based on 16bit input values 76 //! Creates a 16bit A1R5G5B5 color, based on 16bit input values
77 inline u16 RGB16from16(u16 r, u16 g, u16 b) 77 inline u16 RGB16from16(u16 r, u16 g, u16 b)
78 { 78 {
79 return (0x8000 | 79 return (0x8000 |
80 (r & 0x1F) << 10 | 80 (r & 0x1F) << 10 |
81 (g & 0x1F) << 5 | 81 (g & 0x1F) << 5 |
82 (b & 0x1F)); 82 (b & 0x1F));
83 } 83 }
84 84
85 85
86 //! Converts a 32bit (X8R8G8B8) color to a 16bit A1R5G5B5 color 86 //! Converts a 32bit (X8R8G8B8) color to a 16bit A1R5G5B5 color
87 inline u16 X8R8G8B8toA1R5G5B5(u32 color) 87 inline u16 X8R8G8B8toA1R5G5B5(u32 color)
88 { 88 {
89 return (u16)(0x8000 | 89 return (u16)(0x8000 |
90 ( color & 0x00F80000) >> 9 | 90 ( color & 0x00F80000) >> 9 |
91 ( color & 0x0000F800) >> 6 | 91 ( color & 0x0000F800) >> 6 |
92 ( color & 0x000000F8) >> 3); 92 ( color & 0x000000F8) >> 3);
93 } 93 }
94 94
95 95
96 //! Converts a 32bit (A8R8G8B8) color to a 16bit A1R5G5B5 color 96 //! Converts a 32bit (A8R8G8B8) color to a 16bit A1R5G5B5 color
97 inline u16 A8R8G8B8toA1R5G5B5(u32 color) 97 inline u16 A8R8G8B8toA1R5G5B5(u32 color)
98 { 98 {
99 return (u16)(( color & 0x80000000) >> 16| 99 return (u16)(( color & 0x80000000) >> 16|
100 ( color & 0x00F80000) >> 9 | 100 ( color & 0x00F80000) >> 9 |
101 ( color & 0x0000F800) >> 6 | 101 ( color & 0x0000F800) >> 6 |
102 ( color & 0x000000F8) >> 3); 102 ( color & 0x000000F8) >> 3);
103 } 103 }
104 104
105 105
106 //! Converts a 32bit (A8R8G8B8) color to a 16bit R5G6B5 color 106 //! Converts a 32bit (A8R8G8B8) color to a 16bit R5G6B5 color
107 inline u16 A8R8G8B8toR5G6B5(u32 color) 107 inline u16 A8R8G8B8toR5G6B5(u32 color)
108 { 108 {
109 return (u16)(( color & 0x00F80000) >> 8 | 109 return (u16)(( color & 0x00F80000) >> 8 |
110 ( color & 0x0000FC00) >> 5 | 110 ( color & 0x0000FC00) >> 5 |
111 ( color & 0x000000F8) >> 3); 111 ( color & 0x000000F8) >> 3);
112 } 112 }
113 113
114 114
115 //! Convert A8R8G8B8 Color from A1R5G5B5 color 115 //! Convert A8R8G8B8 Color from A1R5G5B5 color
116 /** build a nicer 32bit Color by extending dest lower bits with source high bits. */ 116 /** build a nicer 32bit Color by extending dest lower bits with source high bits. */
117 inline u32 A1R5G5B5toA8R8G8B8(u16 color) 117 inline u32 A1R5G5B5toA8R8G8B8(u16 color)
118 { 118 {
119 return ( (( -( (s32) color & 0x00008000 ) >> (s32) 31 ) & 0xFF000000 ) | 119 return ( (( -( (s32) color & 0x00008000 ) >> (s32) 31 ) & 0xFF000000 ) |
120 (( color & 0x00007C00 ) << 9) | (( color & 0x00007000 ) << 4) | 120 (( color & 0x00007C00 ) << 9) | (( color & 0x00007000 ) << 4) |
121 (( color & 0x000003E0 ) << 6) | (( color & 0x00000380 ) << 1) | 121 (( color & 0x000003E0 ) << 6) | (( color & 0x00000380 ) << 1) |
122 (( color & 0x0000001F ) << 3) | (( color & 0x0000001C ) >> 2) 122 (( color & 0x0000001F ) << 3) | (( color & 0x0000001C ) >> 2)
123 ); 123 );
124 } 124 }
125 125
126 126
127 //! Returns A8R8G8B8 Color from R5G6B5 color 127 //! Returns A8R8G8B8 Color from R5G6B5 color
128 inline u32 R5G6B5toA8R8G8B8(u16 color) 128 inline u32 R5G6B5toA8R8G8B8(u16 color)
129 { 129 {
130 return 0xFF000000 | 130 return 0xFF000000 |
131 ((color & 0xF800) << 8)| 131 ((color & 0xF800) << 8)|
132 ((color & 0x07E0) << 5)| 132 ((color & 0x07E0) << 5)|
133 ((color & 0x001F) << 3); 133 ((color & 0x001F) << 3);
134 } 134 }
135 135
136 136
137 //! Returns A1R5G5B5 Color from R5G6B5 color 137 //! Returns A1R5G5B5 Color from R5G6B5 color
138 inline u16 R5G6B5toA1R5G5B5(u16 color) 138 inline u16 R5G6B5toA1R5G5B5(u16 color)
139 { 139 {
140 return 0x8000 | (((color & 0xFFC0) >> 1) | (color & 0x1F)); 140 return 0x8000 | (((color & 0xFFC0) >> 1) | (color & 0x1F));
141 } 141 }
142 142
143 143
144 //! Returns R5G6B5 Color from A1R5G5B5 color 144 //! Returns R5G6B5 Color from A1R5G5B5 color
145 inline u16 A1R5G5B5toR5G6B5(u16 color) 145 inline u16 A1R5G5B5toR5G6B5(u16 color)
146 { 146 {
147 return (((color & 0x7FE0) << 1) | (color & 0x1F)); 147 return (((color & 0x7FE0) << 1) | (color & 0x1F));
148 } 148 }
149 149
150 150
151 151
152 //! Returns the alpha component from A1R5G5B5 color 152 //! Returns the alpha component from A1R5G5B5 color
153 /** In Irrlicht, alpha refers to opacity. 153 /** In Irrlicht, alpha refers to opacity.
154 \return The alpha value of the color. 0 is transparent, 1 is opaque. */ 154 \return The alpha value of the color. 0 is transparent, 1 is opaque. */
155 inline u32 getAlpha(u16 color) 155 inline u32 getAlpha(u16 color)
156 { 156 {
157 return ((color >> 15)&0x1); 157 return ((color >> 15)&0x1);
158 } 158 }
159 159
160 160
161 //! Returns the red component from A1R5G5B5 color. 161 //! Returns the red component from A1R5G5B5 color.
162 /** Shift left by 3 to get 8 bit value. */ 162 /** Shift left by 3 to get 8 bit value. */
163 inline u32 getRed(u16 color) 163 inline u32 getRed(u16 color)
164 { 164 {
165 return ((color >> 10)&0x1F); 165 return ((color >> 10)&0x1F);
166 } 166 }
167 167
168 168
169 //! Returns the green component from A1R5G5B5 color 169 //! Returns the green component from A1R5G5B5 color
170 /** Shift left by 3 to get 8 bit value. */ 170 /** Shift left by 3 to get 8 bit value. */
171 inline u32 getGreen(u16 color) 171 inline u32 getGreen(u16 color)
172 { 172 {
173 return ((color >> 5)&0x1F); 173 return ((color >> 5)&0x1F);
174 } 174 }
175 175
176 176
177 //! Returns the blue component from A1R5G5B5 color 177 //! Returns the blue component from A1R5G5B5 color
178 /** Shift left by 3 to get 8 bit value. */ 178 /** Shift left by 3 to get 8 bit value. */
179 inline u32 getBlue(u16 color) 179 inline u32 getBlue(u16 color)
180 { 180 {
181 return (color & 0x1F); 181 return (color & 0x1F);
182 } 182 }
183 183
184 184
185 //! Returns the average from a 16 bit A1R5G5B5 color 185 //! Returns the average from a 16 bit A1R5G5B5 color
186 inline s32 getAverage(s16 color) 186 inline s32 getAverage(s16 color)
187 { 187 {
188 return ((getRed(color)<<3) + (getGreen(color)<<3) + (getBlue(color)<<3)) / 3; 188 return ((getRed(color)<<3) + (getGreen(color)<<3) + (getBlue(color)<<3)) / 3;
189 } 189 }
190 190
191 191
192 //! Class representing a 32 bit ARGB color. 192 //! Class representing a 32 bit ARGB color.
193 /** The color values for alpha, red, green, and blue are 193 /** The color values for alpha, red, green, and blue are
194 stored in a single u32. So all four values may be between 0 and 255. 194 stored in a single u32. So all four values may be between 0 and 255.
195 Alpha in Irrlicht is opacity, so 0 is fully transparent, 255 is fully opaque (solid). 195 Alpha in Irrlicht is opacity, so 0 is fully transparent, 255 is fully opaque (solid).
196 This class is used by most parts of the Irrlicht Engine 196 This class is used by most parts of the Irrlicht Engine
197 to specify a color. Another way is using the class SColorf, which 197 to specify a color. Another way is using the class SColorf, which
198 stores the color values in 4 floats. 198 stores the color values in 4 floats.
199 This class must consist of only one u32 and must not use virtual functions. 199 This class must consist of only one u32 and must not use virtual functions.
200 */ 200 */
201 class SColor 201 class SColor
202 { 202 {
203 public: 203 public:
204 204
205 //! Constructor of the Color. Does nothing. 205 //! Constructor of the Color. Does nothing.
206 /** The color value is not initialized to save time. */ 206 /** The color value is not initialized to save time. */
207 SColor() {} 207 SColor() {}
208 208
209 //! Constructs the color from 4 values representing the alpha, red, green and blue component. 209 //! Constructs the color from 4 values representing the alpha, red, green and blue component.
210 /** Must be values between 0 and 255. */ 210 /** Must be values between 0 and 255. */
211 SColor (u32 a, u32 r, u32 g, u32 b) 211 SColor (u32 a, u32 r, u32 g, u32 b)
212 : color(((a & 0xff)<<24) | ((r & 0xff)<<16) | ((g & 0xff)<<8) | (b & 0xff)) {} 212 : color(((a & 0xff)<<24) | ((r & 0xff)<<16) | ((g & 0xff)<<8) | (b & 0xff)) {}
213 213
214 //! Constructs the color from a 32 bit value. Could be another color. 214 //! Constructs the color from a 32 bit value. Could be another color.
215 SColor(u32 clr) 215 SColor(u32 clr)
216 : color(clr) {} 216 : color(clr) {}
217 217
218 //! Returns the alpha component of the color. 218 //! Returns the alpha component of the color.
219 /** The alpha component defines how opaque a color is. 219 /** The alpha component defines how opaque a color is.
220 \return The alpha value of the color. 0 is fully transparent, 255 is fully opaque. */ 220 \return The alpha value of the color. 0 is fully transparent, 255 is fully opaque. */
221 u32 getAlpha() const { return color>>24; } 221 u32 getAlpha() const { return color>>24; }
222 222
223 //! Returns the red component of the color. 223 //! Returns the red component of the color.
224 /** \return Value between 0 and 255, specifying how red the color is. 224 /** \return Value between 0 and 255, specifying how red the color is.
225 0 means no red, 255 means full red. */ 225 0 means no red, 255 means full red. */
226 u32 getRed() const { return (color>>16) & 0xff; } 226 u32 getRed() const { return (color>>16) & 0xff; }
227 227
228 //! Returns the green component of the color. 228 //! Returns the green component of the color.
229 /** \return Value between 0 and 255, specifying how green the color is. 229 /** \return Value between 0 and 255, specifying how green the color is.
230 0 means no green, 255 means full green. */ 230 0 means no green, 255 means full green. */
231 u32 getGreen() const { return (color>>8) & 0xff; } 231 u32 getGreen() const { return (color>>8) & 0xff; }
232 232
233 //! Returns the blue component of the color. 233 //! Returns the blue component of the color.
234 /** \return Value between 0 and 255, specifying how blue the color is. 234 /** \return Value between 0 and 255, specifying how blue the color is.
235 0 means no blue, 255 means full blue. */ 235 0 means no blue, 255 means full blue. */
236 u32 getBlue() const { return color & 0xff; } 236 u32 getBlue() const { return color & 0xff; }
237 237
238 //! Get lightness of the color in the range [0,255] 238 //! Get lightness of the color in the range [0,255]
239 f32 getLightness() const 239 f32 getLightness() const
240 { 240 {
241 return 0.5f*(core::max_(core::max_(getRed(),getGreen()),getBlue())+core::min_(core::min_(getRed(),getGreen()),getBlue())); 241 return 0.5f*(core::max_(core::max_(getRed(),getGreen()),getBlue())+core::min_(core::min_(getRed(),getGreen()),getBlue()));
242 } 242 }
243 243
244 //! Get luminance of the color in the range [0,255]. 244 //! Get luminance of the color in the range [0,255].
245 f32 getLuminance() const 245 f32 getLuminance() const
246 { 246 {
247 return 0.3f*getRed() + 0.59f*getGreen() + 0.11f*getBlue(); 247 return 0.3f*getRed() + 0.59f*getGreen() + 0.11f*getBlue();
248 } 248 }
249 249
250 //! Get average intensity of the color in the range [0,255]. 250 //! Get average intensity of the color in the range [0,255].
251 u32 getAverage() const 251 u32 getAverage() const
252 { 252 {
253 return ( getRed() + getGreen() + getBlue() ) / 3; 253 return ( getRed() + getGreen() + getBlue() ) / 3;
254 } 254 }
255 255
256 //! Sets the alpha component of the Color. 256 //! Sets the alpha component of the Color.
257 /** The alpha component defines how transparent a color should be. 257 /** The alpha component defines how transparent a color should be.
258 \param a The alpha value of the color. 0 is fully transparent, 255 is fully opaque. */ 258 \param a The alpha value of the color. 0 is fully transparent, 255 is fully opaque. */
259 void setAlpha(u32 a) { color = ((a & 0xff)<<24) | (color & 0x00ffffff); } 259 void setAlpha(u32 a) { color = ((a & 0xff)<<24) | (color & 0x00ffffff); }
260 260
261 //! Sets the red component of the Color. 261 //! Sets the red component of the Color.
262 /** \param r: Has to be a value between 0 and 255. 262 /** \param r: Has to be a value between 0 and 255.
263 0 means no red, 255 means full red. */ 263 0 means no red, 255 means full red. */
264 void setRed(u32 r) { color = ((r & 0xff)<<16) | (color & 0xff00ffff); } 264 void setRed(u32 r) { color = ((r & 0xff)<<16) | (color & 0xff00ffff); }
265 265
266 //! Sets the green component of the Color. 266 //! Sets the green component of the Color.
267 /** \param g: Has to be a value between 0 and 255. 267 /** \param g: Has to be a value between 0 and 255.
268 0 means no green, 255 means full green. */ 268 0 means no green, 255 means full green. */
269 void setGreen(u32 g) { color = ((g & 0xff)<<8) | (color & 0xffff00ff); } 269 void setGreen(u32 g) { color = ((g & 0xff)<<8) | (color & 0xffff00ff); }
270 270
271 //! Sets the blue component of the Color. 271 //! Sets the blue component of the Color.
272 /** \param b: Has to be a value between 0 and 255. 272 /** \param b: Has to be a value between 0 and 255.
273 0 means no blue, 255 means full blue. */ 273 0 means no blue, 255 means full blue. */
274 void setBlue(u32 b) { color = (b & 0xff) | (color & 0xffffff00); } 274 void setBlue(u32 b) { color = (b & 0xff) | (color & 0xffffff00); }
275 275
276 //! Calculates a 16 bit A1R5G5B5 value of this color. 276 //! Calculates a 16 bit A1R5G5B5 value of this color.
277 /** \return 16 bit A1R5G5B5 value of this color. */ 277 /** \return 16 bit A1R5G5B5 value of this color. */
278 u16 toA1R5G5B5() const { return A8R8G8B8toA1R5G5B5(color); } 278 u16 toA1R5G5B5() const { return A8R8G8B8toA1R5G5B5(color); }
279 279
280 //! Converts color to OpenGL color format 280 //! Converts color to OpenGL color format
281 /** From ARGB to RGBA in 4 byte components for endian aware 281 /** From ARGB to RGBA in 4 byte components for endian aware
282 passing to OpenGL 282 passing to OpenGL
283 \param dest: address where the 4x8 bit OpenGL color is stored. */ 283 \param dest: address where the 4x8 bit OpenGL color is stored. */
284 void toOpenGLColor(u8* dest) const 284 void toOpenGLColor(u8* dest) const
285 { 285 {
286 *dest = (u8)getRed(); 286 *dest = (u8)getRed();
287 *++dest = (u8)getGreen(); 287 *++dest = (u8)getGreen();
288 *++dest = (u8)getBlue(); 288 *++dest = (u8)getBlue();
289 *++dest = (u8)getAlpha(); 289 *++dest = (u8)getAlpha();
290 } 290 }
291 291
292 //! Sets all four components of the color at once. 292 //! Sets all four components of the color at once.
293 /** Constructs the color from 4 values representing the alpha, 293 /** Constructs the color from 4 values representing the alpha,
294 red, green and blue components of the color. Must be values 294 red, green and blue components of the color. Must be values
295 between 0 and 255. 295 between 0 and 255.
296 \param a: Alpha component of the color. The alpha component 296 \param a: Alpha component of the color. The alpha component
297 defines how transparent a color should be. Has to be a value 297 defines how transparent a color should be. Has to be a value
298 between 0 and 255. 255 means not transparent (opaque), 0 means 298 between 0 and 255. 255 means not transparent (opaque), 0 means
299 fully transparent. 299 fully transparent.
300 \param r: Sets the red component of the Color. Has to be a 300 \param r: Sets the red component of the Color. Has to be a
301 value between 0 and 255. 0 means no red, 255 means full red. 301 value between 0 and 255. 0 means no red, 255 means full red.
302 \param g: Sets the green component of the Color. Has to be a 302 \param g: Sets the green component of the Color. Has to be a
303 value between 0 and 255. 0 means no green, 255 means full 303 value between 0 and 255. 0 means no green, 255 means full
304 green. 304 green.
305 \param b: Sets the blue component of the Color. Has to be a 305 \param b: Sets the blue component of the Color. Has to be a
306 value between 0 and 255. 0 means no blue, 255 means full blue. */ 306 value between 0 and 255. 0 means no blue, 255 means full blue. */
307 void set(u32 a, u32 r, u32 g, u32 b) 307 void set(u32 a, u32 r, u32 g, u32 b)
308 { 308 {
309 color = (((a & 0xff)<<24) | ((r & 0xff)<<16) | ((g & 0xff)<<8) | (b & 0xff)); 309 color = (((a & 0xff)<<24) | ((r & 0xff)<<16) | ((g & 0xff)<<8) | (b & 0xff));
310 } 310 }
311 void set(u32 col) { color = col; } 311 void set(u32 col) { color = col; }
312 312
313 //! Compares the color to another color. 313 //! Compares the color to another color.
314 /** \return True if the colors are the same, and false if not. */ 314 /** \return True if the colors are the same, and false if not. */
315 bool operator==(const SColor& other) const { return other.color == color; } 315 bool operator==(const SColor& other) const { return other.color == color; }
316 316
317 //! Compares the color to another color. 317 //! Compares the color to another color.
318 /** \return True if the colors are different, and false if they are the same. */ 318 /** \return True if the colors are different, and false if they are the same. */
319 bool operator!=(const SColor& other) const { return other.color != color; } 319 bool operator!=(const SColor& other) const { return other.color != color; }
320 320
321 //! comparison operator 321 //! comparison operator
322 /** \return True if this color is smaller than the other one */ 322 /** \return True if this color is smaller than the other one */
323 bool operator<(const SColor& other) const { return (color < other.color); } 323 bool operator<(const SColor& other) const { return (color < other.color); }
324 324
325 //! Adds two colors, result is clamped to 0..255 values 325 //! Adds two colors, result is clamped to 0..255 values
326 /** \param other Color to add to this color 326 /** \param other Color to add to this color
327 \return Addition of the two colors, clamped to 0..255 values */ 327 \return Addition of the two colors, clamped to 0..255 values */
328 SColor operator+(const SColor& other) const 328 SColor operator+(const SColor& other) const
329 { 329 {
330 return SColor(core::min_(getAlpha() + other.getAlpha(), 255u), 330 return SColor(core::min_(getAlpha() + other.getAlpha(), 255u),
331 core::min_(getRed() + other.getRed(), 255u), 331 core::min_(getRed() + other.getRed(), 255u),
332 core::min_(getGreen() + other.getGreen(), 255u), 332 core::min_(getGreen() + other.getGreen(), 255u),
333 core::min_(getBlue() + other.getBlue(), 255u)); 333 core::min_(getBlue() + other.getBlue(), 255u));
334 } 334 }
335 335
336 //! Interpolates the color with a f32 value to another color 336 //! Interpolates the color with a f32 value to another color
337 /** \param other: Other color 337 /** \param other: Other color
338 \param d: value between 0.0f and 1.0f 338 \param d: value between 0.0f and 1.0f
339 \return Interpolated color. */ 339 \return Interpolated color. */
340 SColor getInterpolated(const SColor &other, f32 d) const 340 SColor getInterpolated(const SColor &other, f32 d) const
341 { 341 {
342 d = core::clamp(d, 0.f, 1.f); 342 d = core::clamp(d, 0.f, 1.f);
343 const f32 inv = 1.0f - d; 343 const f32 inv = 1.0f - d;
344 return SColor((u32)core::round32(other.getAlpha()*inv + getAlpha()*d), 344 return SColor((u32)core::round32(other.getAlpha()*inv + getAlpha()*d),
345 (u32)core::round32(other.getRed()*inv + getRed()*d), 345 (u32)core::round32(other.getRed()*inv + getRed()*d),
346 (u32)core::round32(other.getGreen()*inv + getGreen()*d), 346 (u32)core::round32(other.getGreen()*inv + getGreen()*d),
347 (u32)core::round32(other.getBlue()*inv + getBlue()*d)); 347 (u32)core::round32(other.getBlue()*inv + getBlue()*d));
348 } 348 }
349 349
350 //! Returns interpolated color. ( quadratic ) 350 //! Returns interpolated color. ( quadratic )
351 /** \param c1: first color to interpolate with 351 /** \param c1: first color to interpolate with
352 \param c2: second color to interpolate with 352 \param c2: second color to interpolate with
353 \param d: value between 0.0f and 1.0f. */ 353 \param d: value between 0.0f and 1.0f. */
354 SColor getInterpolated_quadratic(const SColor& c1, const SColor& c2, f32 d) const 354 SColor getInterpolated_quadratic(const SColor& c1, const SColor& c2, f32 d) const
355 { 355 {
356 // this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d; 356 // this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d;
357 d = core::clamp(d, 0.f, 1.f); 357 d = core::clamp(d, 0.f, 1.f);
358 const f32 inv = 1.f - d; 358 const f32 inv = 1.f - d;
359 const f32 mul0 = inv * inv; 359 const f32 mul0 = inv * inv;
360 const f32 mul1 = 2.f * d * inv; 360 const f32 mul1 = 2.f * d * inv;
361 const f32 mul2 = d * d; 361 const f32 mul2 = d * d;
362 362
363 return SColor( 363 return SColor(
364 core::clamp( core::floor32( 364 core::clamp( core::floor32(
365 getAlpha() * mul0 + c1.getAlpha() * mul1 + c2.getAlpha() * mul2 ), 0, 255 ), 365 getAlpha() * mul0 + c1.getAlpha() * mul1 + c2.getAlpha() * mul2 ), 0, 255 ),
366 core::clamp( core::floor32( 366 core::clamp( core::floor32(
367 getRed() * mul0 + c1.getRed() * mul1 + c2.getRed() * mul2 ), 0, 255 ), 367 getRed() * mul0 + c1.getRed() * mul1 + c2.getRed() * mul2 ), 0, 255 ),
368 core::clamp ( core::floor32( 368 core::clamp ( core::floor32(
369 getGreen() * mul0 + c1.getGreen() * mul1 + c2.getGreen() * mul2 ), 0, 255 ), 369 getGreen() * mul0 + c1.getGreen() * mul1 + c2.getGreen() * mul2 ), 0, 255 ),
370 core::clamp ( core::floor32( 370 core::clamp ( core::floor32(
371 getBlue() * mul0 + c1.getBlue() * mul1 + c2.getBlue() * mul2 ), 0, 255 )); 371 getBlue() * mul0 + c1.getBlue() * mul1 + c2.getBlue() * mul2 ), 0, 255 ));
372 } 372 }
373 373
374 //! set the color by expecting data in the given format 374 //! set the color by expecting data in the given format
375 /** \param data: must point to valid memory containing color information in the given format 375 /** \param data: must point to valid memory containing color information in the given format
376 \param format: tells the format in which data is available 376 \param format: tells the format in which data is available
377 */ 377 */
378 void setData(const void *data, ECOLOR_FORMAT format) 378 void setData(const void *data, ECOLOR_FORMAT format)
379 { 379 {
380 switch (format) 380 switch (format)
381 { 381 {
382 case ECF_A1R5G5B5: 382 case ECF_A1R5G5B5:
383 color = A1R5G5B5toA8R8G8B8(*(u16*)data); 383 color = A1R5G5B5toA8R8G8B8(*(u16*)data);
384 break; 384 break;
385 case ECF_R5G6B5: 385 case ECF_R5G6B5:
386 color = R5G6B5toA8R8G8B8(*(u16*)data); 386 color = R5G6B5toA8R8G8B8(*(u16*)data);
387 break; 387 break;
388 case ECF_A8R8G8B8: 388 case ECF_A8R8G8B8:
389 color = *(u32*)data; 389 color = *(u32*)data;
390 break; 390 break;
391 case ECF_R8G8B8: 391 case ECF_R8G8B8:
392 { 392 {
393 u8* p = (u8*)data; 393 u8* p = (u8*)data;
394 set(255, p[0],p[1],p[2]); 394 set(255, p[0],p[1],p[2]);
395 } 395 }
396 break; 396 break;
397 default: 397 default:
398 color = 0xffffffff; 398 color = 0xffffffff;
399 break; 399 break;
400 } 400 }
401 } 401 }
402 402
403 //! Write the color to data in the defined format 403 //! Write the color to data in the defined format
404 /** \param data: target to write the color. Must contain sufficiently large memory to receive the number of bytes neede for format 404 /** \param data: target to write the color. Must contain sufficiently large memory to receive the number of bytes neede for format
405 \param format: tells the format used to write the color into data 405 \param format: tells the format used to write the color into data
406 */ 406 */
407 void getData(void *data, ECOLOR_FORMAT format) 407 void getData(void *data, ECOLOR_FORMAT format)
408 { 408 {
409 switch(format) 409 switch(format)
410 { 410 {
411 case ECF_A1R5G5B5: 411 case ECF_A1R5G5B5:
412 { 412 {
413 u16 * dest = (u16*)data; 413 u16 * dest = (u16*)data;
414 *dest = video::A8R8G8B8toA1R5G5B5( color ); 414 *dest = video::A8R8G8B8toA1R5G5B5( color );
415 } 415 }
416 break; 416 break;
417 417
418 case ECF_R5G6B5: 418 case ECF_R5G6B5:
419 { 419 {
420 u16 * dest = (u16*)data; 420 u16 * dest = (u16*)data;
421 *dest = video::A8R8G8B8toR5G6B5( color ); 421 *dest = video::A8R8G8B8toR5G6B5( color );
422 } 422 }
423 break; 423 break;
424 424
425 case ECF_R8G8B8: 425 case ECF_R8G8B8:
426 { 426 {
427 u8* dest = (u8*)data; 427 u8* dest = (u8*)data;
428 dest[0] = (u8)getRed(); 428 dest[0] = (u8)getRed();
429 dest[1] = (u8)getGreen(); 429 dest[1] = (u8)getGreen();
430 dest[2] = (u8)getBlue(); 430 dest[2] = (u8)getBlue();
431 } 431 }
432 break; 432 break;
433 433
434 case ECF_A8R8G8B8: 434 case ECF_A8R8G8B8:
435 { 435 {
436 u32 * dest = (u32*)data; 436 u32 * dest = (u32*)data;
437 *dest = color; 437 *dest = color;
438 } 438 }
439 break; 439 break;
440 440
441 default: 441 default:
442 break; 442 break;
443 } 443 }
444 } 444 }
445 445
446 //! color in A8R8G8B8 Format 446 //! color in A8R8G8B8 Format
447 u32 color; 447 u32 color;
448 }; 448 };
449 449
450 450
451 //! Class representing a color with four floats. 451 //! Class representing a color with four floats.
452 /** The color values for red, green, blue 452 /** The color values for red, green, blue
453 and alpha are each stored in a 32 bit floating point variable. 453 and alpha are each stored in a 32 bit floating point variable.
454 So all four values may be between 0.0f and 1.0f. 454 So all four values may be between 0.0f and 1.0f.
455 Another, faster way to define colors is using the class SColor, which 455 Another, faster way to define colors is using the class SColor, which
456 stores the color values in a single 32 bit integer. 456 stores the color values in a single 32 bit integer.
457 */ 457 */
458 class SColorf 458 class SColorf
459 { 459 {
460 public: 460 public:
461 //! Default constructor for SColorf. 461 //! Default constructor for SColorf.
462 /** Sets red, green and blue to 0.0f and alpha to 1.0f. */ 462 /** Sets red, green and blue to 0.0f and alpha to 1.0f. */
463 SColorf() : r(0.0f), g(0.0f), b(0.0f), a(1.0f) {} 463 SColorf() : r(0.0f), g(0.0f), b(0.0f), a(1.0f) {}
464 464
465 //! Constructs a color from up to four color values: red, green, blue, and alpha. 465 //! Constructs a color from up to four color values: red, green, blue, and alpha.
466 /** \param r: Red color component. Should be a value between 466 /** \param r: Red color component. Should be a value between
467 0.0f meaning no red and 1.0f, meaning full red. 467 0.0f meaning no red and 1.0f, meaning full red.
468 \param g: Green color component. Should be a value between 0.0f 468 \param g: Green color component. Should be a value between 0.0f
469 meaning no green and 1.0f, meaning full green. 469 meaning no green and 1.0f, meaning full green.
470 \param b: Blue color component. Should be a value between 0.0f 470 \param b: Blue color component. Should be a value between 0.0f
471 meaning no blue and 1.0f, meaning full blue. 471 meaning no blue and 1.0f, meaning full blue.
472 \param a: Alpha color component of the color. The alpha 472 \param a: Alpha color component of the color. The alpha
473 component defines how transparent a color should be. Has to be 473 component defines how transparent a color should be. Has to be
474 a value between 0.0f and 1.0f, 1.0f means not transparent 474 a value between 0.0f and 1.0f, 1.0f means not transparent
475 (opaque), 0.0f means fully transparent. */ 475 (opaque), 0.0f means fully transparent. */
476 SColorf(f32 r, f32 g, f32 b, f32 a = 1.0f) : r(r), g(g), b(b), a(a) {} 476 SColorf(f32 r, f32 g, f32 b, f32 a = 1.0f) : r(r), g(g), b(b), a(a) {}
477 477
478 //! Constructs a color from 32 bit Color. 478 //! Constructs a color from 32 bit Color.
479 /** \param c: 32 bit color from which this SColorf class is 479 /** \param c: 32 bit color from which this SColorf class is
480 constructed from. */ 480 constructed from. */
481 SColorf(SColor c) 481 SColorf(SColor c)
482 { 482 {
483 const f32 inv = 1.0f / 255.0f; 483 const f32 inv = 1.0f / 255.0f;
484 r = c.getRed() * inv; 484 r = c.getRed() * inv;
485 g = c.getGreen() * inv; 485 g = c.getGreen() * inv;
486 b = c.getBlue() * inv; 486 b = c.getBlue() * inv;
487 a = c.getAlpha() * inv; 487 a = c.getAlpha() * inv;
488 } 488 }
489 489
490 //! Converts this color to a SColor without floats. 490 //! Converts this color to a SColor without floats.
491 SColor toSColor() const 491 SColor toSColor() const
492 { 492 {
493 return SColor((u32)core::round32(a*255.0f), (u32)core::round32(r*255.0f), (u32)core::round32(g*255.0f), (u32)core::round32(b*255.0f)); 493 return SColor((u32)core::round32(a*255.0f), (u32)core::round32(r*255.0f), (u32)core::round32(g*255.0f), (u32)core::round32(b*255.0f));
494 } 494 }
495 495
496 //! Sets three color components to new values at once. 496 //! Sets three color components to new values at once.
497 /** \param rr: Red color component. Should be a value between 0.0f meaning 497 /** \param rr: Red color component. Should be a value between 0.0f meaning
498 no red (=black) and 1.0f, meaning full red. 498 no red (=black) and 1.0f, meaning full red.
499 \param gg: Green color component. Should be a value between 0.0f meaning 499 \param gg: Green color component. Should be a value between 0.0f meaning
500 no green (=black) and 1.0f, meaning full green. 500 no green (=black) and 1.0f, meaning full green.
501 \param bb: Blue color component. Should be a value between 0.0f meaning 501 \param bb: Blue color component. Should be a value between 0.0f meaning
502 no blue (=black) and 1.0f, meaning full blue. */ 502 no blue (=black) and 1.0f, meaning full blue. */
503 void set(f32 rr, f32 gg, f32 bb) {r = rr; g =gg; b = bb; } 503 void set(f32 rr, f32 gg, f32 bb) {r = rr; g =gg; b = bb; }
504 504
505 //! Sets all four color components to new values at once. 505 //! Sets all four color components to new values at once.
506 /** \param aa: Alpha component. Should be a value between 0.0f meaning 506 /** \param aa: Alpha component. Should be a value between 0.0f meaning
507 fully transparent and 1.0f, meaning opaque. 507 fully transparent and 1.0f, meaning opaque.
508 \param rr: Red color component. Should be a value between 0.0f meaning 508 \param rr: Red color component. Should be a value between 0.0f meaning
509 no red and 1.0f, meaning full red. 509 no red and 1.0f, meaning full red.
510 \param gg: Green color component. Should be a value between 0.0f meaning 510 \param gg: Green color component. Should be a value between 0.0f meaning
511 no green and 1.0f, meaning full green. 511 no green and 1.0f, meaning full green.
512 \param bb: Blue color component. Should be a value between 0.0f meaning 512 \param bb: Blue color component. Should be a value between 0.0f meaning
513 no blue and 1.0f, meaning full blue. */ 513 no blue and 1.0f, meaning full blue. */
514 void set(f32 aa, f32 rr, f32 gg, f32 bb) {a = aa; r = rr; g =gg; b = bb; } 514 void set(f32 aa, f32 rr, f32 gg, f32 bb) {a = aa; r = rr; g =gg; b = bb; }
515 515
516 //! Interpolates the color with a f32 value to another color 516 //! Interpolates the color with a f32 value to another color
517 /** \param other: Other color 517 /** \param other: Other color
518 \param d: value between 0.0f and 1.0f 518 \param d: value between 0.0f and 1.0f
519 \return Interpolated color. */ 519 \return Interpolated color. */
520 SColorf getInterpolated(const SColorf &other, f32 d) const 520 SColorf getInterpolated(const SColorf &other, f32 d) const
521 { 521 {
522 d = core::clamp(d, 0.f, 1.f); 522 d = core::clamp(d, 0.f, 1.f);
523 const f32 inv = 1.0f - d; 523 const f32 inv = 1.0f - d;
524 return SColorf(other.r*inv + r*d, 524 return SColorf(other.r*inv + r*d,
525 other.g*inv + g*d, other.b*inv + b*d, other.a*inv + a*d); 525 other.g*inv + g*d, other.b*inv + b*d, other.a*inv + a*d);
526 } 526 }
527 527
528 //! Returns interpolated color. ( quadratic ) 528 //! Returns interpolated color. ( quadratic )
529 /** \param c1: first color to interpolate with 529 /** \param c1: first color to interpolate with
530 \param c2: second color to interpolate with 530 \param c2: second color to interpolate with
531 \param d: value between 0.0f and 1.0f. */ 531 \param d: value between 0.0f and 1.0f. */
532 inline SColorf getInterpolated_quadratic(const SColorf& c1, const SColorf& c2, 532 inline SColorf getInterpolated_quadratic(const SColorf& c1, const SColorf& c2,
533 f32 d) const 533 f32 d) const
534 { 534 {
535 d = core::clamp(d, 0.f, 1.f); 535 d = core::clamp(d, 0.f, 1.f);
536 // this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d; 536 // this*(1-d)*(1-d) + 2 * c1 * (1-d) + c2 * d * d;
537 const f32 inv = 1.f - d; 537 const f32 inv = 1.f - d;
538 const f32 mul0 = inv * inv; 538 const f32 mul0 = inv * inv;
539 const f32 mul1 = 2.f * d * inv; 539 const f32 mul1 = 2.f * d * inv;
540 const f32 mul2 = d * d; 540 const f32 mul2 = d * d;
541 541
542 return SColorf (r * mul0 + c1.r * mul1 + c2.r * mul2, 542 return SColorf (r * mul0 + c1.r * mul1 + c2.r * mul2,
543 g * mul0 + c1.g * mul1 + c2.g * mul2, 543 g * mul0 + c1.g * mul1 + c2.g * mul2,
544 b * mul0 + c1.b * mul1 + c2.b * mul2, 544 b * mul0 + c1.b * mul1 + c2.b * mul2,
545 a * mul0 + c1.a * mul1 + c2.a * mul2); 545 a * mul0 + c1.a * mul1 + c2.a * mul2);
546 } 546 }
547 547
548 548
549 //! Sets a color component by index. R=0, G=1, B=2, A=3 549 //! Sets a color component by index. R=0, G=1, B=2, A=3
550 void setColorComponentValue(s32 index, f32 value) 550 void setColorComponentValue(s32 index, f32 value)
551 { 551 {
552 switch(index) 552 switch(index)
553 { 553 {
554 case 0: r = value; break; 554 case 0: r = value; break;
555 case 1: g = value; break; 555 case 1: g = value; break;
556 case 2: b = value; break; 556 case 2: b = value; break;
557 case 3: a = value; break; 557 case 3: a = value; break;
558 } 558 }
559 } 559 }
560 560
561 //! Returns the alpha component of the color in the range 0.0 (transparent) to 1.0 (opaque) 561 //! Returns the alpha component of the color in the range 0.0 (transparent) to 1.0 (opaque)
562 f32 getAlpha() const { return a; } 562 f32 getAlpha() const { return a; }
563 563
564 //! Returns the red component of the color in the range 0.0 to 1.0 564 //! Returns the red component of the color in the range 0.0 to 1.0
565 f32 getRed() const { return r; } 565 f32 getRed() const { return r; }
566 566
567 //! Returns the green component of the color in the range 0.0 to 1.0 567 //! Returns the green component of the color in the range 0.0 to 1.0
568 f32 getGreen() const { return g; } 568 f32 getGreen() const { return g; }
569 569
570 //! Returns the blue component of the color in the range 0.0 to 1.0 570 //! Returns the blue component of the color in the range 0.0 to 1.0
571 f32 getBlue() const { return b; } 571 f32 getBlue() const { return b; }
572 572
573 //! red color component 573 //! red color component
574 f32 r; 574 f32 r;
575 575
576 //! green color component 576 //! green color component
577 f32 g; 577 f32 g;
578 578
579 //! blue component 579 //! blue component
580 f32 b; 580 f32 b;
581 581
582 //! alpha color component 582 //! alpha color component
583 f32 a; 583 f32 a;
584 }; 584 };
585 585
586 586
587 //! Class representing a color in HSL format 587 //! Class representing a color in HSL format
588 /** The color values for hue, saturation, luminance 588 /** The color values for hue, saturation, luminance
589 are stored in 32bit floating point variables. Hue is in range [0,360], 589 are stored in 32bit floating point variables. Hue is in range [0,360],
590 Luminance and Saturation are in percent [0,100] 590 Luminance and Saturation are in percent [0,100]
591 */ 591 */
592 class SColorHSL 592 class SColorHSL
593 { 593 {
594 public: 594 public:
595 SColorHSL ( f32 h = 0.f, f32 s = 0.f, f32 l = 0.f ) 595 SColorHSL ( f32 h = 0.f, f32 s = 0.f, f32 l = 0.f )
596 : Hue ( h ), Saturation ( s ), Luminance ( l ) {} 596 : Hue ( h ), Saturation ( s ), Luminance ( l ) {}
597 597
598 void fromRGB(const SColorf &color); 598 void fromRGB(const SColorf &color);
599 void toRGB(SColorf &color) const; 599 void toRGB(SColorf &color) const;
600 600
601 f32 Hue; 601 f32 Hue;
602 f32 Saturation; 602 f32 Saturation;
603 f32 Luminance; 603 f32 Luminance;
604 604
605 private: 605 private:
606 inline f32 toRGB1(f32 rm1, f32 rm2, f32 rh) const; 606 inline f32 toRGB1(f32 rm1, f32 rm2, f32 rh) const;
607 607
608 }; 608 };
609 609
610 inline void SColorHSL::fromRGB(const SColorf &color) 610 inline void SColorHSL::fromRGB(const SColorf &color)
611 { 611 {
612 const f32 maxVal = core::max_(color.getRed(), color.getGreen(), color.getBlue()); 612 const f32 maxVal = core::max_(color.getRed(), color.getGreen(), color.getBlue());
613 const f32 minVal = (f32)core::min_(color.getRed(), color.getGreen(), color.getBlue()); 613 const f32 minVal = (f32)core::min_(color.getRed(), color.getGreen(), color.getBlue());
614 Luminance = (maxVal+minVal)*50; 614 Luminance = (maxVal+minVal)*50;
615 if (core::equals(maxVal, minVal)) 615 if (core::equals(maxVal, minVal))
616 { 616 {
617 Hue=0.f; 617 Hue=0.f;
618 Saturation=0.f; 618 Saturation=0.f;
619 return; 619 return;
620 } 620 }
621 621
622 const f32 delta = maxVal-minVal; 622 const f32 delta = maxVal-minVal;
623 if ( Luminance <= 50 ) 623 if ( Luminance <= 50 )
624 { 624 {
625 Saturation = (delta)/(maxVal+minVal); 625 Saturation = (delta)/(maxVal+minVal);
626 } 626 }
627 else 627 else
628 { 628 {
629 Saturation = (delta)/(2-maxVal-minVal); 629 Saturation = (delta)/(2-maxVal-minVal);
630 } 630 }
631 Saturation *= 100; 631 Saturation *= 100;
632 632
633 if (core::equals(maxVal, color.getRed())) 633 if (core::equals(maxVal, color.getRed()))
634 Hue = (color.getGreen()-color.getBlue())/delta; 634 Hue = (color.getGreen()-color.getBlue())/delta;
635 else if (core::equals(maxVal, color.getGreen())) 635 else if (core::equals(maxVal, color.getGreen()))
636 Hue = 2+((color.getBlue()-color.getRed())/delta); 636 Hue = 2+((color.getBlue()-color.getRed())/delta);
637 else // blue is max 637 else // blue is max
638 Hue = 4+((color.getRed()-color.getGreen())/delta); 638 Hue = 4+((color.getRed()-color.getGreen())/delta);
639 639
640 Hue *= 60.0f; 640 Hue *= 60.0f;
641 while ( Hue < 0.f ) 641 while ( Hue < 0.f )
642 Hue += 360; 642 Hue += 360;
643 } 643 }
644 644
645 645
646 inline void SColorHSL::toRGB(SColorf &color) const 646 inline void SColorHSL::toRGB(SColorf &color) const
647 { 647 {
648 const f32 l = Luminance/100; 648 const f32 l = Luminance/100;
649 if (core::iszero(Saturation)) // grey 649 if (core::iszero(Saturation)) // grey
650 { 650 {
651 color.set(l, l, l); 651 color.set(l, l, l);
652 return; 652 return;
653 } 653 }
654 654
655 f32 rm2; 655 f32 rm2;
656 656
657 if ( Luminance <= 50 ) 657 if ( Luminance <= 50 )
658 { 658 {
659 rm2 = l + l * (Saturation/100); 659 rm2 = l + l * (Saturation/100);
660 } 660 }
661 else 661 else
662 { 662 {
663 rm2 = l + (1 - l) * (Saturation/100); 663 rm2 = l + (1 - l) * (Saturation/100);
664 } 664 }
665 665
666 const f32 rm1 = 2.0f * l - rm2; 666 const f32 rm1 = 2.0f * l - rm2;
667 667
668 const f32 h = Hue / 360.0f; 668 const f32 h = Hue / 360.0f;
669 color.set( toRGB1(rm1, rm2, h + 1.f/3.f), 669 color.set( toRGB1(rm1, rm2, h + 1.f/3.f),
670 toRGB1(rm1, rm2, h), 670 toRGB1(rm1, rm2, h),
671 toRGB1(rm1, rm2, h - 1.f/3.f) 671 toRGB1(rm1, rm2, h - 1.f/3.f)
672 ); 672 );
673 } 673 }
674 674
675 675
676 // algorithm from Foley/Van-Dam 676 // algorithm from Foley/Van-Dam
677 inline f32 SColorHSL::toRGB1(f32 rm1, f32 rm2, f32 rh) const 677 inline f32 SColorHSL::toRGB1(f32 rm1, f32 rm2, f32 rh) const
678 { 678 {
679 if (rh<0) 679 if (rh<0)
680 rh += 1; 680 rh += 1;
681 if (rh>1) 681 if (rh>1)
682 rh -= 1; 682 rh -= 1;
683 683
684 if (rh < 1.f/6.f) 684 if (rh < 1.f/6.f)
685 rm1 = rm1 + (rm2 - rm1) * rh*6.f; 685 rm1 = rm1 + (rm2 - rm1) * rh*6.f;
686 else if (rh < 0.5f) 686 else if (rh < 0.5f)
687 rm1 = rm2; 687 rm1 = rm2;
688 else if (rh < 2.f/3.f) 688 else if (rh < 2.f/3.f)
689 rm1 = rm1 + (rm2 - rm1) * ((2.f/3.f)-rh)*6.f; 689 rm1 = rm1 + (rm2 - rm1) * ((2.f/3.f)-rh)*6.f;
690 690
691 return rm1; 691 return rm1;
692 } 692 }
693 693
694} // end namespace video 694} // end namespace video
695} // end namespace irr 695} // end namespace irr
696 696
697#endif 697#endif
diff --git a/libraries/irrlicht-1.8/include/SExposedVideoData.h b/libraries/irrlicht-1.8/include/SExposedVideoData.h
index c30f4a7..2415d55 100644
--- a/libraries/irrlicht-1.8/include/SExposedVideoData.h
+++ b/libraries/irrlicht-1.8/include/SExposedVideoData.h
@@ -1,90 +1,90 @@
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#ifndef __S_EXPOSED_VIDEO_DATA_H_INCLUDED__ 5#ifndef __S_EXPOSED_VIDEO_DATA_H_INCLUDED__
6#define __S_EXPOSED_VIDEO_DATA_H_INCLUDED__ 6#define __S_EXPOSED_VIDEO_DATA_H_INCLUDED__
7 7
8// forward declarations for internal pointers 8// forward declarations for internal pointers
9struct IDirect3D9; 9struct IDirect3D9;
10struct IDirect3DDevice9; 10struct IDirect3DDevice9;
11struct IDirect3D8; 11struct IDirect3D8;
12struct IDirect3DDevice8; 12struct IDirect3DDevice8;
13 13
14namespace irr 14namespace irr
15{ 15{
16namespace video 16namespace video
17{ 17{
18 18
19//! structure for holding data describing a driver and operating system specific data. 19//! structure for holding data describing a driver and operating system specific data.
20/** This data can be retrived by IVideoDriver::getExposedVideoData(). Use this with caution. 20/** This data can be retrived by IVideoDriver::getExposedVideoData(). Use this with caution.
21This only should be used to make it possible to extend the engine easily without 21This only should be used to make it possible to extend the engine easily without
22modification of its source. Note that this structure does not contain any valid data, if 22modification of its source. Note that this structure does not contain any valid data, if
23you are using the software or the null device. 23you are using the software or the null device.
24*/ 24*/
25struct SExposedVideoData 25struct SExposedVideoData
26{ 26{
27 SExposedVideoData() {OpenGLWin32.HDc=0; OpenGLWin32.HRc=0; OpenGLWin32.HWnd=0;} 27 SExposedVideoData() {OpenGLWin32.HDc=0; OpenGLWin32.HRc=0; OpenGLWin32.HWnd=0;}
28 explicit SExposedVideoData(void* Window) {OpenGLWin32.HDc=0; OpenGLWin32.HRc=0; OpenGLWin32.HWnd=Window;} 28 explicit SExposedVideoData(void* Window) {OpenGLWin32.HDc=0; OpenGLWin32.HRc=0; OpenGLWin32.HWnd=Window;}
29 29
30 union 30 union
31 { 31 {
32 struct 32 struct
33 { 33 {
34 //! Pointer to the IDirect3D9 interface 34 //! Pointer to the IDirect3D9 interface
35 IDirect3D9* D3D9; 35 IDirect3D9* D3D9;
36 36
37 //! Pointer to the IDirect3DDevice9 interface 37 //! Pointer to the IDirect3DDevice9 interface
38 IDirect3DDevice9* D3DDev9; 38 IDirect3DDevice9* D3DDev9;
39 39
40 //! Window handle. 40 //! Window handle.
41 /** Get with for example HWND h = reinterpret_cast<HWND>(exposedData.D3D9.HWnd) */ 41 /** Get with for example HWND h = reinterpret_cast<HWND>(exposedData.D3D9.HWnd) */
42 void* HWnd; 42 void* HWnd;
43 43
44 } D3D9; 44 } D3D9;
45 45
46 struct 46 struct
47 { 47 {
48 //! Pointer to the IDirect3D8 interface 48 //! Pointer to the IDirect3D8 interface
49 IDirect3D8* D3D8; 49 IDirect3D8* D3D8;
50 50
51 //! Pointer to the IDirect3DDevice8 interface 51 //! Pointer to the IDirect3DDevice8 interface
52 IDirect3DDevice8* D3DDev8; 52 IDirect3DDevice8* D3DDev8;
53 53
54 //! Window handle. 54 //! Window handle.
55 /** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.D3D8.HWnd) */ 55 /** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.D3D8.HWnd) */
56 void* HWnd; 56 void* HWnd;
57 57
58 } D3D8; 58 } D3D8;
59 59
60 struct 60 struct
61 { 61 {
62 //! Private GDI Device Context. 62 //! Private GDI Device Context.
63 /** Get if for example with: HDC h = reinterpret_cast<HDC>(exposedData.OpenGLWin32.HDc) */ 63 /** Get if for example with: HDC h = reinterpret_cast<HDC>(exposedData.OpenGLWin32.HDc) */
64 void* HDc; 64 void* HDc;
65 65
66 //! Permanent Rendering Context. 66 //! Permanent Rendering Context.
67 /** Get if for example with: HGLRC h = reinterpret_cast<HGLRC>(exposedData.OpenGLWin32.HRc) */ 67 /** Get if for example with: HGLRC h = reinterpret_cast<HGLRC>(exposedData.OpenGLWin32.HRc) */
68 void* HRc; 68 void* HRc;
69 69
70 //! Window handle. 70 //! Window handle.
71 /** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd) */ 71 /** Get with for example with: HWND h = reinterpret_cast<HWND>(exposedData.OpenGLWin32.HWnd) */
72 void* HWnd; 72 void* HWnd;
73 } OpenGLWin32; 73 } OpenGLWin32;
74 74
75 struct 75 struct
76 { 76 {
77 // XWindow handles 77 // XWindow handles
78 void* X11Display; 78 void* X11Display;
79 void* X11Context; 79 void* X11Context;
80 unsigned long X11Window; 80 unsigned long X11Window;
81 } OpenGLLinux; 81 } OpenGLLinux;
82 }; 82 };
83}; 83};
84 84
85} // end namespace video 85} // end namespace video
86} // end namespace irr 86} // end namespace irr
87 87
88 88
89#endif 89#endif
90 90
diff --git a/libraries/irrlicht-1.8/include/SIrrCreationParameters.h b/libraries/irrlicht-1.8/include/SIrrCreationParameters.h
index 89dff19..63395d7 100644
--- a/libraries/irrlicht-1.8/include/SIrrCreationParameters.h
+++ b/libraries/irrlicht-1.8/include/SIrrCreationParameters.h
@@ -1,301 +1,301 @@
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#ifndef __I_IRRLICHT_CREATION_PARAMETERS_H_INCLUDED__ 5#ifndef __I_IRRLICHT_CREATION_PARAMETERS_H_INCLUDED__
6#define __I_IRRLICHT_CREATION_PARAMETERS_H_INCLUDED__ 6#define __I_IRRLICHT_CREATION_PARAMETERS_H_INCLUDED__
7 7
8#include "EDriverTypes.h" 8#include "EDriverTypes.h"
9#include "EDeviceTypes.h" 9#include "EDeviceTypes.h"
10#include "dimension2d.h" 10#include "dimension2d.h"
11#include "ILogger.h" 11#include "ILogger.h"
12#include "SExposedVideoData.h" 12#include "SExposedVideoData.h"
13 13
14namespace irr 14namespace irr
15{ 15{
16 class IEventReceiver; 16 class IEventReceiver;
17 17
18 //! Structure for holding Irrlicht Device creation parameters. 18 //! Structure for holding Irrlicht Device creation parameters.
19 /** This structure is used in the createDeviceEx() function. */ 19 /** This structure is used in the createDeviceEx() function. */
20 struct SIrrlichtCreationParameters 20 struct SIrrlichtCreationParameters
21 { 21 {
22 //! Constructs a SIrrlichtCreationParameters structure with default values. 22 //! Constructs a SIrrlichtCreationParameters structure with default values.
23 SIrrlichtCreationParameters() : 23 SIrrlichtCreationParameters() :
24 DeviceType(EIDT_BEST), 24 DeviceType(EIDT_BEST),
25 DriverType(video::EDT_BURNINGSVIDEO), 25 DriverType(video::EDT_BURNINGSVIDEO),
26 WindowSize(core::dimension2d<u32>(800, 600)), 26 WindowSize(core::dimension2d<u32>(800, 600)),
27 Bits(16), 27 Bits(16),
28 ZBufferBits(16), 28 ZBufferBits(16),
29 Fullscreen(false), 29 Fullscreen(false),
30 Stencilbuffer(false), 30 Stencilbuffer(false),
31 Vsync(false), 31 Vsync(false),
32 AntiAlias(0), 32 AntiAlias(0),
33 HandleSRGB(false), 33 HandleSRGB(false),
34 WithAlphaChannel(false), 34 WithAlphaChannel(false),
35 Doublebuffer(true), 35 Doublebuffer(true),
36 IgnoreInput(false), 36 IgnoreInput(false),
37 Stereobuffer(false), 37 Stereobuffer(false),
38 HighPrecisionFPU(false), 38 HighPrecisionFPU(false),
39 EventReceiver(0), 39 EventReceiver(0),
40 WindowId(0), 40 WindowId(0),
41 VideoData(0), 41 VideoData(0),
42#ifdef _DEBUG 42#ifdef _DEBUG
43 LoggingLevel(ELL_DEBUG), 43 LoggingLevel(ELL_DEBUG),
44#else 44#else
45 LoggingLevel(ELL_INFORMATION), 45 LoggingLevel(ELL_INFORMATION),
46#endif 46#endif
47 DisplayAdapter(0), 47 DisplayAdapter(0),
48 DriverMultithreaded(false), 48 DriverMultithreaded(false),
49 UsePerformanceTimer(true), 49 UsePerformanceTimer(true),
50 SDK_version_do_not_use(IRRLICHT_SDK_VERSION) 50 SDK_version_do_not_use(IRRLICHT_SDK_VERSION)
51 { 51 {
52 } 52 }
53 53
54 SIrrlichtCreationParameters(const SIrrlichtCreationParameters& other) : 54 SIrrlichtCreationParameters(const SIrrlichtCreationParameters& other) :
55 SDK_version_do_not_use(IRRLICHT_SDK_VERSION) 55 SDK_version_do_not_use(IRRLICHT_SDK_VERSION)
56 {*this = other;} 56 {*this = other;}
57 57
58 SIrrlichtCreationParameters& operator=(const SIrrlichtCreationParameters& other) 58 SIrrlichtCreationParameters& operator=(const SIrrlichtCreationParameters& other)
59 { 59 {
60 DeviceType = other.DeviceType; 60 DeviceType = other.DeviceType;
61 DriverType = other.DriverType; 61 DriverType = other.DriverType;
62 WindowSize = other.WindowSize; 62 WindowSize = other.WindowSize;
63 Bits = other.Bits; 63 Bits = other.Bits;
64 ZBufferBits = other.ZBufferBits; 64 ZBufferBits = other.ZBufferBits;
65 Fullscreen = other.Fullscreen; 65 Fullscreen = other.Fullscreen;
66 Stencilbuffer = other.Stencilbuffer; 66 Stencilbuffer = other.Stencilbuffer;
67 Vsync = other.Vsync; 67 Vsync = other.Vsync;
68 AntiAlias = other.AntiAlias; 68 AntiAlias = other.AntiAlias;
69 HandleSRGB = other.HandleSRGB; 69 HandleSRGB = other.HandleSRGB;
70 WithAlphaChannel = other.WithAlphaChannel; 70 WithAlphaChannel = other.WithAlphaChannel;
71 Doublebuffer = other.Doublebuffer; 71 Doublebuffer = other.Doublebuffer;
72 IgnoreInput = other.IgnoreInput; 72 IgnoreInput = other.IgnoreInput;
73 Stereobuffer = other.Stereobuffer; 73 Stereobuffer = other.Stereobuffer;
74 HighPrecisionFPU = other.HighPrecisionFPU; 74 HighPrecisionFPU = other.HighPrecisionFPU;
75 EventReceiver = other.EventReceiver; 75 EventReceiver = other.EventReceiver;
76 WindowId = other.WindowId; 76 WindowId = other.WindowId;
77 VideoData = other.VideoData; 77 VideoData = other.VideoData;
78 LoggingLevel = other.LoggingLevel; 78 LoggingLevel = other.LoggingLevel;
79 DriverMultithreaded = other.DriverMultithreaded; 79 DriverMultithreaded = other.DriverMultithreaded;
80 DisplayAdapter = other.DisplayAdapter; 80 DisplayAdapter = other.DisplayAdapter;
81 UsePerformanceTimer = other.UsePerformanceTimer; 81 UsePerformanceTimer = other.UsePerformanceTimer;
82 return *this; 82 return *this;
83 } 83 }
84 84
85 //! Type of the device. 85 //! Type of the device.
86 /** This setting decides the windowing system used by the device, most device types are native 86 /** This setting decides the windowing system used by the device, most device types are native
87 to a specific operating system and so may not be available. 87 to a specific operating system and so may not be available.
88 EIDT_WIN32 is only available on Windows desktops, 88 EIDT_WIN32 is only available on Windows desktops,
89 EIDT_WINCE is only available on Windows mobile devices, 89 EIDT_WINCE is only available on Windows mobile devices,
90 EIDT_COCOA is only available on Mac OSX, 90 EIDT_COCOA is only available on Mac OSX,
91 EIDT_X11 is available on Linux, Solaris, BSD and other operating systems which use X11, 91 EIDT_X11 is available on Linux, Solaris, BSD and other operating systems which use X11,
92 EIDT_SDL is available on most systems if compiled in, 92 EIDT_SDL is available on most systems if compiled in,
93 EIDT_CONSOLE is usually available but can only render to text, 93 EIDT_CONSOLE is usually available but can only render to text,
94 EIDT_BEST will select the best available device for your operating system. 94 EIDT_BEST will select the best available device for your operating system.
95 Default: EIDT_BEST. */ 95 Default: EIDT_BEST. */
96 E_DEVICE_TYPE DeviceType; 96 E_DEVICE_TYPE DeviceType;
97 97
98 //! Type of video driver used to render graphics. 98 //! Type of video driver used to render graphics.
99 /** This can currently be video::EDT_NULL, video::EDT_SOFTWARE, 99 /** This can currently be video::EDT_NULL, video::EDT_SOFTWARE,
100 video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D8, 100 video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D8,
101 video::EDT_DIRECT3D9, and video::EDT_OPENGL. 101 video::EDT_DIRECT3D9, and video::EDT_OPENGL.
102 Default: Software. */ 102 Default: Software. */
103 video::E_DRIVER_TYPE DriverType; 103 video::E_DRIVER_TYPE DriverType;
104 104
105 //! Size of the window or the video mode in fullscreen mode. Default: 800x600 105 //! Size of the window or the video mode in fullscreen mode. Default: 800x600
106 core::dimension2d<u32> WindowSize; 106 core::dimension2d<u32> WindowSize;
107 107
108 //! Minimum Bits per pixel of the color buffer in fullscreen mode. Ignored if windowed mode. Default: 16. 108 //! Minimum Bits per pixel of the color buffer in fullscreen mode. Ignored if windowed mode. Default: 16.
109 u8 Bits; 109 u8 Bits;
110 110
111 //! Minimum Bits per pixel of the depth buffer. Default: 16. 111 //! Minimum Bits per pixel of the depth buffer. Default: 16.
112 u8 ZBufferBits; 112 u8 ZBufferBits;
113 113
114 //! Should be set to true if the device should run in fullscreen. 114 //! Should be set to true if the device should run in fullscreen.
115 /** Otherwise the device runs in windowed mode. Default: false. */ 115 /** Otherwise the device runs in windowed mode. Default: false. */
116 bool Fullscreen; 116 bool Fullscreen;
117 117
118 //! Specifies if the stencil buffer should be enabled. 118 //! Specifies if the stencil buffer should be enabled.
119 /** Set this to true, if you want the engine be able to draw 119 /** Set this to true, if you want the engine be able to draw
120 stencil buffer shadows. Note that not all drivers are able to 120 stencil buffer shadows. Note that not all drivers are able to
121 use the stencil buffer, hence it can be ignored during device 121 use the stencil buffer, hence it can be ignored during device
122 creation. Without the stencil buffer no shadows will be drawn. 122 creation. Without the stencil buffer no shadows will be drawn.
123 Default: false. */ 123 Default: false. */
124 bool Stencilbuffer; 124 bool Stencilbuffer;
125 125
126 //! Specifies vertical syncronisation. 126 //! Specifies vertical syncronisation.
127 /** If set to true, the driver will wait for the vertical 127 /** If set to true, the driver will wait for the vertical
128 retrace period, otherwise not. May be silently ignored. 128 retrace period, otherwise not. May be silently ignored.
129 Default: false */ 129 Default: false */
130 bool Vsync; 130 bool Vsync;
131 131
132 //! Specifies if the device should use fullscreen anti aliasing 132 //! Specifies if the device should use fullscreen anti aliasing
133 /** Makes sharp/pixelated edges softer, but requires more 133 /** Makes sharp/pixelated edges softer, but requires more
134 performance. Also, 2D elements might look blurred with this 134 performance. Also, 2D elements might look blurred with this
135 switched on. The resulting rendering quality also depends on 135 switched on. The resulting rendering quality also depends on
136 the hardware and driver you are using, your program might look 136 the hardware and driver you are using, your program might look
137 different on different hardware with this. So if you are 137 different on different hardware with this. So if you are
138 writing a game/application with AntiAlias switched on, it would 138 writing a game/application with AntiAlias switched on, it would
139 be a good idea to make it possible to switch this option off 139 be a good idea to make it possible to switch this option off
140 again by the user. 140 again by the user.
141 The value is the maximal antialiasing factor requested for 141 The value is the maximal antialiasing factor requested for
142 the device. The cretion method will automatically try smaller 142 the device. The cretion method will automatically try smaller
143 values if no window can be created with the given value. 143 values if no window can be created with the given value.
144 Value one is usually the same as 0 (disabled), but might be a 144 Value one is usually the same as 0 (disabled), but might be a
145 special value on some platforms. On D3D devices it maps to 145 special value on some platforms. On D3D devices it maps to
146 NONMASKABLE. 146 NONMASKABLE.
147 Default value: 0 - disabled */ 147 Default value: 0 - disabled */
148 u8 AntiAlias; 148 u8 AntiAlias;
149 149
150 //! Flag to enable proper sRGB and linear color handling 150 //! Flag to enable proper sRGB and linear color handling
151 /** In most situations, it is desireable to have the color handling in 151 /** In most situations, it is desireable to have the color handling in
152 non-linear sRGB color space, and only do the intermediate color 152 non-linear sRGB color space, and only do the intermediate color
153 calculations in linear RGB space. If this flag is enabled, the device and 153 calculations in linear RGB space. If this flag is enabled, the device and
154 driver try to assure that all color input and output are color corrected 154 driver try to assure that all color input and output are color corrected
155 and only the internal color representation is linear. This means, that 155 and only the internal color representation is linear. This means, that
156 the color output is properly gamma-adjusted to provide the brighter 156 the color output is properly gamma-adjusted to provide the brighter
157 colors for monitor display. And that blending and lighting give a more 157 colors for monitor display. And that blending and lighting give a more
158 natural look, due to proper conversion from non-linear colors into linear 158 natural look, due to proper conversion from non-linear colors into linear
159 color space for blend operations. If this flag is enabled, all texture colors 159 color space for blend operations. If this flag is enabled, all texture colors
160 (which are usually in sRGB space) are correctly displayed. However vertex colors 160 (which are usually in sRGB space) are correctly displayed. However vertex colors
161 and other explicitly set values have to be manually encoded in linear color space. 161 and other explicitly set values have to be manually encoded in linear color space.
162 Default value: false. */ 162 Default value: false. */
163 bool HandleSRGB; 163 bool HandleSRGB;
164 164
165 //! Whether the main framebuffer uses an alpha channel. 165 //! Whether the main framebuffer uses an alpha channel.
166 /** In some situations it might be desireable to get a color 166 /** In some situations it might be desireable to get a color
167 buffer with an alpha channel, e.g. when rendering into a 167 buffer with an alpha channel, e.g. when rendering into a
168 transparent window or overlay. If this flag is set the device 168 transparent window or overlay. If this flag is set the device
169 tries to create a framebuffer with alpha channel. 169 tries to create a framebuffer with alpha channel.
170 If this flag is set, only color buffers with alpha channel 170 If this flag is set, only color buffers with alpha channel
171 are considered. Otherwise, it depends on the actual hardware 171 are considered. Otherwise, it depends on the actual hardware
172 if the colorbuffer has an alpha channel or not. 172 if the colorbuffer has an alpha channel or not.
173 Default value: false */ 173 Default value: false */
174 bool WithAlphaChannel; 174 bool WithAlphaChannel;
175 175
176 //! Whether the main framebuffer uses doublebuffering. 176 //! Whether the main framebuffer uses doublebuffering.
177 /** This should be usually enabled, in order to avoid render 177 /** This should be usually enabled, in order to avoid render
178 artifacts on the visible framebuffer. However, it might be 178 artifacts on the visible framebuffer. However, it might be
179 useful to use only one buffer on very small devices. If no 179 useful to use only one buffer on very small devices. If no
180 doublebuffering is available, the drivers will fall back to 180 doublebuffering is available, the drivers will fall back to
181 single buffers. Default value: true */ 181 single buffers. Default value: true */
182 bool Doublebuffer; 182 bool Doublebuffer;
183 183
184 //! Specifies if the device should ignore input events 184 //! Specifies if the device should ignore input events
185 /** This is only relevant when using external I/O handlers. 185 /** This is only relevant when using external I/O handlers.
186 External windows need to take care of this themselves. 186 External windows need to take care of this themselves.
187 Currently only supported by X11. 187 Currently only supported by X11.
188 Default value: false */ 188 Default value: false */
189 bool IgnoreInput; 189 bool IgnoreInput;
190 190
191 //! Specifies if the device should use stereo buffers 191 //! Specifies if the device should use stereo buffers
192 /** Some high-end gfx cards support two framebuffers for direct 192 /** Some high-end gfx cards support two framebuffers for direct
193 support of stereoscopic output devices. If this flag is set the 193 support of stereoscopic output devices. If this flag is set the
194 device tries to create a stereo context. 194 device tries to create a stereo context.
195 Currently only supported by OpenGL. 195 Currently only supported by OpenGL.
196 Default value: false */ 196 Default value: false */
197 bool Stereobuffer; 197 bool Stereobuffer;
198 198
199 //! Specifies if the device should use high precision FPU setting 199 //! Specifies if the device should use high precision FPU setting
200 /** This is only relevant for DirectX Devices, which switch to 200 /** This is only relevant for DirectX Devices, which switch to
201 low FPU precision by default for performance reasons. However, 201 low FPU precision by default for performance reasons. However,
202 this may lead to problems with the other computations of the 202 this may lead to problems with the other computations of the
203 application. In this case setting this flag to true should help 203 application. In this case setting this flag to true should help
204 - on the expense of performance loss, though. 204 - on the expense of performance loss, though.
205 Default value: false */ 205 Default value: false */
206 bool HighPrecisionFPU; 206 bool HighPrecisionFPU;
207 207
208 //! A user created event receiver. 208 //! A user created event receiver.
209 IEventReceiver* EventReceiver; 209 IEventReceiver* EventReceiver;
210 210
211 //! Window Id. 211 //! Window Id.
212 /** If this is set to a value other than 0, the Irrlicht Engine 212 /** If this is set to a value other than 0, the Irrlicht Engine
213 will be created in an already existing window. For windows, set 213 will be created in an already existing window. For windows, set
214 this to the HWND of the window you want. The windowSize and 214 this to the HWND of the window you want. The windowSize and
215 FullScreen options will be ignored when using the WindowId 215 FullScreen options will be ignored when using the WindowId
216 parameter. Default this is set to 0. 216 parameter. Default this is set to 0.
217 To make Irrlicht run inside the custom window, you still will 217 To make Irrlicht run inside the custom window, you still will
218 have to draw Irrlicht on your own. You can use this loop, as 218 have to draw Irrlicht on your own. You can use this loop, as
219 usual: 219 usual:
220 \code 220 \code
221 while (device->run()) 221 while (device->run())
222 { 222 {
223 driver->beginScene(true, true, 0); 223 driver->beginScene(true, true, 0);
224 smgr->drawAll(); 224 smgr->drawAll();
225 driver->endScene(); 225 driver->endScene();
226 } 226 }
227 \endcode 227 \endcode
228 Instead of this, you can also simply use your own message loop 228 Instead of this, you can also simply use your own message loop
229 using GetMessage, DispatchMessage and whatever. Calling 229 using GetMessage, DispatchMessage and whatever. Calling
230 IrrlichtDevice::run() will cause Irrlicht to dispatch messages 230 IrrlichtDevice::run() will cause Irrlicht to dispatch messages
231 internally too. You need not call Device->run() if you want to 231 internally too. You need not call Device->run() if you want to
232 do your own message dispatching loop, but Irrlicht will not be 232 do your own message dispatching loop, but Irrlicht will not be
233 able to fetch user input then and you have to do it on your own 233 able to fetch user input then and you have to do it on your own
234 using the window messages, DirectInput, or whatever. Also, 234 using the window messages, DirectInput, or whatever. Also,
235 you'll have to increment the Irrlicht timer. 235 you'll have to increment the Irrlicht timer.
236 An alternative, own message dispatching loop without 236 An alternative, own message dispatching loop without
237 device->run() would look like this: 237 device->run() would look like this:
238 \code 238 \code
239 MSG msg; 239 MSG msg;
240 while (true) 240 while (true)
241 { 241 {
242 if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) 242 if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
243 { 243 {
244 TranslateMessage(&msg); 244 TranslateMessage(&msg);
245 DispatchMessage(&msg); 245 DispatchMessage(&msg);
246 246
247 if (msg.message == WM_QUIT) 247 if (msg.message == WM_QUIT)
248 break; 248 break;
249 } 249 }
250 250
251 // increase virtual timer time 251 // increase virtual timer time
252 device->getTimer()->tick(); 252 device->getTimer()->tick();
253 253
254 // draw engine picture 254 // draw engine picture
255 driver->beginScene(true, true, 0); 255 driver->beginScene(true, true, 0);
256 smgr->drawAll(); 256 smgr->drawAll();
257 driver->endScene(); 257 driver->endScene();
258 } 258 }
259 \endcode 259 \endcode
260 However, there is no need to draw the picture this often. Just 260 However, there is no need to draw the picture this often. Just
261 do it how you like. */ 261 do it how you like. */
262 void* WindowId; 262 void* WindowId;
263 263
264 video::SExposedVideoData *VideoData; 264 video::SExposedVideoData *VideoData;
265 265
266 //! Specifies the logging level used in the logging interface. 266 //! Specifies the logging level used in the logging interface.
267 /** The default value is ELL_INFORMATION. You can access the ILogger interface 267 /** The default value is ELL_INFORMATION. You can access the ILogger interface
268 later on from the IrrlichtDevice with getLogger() and set another level. 268 later on from the IrrlichtDevice with getLogger() and set another level.
269 But if you need more or less logging information already from device creation, 269 But if you need more or less logging information already from device creation,
270 then you have to change it here. 270 then you have to change it here.
271 */ 271 */
272 ELOG_LEVEL LoggingLevel; 272 ELOG_LEVEL LoggingLevel;
273 273
274 //! Allows to select which graphic card is used for rendering when more than one card is in the system. 274 //! Allows to select which graphic card is used for rendering when more than one card is in the system.
275 /** So far only supported on D3D */ 275 /** So far only supported on D3D */
276 u32 DisplayAdapter; 276 u32 DisplayAdapter;
277 277
278 //! Create the driver multithreaded. 278 //! Create the driver multithreaded.
279 /** Default is false. Enabling this can slow down your application. 279 /** Default is false. Enabling this can slow down your application.
280 Note that this does _not_ make Irrlicht threadsafe, but only the underlying driver-API for the graphiccard. 280 Note that this does _not_ make Irrlicht threadsafe, but only the underlying driver-API for the graphiccard.
281 So far only supported on D3D. */ 281 So far only supported on D3D. */
282 bool DriverMultithreaded; 282 bool DriverMultithreaded;
283 283
284 //! Enables use of high performance timers on Windows platform. 284 //! Enables use of high performance timers on Windows platform.
285 /** When performance timers are not used, standard GetTickCount() 285 /** When performance timers are not used, standard GetTickCount()
286 is used instead which usually has worse resolution, but also less 286 is used instead which usually has worse resolution, but also less
287 problems with speed stepping and other techniques. 287 problems with speed stepping and other techniques.
288 */ 288 */
289 bool UsePerformanceTimer; 289 bool UsePerformanceTimer;
290 290
291 //! Don't use or change this parameter. 291 //! Don't use or change this parameter.
292 /** Always set it to IRRLICHT_SDK_VERSION, which is done by default. 292 /** Always set it to IRRLICHT_SDK_VERSION, which is done by default.
293 This is needed for sdk version checks. */ 293 This is needed for sdk version checks. */
294 const c8* const SDK_version_do_not_use; 294 const c8* const SDK_version_do_not_use;
295 }; 295 };
296 296
297 297
298} // end namespace irr 298} // end namespace irr
299 299
300#endif 300#endif
301 301
diff --git a/libraries/irrlicht-1.8/include/SKeyMap.h b/libraries/irrlicht-1.8/include/SKeyMap.h
index 793cd98..55aa5f9 100644
--- a/libraries/irrlicht-1.8/include/SKeyMap.h
+++ b/libraries/irrlicht-1.8/include/SKeyMap.h
@@ -1,41 +1,41 @@
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#ifndef __S_KEY_MAP_H_INCLUDED__ 5#ifndef __S_KEY_MAP_H_INCLUDED__
6#define __S_KEY_MAP_H_INCLUDED__ 6#define __S_KEY_MAP_H_INCLUDED__
7 7
8#include "Keycodes.h" 8#include "Keycodes.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12 12
13 //! enumeration for key actions. Used for example in the FPS Camera. 13 //! enumeration for key actions. Used for example in the FPS Camera.
14 enum EKEY_ACTION 14 enum EKEY_ACTION
15 { 15 {
16 EKA_MOVE_FORWARD = 0, 16 EKA_MOVE_FORWARD = 0,
17 EKA_MOVE_BACKWARD, 17 EKA_MOVE_BACKWARD,
18 EKA_STRAFE_LEFT, 18 EKA_STRAFE_LEFT,
19 EKA_STRAFE_RIGHT, 19 EKA_STRAFE_RIGHT,
20 EKA_JUMP_UP, 20 EKA_JUMP_UP,
21 EKA_CROUCH, 21 EKA_CROUCH,
22 EKA_COUNT, 22 EKA_COUNT,
23 23
24 //! This value is not used. It only forces this enumeration to compile in 32 bit. 24 //! This value is not used. It only forces this enumeration to compile in 32 bit.
25 EKA_FORCE_32BIT = 0x7fffffff 25 EKA_FORCE_32BIT = 0x7fffffff
26 }; 26 };
27 27
28 //! Struct storing which key belongs to which action. 28 //! Struct storing which key belongs to which action.
29 struct SKeyMap 29 struct SKeyMap
30 { 30 {
31 SKeyMap() {} 31 SKeyMap() {}
32 SKeyMap(EKEY_ACTION action, EKEY_CODE keyCode) : Action(action), KeyCode(keyCode) {} 32 SKeyMap(EKEY_ACTION action, EKEY_CODE keyCode) : Action(action), KeyCode(keyCode) {}
33 33
34 EKEY_ACTION Action; 34 EKEY_ACTION Action;
35 EKEY_CODE KeyCode; 35 EKEY_CODE KeyCode;
36 }; 36 };
37 37
38} // end namespace irr 38} // end namespace irr
39 39
40#endif 40#endif
41 41
diff --git a/libraries/irrlicht-1.8/include/SLight.h b/libraries/irrlicht-1.8/include/SLight.h
index f809d2e..022c40a 100644
--- a/libraries/irrlicht-1.8/include/SLight.h
+++ b/libraries/irrlicht-1.8/include/SLight.h
@@ -1,98 +1,98 @@
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#ifndef __S_LIGHT_H_INCLUDED__ 5#ifndef __S_LIGHT_H_INCLUDED__
6#define __S_LIGHT_H_INCLUDED__ 6#define __S_LIGHT_H_INCLUDED__
7 7
8#include "SColor.h" 8#include "SColor.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace video 12namespace video
13{ 13{
14 14
15//! Enumeration for different types of lights 15//! Enumeration for different types of lights
16enum E_LIGHT_TYPE 16enum E_LIGHT_TYPE
17{ 17{
18 //! point light, it has a position in space and radiates light in all directions 18 //! point light, it has a position in space and radiates light in all directions
19 ELT_POINT, 19 ELT_POINT,
20 //! spot light, it has a position in space, a direction, and a limited cone of influence 20 //! spot light, it has a position in space, a direction, and a limited cone of influence
21 ELT_SPOT, 21 ELT_SPOT,
22 //! directional light, coming from a direction from an infinite distance 22 //! directional light, coming from a direction from an infinite distance
23 ELT_DIRECTIONAL, 23 ELT_DIRECTIONAL,
24 24
25 //! Only used for counting the elements of this enum 25 //! Only used for counting the elements of this enum
26 ELT_COUNT 26 ELT_COUNT
27}; 27};
28 28
29//! Names for light types 29//! Names for light types
30const c8* const LightTypeNames[] = 30const c8* const LightTypeNames[] =
31{ 31{
32 "Point", 32 "Point",
33 "Spot", 33 "Spot",
34 "Directional", 34 "Directional",
35 0 35 0
36}; 36};
37 37
38//! structure for holding data describing a dynamic point light. 38//! structure for holding data describing a dynamic point light.
39/** Irrlicht supports point lights, spot lights, and directional lights. 39/** Irrlicht supports point lights, spot lights, and directional lights.
40*/ 40*/
41struct SLight 41struct SLight
42{ 42{
43 SLight() : AmbientColor(0.f,0.f,0.f), DiffuseColor(1.f,1.f,1.f), 43 SLight() : AmbientColor(0.f,0.f,0.f), DiffuseColor(1.f,1.f,1.f),
44 SpecularColor(1.f,1.f,1.f), Attenuation(1.f,0.f,0.f), 44 SpecularColor(1.f,1.f,1.f), Attenuation(1.f,0.f,0.f),
45 OuterCone(45.f), InnerCone(0.f), Falloff(2.f), 45 OuterCone(45.f), InnerCone(0.f), Falloff(2.f),
46 Position(0.f,0.f,0.f), Direction(0.f,0.f,1.f), 46 Position(0.f,0.f,0.f), Direction(0.f,0.f,1.f),
47 Radius(100.f), Type(ELT_POINT), CastShadows(true) 47 Radius(100.f), Type(ELT_POINT), CastShadows(true)
48 {} 48 {}
49 49
50 //! Ambient color emitted by the light 50 //! Ambient color emitted by the light
51 SColorf AmbientColor; 51 SColorf AmbientColor;
52 52
53 //! Diffuse color emitted by the light. 53 //! Diffuse color emitted by the light.
54 /** This is the primary color you want to set. */ 54 /** This is the primary color you want to set. */
55 SColorf DiffuseColor; 55 SColorf DiffuseColor;
56 56
57 //! Specular color emitted by the light. 57 //! Specular color emitted by the light.
58 /** For details how to use specular highlights, see SMaterial::Shininess */ 58 /** For details how to use specular highlights, see SMaterial::Shininess */
59 SColorf SpecularColor; 59 SColorf SpecularColor;
60 60
61 //! Attenuation factors (constant, linear, quadratic) 61 //! Attenuation factors (constant, linear, quadratic)
62 /** Changes the light strength fading over distance. 62 /** Changes the light strength fading over distance.
63 Can also be altered by setting the radius, Attenuation will change to 63 Can also be altered by setting the radius, Attenuation will change to
64 (0,1.f/radius,0). Can be overridden after radius was set. */ 64 (0,1.f/radius,0). Can be overridden after radius was set. */
65 core::vector3df Attenuation; 65 core::vector3df Attenuation;
66 66
67 //! The angle of the spot's outer cone. Ignored for other lights. 67 //! The angle of the spot's outer cone. Ignored for other lights.
68 f32 OuterCone; 68 f32 OuterCone;
69 69
70 //! The angle of the spot's inner cone. Ignored for other lights. 70 //! The angle of the spot's inner cone. Ignored for other lights.
71 f32 InnerCone; 71 f32 InnerCone;
72 72
73 //! The light strength's decrease between Outer and Inner cone. 73 //! The light strength's decrease between Outer and Inner cone.
74 f32 Falloff; 74 f32 Falloff;
75 75
76 //! Read-ONLY! Position of the light. 76 //! Read-ONLY! Position of the light.
77 /** If Type is ELT_DIRECTIONAL, it is ignored. Changed via light scene node's position. */ 77 /** If Type is ELT_DIRECTIONAL, it is ignored. Changed via light scene node's position. */
78 core::vector3df Position; 78 core::vector3df Position;
79 79
80 //! Read-ONLY! Direction of the light. 80 //! Read-ONLY! Direction of the light.
81 /** If Type is ELT_POINT, it is ignored. Changed via light scene node's rotation. */ 81 /** If Type is ELT_POINT, it is ignored. Changed via light scene node's rotation. */
82 core::vector3df Direction; 82 core::vector3df Direction;
83 83
84 //! Read-ONLY! Radius of light. Everything within this radius will be lighted. 84 //! Read-ONLY! Radius of light. Everything within this radius will be lighted.
85 f32 Radius; 85 f32 Radius;
86 86
87 //! Read-ONLY! Type of the light. Default: ELT_POINT 87 //! Read-ONLY! Type of the light. Default: ELT_POINT
88 E_LIGHT_TYPE Type; 88 E_LIGHT_TYPE Type;
89 89
90 //! Read-ONLY! Does the light cast shadows? 90 //! Read-ONLY! Does the light cast shadows?
91 bool CastShadows:1; 91 bool CastShadows:1;
92}; 92};
93 93
94} // end namespace video 94} // end namespace video
95} // end namespace irr 95} // end namespace irr
96 96
97#endif 97#endif
98 98
diff --git a/libraries/irrlicht-1.8/include/SMaterial.h b/libraries/irrlicht-1.8/include/SMaterial.h
index 3172241..a1c3ff4 100644
--- a/libraries/irrlicht-1.8/include/SMaterial.h
+++ b/libraries/irrlicht-1.8/include/SMaterial.h
@@ -1,685 +1,685 @@
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#ifndef __S_MATERIAL_H_INCLUDED__ 5#ifndef __S_MATERIAL_H_INCLUDED__
6#define __S_MATERIAL_H_INCLUDED__ 6#define __S_MATERIAL_H_INCLUDED__
7 7
8#include "SColor.h" 8#include "SColor.h"
9#include "matrix4.h" 9#include "matrix4.h"
10#include "irrArray.h" 10#include "irrArray.h"
11#include "irrMath.h" 11#include "irrMath.h"
12#include "EMaterialTypes.h" 12#include "EMaterialTypes.h"
13#include "EMaterialFlags.h" 13#include "EMaterialFlags.h"
14#include "SMaterialLayer.h" 14#include "SMaterialLayer.h"
15 15
16namespace irr 16namespace irr
17{ 17{
18namespace video 18namespace video
19{ 19{
20 class ITexture; 20 class ITexture;
21 21
22 //! Flag for EMT_ONETEXTURE_BLEND, ( BlendFactor ) BlendFunc = source * sourceFactor + dest * destFactor 22 //! Flag for EMT_ONETEXTURE_BLEND, ( BlendFactor ) BlendFunc = source * sourceFactor + dest * destFactor
23 enum E_BLEND_FACTOR 23 enum E_BLEND_FACTOR
24 { 24 {
25 EBF_ZERO = 0, //!< src & dest (0, 0, 0, 0) 25 EBF_ZERO = 0, //!< src & dest (0, 0, 0, 0)
26 EBF_ONE, //!< src & dest (1, 1, 1, 1) 26 EBF_ONE, //!< src & dest (1, 1, 1, 1)
27 EBF_DST_COLOR, //!< src (destR, destG, destB, destA) 27 EBF_DST_COLOR, //!< src (destR, destG, destB, destA)
28 EBF_ONE_MINUS_DST_COLOR, //!< src (1-destR, 1-destG, 1-destB, 1-destA) 28 EBF_ONE_MINUS_DST_COLOR, //!< src (1-destR, 1-destG, 1-destB, 1-destA)
29 EBF_SRC_COLOR, //!< dest (srcR, srcG, srcB, srcA) 29 EBF_SRC_COLOR, //!< dest (srcR, srcG, srcB, srcA)
30 EBF_ONE_MINUS_SRC_COLOR, //!< dest (1-srcR, 1-srcG, 1-srcB, 1-srcA) 30 EBF_ONE_MINUS_SRC_COLOR, //!< dest (1-srcR, 1-srcG, 1-srcB, 1-srcA)
31 EBF_SRC_ALPHA, //!< src & dest (srcA, srcA, srcA, srcA) 31 EBF_SRC_ALPHA, //!< src & dest (srcA, srcA, srcA, srcA)
32 EBF_ONE_MINUS_SRC_ALPHA, //!< src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA) 32 EBF_ONE_MINUS_SRC_ALPHA, //!< src & dest (1-srcA, 1-srcA, 1-srcA, 1-srcA)
33 EBF_DST_ALPHA, //!< src & dest (destA, destA, destA, destA) 33 EBF_DST_ALPHA, //!< src & dest (destA, destA, destA, destA)
34 EBF_ONE_MINUS_DST_ALPHA, //!< src & dest (1-destA, 1-destA, 1-destA, 1-destA) 34 EBF_ONE_MINUS_DST_ALPHA, //!< src & dest (1-destA, 1-destA, 1-destA, 1-destA)
35 EBF_SRC_ALPHA_SATURATE //!< src (min(srcA, 1-destA), idem, ...) 35 EBF_SRC_ALPHA_SATURATE //!< src (min(srcA, 1-destA), idem, ...)
36 }; 36 };
37 37
38 //! Values defining the blend operation used when blend is enabled 38 //! Values defining the blend operation used when blend is enabled
39 enum E_BLEND_OPERATION 39 enum E_BLEND_OPERATION
40 { 40 {
41 EBO_NONE = 0, //!< No blending happens 41 EBO_NONE = 0, //!< No blending happens
42 EBO_ADD, //!< Default blending adds the color values 42 EBO_ADD, //!< Default blending adds the color values
43 EBO_SUBTRACT, //!< This mode subtracts the color values 43 EBO_SUBTRACT, //!< This mode subtracts the color values
44 EBO_REVSUBTRACT,//!< This modes subtracts destination from source 44 EBO_REVSUBTRACT,//!< This modes subtracts destination from source
45 EBO_MIN, //!< Choose minimum value of each color channel 45 EBO_MIN, //!< Choose minimum value of each color channel
46 EBO_MAX, //!< Choose maximum value of each color channel 46 EBO_MAX, //!< Choose maximum value of each color channel
47 EBO_MIN_FACTOR, //!< Choose minimum value of each color channel after applying blend factors, not widely supported 47 EBO_MIN_FACTOR, //!< Choose minimum value of each color channel after applying blend factors, not widely supported
48 EBO_MAX_FACTOR, //!< Choose maximum value of each color channel after applying blend factors, not widely supported 48 EBO_MAX_FACTOR, //!< Choose maximum value of each color channel after applying blend factors, not widely supported
49 EBO_MIN_ALPHA, //!< Choose minimum value of each color channel based on alpha value, not widely supported 49 EBO_MIN_ALPHA, //!< Choose minimum value of each color channel based on alpha value, not widely supported
50 EBO_MAX_ALPHA //!< Choose maximum value of each color channel based on alpha value, not widely supported 50 EBO_MAX_ALPHA //!< Choose maximum value of each color channel based on alpha value, not widely supported
51 }; 51 };
52 52
53 //! MaterialTypeParam: e.g. DirectX: D3DTOP_MODULATE, D3DTOP_MODULATE2X, D3DTOP_MODULATE4X 53 //! MaterialTypeParam: e.g. DirectX: D3DTOP_MODULATE, D3DTOP_MODULATE2X, D3DTOP_MODULATE4X
54 enum E_MODULATE_FUNC 54 enum E_MODULATE_FUNC
55 { 55 {
56 EMFN_MODULATE_1X = 1, 56 EMFN_MODULATE_1X = 1,
57 EMFN_MODULATE_2X = 2, 57 EMFN_MODULATE_2X = 2,
58 EMFN_MODULATE_4X = 4 58 EMFN_MODULATE_4X = 4
59 }; 59 };
60 60
61 //! Comparison function, e.g. for depth buffer test 61 //! Comparison function, e.g. for depth buffer test
62 enum E_COMPARISON_FUNC 62 enum E_COMPARISON_FUNC
63 { 63 {
64 //! Test never succeeds, this equals disable 64 //! Test never succeeds, this equals disable
65 ECFN_NEVER=0, 65 ECFN_NEVER=0,
66 //! <= test, default for e.g. depth test 66 //! <= test, default for e.g. depth test
67 ECFN_LESSEQUAL=1, 67 ECFN_LESSEQUAL=1,
68 //! Exact equality 68 //! Exact equality
69 ECFN_EQUAL=2, 69 ECFN_EQUAL=2,
70 //! exclusive less comparison, i.e. < 70 //! exclusive less comparison, i.e. <
71 ECFN_LESS, 71 ECFN_LESS,
72 //! Succeeds almost always, except for exact equality 72 //! Succeeds almost always, except for exact equality
73 ECFN_NOTEQUAL, 73 ECFN_NOTEQUAL,
74 //! >= test 74 //! >= test
75 ECFN_GREATEREQUAL, 75 ECFN_GREATEREQUAL,
76 //! inverse of <= 76 //! inverse of <=
77 ECFN_GREATER, 77 ECFN_GREATER,
78 //! test succeeds always 78 //! test succeeds always
79 ECFN_ALWAYS 79 ECFN_ALWAYS
80 }; 80 };
81 81
82 //! Enum values for enabling/disabling color planes for rendering 82 //! Enum values for enabling/disabling color planes for rendering
83 enum E_COLOR_PLANE 83 enum E_COLOR_PLANE
84 { 84 {
85 //! No color enabled 85 //! No color enabled
86 ECP_NONE=0, 86 ECP_NONE=0,
87 //! Alpha enabled 87 //! Alpha enabled
88 ECP_ALPHA=1, 88 ECP_ALPHA=1,
89 //! Red enabled 89 //! Red enabled
90 ECP_RED=2, 90 ECP_RED=2,
91 //! Green enabled 91 //! Green enabled
92 ECP_GREEN=4, 92 ECP_GREEN=4,
93 //! Blue enabled 93 //! Blue enabled
94 ECP_BLUE=8, 94 ECP_BLUE=8,
95 //! All colors, no alpha 95 //! All colors, no alpha
96 ECP_RGB=14, 96 ECP_RGB=14,
97 //! All planes enabled 97 //! All planes enabled
98 ECP_ALL=15 98 ECP_ALL=15
99 }; 99 };
100 100
101 //! Source of the alpha value to take 101 //! Source of the alpha value to take
102 /** This is currently only supported in EMT_ONETEXTURE_BLEND. You can use an 102 /** This is currently only supported in EMT_ONETEXTURE_BLEND. You can use an
103 or'ed combination of values. Alpha values are modulated (multiplicated). */ 103 or'ed combination of values. Alpha values are modulated (multiplicated). */
104 enum E_ALPHA_SOURCE 104 enum E_ALPHA_SOURCE
105 { 105 {
106 //! Use no alpha, somewhat redundant with other settings 106 //! Use no alpha, somewhat redundant with other settings
107 EAS_NONE=0, 107 EAS_NONE=0,
108 //! Use vertex color alpha 108 //! Use vertex color alpha
109 EAS_VERTEX_COLOR, 109 EAS_VERTEX_COLOR,
110 //! Use texture alpha channel 110 //! Use texture alpha channel
111 EAS_TEXTURE 111 EAS_TEXTURE
112 }; 112 };
113 113
114 //! EMT_ONETEXTURE_BLEND: pack srcFact, dstFact, Modulate and alpha source to MaterialTypeParam 114 //! EMT_ONETEXTURE_BLEND: pack srcFact, dstFact, Modulate and alpha source to MaterialTypeParam
115 /** alpha source can be an OR'ed combination of E_ALPHA_SOURCE values. */ 115 /** alpha source can be an OR'ed combination of E_ALPHA_SOURCE values. */
116 inline f32 pack_textureBlendFunc ( const E_BLEND_FACTOR srcFact, const E_BLEND_FACTOR dstFact, const E_MODULATE_FUNC modulate=EMFN_MODULATE_1X, const u32 alphaSource=EAS_TEXTURE ) 116 inline f32 pack_textureBlendFunc ( const E_BLEND_FACTOR srcFact, const E_BLEND_FACTOR dstFact, const E_MODULATE_FUNC modulate=EMFN_MODULATE_1X, const u32 alphaSource=EAS_TEXTURE )
117 { 117 {
118 const u32 tmp = (alphaSource << 12) | (modulate << 8) | (srcFact << 4) | dstFact; 118 const u32 tmp = (alphaSource << 12) | (modulate << 8) | (srcFact << 4) | dstFact;
119 return FR(tmp); 119 return FR(tmp);
120 } 120 }
121 121
122 //! EMT_ONETEXTURE_BLEND: unpack srcFact & dstFact and Modulo to MaterialTypeParam 122 //! EMT_ONETEXTURE_BLEND: unpack srcFact & dstFact and Modulo to MaterialTypeParam
123 /** The fields don't use the full byte range, so we could pack even more... */ 123 /** The fields don't use the full byte range, so we could pack even more... */
124 inline void unpack_textureBlendFunc ( E_BLEND_FACTOR &srcFact, E_BLEND_FACTOR &dstFact, 124 inline void unpack_textureBlendFunc ( E_BLEND_FACTOR &srcFact, E_BLEND_FACTOR &dstFact,
125 E_MODULATE_FUNC &modulo, u32& alphaSource, const f32 param ) 125 E_MODULATE_FUNC &modulo, u32& alphaSource, const f32 param )
126 { 126 {
127 const u32 state = IR(param); 127 const u32 state = IR(param);
128 alphaSource = (state & 0x0000F000) >> 12; 128 alphaSource = (state & 0x0000F000) >> 12;
129 modulo = E_MODULATE_FUNC( ( state & 0x00000F00 ) >> 8 ); 129 modulo = E_MODULATE_FUNC( ( state & 0x00000F00 ) >> 8 );
130 srcFact = E_BLEND_FACTOR ( ( state & 0x000000F0 ) >> 4 ); 130 srcFact = E_BLEND_FACTOR ( ( state & 0x000000F0 ) >> 4 );
131 dstFact = E_BLEND_FACTOR ( ( state & 0x0000000F ) ); 131 dstFact = E_BLEND_FACTOR ( ( state & 0x0000000F ) );
132 } 132 }
133 133
134 //! EMT_ONETEXTURE_BLEND: has BlendFactor Alphablending 134 //! EMT_ONETEXTURE_BLEND: has BlendFactor Alphablending
135 inline bool textureBlendFunc_hasAlpha ( const E_BLEND_FACTOR factor ) 135 inline bool textureBlendFunc_hasAlpha ( const E_BLEND_FACTOR factor )
136 { 136 {
137 switch ( factor ) 137 switch ( factor )
138 { 138 {
139 case EBF_SRC_ALPHA: 139 case EBF_SRC_ALPHA:
140 case EBF_ONE_MINUS_SRC_ALPHA: 140 case EBF_ONE_MINUS_SRC_ALPHA:
141 case EBF_DST_ALPHA: 141 case EBF_DST_ALPHA:
142 case EBF_ONE_MINUS_DST_ALPHA: 142 case EBF_ONE_MINUS_DST_ALPHA:
143 case EBF_SRC_ALPHA_SATURATE: 143 case EBF_SRC_ALPHA_SATURATE:
144 return true; 144 return true;
145 default: 145 default:
146 return false; 146 return false;
147 } 147 }
148 } 148 }
149 149
150 150
151 //! These flags are used to specify the anti-aliasing and smoothing modes 151 //! These flags are used to specify the anti-aliasing and smoothing modes
152 /** Techniques supported are multisampling, geometry smoothing, and alpha 152 /** Techniques supported are multisampling, geometry smoothing, and alpha
153 to coverage. 153 to coverage.
154 Some drivers don't support a per-material setting of the anti-aliasing 154 Some drivers don't support a per-material setting of the anti-aliasing
155 modes. In those cases, FSAA/multisampling is defined by the device mode 155 modes. In those cases, FSAA/multisampling is defined by the device mode
156 chosen upon creation via irr::SIrrCreationParameters. 156 chosen upon creation via irr::SIrrCreationParameters.
157 */ 157 */
158 enum E_ANTI_ALIASING_MODE 158 enum E_ANTI_ALIASING_MODE
159 { 159 {
160 //! Use to turn off anti-aliasing for this material 160 //! Use to turn off anti-aliasing for this material
161 EAAM_OFF=0, 161 EAAM_OFF=0,
162 //! Default anti-aliasing mode 162 //! Default anti-aliasing mode
163 EAAM_SIMPLE=1, 163 EAAM_SIMPLE=1,
164 //! High-quality anti-aliasing, not always supported, automatically enables SIMPLE mode 164 //! High-quality anti-aliasing, not always supported, automatically enables SIMPLE mode
165 EAAM_QUALITY=3, 165 EAAM_QUALITY=3,
166 //! Line smoothing 166 //! Line smoothing
167 EAAM_LINE_SMOOTH=4, 167 EAAM_LINE_SMOOTH=4,
168 //! point smoothing, often in software and slow, only with OpenGL 168 //! point smoothing, often in software and slow, only with OpenGL
169 EAAM_POINT_SMOOTH=8, 169 EAAM_POINT_SMOOTH=8,
170 //! All typical anti-alias and smooth modes 170 //! All typical anti-alias and smooth modes
171 EAAM_FULL_BASIC=15, 171 EAAM_FULL_BASIC=15,
172 //! Enhanced anti-aliasing for transparent materials 172 //! Enhanced anti-aliasing for transparent materials
173 /** Usually used with EMT_TRANSPARENT_ALPHA_REF and multisampling. */ 173 /** Usually used with EMT_TRANSPARENT_ALPHA_REF and multisampling. */
174 EAAM_ALPHA_TO_COVERAGE=16 174 EAAM_ALPHA_TO_COVERAGE=16
175 }; 175 };
176 176
177 //! These flags allow to define the interpretation of vertex color when lighting is enabled 177 //! These flags allow to define the interpretation of vertex color when lighting is enabled
178 /** Without lighting being enabled the vertex color is the only value defining the fragment color. 178 /** Without lighting being enabled the vertex color is the only value defining the fragment color.
179 Once lighting is enabled, the four values for diffuse, ambient, emissive, and specular take over. 179 Once lighting is enabled, the four values for diffuse, ambient, emissive, and specular take over.
180 With these flags it is possible to define which lighting factor shall be defined by the vertex color 180 With these flags it is possible to define which lighting factor shall be defined by the vertex color
181 instead of the lighting factor which is the same for all faces of that material. 181 instead of the lighting factor which is the same for all faces of that material.
182 The default is to use vertex color for the diffuse value, another pretty common value is to use 182 The default is to use vertex color for the diffuse value, another pretty common value is to use
183 vertex color for both diffuse and ambient factor. */ 183 vertex color for both diffuse and ambient factor. */
184 enum E_COLOR_MATERIAL 184 enum E_COLOR_MATERIAL
185 { 185 {
186 //! Don't use vertex color for lighting 186 //! Don't use vertex color for lighting
187 ECM_NONE=0, 187 ECM_NONE=0,
188 //! Use vertex color for diffuse light, this is default 188 //! Use vertex color for diffuse light, this is default
189 ECM_DIFFUSE, 189 ECM_DIFFUSE,
190 //! Use vertex color for ambient light 190 //! Use vertex color for ambient light
191 ECM_AMBIENT, 191 ECM_AMBIENT,
192 //! Use vertex color for emissive light 192 //! Use vertex color for emissive light
193 ECM_EMISSIVE, 193 ECM_EMISSIVE,
194 //! Use vertex color for specular light 194 //! Use vertex color for specular light
195 ECM_SPECULAR, 195 ECM_SPECULAR,
196 //! Use vertex color for both diffuse and ambient light 196 //! Use vertex color for both diffuse and ambient light
197 ECM_DIFFUSE_AND_AMBIENT 197 ECM_DIFFUSE_AND_AMBIENT
198 }; 198 };
199 199
200 //! Flags for the definition of the polygon offset feature 200 //! Flags for the definition of the polygon offset feature
201 /** These flags define whether the offset should be into the screen, or towards the eye. */ 201 /** These flags define whether the offset should be into the screen, or towards the eye. */
202 enum E_POLYGON_OFFSET 202 enum E_POLYGON_OFFSET
203 { 203 {
204 //! Push pixel towards the far plane, away from the eye 204 //! Push pixel towards the far plane, away from the eye
205 /** This is typically used for rendering inner areas. */ 205 /** This is typically used for rendering inner areas. */
206 EPO_BACK=0, 206 EPO_BACK=0,
207 //! Pull pixels towards the camera. 207 //! Pull pixels towards the camera.
208 /** This is typically used for polygons which should appear on top 208 /** This is typically used for polygons which should appear on top
209 of other elements, such as decals. */ 209 of other elements, such as decals. */
210 EPO_FRONT=1 210 EPO_FRONT=1
211 }; 211 };
212 212
213 //! Names for polygon offset direction 213 //! Names for polygon offset direction
214 const c8* const PolygonOffsetDirectionNames[] = 214 const c8* const PolygonOffsetDirectionNames[] =
215 { 215 {
216 "Back", 216 "Back",
217 "Front", 217 "Front",
218 0 218 0
219 }; 219 };
220 220
221 221
222 //! Maximum number of texture an SMaterial can have. 222 //! Maximum number of texture an SMaterial can have.
223 const u32 MATERIAL_MAX_TEXTURES = _IRR_MATERIAL_MAX_TEXTURES_; 223 const u32 MATERIAL_MAX_TEXTURES = _IRR_MATERIAL_MAX_TEXTURES_;
224 224
225 //! Struct for holding parameters for a material renderer 225 //! Struct for holding parameters for a material renderer
226 class SMaterial 226 class SMaterial
227 { 227 {
228 public: 228 public:
229 //! Default constructor. Creates a solid, lit material with white colors 229 //! Default constructor. Creates a solid, lit material with white colors
230 SMaterial() 230 SMaterial()
231 : MaterialType(EMT_SOLID), AmbientColor(255,255,255,255), DiffuseColor(255,255,255,255), 231 : MaterialType(EMT_SOLID), AmbientColor(255,255,255,255), DiffuseColor(255,255,255,255),
232 EmissiveColor(0,0,0,0), SpecularColor(255,255,255,255), 232 EmissiveColor(0,0,0,0), SpecularColor(255,255,255,255),
233 Shininess(0.0f), MaterialTypeParam(0.0f), MaterialTypeParam2(0.0f), Thickness(1.0f), 233 Shininess(0.0f), MaterialTypeParam(0.0f), MaterialTypeParam2(0.0f), Thickness(1.0f),
234 ZBuffer(ECFN_LESSEQUAL), AntiAliasing(EAAM_SIMPLE), ColorMask(ECP_ALL), 234 ZBuffer(ECFN_LESSEQUAL), AntiAliasing(EAAM_SIMPLE), ColorMask(ECP_ALL),
235 ColorMaterial(ECM_DIFFUSE), BlendOperation(EBO_NONE), 235 ColorMaterial(ECM_DIFFUSE), BlendOperation(EBO_NONE),
236 PolygonOffsetFactor(0), PolygonOffsetDirection(EPO_FRONT), 236 PolygonOffsetFactor(0), PolygonOffsetDirection(EPO_FRONT),
237 Wireframe(false), PointCloud(false), GouraudShading(true), 237 Wireframe(false), PointCloud(false), GouraudShading(true),
238 Lighting(true), ZWriteEnable(true), BackfaceCulling(true), FrontfaceCulling(false), 238 Lighting(true), ZWriteEnable(true), BackfaceCulling(true), FrontfaceCulling(false),
239 FogEnable(false), NormalizeNormals(false), UseMipMaps(true) 239 FogEnable(false), NormalizeNormals(false), UseMipMaps(true)
240 { } 240 { }
241 241
242 //! Copy constructor 242 //! Copy constructor
243 /** \param other Material to copy from. */ 243 /** \param other Material to copy from. */
244 SMaterial(const SMaterial& other) 244 SMaterial(const SMaterial& other)
245 { 245 {
246 // These pointers are checked during assignment 246 // These pointers are checked during assignment
247 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i) 247 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
248 TextureLayer[i].TextureMatrix = 0; 248 TextureLayer[i].TextureMatrix = 0;
249 *this = other; 249 *this = other;
250 } 250 }
251 251
252 //! Assignment operator 252 //! Assignment operator
253 /** \param other Material to copy from. */ 253 /** \param other Material to copy from. */
254 SMaterial& operator=(const SMaterial& other) 254 SMaterial& operator=(const SMaterial& other)
255 { 255 {
256 // Check for self-assignment! 256 // Check for self-assignment!
257 if (this == &other) 257 if (this == &other)
258 return *this; 258 return *this;
259 259
260 MaterialType = other.MaterialType; 260 MaterialType = other.MaterialType;
261 261
262 AmbientColor = other.AmbientColor; 262 AmbientColor = other.AmbientColor;
263 DiffuseColor = other.DiffuseColor; 263 DiffuseColor = other.DiffuseColor;
264 EmissiveColor = other.EmissiveColor; 264 EmissiveColor = other.EmissiveColor;
265 SpecularColor = other.SpecularColor; 265 SpecularColor = other.SpecularColor;
266 Shininess = other.Shininess; 266 Shininess = other.Shininess;
267 MaterialTypeParam = other.MaterialTypeParam; 267 MaterialTypeParam = other.MaterialTypeParam;
268 MaterialTypeParam2 = other.MaterialTypeParam2; 268 MaterialTypeParam2 = other.MaterialTypeParam2;
269 Thickness = other.Thickness; 269 Thickness = other.Thickness;
270 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i) 270 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
271 { 271 {
272 TextureLayer[i] = other.TextureLayer[i]; 272 TextureLayer[i] = other.TextureLayer[i];
273 } 273 }
274 274
275 Wireframe = other.Wireframe; 275 Wireframe = other.Wireframe;
276 PointCloud = other.PointCloud; 276 PointCloud = other.PointCloud;
277 GouraudShading = other.GouraudShading; 277 GouraudShading = other.GouraudShading;
278 Lighting = other.Lighting; 278 Lighting = other.Lighting;
279 ZWriteEnable = other.ZWriteEnable; 279 ZWriteEnable = other.ZWriteEnable;
280 BackfaceCulling = other.BackfaceCulling; 280 BackfaceCulling = other.BackfaceCulling;
281 FrontfaceCulling = other.FrontfaceCulling; 281 FrontfaceCulling = other.FrontfaceCulling;
282 FogEnable = other.FogEnable; 282 FogEnable = other.FogEnable;
283 NormalizeNormals = other.NormalizeNormals; 283 NormalizeNormals = other.NormalizeNormals;
284 ZBuffer = other.ZBuffer; 284 ZBuffer = other.ZBuffer;
285 AntiAliasing = other.AntiAliasing; 285 AntiAliasing = other.AntiAliasing;
286 ColorMask = other.ColorMask; 286 ColorMask = other.ColorMask;
287 ColorMaterial = other.ColorMaterial; 287 ColorMaterial = other.ColorMaterial;
288 BlendOperation = other.BlendOperation; 288 BlendOperation = other.BlendOperation;
289 PolygonOffsetFactor = other.PolygonOffsetFactor; 289 PolygonOffsetFactor = other.PolygonOffsetFactor;
290 PolygonOffsetDirection = other.PolygonOffsetDirection; 290 PolygonOffsetDirection = other.PolygonOffsetDirection;
291 UseMipMaps = other.UseMipMaps; 291 UseMipMaps = other.UseMipMaps;
292 292
293 return *this; 293 return *this;
294 } 294 }
295 295
296 //! Texture layer array. 296 //! Texture layer array.
297 SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES]; 297 SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES];
298 298
299 //! Type of the material. Specifies how everything is blended together 299 //! Type of the material. Specifies how everything is blended together
300 E_MATERIAL_TYPE MaterialType; 300 E_MATERIAL_TYPE MaterialType;
301 301
302 //! How much ambient light (a global light) is reflected by this material. 302 //! How much ambient light (a global light) is reflected by this material.
303 /** The default is full white, meaning objects are completely 303 /** The default is full white, meaning objects are completely
304 globally illuminated. Reduce this if you want to see diffuse 304 globally illuminated. Reduce this if you want to see diffuse
305 or specular light effects. */ 305 or specular light effects. */
306 SColor AmbientColor; 306 SColor AmbientColor;
307 307
308 //! How much diffuse light coming from a light source is reflected by this material. 308 //! How much diffuse light coming from a light source is reflected by this material.
309 /** The default is full white. */ 309 /** The default is full white. */
310 SColor DiffuseColor; 310 SColor DiffuseColor;
311 311
312 //! Light emitted by this material. Default is to emit no light. 312 //! Light emitted by this material. Default is to emit no light.
313 SColor EmissiveColor; 313 SColor EmissiveColor;
314 314
315 //! How much specular light (highlights from a light) is reflected. 315 //! How much specular light (highlights from a light) is reflected.
316 /** The default is to reflect white specular light. See 316 /** The default is to reflect white specular light. See
317 SMaterial::Shininess on how to enable specular lights. */ 317 SMaterial::Shininess on how to enable specular lights. */
318 SColor SpecularColor; 318 SColor SpecularColor;
319 319
320 //! Value affecting the size of specular highlights. 320 //! Value affecting the size of specular highlights.
321 /** A value of 20 is common. If set to 0, no specular 321 /** A value of 20 is common. If set to 0, no specular
322 highlights are being used. To activate, simply set the 322 highlights are being used. To activate, simply set the
323 shininess of a material to a value in the range [0.5;128]: 323 shininess of a material to a value in the range [0.5;128]:
324 \code 324 \code
325 sceneNode->getMaterial(0).Shininess = 20.0f; 325 sceneNode->getMaterial(0).Shininess = 20.0f;
326 \endcode 326 \endcode
327 327
328 You can change the color of the highlights using 328 You can change the color of the highlights using
329 \code 329 \code
330 sceneNode->getMaterial(0).SpecularColor.set(255,255,255,255); 330 sceneNode->getMaterial(0).SpecularColor.set(255,255,255,255);
331 \endcode 331 \endcode
332 332
333 The specular color of the dynamic lights 333 The specular color of the dynamic lights
334 (SLight::SpecularColor) will influence the the highlight color 334 (SLight::SpecularColor) will influence the the highlight color
335 too, but they are set to a useful value by default when 335 too, but they are set to a useful value by default when
336 creating the light scene node. Here is a simple example on how 336 creating the light scene node. Here is a simple example on how
337 to use specular highlights: 337 to use specular highlights:
338 \code 338 \code
339 // load and display mesh 339 // load and display mesh
340 scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( 340 scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(
341 smgr->getMesh("data/faerie.md2")); 341 smgr->getMesh("data/faerie.md2"));
342 node->setMaterialTexture(0, driver->getTexture("data/Faerie2.pcx")); // set diffuse texture 342 node->setMaterialTexture(0, driver->getTexture("data/Faerie2.pcx")); // set diffuse texture
343 node->setMaterialFlag(video::EMF_LIGHTING, true); // enable dynamic lighting 343 node->setMaterialFlag(video::EMF_LIGHTING, true); // enable dynamic lighting
344 node->getMaterial(0).Shininess = 20.0f; // set size of specular highlights 344 node->getMaterial(0).Shininess = 20.0f; // set size of specular highlights
345 345
346 // add white light 346 // add white light
347 scene::ILightSceneNode* light = smgr->addLightSceneNode(0, 347 scene::ILightSceneNode* light = smgr->addLightSceneNode(0,
348 core::vector3df(5,5,5), video::SColorf(1.0f, 1.0f, 1.0f)); 348 core::vector3df(5,5,5), video::SColorf(1.0f, 1.0f, 1.0f));
349 \endcode */ 349 \endcode */
350 f32 Shininess; 350 f32 Shininess;
351 351
352 //! Free parameter, dependent on the material type. 352 //! Free parameter, dependent on the material type.
353 /** Mostly ignored, used for example in EMT_PARALLAX_MAP_SOLID 353 /** Mostly ignored, used for example in EMT_PARALLAX_MAP_SOLID
354 and EMT_TRANSPARENT_ALPHA_CHANNEL. */ 354 and EMT_TRANSPARENT_ALPHA_CHANNEL. */
355 f32 MaterialTypeParam; 355 f32 MaterialTypeParam;
356 356
357 //! Second free parameter, dependent on the material type. 357 //! Second free parameter, dependent on the material type.
358 /** Mostly ignored. */ 358 /** Mostly ignored. */
359 f32 MaterialTypeParam2; 359 f32 MaterialTypeParam2;
360 360
361 //! Thickness of non-3dimensional elements such as lines and points. 361 //! Thickness of non-3dimensional elements such as lines and points.
362 f32 Thickness; 362 f32 Thickness;
363 363
364 //! Is the ZBuffer enabled? Default: ECFN_LESSEQUAL 364 //! Is the ZBuffer enabled? Default: ECFN_LESSEQUAL
365 /** Values are from E_COMPARISON_FUNC. */ 365 /** Values are from E_COMPARISON_FUNC. */
366 u8 ZBuffer; 366 u8 ZBuffer;
367 367
368 //! Sets the antialiasing mode 368 //! Sets the antialiasing mode
369 /** Values are chosen from E_ANTI_ALIASING_MODE. Default is 369 /** Values are chosen from E_ANTI_ALIASING_MODE. Default is
370 EAAM_SIMPLE|EAAM_LINE_SMOOTH, i.e. simple multi-sample 370 EAAM_SIMPLE|EAAM_LINE_SMOOTH, i.e. simple multi-sample
371 anti-aliasing and lime smoothing is enabled. */ 371 anti-aliasing and lime smoothing is enabled. */
372 u8 AntiAliasing; 372 u8 AntiAliasing;
373 373
374 //! Defines the enabled color planes 374 //! Defines the enabled color planes
375 /** Values are defined as or'ed values of the E_COLOR_PLANE enum. 375 /** Values are defined as or'ed values of the E_COLOR_PLANE enum.
376 Only enabled color planes will be rendered to the current render 376 Only enabled color planes will be rendered to the current render
377 target. Typical use is to disable all colors when rendering only to 377 target. Typical use is to disable all colors when rendering only to
378 depth or stencil buffer, or using Red and Green for Stereo rendering. */ 378 depth or stencil buffer, or using Red and Green for Stereo rendering. */
379 u8 ColorMask:4; 379 u8 ColorMask:4;
380 380
381 //! Defines the interpretation of vertex color in the lighting equation 381 //! Defines the interpretation of vertex color in the lighting equation
382 /** Values should be chosen from E_COLOR_MATERIAL. 382 /** Values should be chosen from E_COLOR_MATERIAL.
383 When lighting is enabled, vertex color can be used instead of the 383 When lighting is enabled, vertex color can be used instead of the
384 material values for light modulation. This allows to easily change e.g. the 384 material values for light modulation. This allows to easily change e.g. the
385 diffuse light behavior of each face. The default, ECM_DIFFUSE, will result in 385 diffuse light behavior of each face. The default, ECM_DIFFUSE, will result in
386 a very similar rendering as with lighting turned off, just with light shading. */ 386 a very similar rendering as with lighting turned off, just with light shading. */
387 u8 ColorMaterial:3; 387 u8 ColorMaterial:3;
388 388
389 //! Store the blend operation of choice 389 //! Store the blend operation of choice
390 /** Values to be chosen from E_BLEND_OPERATION. The actual way to use this value 390 /** Values to be chosen from E_BLEND_OPERATION. The actual way to use this value
391 is not yet determined, so ignore it for now. */ 391 is not yet determined, so ignore it for now. */
392 E_BLEND_OPERATION BlendOperation:4; 392 E_BLEND_OPERATION BlendOperation:4;
393 393
394 //! Factor specifying how far the polygon offset should be made 394 //! Factor specifying how far the polygon offset should be made
395 /** Specifying 0 disables the polygon offset. The direction is specified spearately. 395 /** Specifying 0 disables the polygon offset. The direction is specified spearately.
396 The factor can be from 0 to 7.*/ 396 The factor can be from 0 to 7.*/
397 u8 PolygonOffsetFactor:3; 397 u8 PolygonOffsetFactor:3;
398 398
399 //! Flag defining the direction the polygon offset is applied to. 399 //! Flag defining the direction the polygon offset is applied to.
400 /** Can be to front or to back, specififed by values from E_POLYGON_OFFSET. */ 400 /** Can be to front or to back, specififed by values from E_POLYGON_OFFSET. */
401 E_POLYGON_OFFSET PolygonOffsetDirection:1; 401 E_POLYGON_OFFSET PolygonOffsetDirection:1;
402 402
403 //! Draw as wireframe or filled triangles? Default: false 403 //! Draw as wireframe or filled triangles? Default: false
404 /** The user can access a material flag using 404 /** The user can access a material flag using
405 \code material.Wireframe=true \endcode 405 \code material.Wireframe=true \endcode
406 or \code material.setFlag(EMF_WIREFRAME, true); \endcode */ 406 or \code material.setFlag(EMF_WIREFRAME, true); \endcode */
407 bool Wireframe:1; 407 bool Wireframe:1;
408 408
409 //! Draw as point cloud or filled triangles? Default: false 409 //! Draw as point cloud or filled triangles? Default: false
410 bool PointCloud:1; 410 bool PointCloud:1;
411 411
412 //! Flat or Gouraud shading? Default: true 412 //! Flat or Gouraud shading? Default: true
413 bool GouraudShading:1; 413 bool GouraudShading:1;
414 414
415 //! Will this material be lighted? Default: true 415 //! Will this material be lighted? Default: true
416 bool Lighting:1; 416 bool Lighting:1;
417 417
418 //! Is the zbuffer writeable or is it read-only. Default: true. 418 //! Is the zbuffer writeable or is it read-only. Default: true.
419 /** This flag is forced to false if the MaterialType is a 419 /** This flag is forced to false if the MaterialType is a
420 transparent type and the scene parameter 420 transparent type and the scene parameter
421 ALLOW_ZWRITE_ON_TRANSPARENT is not set. */ 421 ALLOW_ZWRITE_ON_TRANSPARENT is not set. */
422 bool ZWriteEnable:1; 422 bool ZWriteEnable:1;
423 423
424 //! Is backface culling enabled? Default: true 424 //! Is backface culling enabled? Default: true
425 bool BackfaceCulling:1; 425 bool BackfaceCulling:1;
426 426
427 //! Is frontface culling enabled? Default: false 427 //! Is frontface culling enabled? Default: false
428 bool FrontfaceCulling:1; 428 bool FrontfaceCulling:1;
429 429
430 //! Is fog enabled? Default: false 430 //! Is fog enabled? Default: false
431 bool FogEnable:1; 431 bool FogEnable:1;
432 432
433 //! Should normals be normalized? 433 //! Should normals be normalized?
434 /** Always use this if the mesh lit and scaled. Default: false */ 434 /** Always use this if the mesh lit and scaled. Default: false */
435 bool NormalizeNormals:1; 435 bool NormalizeNormals:1;
436 436
437 //! Shall mipmaps be used if available 437 //! Shall mipmaps be used if available
438 /** Sometimes, disabling mipmap usage can be useful. Default: true */ 438 /** Sometimes, disabling mipmap usage can be useful. Default: true */
439 bool UseMipMaps:1; 439 bool UseMipMaps:1;
440 440
441 //! Gets the texture transformation matrix for level i 441 //! Gets the texture transformation matrix for level i
442 /** \param i The desired level. Must not be larger than MATERIAL_MAX_TEXTURES. 442 /** \param i The desired level. Must not be larger than MATERIAL_MAX_TEXTURES.
443 \return Texture matrix for texture level i. */ 443 \return Texture matrix for texture level i. */
444 core::matrix4& getTextureMatrix(u32 i) 444 core::matrix4& getTextureMatrix(u32 i)
445 { 445 {
446 return TextureLayer[i].getTextureMatrix(); 446 return TextureLayer[i].getTextureMatrix();
447 } 447 }
448 448
449 //! Gets the immutable texture transformation matrix for level i 449 //! Gets the immutable texture transformation matrix for level i
450 /** \param i The desired level. 450 /** \param i The desired level.
451 \return Texture matrix for texture level i, or identity matrix for levels larger than MATERIAL_MAX_TEXTURES. */ 451 \return Texture matrix for texture level i, or identity matrix for levels larger than MATERIAL_MAX_TEXTURES. */
452 const core::matrix4& getTextureMatrix(u32 i) const 452 const core::matrix4& getTextureMatrix(u32 i) const
453 { 453 {
454 if (i<MATERIAL_MAX_TEXTURES) 454 if (i<MATERIAL_MAX_TEXTURES)
455 return TextureLayer[i].getTextureMatrix(); 455 return TextureLayer[i].getTextureMatrix();
456 else 456 else
457 return core::IdentityMatrix; 457 return core::IdentityMatrix;
458 } 458 }
459 459
460 //! Sets the i-th texture transformation matrix 460 //! Sets the i-th texture transformation matrix
461 /** \param i The desired level. 461 /** \param i The desired level.
462 \param mat Texture matrix for texture level i. */ 462 \param mat Texture matrix for texture level i. */
463 void setTextureMatrix(u32 i, const core::matrix4& mat) 463 void setTextureMatrix(u32 i, const core::matrix4& mat)
464 { 464 {
465 if (i>=MATERIAL_MAX_TEXTURES) 465 if (i>=MATERIAL_MAX_TEXTURES)
466 return; 466 return;
467 TextureLayer[i].setTextureMatrix(mat); 467 TextureLayer[i].setTextureMatrix(mat);
468 } 468 }
469 469
470 //! Gets the i-th texture 470 //! Gets the i-th texture
471 /** \param i The desired level. 471 /** \param i The desired level.
472 \return Texture for texture level i, if defined, else 0. */ 472 \return Texture for texture level i, if defined, else 0. */
473 ITexture* getTexture(u32 i) const 473 ITexture* getTexture(u32 i) const
474 { 474 {
475 return i < MATERIAL_MAX_TEXTURES ? TextureLayer[i].Texture : 0; 475 return i < MATERIAL_MAX_TEXTURES ? TextureLayer[i].Texture : 0;
476 } 476 }
477 477
478 //! Sets the i-th texture 478 //! Sets the i-th texture
479 /** If i>=MATERIAL_MAX_TEXTURES this setting will be ignored. 479 /** If i>=MATERIAL_MAX_TEXTURES this setting will be ignored.
480 \param i The desired level. 480 \param i The desired level.
481 \param tex Texture for texture level i. */ 481 \param tex Texture for texture level i. */
482 void setTexture(u32 i, ITexture* tex) 482 void setTexture(u32 i, ITexture* tex)
483 { 483 {
484 if (i>=MATERIAL_MAX_TEXTURES) 484 if (i>=MATERIAL_MAX_TEXTURES)
485 return; 485 return;
486 TextureLayer[i].Texture = tex; 486 TextureLayer[i].Texture = tex;
487 } 487 }
488 488
489 //! Sets the Material flag to the given value 489 //! Sets the Material flag to the given value
490 /** \param flag The flag to be set. 490 /** \param flag The flag to be set.
491 \param value The new value for the flag. */ 491 \param value The new value for the flag. */
492 void setFlag(E_MATERIAL_FLAG flag, bool value) 492 void setFlag(E_MATERIAL_FLAG flag, bool value)
493 { 493 {
494 switch (flag) 494 switch (flag)
495 { 495 {
496 case EMF_WIREFRAME: 496 case EMF_WIREFRAME:
497 Wireframe = value; break; 497 Wireframe = value; break;
498 case EMF_POINTCLOUD: 498 case EMF_POINTCLOUD:
499 PointCloud = value; break; 499 PointCloud = value; break;
500 case EMF_GOURAUD_SHADING: 500 case EMF_GOURAUD_SHADING:
501 GouraudShading = value; break; 501 GouraudShading = value; break;
502 case EMF_LIGHTING: 502 case EMF_LIGHTING:
503 Lighting = value; break; 503 Lighting = value; break;
504 case EMF_ZBUFFER: 504 case EMF_ZBUFFER:
505 ZBuffer = value; break; 505 ZBuffer = value; break;
506 case EMF_ZWRITE_ENABLE: 506 case EMF_ZWRITE_ENABLE:
507 ZWriteEnable = value; break; 507 ZWriteEnable = value; break;
508 case EMF_BACK_FACE_CULLING: 508 case EMF_BACK_FACE_CULLING:
509 BackfaceCulling = value; break; 509 BackfaceCulling = value; break;
510 case EMF_FRONT_FACE_CULLING: 510 case EMF_FRONT_FACE_CULLING:
511 FrontfaceCulling = value; break; 511 FrontfaceCulling = value; break;
512 case EMF_BILINEAR_FILTER: 512 case EMF_BILINEAR_FILTER:
513 { 513 {
514 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i) 514 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
515 TextureLayer[i].BilinearFilter = value; 515 TextureLayer[i].BilinearFilter = value;
516 } 516 }
517 break; 517 break;
518 case EMF_TRILINEAR_FILTER: 518 case EMF_TRILINEAR_FILTER:
519 { 519 {
520 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i) 520 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
521 TextureLayer[i].TrilinearFilter = value; 521 TextureLayer[i].TrilinearFilter = value;
522 } 522 }
523 break; 523 break;
524 case EMF_ANISOTROPIC_FILTER: 524 case EMF_ANISOTROPIC_FILTER:
525 { 525 {
526 if (value) 526 if (value)
527 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i) 527 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
528 TextureLayer[i].AnisotropicFilter = 0xFF; 528 TextureLayer[i].AnisotropicFilter = 0xFF;
529 else 529 else
530 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i) 530 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
531 TextureLayer[i].AnisotropicFilter = 0; 531 TextureLayer[i].AnisotropicFilter = 0;
532 } 532 }
533 break; 533 break;
534 case EMF_FOG_ENABLE: 534 case EMF_FOG_ENABLE:
535 FogEnable = value; break; 535 FogEnable = value; break;
536 case EMF_NORMALIZE_NORMALS: 536 case EMF_NORMALIZE_NORMALS:
537 NormalizeNormals = value; break; 537 NormalizeNormals = value; break;
538 case EMF_TEXTURE_WRAP: 538 case EMF_TEXTURE_WRAP:
539 { 539 {
540 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i) 540 for (u32 i=0; i<MATERIAL_MAX_TEXTURES; ++i)
541 { 541 {
542 TextureLayer[i].TextureWrapU = (E_TEXTURE_CLAMP)value; 542 TextureLayer[i].TextureWrapU = (E_TEXTURE_CLAMP)value;
543 TextureLayer[i].TextureWrapV = (E_TEXTURE_CLAMP)value; 543 TextureLayer[i].TextureWrapV = (E_TEXTURE_CLAMP)value;
544 } 544 }
545 } 545 }
546 break; 546 break;
547 case EMF_ANTI_ALIASING: 547 case EMF_ANTI_ALIASING:
548 AntiAliasing = value?EAAM_SIMPLE:EAAM_OFF; break; 548 AntiAliasing = value?EAAM_SIMPLE:EAAM_OFF; break;
549 case EMF_COLOR_MASK: 549 case EMF_COLOR_MASK:
550 ColorMask = value?ECP_ALL:ECP_NONE; break; 550 ColorMask = value?ECP_ALL:ECP_NONE; break;
551 case EMF_COLOR_MATERIAL: 551 case EMF_COLOR_MATERIAL:
552 ColorMaterial = value?ECM_DIFFUSE:ECM_NONE; break; 552 ColorMaterial = value?ECM_DIFFUSE:ECM_NONE; break;
553 case EMF_USE_MIP_MAPS: 553 case EMF_USE_MIP_MAPS:
554 UseMipMaps = value; break; 554 UseMipMaps = value; break;
555 case EMF_BLEND_OPERATION: 555 case EMF_BLEND_OPERATION:
556 BlendOperation = value?EBO_ADD:EBO_NONE; break; 556 BlendOperation = value?EBO_ADD:EBO_NONE; break;
557 case EMF_POLYGON_OFFSET: 557 case EMF_POLYGON_OFFSET:
558 PolygonOffsetFactor = value?1:0; 558 PolygonOffsetFactor = value?1:0;
559 PolygonOffsetDirection = EPO_BACK; 559 PolygonOffsetDirection = EPO_BACK;
560 break; 560 break;
561 default: 561 default:
562 break; 562 break;
563 } 563 }
564 } 564 }
565 565
566 //! Gets the Material flag 566 //! Gets the Material flag
567 /** \param flag The flag to query. 567 /** \param flag The flag to query.
568 \return The current value of the flag. */ 568 \return The current value of the flag. */
569 bool getFlag(E_MATERIAL_FLAG flag) const 569 bool getFlag(E_MATERIAL_FLAG flag) const
570 { 570 {
571 switch (flag) 571 switch (flag)
572 { 572 {
573 case EMF_WIREFRAME: 573 case EMF_WIREFRAME:
574 return Wireframe; 574 return Wireframe;
575 case EMF_POINTCLOUD: 575 case EMF_POINTCLOUD:
576 return PointCloud; 576 return PointCloud;
577 case EMF_GOURAUD_SHADING: 577 case EMF_GOURAUD_SHADING:
578 return GouraudShading; 578 return GouraudShading;
579 case EMF_LIGHTING: 579 case EMF_LIGHTING:
580 return Lighting; 580 return Lighting;
581 case EMF_ZBUFFER: 581 case EMF_ZBUFFER:
582 return ZBuffer!=ECFN_NEVER; 582 return ZBuffer!=ECFN_NEVER;
583 case EMF_ZWRITE_ENABLE: 583 case EMF_ZWRITE_ENABLE:
584 return ZWriteEnable; 584 return ZWriteEnable;
585 case EMF_BACK_FACE_CULLING: 585 case EMF_BACK_FACE_CULLING:
586 return BackfaceCulling; 586 return BackfaceCulling;
587 case EMF_FRONT_FACE_CULLING: 587 case EMF_FRONT_FACE_CULLING:
588 return FrontfaceCulling; 588 return FrontfaceCulling;
589 case EMF_BILINEAR_FILTER: 589 case EMF_BILINEAR_FILTER:
590 return TextureLayer[0].BilinearFilter; 590 return TextureLayer[0].BilinearFilter;
591 case EMF_TRILINEAR_FILTER: 591 case EMF_TRILINEAR_FILTER:
592 return TextureLayer[0].TrilinearFilter; 592 return TextureLayer[0].TrilinearFilter;
593 case EMF_ANISOTROPIC_FILTER: 593 case EMF_ANISOTROPIC_FILTER:
594 return TextureLayer[0].AnisotropicFilter!=0; 594 return TextureLayer[0].AnisotropicFilter!=0;
595 case EMF_FOG_ENABLE: 595 case EMF_FOG_ENABLE:
596 return FogEnable; 596 return FogEnable;
597 case EMF_NORMALIZE_NORMALS: 597 case EMF_NORMALIZE_NORMALS:
598 return NormalizeNormals; 598 return NormalizeNormals;
599 case EMF_TEXTURE_WRAP: 599 case EMF_TEXTURE_WRAP:
600 return !(TextureLayer[0].TextureWrapU || 600 return !(TextureLayer[0].TextureWrapU ||
601 TextureLayer[0].TextureWrapV || 601 TextureLayer[0].TextureWrapV ||
602 TextureLayer[1].TextureWrapU || 602 TextureLayer[1].TextureWrapU ||
603 TextureLayer[1].TextureWrapV || 603 TextureLayer[1].TextureWrapV ||
604 TextureLayer[2].TextureWrapU || 604 TextureLayer[2].TextureWrapU ||
605 TextureLayer[2].TextureWrapV || 605 TextureLayer[2].TextureWrapV ||
606 TextureLayer[3].TextureWrapU || 606 TextureLayer[3].TextureWrapU ||
607 TextureLayer[3].TextureWrapV); 607 TextureLayer[3].TextureWrapV);
608 case EMF_ANTI_ALIASING: 608 case EMF_ANTI_ALIASING:
609 return (AntiAliasing==1); 609 return (AntiAliasing==1);
610 case EMF_COLOR_MASK: 610 case EMF_COLOR_MASK:
611 return (ColorMask!=ECP_NONE); 611 return (ColorMask!=ECP_NONE);
612 case EMF_COLOR_MATERIAL: 612 case EMF_COLOR_MATERIAL:
613 return (ColorMaterial != ECM_NONE); 613 return (ColorMaterial != ECM_NONE);
614 case EMF_USE_MIP_MAPS: 614 case EMF_USE_MIP_MAPS:
615 return UseMipMaps; 615 return UseMipMaps;
616 case EMF_BLEND_OPERATION: 616 case EMF_BLEND_OPERATION:
617 return BlendOperation != EBO_NONE; 617 return BlendOperation != EBO_NONE;
618 case EMF_POLYGON_OFFSET: 618 case EMF_POLYGON_OFFSET:
619 return PolygonOffsetFactor != 0; 619 return PolygonOffsetFactor != 0;
620 } 620 }
621 621
622 return false; 622 return false;
623 } 623 }
624 624
625 //! Inequality operator 625 //! Inequality operator
626 /** \param b Material to compare to. 626 /** \param b Material to compare to.
627 \return True if the materials differ, else false. */ 627 \return True if the materials differ, else false. */
628 inline bool operator!=(const SMaterial& b) const 628 inline bool operator!=(const SMaterial& b) const
629 { 629 {
630 bool different = 630 bool different =
631 MaterialType != b.MaterialType || 631 MaterialType != b.MaterialType ||
632 AmbientColor != b.AmbientColor || 632 AmbientColor != b.AmbientColor ||
633 DiffuseColor != b.DiffuseColor || 633 DiffuseColor != b.DiffuseColor ||
634 EmissiveColor != b.EmissiveColor || 634 EmissiveColor != b.EmissiveColor ||
635 SpecularColor != b.SpecularColor || 635 SpecularColor != b.SpecularColor ||
636 Shininess != b.Shininess || 636 Shininess != b.Shininess ||
637 MaterialTypeParam != b.MaterialTypeParam || 637 MaterialTypeParam != b.MaterialTypeParam ||
638 MaterialTypeParam2 != b.MaterialTypeParam2 || 638 MaterialTypeParam2 != b.MaterialTypeParam2 ||
639 Thickness != b.Thickness || 639 Thickness != b.Thickness ||
640 Wireframe != b.Wireframe || 640 Wireframe != b.Wireframe ||
641 PointCloud != b.PointCloud || 641 PointCloud != b.PointCloud ||
642 GouraudShading != b.GouraudShading || 642 GouraudShading != b.GouraudShading ||
643 Lighting != b.Lighting || 643 Lighting != b.Lighting ||
644 ZBuffer != b.ZBuffer || 644 ZBuffer != b.ZBuffer ||
645 ZWriteEnable != b.ZWriteEnable || 645 ZWriteEnable != b.ZWriteEnable ||
646 BackfaceCulling != b.BackfaceCulling || 646 BackfaceCulling != b.BackfaceCulling ||
647 FrontfaceCulling != b.FrontfaceCulling || 647 FrontfaceCulling != b.FrontfaceCulling ||
648 FogEnable != b.FogEnable || 648 FogEnable != b.FogEnable ||
649 NormalizeNormals != b.NormalizeNormals || 649 NormalizeNormals != b.NormalizeNormals ||
650 AntiAliasing != b.AntiAliasing || 650 AntiAliasing != b.AntiAliasing ||
651 ColorMask != b.ColorMask || 651 ColorMask != b.ColorMask ||
652 ColorMaterial != b.ColorMaterial || 652 ColorMaterial != b.ColorMaterial ||
653 BlendOperation != b.BlendOperation || 653 BlendOperation != b.BlendOperation ||
654 PolygonOffsetFactor != b.PolygonOffsetFactor || 654 PolygonOffsetFactor != b.PolygonOffsetFactor ||
655 PolygonOffsetDirection != b.PolygonOffsetDirection || 655 PolygonOffsetDirection != b.PolygonOffsetDirection ||
656 UseMipMaps != b.UseMipMaps; 656 UseMipMaps != b.UseMipMaps;
657 for (u32 i=0; (i<MATERIAL_MAX_TEXTURES) && !different; ++i) 657 for (u32 i=0; (i<MATERIAL_MAX_TEXTURES) && !different; ++i)
658 { 658 {
659 different |= (TextureLayer[i] != b.TextureLayer[i]); 659 different |= (TextureLayer[i] != b.TextureLayer[i]);
660 } 660 }
661 return different; 661 return different;
662 } 662 }
663 663
664 //! Equality operator 664 //! Equality operator
665 /** \param b Material to compare to. 665 /** \param b Material to compare to.
666 \return True if the materials are equal, else false. */ 666 \return True if the materials are equal, else false. */
667 inline bool operator==(const SMaterial& b) const 667 inline bool operator==(const SMaterial& b) const
668 { return !(b!=*this); } 668 { return !(b!=*this); }
669 669
670 bool isTransparent() const 670 bool isTransparent() const
671 { 671 {
672 return MaterialType==EMT_TRANSPARENT_ADD_COLOR || 672 return MaterialType==EMT_TRANSPARENT_ADD_COLOR ||
673 MaterialType==EMT_TRANSPARENT_ALPHA_CHANNEL || 673 MaterialType==EMT_TRANSPARENT_ALPHA_CHANNEL ||
674 MaterialType==EMT_TRANSPARENT_VERTEX_ALPHA || 674 MaterialType==EMT_TRANSPARENT_VERTEX_ALPHA ||
675 MaterialType==EMT_TRANSPARENT_REFLECTION_2_LAYER; 675 MaterialType==EMT_TRANSPARENT_REFLECTION_2_LAYER;
676 } 676 }
677 }; 677 };
678 678
679 //! global const identity Material 679 //! global const identity Material
680 IRRLICHT_API extern SMaterial IdentityMaterial; 680 IRRLICHT_API extern SMaterial IdentityMaterial;
681 681
682} // end namespace video 682} // end namespace video
683} // end namespace irr 683} // end namespace irr
684 684
685#endif 685#endif
diff --git a/libraries/irrlicht-1.8/include/SMaterialLayer.h b/libraries/irrlicht-1.8/include/SMaterialLayer.h
index 068c030..30e8cd9 100644
--- a/libraries/irrlicht-1.8/include/SMaterialLayer.h
+++ b/libraries/irrlicht-1.8/include/SMaterialLayer.h
@@ -1,228 +1,228 @@
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#ifndef __S_MATERIAL_LAYER_H_INCLUDED__ 5#ifndef __S_MATERIAL_LAYER_H_INCLUDED__
6#define __S_MATERIAL_LAYER_H_INCLUDED__ 6#define __S_MATERIAL_LAYER_H_INCLUDED__
7 7
8#include "matrix4.h" 8#include "matrix4.h"
9#include "irrAllocator.h" 9#include "irrAllocator.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace video 13namespace video
14{ 14{
15 class ITexture; 15 class ITexture;
16 16
17 //! Texture coord clamp mode outside [0.0, 1.0] 17 //! Texture coord clamp mode outside [0.0, 1.0]
18 enum E_TEXTURE_CLAMP 18 enum E_TEXTURE_CLAMP
19 { 19 {
20 //! Texture repeats 20 //! Texture repeats
21 ETC_REPEAT = 0, 21 ETC_REPEAT = 0,
22 //! Texture is clamped to the last pixel 22 //! Texture is clamped to the last pixel
23 ETC_CLAMP, 23 ETC_CLAMP,
24 //! Texture is clamped to the edge pixel 24 //! Texture is clamped to the edge pixel
25 ETC_CLAMP_TO_EDGE, 25 ETC_CLAMP_TO_EDGE,
26 //! Texture is clamped to the border pixel (if exists) 26 //! Texture is clamped to the border pixel (if exists)
27 ETC_CLAMP_TO_BORDER, 27 ETC_CLAMP_TO_BORDER,
28 //! Texture is alternatingly mirrored (0..1..0..1..0..) 28 //! Texture is alternatingly mirrored (0..1..0..1..0..)
29 ETC_MIRROR, 29 ETC_MIRROR,
30 //! Texture is mirrored once and then clamped (0..1..0) 30 //! Texture is mirrored once and then clamped (0..1..0)
31 ETC_MIRROR_CLAMP, 31 ETC_MIRROR_CLAMP,
32 //! Texture is mirrored once and then clamped to edge 32 //! Texture is mirrored once and then clamped to edge
33 ETC_MIRROR_CLAMP_TO_EDGE, 33 ETC_MIRROR_CLAMP_TO_EDGE,
34 //! Texture is mirrored once and then clamped to border 34 //! Texture is mirrored once and then clamped to border
35 ETC_MIRROR_CLAMP_TO_BORDER 35 ETC_MIRROR_CLAMP_TO_BORDER
36 }; 36 };
37 static const char* const aTextureClampNames[] = { 37 static const char* const aTextureClampNames[] = {
38 "texture_clamp_repeat", 38 "texture_clamp_repeat",
39 "texture_clamp_clamp", 39 "texture_clamp_clamp",
40 "texture_clamp_clamp_to_edge", 40 "texture_clamp_clamp_to_edge",
41 "texture_clamp_clamp_to_border", 41 "texture_clamp_clamp_to_border",
42 "texture_clamp_mirror", 42 "texture_clamp_mirror",
43 "texture_clamp_mirror_clamp", 43 "texture_clamp_mirror_clamp",
44 "texture_clamp_mirror_clamp_to_edge", 44 "texture_clamp_mirror_clamp_to_edge",
45 "texture_clamp_mirror_clamp_to_border", 0}; 45 "texture_clamp_mirror_clamp_to_border", 0};
46 46
47 //! Struct for holding material parameters which exist per texture layer 47 //! Struct for holding material parameters which exist per texture layer
48 class SMaterialLayer 48 class SMaterialLayer
49 { 49 {
50 public: 50 public:
51 //! Default constructor 51 //! Default constructor
52 SMaterialLayer() 52 SMaterialLayer()
53 : Texture(0), 53 : Texture(0),
54 TextureWrapU(ETC_REPEAT), 54 TextureWrapU(ETC_REPEAT),
55 TextureWrapV(ETC_REPEAT), 55 TextureWrapV(ETC_REPEAT),
56 BilinearFilter(true), 56 BilinearFilter(true),
57 TrilinearFilter(false), 57 TrilinearFilter(false),
58 AnisotropicFilter(0), 58 AnisotropicFilter(0),
59 LODBias(0), 59 LODBias(0),
60 TextureMatrix(0) 60 TextureMatrix(0)
61 {} 61 {}
62 62
63 //! Copy constructor 63 //! Copy constructor
64 /** \param other Material layer to copy from. */ 64 /** \param other Material layer to copy from. */
65 SMaterialLayer(const SMaterialLayer& other) 65 SMaterialLayer(const SMaterialLayer& other)
66 { 66 {
67 // This pointer is checked during assignment 67 // This pointer is checked during assignment
68 TextureMatrix = 0; 68 TextureMatrix = 0;
69 *this = other; 69 *this = other;
70 } 70 }
71 71
72 //! Destructor 72 //! Destructor
73 ~SMaterialLayer() 73 ~SMaterialLayer()
74 { 74 {
75 MatrixAllocator.destruct(TextureMatrix); 75 MatrixAllocator.destruct(TextureMatrix);
76 MatrixAllocator.deallocate(TextureMatrix); 76 MatrixAllocator.deallocate(TextureMatrix);
77 } 77 }
78 78
79 //! Assignment operator 79 //! Assignment operator
80 /** \param other Material layer to copy from. 80 /** \param other Material layer to copy from.
81 \return This material layer, updated. */ 81 \return This material layer, updated. */
82 SMaterialLayer& operator=(const SMaterialLayer& other) 82 SMaterialLayer& operator=(const SMaterialLayer& other)
83 { 83 {
84 // Check for self-assignment! 84 // Check for self-assignment!
85 if (this == &other) 85 if (this == &other)
86 return *this; 86 return *this;
87 87
88 Texture = other.Texture; 88 Texture = other.Texture;
89 if (TextureMatrix) 89 if (TextureMatrix)
90 { 90 {
91 if (other.TextureMatrix) 91 if (other.TextureMatrix)
92 *TextureMatrix = *other.TextureMatrix; 92 *TextureMatrix = *other.TextureMatrix;
93 else 93 else
94 { 94 {
95 MatrixAllocator.destruct(TextureMatrix); 95 MatrixAllocator.destruct(TextureMatrix);
96 MatrixAllocator.deallocate(TextureMatrix); 96 MatrixAllocator.deallocate(TextureMatrix);
97 TextureMatrix = 0; 97 TextureMatrix = 0;
98 } 98 }
99 } 99 }
100 else 100 else
101 { 101 {
102 if (other.TextureMatrix) 102 if (other.TextureMatrix)
103 { 103 {
104 TextureMatrix = MatrixAllocator.allocate(1); 104 TextureMatrix = MatrixAllocator.allocate(1);
105 MatrixAllocator.construct(TextureMatrix,*other.TextureMatrix); 105 MatrixAllocator.construct(TextureMatrix,*other.TextureMatrix);
106 } 106 }
107 else 107 else
108 TextureMatrix = 0; 108 TextureMatrix = 0;
109 } 109 }
110 TextureWrapU = other.TextureWrapU; 110 TextureWrapU = other.TextureWrapU;
111 TextureWrapV = other.TextureWrapV; 111 TextureWrapV = other.TextureWrapV;
112 BilinearFilter = other.BilinearFilter; 112 BilinearFilter = other.BilinearFilter;
113 TrilinearFilter = other.TrilinearFilter; 113 TrilinearFilter = other.TrilinearFilter;
114 AnisotropicFilter = other.AnisotropicFilter; 114 AnisotropicFilter = other.AnisotropicFilter;
115 LODBias = other.LODBias; 115 LODBias = other.LODBias;
116 116
117 return *this; 117 return *this;
118 } 118 }
119 119
120 //! Gets the texture transformation matrix 120 //! Gets the texture transformation matrix
121 /** \return Texture matrix of this layer. */ 121 /** \return Texture matrix of this layer. */
122 core::matrix4& getTextureMatrix() 122 core::matrix4& getTextureMatrix()
123 { 123 {
124 if (!TextureMatrix) 124 if (!TextureMatrix)
125 { 125 {
126 TextureMatrix = MatrixAllocator.allocate(1); 126 TextureMatrix = MatrixAllocator.allocate(1);
127 MatrixAllocator.construct(TextureMatrix,core::IdentityMatrix); 127 MatrixAllocator.construct(TextureMatrix,core::IdentityMatrix);
128 } 128 }
129 return *TextureMatrix; 129 return *TextureMatrix;
130 } 130 }
131 131
132 //! Gets the immutable texture transformation matrix 132 //! Gets the immutable texture transformation matrix
133 /** \return Texture matrix of this layer. */ 133 /** \return Texture matrix of this layer. */
134 const core::matrix4& getTextureMatrix() const 134 const core::matrix4& getTextureMatrix() const
135 { 135 {
136 if (TextureMatrix) 136 if (TextureMatrix)
137 return *TextureMatrix; 137 return *TextureMatrix;
138 else 138 else
139 return core::IdentityMatrix; 139 return core::IdentityMatrix;
140 } 140 }
141 141
142 //! Sets the texture transformation matrix to mat 142 //! Sets the texture transformation matrix to mat
143 /** \param mat New texture matrix for this layer. */ 143 /** \param mat New texture matrix for this layer. */
144 void setTextureMatrix(const core::matrix4& mat) 144 void setTextureMatrix(const core::matrix4& mat)
145 { 145 {
146 if (!TextureMatrix) 146 if (!TextureMatrix)
147 { 147 {
148 TextureMatrix = MatrixAllocator.allocate(1); 148 TextureMatrix = MatrixAllocator.allocate(1);
149 MatrixAllocator.construct(TextureMatrix,mat); 149 MatrixAllocator.construct(TextureMatrix,mat);
150 } 150 }
151 else 151 else
152 *TextureMatrix = mat; 152 *TextureMatrix = mat;
153 } 153 }
154 154
155 //! Inequality operator 155 //! Inequality operator
156 /** \param b Layer to compare to. 156 /** \param b Layer to compare to.
157 \return True if layers are different, else false. */ 157 \return True if layers are different, else false. */
158 inline bool operator!=(const SMaterialLayer& b) const 158 inline bool operator!=(const SMaterialLayer& b) const
159 { 159 {
160 bool different = 160 bool different =
161 Texture != b.Texture || 161 Texture != b.Texture ||
162 TextureWrapU != b.TextureWrapU || 162 TextureWrapU != b.TextureWrapU ||
163 TextureWrapV != b.TextureWrapV || 163 TextureWrapV != b.TextureWrapV ||
164 BilinearFilter != b.BilinearFilter || 164 BilinearFilter != b.BilinearFilter ||
165 TrilinearFilter != b.TrilinearFilter || 165 TrilinearFilter != b.TrilinearFilter ||
166 AnisotropicFilter != b.AnisotropicFilter || 166 AnisotropicFilter != b.AnisotropicFilter ||
167 LODBias != b.LODBias; 167 LODBias != b.LODBias;
168 if (different) 168 if (different)
169 return true; 169 return true;
170 else 170 else
171 different |= (TextureMatrix != b.TextureMatrix) && 171 different |= (TextureMatrix != b.TextureMatrix) &&
172 TextureMatrix && b.TextureMatrix && 172 TextureMatrix && b.TextureMatrix &&
173 (*TextureMatrix != *(b.TextureMatrix)); 173 (*TextureMatrix != *(b.TextureMatrix));
174 return different; 174 return different;
175 } 175 }
176 176
177 //! Equality operator 177 //! Equality operator
178 /** \param b Layer to compare to. 178 /** \param b Layer to compare to.
179 \return True if layers are equal, else false. */ 179 \return True if layers are equal, else false. */
180 inline bool operator==(const SMaterialLayer& b) const 180 inline bool operator==(const SMaterialLayer& b) const
181 { return !(b!=*this); } 181 { return !(b!=*this); }
182 182
183 //! Texture 183 //! Texture
184 ITexture* Texture; 184 ITexture* Texture;
185 185
186 //! Texture Clamp Mode 186 //! Texture Clamp Mode
187 /** Values are taken from E_TEXTURE_CLAMP. */ 187 /** Values are taken from E_TEXTURE_CLAMP. */
188 u8 TextureWrapU:4; 188 u8 TextureWrapU:4;
189 u8 TextureWrapV:4; 189 u8 TextureWrapV:4;
190 190
191 //! Is bilinear filtering enabled? Default: true 191 //! Is bilinear filtering enabled? Default: true
192 bool BilinearFilter:1; 192 bool BilinearFilter:1;
193 193
194 //! Is trilinear filtering enabled? Default: false 194 //! Is trilinear filtering enabled? Default: false
195 /** If the trilinear filter flag is enabled, 195 /** If the trilinear filter flag is enabled,
196 the bilinear filtering flag is ignored. */ 196 the bilinear filtering flag is ignored. */
197 bool TrilinearFilter:1; 197 bool TrilinearFilter:1;
198 198
199 //! Is anisotropic filtering enabled? Default: 0, disabled 199 //! Is anisotropic filtering enabled? Default: 0, disabled
200 /** In Irrlicht you can use anisotropic texture filtering 200 /** In Irrlicht you can use anisotropic texture filtering
201 in conjunction with bilinear or trilinear texture 201 in conjunction with bilinear or trilinear texture
202 filtering to improve rendering results. Primitives 202 filtering to improve rendering results. Primitives
203 will look less blurry with this flag switched on. The number gives 203 will look less blurry with this flag switched on. The number gives
204 the maximal anisotropy degree, and is often in the range 2-16. 204 the maximal anisotropy degree, and is often in the range 2-16.
205 Value 1 is equivalent to 0, but should be avoided. */ 205 Value 1 is equivalent to 0, but should be avoided. */
206 u8 AnisotropicFilter; 206 u8 AnisotropicFilter;
207 207
208 //! Bias for the mipmap choosing decision. 208 //! Bias for the mipmap choosing decision.
209 /** This value can make the textures more or less blurry than with the 209 /** This value can make the textures more or less blurry than with the
210 default value of 0. The value (divided by 8.f) is added to the mipmap level 210 default value of 0. The value (divided by 8.f) is added to the mipmap level
211 chosen initially, and thus takes a smaller mipmap for a region 211 chosen initially, and thus takes a smaller mipmap for a region
212 if the value is positive. */ 212 if the value is positive. */
213 s8 LODBias; 213 s8 LODBias;
214 214
215 private: 215 private:
216 friend class SMaterial; 216 friend class SMaterial;
217 irr::core::irrAllocator<irr::core::matrix4> MatrixAllocator; 217 irr::core::irrAllocator<irr::core::matrix4> MatrixAllocator;
218 218
219 //! Texture Matrix 219 //! Texture Matrix
220 /** Do not access this element directly as the internal 220 /** Do not access this element directly as the internal
221 ressource management has to cope with Null pointers etc. */ 221 ressource management has to cope with Null pointers etc. */
222 core::matrix4* TextureMatrix; 222 core::matrix4* TextureMatrix;
223 }; 223 };
224 224
225} // end namespace video 225} // end namespace video
226} // end namespace irr 226} // end namespace irr
227 227
228#endif // __S_MATERIAL_LAYER_H_INCLUDED__ 228#endif // __S_MATERIAL_LAYER_H_INCLUDED__
diff --git a/libraries/irrlicht-1.8/include/SMesh.h b/libraries/irrlicht-1.8/include/SMesh.h
index 77a695d..efac56e 100644
--- a/libraries/irrlicht-1.8/include/SMesh.h
+++ b/libraries/irrlicht-1.8/include/SMesh.h
@@ -1,140 +1,140 @@
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#ifndef __S_MESH_H_INCLUDED__ 5#ifndef __S_MESH_H_INCLUDED__
6#define __S_MESH_H_INCLUDED__ 6#define __S_MESH_H_INCLUDED__
7 7
8#include "IMesh.h" 8#include "IMesh.h"
9#include "IMeshBuffer.h" 9#include "IMeshBuffer.h"
10#include "aabbox3d.h" 10#include "aabbox3d.h"
11#include "irrArray.h" 11#include "irrArray.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace scene 15namespace scene
16{ 16{
17 //! Simple implementation of the IMesh interface. 17 //! Simple implementation of the IMesh interface.
18 struct SMesh : public IMesh 18 struct SMesh : public IMesh
19 { 19 {
20 //! constructor 20 //! constructor
21 SMesh() 21 SMesh()
22 { 22 {
23 #ifdef _DEBUG 23 #ifdef _DEBUG
24 setDebugName("SMesh"); 24 setDebugName("SMesh");
25 #endif 25 #endif
26 } 26 }
27 27
28 //! destructor 28 //! destructor
29 virtual ~SMesh() 29 virtual ~SMesh()
30 { 30 {
31 // drop buffers 31 // drop buffers
32 for (u32 i=0; i<MeshBuffers.size(); ++i) 32 for (u32 i=0; i<MeshBuffers.size(); ++i)
33 MeshBuffers[i]->drop(); 33 MeshBuffers[i]->drop();
34 } 34 }
35 35
36 //! clean mesh 36 //! clean mesh
37 virtual void clear() 37 virtual void clear()
38 { 38 {
39 for (u32 i=0; i<MeshBuffers.size(); ++i) 39 for (u32 i=0; i<MeshBuffers.size(); ++i)
40 MeshBuffers[i]->drop(); 40 MeshBuffers[i]->drop();
41 MeshBuffers.clear(); 41 MeshBuffers.clear();
42 BoundingBox.reset ( 0.f, 0.f, 0.f ); 42 BoundingBox.reset ( 0.f, 0.f, 0.f );
43 } 43 }
44 44
45 45
46 //! returns amount of mesh buffers. 46 //! returns amount of mesh buffers.
47 virtual u32 getMeshBufferCount() const 47 virtual u32 getMeshBufferCount() const
48 { 48 {
49 return MeshBuffers.size(); 49 return MeshBuffers.size();
50 } 50 }
51 51
52 //! returns pointer to a mesh buffer 52 //! returns pointer to a mesh buffer
53 virtual IMeshBuffer* getMeshBuffer(u32 nr) const 53 virtual IMeshBuffer* getMeshBuffer(u32 nr) const
54 { 54 {
55 return MeshBuffers[nr]; 55 return MeshBuffers[nr];
56 } 56 }
57 57
58 //! returns a meshbuffer which fits a material 58 //! returns a meshbuffer which fits a material
59 /** reverse search */ 59 /** reverse search */
60 virtual IMeshBuffer* getMeshBuffer( const video::SMaterial & material) const 60 virtual IMeshBuffer* getMeshBuffer( const video::SMaterial & material) const
61 { 61 {
62 for (s32 i = (s32)MeshBuffers.size()-1; i >= 0; --i) 62 for (s32 i = (s32)MeshBuffers.size()-1; i >= 0; --i)
63 { 63 {
64 if ( material == MeshBuffers[i]->getMaterial()) 64 if ( material == MeshBuffers[i]->getMaterial())
65 return MeshBuffers[i]; 65 return MeshBuffers[i];
66 } 66 }
67 67
68 return 0; 68 return 0;
69 } 69 }
70 70
71 //! returns an axis aligned bounding box 71 //! returns an axis aligned bounding box
72 virtual const core::aabbox3d<f32>& getBoundingBox() const 72 virtual const core::aabbox3d<f32>& getBoundingBox() const
73 { 73 {
74 return BoundingBox; 74 return BoundingBox;
75 } 75 }
76 76
77 //! set user axis aligned bounding box 77 //! set user axis aligned bounding box
78 virtual void setBoundingBox( const core::aabbox3df& box) 78 virtual void setBoundingBox( const core::aabbox3df& box)
79 { 79 {
80 BoundingBox = box; 80 BoundingBox = box;
81 } 81 }
82 82
83 //! recalculates the bounding box 83 //! recalculates the bounding box
84 void recalculateBoundingBox() 84 void recalculateBoundingBox()
85 { 85 {
86 if (MeshBuffers.size()) 86 if (MeshBuffers.size())
87 { 87 {
88 BoundingBox = MeshBuffers[0]->getBoundingBox(); 88 BoundingBox = MeshBuffers[0]->getBoundingBox();
89 for (u32 i=1; i<MeshBuffers.size(); ++i) 89 for (u32 i=1; i<MeshBuffers.size(); ++i)
90 BoundingBox.addInternalBox(MeshBuffers[i]->getBoundingBox()); 90 BoundingBox.addInternalBox(MeshBuffers[i]->getBoundingBox());
91 } 91 }
92 else 92 else
93 BoundingBox.reset(0.0f, 0.0f, 0.0f); 93 BoundingBox.reset(0.0f, 0.0f, 0.0f);
94 } 94 }
95 95
96 //! adds a MeshBuffer 96 //! adds a MeshBuffer
97 /** The bounding box is not updated automatically. */ 97 /** The bounding box is not updated automatically. */
98 void addMeshBuffer(IMeshBuffer* buf) 98 void addMeshBuffer(IMeshBuffer* buf)
99 { 99 {
100 if (buf) 100 if (buf)
101 { 101 {
102 buf->grab(); 102 buf->grab();
103 MeshBuffers.push_back(buf); 103 MeshBuffers.push_back(buf);
104 } 104 }
105 } 105 }
106 106
107 //! sets a flag of all contained materials to a new value 107 //! sets a flag of all contained materials to a new value
108 virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) 108 virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
109 { 109 {
110 for (u32 i=0; i<MeshBuffers.size(); ++i) 110 for (u32 i=0; i<MeshBuffers.size(); ++i)
111 MeshBuffers[i]->getMaterial().setFlag(flag, newvalue); 111 MeshBuffers[i]->getMaterial().setFlag(flag, newvalue);
112 } 112 }
113 113
114 //! set the hardware mapping hint, for driver 114 //! set the hardware mapping hint, for driver
115 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) 115 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX )
116 { 116 {
117 for (u32 i=0; i<MeshBuffers.size(); ++i) 117 for (u32 i=0; i<MeshBuffers.size(); ++i)
118 MeshBuffers[i]->setHardwareMappingHint(newMappingHint, buffer); 118 MeshBuffers[i]->setHardwareMappingHint(newMappingHint, buffer);
119 } 119 }
120 120
121 //! flags the meshbuffer as changed, reloads hardware buffers 121 //! flags the meshbuffer as changed, reloads hardware buffers
122 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) 122 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX)
123 { 123 {
124 for (u32 i=0; i<MeshBuffers.size(); ++i) 124 for (u32 i=0; i<MeshBuffers.size(); ++i)
125 MeshBuffers[i]->setDirty(buffer); 125 MeshBuffers[i]->setDirty(buffer);
126 } 126 }
127 127
128 //! The meshbuffers of this mesh 128 //! The meshbuffers of this mesh
129 core::array<IMeshBuffer*> MeshBuffers; 129 core::array<IMeshBuffer*> MeshBuffers;
130 130
131 //! The bounding box of this mesh 131 //! The bounding box of this mesh
132 core::aabbox3d<f32> BoundingBox; 132 core::aabbox3d<f32> BoundingBox;
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 139#endif
140 140
diff --git a/libraries/irrlicht-1.8/include/SMeshBuffer.h b/libraries/irrlicht-1.8/include/SMeshBuffer.h
index 03b441f..2c3b7e2 100644
--- a/libraries/irrlicht-1.8/include/SMeshBuffer.h
+++ b/libraries/irrlicht-1.8/include/SMeshBuffer.h
@@ -1,7 +1,7 @@
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// replaced by template 5// replaced by template
6#include "CMeshBuffer.h" 6#include "CMeshBuffer.h"
7 7
diff --git a/libraries/irrlicht-1.8/include/SMeshBufferLightMap.h b/libraries/irrlicht-1.8/include/SMeshBufferLightMap.h
index 03b441f..2c3b7e2 100644
--- a/libraries/irrlicht-1.8/include/SMeshBufferLightMap.h
+++ b/libraries/irrlicht-1.8/include/SMeshBufferLightMap.h
@@ -1,7 +1,7 @@
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// replaced by template 5// replaced by template
6#include "CMeshBuffer.h" 6#include "CMeshBuffer.h"
7 7
diff --git a/libraries/irrlicht-1.8/include/SMeshBufferTangents.h b/libraries/irrlicht-1.8/include/SMeshBufferTangents.h
index 03b441f..2c3b7e2 100644
--- a/libraries/irrlicht-1.8/include/SMeshBufferTangents.h
+++ b/libraries/irrlicht-1.8/include/SMeshBufferTangents.h
@@ -1,7 +1,7 @@
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// replaced by template 5// replaced by template
6#include "CMeshBuffer.h" 6#include "CMeshBuffer.h"
7 7
diff --git a/libraries/irrlicht-1.8/include/SParticle.h b/libraries/irrlicht-1.8/include/SParticle.h
index d1507a1..c69c483 100644
--- a/libraries/irrlicht-1.8/include/SParticle.h
+++ b/libraries/irrlicht-1.8/include/SParticle.h
@@ -1,56 +1,56 @@
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#ifndef __S_PARTICLE_H_INCLUDED__ 5#ifndef __S_PARTICLE_H_INCLUDED__
6#define __S_PARTICLE_H_INCLUDED__ 6#define __S_PARTICLE_H_INCLUDED__
7 7
8#include "vector3d.h" 8#include "vector3d.h"
9#include "dimension2d.h" 9#include "dimension2d.h"
10#include "SColor.h" 10#include "SColor.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace scene 14namespace scene
15{ 15{
16 //! Struct for holding particle data 16 //! Struct for holding particle data
17 struct SParticle 17 struct SParticle
18 { 18 {
19 //! Position of the particle 19 //! Position of the particle
20 core::vector3df pos; 20 core::vector3df pos;
21 21
22 //! Direction and speed of the particle 22 //! Direction and speed of the particle
23 core::vector3df vector; 23 core::vector3df vector;
24 24
25 //! Start life time of the particle 25 //! Start life time of the particle
26 u32 startTime; 26 u32 startTime;
27 27
28 //! End life time of the particle 28 //! End life time of the particle
29 u32 endTime; 29 u32 endTime;
30 30
31 //! Current color of the particle 31 //! Current color of the particle
32 video::SColor color; 32 video::SColor color;
33 33
34 //! Original color of the particle. 34 //! Original color of the particle.
35 /** That's the color of the particle it had when it was emitted. */ 35 /** That's the color of the particle it had when it was emitted. */
36 video::SColor startColor; 36 video::SColor startColor;
37 37
38 //! Original direction and speed of the particle. 38 //! Original direction and speed of the particle.
39 /** The direction and speed the particle had when it was emitted. */ 39 /** The direction and speed the particle had when it was emitted. */
40 core::vector3df startVector; 40 core::vector3df startVector;
41 41
42 //! Scale of the particle. 42 //! Scale of the particle.
43 /** The current scale of the particle. */ 43 /** The current scale of the particle. */
44 core::dimension2df size; 44 core::dimension2df size;
45 45
46 //! Original scale of the particle. 46 //! Original scale of the particle.
47 /** The scale of the particle when it was emitted. */ 47 /** The scale of the particle when it was emitted. */
48 core::dimension2df startSize; 48 core::dimension2df startSize;
49 }; 49 };
50 50
51 51
52} // end namespace scene 52} // end namespace scene
53} // end namespace irr 53} // end namespace irr
54 54
55#endif 55#endif
56 56
diff --git a/libraries/irrlicht-1.8/include/SSharedMeshBuffer.h b/libraries/irrlicht-1.8/include/SSharedMeshBuffer.h
index b9ee07a..016b796 100644
--- a/libraries/irrlicht-1.8/include/SSharedMeshBuffer.h
+++ b/libraries/irrlicht-1.8/include/SSharedMeshBuffer.h
@@ -1,242 +1,242 @@
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#ifndef __S_SHARED_MESH_BUFFER_H_INCLUDED__ 5#ifndef __S_SHARED_MESH_BUFFER_H_INCLUDED__
6#define __S_SHARED_MESH_BUFFER_H_INCLUDED__ 6#define __S_SHARED_MESH_BUFFER_H_INCLUDED__
7 7
8#include "irrArray.h" 8#include "irrArray.h"
9#include "IMeshBuffer.h" 9#include "IMeshBuffer.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 //! Implementation of the IMeshBuffer interface with shared vertex list 15 //! Implementation of the IMeshBuffer interface with shared vertex list
16 struct SSharedMeshBuffer : public IMeshBuffer 16 struct SSharedMeshBuffer : public IMeshBuffer
17 { 17 {
18 //! constructor 18 //! constructor
19 SSharedMeshBuffer() : IMeshBuffer(), Vertices(0), ChangedID_Vertex(1), ChangedID_Index(1), MappingHintVertex(EHM_NEVER), MappingHintIndex(EHM_NEVER) 19 SSharedMeshBuffer() : IMeshBuffer(), Vertices(0), ChangedID_Vertex(1), ChangedID_Index(1), MappingHintVertex(EHM_NEVER), MappingHintIndex(EHM_NEVER)
20 { 20 {
21 #ifdef _DEBUG 21 #ifdef _DEBUG
22 setDebugName("SSharedMeshBuffer"); 22 setDebugName("SSharedMeshBuffer");
23 #endif 23 #endif
24 } 24 }
25 25
26 //! constructor 26 //! constructor
27 SSharedMeshBuffer(core::array<video::S3DVertex> *vertices) : IMeshBuffer(), Vertices(vertices) 27 SSharedMeshBuffer(core::array<video::S3DVertex> *vertices) : IMeshBuffer(), Vertices(vertices)
28 { 28 {
29 #ifdef _DEBUG 29 #ifdef _DEBUG
30 setDebugName("SSharedMeshBuffer"); 30 setDebugName("SSharedMeshBuffer");
31 #endif 31 #endif
32 } 32 }
33 33
34 //! returns the material of this meshbuffer 34 //! returns the material of this meshbuffer
35 virtual const video::SMaterial& getMaterial() const 35 virtual const video::SMaterial& getMaterial() const
36 { 36 {
37 return Material; 37 return Material;
38 } 38 }
39 39
40 //! returns the material of this meshbuffer 40 //! returns the material of this meshbuffer
41 virtual video::SMaterial& getMaterial() 41 virtual video::SMaterial& getMaterial()
42 { 42 {
43 return Material; 43 return Material;
44 } 44 }
45 45
46 //! returns pointer to vertices 46 //! returns pointer to vertices
47 virtual const void* getVertices() const 47 virtual const void* getVertices() const
48 { 48 {
49 if (Vertices) 49 if (Vertices)
50 return Vertices->const_pointer(); 50 return Vertices->const_pointer();
51 else 51 else
52 return 0; 52 return 0;
53 } 53 }
54 54
55 //! returns pointer to vertices 55 //! returns pointer to vertices
56 virtual void* getVertices() 56 virtual void* getVertices()
57 { 57 {
58 if (Vertices) 58 if (Vertices)
59 return Vertices->pointer(); 59 return Vertices->pointer();
60 else 60 else
61 return 0; 61 return 0;
62 } 62 }
63 63
64 //! returns amount of vertices 64 //! returns amount of vertices
65 virtual u32 getVertexCount() const 65 virtual u32 getVertexCount() const
66 { 66 {
67 if (Vertices) 67 if (Vertices)
68 return Vertices->size(); 68 return Vertices->size();
69 else 69 else
70 return 0; 70 return 0;
71 } 71 }
72 72
73 //! returns pointer to Indices 73 //! returns pointer to Indices
74 virtual const u16* getIndices() const 74 virtual const u16* getIndices() const
75 { 75 {
76 return Indices.const_pointer(); 76 return Indices.const_pointer();
77 } 77 }
78 78
79 //! returns pointer to Indices 79 //! returns pointer to Indices
80 virtual u16* getIndices() 80 virtual u16* getIndices()
81 { 81 {
82 return Indices.pointer(); 82 return Indices.pointer();
83 } 83 }
84 84
85 //! returns amount of indices 85 //! returns amount of indices
86 virtual u32 getIndexCount() const 86 virtual u32 getIndexCount() const
87 { 87 {
88 return Indices.size(); 88 return Indices.size();
89 } 89 }
90 90
91 //! Get type of index data which is stored in this meshbuffer. 91 //! Get type of index data which is stored in this meshbuffer.
92 virtual video::E_INDEX_TYPE getIndexType() const 92 virtual video::E_INDEX_TYPE getIndexType() const
93 { 93 {
94 return video::EIT_16BIT; 94 return video::EIT_16BIT;
95 } 95 }
96 96
97 //! returns an axis aligned bounding box 97 //! returns an axis aligned bounding box
98 virtual const core::aabbox3d<f32>& getBoundingBox() const 98 virtual const core::aabbox3d<f32>& getBoundingBox() const
99 { 99 {
100 return BoundingBox; 100 return BoundingBox;
101 } 101 }
102 102
103 //! set user axis aligned bounding box 103 //! set user axis aligned bounding box
104 virtual void setBoundingBox( const core::aabbox3df& box) 104 virtual void setBoundingBox( const core::aabbox3df& box)
105 { 105 {
106 BoundingBox = box; 106 BoundingBox = box;
107 } 107 }
108 108
109 //! returns which type of vertex data is stored. 109 //! returns which type of vertex data is stored.
110 virtual video::E_VERTEX_TYPE getVertexType() const 110 virtual video::E_VERTEX_TYPE getVertexType() const
111 { 111 {
112 return video::EVT_STANDARD; 112 return video::EVT_STANDARD;
113 } 113 }
114 114
115 //! recalculates the bounding box. should be called if the mesh changed. 115 //! recalculates the bounding box. should be called if the mesh changed.
116 virtual void recalculateBoundingBox() 116 virtual void recalculateBoundingBox()
117 { 117 {
118 if (!Vertices || Vertices->empty() || Indices.empty()) 118 if (!Vertices || Vertices->empty() || Indices.empty())
119 BoundingBox.reset(0,0,0); 119 BoundingBox.reset(0,0,0);
120 else 120 else
121 { 121 {
122 BoundingBox.reset((*Vertices)[Indices[0]].Pos); 122 BoundingBox.reset((*Vertices)[Indices[0]].Pos);
123 for (u32 i=1; i<Indices.size(); ++i) 123 for (u32 i=1; i<Indices.size(); ++i)
124 BoundingBox.addInternalPoint((*Vertices)[Indices[i]].Pos); 124 BoundingBox.addInternalPoint((*Vertices)[Indices[i]].Pos);
125 } 125 }
126 } 126 }
127 127
128 //! returns position of vertex i 128 //! returns position of vertex i
129 virtual const core::vector3df& getPosition(u32 i) const 129 virtual const core::vector3df& getPosition(u32 i) const
130 { 130 {
131 _IRR_DEBUG_BREAK_IF(!Vertices); 131 _IRR_DEBUG_BREAK_IF(!Vertices);
132 return (*Vertices)[Indices[i]].Pos; 132 return (*Vertices)[Indices[i]].Pos;
133 } 133 }
134 134
135 //! returns position of vertex i 135 //! returns position of vertex i
136 virtual core::vector3df& getPosition(u32 i) 136 virtual core::vector3df& getPosition(u32 i)
137 { 137 {
138 _IRR_DEBUG_BREAK_IF(!Vertices); 138 _IRR_DEBUG_BREAK_IF(!Vertices);
139 return (*Vertices)[Indices[i]].Pos; 139 return (*Vertices)[Indices[i]].Pos;
140 } 140 }
141 141
142 //! returns normal of vertex i 142 //! returns normal of vertex i
143 virtual const core::vector3df& getNormal(u32 i) const 143 virtual const core::vector3df& getNormal(u32 i) const
144 { 144 {
145 _IRR_DEBUG_BREAK_IF(!Vertices); 145 _IRR_DEBUG_BREAK_IF(!Vertices);
146 return (*Vertices)[Indices[i]].Normal; 146 return (*Vertices)[Indices[i]].Normal;
147 } 147 }
148 148
149 //! returns normal of vertex i 149 //! returns normal of vertex i
150 virtual core::vector3df& getNormal(u32 i) 150 virtual core::vector3df& getNormal(u32 i)
151 { 151 {
152 _IRR_DEBUG_BREAK_IF(!Vertices); 152 _IRR_DEBUG_BREAK_IF(!Vertices);
153 return (*Vertices)[Indices[i]].Normal; 153 return (*Vertices)[Indices[i]].Normal;
154 } 154 }
155 155
156 //! returns texture coord of vertex i 156 //! returns texture coord of vertex i
157 virtual const core::vector2df& getTCoords(u32 i) const 157 virtual const core::vector2df& getTCoords(u32 i) const
158 { 158 {
159 _IRR_DEBUG_BREAK_IF(!Vertices); 159 _IRR_DEBUG_BREAK_IF(!Vertices);
160 return (*Vertices)[Indices[i]].TCoords; 160 return (*Vertices)[Indices[i]].TCoords;
161 } 161 }
162 162
163 //! returns texture coord of vertex i 163 //! returns texture coord of vertex i
164 virtual core::vector2df& getTCoords(u32 i) 164 virtual core::vector2df& getTCoords(u32 i)
165 { 165 {
166 _IRR_DEBUG_BREAK_IF(!Vertices); 166 _IRR_DEBUG_BREAK_IF(!Vertices);
167 return (*Vertices)[Indices[i]].TCoords; 167 return (*Vertices)[Indices[i]].TCoords;
168 } 168 }
169 169
170 //! append the vertices and indices to the current buffer 170 //! append the vertices and indices to the current buffer
171 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) {} 171 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) {}
172 172
173 //! append the meshbuffer to the current buffer 173 //! append the meshbuffer to the current buffer
174 virtual void append(const IMeshBuffer* const other) {} 174 virtual void append(const IMeshBuffer* const other) {}
175 175
176 //! get the current hardware mapping hint 176 //! get the current hardware mapping hint
177 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const 177 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const
178 { 178 {
179 return MappingHintVertex; 179 return MappingHintVertex;
180 } 180 }
181 181
182 //! get the current hardware mapping hint 182 //! get the current hardware mapping hint
183 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const 183 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const
184 { 184 {
185 return MappingHintIndex; 185 return MappingHintIndex;
186 } 186 }
187 187
188 //! set the hardware mapping hint, for driver 188 //! set the hardware mapping hint, for driver
189 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) 189 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX )
190 { 190 {
191 if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_VERTEX) 191 if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_VERTEX)
192 MappingHintVertex=NewMappingHint; 192 MappingHintVertex=NewMappingHint;
193 if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_INDEX) 193 if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_INDEX)
194 MappingHintIndex=NewMappingHint; 194 MappingHintIndex=NewMappingHint;
195 } 195 }
196 196
197 //! flags the mesh as changed, reloads hardware buffers 197 //! flags the mesh as changed, reloads hardware buffers
198 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) 198 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX)
199 { 199 {
200 if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_VERTEX) 200 if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_VERTEX)
201 ++ChangedID_Vertex; 201 ++ChangedID_Vertex;
202 if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_INDEX) 202 if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_INDEX)
203 ++ChangedID_Index; 203 ++ChangedID_Index;
204 } 204 }
205 205
206 //! Get the currently used ID for identification of changes. 206 //! Get the currently used ID for identification of changes.
207 /** This shouldn't be used for anything outside the VideoDriver. */ 207 /** This shouldn't be used for anything outside the VideoDriver. */
208 virtual u32 getChangedID_Vertex() const {return ChangedID_Vertex;} 208 virtual u32 getChangedID_Vertex() const {return ChangedID_Vertex;}
209 209
210 //! Get the currently used ID for identification of changes. 210 //! Get the currently used ID for identification of changes.
211 /** This shouldn't be used for anything outside the VideoDriver. */ 211 /** This shouldn't be used for anything outside the VideoDriver. */
212 virtual u32 getChangedID_Index() const {return ChangedID_Index;} 212 virtual u32 getChangedID_Index() const {return ChangedID_Index;}
213 213
214 //! Material of this meshBuffer 214 //! Material of this meshBuffer
215 video::SMaterial Material; 215 video::SMaterial Material;
216 216
217 //! Shared Array of vertices 217 //! Shared Array of vertices
218 core::array<video::S3DVertex> *Vertices; 218 core::array<video::S3DVertex> *Vertices;
219 219
220 //! Array of Indices 220 //! Array of Indices
221 core::array<u16> Indices; 221 core::array<u16> Indices;
222 222
223 //! ID used for hardware buffer management 223 //! ID used for hardware buffer management
224 u32 ChangedID_Vertex; 224 u32 ChangedID_Vertex;
225 225
226 //! ID used for hardware buffer management 226 //! ID used for hardware buffer management
227 u32 ChangedID_Index; 227 u32 ChangedID_Index;
228 228
229 //! Bounding box 229 //! Bounding box
230 core::aabbox3df BoundingBox; 230 core::aabbox3df BoundingBox;
231 231
232 //! hardware mapping hint 232 //! hardware mapping hint
233 E_HARDWARE_MAPPING MappingHintVertex; 233 E_HARDWARE_MAPPING MappingHintVertex;
234 E_HARDWARE_MAPPING MappingHintIndex; 234 E_HARDWARE_MAPPING MappingHintIndex;
235 }; 235 };
236 236
237 237
238} // end namespace scene 238} // end namespace scene
239} // end namespace irr 239} // end namespace irr
240 240
241#endif 241#endif
242 242
diff --git a/libraries/irrlicht-1.8/include/SSkinMeshBuffer.h b/libraries/irrlicht-1.8/include/SSkinMeshBuffer.h
index 4582b80..d47de19 100644
--- a/libraries/irrlicht-1.8/include/SSkinMeshBuffer.h
+++ b/libraries/irrlicht-1.8/include/SSkinMeshBuffer.h
@@ -1,404 +1,404 @@
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#ifndef __I_SKIN_MESH_BUFFER_H_INCLUDED__ 5#ifndef __I_SKIN_MESH_BUFFER_H_INCLUDED__
6#define __I_SKIN_MESH_BUFFER_H_INCLUDED__ 6#define __I_SKIN_MESH_BUFFER_H_INCLUDED__
7 7
8#include "IMeshBuffer.h" 8#include "IMeshBuffer.h"
9#include "S3DVertex.h" 9#include "S3DVertex.h"
10 10
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace scene 14namespace scene
15{ 15{
16 16
17 17
18//! A mesh buffer able to choose between S3DVertex2TCoords, S3DVertex and S3DVertexTangents at runtime 18//! A mesh buffer able to choose between S3DVertex2TCoords, S3DVertex and S3DVertexTangents at runtime
19struct SSkinMeshBuffer : public IMeshBuffer 19struct SSkinMeshBuffer : public IMeshBuffer
20{ 20{
21 //! Default constructor 21 //! Default constructor
22 SSkinMeshBuffer(video::E_VERTEX_TYPE vt=video::EVT_STANDARD) : 22 SSkinMeshBuffer(video::E_VERTEX_TYPE vt=video::EVT_STANDARD) :
23 ChangedID_Vertex(1), ChangedID_Index(1), VertexType(vt), 23 ChangedID_Vertex(1), ChangedID_Index(1), VertexType(vt),
24 MappingHint_Vertex(EHM_NEVER), MappingHint_Index(EHM_NEVER), 24 MappingHint_Vertex(EHM_NEVER), MappingHint_Index(EHM_NEVER),
25 BoundingBoxNeedsRecalculated(true) 25 BoundingBoxNeedsRecalculated(true)
26 { 26 {
27 #ifdef _DEBUG 27 #ifdef _DEBUG
28 setDebugName("SSkinMeshBuffer"); 28 setDebugName("SSkinMeshBuffer");
29 #endif 29 #endif
30 } 30 }
31 31
32 //! Get Material of this buffer. 32 //! Get Material of this buffer.
33 virtual const video::SMaterial& getMaterial() const 33 virtual const video::SMaterial& getMaterial() const
34 { 34 {
35 return Material; 35 return Material;
36 } 36 }
37 37
38 //! Get Material of this buffer. 38 //! Get Material of this buffer.
39 virtual video::SMaterial& getMaterial() 39 virtual video::SMaterial& getMaterial()
40 { 40 {
41 return Material; 41 return Material;
42 } 42 }
43 43
44 //! Get standard vertex at given index 44 //! Get standard vertex at given index
45 virtual video::S3DVertex *getVertex(u32 index) 45 virtual video::S3DVertex *getVertex(u32 index)
46 { 46 {
47 switch (VertexType) 47 switch (VertexType)
48 { 48 {
49 case video::EVT_2TCOORDS: 49 case video::EVT_2TCOORDS:
50 return (video::S3DVertex*)&Vertices_2TCoords[index]; 50 return (video::S3DVertex*)&Vertices_2TCoords[index];
51 case video::EVT_TANGENTS: 51 case video::EVT_TANGENTS:
52 return (video::S3DVertex*)&Vertices_Tangents[index]; 52 return (video::S3DVertex*)&Vertices_Tangents[index];
53 default: 53 default:
54 return &Vertices_Standard[index]; 54 return &Vertices_Standard[index];
55 } 55 }
56 } 56 }
57 57
58 //! Get pointer to vertex array 58 //! Get pointer to vertex array
59 virtual const void* getVertices() const 59 virtual const void* getVertices() const
60 { 60 {
61 switch (VertexType) 61 switch (VertexType)
62 { 62 {
63 case video::EVT_2TCOORDS: 63 case video::EVT_2TCOORDS:
64 return Vertices_2TCoords.const_pointer(); 64 return Vertices_2TCoords.const_pointer();
65 case video::EVT_TANGENTS: 65 case video::EVT_TANGENTS:
66 return Vertices_Tangents.const_pointer(); 66 return Vertices_Tangents.const_pointer();
67 default: 67 default:
68 return Vertices_Standard.const_pointer(); 68 return Vertices_Standard.const_pointer();
69 } 69 }
70 } 70 }
71 71
72 //! Get pointer to vertex array 72 //! Get pointer to vertex array
73 virtual void* getVertices() 73 virtual void* getVertices()
74 { 74 {
75 switch (VertexType) 75 switch (VertexType)
76 { 76 {
77 case video::EVT_2TCOORDS: 77 case video::EVT_2TCOORDS:
78 return Vertices_2TCoords.pointer(); 78 return Vertices_2TCoords.pointer();
79 case video::EVT_TANGENTS: 79 case video::EVT_TANGENTS:
80 return Vertices_Tangents.pointer(); 80 return Vertices_Tangents.pointer();
81 default: 81 default:
82 return Vertices_Standard.pointer(); 82 return Vertices_Standard.pointer();
83 } 83 }
84 } 84 }
85 85
86 //! Get vertex count 86 //! Get vertex count
87 virtual u32 getVertexCount() const 87 virtual u32 getVertexCount() const
88 { 88 {
89 switch (VertexType) 89 switch (VertexType)
90 { 90 {
91 case video::EVT_2TCOORDS: 91 case video::EVT_2TCOORDS:
92 return Vertices_2TCoords.size(); 92 return Vertices_2TCoords.size();
93 case video::EVT_TANGENTS: 93 case video::EVT_TANGENTS:
94 return Vertices_Tangents.size(); 94 return Vertices_Tangents.size();
95 default: 95 default:
96 return Vertices_Standard.size(); 96 return Vertices_Standard.size();
97 } 97 }
98 } 98 }
99 99
100 //! Get type of index data which is stored in this meshbuffer. 100 //! Get type of index data which is stored in this meshbuffer.
101 /** \return Index type of this buffer. */ 101 /** \return Index type of this buffer. */
102 virtual video::E_INDEX_TYPE getIndexType() const 102 virtual video::E_INDEX_TYPE getIndexType() const
103 { 103 {
104 return video::EIT_16BIT; 104 return video::EIT_16BIT;
105 } 105 }
106 106
107 //! Get pointer to index array 107 //! Get pointer to index array
108 virtual const u16* getIndices() const 108 virtual const u16* getIndices() const
109 { 109 {
110 return Indices.const_pointer(); 110 return Indices.const_pointer();
111 } 111 }
112 112
113 //! Get pointer to index array 113 //! Get pointer to index array
114 virtual u16* getIndices() 114 virtual u16* getIndices()
115 { 115 {
116 return Indices.pointer(); 116 return Indices.pointer();
117 } 117 }
118 118
119 //! Get index count 119 //! Get index count
120 virtual u32 getIndexCount() const 120 virtual u32 getIndexCount() const
121 { 121 {
122 return Indices.size(); 122 return Indices.size();
123 } 123 }
124 124
125 //! Get bounding box 125 //! Get bounding box
126 virtual const core::aabbox3d<f32>& getBoundingBox() const 126 virtual const core::aabbox3d<f32>& getBoundingBox() const
127 { 127 {
128 return BoundingBox; 128 return BoundingBox;
129 } 129 }
130 130
131 //! Set bounding box 131 //! Set bounding box
132 virtual void setBoundingBox( const core::aabbox3df& box) 132 virtual void setBoundingBox( const core::aabbox3df& box)
133 { 133 {
134 BoundingBox = box; 134 BoundingBox = box;
135 } 135 }
136 136
137 //! Recalculate bounding box 137 //! Recalculate bounding box
138 virtual void recalculateBoundingBox() 138 virtual void recalculateBoundingBox()
139 { 139 {
140 if(!BoundingBoxNeedsRecalculated) 140 if(!BoundingBoxNeedsRecalculated)
141 return; 141 return;
142 142
143 BoundingBoxNeedsRecalculated = false; 143 BoundingBoxNeedsRecalculated = false;
144 144
145 switch (VertexType) 145 switch (VertexType)
146 { 146 {
147 case video::EVT_STANDARD: 147 case video::EVT_STANDARD:
148 { 148 {
149 if (Vertices_Standard.empty()) 149 if (Vertices_Standard.empty())
150 BoundingBox.reset(0,0,0); 150 BoundingBox.reset(0,0,0);
151 else 151 else
152 { 152 {
153 BoundingBox.reset(Vertices_Standard[0].Pos); 153 BoundingBox.reset(Vertices_Standard[0].Pos);
154 for (u32 i=1; i<Vertices_Standard.size(); ++i) 154 for (u32 i=1; i<Vertices_Standard.size(); ++i)
155 BoundingBox.addInternalPoint(Vertices_Standard[i].Pos); 155 BoundingBox.addInternalPoint(Vertices_Standard[i].Pos);
156 } 156 }
157 break; 157 break;
158 } 158 }
159 case video::EVT_2TCOORDS: 159 case video::EVT_2TCOORDS:
160 { 160 {
161 if (Vertices_2TCoords.empty()) 161 if (Vertices_2TCoords.empty())
162 BoundingBox.reset(0,0,0); 162 BoundingBox.reset(0,0,0);
163 else 163 else
164 { 164 {
165 BoundingBox.reset(Vertices_2TCoords[0].Pos); 165 BoundingBox.reset(Vertices_2TCoords[0].Pos);
166 for (u32 i=1; i<Vertices_2TCoords.size(); ++i) 166 for (u32 i=1; i<Vertices_2TCoords.size(); ++i)
167 BoundingBox.addInternalPoint(Vertices_2TCoords[i].Pos); 167 BoundingBox.addInternalPoint(Vertices_2TCoords[i].Pos);
168 } 168 }
169 break; 169 break;
170 } 170 }
171 case video::EVT_TANGENTS: 171 case video::EVT_TANGENTS:
172 { 172 {
173 if (Vertices_Tangents.empty()) 173 if (Vertices_Tangents.empty())
174 BoundingBox.reset(0,0,0); 174 BoundingBox.reset(0,0,0);
175 else 175 else
176 { 176 {
177 BoundingBox.reset(Vertices_Tangents[0].Pos); 177 BoundingBox.reset(Vertices_Tangents[0].Pos);
178 for (u32 i=1; i<Vertices_Tangents.size(); ++i) 178 for (u32 i=1; i<Vertices_Tangents.size(); ++i)
179 BoundingBox.addInternalPoint(Vertices_Tangents[i].Pos); 179 BoundingBox.addInternalPoint(Vertices_Tangents[i].Pos);
180 } 180 }
181 break; 181 break;
182 } 182 }
183 } 183 }
184 } 184 }
185 185
186 //! Get vertex type 186 //! Get vertex type
187 virtual video::E_VERTEX_TYPE getVertexType() const 187 virtual video::E_VERTEX_TYPE getVertexType() const
188 { 188 {
189 return VertexType; 189 return VertexType;
190 } 190 }
191 191
192 //! Convert to 2tcoords vertex type 192 //! Convert to 2tcoords vertex type
193 virtual void convertTo2TCoords() 193 virtual void convertTo2TCoords()
194 { 194 {
195 if (VertexType==video::EVT_STANDARD) 195 if (VertexType==video::EVT_STANDARD)
196 { 196 {
197 for(u32 n=0;n<Vertices_Standard.size();++n) 197 for(u32 n=0;n<Vertices_Standard.size();++n)
198 { 198 {
199 video::S3DVertex2TCoords Vertex; 199 video::S3DVertex2TCoords Vertex;
200 Vertex.Color=Vertices_Standard[n].Color; 200 Vertex.Color=Vertices_Standard[n].Color;
201 Vertex.Pos=Vertices_Standard[n].Pos; 201 Vertex.Pos=Vertices_Standard[n].Pos;
202 Vertex.Normal=Vertices_Standard[n].Normal; 202 Vertex.Normal=Vertices_Standard[n].Normal;
203 Vertex.TCoords=Vertices_Standard[n].TCoords; 203 Vertex.TCoords=Vertices_Standard[n].TCoords;
204 Vertices_2TCoords.push_back(Vertex); 204 Vertices_2TCoords.push_back(Vertex);
205 } 205 }
206 Vertices_Standard.clear(); 206 Vertices_Standard.clear();
207 VertexType=video::EVT_2TCOORDS; 207 VertexType=video::EVT_2TCOORDS;
208 } 208 }
209 } 209 }
210 210
211 //! Convert to tangents vertex type 211 //! Convert to tangents vertex type
212 virtual void convertToTangents() 212 virtual void convertToTangents()
213 { 213 {
214 if (VertexType==video::EVT_STANDARD) 214 if (VertexType==video::EVT_STANDARD)
215 { 215 {
216 for(u32 n=0;n<Vertices_Standard.size();++n) 216 for(u32 n=0;n<Vertices_Standard.size();++n)
217 { 217 {
218 video::S3DVertexTangents Vertex; 218 video::S3DVertexTangents Vertex;
219 Vertex.Color=Vertices_Standard[n].Color; 219 Vertex.Color=Vertices_Standard[n].Color;
220 Vertex.Pos=Vertices_Standard[n].Pos; 220 Vertex.Pos=Vertices_Standard[n].Pos;
221 Vertex.Normal=Vertices_Standard[n].Normal; 221 Vertex.Normal=Vertices_Standard[n].Normal;
222 Vertex.TCoords=Vertices_Standard[n].TCoords; 222 Vertex.TCoords=Vertices_Standard[n].TCoords;
223 Vertices_Tangents.push_back(Vertex); 223 Vertices_Tangents.push_back(Vertex);
224 } 224 }
225 Vertices_Standard.clear(); 225 Vertices_Standard.clear();
226 VertexType=video::EVT_TANGENTS; 226 VertexType=video::EVT_TANGENTS;
227 } 227 }
228 else if (VertexType==video::EVT_2TCOORDS) 228 else if (VertexType==video::EVT_2TCOORDS)
229 { 229 {
230 for(u32 n=0;n<Vertices_2TCoords.size();++n) 230 for(u32 n=0;n<Vertices_2TCoords.size();++n)
231 { 231 {
232 video::S3DVertexTangents Vertex; 232 video::S3DVertexTangents Vertex;
233 Vertex.Color=Vertices_2TCoords[n].Color; 233 Vertex.Color=Vertices_2TCoords[n].Color;
234 Vertex.Pos=Vertices_2TCoords[n].Pos; 234 Vertex.Pos=Vertices_2TCoords[n].Pos;
235 Vertex.Normal=Vertices_2TCoords[n].Normal; 235 Vertex.Normal=Vertices_2TCoords[n].Normal;
236 Vertex.TCoords=Vertices_2TCoords[n].TCoords; 236 Vertex.TCoords=Vertices_2TCoords[n].TCoords;
237 Vertices_Tangents.push_back(Vertex); 237 Vertices_Tangents.push_back(Vertex);
238 } 238 }
239 Vertices_2TCoords.clear(); 239 Vertices_2TCoords.clear();
240 VertexType=video::EVT_TANGENTS; 240 VertexType=video::EVT_TANGENTS;
241 } 241 }
242 } 242 }
243 243
244 //! returns position of vertex i 244 //! returns position of vertex i
245 virtual const core::vector3df& getPosition(u32 i) const 245 virtual const core::vector3df& getPosition(u32 i) const
246 { 246 {
247 switch (VertexType) 247 switch (VertexType)
248 { 248 {
249 case video::EVT_2TCOORDS: 249 case video::EVT_2TCOORDS:
250 return Vertices_2TCoords[i].Pos; 250 return Vertices_2TCoords[i].Pos;
251 case video::EVT_TANGENTS: 251 case video::EVT_TANGENTS:
252 return Vertices_Tangents[i].Pos; 252 return Vertices_Tangents[i].Pos;
253 default: 253 default:
254 return Vertices_Standard[i].Pos; 254 return Vertices_Standard[i].Pos;
255 } 255 }
256 } 256 }
257 257
258 //! returns position of vertex i 258 //! returns position of vertex i
259 virtual core::vector3df& getPosition(u32 i) 259 virtual core::vector3df& getPosition(u32 i)
260 { 260 {
261 switch (VertexType) 261 switch (VertexType)
262 { 262 {
263 case video::EVT_2TCOORDS: 263 case video::EVT_2TCOORDS:
264 return Vertices_2TCoords[i].Pos; 264 return Vertices_2TCoords[i].Pos;
265 case video::EVT_TANGENTS: 265 case video::EVT_TANGENTS:
266 return Vertices_Tangents[i].Pos; 266 return Vertices_Tangents[i].Pos;
267 default: 267 default:
268 return Vertices_Standard[i].Pos; 268 return Vertices_Standard[i].Pos;
269 } 269 }
270 } 270 }
271 271
272 //! returns normal of vertex i 272 //! returns normal of vertex i
273 virtual const core::vector3df& getNormal(u32 i) const 273 virtual const core::vector3df& getNormal(u32 i) const
274 { 274 {
275 switch (VertexType) 275 switch (VertexType)
276 { 276 {
277 case video::EVT_2TCOORDS: 277 case video::EVT_2TCOORDS:
278 return Vertices_2TCoords[i].Normal; 278 return Vertices_2TCoords[i].Normal;
279 case video::EVT_TANGENTS: 279 case video::EVT_TANGENTS:
280 return Vertices_Tangents[i].Normal; 280 return Vertices_Tangents[i].Normal;
281 default: 281 default:
282 return Vertices_Standard[i].Normal; 282 return Vertices_Standard[i].Normal;
283 } 283 }
284 } 284 }
285 285
286 //! returns normal of vertex i 286 //! returns normal of vertex i
287 virtual core::vector3df& getNormal(u32 i) 287 virtual core::vector3df& getNormal(u32 i)
288 { 288 {
289 switch (VertexType) 289 switch (VertexType)
290 { 290 {
291 case video::EVT_2TCOORDS: 291 case video::EVT_2TCOORDS:
292 return Vertices_2TCoords[i].Normal; 292 return Vertices_2TCoords[i].Normal;
293 case video::EVT_TANGENTS: 293 case video::EVT_TANGENTS:
294 return Vertices_Tangents[i].Normal; 294 return Vertices_Tangents[i].Normal;
295 default: 295 default:
296 return Vertices_Standard[i].Normal; 296 return Vertices_Standard[i].Normal;
297 } 297 }
298 } 298 }
299 299
300 //! returns texture coords of vertex i 300 //! returns texture coords of vertex i
301 virtual const core::vector2df& getTCoords(u32 i) const 301 virtual const core::vector2df& getTCoords(u32 i) const
302 { 302 {
303 switch (VertexType) 303 switch (VertexType)
304 { 304 {
305 case video::EVT_2TCOORDS: 305 case video::EVT_2TCOORDS:
306 return Vertices_2TCoords[i].TCoords; 306 return Vertices_2TCoords[i].TCoords;
307 case video::EVT_TANGENTS: 307 case video::EVT_TANGENTS:
308 return Vertices_Tangents[i].TCoords; 308 return Vertices_Tangents[i].TCoords;
309 default: 309 default:
310 return Vertices_Standard[i].TCoords; 310 return Vertices_Standard[i].TCoords;
311 } 311 }
312 } 312 }
313 313
314 //! returns texture coords of vertex i 314 //! returns texture coords of vertex i
315 virtual core::vector2df& getTCoords(u32 i) 315 virtual core::vector2df& getTCoords(u32 i)
316 { 316 {
317 switch (VertexType) 317 switch (VertexType)
318 { 318 {
319 case video::EVT_2TCOORDS: 319 case video::EVT_2TCOORDS:
320 return Vertices_2TCoords[i].TCoords; 320 return Vertices_2TCoords[i].TCoords;
321 case video::EVT_TANGENTS: 321 case video::EVT_TANGENTS:
322 return Vertices_Tangents[i].TCoords; 322 return Vertices_Tangents[i].TCoords;
323 default: 323 default:
324 return Vertices_Standard[i].TCoords; 324 return Vertices_Standard[i].TCoords;
325 } 325 }
326 } 326 }
327 327
328 //! append the vertices and indices to the current buffer 328 //! append the vertices and indices to the current buffer
329 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) {} 329 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) {}
330 330
331 //! append the meshbuffer to the current buffer 331 //! append the meshbuffer to the current buffer
332 virtual void append(const IMeshBuffer* const other) {} 332 virtual void append(const IMeshBuffer* const other) {}
333 333
334 //! get the current hardware mapping hint for vertex buffers 334 //! get the current hardware mapping hint for vertex buffers
335 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const 335 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const
336 { 336 {
337 return MappingHint_Vertex; 337 return MappingHint_Vertex;
338 } 338 }
339 339
340 //! get the current hardware mapping hint for index buffers 340 //! get the current hardware mapping hint for index buffers
341 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const 341 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const
342 { 342 {
343 return MappingHint_Index; 343 return MappingHint_Index;
344 } 344 }
345 345
346 //! set the hardware mapping hint, for driver 346 //! set the hardware mapping hint, for driver
347 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) 347 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX )
348 { 348 {
349 if (Buffer==EBT_VERTEX) 349 if (Buffer==EBT_VERTEX)
350 MappingHint_Vertex=NewMappingHint; 350 MappingHint_Vertex=NewMappingHint;
351 else if (Buffer==EBT_INDEX) 351 else if (Buffer==EBT_INDEX)
352 MappingHint_Index=NewMappingHint; 352 MappingHint_Index=NewMappingHint;
353 else if (Buffer==EBT_VERTEX_AND_INDEX) 353 else if (Buffer==EBT_VERTEX_AND_INDEX)
354 { 354 {
355 MappingHint_Vertex=NewMappingHint; 355 MappingHint_Vertex=NewMappingHint;
356 MappingHint_Index=NewMappingHint; 356 MappingHint_Index=NewMappingHint;
357 } 357 }
358 } 358 }
359 359
360 //! flags the mesh as changed, reloads hardware buffers 360 //! flags the mesh as changed, reloads hardware buffers
361 virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) 361 virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
362 { 362 {
363 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX) 363 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
364 ++ChangedID_Vertex; 364 ++ChangedID_Vertex;
365 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX) 365 if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
366 ++ChangedID_Index; 366 ++ChangedID_Index;
367 } 367 }
368 368
369 virtual u32 getChangedID_Vertex() const {return ChangedID_Vertex;} 369 virtual u32 getChangedID_Vertex() const {return ChangedID_Vertex;}
370 370
371 virtual u32 getChangedID_Index() const {return ChangedID_Index;} 371 virtual u32 getChangedID_Index() const {return ChangedID_Index;}
372 372
373 //! Call this after changing the positions of any vertex. 373 //! Call this after changing the positions of any vertex.
374 void boundingBoxNeedsRecalculated(void) { BoundingBoxNeedsRecalculated = true; } 374 void boundingBoxNeedsRecalculated(void) { BoundingBoxNeedsRecalculated = true; }
375 375
376 core::array<video::S3DVertexTangents> Vertices_Tangents; 376 core::array<video::S3DVertexTangents> Vertices_Tangents;
377 core::array<video::S3DVertex2TCoords> Vertices_2TCoords; 377 core::array<video::S3DVertex2TCoords> Vertices_2TCoords;
378 core::array<video::S3DVertex> Vertices_Standard; 378 core::array<video::S3DVertex> Vertices_Standard;
379 core::array<u16> Indices; 379 core::array<u16> Indices;
380 380
381 u32 ChangedID_Vertex; 381 u32 ChangedID_Vertex;
382 u32 ChangedID_Index; 382 u32 ChangedID_Index;
383 383
384 //ISkinnedMesh::SJoint *AttachedJoint; 384 //ISkinnedMesh::SJoint *AttachedJoint;
385 core::matrix4 Transformation; 385 core::matrix4 Transformation;
386 386
387 video::SMaterial Material; 387 video::SMaterial Material;
388 video::E_VERTEX_TYPE VertexType; 388 video::E_VERTEX_TYPE VertexType;
389 389
390 core::aabbox3d<f32> BoundingBox; 390 core::aabbox3d<f32> BoundingBox;
391 391
392 // hardware mapping hint 392 // hardware mapping hint
393 E_HARDWARE_MAPPING MappingHint_Vertex:3; 393 E_HARDWARE_MAPPING MappingHint_Vertex:3;
394 E_HARDWARE_MAPPING MappingHint_Index:3; 394 E_HARDWARE_MAPPING MappingHint_Index:3;
395 395
396 bool BoundingBoxNeedsRecalculated:1; 396 bool BoundingBoxNeedsRecalculated:1;
397}; 397};
398 398
399 399
400} // end namespace scene 400} // end namespace scene
401} // end namespace irr 401} // end namespace irr
402 402
403#endif 403#endif
404 404
diff --git a/libraries/irrlicht-1.8/include/SVertexIndex.h b/libraries/irrlicht-1.8/include/SVertexIndex.h
index d6837dc..bc775ec 100644
--- a/libraries/irrlicht-1.8/include/SVertexIndex.h
+++ b/libraries/irrlicht-1.8/include/SVertexIndex.h
@@ -1,79 +1,79 @@
1// Copyright (C) 2008-2012 Nikolaus Gebhardt 1// Copyright (C) 2008-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#ifndef __S_VERTEX_INDEX_H_INCLUDED__ 5#ifndef __S_VERTEX_INDEX_H_INCLUDED__
6#define __S_VERTEX_INDEX_H_INCLUDED__ 6#define __S_VERTEX_INDEX_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9 9
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace video 13namespace video
14{ 14{
15enum E_INDEX_TYPE 15enum E_INDEX_TYPE
16{ 16{
17 EIT_16BIT = 0, 17 EIT_16BIT = 0,
18 EIT_32BIT 18 EIT_32BIT
19}; 19};
20 20
21 21
22/* 22/*
23//! vertex index used by the Irrlicht engine. 23//! vertex index used by the Irrlicht engine.
24template <class T> 24template <class T>
25struct SSpecificVertexIndex 25struct SSpecificVertexIndex
26{ 26{
27 T Index; 27 T Index;
28 28
29 //! default constructor 29 //! default constructor
30 SSpecificVertexIndex() {} 30 SSpecificVertexIndex() {}
31 31
32 //! constructor 32 //! constructor
33 SSpecificVertexIndex(u32 _index) :Index(_index) {} 33 SSpecificVertexIndex(u32 _index) :Index(_index) {}
34 34
35 bool operator==(const SSpecificVertexIndex& other) const 35 bool operator==(const SSpecificVertexIndex& other) const
36 { 36 {
37 return (Index == other.Index); 37 return (Index == other.Index);
38 } 38 }
39 39
40 bool operator!=(const SSpecificVertexIndex& other) const 40 bool operator!=(const SSpecificVertexIndex& other) const
41 { 41 {
42 return (Index != other.Index); 42 return (Index != other.Index);
43 } 43 }
44 44
45 bool operator<(const SSpecificVertexIndex& other) const 45 bool operator<(const SSpecificVertexIndex& other) const
46 { 46 {
47 return (Index < other.Index); 47 return (Index < other.Index);
48 } 48 }
49 49
50 SSpecificVertexIndex operator+(const u32& other) const 50 SSpecificVertexIndex operator+(const u32& other) const
51 { 51 {
52 return SSpecificVertexIndex(Index + other); 52 return SSpecificVertexIndex(Index + other);
53 } 53 }
54 54
55 operator const u32() const 55 operator const u32() const
56 { 56 {
57 return (const u32)Index; 57 return (const u32)Index;
58 } 58 }
59 59
60 E_INDEX_TYPE getType() const 60 E_INDEX_TYPE getType() const
61 { 61 {
62 if (sizeof(T)==sizeof(u16)) 62 if (sizeof(T)==sizeof(u16))
63 return video::EIT_16BIT; 63 return video::EIT_16BIT;
64 return video::EIT_32BIT; 64 return video::EIT_32BIT;
65 } 65 }
66 66
67}; 67};
68 68
69//typedef SSpecificVertexIndex<u16> SVertexIndex; 69//typedef SSpecificVertexIndex<u16> SVertexIndex;
70 70
71typedef u32 SVertexIndex; 71typedef u32 SVertexIndex;
72*/ 72*/
73 73
74 74
75} // end namespace video 75} // end namespace video
76} // end namespace irr 76} // end namespace irr
77 77
78#endif 78#endif
79 79
diff --git a/libraries/irrlicht-1.8/include/SVertexManipulator.h b/libraries/irrlicht-1.8/include/SVertexManipulator.h
index 6696ad0..592544b 100644
--- a/libraries/irrlicht-1.8/include/SVertexManipulator.h
+++ b/libraries/irrlicht-1.8/include/SVertexManipulator.h
@@ -1,292 +1,292 @@
1// Copyright (C) 2009-2012 Christian Stehno 1// Copyright (C) 2009-2012 Christian Stehno
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#ifndef __S_VERTEX_MANIPULATOR_H_INCLUDED__ 5#ifndef __S_VERTEX_MANIPULATOR_H_INCLUDED__
6#define __S_VERTEX_MANIPULATOR_H_INCLUDED__ 6#define __S_VERTEX_MANIPULATOR_H_INCLUDED__
7 7
8#include "S3DVertex.h" 8#include "S3DVertex.h"
9#include "SColor.h" 9#include "SColor.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace scene 13namespace scene
14{ 14{
15 15
16 class IMesh; 16 class IMesh;
17 class IMeshBuffer; 17 class IMeshBuffer;
18 struct SMesh; 18 struct SMesh;
19 19
20 //! Interface for vertex manipulators. 20 //! Interface for vertex manipulators.
21 /** You should derive your manipulator from this class if it shall be called for every vertex, getting as parameter just the vertex. 21 /** You should derive your manipulator from this class if it shall be called for every vertex, getting as parameter just the vertex.
22 */ 22 */
23 struct IVertexManipulator 23 struct IVertexManipulator
24 { 24 {
25 }; 25 };
26 //! Vertex manipulator to set color to a fixed color for all vertices 26 //! Vertex manipulator to set color to a fixed color for all vertices
27 class SVertexColorSetManipulator : public IVertexManipulator 27 class SVertexColorSetManipulator : public IVertexManipulator
28 { 28 {
29 public: 29 public:
30 SVertexColorSetManipulator(video::SColor color) : Color(color) {} 30 SVertexColorSetManipulator(video::SColor color) : Color(color) {}
31 void operator()(video::S3DVertex& vertex) const 31 void operator()(video::S3DVertex& vertex) const
32 { 32 {
33 vertex.Color=Color; 33 vertex.Color=Color;
34 } 34 }
35 private: 35 private:
36 video::SColor Color; 36 video::SColor Color;
37 }; 37 };
38 //! Vertex manipulator to set the alpha value of the vertex color to a fixed value 38 //! Vertex manipulator to set the alpha value of the vertex color to a fixed value
39 class SVertexColorSetAlphaManipulator : public IVertexManipulator 39 class SVertexColorSetAlphaManipulator : public IVertexManipulator
40 { 40 {
41 public: 41 public:
42 SVertexColorSetAlphaManipulator(u32 alpha) : Alpha(alpha) {} 42 SVertexColorSetAlphaManipulator(u32 alpha) : Alpha(alpha) {}
43 void operator()(video::S3DVertex& vertex) const 43 void operator()(video::S3DVertex& vertex) const
44 { 44 {
45 vertex.Color.setAlpha(Alpha); 45 vertex.Color.setAlpha(Alpha);
46 } 46 }
47 private: 47 private:
48 u32 Alpha; 48 u32 Alpha;
49 }; 49 };
50 //! Vertex manipulator which invertes the RGB values 50 //! Vertex manipulator which invertes the RGB values
51 class SVertexColorInvertManipulator : public IVertexManipulator 51 class SVertexColorInvertManipulator : public IVertexManipulator
52 { 52 {
53 public: 53 public:
54 void operator()(video::S3DVertex& vertex) const 54 void operator()(video::S3DVertex& vertex) const
55 { 55 {
56 vertex.Color.setRed(255-vertex.Color.getRed()); 56 vertex.Color.setRed(255-vertex.Color.getRed());
57 vertex.Color.setGreen(255-vertex.Color.getGreen()); 57 vertex.Color.setGreen(255-vertex.Color.getGreen());
58 vertex.Color.setBlue(255-vertex.Color.getBlue()); 58 vertex.Color.setBlue(255-vertex.Color.getBlue());
59 } 59 }
60 }; 60 };
61 //! Vertex manipulator to set vertex color to one of two values depending on a given threshold 61 //! Vertex manipulator to set vertex color to one of two values depending on a given threshold
62 /** If average of the color value is >Threshold the High color is chosen, else Low. */ 62 /** If average of the color value is >Threshold the High color is chosen, else Low. */
63 class SVertexColorThresholdManipulator : public IVertexManipulator 63 class SVertexColorThresholdManipulator : public IVertexManipulator
64 { 64 {
65 public: 65 public:
66 SVertexColorThresholdManipulator(u8 threshold, video::SColor low, 66 SVertexColorThresholdManipulator(u8 threshold, video::SColor low,
67 video::SColor high) : Threshold(threshold), Low(low), High(high) {} 67 video::SColor high) : Threshold(threshold), Low(low), High(high) {}
68 void operator()(video::S3DVertex& vertex) const 68 void operator()(video::S3DVertex& vertex) const
69 { 69 {
70 vertex.Color = ((u8)vertex.Color.getAverage()>Threshold)?High:Low; 70 vertex.Color = ((u8)vertex.Color.getAverage()>Threshold)?High:Low;
71 } 71 }
72 private: 72 private:
73 u8 Threshold; 73 u8 Threshold;
74 video::SColor Low; 74 video::SColor Low;
75 video::SColor High; 75 video::SColor High;
76 }; 76 };
77 //! Vertex manipulator which adjusts the brightness by the given amount 77 //! Vertex manipulator which adjusts the brightness by the given amount
78 /** A positive value increases brightness, a negative value darkens the colors. */ 78 /** A positive value increases brightness, a negative value darkens the colors. */
79 class SVertexColorBrightnessManipulator : public IVertexManipulator 79 class SVertexColorBrightnessManipulator : public IVertexManipulator
80 { 80 {
81 public: 81 public:
82 SVertexColorBrightnessManipulator(s32 amount) : Amount(amount) {} 82 SVertexColorBrightnessManipulator(s32 amount) : Amount(amount) {}
83 void operator()(video::S3DVertex& vertex) const 83 void operator()(video::S3DVertex& vertex) const
84 { 84 {
85 vertex.Color.setRed(core::clamp(vertex.Color.getRed()+Amount, 0u, 255u)); 85 vertex.Color.setRed(core::clamp(vertex.Color.getRed()+Amount, 0u, 255u));
86 vertex.Color.setGreen(core::clamp(vertex.Color.getGreen()+Amount, 0u, 255u)); 86 vertex.Color.setGreen(core::clamp(vertex.Color.getGreen()+Amount, 0u, 255u));
87 vertex.Color.setBlue(core::clamp(vertex.Color.getBlue()+Amount, 0u, 255u)); 87 vertex.Color.setBlue(core::clamp(vertex.Color.getBlue()+Amount, 0u, 255u));
88 } 88 }
89 private: 89 private:
90 s32 Amount; 90 s32 Amount;
91 }; 91 };
92 //! Vertex manipulator which adjusts the contrast by the given factor 92 //! Vertex manipulator which adjusts the contrast by the given factor
93 /** Factors over 1 increase contrast, below 1 reduce it. */ 93 /** Factors over 1 increase contrast, below 1 reduce it. */
94 class SVertexColorContrastManipulator : public IVertexManipulator 94 class SVertexColorContrastManipulator : public IVertexManipulator
95 { 95 {
96 public: 96 public:
97 SVertexColorContrastManipulator(f32 factor) : Factor(factor) {} 97 SVertexColorContrastManipulator(f32 factor) : Factor(factor) {}
98 void operator()(video::S3DVertex& vertex) const 98 void operator()(video::S3DVertex& vertex) const
99 { 99 {
100 vertex.Color.setRed(core::clamp(core::round32((vertex.Color.getRed()-128)*Factor)+128, 0, 255)); 100 vertex.Color.setRed(core::clamp(core::round32((vertex.Color.getRed()-128)*Factor)+128, 0, 255));
101 vertex.Color.setGreen(core::clamp(core::round32((vertex.Color.getGreen()-128)*Factor)+128, 0, 255)); 101 vertex.Color.setGreen(core::clamp(core::round32((vertex.Color.getGreen()-128)*Factor)+128, 0, 255));
102 vertex.Color.setBlue(core::clamp(core::round32((vertex.Color.getBlue()-128)*Factor)+128, 0, 255)); 102 vertex.Color.setBlue(core::clamp(core::round32((vertex.Color.getBlue()-128)*Factor)+128, 0, 255));
103 } 103 }
104 private: 104 private:
105 f32 Factor; 105 f32 Factor;
106 }; 106 };
107 //! Vertex manipulator which adjusts the contrast by the given factor and brightness by a signed amount. 107 //! Vertex manipulator which adjusts the contrast by the given factor and brightness by a signed amount.
108 /** Factors over 1 increase contrast, below 1 reduce it. 108 /** Factors over 1 increase contrast, below 1 reduce it.
109 A positive amount increases brightness, a negative one darkens the colors. */ 109 A positive amount increases brightness, a negative one darkens the colors. */
110 class SVertexColorContrastBrightnessManipulator : public IVertexManipulator 110 class SVertexColorContrastBrightnessManipulator : public IVertexManipulator
111 { 111 {
112 public: 112 public:
113 SVertexColorContrastBrightnessManipulator(f32 factor, s32 amount) : Factor(factor), Amount(amount+128) {} 113 SVertexColorContrastBrightnessManipulator(f32 factor, s32 amount) : Factor(factor), Amount(amount+128) {}
114 void operator()(video::S3DVertex& vertex) const 114 void operator()(video::S3DVertex& vertex) const
115 { 115 {
116 vertex.Color.setRed(core::clamp(core::round32((vertex.Color.getRed()-128)*Factor)+Amount, 0, 255)); 116 vertex.Color.setRed(core::clamp(core::round32((vertex.Color.getRed()-128)*Factor)+Amount, 0, 255));
117 vertex.Color.setGreen(core::clamp(core::round32((vertex.Color.getGreen()-128)*Factor)+Amount, 0, 255)); 117 vertex.Color.setGreen(core::clamp(core::round32((vertex.Color.getGreen()-128)*Factor)+Amount, 0, 255));
118 vertex.Color.setBlue(core::clamp(core::round32((vertex.Color.getBlue()-128)*Factor)+Amount, 0, 255)); 118 vertex.Color.setBlue(core::clamp(core::round32((vertex.Color.getBlue()-128)*Factor)+Amount, 0, 255));
119 } 119 }
120 private: 120 private:
121 f32 Factor; 121 f32 Factor;
122 s32 Amount; 122 s32 Amount;
123 }; 123 };
124 //! Vertex manipulator which adjusts the brightness by a gamma operation 124 //! Vertex manipulator which adjusts the brightness by a gamma operation
125 /** A value over one increases brightness, one below darkens the colors. */ 125 /** A value over one increases brightness, one below darkens the colors. */
126 class SVertexColorGammaManipulator : public IVertexManipulator 126 class SVertexColorGammaManipulator : public IVertexManipulator
127 { 127 {
128 public: 128 public:
129 SVertexColorGammaManipulator(f32 gamma) : Gamma(1.f) 129 SVertexColorGammaManipulator(f32 gamma) : Gamma(1.f)
130 { 130 {
131 if (gamma != 0.f) 131 if (gamma != 0.f)
132 Gamma = 1.f/gamma; 132 Gamma = 1.f/gamma;
133 } 133 }
134 void operator()(video::S3DVertex& vertex) const 134 void operator()(video::S3DVertex& vertex) const
135 { 135 {
136 vertex.Color.setRed(core::clamp(core::round32(powf((f32)(vertex.Color.getRed()),Gamma)), 0, 255)); 136 vertex.Color.setRed(core::clamp(core::round32(powf((f32)(vertex.Color.getRed()),Gamma)), 0, 255));
137 vertex.Color.setGreen(core::clamp(core::round32(powf((f32)(vertex.Color.getGreen()),Gamma)), 0, 255)); 137 vertex.Color.setGreen(core::clamp(core::round32(powf((f32)(vertex.Color.getGreen()),Gamma)), 0, 255));
138 vertex.Color.setBlue(core::clamp(core::round32(powf((f32)(vertex.Color.getBlue()),Gamma)), 0, 255)); 138 vertex.Color.setBlue(core::clamp(core::round32(powf((f32)(vertex.Color.getBlue()),Gamma)), 0, 255));
139 } 139 }
140 private: 140 private:
141 f32 Gamma; 141 f32 Gamma;
142 }; 142 };
143 //! Vertex manipulator which scales the color values 143 //! Vertex manipulator which scales the color values
144 /** Can e.g be used for white balance, factor would be 255.f/brightest color. */ 144 /** Can e.g be used for white balance, factor would be 255.f/brightest color. */
145 class SVertexColorScaleManipulator : public IVertexManipulator 145 class SVertexColorScaleManipulator : public IVertexManipulator
146 { 146 {
147 public: 147 public:
148 SVertexColorScaleManipulator(f32 factor) : Factor(factor) {} 148 SVertexColorScaleManipulator(f32 factor) : Factor(factor) {}
149 void operator()(video::S3DVertex& vertex) const 149 void operator()(video::S3DVertex& vertex) const
150 { 150 {
151 vertex.Color.setRed(core::clamp(core::round32(vertex.Color.getRed()*Factor), 0, 255)); 151 vertex.Color.setRed(core::clamp(core::round32(vertex.Color.getRed()*Factor), 0, 255));
152 vertex.Color.setGreen(core::clamp(core::round32(vertex.Color.getGreen()*Factor), 0, 255)); 152 vertex.Color.setGreen(core::clamp(core::round32(vertex.Color.getGreen()*Factor), 0, 255));
153 vertex.Color.setBlue(core::clamp(core::round32(vertex.Color.getBlue()*Factor), 0, 255)); 153 vertex.Color.setBlue(core::clamp(core::round32(vertex.Color.getBlue()*Factor), 0, 255));
154 } 154 }
155 private: 155 private:
156 f32 Factor; 156 f32 Factor;
157 }; 157 };
158 //! Vertex manipulator which desaturates the color values 158 //! Vertex manipulator which desaturates the color values
159 /** Uses the lightness value of the color. */ 159 /** Uses the lightness value of the color. */
160 class SVertexColorDesaturateToLightnessManipulator : public IVertexManipulator 160 class SVertexColorDesaturateToLightnessManipulator : public IVertexManipulator
161 { 161 {
162 public: 162 public:
163 void operator()(video::S3DVertex& vertex) const 163 void operator()(video::S3DVertex& vertex) const
164 { 164 {
165 vertex.Color=core::round32(vertex.Color.getLightness()); 165 vertex.Color=core::round32(vertex.Color.getLightness());
166 } 166 }
167 }; 167 };
168 //! Vertex manipulator which desaturates the color values 168 //! Vertex manipulator which desaturates the color values
169 /** Uses the average value of the color. */ 169 /** Uses the average value of the color. */
170 class SVertexColorDesaturateToAverageManipulator : public IVertexManipulator 170 class SVertexColorDesaturateToAverageManipulator : public IVertexManipulator
171 { 171 {
172 public: 172 public:
173 void operator()(video::S3DVertex& vertex) const 173 void operator()(video::S3DVertex& vertex) const
174 { 174 {
175 vertex.Color=vertex.Color.getAverage(); 175 vertex.Color=vertex.Color.getAverage();
176 } 176 }
177 }; 177 };
178 //! Vertex manipulator which desaturates the color values 178 //! Vertex manipulator which desaturates the color values
179 /** Uses the luminance value of the color. */ 179 /** Uses the luminance value of the color. */
180 class SVertexColorDesaturateToLuminanceManipulator : public IVertexManipulator 180 class SVertexColorDesaturateToLuminanceManipulator : public IVertexManipulator
181 { 181 {
182 public: 182 public:
183 void operator()(video::S3DVertex& vertex) const 183 void operator()(video::S3DVertex& vertex) const
184 { 184 {
185 vertex.Color=core::round32(vertex.Color.getLuminance()); 185 vertex.Color=core::round32(vertex.Color.getLuminance());
186 } 186 }
187 }; 187 };
188 //! Vertex manipulator which interpolates the color values 188 //! Vertex manipulator which interpolates the color values
189 /** Uses linear interpolation. */ 189 /** Uses linear interpolation. */
190 class SVertexColorInterpolateLinearManipulator : public IVertexManipulator 190 class SVertexColorInterpolateLinearManipulator : public IVertexManipulator
191 { 191 {
192 public: 192 public:
193 SVertexColorInterpolateLinearManipulator(video::SColor color, f32 factor) : 193 SVertexColorInterpolateLinearManipulator(video::SColor color, f32 factor) :
194 Color(color), Factor(factor) {} 194 Color(color), Factor(factor) {}
195 void operator()(video::S3DVertex& vertex) const 195 void operator()(video::S3DVertex& vertex) const
196 { 196 {
197 vertex.Color=vertex.Color.getInterpolated(Color, Factor); 197 vertex.Color=vertex.Color.getInterpolated(Color, Factor);
198 } 198 }
199 private: 199 private:
200 video::SColor Color; 200 video::SColor Color;
201 f32 Factor; 201 f32 Factor;
202 }; 202 };
203 //! Vertex manipulator which interpolates the color values 203 //! Vertex manipulator which interpolates the color values
204 /** Uses linear interpolation. */ 204 /** Uses linear interpolation. */
205 class SVertexColorInterpolateQuadraticManipulator : public IVertexManipulator 205 class SVertexColorInterpolateQuadraticManipulator : public IVertexManipulator
206 { 206 {
207 public: 207 public:
208 SVertexColorInterpolateQuadraticManipulator(video::SColor color1, video::SColor color2, f32 factor) : 208 SVertexColorInterpolateQuadraticManipulator(video::SColor color1, video::SColor color2, f32 factor) :
209 Color1(color1), Color2(color2), Factor(factor) {} 209 Color1(color1), Color2(color2), Factor(factor) {}
210 void operator()(video::S3DVertex& vertex) const 210 void operator()(video::S3DVertex& vertex) const
211 { 211 {
212 vertex.Color=vertex.Color.getInterpolated_quadratic(Color1, Color2, Factor); 212 vertex.Color=vertex.Color.getInterpolated_quadratic(Color1, Color2, Factor);
213 } 213 }
214 private: 214 private:
215 video::SColor Color1; 215 video::SColor Color1;
216 video::SColor Color2; 216 video::SColor Color2;
217 f32 Factor; 217 f32 Factor;
218 }; 218 };
219 219
220 //! Vertex manipulator which scales the position of the vertex 220 //! Vertex manipulator which scales the position of the vertex
221 class SVertexPositionScaleManipulator : public IVertexManipulator 221 class SVertexPositionScaleManipulator : public IVertexManipulator
222 { 222 {
223 public: 223 public:
224 SVertexPositionScaleManipulator(const core::vector3df& factor) : Factor(factor) {} 224 SVertexPositionScaleManipulator(const core::vector3df& factor) : Factor(factor) {}
225 template <typename VType> 225 template <typename VType>
226 void operator()(VType& vertex) const 226 void operator()(VType& vertex) const
227 { 227 {
228 vertex.Pos *= Factor; 228 vertex.Pos *= Factor;
229 } 229 }
230 private: 230 private:
231 core::vector3df Factor; 231 core::vector3df Factor;
232 }; 232 };
233 233
234 //! Vertex manipulator which scales the position of the vertex along the normals 234 //! Vertex manipulator which scales the position of the vertex along the normals
235 /** This can look more pleasing than the usual Scale operator, but 235 /** This can look more pleasing than the usual Scale operator, but
236 depends on the mesh geometry. 236 depends on the mesh geometry.
237 */ 237 */
238 class SVertexPositionScaleAlongNormalsManipulator : public IVertexManipulator 238 class SVertexPositionScaleAlongNormalsManipulator : public IVertexManipulator
239 { 239 {
240 public: 240 public:
241 SVertexPositionScaleAlongNormalsManipulator(const core::vector3df& factor) : Factor(factor) {} 241 SVertexPositionScaleAlongNormalsManipulator(const core::vector3df& factor) : Factor(factor) {}
242 template <typename VType> 242 template <typename VType>
243 void operator()(VType& vertex) const 243 void operator()(VType& vertex) const
244 { 244 {
245 vertex.Pos += vertex.Normal*Factor; 245 vertex.Pos += vertex.Normal*Factor;
246 } 246 }
247 private: 247 private:
248 core::vector3df Factor; 248 core::vector3df Factor;
249 }; 249 };
250 250
251 //! Vertex manipulator which transforms the position of the vertex 251 //! Vertex manipulator which transforms the position of the vertex
252 class SVertexPositionTransformManipulator : public IVertexManipulator 252 class SVertexPositionTransformManipulator : public IVertexManipulator
253 { 253 {
254 public: 254 public:
255 SVertexPositionTransformManipulator(const core::matrix4& m) : Transformation(m) {} 255 SVertexPositionTransformManipulator(const core::matrix4& m) : Transformation(m) {}
256 template <typename VType> 256 template <typename VType>
257 void operator()(VType& vertex) const 257 void operator()(VType& vertex) const
258 { 258 {
259 Transformation.transformVect(vertex.Pos); 259 Transformation.transformVect(vertex.Pos);
260 } 260 }
261 private: 261 private:
262 core::matrix4 Transformation; 262 core::matrix4 Transformation;
263 }; 263 };
264 264
265 //! Vertex manipulator which scales the TCoords of the vertex 265 //! Vertex manipulator which scales the TCoords of the vertex
266 class SVertexTCoordsScaleManipulator : public IVertexManipulator 266 class SVertexTCoordsScaleManipulator : public IVertexManipulator
267 { 267 {
268 public: 268 public:
269 SVertexTCoordsScaleManipulator(const core::vector2df& factor, u32 uvSet=1) : Factor(factor), UVSet(uvSet) {} 269 SVertexTCoordsScaleManipulator(const core::vector2df& factor, u32 uvSet=1) : Factor(factor), UVSet(uvSet) {}
270 void operator()(video::S3DVertex2TCoords& vertex) const 270 void operator()(video::S3DVertex2TCoords& vertex) const
271 { 271 {
272 if (1==UVSet) 272 if (1==UVSet)
273 vertex.TCoords *= Factor; 273 vertex.TCoords *= Factor;
274 else if (2==UVSet) 274 else if (2==UVSet)
275 vertex.TCoords2 *= Factor; 275 vertex.TCoords2 *= Factor;
276 } 276 }
277 template <typename VType> 277 template <typename VType>
278 void operator()(VType& vertex) const 278 void operator()(VType& vertex) const
279 { 279 {
280 if (1==UVSet) 280 if (1==UVSet)
281 vertex.TCoords *= Factor; 281 vertex.TCoords *= Factor;
282 } 282 }
283 private: 283 private:
284 core::vector2df Factor; 284 core::vector2df Factor;
285 u32 UVSet; 285 u32 UVSet;
286 }; 286 };
287 287
288} // end namespace scene 288} // end namespace scene
289} // end namespace irr 289} // end namespace irr
290 290
291 291
292#endif 292#endif
diff --git a/libraries/irrlicht-1.8/include/SViewFrustum.h b/libraries/irrlicht-1.8/include/SViewFrustum.h
index 88d7e2e..d2b5b9a 100644
--- a/libraries/irrlicht-1.8/include/SViewFrustum.h
+++ b/libraries/irrlicht-1.8/include/SViewFrustum.h
@@ -1,370 +1,370 @@
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#ifndef __S_VIEW_FRUSTUM_H_INCLUDED__ 5#ifndef __S_VIEW_FRUSTUM_H_INCLUDED__
6#define __S_VIEW_FRUSTUM_H_INCLUDED__ 6#define __S_VIEW_FRUSTUM_H_INCLUDED__
7 7
8#include "plane3d.h" 8#include "plane3d.h"
9#include "vector3d.h" 9#include "vector3d.h"
10#include "line3d.h" 10#include "line3d.h"
11#include "aabbox3d.h" 11#include "aabbox3d.h"
12#include "matrix4.h" 12#include "matrix4.h"
13#include "IVideoDriver.h" 13#include "IVideoDriver.h"
14 14
15namespace irr 15namespace irr
16{ 16{
17namespace scene 17namespace scene
18{ 18{
19 19
20 //! Defines the view frustum. That's the space visible by the camera. 20 //! Defines the view frustum. That's the space visible by the camera.
21 /** The view frustum is enclosed by 6 planes. These six planes share 21 /** The view frustum is enclosed by 6 planes. These six planes share
22 eight points. A bounding box around these eight points is also stored in 22 eight points. A bounding box around these eight points is also stored in
23 this structure. 23 this structure.
24 */ 24 */
25 struct SViewFrustum 25 struct SViewFrustum
26 { 26 {
27 enum VFPLANES 27 enum VFPLANES
28 { 28 {
29 //! Far plane of the frustum. That is the plane farest away from the eye. 29 //! Far plane of the frustum. That is the plane farest away from the eye.
30 VF_FAR_PLANE = 0, 30 VF_FAR_PLANE = 0,
31 //! Near plane of the frustum. That is the plane nearest to the eye. 31 //! Near plane of the frustum. That is the plane nearest to the eye.
32 VF_NEAR_PLANE, 32 VF_NEAR_PLANE,
33 //! Left plane of the frustum. 33 //! Left plane of the frustum.
34 VF_LEFT_PLANE, 34 VF_LEFT_PLANE,
35 //! Right plane of the frustum. 35 //! Right plane of the frustum.
36 VF_RIGHT_PLANE, 36 VF_RIGHT_PLANE,
37 //! Bottom plane of the frustum. 37 //! Bottom plane of the frustum.
38 VF_BOTTOM_PLANE, 38 VF_BOTTOM_PLANE,
39 //! Top plane of the frustum. 39 //! Top plane of the frustum.
40 VF_TOP_PLANE, 40 VF_TOP_PLANE,
41 41
42 //! Amount of planes enclosing the view frustum. Should be 6. 42 //! Amount of planes enclosing the view frustum. Should be 6.
43 VF_PLANE_COUNT 43 VF_PLANE_COUNT
44 }; 44 };
45 45
46 46
47 //! Default Constructor 47 //! Default Constructor
48 SViewFrustum() {} 48 SViewFrustum() {}
49 49
50 //! Copy Constructor 50 //! Copy Constructor
51 SViewFrustum(const SViewFrustum& other); 51 SViewFrustum(const SViewFrustum& other);
52 52
53 //! This constructor creates a view frustum based on a projection and/or view matrix. 53 //! This constructor creates a view frustum based on a projection and/or view matrix.
54 SViewFrustum(const core::matrix4& mat); 54 SViewFrustum(const core::matrix4& mat);
55 55
56 //! This constructor creates a view frustum based on a projection and/or view matrix. 56 //! This constructor creates a view frustum based on a projection and/or view matrix.
57 inline void setFrom(const core::matrix4& mat); 57 inline void setFrom(const core::matrix4& mat);
58 58
59 //! transforms the frustum by the matrix 59 //! transforms the frustum by the matrix
60 /** \param mat: Matrix by which the view frustum is transformed.*/ 60 /** \param mat: Matrix by which the view frustum is transformed.*/
61 void transform(const core::matrix4& mat); 61 void transform(const core::matrix4& mat);
62 62
63 //! returns the point which is on the far left upper corner inside the the view frustum. 63 //! returns the point which is on the far left upper corner inside the the view frustum.
64 core::vector3df getFarLeftUp() const; 64 core::vector3df getFarLeftUp() const;
65 65
66 //! returns the point which is on the far left bottom corner inside the the view frustum. 66 //! returns the point which is on the far left bottom corner inside the the view frustum.
67 core::vector3df getFarLeftDown() const; 67 core::vector3df getFarLeftDown() const;
68 68
69 //! returns the point which is on the far right top corner inside the the view frustum. 69 //! returns the point which is on the far right top corner inside the the view frustum.
70 core::vector3df getFarRightUp() const; 70 core::vector3df getFarRightUp() const;
71 71
72 //! returns the point which is on the far right bottom corner inside the the view frustum. 72 //! returns the point which is on the far right bottom corner inside the the view frustum.
73 core::vector3df getFarRightDown() const; 73 core::vector3df getFarRightDown() const;
74 74
75 //! returns the point which is on the near left upper corner inside the the view frustum. 75 //! returns the point which is on the near left upper corner inside the the view frustum.
76 core::vector3df getNearLeftUp() const; 76 core::vector3df getNearLeftUp() const;
77 77
78 //! returns the point which is on the near left bottom corner inside the the view frustum. 78 //! returns the point which is on the near left bottom corner inside the the view frustum.
79 core::vector3df getNearLeftDown() const; 79 core::vector3df getNearLeftDown() const;
80 80
81 //! returns the point which is on the near right top corner inside the the view frustum. 81 //! returns the point which is on the near right top corner inside the the view frustum.
82 core::vector3df getNearRightUp() const; 82 core::vector3df getNearRightUp() const;
83 83
84 //! returns the point which is on the near right bottom corner inside the the view frustum. 84 //! returns the point which is on the near right bottom corner inside the the view frustum.
85 core::vector3df getNearRightDown() const; 85 core::vector3df getNearRightDown() const;
86 86
87 //! returns a bounding box enclosing the whole view frustum 87 //! returns a bounding box enclosing the whole view frustum
88 const core::aabbox3d<f32> &getBoundingBox() const; 88 const core::aabbox3d<f32> &getBoundingBox() const;
89 89
90 //! recalculates the bounding box member based on the planes 90 //! recalculates the bounding box member based on the planes
91 inline void recalculateBoundingBox(); 91 inline void recalculateBoundingBox();
92 92
93 //! get the given state's matrix based on frustum E_TRANSFORMATION_STATE 93 //! get the given state's matrix based on frustum E_TRANSFORMATION_STATE
94 core::matrix4& getTransform( video::E_TRANSFORMATION_STATE state); 94 core::matrix4& getTransform( video::E_TRANSFORMATION_STATE state);
95 95
96 //! get the given state's matrix based on frustum E_TRANSFORMATION_STATE 96 //! get the given state's matrix based on frustum E_TRANSFORMATION_STATE
97 const core::matrix4& getTransform( video::E_TRANSFORMATION_STATE state) const; 97 const core::matrix4& getTransform( video::E_TRANSFORMATION_STATE state) const;
98 98
99 //! clips a line to the view frustum. 99 //! clips a line to the view frustum.
100 /** \return True if the line was clipped, false if not */ 100 /** \return True if the line was clipped, false if not */
101 bool clipLine(core::line3d<f32>& line) const; 101 bool clipLine(core::line3d<f32>& line) const;
102 102
103 //! the position of the camera 103 //! the position of the camera
104 core::vector3df cameraPosition; 104 core::vector3df cameraPosition;
105 105
106 //! all planes enclosing the view frustum. 106 //! all planes enclosing the view frustum.
107 core::plane3d<f32> planes[VF_PLANE_COUNT]; 107 core::plane3d<f32> planes[VF_PLANE_COUNT];
108 108
109 //! bounding box around the view frustum 109 //! bounding box around the view frustum
110 core::aabbox3d<f32> boundingBox; 110 core::aabbox3d<f32> boundingBox;
111 111
112 private: 112 private:
113 //! Hold a copy of important transform matrices 113 //! Hold a copy of important transform matrices
114 enum E_TRANSFORMATION_STATE_FRUSTUM 114 enum E_TRANSFORMATION_STATE_FRUSTUM
115 { 115 {
116 ETS_VIEW = 0, 116 ETS_VIEW = 0,
117 ETS_PROJECTION = 1, 117 ETS_PROJECTION = 1,
118 ETS_COUNT_FRUSTUM 118 ETS_COUNT_FRUSTUM
119 }; 119 };
120 120
121 //! Hold a copy of important transform matrices 121 //! Hold a copy of important transform matrices
122 core::matrix4 Matrices[ETS_COUNT_FRUSTUM]; 122 core::matrix4 Matrices[ETS_COUNT_FRUSTUM];
123 }; 123 };
124 124
125 125
126 /*! 126 /*!
127 Copy constructor ViewFrustum 127 Copy constructor ViewFrustum
128 */ 128 */
129 inline SViewFrustum::SViewFrustum(const SViewFrustum& other) 129 inline SViewFrustum::SViewFrustum(const SViewFrustum& other)
130 { 130 {
131 cameraPosition=other.cameraPosition; 131 cameraPosition=other.cameraPosition;
132 boundingBox=other.boundingBox; 132 boundingBox=other.boundingBox;
133 133
134 u32 i; 134 u32 i;
135 for (i=0; i<VF_PLANE_COUNT; ++i) 135 for (i=0; i<VF_PLANE_COUNT; ++i)
136 planes[i]=other.planes[i]; 136 planes[i]=other.planes[i];
137 137
138 for (i=0; i<ETS_COUNT_FRUSTUM; ++i) 138 for (i=0; i<ETS_COUNT_FRUSTUM; ++i)
139 Matrices[i]=other.Matrices[i]; 139 Matrices[i]=other.Matrices[i];
140 } 140 }
141 141
142 inline SViewFrustum::SViewFrustum(const core::matrix4& mat) 142 inline SViewFrustum::SViewFrustum(const core::matrix4& mat)
143 { 143 {
144 setFrom ( mat ); 144 setFrom ( mat );
145 } 145 }
146 146
147 147
148 inline void SViewFrustum::transform(const core::matrix4& mat) 148 inline void SViewFrustum::transform(const core::matrix4& mat)
149 { 149 {
150 for (u32 i=0; i<VF_PLANE_COUNT; ++i) 150 for (u32 i=0; i<VF_PLANE_COUNT; ++i)
151 mat.transformPlane(planes[i]); 151 mat.transformPlane(planes[i]);
152 152
153 mat.transformVect(cameraPosition); 153 mat.transformVect(cameraPosition);
154 recalculateBoundingBox(); 154 recalculateBoundingBox();
155 } 155 }
156 156
157 157
158 inline core::vector3df SViewFrustum::getFarLeftUp() const 158 inline core::vector3df SViewFrustum::getFarLeftUp() const
159 { 159 {
160 core::vector3df p; 160 core::vector3df p;
161 planes[scene::SViewFrustum::VF_FAR_PLANE].getIntersectionWithPlanes( 161 planes[scene::SViewFrustum::VF_FAR_PLANE].getIntersectionWithPlanes(
162 planes[scene::SViewFrustum::VF_TOP_PLANE], 162 planes[scene::SViewFrustum::VF_TOP_PLANE],
163 planes[scene::SViewFrustum::VF_LEFT_PLANE], p); 163 planes[scene::SViewFrustum::VF_LEFT_PLANE], p);
164 164
165 return p; 165 return p;
166 } 166 }
167 167
168 inline core::vector3df SViewFrustum::getFarLeftDown() const 168 inline core::vector3df SViewFrustum::getFarLeftDown() const
169 { 169 {
170 core::vector3df p; 170 core::vector3df p;
171 planes[scene::SViewFrustum::VF_FAR_PLANE].getIntersectionWithPlanes( 171 planes[scene::SViewFrustum::VF_FAR_PLANE].getIntersectionWithPlanes(
172 planes[scene::SViewFrustum::VF_BOTTOM_PLANE], 172 planes[scene::SViewFrustum::VF_BOTTOM_PLANE],
173 planes[scene::SViewFrustum::VF_LEFT_PLANE], p); 173 planes[scene::SViewFrustum::VF_LEFT_PLANE], p);
174 174
175 return p; 175 return p;
176 } 176 }
177 177
178 inline core::vector3df SViewFrustum::getFarRightUp() const 178 inline core::vector3df SViewFrustum::getFarRightUp() const
179 { 179 {
180 core::vector3df p; 180 core::vector3df p;
181 planes[scene::SViewFrustum::VF_FAR_PLANE].getIntersectionWithPlanes( 181 planes[scene::SViewFrustum::VF_FAR_PLANE].getIntersectionWithPlanes(
182 planes[scene::SViewFrustum::VF_TOP_PLANE], 182 planes[scene::SViewFrustum::VF_TOP_PLANE],
183 planes[scene::SViewFrustum::VF_RIGHT_PLANE], p); 183 planes[scene::SViewFrustum::VF_RIGHT_PLANE], p);
184 184
185 return p; 185 return p;
186 } 186 }
187 187
188 inline core::vector3df SViewFrustum::getFarRightDown() const 188 inline core::vector3df SViewFrustum::getFarRightDown() const
189 { 189 {
190 core::vector3df p; 190 core::vector3df p;
191 planes[scene::SViewFrustum::VF_FAR_PLANE].getIntersectionWithPlanes( 191 planes[scene::SViewFrustum::VF_FAR_PLANE].getIntersectionWithPlanes(
192 planes[scene::SViewFrustum::VF_BOTTOM_PLANE], 192 planes[scene::SViewFrustum::VF_BOTTOM_PLANE],
193 planes[scene::SViewFrustum::VF_RIGHT_PLANE], p); 193 planes[scene::SViewFrustum::VF_RIGHT_PLANE], p);
194 194
195 return p; 195 return p;
196 } 196 }
197 197
198 inline core::vector3df SViewFrustum::getNearLeftUp() const 198 inline core::vector3df SViewFrustum::getNearLeftUp() const
199 { 199 {
200 core::vector3df p; 200 core::vector3df p;
201 planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes( 201 planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes(
202 planes[scene::SViewFrustum::VF_TOP_PLANE], 202 planes[scene::SViewFrustum::VF_TOP_PLANE],
203 planes[scene::SViewFrustum::VF_LEFT_PLANE], p); 203 planes[scene::SViewFrustum::VF_LEFT_PLANE], p);
204 204
205 return p; 205 return p;
206 } 206 }
207 207
208 inline core::vector3df SViewFrustum::getNearLeftDown() const 208 inline core::vector3df SViewFrustum::getNearLeftDown() const
209 { 209 {
210 core::vector3df p; 210 core::vector3df p;
211 planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes( 211 planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes(
212 planes[scene::SViewFrustum::VF_BOTTOM_PLANE], 212 planes[scene::SViewFrustum::VF_BOTTOM_PLANE],
213 planes[scene::SViewFrustum::VF_LEFT_PLANE], p); 213 planes[scene::SViewFrustum::VF_LEFT_PLANE], p);
214 214
215 return p; 215 return p;
216 } 216 }
217 217
218 inline core::vector3df SViewFrustum::getNearRightUp() const 218 inline core::vector3df SViewFrustum::getNearRightUp() const
219 { 219 {
220 core::vector3df p; 220 core::vector3df p;
221 planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes( 221 planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes(
222 planes[scene::SViewFrustum::VF_TOP_PLANE], 222 planes[scene::SViewFrustum::VF_TOP_PLANE],
223 planes[scene::SViewFrustum::VF_RIGHT_PLANE], p); 223 planes[scene::SViewFrustum::VF_RIGHT_PLANE], p);
224 224
225 return p; 225 return p;
226 } 226 }
227 227
228 inline core::vector3df SViewFrustum::getNearRightDown() const 228 inline core::vector3df SViewFrustum::getNearRightDown() const
229 { 229 {
230 core::vector3df p; 230 core::vector3df p;
231 planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes( 231 planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes(
232 planes[scene::SViewFrustum::VF_BOTTOM_PLANE], 232 planes[scene::SViewFrustum::VF_BOTTOM_PLANE],
233 planes[scene::SViewFrustum::VF_RIGHT_PLANE], p); 233 planes[scene::SViewFrustum::VF_RIGHT_PLANE], p);
234 234
235 return p; 235 return p;
236 } 236 }
237 237
238 inline const core::aabbox3d<f32> &SViewFrustum::getBoundingBox() const 238 inline const core::aabbox3d<f32> &SViewFrustum::getBoundingBox() const
239 { 239 {
240 return boundingBox; 240 return boundingBox;
241 } 241 }
242 242
243 inline void SViewFrustum::recalculateBoundingBox() 243 inline void SViewFrustum::recalculateBoundingBox()
244 { 244 {
245 boundingBox.reset ( cameraPosition ); 245 boundingBox.reset ( cameraPosition );
246 246
247 boundingBox.addInternalPoint(getFarLeftUp()); 247 boundingBox.addInternalPoint(getFarLeftUp());
248 boundingBox.addInternalPoint(getFarRightUp()); 248 boundingBox.addInternalPoint(getFarRightUp());
249 boundingBox.addInternalPoint(getFarLeftDown()); 249 boundingBox.addInternalPoint(getFarLeftDown());
250 boundingBox.addInternalPoint(getFarRightDown()); 250 boundingBox.addInternalPoint(getFarRightDown());
251 } 251 }
252 252
253 //! This constructor creates a view frustum based on a projection 253 //! This constructor creates a view frustum based on a projection
254 //! and/or view matrix. 254 //! and/or view matrix.
255 inline void SViewFrustum::setFrom(const core::matrix4& mat) 255 inline void SViewFrustum::setFrom(const core::matrix4& mat)
256 { 256 {
257 // left clipping plane 257 // left clipping plane
258 planes[VF_LEFT_PLANE].Normal.X = mat[3 ] + mat[0]; 258 planes[VF_LEFT_PLANE].Normal.X = mat[3 ] + mat[0];
259 planes[VF_LEFT_PLANE].Normal.Y = mat[7 ] + mat[4]; 259 planes[VF_LEFT_PLANE].Normal.Y = mat[7 ] + mat[4];
260 planes[VF_LEFT_PLANE].Normal.Z = mat[11] + mat[8]; 260 planes[VF_LEFT_PLANE].Normal.Z = mat[11] + mat[8];
261 planes[VF_LEFT_PLANE].D = mat[15] + mat[12]; 261 planes[VF_LEFT_PLANE].D = mat[15] + mat[12];
262 262
263 // right clipping plane 263 // right clipping plane
264 planes[VF_RIGHT_PLANE].Normal.X = mat[3 ] - mat[0]; 264 planes[VF_RIGHT_PLANE].Normal.X = mat[3 ] - mat[0];
265 planes[VF_RIGHT_PLANE].Normal.Y = mat[7 ] - mat[4]; 265 planes[VF_RIGHT_PLANE].Normal.Y = mat[7 ] - mat[4];
266 planes[VF_RIGHT_PLANE].Normal.Z = mat[11] - mat[8]; 266 planes[VF_RIGHT_PLANE].Normal.Z = mat[11] - mat[8];
267 planes[VF_RIGHT_PLANE].D = mat[15] - mat[12]; 267 planes[VF_RIGHT_PLANE].D = mat[15] - mat[12];
268 268
269 // top clipping plane 269 // top clipping plane
270 planes[VF_TOP_PLANE].Normal.X = mat[3 ] - mat[1]; 270 planes[VF_TOP_PLANE].Normal.X = mat[3 ] - mat[1];
271 planes[VF_TOP_PLANE].Normal.Y = mat[7 ] - mat[5]; 271 planes[VF_TOP_PLANE].Normal.Y = mat[7 ] - mat[5];
272 planes[VF_TOP_PLANE].Normal.Z = mat[11] - mat[9]; 272 planes[VF_TOP_PLANE].Normal.Z = mat[11] - mat[9];
273 planes[VF_TOP_PLANE].D = mat[15] - mat[13]; 273 planes[VF_TOP_PLANE].D = mat[15] - mat[13];
274 274
275 // bottom clipping plane 275 // bottom clipping plane
276 planes[VF_BOTTOM_PLANE].Normal.X = mat[3 ] + mat[1]; 276 planes[VF_BOTTOM_PLANE].Normal.X = mat[3 ] + mat[1];
277 planes[VF_BOTTOM_PLANE].Normal.Y = mat[7 ] + mat[5]; 277 planes[VF_BOTTOM_PLANE].Normal.Y = mat[7 ] + mat[5];
278 planes[VF_BOTTOM_PLANE].Normal.Z = mat[11] + mat[9]; 278 planes[VF_BOTTOM_PLANE].Normal.Z = mat[11] + mat[9];
279 planes[VF_BOTTOM_PLANE].D = mat[15] + mat[13]; 279 planes[VF_BOTTOM_PLANE].D = mat[15] + mat[13];
280 280
281 // far clipping plane 281 // far clipping plane
282 planes[VF_FAR_PLANE].Normal.X = mat[3 ] - mat[2]; 282 planes[VF_FAR_PLANE].Normal.X = mat[3 ] - mat[2];
283 planes[VF_FAR_PLANE].Normal.Y = mat[7 ] - mat[6]; 283 planes[VF_FAR_PLANE].Normal.Y = mat[7 ] - mat[6];
284 planes[VF_FAR_PLANE].Normal.Z = mat[11] - mat[10]; 284 planes[VF_FAR_PLANE].Normal.Z = mat[11] - mat[10];
285 planes[VF_FAR_PLANE].D = mat[15] - mat[14]; 285 planes[VF_FAR_PLANE].D = mat[15] - mat[14];
286 286
287 // near clipping plane 287 // near clipping plane
288 planes[VF_NEAR_PLANE].Normal.X = mat[2]; 288 planes[VF_NEAR_PLANE].Normal.X = mat[2];
289 planes[VF_NEAR_PLANE].Normal.Y = mat[6]; 289 planes[VF_NEAR_PLANE].Normal.Y = mat[6];
290 planes[VF_NEAR_PLANE].Normal.Z = mat[10]; 290 planes[VF_NEAR_PLANE].Normal.Z = mat[10];
291 planes[VF_NEAR_PLANE].D = mat[14]; 291 planes[VF_NEAR_PLANE].D = mat[14];
292 292
293 // normalize normals 293 // normalize normals
294 u32 i; 294 u32 i;
295 for ( i=0; i != VF_PLANE_COUNT; ++i) 295 for ( i=0; i != VF_PLANE_COUNT; ++i)
296 { 296 {
297 const f32 len = -core::reciprocal_squareroot( 297 const f32 len = -core::reciprocal_squareroot(
298 planes[i].Normal.getLengthSQ()); 298 planes[i].Normal.getLengthSQ());
299 planes[i].Normal *= len; 299 planes[i].Normal *= len;
300 planes[i].D *= len; 300 planes[i].D *= len;
301 } 301 }
302 302
303 // make bounding box 303 // make bounding box
304 recalculateBoundingBox(); 304 recalculateBoundingBox();
305 } 305 }
306 306
307 /*! 307 /*!
308 View Frustum depends on Projection & View Matrix 308 View Frustum depends on Projection & View Matrix
309 */ 309 */
310 inline core::matrix4& SViewFrustum::getTransform(video::E_TRANSFORMATION_STATE state ) 310 inline core::matrix4& SViewFrustum::getTransform(video::E_TRANSFORMATION_STATE state )
311 { 311 {
312 u32 index = 0; 312 u32 index = 0;
313 switch ( state ) 313 switch ( state )
314 { 314 {
315 case video::ETS_PROJECTION: 315 case video::ETS_PROJECTION:
316 index = SViewFrustum::ETS_PROJECTION; break; 316 index = SViewFrustum::ETS_PROJECTION; break;
317 case video::ETS_VIEW: 317 case video::ETS_VIEW:
318 index = SViewFrustum::ETS_VIEW; break; 318 index = SViewFrustum::ETS_VIEW; break;
319 default: 319 default:
320 break; 320 break;
321 } 321 }
322 return Matrices [ index ]; 322 return Matrices [ index ];
323 } 323 }
324 324
325 /*! 325 /*!
326 View Frustum depends on Projection & View Matrix 326 View Frustum depends on Projection & View Matrix
327 */ 327 */
328 inline const core::matrix4& SViewFrustum::getTransform(video::E_TRANSFORMATION_STATE state ) const 328 inline const core::matrix4& SViewFrustum::getTransform(video::E_TRANSFORMATION_STATE state ) const
329 { 329 {
330 u32 index = 0; 330 u32 index = 0;
331 switch ( state ) 331 switch ( state )
332 { 332 {
333 case video::ETS_PROJECTION: 333 case video::ETS_PROJECTION:
334 index = SViewFrustum::ETS_PROJECTION; break; 334 index = SViewFrustum::ETS_PROJECTION; break;
335 case video::ETS_VIEW: 335 case video::ETS_VIEW:
336 index = SViewFrustum::ETS_VIEW; break; 336 index = SViewFrustum::ETS_VIEW; break;
337 default: 337 default:
338 break; 338 break;
339 } 339 }
340 return Matrices [ index ]; 340 return Matrices [ index ];
341 } 341 }
342 342
343 //! Clips a line to the frustum 343 //! Clips a line to the frustum
344 inline bool SViewFrustum::clipLine(core::line3d<f32>& line) const 344 inline bool SViewFrustum::clipLine(core::line3d<f32>& line) const
345 { 345 {
346 bool wasClipped = false; 346 bool wasClipped = false;
347 for (u32 i=0; i < VF_PLANE_COUNT; ++i) 347 for (u32 i=0; i < VF_PLANE_COUNT; ++i)
348 { 348 {
349 if (planes[i].classifyPointRelation(line.start) == core::ISREL3D_FRONT) 349 if (planes[i].classifyPointRelation(line.start) == core::ISREL3D_FRONT)
350 { 350 {
351 line.start = line.start.getInterpolated(line.end, 351 line.start = line.start.getInterpolated(line.end,
352 planes[i].getKnownIntersectionWithLine(line.start, line.end)); 352 planes[i].getKnownIntersectionWithLine(line.start, line.end));
353 wasClipped = true; 353 wasClipped = true;
354 } 354 }
355 if (planes[i].classifyPointRelation(line.end) == core::ISREL3D_FRONT) 355 if (planes[i].classifyPointRelation(line.end) == core::ISREL3D_FRONT)
356 { 356 {
357 line.end = line.start.getInterpolated(line.end, 357 line.end = line.start.getInterpolated(line.end,
358 planes[i].getKnownIntersectionWithLine(line.start, line.end)); 358 planes[i].getKnownIntersectionWithLine(line.start, line.end));
359 wasClipped = true; 359 wasClipped = true;
360 } 360 }
361 } 361 }
362 return wasClipped; 362 return wasClipped;
363 } 363 }
364 364
365 365
366} // end namespace scene 366} // end namespace scene
367} // end namespace irr 367} // end namespace irr
368 368
369#endif 369#endif
370 370
diff --git a/libraries/irrlicht-1.8/include/SceneParameters.h b/libraries/irrlicht-1.8/include/SceneParameters.h
index 699e2ac..827ae42 100644
--- a/libraries/irrlicht-1.8/include/SceneParameters.h
+++ b/libraries/irrlicht-1.8/include/SceneParameters.h
@@ -1,182 +1,182 @@
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#ifndef __I_SCENE_PARAMETERS_H_INCLUDED__ 5#ifndef __I_SCENE_PARAMETERS_H_INCLUDED__
6#define __I_SCENE_PARAMETERS_H_INCLUDED__ 6#define __I_SCENE_PARAMETERS_H_INCLUDED__
7 7
8/*! \file SceneParameters.h 8/*! \file SceneParameters.h
9 \brief Header file containing all scene parameters for modifying mesh loading etc. 9 \brief Header file containing all scene parameters for modifying mesh loading etc.
10 10
11 This file includes all parameter names which can be set using ISceneManager::getParameters() 11 This file includes all parameter names which can be set using ISceneManager::getParameters()
12 to modify the behavior of plugins and mesh loaders. 12 to modify the behavior of plugins and mesh loaders.
13*/ 13*/
14 14
15namespace irr 15namespace irr
16{ 16{
17namespace scene 17namespace scene
18{ 18{
19 //! Name of the parameter for changing how Irrlicht handles the ZWrite flag for transparent (blending) materials 19 //! Name of the parameter for changing how Irrlicht handles the ZWrite flag for transparent (blending) materials
20 /** The default behavior in Irrlicht is to disable writing to the 20 /** The default behavior in Irrlicht is to disable writing to the
21 z-buffer for all really transparent, i.e. blending materials. This 21 z-buffer for all really transparent, i.e. blending materials. This
22 avoids problems with intersecting faces, but can also break renderings. 22 avoids problems with intersecting faces, but can also break renderings.
23 If transparent materials should use the SMaterial flag for ZWriteEnable 23 If transparent materials should use the SMaterial flag for ZWriteEnable
24 just as other material types use this attribute. 24 just as other material types use this attribute.
25 Use it like this: 25 Use it like this:
26 \code 26 \code
27 SceneManager->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true); 27 SceneManager->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true);
28 \endcode 28 \endcode
29 **/ 29 **/
30 const c8* const ALLOW_ZWRITE_ON_TRANSPARENT = "Allow_ZWrite_On_Transparent"; 30 const c8* const ALLOW_ZWRITE_ON_TRANSPARENT = "Allow_ZWrite_On_Transparent";
31 31
32 //! Name of the parameter for changing the texture path of the built-in csm loader. 32 //! Name of the parameter for changing the texture path of the built-in csm loader.
33 /** Use it like this: 33 /** Use it like this:
34 \code 34 \code
35 SceneManager->getParameters()->setAttribute(scene::CSM_TEXTURE_PATH, "path/to/your/textures"); 35 SceneManager->getParameters()->setAttribute(scene::CSM_TEXTURE_PATH, "path/to/your/textures");
36 \endcode 36 \endcode
37 **/ 37 **/
38 const c8* const CSM_TEXTURE_PATH = "CSM_TexturePath"; 38 const c8* const CSM_TEXTURE_PATH = "CSM_TexturePath";
39 39
40 //! Name of the parameter for changing the texture path of the built-in lmts loader. 40 //! Name of the parameter for changing the texture path of the built-in lmts loader.
41 /** Use it like this: 41 /** Use it like this:
42 \code 42 \code
43 SceneManager->getParameters()->setAttribute(scene::LMTS_TEXTURE_PATH, "path/to/your/textures"); 43 SceneManager->getParameters()->setAttribute(scene::LMTS_TEXTURE_PATH, "path/to/your/textures");
44 \endcode 44 \endcode
45 **/ 45 **/
46 const c8* const LMTS_TEXTURE_PATH = "LMTS_TexturePath"; 46 const c8* const LMTS_TEXTURE_PATH = "LMTS_TexturePath";
47 47
48 //! Name of the parameter for changing the texture path of the built-in my3d loader. 48 //! Name of the parameter for changing the texture path of the built-in my3d loader.
49 /** Use it like this: 49 /** Use it like this:
50 \code 50 \code
51 SceneManager->getParameters()->setAttribute(scene::MY3D_TEXTURE_PATH, "path/to/your/textures"); 51 SceneManager->getParameters()->setAttribute(scene::MY3D_TEXTURE_PATH, "path/to/your/textures");
52 \endcode 52 \endcode
53 **/ 53 **/
54 const c8* const MY3D_TEXTURE_PATH = "MY3D_TexturePath"; 54 const c8* const MY3D_TEXTURE_PATH = "MY3D_TexturePath";
55 55
56 //! Name of the parameter specifying the COLLADA mesh loading mode 56 //! Name of the parameter specifying the COLLADA mesh loading mode
57 /** 57 /**
58 Specifies if the COLLADA loader should create instances of the models, lights and 58 Specifies if the COLLADA loader should create instances of the models, lights and
59 cameras when loading COLLADA meshes. By default, this is set to false. If this is 59 cameras when loading COLLADA meshes. By default, this is set to false. If this is
60 set to true, the ISceneManager::getMesh() method will only return a pointer to a 60 set to true, the ISceneManager::getMesh() method will only return a pointer to a
61 dummy mesh and create instances of all meshes and lights and cameras in the collada 61 dummy mesh and create instances of all meshes and lights and cameras in the collada
62 file by itself. Example: 62 file by itself. Example:
63 \code 63 \code
64 SceneManager->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true); 64 SceneManager->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true);
65 \endcode 65 \endcode
66 */ 66 */
67 const c8* const COLLADA_CREATE_SCENE_INSTANCES = "COLLADA_CreateSceneInstances"; 67 const c8* const COLLADA_CREATE_SCENE_INSTANCES = "COLLADA_CreateSceneInstances";
68 68
69 //! Name of the parameter for changing the texture path of the built-in DMF loader. 69 //! Name of the parameter for changing the texture path of the built-in DMF loader.
70 /** This path is prefixed to the file names defined in the Deled file when loading 70 /** This path is prefixed to the file names defined in the Deled file when loading
71 textures. This allows to alter the paths for a specific project setting. 71 textures. This allows to alter the paths for a specific project setting.
72 Use it like this: 72 Use it like this:
73 \code 73 \code
74 SceneManager->getStringParameters()->setAttribute(scene::DMF_TEXTURE_PATH, "path/to/your/textures"); 74 SceneManager->getStringParameters()->setAttribute(scene::DMF_TEXTURE_PATH, "path/to/your/textures");
75 \endcode 75 \endcode
76 **/ 76 **/
77 const c8* const DMF_TEXTURE_PATH = "DMF_TexturePath"; 77 const c8* const DMF_TEXTURE_PATH = "DMF_TexturePath";
78 78
79 //! Name of the parameter for preserving DMF textures dir structure with built-in DMF loader. 79 //! Name of the parameter for preserving DMF textures dir structure with built-in DMF loader.
80 /** If this parameter is set to true, the texture directory defined in the Deled file 80 /** If this parameter is set to true, the texture directory defined in the Deled file
81 is ignored, and only the texture name is used to find the proper file. Otherwise, the 81 is ignored, and only the texture name is used to find the proper file. Otherwise, the
82 texture path is also used, which allows to use a nicer media layout. 82 texture path is also used, which allows to use a nicer media layout.
83 Use it like this: 83 Use it like this:
84 \code 84 \code
85 //this way you won't use this setting (default) 85 //this way you won't use this setting (default)
86 SceneManager->getParameters()->setAttribute(scene::DMF_IGNORE_MATERIALS_DIRS, false); 86 SceneManager->getParameters()->setAttribute(scene::DMF_IGNORE_MATERIALS_DIRS, false);
87 \endcode 87 \endcode
88 \code 88 \code
89 //this way you'll use this setting 89 //this way you'll use this setting
90 SceneManager->getParameters()->setAttribute(scene::DMF_IGNORE_MATERIALS_DIRS, true); 90 SceneManager->getParameters()->setAttribute(scene::DMF_IGNORE_MATERIALS_DIRS, true);
91 \endcode 91 \endcode
92 **/ 92 **/
93 const c8* const DMF_IGNORE_MATERIALS_DIRS = "DMF_IgnoreMaterialsDir"; 93 const c8* const DMF_IGNORE_MATERIALS_DIRS = "DMF_IgnoreMaterialsDir";
94 94
95 //! Name of the parameter for setting reference value of alpha in transparent materials. 95 //! Name of the parameter for setting reference value of alpha in transparent materials.
96 /** Use it like this: 96 /** Use it like this:
97 \code 97 \code
98 //this way you'll set alpha ref to 0.1 98 //this way you'll set alpha ref to 0.1
99 SceneManager->getParameters()->setAttribute(scene::DMF_ALPHA_CHANNEL_REF, 0.1); 99 SceneManager->getParameters()->setAttribute(scene::DMF_ALPHA_CHANNEL_REF, 0.1);
100 \endcode 100 \endcode
101 **/ 101 **/
102 const c8* const DMF_ALPHA_CHANNEL_REF = "DMF_AlphaRef"; 102 const c8* const DMF_ALPHA_CHANNEL_REF = "DMF_AlphaRef";
103 103
104 //! Name of the parameter for choose to flip or not tga files. 104 //! Name of the parameter for choose to flip or not tga files.
105 /** Use it like this: 105 /** Use it like this:
106 \code 106 \code
107 //this way you'll choose to flip alpha textures 107 //this way you'll choose to flip alpha textures
108 SceneManager->getParameters()->setAttribute(scene::DMF_FLIP_ALPHA_TEXTURES, true); 108 SceneManager->getParameters()->setAttribute(scene::DMF_FLIP_ALPHA_TEXTURES, true);
109 \endcode 109 \endcode
110 **/ 110 **/
111 const c8* const DMF_FLIP_ALPHA_TEXTURES = "DMF_FlipAlpha"; 111 const c8* const DMF_FLIP_ALPHA_TEXTURES = "DMF_FlipAlpha";
112 112
113 113
114 //! Name of the parameter for changing the texture path of the built-in obj loader. 114 //! Name of the parameter for changing the texture path of the built-in obj loader.
115 /** Use it like this: 115 /** Use it like this:
116 \code 116 \code
117 SceneManager->getParameters()->setAttribute(scene::OBJ_TEXTURE_PATH, "path/to/your/textures"); 117 SceneManager->getParameters()->setAttribute(scene::OBJ_TEXTURE_PATH, "path/to/your/textures");
118 \endcode 118 \endcode
119 **/ 119 **/
120 const c8* const OBJ_TEXTURE_PATH = "OBJ_TexturePath"; 120 const c8* const OBJ_TEXTURE_PATH = "OBJ_TexturePath";
121 121
122 //! Flag to avoid loading group structures in .obj files 122 //! Flag to avoid loading group structures in .obj files
123 /** Use it like this: 123 /** Use it like this:
124 \code 124 \code
125 SceneManager->getParameters()->setAttribute(scene::OBJ_LOADER_IGNORE_GROUPS, true); 125 SceneManager->getParameters()->setAttribute(scene::OBJ_LOADER_IGNORE_GROUPS, true);
126 \endcode 126 \endcode
127 **/ 127 **/
128 const c8* const OBJ_LOADER_IGNORE_GROUPS = "OBJ_IgnoreGroups"; 128 const c8* const OBJ_LOADER_IGNORE_GROUPS = "OBJ_IgnoreGroups";
129 129
130 130
131 //! Flag to avoid loading material .mtl file for .obj files 131 //! Flag to avoid loading material .mtl file for .obj files
132 /** Use it like this: 132 /** Use it like this:
133 \code 133 \code
134 SceneManager->getParameters()->setAttribute(scene::OBJ_LOADER_IGNORE_MATERIAL_FILES, true); 134 SceneManager->getParameters()->setAttribute(scene::OBJ_LOADER_IGNORE_MATERIAL_FILES, true);
135 \endcode 135 \endcode
136 **/ 136 **/
137 const c8* const OBJ_LOADER_IGNORE_MATERIAL_FILES = "OBJ_IgnoreMaterialFiles"; 137 const c8* const OBJ_LOADER_IGNORE_MATERIAL_FILES = "OBJ_IgnoreMaterialFiles";
138 138
139 139
140 //! Flag to ignore the b3d file's mipmapping flag 140 //! Flag to ignore the b3d file's mipmapping flag
141 /** Instead Irrlicht's texture creation flag is used. Use it like this: 141 /** Instead Irrlicht's texture creation flag is used. Use it like this:
142 \code 142 \code
143 SceneManager->getParameters()->setAttribute(scene::B3D_LOADER_IGNORE_MIPMAP_FLAG, true); 143 SceneManager->getParameters()->setAttribute(scene::B3D_LOADER_IGNORE_MIPMAP_FLAG, true);
144 \endcode 144 \endcode
145 **/ 145 **/
146 const c8* const B3D_LOADER_IGNORE_MIPMAP_FLAG = "B3D_IgnoreMipmapFlag"; 146 const c8* const B3D_LOADER_IGNORE_MIPMAP_FLAG = "B3D_IgnoreMipmapFlag";
147 147
148 //! Name of the parameter for changing the texture path of the built-in b3d loader. 148 //! Name of the parameter for changing the texture path of the built-in b3d loader.
149 /** Use it like this: 149 /** Use it like this:
150 \code 150 \code
151 SceneManager->getParameters()->setAttribute(scene::B3D_TEXTURE_PATH, "path/to/your/textures"); 151 SceneManager->getParameters()->setAttribute(scene::B3D_TEXTURE_PATH, "path/to/your/textures");
152 \endcode 152 \endcode
153 **/ 153 **/
154 const c8* const B3D_TEXTURE_PATH = "B3D_TexturePath"; 154 const c8* const B3D_TEXTURE_PATH = "B3D_TexturePath";
155 155
156 //! Flag set as parameter when the scene manager is used as editor 156 //! Flag set as parameter when the scene manager is used as editor
157 /** In this way special animators like deletion animators can be stopped from 157 /** In this way special animators like deletion animators can be stopped from
158 deleting scene nodes for example */ 158 deleting scene nodes for example */
159 const c8* const IRR_SCENE_MANAGER_IS_EDITOR = "IRR_Editor"; 159 const c8* const IRR_SCENE_MANAGER_IS_EDITOR = "IRR_Editor";
160 160
161 //! Name of the parameter for setting the length of debug normals. 161 //! Name of the parameter for setting the length of debug normals.
162 /** Use it like this: 162 /** Use it like this:
163 \code 163 \code
164 SceneManager->getParameters()->setAttribute(scene::DEBUG_NORMAL_LENGTH, 1.5f); 164 SceneManager->getParameters()->setAttribute(scene::DEBUG_NORMAL_LENGTH, 1.5f);
165 \endcode 165 \endcode
166 **/ 166 **/
167 const c8* const DEBUG_NORMAL_LENGTH = "DEBUG_Normal_Length"; 167 const c8* const DEBUG_NORMAL_LENGTH = "DEBUG_Normal_Length";
168 168
169 //! Name of the parameter for setting the color of debug normals. 169 //! Name of the parameter for setting the color of debug normals.
170 /** Use it like this: 170 /** Use it like this:
171 \code 171 \code
172 SceneManager->getParameters()->setAttributeAsColor(scene::DEBUG_NORMAL_COLOR, video::SColor(255, 255, 255, 255)); 172 SceneManager->getParameters()->setAttributeAsColor(scene::DEBUG_NORMAL_COLOR, video::SColor(255, 255, 255, 255));
173 \endcode 173 \endcode
174 **/ 174 **/
175 const c8* const DEBUG_NORMAL_COLOR = "DEBUG_Normal_Color"; 175 const c8* const DEBUG_NORMAL_COLOR = "DEBUG_Normal_Color";
176 176
177 177
178} // end namespace scene 178} // end namespace scene
179} // end namespace irr 179} // end namespace irr
180 180
181#endif 181#endif
182 182
diff --git a/libraries/irrlicht-1.8/include/aabbox3d.h b/libraries/irrlicht-1.8/include/aabbox3d.h
index afaf12d..ae4e3ae 100644
--- a/libraries/irrlicht-1.8/include/aabbox3d.h
+++ b/libraries/irrlicht-1.8/include/aabbox3d.h
@@ -1,332 +1,332 @@
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#ifndef __IRR_AABBOX_3D_H_INCLUDED__ 5#ifndef __IRR_AABBOX_3D_H_INCLUDED__
6#define __IRR_AABBOX_3D_H_INCLUDED__ 6#define __IRR_AABBOX_3D_H_INCLUDED__
7 7
8#include "irrMath.h" 8#include "irrMath.h"
9#include "plane3d.h" 9#include "plane3d.h"
10#include "line3d.h" 10#include "line3d.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace core 14namespace core
15{ 15{
16 16
17//! Axis aligned bounding box in 3d dimensional space. 17//! Axis aligned bounding box in 3d dimensional space.
18/** Has some useful methods used with occlusion culling or clipping. 18/** Has some useful methods used with occlusion culling or clipping.
19*/ 19*/
20template <class T> 20template <class T>
21class aabbox3d 21class aabbox3d
22{ 22{
23 public: 23 public:
24 24
25 //! Default Constructor. 25 //! Default Constructor.
26 aabbox3d(): MinEdge(-1,-1,-1), MaxEdge(1,1,1) {} 26 aabbox3d(): MinEdge(-1,-1,-1), MaxEdge(1,1,1) {}
27 //! Constructor with min edge and max edge. 27 //! Constructor with min edge and max edge.
28 aabbox3d(const vector3d<T>& min, const vector3d<T>& max): MinEdge(min), MaxEdge(max) {} 28 aabbox3d(const vector3d<T>& min, const vector3d<T>& max): MinEdge(min), MaxEdge(max) {}
29 //! Constructor with only one point. 29 //! Constructor with only one point.
30 aabbox3d(const vector3d<T>& init): MinEdge(init), MaxEdge(init) {} 30 aabbox3d(const vector3d<T>& init): MinEdge(init), MaxEdge(init) {}
31 //! Constructor with min edge and max edge as single values, not vectors. 31 //! Constructor with min edge and max edge as single values, not vectors.
32 aabbox3d(T minx, T miny, T minz, T maxx, T maxy, T maxz): MinEdge(minx, miny, minz), MaxEdge(maxx, maxy, maxz) {} 32 aabbox3d(T minx, T miny, T minz, T maxx, T maxy, T maxz): MinEdge(minx, miny, minz), MaxEdge(maxx, maxy, maxz) {}
33 33
34 // operators 34 // operators
35 //! Equality operator 35 //! Equality operator
36 /** \param other box to compare with. 36 /** \param other box to compare with.
37 \return True if both boxes are equal, else false. */ 37 \return True if both boxes are equal, else false. */
38 inline bool operator==(const aabbox3d<T>& other) const { return (MinEdge == other.MinEdge && other.MaxEdge == MaxEdge);} 38 inline bool operator==(const aabbox3d<T>& other) const { return (MinEdge == other.MinEdge && other.MaxEdge == MaxEdge);}
39 //! Inequality operator 39 //! Inequality operator
40 /** \param other box to compare with. 40 /** \param other box to compare with.
41 \return True if both boxes are different, else false. */ 41 \return True if both boxes are different, else false. */
42 inline bool operator!=(const aabbox3d<T>& other) const { return !(MinEdge == other.MinEdge && other.MaxEdge == MaxEdge);} 42 inline bool operator!=(const aabbox3d<T>& other) const { return !(MinEdge == other.MinEdge && other.MaxEdge == MaxEdge);}
43 43
44 // functions 44 // functions
45 45
46 //! Resets the bounding box to a one-point box. 46 //! Resets the bounding box to a one-point box.
47 /** \param x X coord of the point. 47 /** \param x X coord of the point.
48 \param y Y coord of the point. 48 \param y Y coord of the point.
49 \param z Z coord of the point. */ 49 \param z Z coord of the point. */
50 void reset(T x, T y, T z) 50 void reset(T x, T y, T z)
51 { 51 {
52 MaxEdge.set(x,y,z); 52 MaxEdge.set(x,y,z);
53 MinEdge = MaxEdge; 53 MinEdge = MaxEdge;
54 } 54 }
55 55
56 //! Resets the bounding box. 56 //! Resets the bounding box.
57 /** \param initValue New box to set this one to. */ 57 /** \param initValue New box to set this one to. */
58 void reset(const aabbox3d<T>& initValue) 58 void reset(const aabbox3d<T>& initValue)
59 { 59 {
60 *this = initValue; 60 *this = initValue;
61 } 61 }
62 62
63 //! Resets the bounding box to a one-point box. 63 //! Resets the bounding box to a one-point box.
64 /** \param initValue New point. */ 64 /** \param initValue New point. */
65 void reset(const vector3d<T>& initValue) 65 void reset(const vector3d<T>& initValue)
66 { 66 {
67 MaxEdge = initValue; 67 MaxEdge = initValue;
68 MinEdge = initValue; 68 MinEdge = initValue;
69 } 69 }
70 70
71 //! Adds a point to the bounding box 71 //! Adds a point to the bounding box
72 /** The box grows bigger, if point was outside of the box. 72 /** The box grows bigger, if point was outside of the box.
73 \param p: Point to add into the box. */ 73 \param p: Point to add into the box. */
74 void addInternalPoint(const vector3d<T>& p) 74 void addInternalPoint(const vector3d<T>& p)
75 { 75 {
76 addInternalPoint(p.X, p.Y, p.Z); 76 addInternalPoint(p.X, p.Y, p.Z);
77 } 77 }
78 78
79 //! Adds another bounding box 79 //! Adds another bounding box
80 /** The box grows bigger, if the new box was outside of the box. 80 /** The box grows bigger, if the new box was outside of the box.
81 \param b: Other bounding box to add into this box. */ 81 \param b: Other bounding box to add into this box. */
82 void addInternalBox(const aabbox3d<T>& b) 82 void addInternalBox(const aabbox3d<T>& b)
83 { 83 {
84 addInternalPoint(b.MaxEdge); 84 addInternalPoint(b.MaxEdge);
85 addInternalPoint(b.MinEdge); 85 addInternalPoint(b.MinEdge);
86 } 86 }
87 87
88 //! Adds a point to the bounding box 88 //! Adds a point to the bounding box
89 /** The box grows bigger, if point is outside of the box. 89 /** The box grows bigger, if point is outside of the box.
90 \param x X coordinate of the point to add to this box. 90 \param x X coordinate of the point to add to this box.
91 \param y Y coordinate of the point to add to this box. 91 \param y Y coordinate of the point to add to this box.
92 \param z Z coordinate of the point to add to this box. */ 92 \param z Z coordinate of the point to add to this box. */
93 void addInternalPoint(T x, T y, T z) 93 void addInternalPoint(T x, T y, T z)
94 { 94 {
95 if (x>MaxEdge.X) MaxEdge.X = x; 95 if (x>MaxEdge.X) MaxEdge.X = x;
96 if (y>MaxEdge.Y) MaxEdge.Y = y; 96 if (y>MaxEdge.Y) MaxEdge.Y = y;
97 if (z>MaxEdge.Z) MaxEdge.Z = z; 97 if (z>MaxEdge.Z) MaxEdge.Z = z;
98 98
99 if (x<MinEdge.X) MinEdge.X = x; 99 if (x<MinEdge.X) MinEdge.X = x;
100 if (y<MinEdge.Y) MinEdge.Y = y; 100 if (y<MinEdge.Y) MinEdge.Y = y;
101 if (z<MinEdge.Z) MinEdge.Z = z; 101 if (z<MinEdge.Z) MinEdge.Z = z;
102 } 102 }
103 103
104 //! Get center of the bounding box 104 //! Get center of the bounding box
105 /** \return Center of the bounding box. */ 105 /** \return Center of the bounding box. */
106 vector3d<T> getCenter() const 106 vector3d<T> getCenter() const
107 { 107 {
108 return (MinEdge + MaxEdge) / 2; 108 return (MinEdge + MaxEdge) / 2;
109 } 109 }
110 110
111 //! Get extent of the box (maximal distance of two points in the box) 111 //! Get extent of the box (maximal distance of two points in the box)
112 /** \return Extent of the bounding box. */ 112 /** \return Extent of the bounding box. */
113 vector3d<T> getExtent() const 113 vector3d<T> getExtent() const
114 { 114 {
115 return MaxEdge - MinEdge; 115 return MaxEdge - MinEdge;
116 } 116 }
117 117
118 //! Check if the box is empty. 118 //! Check if the box is empty.
119 /** This means that there is no space between the min and max edge. 119 /** This means that there is no space between the min and max edge.
120 \return True if box is empty, else false. */ 120 \return True if box is empty, else false. */
121 bool isEmpty() const 121 bool isEmpty() const
122 { 122 {
123 return MinEdge.equals ( MaxEdge ); 123 return MinEdge.equals ( MaxEdge );
124 } 124 }
125 125
126 //! Get the volume enclosed by the box in cubed units 126 //! Get the volume enclosed by the box in cubed units
127 T getVolume() const 127 T getVolume() const
128 { 128 {
129 const vector3d<T> e = getExtent(); 129 const vector3d<T> e = getExtent();
130 return e.X * e.Y * e.Z; 130 return e.X * e.Y * e.Z;
131 } 131 }
132 132
133 //! Get the surface area of the box in squared units 133 //! Get the surface area of the box in squared units
134 T getArea() const 134 T getArea() const
135 { 135 {
136 const vector3d<T> e = getExtent(); 136 const vector3d<T> e = getExtent();
137 return 2*(e.X*e.Y + e.X*e.Z + e.Y*e.Z); 137 return 2*(e.X*e.Y + e.X*e.Z + e.Y*e.Z);
138 } 138 }
139 139
140 //! Stores all 8 edges of the box into an array 140 //! Stores all 8 edges of the box into an array
141 /** \param edges: Pointer to array of 8 edges. */ 141 /** \param edges: Pointer to array of 8 edges. */
142 void getEdges(vector3d<T> *edges) const 142 void getEdges(vector3d<T> *edges) const
143 { 143 {
144 const core::vector3d<T> middle = getCenter(); 144 const core::vector3d<T> middle = getCenter();
145 const core::vector3d<T> diag = middle - MaxEdge; 145 const core::vector3d<T> diag = middle - MaxEdge;
146 146
147 /* 147 /*
148 Edges are stored in this way: 148 Edges are stored in this way:
149 Hey, am I an ascii artist, or what? :) niko. 149 Hey, am I an ascii artist, or what? :) niko.
150 /3--------/7 150 /3--------/7
151 / | / | 151 / | / |
152 / | / | 152 / | / |
153 1---------5 | 153 1---------5 |
154 | /2- - -|- -6 154 | /2- - -|- -6
155 | / | / 155 | / | /
156 |/ | / 156 |/ | /
157 0---------4/ 157 0---------4/
158 */ 158 */
159 159
160 edges[0].set(middle.X + diag.X, middle.Y + diag.Y, middle.Z + diag.Z); 160 edges[0].set(middle.X + diag.X, middle.Y + diag.Y, middle.Z + diag.Z);
161 edges[1].set(middle.X + diag.X, middle.Y - diag.Y, middle.Z + diag.Z); 161 edges[1].set(middle.X + diag.X, middle.Y - diag.Y, middle.Z + diag.Z);
162 edges[2].set(middle.X + diag.X, middle.Y + diag.Y, middle.Z - diag.Z); 162 edges[2].set(middle.X + diag.X, middle.Y + diag.Y, middle.Z - diag.Z);
163 edges[3].set(middle.X + diag.X, middle.Y - diag.Y, middle.Z - diag.Z); 163 edges[3].set(middle.X + diag.X, middle.Y - diag.Y, middle.Z - diag.Z);
164 edges[4].set(middle.X - diag.X, middle.Y + diag.Y, middle.Z + diag.Z); 164 edges[4].set(middle.X - diag.X, middle.Y + diag.Y, middle.Z + diag.Z);
165 edges[5].set(middle.X - diag.X, middle.Y - diag.Y, middle.Z + diag.Z); 165 edges[5].set(middle.X - diag.X, middle.Y - diag.Y, middle.Z + diag.Z);
166 edges[6].set(middle.X - diag.X, middle.Y + diag.Y, middle.Z - diag.Z); 166 edges[6].set(middle.X - diag.X, middle.Y + diag.Y, middle.Z - diag.Z);
167 edges[7].set(middle.X - diag.X, middle.Y - diag.Y, middle.Z - diag.Z); 167 edges[7].set(middle.X - diag.X, middle.Y - diag.Y, middle.Z - diag.Z);
168 } 168 }
169 169
170 //! Repairs the box. 170 //! Repairs the box.
171 /** Necessary if for example MinEdge and MaxEdge are swapped. */ 171 /** Necessary if for example MinEdge and MaxEdge are swapped. */
172 void repair() 172 void repair()
173 { 173 {
174 T t; 174 T t;
175 175
176 if (MinEdge.X > MaxEdge.X) 176 if (MinEdge.X > MaxEdge.X)
177 { t=MinEdge.X; MinEdge.X = MaxEdge.X; MaxEdge.X=t; } 177 { t=MinEdge.X; MinEdge.X = MaxEdge.X; MaxEdge.X=t; }
178 if (MinEdge.Y > MaxEdge.Y) 178 if (MinEdge.Y > MaxEdge.Y)
179 { t=MinEdge.Y; MinEdge.Y = MaxEdge.Y; MaxEdge.Y=t; } 179 { t=MinEdge.Y; MinEdge.Y = MaxEdge.Y; MaxEdge.Y=t; }
180 if (MinEdge.Z > MaxEdge.Z) 180 if (MinEdge.Z > MaxEdge.Z)
181 { t=MinEdge.Z; MinEdge.Z = MaxEdge.Z; MaxEdge.Z=t; } 181 { t=MinEdge.Z; MinEdge.Z = MaxEdge.Z; MaxEdge.Z=t; }
182 } 182 }
183 183
184 //! Calculates a new interpolated bounding box. 184 //! Calculates a new interpolated bounding box.
185 /** d=0 returns other, d=1 returns this, all other values blend between 185 /** d=0 returns other, d=1 returns this, all other values blend between
186 the two boxes. 186 the two boxes.
187 \param other Other box to interpolate between 187 \param other Other box to interpolate between
188 \param d Value between 0.0f and 1.0f. 188 \param d Value between 0.0f and 1.0f.
189 \return Interpolated box. */ 189 \return Interpolated box. */
190 aabbox3d<T> getInterpolated(const aabbox3d<T>& other, f32 d) const 190 aabbox3d<T> getInterpolated(const aabbox3d<T>& other, f32 d) const
191 { 191 {
192 f32 inv = 1.0f - d; 192 f32 inv = 1.0f - d;
193 return aabbox3d<T>((other.MinEdge*inv) + (MinEdge*d), 193 return aabbox3d<T>((other.MinEdge*inv) + (MinEdge*d),
194 (other.MaxEdge*inv) + (MaxEdge*d)); 194 (other.MaxEdge*inv) + (MaxEdge*d));
195 } 195 }
196 196
197 //! Determines if a point is within this box. 197 //! Determines if a point is within this box.
198 /** Border is included (IS part of the box)! 198 /** Border is included (IS part of the box)!
199 \param p: Point to check. 199 \param p: Point to check.
200 \return True if the point is within the box and false if not */ 200 \return True if the point is within the box and false if not */
201 bool isPointInside(const vector3d<T>& p) const 201 bool isPointInside(const vector3d<T>& p) const
202 { 202 {
203 return (p.X >= MinEdge.X && p.X <= MaxEdge.X && 203 return (p.X >= MinEdge.X && p.X <= MaxEdge.X &&
204 p.Y >= MinEdge.Y && p.Y <= MaxEdge.Y && 204 p.Y >= MinEdge.Y && p.Y <= MaxEdge.Y &&
205 p.Z >= MinEdge.Z && p.Z <= MaxEdge.Z); 205 p.Z >= MinEdge.Z && p.Z <= MaxEdge.Z);
206 } 206 }
207 207
208 //! Determines if a point is within this box and not its borders. 208 //! Determines if a point is within this box and not its borders.
209 /** Border is excluded (NOT part of the box)! 209 /** Border is excluded (NOT part of the box)!
210 \param p: Point to check. 210 \param p: Point to check.
211 \return True if the point is within the box and false if not. */ 211 \return True if the point is within the box and false if not. */
212 bool isPointTotalInside(const vector3d<T>& p) const 212 bool isPointTotalInside(const vector3d<T>& p) const
213 { 213 {
214 return (p.X > MinEdge.X && p.X < MaxEdge.X && 214 return (p.X > MinEdge.X && p.X < MaxEdge.X &&
215 p.Y > MinEdge.Y && p.Y < MaxEdge.Y && 215 p.Y > MinEdge.Y && p.Y < MaxEdge.Y &&
216 p.Z > MinEdge.Z && p.Z < MaxEdge.Z); 216 p.Z > MinEdge.Z && p.Z < MaxEdge.Z);
217 } 217 }
218 218
219 //! Check if this box is completely inside the 'other' box. 219 //! Check if this box is completely inside the 'other' box.
220 /** \param other: Other box to check against. 220 /** \param other: Other box to check against.
221 \return True if this box is completly inside the other box, 221 \return True if this box is completly inside the other box,
222 otherwise false. */ 222 otherwise false. */
223 bool isFullInside(const aabbox3d<T>& other) const 223 bool isFullInside(const aabbox3d<T>& other) const
224 { 224 {
225 return (MinEdge.X >= other.MinEdge.X && MinEdge.Y >= other.MinEdge.Y && MinEdge.Z >= other.MinEdge.Z && 225 return (MinEdge.X >= other.MinEdge.X && MinEdge.Y >= other.MinEdge.Y && MinEdge.Z >= other.MinEdge.Z &&
226 MaxEdge.X <= other.MaxEdge.X && MaxEdge.Y <= other.MaxEdge.Y && MaxEdge.Z <= other.MaxEdge.Z); 226 MaxEdge.X <= other.MaxEdge.X && MaxEdge.Y <= other.MaxEdge.Y && MaxEdge.Z <= other.MaxEdge.Z);
227 } 227 }
228 228
229 //! Determines if the axis-aligned box intersects with another axis-aligned box. 229 //! Determines if the axis-aligned box intersects with another axis-aligned box.
230 /** \param other: Other box to check a intersection with. 230 /** \param other: Other box to check a intersection with.
231 \return True if there is an intersection with the other box, 231 \return True if there is an intersection with the other box,
232 otherwise false. */ 232 otherwise false. */
233 bool intersectsWithBox(const aabbox3d<T>& other) const 233 bool intersectsWithBox(const aabbox3d<T>& other) const
234 { 234 {
235 return (MinEdge.X <= other.MaxEdge.X && MinEdge.Y <= other.MaxEdge.Y && MinEdge.Z <= other.MaxEdge.Z && 235 return (MinEdge.X <= other.MaxEdge.X && MinEdge.Y <= other.MaxEdge.Y && MinEdge.Z <= other.MaxEdge.Z &&
236 MaxEdge.X >= other.MinEdge.X && MaxEdge.Y >= other.MinEdge.Y && MaxEdge.Z >= other.MinEdge.Z); 236 MaxEdge.X >= other.MinEdge.X && MaxEdge.Y >= other.MinEdge.Y && MaxEdge.Z >= other.MinEdge.Z);
237 } 237 }
238 238
239 //! Tests if the box intersects with a line 239 //! Tests if the box intersects with a line
240 /** \param line: Line to test intersection with. 240 /** \param line: Line to test intersection with.
241 \return True if there is an intersection , else false. */ 241 \return True if there is an intersection , else false. */
242 bool intersectsWithLine(const line3d<T>& line) const 242 bool intersectsWithLine(const line3d<T>& line) const
243 { 243 {
244 return intersectsWithLine(line.getMiddle(), line.getVector().normalize(), 244 return intersectsWithLine(line.getMiddle(), line.getVector().normalize(),
245 (T)(line.getLength() * 0.5)); 245 (T)(line.getLength() * 0.5));
246 } 246 }
247 247
248 //! Tests if the box intersects with a line 248 //! Tests if the box intersects with a line
249 /** \param linemiddle Center of the line. 249 /** \param linemiddle Center of the line.
250 \param linevect Vector of the line. 250 \param linevect Vector of the line.
251 \param halflength Half length of the line. 251 \param halflength Half length of the line.
252 \return True if there is an intersection, else false. */ 252 \return True if there is an intersection, else false. */
253 bool intersectsWithLine(const vector3d<T>& linemiddle, 253 bool intersectsWithLine(const vector3d<T>& linemiddle,
254 const vector3d<T>& linevect, T halflength) const 254 const vector3d<T>& linevect, T halflength) const
255 { 255 {
256 const vector3d<T> e = getExtent() * (T)0.5; 256 const vector3d<T> e = getExtent() * (T)0.5;
257 const vector3d<T> t = getCenter() - linemiddle; 257 const vector3d<T> t = getCenter() - linemiddle;
258 258
259 if ((fabs(t.X) > e.X + halflength * fabs(linevect.X)) || 259 if ((fabs(t.X) > e.X + halflength * fabs(linevect.X)) ||
260 (fabs(t.Y) > e.Y + halflength * fabs(linevect.Y)) || 260 (fabs(t.Y) > e.Y + halflength * fabs(linevect.Y)) ||
261 (fabs(t.Z) > e.Z + halflength * fabs(linevect.Z)) ) 261 (fabs(t.Z) > e.Z + halflength * fabs(linevect.Z)) )
262 return false; 262 return false;
263 263
264 T r = e.Y * (T)fabs(linevect.Z) + e.Z * (T)fabs(linevect.Y); 264 T r = e.Y * (T)fabs(linevect.Z) + e.Z * (T)fabs(linevect.Y);
265 if (fabs(t.Y*linevect.Z - t.Z*linevect.Y) > r ) 265 if (fabs(t.Y*linevect.Z - t.Z*linevect.Y) > r )
266 return false; 266 return false;
267 267
268 r = e.X * (T)fabs(linevect.Z) + e.Z * (T)fabs(linevect.X); 268 r = e.X * (T)fabs(linevect.Z) + e.Z * (T)fabs(linevect.X);
269 if (fabs(t.Z*linevect.X - t.X*linevect.Z) > r ) 269 if (fabs(t.Z*linevect.X - t.X*linevect.Z) > r )
270 return false; 270 return false;
271 271
272 r = e.X * (T)fabs(linevect.Y) + e.Y * (T)fabs(linevect.X); 272 r = e.X * (T)fabs(linevect.Y) + e.Y * (T)fabs(linevect.X);
273 if (fabs(t.X*linevect.Y - t.Y*linevect.X) > r) 273 if (fabs(t.X*linevect.Y - t.Y*linevect.X) > r)
274 return false; 274 return false;
275 275
276 return true; 276 return true;
277 } 277 }
278 278
279 //! Classifies a relation with a plane. 279 //! Classifies a relation with a plane.
280 /** \param plane Plane to classify relation to. 280 /** \param plane Plane to classify relation to.
281 \return Returns ISREL3D_FRONT if the box is in front of the plane, 281 \return Returns ISREL3D_FRONT if the box is in front of the plane,
282 ISREL3D_BACK if the box is behind the plane, and 282 ISREL3D_BACK if the box is behind the plane, and
283 ISREL3D_CLIPPED if it is on both sides of the plane. */ 283 ISREL3D_CLIPPED if it is on both sides of the plane. */
284 EIntersectionRelation3D classifyPlaneRelation(const plane3d<T>& plane) const 284 EIntersectionRelation3D classifyPlaneRelation(const plane3d<T>& plane) const
285 { 285 {
286 vector3d<T> nearPoint(MaxEdge); 286 vector3d<T> nearPoint(MaxEdge);
287 vector3d<T> farPoint(MinEdge); 287 vector3d<T> farPoint(MinEdge);
288 288
289 if (plane.Normal.X > (T)0) 289 if (plane.Normal.X > (T)0)
290 { 290 {
291 nearPoint.X = MinEdge.X; 291 nearPoint.X = MinEdge.X;
292 farPoint.X = MaxEdge.X; 292 farPoint.X = MaxEdge.X;
293 } 293 }
294 294
295 if (plane.Normal.Y > (T)0) 295 if (plane.Normal.Y > (T)0)
296 { 296 {
297 nearPoint.Y = MinEdge.Y; 297 nearPoint.Y = MinEdge.Y;
298 farPoint.Y = MaxEdge.Y; 298 farPoint.Y = MaxEdge.Y;
299 } 299 }
300 300
301 if (plane.Normal.Z > (T)0) 301 if (plane.Normal.Z > (T)0)
302 { 302 {
303 nearPoint.Z = MinEdge.Z; 303 nearPoint.Z = MinEdge.Z;
304 farPoint.Z = MaxEdge.Z; 304 farPoint.Z = MaxEdge.Z;
305 } 305 }
306 306
307 if (plane.Normal.dotProduct(nearPoint) + plane.D > (T)0) 307 if (plane.Normal.dotProduct(nearPoint) + plane.D > (T)0)
308 return ISREL3D_FRONT; 308 return ISREL3D_FRONT;
309 309
310 if (plane.Normal.dotProduct(farPoint) + plane.D > (T)0) 310 if (plane.Normal.dotProduct(farPoint) + plane.D > (T)0)
311 return ISREL3D_CLIPPED; 311 return ISREL3D_CLIPPED;
312 312
313 return ISREL3D_BACK; 313 return ISREL3D_BACK;
314 } 314 }
315 315
316 //! The near edge 316 //! The near edge
317 vector3d<T> MinEdge; 317 vector3d<T> MinEdge;
318 318
319 //! The far edge 319 //! The far edge
320 vector3d<T> MaxEdge; 320 vector3d<T> MaxEdge;
321}; 321};
322 322
323 //! Typedef for a f32 3d bounding box. 323 //! Typedef for a f32 3d bounding box.
324 typedef aabbox3d<f32> aabbox3df; 324 typedef aabbox3d<f32> aabbox3df;
325 //! Typedef for an integer 3d bounding box. 325 //! Typedef for an integer 3d bounding box.
326 typedef aabbox3d<s32> aabbox3di; 326 typedef aabbox3d<s32> aabbox3di;
327 327
328} // end namespace core 328} // end namespace core
329} // end namespace irr 329} // end namespace irr
330 330
331#endif 331#endif
332 332
diff --git a/libraries/irrlicht-1.8/include/coreutil.h b/libraries/irrlicht-1.8/include/coreutil.h
index 2ab4855..eaf0097 100644
--- a/libraries/irrlicht-1.8/include/coreutil.h
+++ b/libraries/irrlicht-1.8/include/coreutil.h
@@ -1,188 +1,188 @@
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#ifndef __IRR_CORE_UTIL_H_INCLUDED__ 5#ifndef __IRR_CORE_UTIL_H_INCLUDED__
6#define __IRR_CORE_UTIL_H_INCLUDED__ 6#define __IRR_CORE_UTIL_H_INCLUDED__
7 7
8#include "irrString.h" 8#include "irrString.h"
9#include "path.h" 9#include "path.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace core 13namespace core
14{ 14{
15 15
16/*! \file coreutil.h 16/*! \file coreutil.h
17 \brief File containing useful basic utility functions 17 \brief File containing useful basic utility functions
18*/ 18*/
19 19
20// ----------- some basic quite often used string functions ----------------- 20// ----------- some basic quite often used string functions -----------------
21 21
22//! search if a filename has a proper extension 22//! search if a filename has a proper extension
23inline s32 isFileExtension ( const io::path& filename, 23inline s32 isFileExtension ( const io::path& filename,
24 const io::path& ext0, 24 const io::path& ext0,
25 const io::path& ext1, 25 const io::path& ext1,
26 const io::path& ext2) 26 const io::path& ext2)
27{ 27{
28 s32 extPos = filename.findLast ( '.' ); 28 s32 extPos = filename.findLast ( '.' );
29 if ( extPos < 0 ) 29 if ( extPos < 0 )
30 return 0; 30 return 0;
31 31
32 extPos += 1; 32 extPos += 1;
33 if ( filename.equals_substring_ignore_case ( ext0, extPos ) ) return 1; 33 if ( filename.equals_substring_ignore_case ( ext0, extPos ) ) return 1;
34 if ( filename.equals_substring_ignore_case ( ext1, extPos ) ) return 2; 34 if ( filename.equals_substring_ignore_case ( ext1, extPos ) ) return 2;
35 if ( filename.equals_substring_ignore_case ( ext2, extPos ) ) return 3; 35 if ( filename.equals_substring_ignore_case ( ext2, extPos ) ) return 3;
36 return 0; 36 return 0;
37} 37}
38 38
39//! search if a filename has a proper extension 39//! search if a filename has a proper extension
40inline bool hasFileExtension ( const io::path& filename, 40inline bool hasFileExtension ( const io::path& filename,
41 const io::path& ext0, 41 const io::path& ext0,
42 const io::path& ext1 = "", 42 const io::path& ext1 = "",
43 const io::path& ext2 = "") 43 const io::path& ext2 = "")
44{ 44{
45 return isFileExtension ( filename, ext0, ext1, ext2 ) > 0; 45 return isFileExtension ( filename, ext0, ext1, ext2 ) > 0;
46} 46}
47 47
48//! cut the filename extension from a source file path and store it in a dest file path 48//! cut the filename extension from a source file path and store it in a dest file path
49inline io::path& cutFilenameExtension ( io::path &dest, const io::path &source ) 49inline io::path& cutFilenameExtension ( io::path &dest, const io::path &source )
50{ 50{
51 s32 endPos = source.findLast ( '.' ); 51 s32 endPos = source.findLast ( '.' );
52 dest = source.subString ( 0, endPos < 0 ? source.size () : endPos ); 52 dest = source.subString ( 0, endPos < 0 ? source.size () : endPos );
53 return dest; 53 return dest;
54} 54}
55 55
56//! get the filename extension from a file path 56//! get the filename extension from a file path
57inline io::path& getFileNameExtension ( io::path &dest, const io::path &source ) 57inline io::path& getFileNameExtension ( io::path &dest, const io::path &source )
58{ 58{
59 s32 endPos = source.findLast ( '.' ); 59 s32 endPos = source.findLast ( '.' );
60 if ( endPos < 0 ) 60 if ( endPos < 0 )
61 dest = ""; 61 dest = "";
62 else 62 else
63 dest = source.subString ( endPos, source.size () ); 63 dest = source.subString ( endPos, source.size () );
64 return dest; 64 return dest;
65} 65}
66 66
67//! delete path from filename 67//! delete path from filename
68inline io::path& deletePathFromFilename(io::path& filename) 68inline io::path& deletePathFromFilename(io::path& filename)
69{ 69{
70 // delete path from filename 70 // delete path from filename
71 const fschar_t* s = filename.c_str(); 71 const fschar_t* s = filename.c_str();
72 const fschar_t* p = s + filename.size(); 72 const fschar_t* p = s + filename.size();
73 73
74 // search for path separator or beginning 74 // search for path separator or beginning
75 while ( *p != '/' && *p != '\\' && p != s ) 75 while ( *p != '/' && *p != '\\' && p != s )
76 p--; 76 p--;
77 77
78 if ( p != s ) 78 if ( p != s )
79 { 79 {
80 ++p; 80 ++p;
81 filename = p; 81 filename = p;
82 } 82 }
83 return filename; 83 return filename;
84} 84}
85 85
86//! trim paths 86//! trim paths
87inline io::path& deletePathFromPath(io::path& filename, s32 pathCount) 87inline io::path& deletePathFromPath(io::path& filename, s32 pathCount)
88{ 88{
89 // delete path from filename 89 // delete path from filename
90 s32 i = filename.size(); 90 s32 i = filename.size();
91 91
92 // search for path separator or beginning 92 // search for path separator or beginning
93 while ( i>=0 ) 93 while ( i>=0 )
94 { 94 {
95 if ( filename[i] == '/' || filename[i] == '\\' ) 95 if ( filename[i] == '/' || filename[i] == '\\' )
96 { 96 {
97 if ( --pathCount <= 0 ) 97 if ( --pathCount <= 0 )
98 break; 98 break;
99 } 99 }
100 --i; 100 --i;
101 } 101 }
102 102
103 if ( i>0 ) 103 if ( i>0 )
104 { 104 {
105 filename [ i + 1 ] = 0; 105 filename [ i + 1 ] = 0;
106 filename.validate(); 106 filename.validate();
107 } 107 }
108 else 108 else
109 filename=""; 109 filename="";
110 return filename; 110 return filename;
111} 111}
112 112
113//! looks if file is in the same directory of path. returns offset of directory. 113//! looks if file is in the same directory of path. returns offset of directory.
114//! 0 means in same directory. 1 means file is direct child of path 114//! 0 means in same directory. 1 means file is direct child of path
115inline s32 isInSameDirectory ( const io::path& path, const io::path& file ) 115inline s32 isInSameDirectory ( const io::path& path, const io::path& file )
116{ 116{
117 s32 subA = 0; 117 s32 subA = 0;
118 s32 subB = 0; 118 s32 subB = 0;
119 s32 pos; 119 s32 pos;
120 120
121 if ( path.size() && !path.equalsn ( file, path.size() ) ) 121 if ( path.size() && !path.equalsn ( file, path.size() ) )
122 return -1; 122 return -1;
123 123
124 pos = 0; 124 pos = 0;
125 while ( (pos = path.findNext ( '/', pos )) >= 0 ) 125 while ( (pos = path.findNext ( '/', pos )) >= 0 )
126 { 126 {
127 subA += 1; 127 subA += 1;
128 pos += 1; 128 pos += 1;
129 } 129 }
130 130
131 pos = 0; 131 pos = 0;
132 while ( (pos = file.findNext ( '/', pos )) >= 0 ) 132 while ( (pos = file.findNext ( '/', pos )) >= 0 )
133 { 133 {
134 subB += 1; 134 subB += 1;
135 pos += 1; 135 pos += 1;
136 } 136 }
137 137
138 return subB - subA; 138 return subB - subA;
139} 139}
140 140
141// splits a path into components 141// splits a path into components
142static inline void splitFilename(const io::path &name, io::path* path=0, 142static inline void splitFilename(const io::path &name, io::path* path=0,
143 io::path* filename=0, io::path* extension=0, bool make_lower=false) 143 io::path* filename=0, io::path* extension=0, bool make_lower=false)
144{ 144{
145 s32 i = name.size(); 145 s32 i = name.size();
146 s32 extpos = i; 146 s32 extpos = i;
147 147
148 // search for path separator or beginning 148 // search for path separator or beginning
149 while ( i >= 0 ) 149 while ( i >= 0 )
150 { 150 {
151 if ( name[i] == '.' ) 151 if ( name[i] == '.' )
152 { 152 {
153 extpos = i; 153 extpos = i;
154 if ( extension ) 154 if ( extension )
155 *extension = name.subString ( extpos + 1, name.size() - (extpos + 1), make_lower ); 155 *extension = name.subString ( extpos + 1, name.size() - (extpos + 1), make_lower );
156 } 156 }
157 else 157 else
158 if ( name[i] == '/' || name[i] == '\\' ) 158 if ( name[i] == '/' || name[i] == '\\' )
159 { 159 {
160 if ( filename ) 160 if ( filename )
161 *filename = name.subString ( i + 1, extpos - (i + 1), make_lower ); 161 *filename = name.subString ( i + 1, extpos - (i + 1), make_lower );
162 if ( path ) 162 if ( path )
163 { 163 {
164 *path = name.subString ( 0, i + 1, make_lower ); 164 *path = name.subString ( 0, i + 1, make_lower );
165 path->replace ( '\\', '/' ); 165 path->replace ( '\\', '/' );
166 } 166 }
167 return; 167 return;
168 } 168 }
169 i -= 1; 169 i -= 1;
170 } 170 }
171 if ( filename ) 171 if ( filename )
172 *filename = name.subString ( 0, extpos, make_lower ); 172 *filename = name.subString ( 0, extpos, make_lower );
173} 173}
174 174
175 175
176//! some standard function ( to remove dependencies ) 176//! some standard function ( to remove dependencies )
177#undef isdigit 177#undef isdigit
178#undef isspace 178#undef isspace
179#undef isupper 179#undef isupper
180inline s32 isdigit(s32 c) { return c >= '0' && c <= '9'; } 180inline s32 isdigit(s32 c) { return c >= '0' && c <= '9'; }
181inline s32 isspace(s32 c) { return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v'; } 181inline s32 isspace(s32 c) { return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v'; }
182inline s32 isupper(s32 c) { return c >= 'A' && c <= 'Z'; } 182inline s32 isupper(s32 c) { return c >= 'A' && c <= 'Z'; }
183 183
184 184
185} // end namespace core 185} // end namespace core
186} // end namespace irr 186} // end namespace irr
187 187
188#endif 188#endif
diff --git a/libraries/irrlicht-1.8/include/dimension2d.h b/libraries/irrlicht-1.8/include/dimension2d.h
index 13addb4..c9d0652 100644
--- a/libraries/irrlicht-1.8/include/dimension2d.h
+++ b/libraries/irrlicht-1.8/include/dimension2d.h
@@ -1,224 +1,224 @@
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#ifndef __IRR_DIMENSION2D_H_INCLUDED__ 5#ifndef __IRR_DIMENSION2D_H_INCLUDED__
6#define __IRR_DIMENSION2D_H_INCLUDED__ 6#define __IRR_DIMENSION2D_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include "irrMath.h" // for irr::core::equals() 9#include "irrMath.h" // for irr::core::equals()
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace core 13namespace core
14{ 14{
15 template <class T> 15 template <class T>
16 class vector2d; 16 class vector2d;
17 17
18 //! Specifies a 2 dimensional size. 18 //! Specifies a 2 dimensional size.
19 template <class T> 19 template <class T>
20 class dimension2d 20 class dimension2d
21 { 21 {
22 public: 22 public:
23 //! Default constructor for empty dimension 23 //! Default constructor for empty dimension
24 dimension2d() : Width(0), Height(0) {} 24 dimension2d() : Width(0), Height(0) {}
25 //! Constructor with width and height 25 //! Constructor with width and height
26 dimension2d(const T& width, const T& height) 26 dimension2d(const T& width, const T& height)
27 : Width(width), Height(height) {} 27 : Width(width), Height(height) {}
28 28
29 dimension2d(const vector2d<T>& other); // Defined in vector2d.h 29 dimension2d(const vector2d<T>& other); // Defined in vector2d.h
30 30
31 //! Use this constructor only where you are sure that the conversion is valid. 31 //! Use this constructor only where you are sure that the conversion is valid.
32 template <class U> 32 template <class U>
33 explicit dimension2d(const dimension2d<U>& other) : 33 explicit dimension2d(const dimension2d<U>& other) :
34 Width((T)other.Width), Height((T)other.Height) { } 34 Width((T)other.Width), Height((T)other.Height) { }
35 35
36 template <class U> 36 template <class U>
37 dimension2d<T>& operator=(const dimension2d<U>& other) 37 dimension2d<T>& operator=(const dimension2d<U>& other)
38 { 38 {
39 Width = (T) other.Width; 39 Width = (T) other.Width;
40 Height = (T) other.Height; 40 Height = (T) other.Height;
41 return *this; 41 return *this;
42 } 42 }
43 43
44 44
45 //! Equality operator 45 //! Equality operator
46 bool operator==(const dimension2d<T>& other) const 46 bool operator==(const dimension2d<T>& other) const
47 { 47 {
48 return core::equals(Width, other.Width) && 48 return core::equals(Width, other.Width) &&
49 core::equals(Height, other.Height); 49 core::equals(Height, other.Height);
50 } 50 }
51 51
52 //! Inequality operator 52 //! Inequality operator
53 bool operator!=(const dimension2d<T>& other) const 53 bool operator!=(const dimension2d<T>& other) const
54 { 54 {
55 return ! (*this == other); 55 return ! (*this == other);
56 } 56 }
57 57
58 bool operator==(const vector2d<T>& other) const; // Defined in vector2d.h 58 bool operator==(const vector2d<T>& other) const; // Defined in vector2d.h
59 59
60 bool operator!=(const vector2d<T>& other) const 60 bool operator!=(const vector2d<T>& other) const
61 { 61 {
62 return !(*this == other); 62 return !(*this == other);
63 } 63 }
64 64
65 //! Set to new values 65 //! Set to new values
66 dimension2d<T>& set(const T& width, const T& height) 66 dimension2d<T>& set(const T& width, const T& height)
67 { 67 {
68 Width = width; 68 Width = width;
69 Height = height; 69 Height = height;
70 return *this; 70 return *this;
71 } 71 }
72 72
73 //! Divide width and height by scalar 73 //! Divide width and height by scalar
74 dimension2d<T>& operator/=(const T& scale) 74 dimension2d<T>& operator/=(const T& scale)
75 { 75 {
76 Width /= scale; 76 Width /= scale;
77 Height /= scale; 77 Height /= scale;
78 return *this; 78 return *this;
79 } 79 }
80 80
81 //! Divide width and height by scalar 81 //! Divide width and height by scalar
82 dimension2d<T> operator/(const T& scale) const 82 dimension2d<T> operator/(const T& scale) const
83 { 83 {
84 return dimension2d<T>(Width/scale, Height/scale); 84 return dimension2d<T>(Width/scale, Height/scale);
85 } 85 }
86 86
87 //! Multiply width and height by scalar 87 //! Multiply width and height by scalar
88 dimension2d<T>& operator*=(const T& scale) 88 dimension2d<T>& operator*=(const T& scale)
89 { 89 {
90 Width *= scale; 90 Width *= scale;
91 Height *= scale; 91 Height *= scale;
92 return *this; 92 return *this;
93 } 93 }
94 94
95 //! Multiply width and height by scalar 95 //! Multiply width and height by scalar
96 dimension2d<T> operator*(const T& scale) const 96 dimension2d<T> operator*(const T& scale) const
97 { 97 {
98 return dimension2d<T>(Width*scale, Height*scale); 98 return dimension2d<T>(Width*scale, Height*scale);
99 } 99 }
100 100
101 //! Add another dimension to this one. 101 //! Add another dimension to this one.
102 dimension2d<T>& operator+=(const dimension2d<T>& other) 102 dimension2d<T>& operator+=(const dimension2d<T>& other)
103 { 103 {
104 Width += other.Width; 104 Width += other.Width;
105 Height += other.Height; 105 Height += other.Height;
106 return *this; 106 return *this;
107 } 107 }
108 108
109 //! Add two dimensions 109 //! Add two dimensions
110 dimension2d<T> operator+(const dimension2d<T>& other) const 110 dimension2d<T> operator+(const dimension2d<T>& other) const
111 { 111 {
112 return dimension2d<T>(Width+other.Width, Height+other.Height); 112 return dimension2d<T>(Width+other.Width, Height+other.Height);
113 } 113 }
114 114
115 //! Subtract a dimension from this one 115 //! Subtract a dimension from this one
116 dimension2d<T>& operator-=(const dimension2d<T>& other) 116 dimension2d<T>& operator-=(const dimension2d<T>& other)
117 { 117 {
118 Width -= other.Width; 118 Width -= other.Width;
119 Height -= other.Height; 119 Height -= other.Height;
120 return *this; 120 return *this;
121 } 121 }
122 122
123 //! Subtract one dimension from another 123 //! Subtract one dimension from another
124 dimension2d<T> operator-(const dimension2d<T>& other) const 124 dimension2d<T> operator-(const dimension2d<T>& other) const
125 { 125 {
126 return dimension2d<T>(Width-other.Width, Height-other.Height); 126 return dimension2d<T>(Width-other.Width, Height-other.Height);
127 } 127 }
128 128
129 //! Get area 129 //! Get area
130 T getArea() const 130 T getArea() const
131 { 131 {
132 return Width*Height; 132 return Width*Height;
133 } 133 }
134 134
135 //! Get the optimal size according to some properties 135 //! Get the optimal size according to some properties
136 /** This is a function often used for texture dimension 136 /** This is a function often used for texture dimension
137 calculations. The function returns the next larger or 137 calculations. The function returns the next larger or
138 smaller dimension which is a power-of-two dimension 138 smaller dimension which is a power-of-two dimension
139 (2^n,2^m) and/or square (Width=Height). 139 (2^n,2^m) and/or square (Width=Height).
140 \param requirePowerOfTwo Forces the result to use only 140 \param requirePowerOfTwo Forces the result to use only
141 powers of two as values. 141 powers of two as values.
142 \param requireSquare Makes width==height in the result 142 \param requireSquare Makes width==height in the result
143 \param larger Choose whether the result is larger or 143 \param larger Choose whether the result is larger or
144 smaller than the current dimension. If one dimension 144 smaller than the current dimension. If one dimension
145 need not be changed it is kept with any value of larger. 145 need not be changed it is kept with any value of larger.
146 \param maxValue Maximum texturesize. if value > 0 size is 146 \param maxValue Maximum texturesize. if value > 0 size is
147 clamped to maxValue 147 clamped to maxValue
148 \return The optimal dimension under the given 148 \return The optimal dimension under the given
149 constraints. */ 149 constraints. */
150 dimension2d<T> getOptimalSize( 150 dimension2d<T> getOptimalSize(
151 bool requirePowerOfTwo=true, 151 bool requirePowerOfTwo=true,
152 bool requireSquare=false, 152 bool requireSquare=false,
153 bool larger=true, 153 bool larger=true,
154 u32 maxValue = 0) const 154 u32 maxValue = 0) const
155 { 155 {
156 u32 i=1; 156 u32 i=1;
157 u32 j=1; 157 u32 j=1;
158 if (requirePowerOfTwo) 158 if (requirePowerOfTwo)
159 { 159 {
160 while (i<(u32)Width) 160 while (i<(u32)Width)
161 i<<=1; 161 i<<=1;
162 if (!larger && i!=1 && i!=(u32)Width) 162 if (!larger && i!=1 && i!=(u32)Width)
163 i>>=1; 163 i>>=1;
164 while (j<(u32)Height) 164 while (j<(u32)Height)
165 j<<=1; 165 j<<=1;
166 if (!larger && j!=1 && j!=(u32)Height) 166 if (!larger && j!=1 && j!=(u32)Height)
167 j>>=1; 167 j>>=1;
168 } 168 }
169 else 169 else
170 { 170 {
171 i=(u32)Width; 171 i=(u32)Width;
172 j=(u32)Height; 172 j=(u32)Height;
173 } 173 }
174 174
175 if (requireSquare) 175 if (requireSquare)
176 { 176 {
177 if ((larger && (i>j)) || (!larger && (i<j))) 177 if ((larger && (i>j)) || (!larger && (i<j)))
178 j=i; 178 j=i;
179 else 179 else
180 i=j; 180 i=j;
181 } 181 }
182 182
183 if ( maxValue > 0 && i > maxValue) 183 if ( maxValue > 0 && i > maxValue)
184 i = maxValue; 184 i = maxValue;
185 185
186 if ( maxValue > 0 && j > maxValue) 186 if ( maxValue > 0 && j > maxValue)
187 j = maxValue; 187 j = maxValue;
188 188
189 return dimension2d<T>((T)i,(T)j); 189 return dimension2d<T>((T)i,(T)j);
190 } 190 }
191 191
192 //! Get the interpolated dimension 192 //! Get the interpolated dimension
193 /** \param other Other dimension to interpolate with. 193 /** \param other Other dimension to interpolate with.
194 \param d Value between 0.0f and 1.0f. 194 \param d Value between 0.0f and 1.0f.
195 \return Interpolated dimension. */ 195 \return Interpolated dimension. */
196 dimension2d<T> getInterpolated(const dimension2d<T>& other, f32 d) const 196 dimension2d<T> getInterpolated(const dimension2d<T>& other, f32 d) const
197 { 197 {
198 f32 inv = (1.0f - d); 198 f32 inv = (1.0f - d);
199 return dimension2d<T>( (T)(other.Width*inv + Width*d), (T)(other.Height*inv + Height*d)); 199 return dimension2d<T>( (T)(other.Width*inv + Width*d), (T)(other.Height*inv + Height*d));
200 } 200 }
201 201
202 202
203 //! Width of the dimension. 203 //! Width of the dimension.
204 T Width; 204 T Width;
205 //! Height of the dimension. 205 //! Height of the dimension.
206 T Height; 206 T Height;
207 }; 207 };
208 208
209 //! Typedef for an f32 dimension. 209 //! Typedef for an f32 dimension.
210 typedef dimension2d<f32> dimension2df; 210 typedef dimension2d<f32> dimension2df;
211 //! Typedef for an unsigned integer dimension. 211 //! Typedef for an unsigned integer dimension.
212 typedef dimension2d<u32> dimension2du; 212 typedef dimension2d<u32> dimension2du;
213 213
214 //! Typedef for an integer dimension. 214 //! Typedef for an integer dimension.
215 /** There are few cases where negative dimensions make sense. Please consider using 215 /** There are few cases where negative dimensions make sense. Please consider using
216 dimension2du instead. */ 216 dimension2du instead. */
217 typedef dimension2d<s32> dimension2di; 217 typedef dimension2d<s32> dimension2di;
218 218
219 219
220} // end namespace core 220} // end namespace core
221} // end namespace irr 221} // end namespace irr
222 222
223#endif 223#endif
224 224
diff --git a/libraries/irrlicht-1.8/include/driverChoice.h b/libraries/irrlicht-1.8/include/driverChoice.h
index d418ba8..8f17c38 100644
--- a/libraries/irrlicht-1.8/include/driverChoice.h
+++ b/libraries/irrlicht-1.8/include/driverChoice.h
@@ -1,45 +1,45 @@
1// Copyright (C) 2009-2012 Christian Stehno 1// Copyright (C) 2009-2012 Christian Stehno
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#ifndef __E_DRIVER_CHOICE_H_INCLUDED__ 5#ifndef __E_DRIVER_CHOICE_H_INCLUDED__
6#define __E_DRIVER_CHOICE_H_INCLUDED__ 6#define __E_DRIVER_CHOICE_H_INCLUDED__
7 7
8#include <iostream> 8#include <iostream>
9#include <cstdio> 9#include <cstdio>
10#include "EDriverTypes.h" 10#include "EDriverTypes.h"
11#include "irrTypes.h" 11#include "irrTypes.h"
12#include "IrrlichtDevice.h" 12#include "IrrlichtDevice.h"
13 13
14namespace irr 14namespace irr
15{ 15{
16 16
17//! ask user for driver 17//! ask user for driver
18static irr::video::E_DRIVER_TYPE driverChoiceConsole(bool allDrivers=true) 18static irr::video::E_DRIVER_TYPE driverChoiceConsole(bool allDrivers=true)
19{ 19{
20 const char* const names[] = {"NullDriver","Software Renderer","Burning's Video","Direct3D 8.1","Direct3D 9.0c","OpenGL 1.x/2.x/3.x"}; 20 const char* const names[] = {"NullDriver","Software Renderer","Burning's Video","Direct3D 8.1","Direct3D 9.0c","OpenGL 1.x/2.x/3.x"};
21 printf("Please select the driver you want:\n"); 21 printf("Please select the driver you want:\n");
22 irr::u32 i=0; 22 irr::u32 i=0;
23 for (i=irr::video::EDT_COUNT; i>0; --i) 23 for (i=irr::video::EDT_COUNT; i>0; --i)
24 { 24 {
25 if (allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1)))) 25 if (allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1))))
26 printf(" (%c) %s\n", 'a'+irr::video::EDT_COUNT-i, names[i-1]); 26 printf(" (%c) %s\n", 'a'+irr::video::EDT_COUNT-i, names[i-1]);
27 } 27 }
28 28
29 char c; 29 char c;
30 std::cin >> c; 30 std::cin >> c;
31 c = irr::video::EDT_COUNT+'a'-c; 31 c = irr::video::EDT_COUNT+'a'-c;
32 32
33 for (i=irr::video::EDT_COUNT; i>0; --i) 33 for (i=irr::video::EDT_COUNT; i>0; --i)
34 { 34 {
35 if (!(allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1))))) 35 if (!(allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1)))))
36 --c; 36 --c;
37 if ((char)i==c) 37 if ((char)i==c)
38 return irr::video::E_DRIVER_TYPE(i-1); 38 return irr::video::E_DRIVER_TYPE(i-1);
39 } 39 }
40 return irr::video::EDT_COUNT; 40 return irr::video::EDT_COUNT;
41} 41}
42 42
43} // end namespace irr 43} // end namespace irr
44 44
45#endif 45#endif
diff --git a/libraries/irrlicht-1.8/include/fast_atof.h b/libraries/irrlicht-1.8/include/fast_atof.h
index 7d4917a..d11f7b4 100644
--- a/libraries/irrlicht-1.8/include/fast_atof.h
+++ b/libraries/irrlicht-1.8/include/fast_atof.h
@@ -1,364 +1,364 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine" and the "irrXML" project. 2// This file is part of the "Irrlicht Engine" and the "irrXML" project.
3// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h 3// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
4 4
5#ifndef __FAST_ATOF_H_INCLUDED__ 5#ifndef __FAST_ATOF_H_INCLUDED__
6#define __FAST_ATOF_H_INCLUDED__ 6#define __FAST_ATOF_H_INCLUDED__
7 7
8#include "irrMath.h" 8#include "irrMath.h"
9#include "irrString.h" 9#include "irrString.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace core 13namespace core
14{ 14{
15 //! Selection of characters which count as decimal point in fast_atof 15 //! Selection of characters which count as decimal point in fast_atof
16 // TODO: This should probably also be used in irr::core::string, but the float-to-string code 16 // TODO: This should probably also be used in irr::core::string, but the float-to-string code
17 // used there has to be rewritten first. 17 // used there has to be rewritten first.
18 IRRLICHT_API extern irr::core::stringc LOCALE_DECIMAL_POINTS; 18 IRRLICHT_API extern irr::core::stringc LOCALE_DECIMAL_POINTS;
19 19
20// we write [17] here instead of [] to work around a swig bug 20// we write [17] here instead of [] to work around a swig bug
21const float fast_atof_table[17] = { 21const float fast_atof_table[17] = {
22 0.f, 22 0.f,
23 0.1f, 23 0.1f,
24 0.01f, 24 0.01f,
25 0.001f, 25 0.001f,
26 0.0001f, 26 0.0001f,
27 0.00001f, 27 0.00001f,
28 0.000001f, 28 0.000001f,
29 0.0000001f, 29 0.0000001f,
30 0.00000001f, 30 0.00000001f,
31 0.000000001f, 31 0.000000001f,
32 0.0000000001f, 32 0.0000000001f,
33 0.00000000001f, 33 0.00000000001f,
34 0.000000000001f, 34 0.000000000001f,
35 0.0000000000001f, 35 0.0000000000001f,
36 0.00000000000001f, 36 0.00000000000001f,
37 0.000000000000001f, 37 0.000000000000001f,
38 0.0000000000000001f 38 0.0000000000000001f
39}; 39};
40 40
41//! Convert a simple string of base 10 digits into an unsigned 32 bit integer. 41//! Convert a simple string of base 10 digits into an unsigned 32 bit integer.
42/** \param[in] in: The string of digits to convert. No leading chars are 42/** \param[in] in: The string of digits to convert. No leading chars are
43 allowed, only digits 0 to 9. Parsing stops at the first non-digit. 43 allowed, only digits 0 to 9. Parsing stops at the first non-digit.
44 \param[out] out: (optional) If provided, it will be set to point at the 44 \param[out] out: (optional) If provided, it will be set to point at the
45 first character not used in the calculation. 45 first character not used in the calculation.
46 \return The unsigned integer value of the digits. If the string specifies 46 \return The unsigned integer value of the digits. If the string specifies
47 too many digits to encode in an u32 then INT_MAX will be returned. 47 too many digits to encode in an u32 then INT_MAX will be returned.
48*/ 48*/
49inline u32 strtoul10(const char* in, const char** out=0) 49inline u32 strtoul10(const char* in, const char** out=0)
50{ 50{
51 if (!in) 51 if (!in)
52 { 52 {
53 if (out) 53 if (out)
54 *out = in; 54 *out = in;
55 return 0; 55 return 0;
56 } 56 }
57 57
58 bool overflow=false; 58 bool overflow=false;
59 u32 unsignedValue = 0; 59 u32 unsignedValue = 0;
60 while ( ( *in >= '0') && ( *in <= '9' )) 60 while ( ( *in >= '0') && ( *in <= '9' ))
61 { 61 {
62 const u32 tmp = ( unsignedValue * 10 ) + ( *in - '0' ); 62 const u32 tmp = ( unsignedValue * 10 ) + ( *in - '0' );
63 if (tmp<unsignedValue) 63 if (tmp<unsignedValue)
64 { 64 {
65 unsignedValue=(u32)0xffffffff; 65 unsignedValue=(u32)0xffffffff;
66 overflow=true; 66 overflow=true;
67 } 67 }
68 if (!overflow) 68 if (!overflow)
69 unsignedValue = tmp; 69 unsignedValue = tmp;
70 ++in; 70 ++in;
71 } 71 }
72 72
73 if (out) 73 if (out)
74 *out = in; 74 *out = in;
75 75
76 return unsignedValue; 76 return unsignedValue;
77} 77}
78 78
79//! Convert a simple string of base 10 digits into a signed 32 bit integer. 79//! Convert a simple string of base 10 digits into a signed 32 bit integer.
80/** \param[in] in: The string of digits to convert. Only a leading - or + 80/** \param[in] in: The string of digits to convert. Only a leading - or +
81 followed by digits 0 to 9 will be considered. Parsing stops at the first 81 followed by digits 0 to 9 will be considered. Parsing stops at the first
82 non-digit. 82 non-digit.
83 \param[out] out: (optional) If provided, it will be set to point at the 83 \param[out] out: (optional) If provided, it will be set to point at the
84 first character not used in the calculation. 84 first character not used in the calculation.
85 \return The signed integer value of the digits. If the string specifies 85 \return The signed integer value of the digits. If the string specifies
86 too many digits to encode in an s32 then +INT_MAX or -INT_MAX will be 86 too many digits to encode in an s32 then +INT_MAX or -INT_MAX will be
87 returned. 87 returned.
88*/ 88*/
89inline s32 strtol10(const char* in, const char** out=0) 89inline s32 strtol10(const char* in, const char** out=0)
90{ 90{
91 if (!in) 91 if (!in)
92 { 92 {
93 if (out) 93 if (out)
94 *out = in; 94 *out = in;
95 return 0; 95 return 0;
96 } 96 }
97 97
98 const bool negative = ('-' == *in); 98 const bool negative = ('-' == *in);
99 if (negative || ('+' == *in)) 99 if (negative || ('+' == *in))
100 ++in; 100 ++in;
101 101
102 const u32 unsignedValue = strtoul10(in,out); 102 const u32 unsignedValue = strtoul10(in,out);
103 if (unsignedValue > (u32)INT_MAX) 103 if (unsignedValue > (u32)INT_MAX)
104 { 104 {
105 if (negative) 105 if (negative)
106 return (s32)INT_MIN; 106 return (s32)INT_MIN;
107 else 107 else
108 return (s32)INT_MAX; 108 return (s32)INT_MAX;
109 } 109 }
110 else 110 else
111 { 111 {
112 if (negative) 112 if (negative)
113 return -((s32)unsignedValue); 113 return -((s32)unsignedValue);
114 else 114 else
115 return (s32)unsignedValue; 115 return (s32)unsignedValue;
116 } 116 }
117} 117}
118 118
119//! Convert a hex-encoded character to an unsigned integer. 119//! Convert a hex-encoded character to an unsigned integer.
120/** \param[in] in The digit to convert. Only digits 0 to 9 and chars A-F,a-f 120/** \param[in] in The digit to convert. Only digits 0 to 9 and chars A-F,a-f
121 will be considered. 121 will be considered.
122 \return The unsigned integer value of the digit. 0xffffffff if the input is 122 \return The unsigned integer value of the digit. 0xffffffff if the input is
123 not hex 123 not hex
124*/ 124*/
125inline u32 ctoul16(char in) 125inline u32 ctoul16(char in)
126{ 126{
127 if (in >= '0' && in <= '9') 127 if (in >= '0' && in <= '9')
128 return in - '0'; 128 return in - '0';
129 else if (in >= 'a' && in <= 'f') 129 else if (in >= 'a' && in <= 'f')
130 return 10u + in - 'a'; 130 return 10u + in - 'a';
131 else if (in >= 'A' && in <= 'F') 131 else if (in >= 'A' && in <= 'F')
132 return 10u + in - 'A'; 132 return 10u + in - 'A';
133 else 133 else
134 return 0xffffffff; 134 return 0xffffffff;
135} 135}
136 136
137//! Convert a simple string of base 16 digits into an unsigned 32 bit integer. 137//! Convert a simple string of base 16 digits into an unsigned 32 bit integer.
138/** \param[in] in: The string of digits to convert. No leading chars are 138/** \param[in] in: The string of digits to convert. No leading chars are
139 allowed, only digits 0 to 9 and chars A-F,a-f are allowed. Parsing stops 139 allowed, only digits 0 to 9 and chars A-F,a-f are allowed. Parsing stops
140 at the first illegal char. 140 at the first illegal char.
141 \param[out] out: (optional) If provided, it will be set to point at the 141 \param[out] out: (optional) If provided, it will be set to point at the
142 first character not used in the calculation. 142 first character not used in the calculation.
143 \return The unsigned integer value of the digits. If the string specifies 143 \return The unsigned integer value of the digits. If the string specifies
144 too many digits to encode in an u32 then INT_MAX will be returned. 144 too many digits to encode in an u32 then INT_MAX will be returned.
145*/ 145*/
146inline u32 strtoul16(const char* in, const char** out=0) 146inline u32 strtoul16(const char* in, const char** out=0)
147{ 147{
148 if (!in) 148 if (!in)
149 { 149 {
150 if (out) 150 if (out)
151 *out = in; 151 *out = in;
152 return 0; 152 return 0;
153 } 153 }
154 154
155 bool overflow=false; 155 bool overflow=false;
156 u32 unsignedValue = 0; 156 u32 unsignedValue = 0;
157 while (true) 157 while (true)
158 { 158 {
159 u32 tmp = 0; 159 u32 tmp = 0;
160 if ((*in >= '0') && (*in <= '9')) 160 if ((*in >= '0') && (*in <= '9'))
161 tmp = (unsignedValue << 4u) + (*in - '0'); 161 tmp = (unsignedValue << 4u) + (*in - '0');
162 else if ((*in >= 'A') && (*in <= 'F')) 162 else if ((*in >= 'A') && (*in <= 'F'))
163 tmp = (unsignedValue << 4u) + (*in - 'A') + 10; 163 tmp = (unsignedValue << 4u) + (*in - 'A') + 10;
164 else if ((*in >= 'a') && (*in <= 'f')) 164 else if ((*in >= 'a') && (*in <= 'f'))
165 tmp = (unsignedValue << 4u) + (*in - 'a') + 10; 165 tmp = (unsignedValue << 4u) + (*in - 'a') + 10;
166 else 166 else
167 break; 167 break;
168 if (tmp<unsignedValue) 168 if (tmp<unsignedValue)
169 { 169 {
170 unsignedValue=(u32)INT_MAX; 170 unsignedValue=(u32)INT_MAX;
171 overflow=true; 171 overflow=true;
172 } 172 }
173 if (!overflow) 173 if (!overflow)
174 unsignedValue = tmp; 174 unsignedValue = tmp;
175 ++in; 175 ++in;
176 } 176 }
177 177
178 if (out) 178 if (out)
179 *out = in; 179 *out = in;
180 180
181 return unsignedValue; 181 return unsignedValue;
182} 182}
183 183
184//! Convert a simple string of base 8 digits into an unsigned 32 bit integer. 184//! Convert a simple string of base 8 digits into an unsigned 32 bit integer.
185/** \param[in] in The string of digits to convert. No leading chars are 185/** \param[in] in The string of digits to convert. No leading chars are
186 allowed, only digits 0 to 7 are allowed. Parsing stops at the first illegal 186 allowed, only digits 0 to 7 are allowed. Parsing stops at the first illegal
187 char. 187 char.
188 \param[out] out (optional) If provided, it will be set to point at the 188 \param[out] out (optional) If provided, it will be set to point at the
189 first character not used in the calculation. 189 first character not used in the calculation.
190 \return The unsigned integer value of the digits. If the string specifies 190 \return The unsigned integer value of the digits. If the string specifies
191 too many digits to encode in an u32 then INT_MAX will be returned. 191 too many digits to encode in an u32 then INT_MAX will be returned.
192*/ 192*/
193inline u32 strtoul8(const char* in, const char** out=0) 193inline u32 strtoul8(const char* in, const char** out=0)
194{ 194{
195 if (!in) 195 if (!in)
196 { 196 {
197 if (out) 197 if (out)
198 *out = in; 198 *out = in;
199 return 0; 199 return 0;
200 } 200 }
201 201
202 bool overflow=false; 202 bool overflow=false;
203 u32 unsignedValue = 0; 203 u32 unsignedValue = 0;
204 while (true) 204 while (true)
205 { 205 {
206 u32 tmp = 0; 206 u32 tmp = 0;
207 if ((*in >= '0') && (*in <= '7')) 207 if ((*in >= '0') && (*in <= '7'))
208 tmp = (unsignedValue << 3u) + (*in - '0'); 208 tmp = (unsignedValue << 3u) + (*in - '0');
209 else 209 else
210 break; 210 break;
211 if (tmp<unsignedValue) 211 if (tmp<unsignedValue)
212 { 212 {
213 unsignedValue=(u32)INT_MAX; 213 unsignedValue=(u32)INT_MAX;
214 overflow=true; 214 overflow=true;
215 } 215 }
216 if (!overflow) 216 if (!overflow)
217 unsignedValue = tmp; 217 unsignedValue = tmp;
218 ++in; 218 ++in;
219 } 219 }
220 220
221 if (out) 221 if (out)
222 *out = in; 222 *out = in;
223 223
224 return unsignedValue; 224 return unsignedValue;
225} 225}
226 226
227//! Convert a C-style prefixed string (hex, oct, integer) into an unsigned 32 bit integer. 227//! Convert a C-style prefixed string (hex, oct, integer) into an unsigned 32 bit integer.
228/** \param[in] in The string of digits to convert. If string starts with 0x the 228/** \param[in] in The string of digits to convert. If string starts with 0x the
229 hex parser is used, if only leading 0 is used, oct parser is used. In all 229 hex parser is used, if only leading 0 is used, oct parser is used. In all
230 other cases, the usual unsigned parser is used. 230 other cases, the usual unsigned parser is used.
231 \param[out] out (optional) If provided, it will be set to point at the 231 \param[out] out (optional) If provided, it will be set to point at the
232 first character not used in the calculation. 232 first character not used in the calculation.
233 \return The unsigned integer value of the digits. If the string specifies 233 \return The unsigned integer value of the digits. If the string specifies
234 too many digits to encode in an u32 then INT_MAX will be returned. 234 too many digits to encode in an u32 then INT_MAX will be returned.
235*/ 235*/
236inline u32 strtoul_prefix(const char* in, const char** out=0) 236inline u32 strtoul_prefix(const char* in, const char** out=0)
237{ 237{
238 if (!in) 238 if (!in)
239 { 239 {
240 if (out) 240 if (out)
241 *out = in; 241 *out = in;
242 return 0; 242 return 0;
243 } 243 }
244 if ('0'==in[0]) 244 if ('0'==in[0])
245 return ('x'==in[1] ? strtoul16(in+2,out) : strtoul8(in+1,out)); 245 return ('x'==in[1] ? strtoul16(in+2,out) : strtoul8(in+1,out));
246 return strtoul10(in,out); 246 return strtoul10(in,out);
247} 247}
248 248
249//! Converts a sequence of digits into a whole positive floating point value. 249//! Converts a sequence of digits into a whole positive floating point value.
250/** Only digits 0 to 9 are parsed. Parsing stops at any other character, 250/** Only digits 0 to 9 are parsed. Parsing stops at any other character,
251 including sign characters or a decimal point. 251 including sign characters or a decimal point.
252 \param in: the sequence of digits to convert. 252 \param in: the sequence of digits to convert.
253 \param out: (optional) will be set to point at the first non-converted 253 \param out: (optional) will be set to point at the first non-converted
254 character. 254 character.
255 \return The whole positive floating point representation of the digit 255 \return The whole positive floating point representation of the digit
256 sequence. 256 sequence.
257*/ 257*/
258inline f32 strtof10(const char* in, const char** out = 0) 258inline f32 strtof10(const char* in, const char** out = 0)
259{ 259{
260 if (!in) 260 if (!in)
261 { 261 {
262 if (out) 262 if (out)
263 *out = in; 263 *out = in;
264 return 0.f; 264 return 0.f;
265 } 265 }
266 266
267 const u32 MAX_SAFE_U32_VALUE = UINT_MAX / 10 - 10; 267 const u32 MAX_SAFE_U32_VALUE = UINT_MAX / 10 - 10;
268 u32 intValue = 0; 268 u32 intValue = 0;
269 269
270 // Use integer arithmetic for as long as possible, for speed 270 // Use integer arithmetic for as long as possible, for speed
271 // and precision. 271 // and precision.
272 while ( ( *in >= '0') && ( *in <= '9' ) ) 272 while ( ( *in >= '0') && ( *in <= '9' ) )
273 { 273 {
274 // If it looks like we're going to overflow, bail out 274 // If it looks like we're going to overflow, bail out
275 // now and start using floating point. 275 // now and start using floating point.
276 if (intValue >= MAX_SAFE_U32_VALUE) 276 if (intValue >= MAX_SAFE_U32_VALUE)
277 break; 277 break;
278 278
279 intValue = (intValue * 10) + (*in - '0'); 279 intValue = (intValue * 10) + (*in - '0');
280 ++in; 280 ++in;
281 } 281 }
282 282
283 f32 floatValue = (f32)intValue; 283 f32 floatValue = (f32)intValue;
284 284
285 // If there are any digits left to parse, then we need to use 285 // If there are any digits left to parse, then we need to use
286 // floating point arithmetic from here. 286 // floating point arithmetic from here.
287 while ( ( *in >= '0') && ( *in <= '9' ) ) 287 while ( ( *in >= '0') && ( *in <= '9' ) )
288 { 288 {
289 floatValue = (floatValue * 10.f) + (f32)(*in - '0'); 289 floatValue = (floatValue * 10.f) + (f32)(*in - '0');
290 ++in; 290 ++in;
291 if (floatValue > FLT_MAX) // Just give up. 291 if (floatValue > FLT_MAX) // Just give up.
292 break; 292 break;
293 } 293 }
294 294
295 if (out) 295 if (out)
296 *out = in; 296 *out = in;
297 297
298 return floatValue; 298 return floatValue;
299} 299}
300 300
301//! Provides a fast function for converting a string into a float. 301//! Provides a fast function for converting a string into a float.
302/** This is not guaranteed to be as accurate as atof(), but is 302/** This is not guaranteed to be as accurate as atof(), but is
303 approximately 6 to 8 times as fast. 303 approximately 6 to 8 times as fast.
304 \param[in] in The string to convert. 304 \param[in] in The string to convert.
305 \param[out] result The resultant float will be written here. 305 \param[out] result The resultant float will be written here.
306 \return Pointer to the first character in the string that wasn't used 306 \return Pointer to the first character in the string that wasn't used
307 to create the float value. 307 to create the float value.
308*/ 308*/
309inline const char* fast_atof_move(const char* in, f32& result) 309inline const char* fast_atof_move(const char* in, f32& result)
310{ 310{
311 // Please run the regression test when making any modifications to this function. 311 // Please run the regression test when making any modifications to this function.
312 312
313 result = 0.f; 313 result = 0.f;
314 if (!in) 314 if (!in)
315 return 0; 315 return 0;
316 316
317 const bool negative = ('-' == *in); 317 const bool negative = ('-' == *in);
318 if (negative || ('+'==*in)) 318 if (negative || ('+'==*in))
319 ++in; 319 ++in;
320 320
321 f32 value = strtof10(in, &in); 321 f32 value = strtof10(in, &in);
322 322
323 if ( LOCALE_DECIMAL_POINTS.findFirst(*in) >= 0 ) 323 if ( LOCALE_DECIMAL_POINTS.findFirst(*in) >= 0 )
324 { 324 {
325 const char* afterDecimal = ++in; 325 const char* afterDecimal = ++in;
326 const f32 decimal = strtof10(in, &afterDecimal); 326 const f32 decimal = strtof10(in, &afterDecimal);
327 value += decimal * fast_atof_table[afterDecimal - in]; 327 value += decimal * fast_atof_table[afterDecimal - in];
328 in = afterDecimal; 328 in = afterDecimal;
329 } 329 }
330 330
331 if ('e' == *in || 'E' == *in) 331 if ('e' == *in || 'E' == *in)
332 { 332 {
333 ++in; 333 ++in;
334 // Assume that the exponent is a whole number. 334 // Assume that the exponent is a whole number.
335 // strtol10() will deal with both + and - signs, 335 // strtol10() will deal with both + and - signs,
336 // but calculate as f32 to prevent overflow at FLT_MAX 336 // but calculate as f32 to prevent overflow at FLT_MAX
337 value *= powf(10.f, (f32)strtol10(in, &in)); 337 value *= powf(10.f, (f32)strtol10(in, &in));
338 } 338 }
339 339
340 result = negative?-value:value; 340 result = negative?-value:value;
341 return in; 341 return in;
342} 342}
343 343
344//! Convert a string to a floating point number 344//! Convert a string to a floating point number
345/** \param floatAsString The string to convert. 345/** \param floatAsString The string to convert.
346 \param out Optional pointer to the first character in the string that 346 \param out Optional pointer to the first character in the string that
347 wasn't used to create the float value. 347 wasn't used to create the float value.
348 \result Float value parsed from the input string 348 \result Float value parsed from the input string
349*/ 349*/
350inline float fast_atof(const char* floatAsString, const char** out=0) 350inline float fast_atof(const char* floatAsString, const char** out=0)
351{ 351{
352 float ret; 352 float ret;
353 if (out) 353 if (out)
354 *out=fast_atof_move(floatAsString, ret); 354 *out=fast_atof_move(floatAsString, ret);
355 else 355 else
356 fast_atof_move(floatAsString, ret); 356 fast_atof_move(floatAsString, ret);
357 return ret; 357 return ret;
358} 358}
359 359
360} // end namespace core 360} // end namespace core
361} // end namespace irr 361} // end namespace irr
362 362
363#endif 363#endif
364 364
diff --git a/libraries/irrlicht-1.8/include/heapsort.h b/libraries/irrlicht-1.8/include/heapsort.h
index 6f87665..a2e2c38 100644
--- a/libraries/irrlicht-1.8/include/heapsort.h
+++ b/libraries/irrlicht-1.8/include/heapsort.h
@@ -1,70 +1,70 @@
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#ifndef __IRR_HEAPSORT_H_INCLUDED__ 5#ifndef __IRR_HEAPSORT_H_INCLUDED__
6#define __IRR_HEAPSORT_H_INCLUDED__ 6#define __IRR_HEAPSORT_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace core 12namespace core
13{ 13{
14 14
15//! Sinks an element into the heap. 15//! Sinks an element into the heap.
16template<class T> 16template<class T>
17inline void heapsink(T*array, s32 element, s32 max) 17inline void heapsink(T*array, s32 element, s32 max)
18{ 18{
19 while ((element<<1) < max) // there is a left child 19 while ((element<<1) < max) // there is a left child
20 { 20 {
21 s32 j = (element<<1); 21 s32 j = (element<<1);
22 22
23 if (j+1 < max && array[j] < array[j+1]) 23 if (j+1 < max && array[j] < array[j+1])
24 j = j+1; // take right child 24 j = j+1; // take right child
25 25
26 if (array[element] < array[j]) 26 if (array[element] < array[j])
27 { 27 {
28 T t = array[j]; // swap elements 28 T t = array[j]; // swap elements
29 array[j] = array[element]; 29 array[j] = array[element];
30 array[element] = t; 30 array[element] = t;
31 element = j; 31 element = j;
32 } 32 }
33 else 33 else
34 return; 34 return;
35 } 35 }
36} 36}
37 37
38 38
39//! Sorts an array with size 'size' using heapsort. 39//! Sorts an array with size 'size' using heapsort.
40template<class T> 40template<class T>
41inline void heapsort(T* array_, s32 size) 41inline void heapsort(T* array_, s32 size)
42{ 42{
43 // for heapsink we pretent this is not c++, where 43 // for heapsink we pretent this is not c++, where
44 // arrays start with index 0. So we decrease the array pointer, 44 // arrays start with index 0. So we decrease the array pointer,
45 // the maximum always +2 and the element always +1 45 // the maximum always +2 and the element always +1
46 46
47 T* virtualArray = array_ - 1; 47 T* virtualArray = array_ - 1;
48 s32 virtualSize = size + 2; 48 s32 virtualSize = size + 2;
49 s32 i; 49 s32 i;
50 50
51 // build heap 51 // build heap
52 52
53 for (i=((size-1)/2); i>=0; --i) 53 for (i=((size-1)/2); i>=0; --i)
54 heapsink(virtualArray, i+1, virtualSize-1); 54 heapsink(virtualArray, i+1, virtualSize-1);
55 55
56 // sort array, leave out the last element (0) 56 // sort array, leave out the last element (0)
57 for (i=size-1; i>0; --i) 57 for (i=size-1; i>0; --i)
58 { 58 {
59 T t = array_[0]; 59 T t = array_[0];
60 array_[0] = array_[i]; 60 array_[0] = array_[i];
61 array_[i] = t; 61 array_[i] = t;
62 heapsink(virtualArray, 1, i + 1); 62 heapsink(virtualArray, 1, i + 1);
63 } 63 }
64} 64}
65 65
66} // end namespace core 66} // end namespace core
67} // end namespace irr 67} // end namespace irr
68 68
69#endif 69#endif
70 70
diff --git a/libraries/irrlicht-1.8/include/irrAllocator.h b/libraries/irrlicht-1.8/include/irrAllocator.h
index 648c410..8a80359 100644
--- a/libraries/irrlicht-1.8/include/irrAllocator.h
+++ b/libraries/irrlicht-1.8/include/irrAllocator.h
@@ -1,124 +1,124 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine" and the "irrXML" project. 2// This file is part of the "Irrlicht Engine" and the "irrXML" project.
3// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h 3// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
4 4
5#ifndef __IRR_ALLOCATOR_H_INCLUDED__ 5#ifndef __IRR_ALLOCATOR_H_INCLUDED__
6#define __IRR_ALLOCATOR_H_INCLUDED__ 6#define __IRR_ALLOCATOR_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include <new> 9#include <new>
10// necessary for older compilers 10// necessary for older compilers
11#include <memory.h> 11#include <memory.h>
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace core 15namespace core
16{ 16{
17 17
18#ifdef DEBUG_CLIENTBLOCK 18#ifdef DEBUG_CLIENTBLOCK
19#undef DEBUG_CLIENTBLOCK 19#undef DEBUG_CLIENTBLOCK
20#define DEBUG_CLIENTBLOCK new 20#define DEBUG_CLIENTBLOCK new
21#endif 21#endif
22 22
23//! Very simple allocator implementation, containers using it can be used across dll boundaries 23//! Very simple allocator implementation, containers using it can be used across dll boundaries
24template<typename T> 24template<typename T>
25class irrAllocator 25class irrAllocator
26{ 26{
27public: 27public:
28 28
29 //! Destructor 29 //! Destructor
30 virtual ~irrAllocator() {} 30 virtual ~irrAllocator() {}
31 31
32 //! Allocate memory for an array of objects 32 //! Allocate memory for an array of objects
33 T* allocate(size_t cnt) 33 T* allocate(size_t cnt)
34 { 34 {
35 return (T*)internal_new(cnt* sizeof(T)); 35 return (T*)internal_new(cnt* sizeof(T));
36 } 36 }
37 37
38 //! Deallocate memory for an array of objects 38 //! Deallocate memory for an array of objects
39 void deallocate(T* ptr) 39 void deallocate(T* ptr)
40 { 40 {
41 internal_delete(ptr); 41 internal_delete(ptr);
42 } 42 }
43 43
44 //! Construct an element 44 //! Construct an element
45 void construct(T* ptr, const T&e) 45 void construct(T* ptr, const T&e)
46 { 46 {
47 new ((void*)ptr) T(e); 47 new ((void*)ptr) T(e);
48 } 48 }
49 49
50 //! Destruct an element 50 //! Destruct an element
51 void destruct(T* ptr) 51 void destruct(T* ptr)
52 { 52 {
53 ptr->~T(); 53 ptr->~T();
54 } 54 }
55 55
56protected: 56protected:
57 57
58 virtual void* internal_new(size_t cnt) 58 virtual void* internal_new(size_t cnt)
59 { 59 {
60 return operator new(cnt); 60 return operator new(cnt);
61 } 61 }
62 62
63 virtual void internal_delete(void* ptr) 63 virtual void internal_delete(void* ptr)
64 { 64 {
65 operator delete(ptr); 65 operator delete(ptr);
66 } 66 }
67 67
68}; 68};
69 69
70 70
71//! Fast allocator, only to be used in containers inside the same memory heap. 71//! Fast allocator, only to be used in containers inside the same memory heap.
72/** Containers using it are NOT able to be used it across dll boundaries. Use this 72/** Containers using it are NOT able to be used it across dll boundaries. Use this
73when using in an internal class or function or when compiled into a static lib */ 73when using in an internal class or function or when compiled into a static lib */
74template<typename T> 74template<typename T>
75class irrAllocatorFast 75class irrAllocatorFast
76{ 76{
77public: 77public:
78 78
79 //! Allocate memory for an array of objects 79 //! Allocate memory for an array of objects
80 T* allocate(size_t cnt) 80 T* allocate(size_t cnt)
81 { 81 {
82 return (T*)operator new(cnt* sizeof(T)); 82 return (T*)operator new(cnt* sizeof(T));
83 } 83 }
84 84
85 //! Deallocate memory for an array of objects 85 //! Deallocate memory for an array of objects
86 void deallocate(T* ptr) 86 void deallocate(T* ptr)
87 { 87 {
88 operator delete(ptr); 88 operator delete(ptr);
89 } 89 }
90 90
91 //! Construct an element 91 //! Construct an element
92 void construct(T* ptr, const T&e) 92 void construct(T* ptr, const T&e)
93 { 93 {
94 new ((void*)ptr) T(e); 94 new ((void*)ptr) T(e);
95 } 95 }
96 96
97 //! Destruct an element 97 //! Destruct an element
98 void destruct(T* ptr) 98 void destruct(T* ptr)
99 { 99 {
100 ptr->~T(); 100 ptr->~T();
101 } 101 }
102}; 102};
103 103
104 104
105 105
106#ifdef DEBUG_CLIENTBLOCK 106#ifdef DEBUG_CLIENTBLOCK
107#undef DEBUG_CLIENTBLOCK 107#undef DEBUG_CLIENTBLOCK
108#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__) 108#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
109#endif 109#endif
110 110
111//! defines an allocation strategy 111//! defines an allocation strategy
112enum eAllocStrategy 112enum eAllocStrategy
113{ 113{
114 ALLOC_STRATEGY_SAFE = 0, 114 ALLOC_STRATEGY_SAFE = 0,
115 ALLOC_STRATEGY_DOUBLE = 1, 115 ALLOC_STRATEGY_DOUBLE = 1,
116 ALLOC_STRATEGY_SQRT = 2 116 ALLOC_STRATEGY_SQRT = 2
117}; 117};
118 118
119 119
120} // end namespace core 120} // end namespace core
121} // end namespace irr 121} // end namespace irr
122 122
123#endif 123#endif
124 124
diff --git a/libraries/irrlicht-1.8/include/irrArray.h b/libraries/irrlicht-1.8/include/irrArray.h
index 7dab593..f9d338d 100644
--- a/libraries/irrlicht-1.8/include/irrArray.h
+++ b/libraries/irrlicht-1.8/include/irrArray.h
@@ -1,627 +1,627 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine" and the "irrXML" project. 2// This file is part of the "Irrlicht Engine" and the "irrXML" project.
3// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h 3// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
4 4
5#ifndef __IRR_ARRAY_H_INCLUDED__ 5#ifndef __IRR_ARRAY_H_INCLUDED__
6#define __IRR_ARRAY_H_INCLUDED__ 6#define __IRR_ARRAY_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include "heapsort.h" 9#include "heapsort.h"
10#include "irrAllocator.h" 10#include "irrAllocator.h"
11#include "irrMath.h" 11#include "irrMath.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace core 15namespace core
16{ 16{
17 17
18//! Self reallocating template array (like stl vector) with additional features. 18//! Self reallocating template array (like stl vector) with additional features.
19/** Some features are: Heap sorting, binary search methods, easier debugging. 19/** Some features are: Heap sorting, binary search methods, easier debugging.
20*/ 20*/
21template <class T, typename TAlloc = irrAllocator<T> > 21template <class T, typename TAlloc = irrAllocator<T> >
22class array 22class array
23{ 23{
24 24
25public: 25public:
26 26
27 //! Default constructor for empty array. 27 //! Default constructor for empty array.
28 array() 28 array()
29 : data(0), allocated(0), used(0), 29 : data(0), allocated(0), used(0),
30 strategy(ALLOC_STRATEGY_DOUBLE), free_when_destroyed(true), is_sorted(true) 30 strategy(ALLOC_STRATEGY_DOUBLE), free_when_destroyed(true), is_sorted(true)
31 { 31 {
32 } 32 }
33 33
34 34
35 //! Constructs an array and allocates an initial chunk of memory. 35 //! Constructs an array and allocates an initial chunk of memory.
36 /** \param start_count Amount of elements to pre-allocate. */ 36 /** \param start_count Amount of elements to pre-allocate. */
37 array(u32 start_count) 37 array(u32 start_count)
38 : data(0), allocated(0), used(0), 38 : data(0), allocated(0), used(0),
39 strategy(ALLOC_STRATEGY_DOUBLE), free_when_destroyed(true), is_sorted(true) 39 strategy(ALLOC_STRATEGY_DOUBLE), free_when_destroyed(true), is_sorted(true)
40 { 40 {
41 reallocate(start_count); 41 reallocate(start_count);
42 } 42 }
43 43
44 44
45 //! Copy constructor 45 //! Copy constructor
46 array(const array<T, TAlloc>& other) : data(0) 46 array(const array<T, TAlloc>& other) : data(0)
47 { 47 {
48 *this = other; 48 *this = other;
49 } 49 }
50 50
51 51
52 //! Destructor. 52 //! Destructor.
53 /** Frees allocated memory, if set_free_when_destroyed was not set to 53 /** Frees allocated memory, if set_free_when_destroyed was not set to
54 false by the user before. */ 54 false by the user before. */
55 ~array() 55 ~array()
56 { 56 {
57 clear(); 57 clear();
58 } 58 }
59 59
60 60
61 //! Reallocates the array, make it bigger or smaller. 61 //! Reallocates the array, make it bigger or smaller.
62 /** \param new_size New size of array. 62 /** \param new_size New size of array.
63 \param canShrink Specifies whether the array is reallocated even if 63 \param canShrink Specifies whether the array is reallocated even if
64 enough space is available. Setting this flag to false can speed up 64 enough space is available. Setting this flag to false can speed up
65 array usage, but may use more memory than required by the data. 65 array usage, but may use more memory than required by the data.
66 */ 66 */
67 void reallocate(u32 new_size, bool canShrink=true) 67 void reallocate(u32 new_size, bool canShrink=true)
68 { 68 {
69 if (allocated==new_size) 69 if (allocated==new_size)
70 return; 70 return;
71 if (!canShrink && (new_size < allocated)) 71 if (!canShrink && (new_size < allocated))
72 return; 72 return;
73 73
74 T* old_data = data; 74 T* old_data = data;
75 75
76 data = allocator.allocate(new_size); //new T[new_size]; 76 data = allocator.allocate(new_size); //new T[new_size];
77 allocated = new_size; 77 allocated = new_size;
78 78
79 // copy old data 79 // copy old data
80 s32 end = used < new_size ? used : new_size; 80 s32 end = used < new_size ? used : new_size;
81 81
82 for (s32 i=0; i<end; ++i) 82 for (s32 i=0; i<end; ++i)
83 { 83 {
84 // data[i] = old_data[i]; 84 // data[i] = old_data[i];
85 allocator.construct(&data[i], old_data[i]); 85 allocator.construct(&data[i], old_data[i]);
86 } 86 }
87 87
88 // destruct old data 88 // destruct old data
89 for (u32 j=0; j<used; ++j) 89 for (u32 j=0; j<used; ++j)
90 allocator.destruct(&old_data[j]); 90 allocator.destruct(&old_data[j]);
91 91
92 if (allocated < used) 92 if (allocated < used)
93 used = allocated; 93 used = allocated;
94 94
95 allocator.deallocate(old_data); //delete [] old_data; 95 allocator.deallocate(old_data); //delete [] old_data;
96 } 96 }
97 97
98 98
99 //! set a new allocation strategy 99 //! set a new allocation strategy
100 /** if the maximum size of the array is unknown, you can define how big the 100 /** if the maximum size of the array is unknown, you can define how big the
101 allocation should happen. 101 allocation should happen.
102 \param newStrategy New strategy to apply to this array. */ 102 \param newStrategy New strategy to apply to this array. */
103 void setAllocStrategy ( eAllocStrategy newStrategy = ALLOC_STRATEGY_DOUBLE ) 103 void setAllocStrategy ( eAllocStrategy newStrategy = ALLOC_STRATEGY_DOUBLE )
104 { 104 {
105 strategy = newStrategy; 105 strategy = newStrategy;
106 } 106 }
107 107
108 108
109 //! Adds an element at back of array. 109 //! Adds an element at back of array.
110 /** If the array is too small to add this new element it is made bigger. 110 /** If the array is too small to add this new element it is made bigger.
111 \param element: Element to add at the back of the array. */ 111 \param element: Element to add at the back of the array. */
112 void push_back(const T& element) 112 void push_back(const T& element)
113 { 113 {
114 insert(element, used); 114 insert(element, used);
115 } 115 }
116 116
117 117
118 //! Adds an element at the front of the array. 118 //! Adds an element at the front of the array.
119 /** If the array is to small to add this new element, the array is 119 /** If the array is to small to add this new element, the array is
120 made bigger. Please note that this is slow, because the whole array 120 made bigger. Please note that this is slow, because the whole array
121 needs to be copied for this. 121 needs to be copied for this.
122 \param element Element to add at the back of the array. */ 122 \param element Element to add at the back of the array. */
123 void push_front(const T& element) 123 void push_front(const T& element)
124 { 124 {
125 insert(element); 125 insert(element);
126 } 126 }
127 127
128 128
129 //! Insert item into array at specified position. 129 //! Insert item into array at specified position.
130 /** Please use this only if you know what you are doing (possible 130 /** Please use this only if you know what you are doing (possible
131 performance loss). The preferred method of adding elements should be 131 performance loss). The preferred method of adding elements should be
132 push_back(). 132 push_back().
133 \param element: Element to be inserted 133 \param element: Element to be inserted
134 \param index: Where position to insert the new element. */ 134 \param index: Where position to insert the new element. */
135 void insert(const T& element, u32 index=0) 135 void insert(const T& element, u32 index=0)
136 { 136 {
137 _IRR_DEBUG_BREAK_IF(index>used) // access violation 137 _IRR_DEBUG_BREAK_IF(index>used) // access violation
138 138
139 if (used + 1 > allocated) 139 if (used + 1 > allocated)
140 { 140 {
141 // this doesn't work if the element is in the same 141 // this doesn't work if the element is in the same
142 // array. So we'll copy the element first to be sure 142 // array. So we'll copy the element first to be sure
143 // we'll get no data corruption 143 // we'll get no data corruption
144 const T e(element); 144 const T e(element);
145 145
146 // increase data block 146 // increase data block
147 u32 newAlloc; 147 u32 newAlloc;
148 switch ( strategy ) 148 switch ( strategy )
149 { 149 {
150 case ALLOC_STRATEGY_DOUBLE: 150 case ALLOC_STRATEGY_DOUBLE:
151 newAlloc = used + 1 + (allocated < 500 ? 151 newAlloc = used + 1 + (allocated < 500 ?
152 (allocated < 5 ? 5 : used) : used >> 2); 152 (allocated < 5 ? 5 : used) : used >> 2);
153 break; 153 break;
154 default: 154 default:
155 case ALLOC_STRATEGY_SAFE: 155 case ALLOC_STRATEGY_SAFE:
156 newAlloc = used + 1; 156 newAlloc = used + 1;
157 break; 157 break;
158 } 158 }
159 reallocate( newAlloc); 159 reallocate( newAlloc);
160 160
161 // move array content and construct new element 161 // move array content and construct new element
162 // first move end one up 162 // first move end one up
163 for (u32 i=used; i>index; --i) 163 for (u32 i=used; i>index; --i)
164 { 164 {
165 if (i<used) 165 if (i<used)
166 allocator.destruct(&data[i]); 166 allocator.destruct(&data[i]);
167 allocator.construct(&data[i], data[i-1]); // data[i] = data[i-1]; 167 allocator.construct(&data[i], data[i-1]); // data[i] = data[i-1];
168 } 168 }
169 // then add new element 169 // then add new element
170 if (used > index) 170 if (used > index)
171 allocator.destruct(&data[index]); 171 allocator.destruct(&data[index]);
172 allocator.construct(&data[index], e); // data[index] = e; 172 allocator.construct(&data[index], e); // data[index] = e;
173 } 173 }
174 else 174 else
175 { 175 {
176 // element inserted not at end 176 // element inserted not at end
177 if ( used > index ) 177 if ( used > index )
178 { 178 {
179 // create one new element at the end 179 // create one new element at the end
180 allocator.construct(&data[used], data[used-1]); 180 allocator.construct(&data[used], data[used-1]);
181 181
182 // move the rest of the array content 182 // move the rest of the array content
183 for (u32 i=used-1; i>index; --i) 183 for (u32 i=used-1; i>index; --i)
184 { 184 {
185 data[i] = data[i-1]; 185 data[i] = data[i-1];
186 } 186 }
187 // insert the new element 187 // insert the new element
188 data[index] = element; 188 data[index] = element;
189 } 189 }
190 else 190 else
191 { 191 {
192 // insert the new element to the end 192 // insert the new element to the end
193 allocator.construct(&data[index], element); 193 allocator.construct(&data[index], element);
194 } 194 }
195 } 195 }
196 // set to false as we don't know if we have the comparison operators 196 // set to false as we don't know if we have the comparison operators
197 is_sorted = false; 197 is_sorted = false;
198 ++used; 198 ++used;
199 } 199 }
200 200
201 201
202 //! Clears the array and deletes all allocated memory. 202 //! Clears the array and deletes all allocated memory.
203 void clear() 203 void clear()
204 { 204 {
205 if (free_when_destroyed) 205 if (free_when_destroyed)
206 { 206 {
207 for (u32 i=0; i<used; ++i) 207 for (u32 i=0; i<used; ++i)
208 allocator.destruct(&data[i]); 208 allocator.destruct(&data[i]);
209 209
210 allocator.deallocate(data); // delete [] data; 210 allocator.deallocate(data); // delete [] data;
211 } 211 }
212 data = 0; 212 data = 0;
213 used = 0; 213 used = 0;
214 allocated = 0; 214 allocated = 0;
215 is_sorted = true; 215 is_sorted = true;
216 } 216 }
217 217
218 218
219 //! Sets pointer to new array, using this as new workspace. 219 //! Sets pointer to new array, using this as new workspace.
220 /** Make sure that set_free_when_destroyed is used properly. 220 /** Make sure that set_free_when_destroyed is used properly.
221 \param newPointer: Pointer to new array of elements. 221 \param newPointer: Pointer to new array of elements.
222 \param size: Size of the new array. 222 \param size: Size of the new array.
223 \param _is_sorted Flag which tells whether the new array is already 223 \param _is_sorted Flag which tells whether the new array is already
224 sorted. 224 sorted.
225 \param _free_when_destroyed Sets whether the new memory area shall be 225 \param _free_when_destroyed Sets whether the new memory area shall be
226 freed by the array upon destruction, or if this will be up to the user 226 freed by the array upon destruction, or if this will be up to the user
227 application. */ 227 application. */
228 void set_pointer(T* newPointer, u32 size, bool _is_sorted=false, bool _free_when_destroyed=true) 228 void set_pointer(T* newPointer, u32 size, bool _is_sorted=false, bool _free_when_destroyed=true)
229 { 229 {
230 clear(); 230 clear();
231 data = newPointer; 231 data = newPointer;
232 allocated = size; 232 allocated = size;
233 used = size; 233 used = size;
234 is_sorted = _is_sorted; 234 is_sorted = _is_sorted;
235 free_when_destroyed=_free_when_destroyed; 235 free_when_destroyed=_free_when_destroyed;
236 } 236 }
237 237
238 238
239 //! Sets if the array should delete the memory it uses upon destruction. 239 //! Sets if the array should delete the memory it uses upon destruction.
240 /** Also clear and set_pointer will only delete the (original) memory 240 /** Also clear and set_pointer will only delete the (original) memory
241 area if this flag is set to true, which is also the default. The 241 area if this flag is set to true, which is also the default. The
242 methods reallocate, set_used, push_back, push_front, insert, and erase 242 methods reallocate, set_used, push_back, push_front, insert, and erase
243 will still try to deallocate the original memory, which might cause 243 will still try to deallocate the original memory, which might cause
244 troubles depending on the intended use of the memory area. 244 troubles depending on the intended use of the memory area.
245 \param f If true, the array frees the allocated memory in its 245 \param f If true, the array frees the allocated memory in its
246 destructor, otherwise not. The default is true. */ 246 destructor, otherwise not. The default is true. */
247 void set_free_when_destroyed(bool f) 247 void set_free_when_destroyed(bool f)
248 { 248 {
249 free_when_destroyed = f; 249 free_when_destroyed = f;
250 } 250 }
251 251
252 252
253 //! Sets the size of the array and allocates new elements if necessary. 253 //! Sets the size of the array and allocates new elements if necessary.
254 /** Please note: This is only secure when using it with simple types, 254 /** Please note: This is only secure when using it with simple types,
255 because no default constructor will be called for the added elements. 255 because no default constructor will be called for the added elements.
256 \param usedNow Amount of elements now used. */ 256 \param usedNow Amount of elements now used. */
257 void set_used(u32 usedNow) 257 void set_used(u32 usedNow)
258 { 258 {
259 if (allocated < usedNow) 259 if (allocated < usedNow)
260 reallocate(usedNow); 260 reallocate(usedNow);
261 261
262 used = usedNow; 262 used = usedNow;
263 } 263 }
264 264
265 265
266 //! Assignment operator 266 //! Assignment operator
267 const array<T, TAlloc>& operator=(const array<T, TAlloc>& other) 267 const array<T, TAlloc>& operator=(const array<T, TAlloc>& other)
268 { 268 {
269 if (this == &other) 269 if (this == &other)
270 return *this; 270 return *this;
271 strategy = other.strategy; 271 strategy = other.strategy;
272 272
273 if (data) 273 if (data)
274 clear(); 274 clear();
275 275
276 //if (allocated < other.allocated) 276 //if (allocated < other.allocated)
277 if (other.allocated == 0) 277 if (other.allocated == 0)
278 data = 0; 278 data = 0;
279 else 279 else
280 data = allocator.allocate(other.allocated); // new T[other.allocated]; 280 data = allocator.allocate(other.allocated); // new T[other.allocated];
281 281
282 used = other.used; 282 used = other.used;
283 free_when_destroyed = true; 283 free_when_destroyed = true;
284 is_sorted = other.is_sorted; 284 is_sorted = other.is_sorted;
285 allocated = other.allocated; 285 allocated = other.allocated;
286 286
287 for (u32 i=0; i<other.used; ++i) 287 for (u32 i=0; i<other.used; ++i)
288 allocator.construct(&data[i], other.data[i]); // data[i] = other.data[i]; 288 allocator.construct(&data[i], other.data[i]); // data[i] = other.data[i];
289 289
290 return *this; 290 return *this;
291 } 291 }
292 292
293 293
294 //! Equality operator 294 //! Equality operator
295 bool operator == (const array<T, TAlloc>& other) const 295 bool operator == (const array<T, TAlloc>& other) const
296 { 296 {
297 if (used != other.used) 297 if (used != other.used)
298 return false; 298 return false;
299 299
300 for (u32 i=0; i<other.used; ++i) 300 for (u32 i=0; i<other.used; ++i)
301 if (data[i] != other[i]) 301 if (data[i] != other[i])
302 return false; 302 return false;
303 return true; 303 return true;
304 } 304 }
305 305
306 306
307 //! Inequality operator 307 //! Inequality operator
308 bool operator != (const array<T, TAlloc>& other) const 308 bool operator != (const array<T, TAlloc>& other) const
309 { 309 {
310 return !(*this==other); 310 return !(*this==other);
311 } 311 }
312 312
313 313
314 //! Direct access operator 314 //! Direct access operator
315 T& operator [](u32 index) 315 T& operator [](u32 index)
316 { 316 {
317 _IRR_DEBUG_BREAK_IF(index>=used) // access violation 317 _IRR_DEBUG_BREAK_IF(index>=used) // access violation
318 318
319 return data[index]; 319 return data[index];
320 } 320 }
321 321
322 322
323 //! Direct const access operator 323 //! Direct const access operator
324 const T& operator [](u32 index) const 324 const T& operator [](u32 index) const
325 { 325 {
326 _IRR_DEBUG_BREAK_IF(index>=used) // access violation 326 _IRR_DEBUG_BREAK_IF(index>=used) // access violation
327 327
328 return data[index]; 328 return data[index];
329 } 329 }
330 330
331 331
332 //! Gets last element. 332 //! Gets last element.
333 T& getLast() 333 T& getLast()
334 { 334 {
335 _IRR_DEBUG_BREAK_IF(!used) // access violation 335 _IRR_DEBUG_BREAK_IF(!used) // access violation
336 336
337 return data[used-1]; 337 return data[used-1];
338 } 338 }
339 339
340 340
341 //! Gets last element 341 //! Gets last element
342 const T& getLast() const 342 const T& getLast() const
343 { 343 {
344 _IRR_DEBUG_BREAK_IF(!used) // access violation 344 _IRR_DEBUG_BREAK_IF(!used) // access violation
345 345
346 return data[used-1]; 346 return data[used-1];
347 } 347 }
348 348
349 349
350 //! Gets a pointer to the array. 350 //! Gets a pointer to the array.
351 /** \return Pointer to the array. */ 351 /** \return Pointer to the array. */
352 T* pointer() 352 T* pointer()
353 { 353 {
354 return data; 354 return data;
355 } 355 }
356 356
357 357
358 //! Gets a const pointer to the array. 358 //! Gets a const pointer to the array.
359 /** \return Pointer to the array. */ 359 /** \return Pointer to the array. */
360 const T* const_pointer() const 360 const T* const_pointer() const
361 { 361 {
362 return data; 362 return data;
363 } 363 }
364 364
365 365
366 //! Get number of occupied elements of the array. 366 //! Get number of occupied elements of the array.
367 /** \return Size of elements in the array which are actually occupied. */ 367 /** \return Size of elements in the array which are actually occupied. */
368 u32 size() const 368 u32 size() const
369 { 369 {
370 return used; 370 return used;
371 } 371 }
372 372
373 373
374 //! Get amount of memory allocated. 374 //! Get amount of memory allocated.
375 /** \return Amount of memory allocated. The amount of bytes 375 /** \return Amount of memory allocated. The amount of bytes
376 allocated would be allocated_size() * sizeof(ElementTypeUsed); */ 376 allocated would be allocated_size() * sizeof(ElementTypeUsed); */
377 u32 allocated_size() const 377 u32 allocated_size() const
378 { 378 {
379 return allocated; 379 return allocated;
380 } 380 }
381 381
382 382
383 //! Check if array is empty. 383 //! Check if array is empty.
384 /** \return True if the array is empty false if not. */ 384 /** \return True if the array is empty false if not. */
385 bool empty() const 385 bool empty() const
386 { 386 {
387 return used == 0; 387 return used == 0;
388 } 388 }
389 389
390 390
391 //! Sorts the array using heapsort. 391 //! Sorts the array using heapsort.
392 /** There is no additional memory waste and the algorithm performs 392 /** There is no additional memory waste and the algorithm performs
393 O(n*log n) in worst case. */ 393 O(n*log n) in worst case. */
394 void sort() 394 void sort()
395 { 395 {
396 if (!is_sorted && used>1) 396 if (!is_sorted && used>1)
397 heapsort(data, used); 397 heapsort(data, used);
398 is_sorted = true; 398 is_sorted = true;
399 } 399 }
400 400
401 401
402 //! Performs a binary search for an element, returns -1 if not found. 402 //! Performs a binary search for an element, returns -1 if not found.
403 /** The array will be sorted before the binary search if it is not 403 /** The array will be sorted before the binary search if it is not
404 already sorted. Caution is advised! Be careful not to call this on 404 already sorted. Caution is advised! Be careful not to call this on
405 unsorted const arrays, or the slower method will be used. 405 unsorted const arrays, or the slower method will be used.
406 \param element Element to search for. 406 \param element Element to search for.
407 \return Position of the searched element if it was found, 407 \return Position of the searched element if it was found,
408 otherwise -1 is returned. */ 408 otherwise -1 is returned. */
409 s32 binary_search(const T& element) 409 s32 binary_search(const T& element)
410 { 410 {
411 sort(); 411 sort();
412 return binary_search(element, 0, used-1); 412 return binary_search(element, 0, used-1);
413 } 413 }
414 414
415 415
416 //! Performs a binary search for an element if possible, returns -1 if not found. 416 //! Performs a binary search for an element if possible, returns -1 if not found.
417 /** This method is for const arrays and so cannot call sort(), if the array is 417 /** This method is for const arrays and so cannot call sort(), if the array is
418 not sorted then linear_search will be used instead. Potentially very slow! 418 not sorted then linear_search will be used instead. Potentially very slow!
419 \param element Element to search for. 419 \param element Element to search for.
420 \return Position of the searched element if it was found, 420 \return Position of the searched element if it was found,
421 otherwise -1 is returned. */ 421 otherwise -1 is returned. */
422 s32 binary_search(const T& element) const 422 s32 binary_search(const T& element) const
423 { 423 {
424 if (is_sorted) 424 if (is_sorted)
425 return binary_search(element, 0, used-1); 425 return binary_search(element, 0, used-1);
426 else 426 else
427 return linear_search(element); 427 return linear_search(element);
428 } 428 }
429 429
430 430
431 //! Performs a binary search for an element, returns -1 if not found. 431 //! Performs a binary search for an element, returns -1 if not found.
432 /** \param element: Element to search for. 432 /** \param element: Element to search for.
433 \param left First left index 433 \param left First left index
434 \param right Last right index. 434 \param right Last right index.
435 \return Position of the searched element if it was found, otherwise -1 435 \return Position of the searched element if it was found, otherwise -1
436 is returned. */ 436 is returned. */
437 s32 binary_search(const T& element, s32 left, s32 right) const 437 s32 binary_search(const T& element, s32 left, s32 right) const
438 { 438 {
439 if (!used) 439 if (!used)
440 return -1; 440 return -1;
441 441
442 s32 m; 442 s32 m;
443 443
444 do 444 do
445 { 445 {
446 m = (left+right)>>1; 446 m = (left+right)>>1;
447 447
448 if (element < data[m]) 448 if (element < data[m])
449 right = m - 1; 449 right = m - 1;
450 else 450 else
451 left = m + 1; 451 left = m + 1;
452 452
453 } while((element < data[m] || data[m] < element) && left<=right); 453 } while((element < data[m] || data[m] < element) && left<=right);
454 // this last line equals to: 454 // this last line equals to:
455 // " while((element != array[m]) && left<=right);" 455 // " while((element != array[m]) && left<=right);"
456 // but we only want to use the '<' operator. 456 // but we only want to use the '<' operator.
457 // the same in next line, it is "(element == array[m])" 457 // the same in next line, it is "(element == array[m])"
458 458
459 459
460 if (!(element < data[m]) && !(data[m] < element)) 460 if (!(element < data[m]) && !(data[m] < element))
461 return m; 461 return m;
462 462
463 return -1; 463 return -1;
464 } 464 }
465 465
466 466
467 //! Performs a binary search for an element, returns -1 if not found. 467 //! Performs a binary search for an element, returns -1 if not found.
468 //! it is used for searching a multiset 468 //! it is used for searching a multiset
469 /** The array will be sorted before the binary search if it is not 469 /** The array will be sorted before the binary search if it is not
470 already sorted. 470 already sorted.
471 \param element Element to search for. 471 \param element Element to search for.
472 \param &last return lastIndex of equal elements 472 \param &last return lastIndex of equal elements
473 \return Position of the first searched element if it was found, 473 \return Position of the first searched element if it was found,
474 otherwise -1 is returned. */ 474 otherwise -1 is returned. */
475 s32 binary_search_multi(const T& element, s32 &last) 475 s32 binary_search_multi(const T& element, s32 &last)
476 { 476 {
477 sort(); 477 sort();
478 s32 index = binary_search(element, 0, used-1); 478 s32 index = binary_search(element, 0, used-1);
479 if ( index < 0 ) 479 if ( index < 0 )
480 return index; 480 return index;
481 481
482 // The search can be somewhere in the middle of the set 482 // The search can be somewhere in the middle of the set
483 // look linear previous and past the index 483 // look linear previous and past the index
484 last = index; 484 last = index;
485 485
486 while ( index > 0 && !(element < data[index - 1]) && !(data[index - 1] < element) ) 486 while ( index > 0 && !(element < data[index - 1]) && !(data[index - 1] < element) )
487 { 487 {
488 index -= 1; 488 index -= 1;
489 } 489 }
490 // look linear up 490 // look linear up
491 while ( last < (s32) used - 1 && !(element < data[last + 1]) && !(data[last + 1] < element) ) 491 while ( last < (s32) used - 1 && !(element < data[last + 1]) && !(data[last + 1] < element) )
492 { 492 {
493 last += 1; 493 last += 1;
494 } 494 }
495 495
496 return index; 496 return index;
497 } 497 }
498 498
499 499
500 //! Finds an element in linear time, which is very slow. 500 //! Finds an element in linear time, which is very slow.
501 /** Use binary_search for faster finding. Only works if ==operator is 501 /** Use binary_search for faster finding. Only works if ==operator is
502 implemented. 502 implemented.
503 \param element Element to search for. 503 \param element Element to search for.
504 \return Position of the searched element if it was found, otherwise -1 504 \return Position of the searched element if it was found, otherwise -1
505 is returned. */ 505 is returned. */
506 s32 linear_search(const T& element) const 506 s32 linear_search(const T& element) const
507 { 507 {
508 for (u32 i=0; i<used; ++i) 508 for (u32 i=0; i<used; ++i)
509 if (element == data[i]) 509 if (element == data[i])
510 return (s32)i; 510 return (s32)i;
511 511
512 return -1; 512 return -1;
513 } 513 }
514 514
515 515
516 //! Finds an element in linear time, which is very slow. 516 //! Finds an element in linear time, which is very slow.
517 /** Use binary_search for faster finding. Only works if ==operator is 517 /** Use binary_search for faster finding. Only works if ==operator is
518 implemented. 518 implemented.
519 \param element: Element to search for. 519 \param element: Element to search for.
520 \return Position of the searched element if it was found, otherwise -1 520 \return Position of the searched element if it was found, otherwise -1
521 is returned. */ 521 is returned. */
522 s32 linear_reverse_search(const T& element) const 522 s32 linear_reverse_search(const T& element) const
523 { 523 {
524 for (s32 i=used-1; i>=0; --i) 524 for (s32 i=used-1; i>=0; --i)
525 if (data[i] == element) 525 if (data[i] == element)
526 return i; 526 return i;
527 527
528 return -1; 528 return -1;
529 } 529 }
530 530
531 531
532 //! Erases an element from the array. 532 //! Erases an element from the array.
533 /** May be slow, because all elements following after the erased 533 /** May be slow, because all elements following after the erased
534 element have to be copied. 534 element have to be copied.
535 \param index: Index of element to be erased. */ 535 \param index: Index of element to be erased. */
536 void erase(u32 index) 536 void erase(u32 index)
537 { 537 {
538 _IRR_DEBUG_BREAK_IF(index>=used) // access violation 538 _IRR_DEBUG_BREAK_IF(index>=used) // access violation
539 539
540 for (u32 i=index+1; i<used; ++i) 540 for (u32 i=index+1; i<used; ++i)
541 { 541 {
542 allocator.destruct(&data[i-1]); 542 allocator.destruct(&data[i-1]);
543 allocator.construct(&data[i-1], data[i]); // data[i-1] = data[i]; 543 allocator.construct(&data[i-1], data[i]); // data[i-1] = data[i];
544 } 544 }
545 545
546 allocator.destruct(&data[used-1]); 546 allocator.destruct(&data[used-1]);
547 547
548 --used; 548 --used;
549 } 549 }
550 550
551 551
552 //! Erases some elements from the array. 552 //! Erases some elements from the array.
553 /** May be slow, because all elements following after the erased 553 /** May be slow, because all elements following after the erased
554 element have to be copied. 554 element have to be copied.
555 \param index: Index of the first element to be erased. 555 \param index: Index of the first element to be erased.
556 \param count: Amount of elements to be erased. */ 556 \param count: Amount of elements to be erased. */
557 void erase(u32 index, s32 count) 557 void erase(u32 index, s32 count)
558 { 558 {
559 if (index>=used || count<1) 559 if (index>=used || count<1)
560 return; 560 return;
561 if (index+count>used) 561 if (index+count>used)
562 count = used-index; 562 count = used-index;
563 563
564 u32 i; 564 u32 i;
565 for (i=index; i<index+count; ++i) 565 for (i=index; i<index+count; ++i)
566 allocator.destruct(&data[i]); 566 allocator.destruct(&data[i]);
567 567
568 for (i=index+count; i<used; ++i) 568 for (i=index+count; i<used; ++i)
569 { 569 {
570 if (i-count >= index+count) // not already destructed before loop 570 if (i-count >= index+count) // not already destructed before loop
571 allocator.destruct(&data[i-count]); 571 allocator.destruct(&data[i-count]);
572 572
573 allocator.construct(&data[i-count], data[i]); // data[i-count] = data[i]; 573 allocator.construct(&data[i-count], data[i]); // data[i-count] = data[i];
574 574
575 if (i >= used-count) // those which are not overwritten 575 if (i >= used-count) // those which are not overwritten
576 allocator.destruct(&data[i]); 576 allocator.destruct(&data[i]);
577 } 577 }
578 578
579 used-= count; 579 used-= count;
580 } 580 }
581 581
582 582
583 //! Sets if the array is sorted 583 //! Sets if the array is sorted
584 void set_sorted(bool _is_sorted) 584 void set_sorted(bool _is_sorted)
585 { 585 {
586 is_sorted = _is_sorted; 586 is_sorted = _is_sorted;
587 } 587 }
588 588
589 589
590 //! Swap the content of this array container with the content of another array 590 //! Swap the content of this array container with the content of another array
591 /** Afterwards this object will contain the content of the other object and the other 591 /** Afterwards this object will contain the content of the other object and the other
592 object will contain the content of this object. 592 object will contain the content of this object.
593 \param other Swap content with this object */ 593 \param other Swap content with this object */
594 void swap(array<T, TAlloc>& other) 594 void swap(array<T, TAlloc>& other)
595 { 595 {
596 core::swap(data, other.data); 596 core::swap(data, other.data);
597 core::swap(allocated, other.allocated); 597 core::swap(allocated, other.allocated);
598 core::swap(used, other.used); 598 core::swap(used, other.used);
599 core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation 599 core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation
600 eAllocStrategy helper_strategy(strategy); // can't use core::swap with bitfields 600 eAllocStrategy helper_strategy(strategy); // can't use core::swap with bitfields
601 strategy = other.strategy; 601 strategy = other.strategy;
602 other.strategy = helper_strategy; 602 other.strategy = helper_strategy;
603 bool helper_free_when_destroyed(free_when_destroyed); 603 bool helper_free_when_destroyed(free_when_destroyed);
604 free_when_destroyed = other.free_when_destroyed; 604 free_when_destroyed = other.free_when_destroyed;
605 other.free_when_destroyed = helper_free_when_destroyed; 605 other.free_when_destroyed = helper_free_when_destroyed;
606 bool helper_is_sorted(is_sorted); 606 bool helper_is_sorted(is_sorted);
607 is_sorted = other.is_sorted; 607 is_sorted = other.is_sorted;
608 other.is_sorted = helper_is_sorted; 608 other.is_sorted = helper_is_sorted;
609 } 609 }
610 610
611 611
612private: 612private:
613 T* data; 613 T* data;
614 u32 allocated; 614 u32 allocated;
615 u32 used; 615 u32 used;
616 TAlloc allocator; 616 TAlloc allocator;
617 eAllocStrategy strategy:4; 617 eAllocStrategy strategy:4;
618 bool free_when_destroyed:1; 618 bool free_when_destroyed:1;
619 bool is_sorted:1; 619 bool is_sorted:1;
620}; 620};
621 621
622 622
623} // end namespace core 623} // end namespace core
624} // end namespace irr 624} // end namespace irr
625 625
626#endif 626#endif
627 627
diff --git a/libraries/irrlicht-1.8/include/irrList.h b/libraries/irrlicht-1.8/include/irrList.h
index 54eed83..a84afd5 100644
--- a/libraries/irrlicht-1.8/include/irrList.h
+++ b/libraries/irrlicht-1.8/include/irrList.h
@@ -1,416 +1,416 @@
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#ifndef __IRR_LIST_H_INCLUDED__ 5#ifndef __IRR_LIST_H_INCLUDED__
6#define __IRR_LIST_H_INCLUDED__ 6#define __IRR_LIST_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include "irrAllocator.h" 9#include "irrAllocator.h"
10#include "irrMath.h" 10#include "irrMath.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace core 14namespace core
15{ 15{
16 16
17 17
18//! Doubly linked list template. 18//! Doubly linked list template.
19template <class T> 19template <class T>
20class list 20class list
21{ 21{
22private: 22private:
23 23
24 //! List element node with pointer to previous and next element in the list. 24 //! List element node with pointer to previous and next element in the list.
25 struct SKListNode 25 struct SKListNode
26 { 26 {
27 SKListNode(const T& e) : Next(0), Prev(0), Element(e) {} 27 SKListNode(const T& e) : Next(0), Prev(0), Element(e) {}
28 28
29 SKListNode* Next; 29 SKListNode* Next;
30 SKListNode* Prev; 30 SKListNode* Prev;
31 T Element; 31 T Element;
32 }; 32 };
33 33
34public: 34public:
35 class ConstIterator; 35 class ConstIterator;
36 36
37 //! List iterator. 37 //! List iterator.
38 class Iterator 38 class Iterator
39 { 39 {
40 public: 40 public:
41 Iterator() : Current(0) {} 41 Iterator() : Current(0) {}
42 42
43 Iterator& operator ++() { Current = Current->Next; return *this; } 43 Iterator& operator ++() { Current = Current->Next; return *this; }
44 Iterator& operator --() { Current = Current->Prev; return *this; } 44 Iterator& operator --() { Current = Current->Prev; return *this; }
45 Iterator operator ++(s32) { Iterator tmp = *this; Current = Current->Next; return tmp; } 45 Iterator operator ++(s32) { Iterator tmp = *this; Current = Current->Next; return tmp; }
46 Iterator operator --(s32) { Iterator tmp = *this; Current = Current->Prev; return tmp; } 46 Iterator operator --(s32) { Iterator tmp = *this; Current = Current->Prev; return tmp; }
47 47
48 Iterator& operator +=(s32 num) 48 Iterator& operator +=(s32 num)
49 { 49 {
50 if(num > 0) 50 if(num > 0)
51 { 51 {
52 while (num-- && this->Current != 0) ++(*this); 52 while (num-- && this->Current != 0) ++(*this);
53 } 53 }
54 else 54 else
55 { 55 {
56 while(num++ && this->Current != 0) --(*this); 56 while(num++ && this->Current != 0) --(*this);
57 } 57 }
58 return *this; 58 return *this;
59 } 59 }
60 60
61 Iterator operator + (s32 num) const { Iterator tmp = *this; return tmp += num; } 61 Iterator operator + (s32 num) const { Iterator tmp = *this; return tmp += num; }
62 Iterator& operator -=(s32 num) { return (*this)+=(-num); } 62 Iterator& operator -=(s32 num) { return (*this)+=(-num); }
63 Iterator operator - (s32 num) const { return (*this)+ (-num); } 63 Iterator operator - (s32 num) const { return (*this)+ (-num); }
64 64
65 bool operator ==(const Iterator& other) const { return Current == other.Current; } 65 bool operator ==(const Iterator& other) const { return Current == other.Current; }
66 bool operator !=(const Iterator& other) const { return Current != other.Current; } 66 bool operator !=(const Iterator& other) const { return Current != other.Current; }
67 bool operator ==(const ConstIterator& other) const { return Current == other.Current; } 67 bool operator ==(const ConstIterator& other) const { return Current == other.Current; }
68 bool operator !=(const ConstIterator& other) const { return Current != other.Current; } 68 bool operator !=(const ConstIterator& other) const { return Current != other.Current; }
69 69
70 #if defined (_MSC_VER) && (_MSC_VER < 1300) 70 #if defined (_MSC_VER) && (_MSC_VER < 1300)
71 #pragma warning(disable:4284) // infix notation problem when using iterator operator -> 71 #pragma warning(disable:4284) // infix notation problem when using iterator operator ->
72 #endif 72 #endif
73 73
74 T & operator * () { return Current->Element; } 74 T & operator * () { return Current->Element; }
75 T * operator ->() { return &Current->Element; } 75 T * operator ->() { return &Current->Element; }
76 76
77 private: 77 private:
78 explicit Iterator(SKListNode* begin) : Current(begin) {} 78 explicit Iterator(SKListNode* begin) : Current(begin) {}
79 79
80 SKListNode* Current; 80 SKListNode* Current;
81 81
82 friend class list<T>; 82 friend class list<T>;
83 friend class ConstIterator; 83 friend class ConstIterator;
84 }; 84 };
85 85
86 //! List iterator for const access. 86 //! List iterator for const access.
87 class ConstIterator 87 class ConstIterator
88 { 88 {
89 public: 89 public:
90 90
91 ConstIterator() : Current(0) {} 91 ConstIterator() : Current(0) {}
92 ConstIterator(const Iterator& iter) : Current(iter.Current) {} 92 ConstIterator(const Iterator& iter) : Current(iter.Current) {}
93 93
94 ConstIterator& operator ++() { Current = Current->Next; return *this; } 94 ConstIterator& operator ++() { Current = Current->Next; return *this; }
95 ConstIterator& operator --() { Current = Current->Prev; return *this; } 95 ConstIterator& operator --() { Current = Current->Prev; return *this; }
96 ConstIterator operator ++(s32) { ConstIterator tmp = *this; Current = Current->Next; return tmp; } 96 ConstIterator operator ++(s32) { ConstIterator tmp = *this; Current = Current->Next; return tmp; }
97 ConstIterator operator --(s32) { ConstIterator tmp = *this; Current = Current->Prev; return tmp; } 97 ConstIterator operator --(s32) { ConstIterator tmp = *this; Current = Current->Prev; return tmp; }
98 98
99 ConstIterator& operator +=(s32 num) 99 ConstIterator& operator +=(s32 num)
100 { 100 {
101 if(num > 0) 101 if(num > 0)
102 { 102 {
103 while(num-- && this->Current != 0) ++(*this); 103 while(num-- && this->Current != 0) ++(*this);
104 } 104 }
105 else 105 else
106 { 106 {
107 while(num++ && this->Current != 0) --(*this); 107 while(num++ && this->Current != 0) --(*this);
108 } 108 }
109 return *this; 109 return *this;
110 } 110 }
111 111
112 ConstIterator operator + (s32 num) const { ConstIterator tmp = *this; return tmp += num; } 112 ConstIterator operator + (s32 num) const { ConstIterator tmp = *this; return tmp += num; }
113 ConstIterator& operator -=(s32 num) { return (*this)+=(-num); } 113 ConstIterator& operator -=(s32 num) { return (*this)+=(-num); }
114 ConstIterator operator - (s32 num) const { return (*this)+ (-num); } 114 ConstIterator operator - (s32 num) const { return (*this)+ (-num); }
115 115
116 bool operator ==(const ConstIterator& other) const { return Current == other.Current; } 116 bool operator ==(const ConstIterator& other) const { return Current == other.Current; }
117 bool operator !=(const ConstIterator& other) const { return Current != other.Current; } 117 bool operator !=(const ConstIterator& other) const { return Current != other.Current; }
118 bool operator ==(const Iterator& other) const { return Current == other.Current; } 118 bool operator ==(const Iterator& other) const { return Current == other.Current; }
119 bool operator !=(const Iterator& other) const { return Current != other.Current; } 119 bool operator !=(const Iterator& other) const { return Current != other.Current; }
120 120
121 const T & operator * () { return Current->Element; } 121 const T & operator * () { return Current->Element; }
122 const T * operator ->() { return &Current->Element; } 122 const T * operator ->() { return &Current->Element; }
123 123
124 ConstIterator & operator =(const Iterator & iterator) { Current = iterator.Current; return *this; } 124 ConstIterator & operator =(const Iterator & iterator) { Current = iterator.Current; return *this; }
125 125
126 private: 126 private:
127 explicit ConstIterator(SKListNode* begin) : Current(begin) {} 127 explicit ConstIterator(SKListNode* begin) : Current(begin) {}
128 128
129 SKListNode* Current; 129 SKListNode* Current;
130 130
131 friend class Iterator; 131 friend class Iterator;
132 friend class list<T>; 132 friend class list<T>;
133 }; 133 };
134 134
135 //! Default constructor for empty list. 135 //! Default constructor for empty list.
136 list() 136 list()
137 : First(0), Last(0), Size(0) {} 137 : First(0), Last(0), Size(0) {}
138 138
139 139
140 //! Copy constructor. 140 //! Copy constructor.
141 list(const list<T>& other) : First(0), Last(0), Size(0) 141 list(const list<T>& other) : First(0), Last(0), Size(0)
142 { 142 {
143 *this = other; 143 *this = other;
144 } 144 }
145 145
146 146
147 //! Destructor 147 //! Destructor
148 ~list() 148 ~list()
149 { 149 {
150 clear(); 150 clear();
151 } 151 }
152 152
153 153
154 //! Assignment operator 154 //! Assignment operator
155 void operator=(const list<T>& other) 155 void operator=(const list<T>& other)
156 { 156 {
157 if(&other == this) 157 if(&other == this)
158 { 158 {
159 return; 159 return;
160 } 160 }
161 161
162 clear(); 162 clear();
163 163
164 SKListNode* node = other.First; 164 SKListNode* node = other.First;
165 while(node) 165 while(node)
166 { 166 {
167 push_back(node->Element); 167 push_back(node->Element);
168 node = node->Next; 168 node = node->Next;
169 } 169 }
170 } 170 }
171 171
172 172
173 //! Returns amount of elements in list. 173 //! Returns amount of elements in list.
174 /** \return Amount of elements in the list. */ 174 /** \return Amount of elements in the list. */
175 u32 size() const 175 u32 size() const
176 { 176 {
177 return Size; 177 return Size;
178 } 178 }
179 u32 getSize() const 179 u32 getSize() const
180 { 180 {
181 return Size; 181 return Size;
182 } 182 }
183 183
184 184
185 //! Clears the list, deletes all elements in the list. 185 //! Clears the list, deletes all elements in the list.
186 /** All existing iterators of this list will be invalid. */ 186 /** All existing iterators of this list will be invalid. */
187 void clear() 187 void clear()
188 { 188 {
189 while(First) 189 while(First)
190 { 190 {
191 SKListNode * next = First->Next; 191 SKListNode * next = First->Next;
192 allocator.destruct(First); 192 allocator.destruct(First);
193 allocator.deallocate(First); 193 allocator.deallocate(First);
194 First = next; 194 First = next;
195 } 195 }
196 196
197 //First = 0; handled by loop 197 //First = 0; handled by loop
198 Last = 0; 198 Last = 0;
199 Size = 0; 199 Size = 0;
200 } 200 }
201 201
202 202
203 //! Checks for empty list. 203 //! Checks for empty list.
204 /** \return True if the list is empty and false if not. */ 204 /** \return True if the list is empty and false if not. */
205 bool empty() const 205 bool empty() const
206 { 206 {
207 return (First == 0); 207 return (First == 0);
208 } 208 }
209 209
210 210
211 //! Adds an element at the end of the list. 211 //! Adds an element at the end of the list.
212 /** \param element Element to add to the list. */ 212 /** \param element Element to add to the list. */
213 void push_back(const T& element) 213 void push_back(const T& element)
214 { 214 {
215 SKListNode* node = allocator.allocate(1); 215 SKListNode* node = allocator.allocate(1);
216 allocator.construct(node, element); 216 allocator.construct(node, element);
217 217
218 ++Size; 218 ++Size;
219 219
220 if (First == 0) 220 if (First == 0)
221 First = node; 221 First = node;
222 222
223 node->Prev = Last; 223 node->Prev = Last;
224 224
225 if (Last != 0) 225 if (Last != 0)
226 Last->Next = node; 226 Last->Next = node;
227 227
228 Last = node; 228 Last = node;
229 } 229 }
230 230
231 231
232 //! Adds an element at the begin of the list. 232 //! Adds an element at the begin of the list.
233 /** \param element: Element to add to the list. */ 233 /** \param element: Element to add to the list. */
234 void push_front(const T& element) 234 void push_front(const T& element)
235 { 235 {
236 SKListNode* node = allocator.allocate(1); 236 SKListNode* node = allocator.allocate(1);
237 allocator.construct(node, element); 237 allocator.construct(node, element);
238 238
239 ++Size; 239 ++Size;
240 240
241 if (First == 0) 241 if (First == 0)
242 { 242 {
243 Last = node; 243 Last = node;
244 First = node; 244 First = node;
245 } 245 }
246 else 246 else
247 { 247 {
248 node->Next = First; 248 node->Next = First;
249 First->Prev = node; 249 First->Prev = node;
250 First = node; 250 First = node;
251 } 251 }
252 } 252 }
253 253
254 254
255 //! Gets first node. 255 //! Gets first node.
256 /** \return A list iterator pointing to the beginning of the list. */ 256 /** \return A list iterator pointing to the beginning of the list. */
257 Iterator begin() 257 Iterator begin()
258 { 258 {
259 return Iterator(First); 259 return Iterator(First);
260 } 260 }
261 261
262 262
263 //! Gets first node. 263 //! Gets first node.
264 /** \return A const list iterator pointing to the beginning of the list. */ 264 /** \return A const list iterator pointing to the beginning of the list. */
265 ConstIterator begin() const 265 ConstIterator begin() const
266 { 266 {
267 return ConstIterator(First); 267 return ConstIterator(First);
268 } 268 }
269 269
270 270
271 //! Gets end node. 271 //! Gets end node.
272 /** \return List iterator pointing to null. */ 272 /** \return List iterator pointing to null. */
273 Iterator end() 273 Iterator end()
274 { 274 {
275 return Iterator(0); 275 return Iterator(0);
276 } 276 }
277 277
278 278
279 //! Gets end node. 279 //! Gets end node.
280 /** \return Const list iterator pointing to null. */ 280 /** \return Const list iterator pointing to null. */
281 ConstIterator end() const 281 ConstIterator end() const
282 { 282 {
283 return ConstIterator(0); 283 return ConstIterator(0);
284 } 284 }
285 285
286 286
287 //! Gets last element. 287 //! Gets last element.
288 /** \return List iterator pointing to the last element of the list. */ 288 /** \return List iterator pointing to the last element of the list. */
289 Iterator getLast() 289 Iterator getLast()
290 { 290 {
291 return Iterator(Last); 291 return Iterator(Last);
292 } 292 }
293 293
294 294
295 //! Gets last element. 295 //! Gets last element.
296 /** \return Const list iterator pointing to the last element of the list. */ 296 /** \return Const list iterator pointing to the last element of the list. */
297 ConstIterator getLast() const 297 ConstIterator getLast() const
298 { 298 {
299 return ConstIterator(Last); 299 return ConstIterator(Last);
300 } 300 }
301 301
302 302
303 //! Inserts an element after an element. 303 //! Inserts an element after an element.
304 /** \param it Iterator pointing to element after which the new element 304 /** \param it Iterator pointing to element after which the new element
305 should be inserted. 305 should be inserted.
306 \param element The new element to be inserted into the list. 306 \param element The new element to be inserted into the list.
307 */ 307 */
308 void insert_after(const Iterator& it, const T& element) 308 void insert_after(const Iterator& it, const T& element)
309 { 309 {
310 SKListNode* node = allocator.allocate(1); 310 SKListNode* node = allocator.allocate(1);
311 allocator.construct(node, element); 311 allocator.construct(node, element);
312 312
313 node->Next = it.Current->Next; 313 node->Next = it.Current->Next;
314 314
315 if (it.Current->Next) 315 if (it.Current->Next)
316 it.Current->Next->Prev = node; 316 it.Current->Next->Prev = node;
317 317
318 node->Prev = it.Current; 318 node->Prev = it.Current;
319 it.Current->Next = node; 319 it.Current->Next = node;
320 ++Size; 320 ++Size;
321 321
322 if (it.Current == Last) 322 if (it.Current == Last)
323 Last = node; 323 Last = node;
324 } 324 }
325 325
326 326
327 //! Inserts an element before an element. 327 //! Inserts an element before an element.
328 /** \param it Iterator pointing to element before which the new element 328 /** \param it Iterator pointing to element before which the new element
329 should be inserted. 329 should be inserted.
330 \param element The new element to be inserted into the list. 330 \param element The new element to be inserted into the list.
331 */ 331 */
332 void insert_before(const Iterator& it, const T& element) 332 void insert_before(const Iterator& it, const T& element)
333 { 333 {
334 SKListNode* node = allocator.allocate(1); 334 SKListNode* node = allocator.allocate(1);
335 allocator.construct(node, element); 335 allocator.construct(node, element);
336 336
337 node->Prev = it.Current->Prev; 337 node->Prev = it.Current->Prev;
338 338
339 if (it.Current->Prev) 339 if (it.Current->Prev)
340 it.Current->Prev->Next = node; 340 it.Current->Prev->Next = node;
341 341
342 node->Next = it.Current; 342 node->Next = it.Current;
343 it.Current->Prev = node; 343 it.Current->Prev = node;
344 ++Size; 344 ++Size;
345 345
346 if (it.Current == First) 346 if (it.Current == First)
347 First = node; 347 First = node;
348 } 348 }
349 349
350 350
351 //! Erases an element. 351 //! Erases an element.
352 /** \param it Iterator pointing to the element which shall be erased. 352 /** \param it Iterator pointing to the element which shall be erased.
353 \return Iterator pointing to next element. */ 353 \return Iterator pointing to next element. */
354 Iterator erase(Iterator& it) 354 Iterator erase(Iterator& it)
355 { 355 {
356 // suggest changing this to a const Iterator& and 356 // suggest changing this to a const Iterator& and
357 // working around line: it.Current = 0 (possibly with a mutable, or just let it be garbage?) 357 // working around line: it.Current = 0 (possibly with a mutable, or just let it be garbage?)
358 358
359 Iterator returnIterator(it); 359 Iterator returnIterator(it);
360 ++returnIterator; 360 ++returnIterator;
361 361
362 if(it.Current == First) 362 if(it.Current == First)
363 { 363 {
364 First = it.Current->Next; 364 First = it.Current->Next;
365 } 365 }
366 else 366 else
367 { 367 {
368 it.Current->Prev->Next = it.Current->Next; 368 it.Current->Prev->Next = it.Current->Next;
369 } 369 }
370 370
371 if(it.Current == Last) 371 if(it.Current == Last)
372 { 372 {
373 Last = it.Current->Prev; 373 Last = it.Current->Prev;
374 } 374 }
375 else 375 else
376 { 376 {
377 it.Current->Next->Prev = it.Current->Prev; 377 it.Current->Next->Prev = it.Current->Prev;
378 } 378 }
379 379
380 allocator.destruct(it.Current); 380 allocator.destruct(it.Current);
381 allocator.deallocate(it.Current); 381 allocator.deallocate(it.Current);
382 it.Current = 0; 382 it.Current = 0;
383 --Size; 383 --Size;
384 384
385 return returnIterator; 385 return returnIterator;
386 } 386 }
387 387
388 //! Swap the content of this list container with the content of another list 388 //! Swap the content of this list container with the content of another list
389 /** Afterwards this object will contain the content of the other object and the other 389 /** Afterwards this object will contain the content of the other object and the other
390 object will contain the content of this object. Iterators will afterwards be valid for 390 object will contain the content of this object. Iterators will afterwards be valid for
391 the swapped object. 391 the swapped object.
392 \param other Swap content with this object */ 392 \param other Swap content with this object */
393 void swap(list<T>& other) 393 void swap(list<T>& other)
394 { 394 {
395 core::swap(First, other.First); 395 core::swap(First, other.First);
396 core::swap(Last, other.Last); 396 core::swap(Last, other.Last);
397 core::swap(Size, other.Size); 397 core::swap(Size, other.Size);
398 core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation 398 core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation
399 } 399 }
400 400
401 401
402private: 402private:
403 403
404 SKListNode* First; 404 SKListNode* First;
405 SKListNode* Last; 405 SKListNode* Last;
406 u32 Size; 406 u32 Size;
407 irrAllocator<SKListNode> allocator; 407 irrAllocator<SKListNode> allocator;
408 408
409}; 409};
410 410
411 411
412} // end namespace core 412} // end namespace core
413}// end namespace irr 413}// end namespace irr
414 414
415#endif 415#endif
416 416
diff --git a/libraries/irrlicht-1.8/include/irrMap.h b/libraries/irrlicht-1.8/include/irrMap.h
index 9e9ae73..6e15174 100644
--- a/libraries/irrlicht-1.8/include/irrMap.h
+++ b/libraries/irrlicht-1.8/include/irrMap.h
@@ -1,1127 +1,1127 @@
1// Copyright (C) 2006-2012 by Kat'Oun 1// Copyright (C) 2006-2012 by Kat'Oun
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#ifndef __IRR_MAP_H_INCLUDED__ 5#ifndef __IRR_MAP_H_INCLUDED__
6#define __IRR_MAP_H_INCLUDED__ 6#define __IRR_MAP_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include "irrMath.h" 9#include "irrMath.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace core 13namespace core
14{ 14{
15 15
16//! map template for associative arrays using a red-black tree 16//! map template for associative arrays using a red-black tree
17template <class KeyType, class ValueType> 17template <class KeyType, class ValueType>
18class map 18class map
19{ 19{
20 //! red/black tree for map 20 //! red/black tree for map
21 template <class KeyTypeRB, class ValueTypeRB> 21 template <class KeyTypeRB, class ValueTypeRB>
22 class RBTree 22 class RBTree
23 { 23 {
24 public: 24 public:
25 25
26 RBTree(const KeyTypeRB& k, const ValueTypeRB& v) 26 RBTree(const KeyTypeRB& k, const ValueTypeRB& v)
27 : LeftChild(0), RightChild(0), Parent(0), Key(k), 27 : LeftChild(0), RightChild(0), Parent(0), Key(k),
28 Value(v), IsRed(true) {} 28 Value(v), IsRed(true) {}
29 29
30 void setLeftChild(RBTree* p) 30 void setLeftChild(RBTree* p)
31 { 31 {
32 LeftChild=p; 32 LeftChild=p;
33 if (p) 33 if (p)
34 p->setParent(this); 34 p->setParent(this);
35 } 35 }
36 36
37 void setRightChild(RBTree* p) 37 void setRightChild(RBTree* p)
38 { 38 {
39 RightChild=p; 39 RightChild=p;
40 if (p) 40 if (p)
41 p->setParent(this); 41 p->setParent(this);
42 } 42 }
43 43
44 void setParent(RBTree* p) { Parent=p; } 44 void setParent(RBTree* p) { Parent=p; }
45 45
46 void setValue(const ValueTypeRB& v) { Value = v; } 46 void setValue(const ValueTypeRB& v) { Value = v; }
47 47
48 void setRed() { IsRed = true; } 48 void setRed() { IsRed = true; }
49 void setBlack() { IsRed = false; } 49 void setBlack() { IsRed = false; }
50 50
51 RBTree* getLeftChild() const { return LeftChild; } 51 RBTree* getLeftChild() const { return LeftChild; }
52 RBTree* getRightChild() const { return RightChild; } 52 RBTree* getRightChild() const { return RightChild; }
53 RBTree* getParent() const { return Parent; } 53 RBTree* getParent() const { return Parent; }
54 54
55 const ValueTypeRB& getValue() const 55 const ValueTypeRB& getValue() const
56 { 56 {
57 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 57 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
58 return Value; 58 return Value;
59 } 59 }
60 60
61 ValueTypeRB& getValue() 61 ValueTypeRB& getValue()
62 { 62 {
63 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 63 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
64 return Value; 64 return Value;
65 } 65 }
66 66
67 const KeyTypeRB& getKey() const 67 const KeyTypeRB& getKey() const
68 { 68 {
69 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 69 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
70 return Key; 70 return Key;
71 } 71 }
72 72
73 bool isRoot() const 73 bool isRoot() const
74 { 74 {
75 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 75 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
76 return Parent==0; 76 return Parent==0;
77 } 77 }
78 78
79 bool isLeftChild() const 79 bool isLeftChild() const
80 { 80 {
81 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 81 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
82 return (Parent != 0) && (Parent->getLeftChild()==this); 82 return (Parent != 0) && (Parent->getLeftChild()==this);
83 } 83 }
84 84
85 bool isRightChild() const 85 bool isRightChild() const
86 { 86 {
87 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 87 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
88 return (Parent!=0) && (Parent->getRightChild()==this); 88 return (Parent!=0) && (Parent->getRightChild()==this);
89 } 89 }
90 90
91 bool isLeaf() const 91 bool isLeaf() const
92 { 92 {
93 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 93 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
94 return (LeftChild==0) && (RightChild==0); 94 return (LeftChild==0) && (RightChild==0);
95 } 95 }
96 96
97 unsigned int getLevel() const 97 unsigned int getLevel() const
98 { 98 {
99 if (isRoot()) 99 if (isRoot())
100 return 1; 100 return 1;
101 else 101 else
102 return getParent()->getLevel() + 1; 102 return getParent()->getLevel() + 1;
103 } 103 }
104 104
105 105
106 bool isRed() const 106 bool isRed() const
107 { 107 {
108 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 108 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
109 return IsRed; 109 return IsRed;
110 } 110 }
111 111
112 bool isBlack() const 112 bool isBlack() const
113 { 113 {
114 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 114 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
115 return !IsRed; 115 return !IsRed;
116 } 116 }
117 117
118 private: 118 private:
119 RBTree(); 119 RBTree();
120 120
121 RBTree* LeftChild; 121 RBTree* LeftChild;
122 RBTree* RightChild; 122 RBTree* RightChild;
123 123
124 RBTree* Parent; 124 RBTree* Parent;
125 125
126 KeyTypeRB Key; 126 KeyTypeRB Key;
127 ValueTypeRB Value; 127 ValueTypeRB Value;
128 128
129 bool IsRed; 129 bool IsRed;
130 }; // RBTree 130 }; // RBTree
131 131
132 public: 132 public:
133 133
134 typedef RBTree<KeyType,ValueType> Node; 134 typedef RBTree<KeyType,ValueType> Node;
135 // We need the forwad declaration for the friend declaration 135 // We need the forwad declaration for the friend declaration
136 class ConstIterator; 136 class ConstIterator;
137 137
138 //! Normal Iterator 138 //! Normal Iterator
139 class Iterator 139 class Iterator
140 { 140 {
141 friend class ConstIterator; 141 friend class ConstIterator;
142 public: 142 public:
143 143
144 Iterator() : Root(0), Cur(0) {} 144 Iterator() : Root(0), Cur(0) {}
145 145
146 // Constructor(Node*) 146 // Constructor(Node*)
147 Iterator(Node* root) : Root(root) 147 Iterator(Node* root) : Root(root)
148 { 148 {
149 reset(); 149 reset();
150 } 150 }
151 151
152 // Copy constructor 152 // Copy constructor
153 Iterator(const Iterator& src) : Root(src.Root), Cur(src.Cur) {} 153 Iterator(const Iterator& src) : Root(src.Root), Cur(src.Cur) {}
154 154
155 void reset(bool atLowest=true) 155 void reset(bool atLowest=true)
156 { 156 {
157 if (atLowest) 157 if (atLowest)
158 Cur = getMin(Root); 158 Cur = getMin(Root);
159 else 159 else
160 Cur = getMax(Root); 160 Cur = getMax(Root);
161 } 161 }
162 162
163 bool atEnd() const 163 bool atEnd() const
164 { 164 {
165 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 165 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
166 return Cur==0; 166 return Cur==0;
167 } 167 }
168 168
169 Node* getNode() const 169 Node* getNode() const
170 { 170 {
171 return Cur; 171 return Cur;
172 } 172 }
173 173
174 Iterator& operator=(const Iterator& src) 174 Iterator& operator=(const Iterator& src)
175 { 175 {
176 Root = src.Root; 176 Root = src.Root;
177 Cur = src.Cur; 177 Cur = src.Cur;
178 return (*this); 178 return (*this);
179 } 179 }
180 180
181 void operator++(int) 181 void operator++(int)
182 { 182 {
183 inc(); 183 inc();
184 } 184 }
185 185
186 void operator--(int) 186 void operator--(int)
187 { 187 {
188 dec(); 188 dec();
189 } 189 }
190 190
191 Node* operator->() 191 Node* operator->()
192 { 192 {
193 return getNode(); 193 return getNode();
194 } 194 }
195 195
196 Node& operator*() 196 Node& operator*()
197 { 197 {
198 _IRR_DEBUG_BREAK_IF(atEnd()) // access violation 198 _IRR_DEBUG_BREAK_IF(atEnd()) // access violation
199 199
200 return *Cur; 200 return *Cur;
201 } 201 }
202 202
203 private: 203 private:
204 204
205 Node* getMin(Node* n) const 205 Node* getMin(Node* n) const
206 { 206 {
207 while(n && n->getLeftChild()) 207 while(n && n->getLeftChild())
208 n = n->getLeftChild(); 208 n = n->getLeftChild();
209 return n; 209 return n;
210 } 210 }
211 211
212 Node* getMax(Node* n) const 212 Node* getMax(Node* n) const
213 { 213 {
214 while(n && n->getRightChild()) 214 while(n && n->getRightChild())
215 n = n->getRightChild(); 215 n = n->getRightChild();
216 return n; 216 return n;
217 } 217 }
218 218
219 void inc() 219 void inc()
220 { 220 {
221 // Already at end? 221 // Already at end?
222 if (Cur==0) 222 if (Cur==0)
223 return; 223 return;
224 224
225 if (Cur->getRightChild()) 225 if (Cur->getRightChild())
226 { 226 {
227 // If current node has a right child, the next higher node is the 227 // If current node has a right child, the next higher node is the
228 // node with lowest key beneath the right child. 228 // node with lowest key beneath the right child.
229 Cur = getMin(Cur->getRightChild()); 229 Cur = getMin(Cur->getRightChild());
230 } 230 }
231 else if (Cur->isLeftChild()) 231 else if (Cur->isLeftChild())
232 { 232 {
233 // No right child? Well if current node is a left child then 233 // No right child? Well if current node is a left child then
234 // the next higher node is the parent 234 // the next higher node is the parent
235 Cur = Cur->getParent(); 235 Cur = Cur->getParent();
236 } 236 }
237 else 237 else
238 { 238 {
239 // Current node neither is left child nor has a right child. 239 // Current node neither is left child nor has a right child.
240 // Ie it is either right child or root 240 // Ie it is either right child or root
241 // The next higher node is the parent of the first non-right 241 // The next higher node is the parent of the first non-right
242 // child (ie either a left child or the root) up in the 242 // child (ie either a left child or the root) up in the
243 // hierarchy. Root's parent is 0. 243 // hierarchy. Root's parent is 0.
244 while(Cur->isRightChild()) 244 while(Cur->isRightChild())
245 Cur = Cur->getParent(); 245 Cur = Cur->getParent();
246 Cur = Cur->getParent(); 246 Cur = Cur->getParent();
247 } 247 }
248 } 248 }
249 249
250 void dec() 250 void dec()
251 { 251 {
252 // Already at end? 252 // Already at end?
253 if (Cur==0) 253 if (Cur==0)
254 return; 254 return;
255 255
256 if (Cur->getLeftChild()) 256 if (Cur->getLeftChild())
257 { 257 {
258 // If current node has a left child, the next lower node is the 258 // If current node has a left child, the next lower node is the
259 // node with highest key beneath the left child. 259 // node with highest key beneath the left child.
260 Cur = getMax(Cur->getLeftChild()); 260 Cur = getMax(Cur->getLeftChild());
261 } 261 }
262 else if (Cur->isRightChild()) 262 else if (Cur->isRightChild())
263 { 263 {
264 // No left child? Well if current node is a right child then 264 // No left child? Well if current node is a right child then
265 // the next lower node is the parent 265 // the next lower node is the parent
266 Cur = Cur->getParent(); 266 Cur = Cur->getParent();
267 } 267 }
268 else 268 else
269 { 269 {
270 // Current node neither is right child nor has a left child. 270 // Current node neither is right child nor has a left child.
271 // Ie it is either left child or root 271 // Ie it is either left child or root
272 // The next higher node is the parent of the first non-left 272 // The next higher node is the parent of the first non-left
273 // child (ie either a right child or the root) up in the 273 // child (ie either a right child or the root) up in the
274 // hierarchy. Root's parent is 0. 274 // hierarchy. Root's parent is 0.
275 275
276 while(Cur->isLeftChild()) 276 while(Cur->isLeftChild())
277 Cur = Cur->getParent(); 277 Cur = Cur->getParent();
278 Cur = Cur->getParent(); 278 Cur = Cur->getParent();
279 } 279 }
280 } 280 }
281 281
282 Node* Root; 282 Node* Root;
283 Node* Cur; 283 Node* Cur;
284 }; // Iterator 284 }; // Iterator
285 285
286 //! Const Iterator 286 //! Const Iterator
287 class ConstIterator 287 class ConstIterator
288 { 288 {
289 friend class Iterator; 289 friend class Iterator;
290 public: 290 public:
291 291
292 ConstIterator() : Root(0), Cur(0) {} 292 ConstIterator() : Root(0), Cur(0) {}
293 293
294 // Constructor(Node*) 294 // Constructor(Node*)
295 ConstIterator(const Node* root) : Root(root) 295 ConstIterator(const Node* root) : Root(root)
296 { 296 {
297 reset(); 297 reset();
298 } 298 }
299 299
300 // Copy constructor 300 // Copy constructor
301 ConstIterator(const ConstIterator& src) : Root(src.Root), Cur(src.Cur) {} 301 ConstIterator(const ConstIterator& src) : Root(src.Root), Cur(src.Cur) {}
302 ConstIterator(const Iterator& src) : Root(src.Root), Cur(src.Cur) {} 302 ConstIterator(const Iterator& src) : Root(src.Root), Cur(src.Cur) {}
303 303
304 void reset(bool atLowest=true) 304 void reset(bool atLowest=true)
305 { 305 {
306 if (atLowest) 306 if (atLowest)
307 Cur = getMin(Root); 307 Cur = getMin(Root);
308 else 308 else
309 Cur = getMax(Root); 309 Cur = getMax(Root);
310 } 310 }
311 311
312 bool atEnd() const 312 bool atEnd() const
313 { 313 {
314 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 314 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
315 return Cur==0; 315 return Cur==0;
316 } 316 }
317 317
318 const Node* getNode() const 318 const Node* getNode() const
319 { 319 {
320 return Cur; 320 return Cur;
321 } 321 }
322 322
323 ConstIterator& operator=(const ConstIterator& src) 323 ConstIterator& operator=(const ConstIterator& src)
324 { 324 {
325 Root = src.Root; 325 Root = src.Root;
326 Cur = src.Cur; 326 Cur = src.Cur;
327 return (*this); 327 return (*this);
328 } 328 }
329 329
330 void operator++(int) 330 void operator++(int)
331 { 331 {
332 inc(); 332 inc();
333 } 333 }
334 334
335 void operator--(int) 335 void operator--(int)
336 { 336 {
337 dec(); 337 dec();
338 } 338 }
339 339
340 const Node* operator->() 340 const Node* operator->()
341 { 341 {
342 return getNode(); 342 return getNode();
343 } 343 }
344 344
345 const Node& operator*() 345 const Node& operator*()
346 { 346 {
347 _IRR_DEBUG_BREAK_IF(atEnd()) // access violation 347 _IRR_DEBUG_BREAK_IF(atEnd()) // access violation
348 348
349 return *Cur; 349 return *Cur;
350 } 350 }
351 351
352 private: 352 private:
353 353
354 const Node* getMin(const Node* n) const 354 const Node* getMin(const Node* n) const
355 { 355 {
356 while(n && n->getLeftChild()) 356 while(n && n->getLeftChild())
357 n = n->getLeftChild(); 357 n = n->getLeftChild();
358 return n; 358 return n;
359 } 359 }
360 360
361 const Node* getMax(const Node* n) const 361 const Node* getMax(const Node* n) const
362 { 362 {
363 while(n && n->getRightChild()) 363 while(n && n->getRightChild())
364 n = n->getRightChild(); 364 n = n->getRightChild();
365 return n; 365 return n;
366 } 366 }
367 367
368 void inc() 368 void inc()
369 { 369 {
370 // Already at end? 370 // Already at end?
371 if (Cur==0) 371 if (Cur==0)
372 return; 372 return;
373 373
374 if (Cur->getRightChild()) 374 if (Cur->getRightChild())
375 { 375 {
376 // If current node has a right child, the next higher node is the 376 // If current node has a right child, the next higher node is the
377 // node with lowest key beneath the right child. 377 // node with lowest key beneath the right child.
378 Cur = getMin(Cur->getRightChild()); 378 Cur = getMin(Cur->getRightChild());
379 } 379 }
380 else if (Cur->isLeftChild()) 380 else if (Cur->isLeftChild())
381 { 381 {
382 // No right child? Well if current node is a left child then 382 // No right child? Well if current node is a left child then
383 // the next higher node is the parent 383 // the next higher node is the parent
384 Cur = Cur->getParent(); 384 Cur = Cur->getParent();
385 } 385 }
386 else 386 else
387 { 387 {
388 // Current node neither is left child nor has a right child. 388 // Current node neither is left child nor has a right child.
389 // Ie it is either right child or root 389 // Ie it is either right child or root
390 // The next higher node is the parent of the first non-right 390 // The next higher node is the parent of the first non-right
391 // child (ie either a left child or the root) up in the 391 // child (ie either a left child or the root) up in the
392 // hierarchy. Root's parent is 0. 392 // hierarchy. Root's parent is 0.
393 while(Cur->isRightChild()) 393 while(Cur->isRightChild())
394 Cur = Cur->getParent(); 394 Cur = Cur->getParent();
395 Cur = Cur->getParent(); 395 Cur = Cur->getParent();
396 } 396 }
397 } 397 }
398 398
399 void dec() 399 void dec()
400 { 400 {
401 // Already at end? 401 // Already at end?
402 if (Cur==0) 402 if (Cur==0)
403 return; 403 return;
404 404
405 if (Cur->getLeftChild()) 405 if (Cur->getLeftChild())
406 { 406 {
407 // If current node has a left child, the next lower node is the 407 // If current node has a left child, the next lower node is the
408 // node with highest key beneath the left child. 408 // node with highest key beneath the left child.
409 Cur = getMax(Cur->getLeftChild()); 409 Cur = getMax(Cur->getLeftChild());
410 } 410 }
411 else if (Cur->isRightChild()) 411 else if (Cur->isRightChild())
412 { 412 {
413 // No left child? Well if current node is a right child then 413 // No left child? Well if current node is a right child then
414 // the next lower node is the parent 414 // the next lower node is the parent
415 Cur = Cur->getParent(); 415 Cur = Cur->getParent();
416 } 416 }
417 else 417 else
418 { 418 {
419 // Current node neither is right child nor has a left child. 419 // Current node neither is right child nor has a left child.
420 // Ie it is either left child or root 420 // Ie it is either left child or root
421 // The next higher node is the parent of the first non-left 421 // The next higher node is the parent of the first non-left
422 // child (ie either a right child or the root) up in the 422 // child (ie either a right child or the root) up in the
423 // hierarchy. Root's parent is 0. 423 // hierarchy. Root's parent is 0.
424 424
425 while(Cur->isLeftChild()) 425 while(Cur->isLeftChild())
426 Cur = Cur->getParent(); 426 Cur = Cur->getParent();
427 Cur = Cur->getParent(); 427 Cur = Cur->getParent();
428 } 428 }
429 } 429 }
430 430
431 const Node* Root; 431 const Node* Root;
432 const Node* Cur; 432 const Node* Cur;
433 }; // ConstIterator 433 }; // ConstIterator
434 434
435 435
436 //! Parent First Iterator. 436 //! Parent First Iterator.
437 /** Traverses the tree from top to bottom. Typical usage is 437 /** Traverses the tree from top to bottom. Typical usage is
438 when storing the tree structure, because when reading it 438 when storing the tree structure, because when reading it
439 later (and inserting elements) the tree structure will 439 later (and inserting elements) the tree structure will
440 be the same. */ 440 be the same. */
441 class ParentFirstIterator 441 class ParentFirstIterator
442 { 442 {
443 public: 443 public:
444 444
445 ParentFirstIterator() : Root(0), Cur(0) {} 445 ParentFirstIterator() : Root(0), Cur(0) {}
446 446
447 explicit ParentFirstIterator(Node* root) : Root(root), Cur(0) 447 explicit ParentFirstIterator(Node* root) : Root(root), Cur(0)
448 { 448 {
449 reset(); 449 reset();
450 } 450 }
451 451
452 void reset() 452 void reset()
453 { 453 {
454 Cur = Root; 454 Cur = Root;
455 } 455 }
456 456
457 bool atEnd() const 457 bool atEnd() const
458 { 458 {
459 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 459 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
460 return Cur==0; 460 return Cur==0;
461 } 461 }
462 462
463 Node* getNode() 463 Node* getNode()
464 { 464 {
465 return Cur; 465 return Cur;
466 } 466 }
467 467
468 ParentFirstIterator& operator=(const ParentFirstIterator& src) 468 ParentFirstIterator& operator=(const ParentFirstIterator& src)
469 { 469 {
470 Root = src.Root; 470 Root = src.Root;
471 Cur = src.Cur; 471 Cur = src.Cur;
472 return (*this); 472 return (*this);
473 } 473 }
474 474
475 void operator++(int) 475 void operator++(int)
476 { 476 {
477 inc(); 477 inc();
478 } 478 }
479 479
480 Node* operator -> () 480 Node* operator -> ()
481 { 481 {
482 return getNode(); 482 return getNode();
483 } 483 }
484 484
485 Node& operator* () 485 Node& operator* ()
486 { 486 {
487 _IRR_DEBUG_BREAK_IF(atEnd()) // access violation 487 _IRR_DEBUG_BREAK_IF(atEnd()) // access violation
488 488
489 return *getNode(); 489 return *getNode();
490 } 490 }
491 491
492 private: 492 private:
493 493
494 void inc() 494 void inc()
495 { 495 {
496 // Already at end? 496 // Already at end?
497 if (Cur==0) 497 if (Cur==0)
498 return; 498 return;
499 499
500 // First we try down to the left 500 // First we try down to the left
501 if (Cur->getLeftChild()) 501 if (Cur->getLeftChild())
502 { 502 {
503 Cur = Cur->getLeftChild(); 503 Cur = Cur->getLeftChild();
504 } 504 }
505 else if (Cur->getRightChild()) 505 else if (Cur->getRightChild())
506 { 506 {
507 // No left child? The we go down to the right. 507 // No left child? The we go down to the right.
508 Cur = Cur->getRightChild(); 508 Cur = Cur->getRightChild();
509 } 509 }
510 else 510 else
511 { 511 {
512 // No children? Move up in the hierarcy until 512 // No children? Move up in the hierarcy until
513 // we either reach 0 (and are finished) or 513 // we either reach 0 (and are finished) or
514 // find a right uncle. 514 // find a right uncle.
515 while (Cur!=0) 515 while (Cur!=0)
516 { 516 {
517 // But if parent is left child and has a right "uncle" the parent 517 // But if parent is left child and has a right "uncle" the parent
518 // has already been processed but the uncle hasn't. Move to 518 // has already been processed but the uncle hasn't. Move to
519 // the uncle. 519 // the uncle.
520 if (Cur->isLeftChild() && Cur->getParent()->getRightChild()) 520 if (Cur->isLeftChild() && Cur->getParent()->getRightChild())
521 { 521 {
522 Cur = Cur->getParent()->getRightChild(); 522 Cur = Cur->getParent()->getRightChild();
523 return; 523 return;
524 } 524 }
525 Cur = Cur->getParent(); 525 Cur = Cur->getParent();
526 } 526 }
527 } 527 }
528 } 528 }
529 529
530 Node* Root; 530 Node* Root;
531 Node* Cur; 531 Node* Cur;
532 532
533 }; // ParentFirstIterator 533 }; // ParentFirstIterator
534 534
535 535
536 //! Parent Last Iterator 536 //! Parent Last Iterator
537 /** Traverse the tree from bottom to top. 537 /** Traverse the tree from bottom to top.
538 Typical usage is when deleting all elements in the tree 538 Typical usage is when deleting all elements in the tree
539 because you must delete the children before you delete 539 because you must delete the children before you delete
540 their parent. */ 540 their parent. */
541 class ParentLastIterator 541 class ParentLastIterator
542 { 542 {
543 public: 543 public:
544 544
545 ParentLastIterator() : Root(0), Cur(0) {} 545 ParentLastIterator() : Root(0), Cur(0) {}
546 546
547 explicit ParentLastIterator(Node* root) : Root(root), Cur(0) 547 explicit ParentLastIterator(Node* root) : Root(root), Cur(0)
548 { 548 {
549 reset(); 549 reset();
550 } 550 }
551 551
552 void reset() 552 void reset()
553 { 553 {
554 Cur = getMin(Root); 554 Cur = getMin(Root);
555 } 555 }
556 556
557 bool atEnd() const 557 bool atEnd() const
558 { 558 {
559 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 559 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
560 return Cur==0; 560 return Cur==0;
561 } 561 }
562 562
563 Node* getNode() 563 Node* getNode()
564 { 564 {
565 return Cur; 565 return Cur;
566 } 566 }
567 567
568 ParentLastIterator& operator=(const ParentLastIterator& src) 568 ParentLastIterator& operator=(const ParentLastIterator& src)
569 { 569 {
570 Root = src.Root; 570 Root = src.Root;
571 Cur = src.Cur; 571 Cur = src.Cur;
572 return (*this); 572 return (*this);
573 } 573 }
574 574
575 void operator++(int) 575 void operator++(int)
576 { 576 {
577 inc(); 577 inc();
578 } 578 }
579 579
580 Node* operator -> () 580 Node* operator -> ()
581 { 581 {
582 return getNode(); 582 return getNode();
583 } 583 }
584 584
585 Node& operator* () 585 Node& operator* ()
586 { 586 {
587 _IRR_DEBUG_BREAK_IF(atEnd()) // access violation 587 _IRR_DEBUG_BREAK_IF(atEnd()) // access violation
588 588
589 return *getNode(); 589 return *getNode();
590 } 590 }
591 private: 591 private:
592 592
593 Node* getMin(Node* n) 593 Node* getMin(Node* n)
594 { 594 {
595 while(n!=0 && (n->getLeftChild()!=0 || n->getRightChild()!=0)) 595 while(n!=0 && (n->getLeftChild()!=0 || n->getRightChild()!=0))
596 { 596 {
597 if (n->getLeftChild()) 597 if (n->getLeftChild())
598 n = n->getLeftChild(); 598 n = n->getLeftChild();
599 else 599 else
600 n = n->getRightChild(); 600 n = n->getRightChild();
601 } 601 }
602 return n; 602 return n;
603 } 603 }
604 604
605 void inc() 605 void inc()
606 { 606 {
607 // Already at end? 607 // Already at end?
608 if (Cur==0) 608 if (Cur==0)
609 return; 609 return;
610 610
611 // Note: Starting point is the node as far down to the left as possible. 611 // Note: Starting point is the node as far down to the left as possible.
612 612
613 // If current node has an uncle to the right, go to the 613 // If current node has an uncle to the right, go to the
614 // node as far down to the left from the uncle as possible 614 // node as far down to the left from the uncle as possible
615 // else just go up a level to the parent. 615 // else just go up a level to the parent.
616 if (Cur->isLeftChild() && Cur->getParent()->getRightChild()) 616 if (Cur->isLeftChild() && Cur->getParent()->getRightChild())
617 { 617 {
618 Cur = getMin(Cur->getParent()->getRightChild()); 618 Cur = getMin(Cur->getParent()->getRightChild());
619 } 619 }
620 else 620 else
621 Cur = Cur->getParent(); 621 Cur = Cur->getParent();
622 } 622 }
623 623
624 Node* Root; 624 Node* Root;
625 Node* Cur; 625 Node* Cur;
626 }; // ParentLastIterator 626 }; // ParentLastIterator
627 627
628 628
629 // AccessClass is a temporary class used with the [] operator. 629 // AccessClass is a temporary class used with the [] operator.
630 // It makes it possible to have different behavior in situations like: 630 // It makes it possible to have different behavior in situations like:
631 // myTree["Foo"] = 32; 631 // myTree["Foo"] = 32;
632 // If "Foo" already exists update its value else insert a new element. 632 // If "Foo" already exists update its value else insert a new element.
633 // int i = myTree["Foo"] 633 // int i = myTree["Foo"]
634 // If "Foo" exists return its value. 634 // If "Foo" exists return its value.
635 class AccessClass 635 class AccessClass
636 { 636 {
637 // Let map be the only one who can instantiate this class. 637 // Let map be the only one who can instantiate this class.
638 friend class map<KeyType, ValueType>; 638 friend class map<KeyType, ValueType>;
639 639
640 public: 640 public:
641 641
642 // Assignment operator. Handles the myTree["Foo"] = 32; situation 642 // Assignment operator. Handles the myTree["Foo"] = 32; situation
643 void operator=(const ValueType& value) 643 void operator=(const ValueType& value)
644 { 644 {
645 // Just use the Set method, it handles already exist/not exist situation 645 // Just use the Set method, it handles already exist/not exist situation
646 Tree.set(Key,value); 646 Tree.set(Key,value);
647 } 647 }
648 648
649 // ValueType operator 649 // ValueType operator
650 operator ValueType() 650 operator ValueType()
651 { 651 {
652 Node* node = Tree.find(Key); 652 Node* node = Tree.find(Key);
653 653
654 // Not found 654 // Not found
655 _IRR_DEBUG_BREAK_IF(node==0) // access violation 655 _IRR_DEBUG_BREAK_IF(node==0) // access violation
656 656
657 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 657 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
658 return node->getValue(); 658 return node->getValue();
659 } 659 }
660 660
661 private: 661 private:
662 662
663 AccessClass(map& tree, const KeyType& key) : Tree(tree), Key(key) {} 663 AccessClass(map& tree, const KeyType& key) : Tree(tree), Key(key) {}
664 664
665 AccessClass(); 665 AccessClass();
666 666
667 map& Tree; 667 map& Tree;
668 const KeyType& Key; 668 const KeyType& Key;
669 }; // AccessClass 669 }; // AccessClass
670 670
671 671
672 // Constructor. 672 // Constructor.
673 map() : Root(0), Size(0) {} 673 map() : Root(0), Size(0) {}
674 674
675 // Destructor 675 // Destructor
676 ~map() 676 ~map()
677 { 677 {
678 clear(); 678 clear();
679 } 679 }
680 680
681 //------------------------------ 681 //------------------------------
682 // Public Commands 682 // Public Commands
683 //------------------------------ 683 //------------------------------
684 684
685 //! Inserts a new node into the tree 685 //! Inserts a new node into the tree
686 /** \param keyNew: the index for this value 686 /** \param keyNew: the index for this value
687 \param v: the value to insert 687 \param v: the value to insert
688 \return True if successful, false if it fails (already exists) */ 688 \return True if successful, false if it fails (already exists) */
689 bool insert(const KeyType& keyNew, const ValueType& v) 689 bool insert(const KeyType& keyNew, const ValueType& v)
690 { 690 {
691 // First insert node the "usual" way (no fancy balance logic yet) 691 // First insert node the "usual" way (no fancy balance logic yet)
692 Node* newNode = new Node(keyNew,v); 692 Node* newNode = new Node(keyNew,v);
693 if (!insert(newNode)) 693 if (!insert(newNode))
694 { 694 {
695 delete newNode; 695 delete newNode;
696 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 696 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
697 return false; 697 return false;
698 } 698 }
699 699
700 // Then attend a balancing party 700 // Then attend a balancing party
701 while (!newNode->isRoot() && (newNode->getParent()->isRed())) 701 while (!newNode->isRoot() && (newNode->getParent()->isRed()))
702 { 702 {
703 if (newNode->getParent()->isLeftChild()) 703 if (newNode->getParent()->isLeftChild())
704 { 704 {
705 // If newNode is a left child, get its right 'uncle' 705 // If newNode is a left child, get its right 'uncle'
706 Node* newNodesUncle = newNode->getParent()->getParent()->getRightChild(); 706 Node* newNodesUncle = newNode->getParent()->getParent()->getRightChild();
707 if ( newNodesUncle!=0 && newNodesUncle->isRed()) 707 if ( newNodesUncle!=0 && newNodesUncle->isRed())
708 { 708 {
709 // case 1 - change the colors 709 // case 1 - change the colors
710 newNode->getParent()->setBlack(); 710 newNode->getParent()->setBlack();
711 newNodesUncle->setBlack(); 711 newNodesUncle->setBlack();
712 newNode->getParent()->getParent()->setRed(); 712 newNode->getParent()->getParent()->setRed();
713 // Move newNode up the tree 713 // Move newNode up the tree
714 newNode = newNode->getParent()->getParent(); 714 newNode = newNode->getParent()->getParent();
715 } 715 }
716 else 716 else
717 { 717 {
718 // newNodesUncle is a black node 718 // newNodesUncle is a black node
719 if ( newNode->isRightChild()) 719 if ( newNode->isRightChild())
720 { 720 {
721 // and newNode is to the right 721 // and newNode is to the right
722 // case 2 - move newNode up and rotate 722 // case 2 - move newNode up and rotate
723 newNode = newNode->getParent(); 723 newNode = newNode->getParent();
724 rotateLeft(newNode); 724 rotateLeft(newNode);
725 } 725 }
726 // case 3 726 // case 3
727 newNode->getParent()->setBlack(); 727 newNode->getParent()->setBlack();
728 newNode->getParent()->getParent()->setRed(); 728 newNode->getParent()->getParent()->setRed();
729 rotateRight(newNode->getParent()->getParent()); 729 rotateRight(newNode->getParent()->getParent());
730 } 730 }
731 } 731 }
732 else 732 else
733 { 733 {
734 // If newNode is a right child, get its left 'uncle' 734 // If newNode is a right child, get its left 'uncle'
735 Node* newNodesUncle = newNode->getParent()->getParent()->getLeftChild(); 735 Node* newNodesUncle = newNode->getParent()->getParent()->getLeftChild();
736 if ( newNodesUncle!=0 && newNodesUncle->isRed()) 736 if ( newNodesUncle!=0 && newNodesUncle->isRed())
737 { 737 {
738 // case 1 - change the colors 738 // case 1 - change the colors
739 newNode->getParent()->setBlack(); 739 newNode->getParent()->setBlack();
740 newNodesUncle->setBlack(); 740 newNodesUncle->setBlack();
741 newNode->getParent()->getParent()->setRed(); 741 newNode->getParent()->getParent()->setRed();
742 // Move newNode up the tree 742 // Move newNode up the tree
743 newNode = newNode->getParent()->getParent(); 743 newNode = newNode->getParent()->getParent();
744 } 744 }
745 else 745 else
746 { 746 {
747 // newNodesUncle is a black node 747 // newNodesUncle is a black node
748 if (newNode->isLeftChild()) 748 if (newNode->isLeftChild())
749 { 749 {
750 // and newNode is to the left 750 // and newNode is to the left
751 // case 2 - move newNode up and rotate 751 // case 2 - move newNode up and rotate
752 newNode = newNode->getParent(); 752 newNode = newNode->getParent();
753 rotateRight(newNode); 753 rotateRight(newNode);
754 } 754 }
755 // case 3 755 // case 3
756 newNode->getParent()->setBlack(); 756 newNode->getParent()->setBlack();
757 newNode->getParent()->getParent()->setRed(); 757 newNode->getParent()->getParent()->setRed();
758 rotateLeft(newNode->getParent()->getParent()); 758 rotateLeft(newNode->getParent()->getParent());
759 } 759 }
760 760
761 } 761 }
762 } 762 }
763 // Color the root black 763 // Color the root black
764 Root->setBlack(); 764 Root->setBlack();
765 return true; 765 return true;
766 } 766 }
767 767
768 //! Replaces the value if the key already exists, otherwise inserts a new element. 768 //! Replaces the value if the key already exists, otherwise inserts a new element.
769 /** \param k The index for this value 769 /** \param k The index for this value
770 \param v The new value of */ 770 \param v The new value of */
771 void set(const KeyType& k, const ValueType& v) 771 void set(const KeyType& k, const ValueType& v)
772 { 772 {
773 Node* p = find(k); 773 Node* p = find(k);
774 if (p) 774 if (p)
775 p->setValue(v); 775 p->setValue(v);
776 else 776 else
777 insert(k,v); 777 insert(k,v);
778 } 778 }
779 779
780 //! Removes a node from the tree and returns it. 780 //! Removes a node from the tree and returns it.
781 /** The returned node must be deleted by the user 781 /** The returned node must be deleted by the user
782 \param k the key to remove 782 \param k the key to remove
783 \return A pointer to the node, or 0 if not found */ 783 \return A pointer to the node, or 0 if not found */
784 Node* delink(const KeyType& k) 784 Node* delink(const KeyType& k)
785 { 785 {
786 Node* p = find(k); 786 Node* p = find(k);
787 if (p == 0) 787 if (p == 0)
788 return 0; 788 return 0;
789 789
790 // Rotate p down to the left until it has no right child, will get there 790 // Rotate p down to the left until it has no right child, will get there
791 // sooner or later. 791 // sooner or later.
792 while(p->getRightChild()) 792 while(p->getRightChild())
793 { 793 {
794 // "Pull up my right child and let it knock me down to the left" 794 // "Pull up my right child and let it knock me down to the left"
795 rotateLeft(p); 795 rotateLeft(p);
796 } 796 }
797 // p now has no right child but might have a left child 797 // p now has no right child but might have a left child
798 Node* left = p->getLeftChild(); 798 Node* left = p->getLeftChild();
799 799
800 // Let p's parent point to p's child instead of point to p 800 // Let p's parent point to p's child instead of point to p
801 if (p->isLeftChild()) 801 if (p->isLeftChild())
802 p->getParent()->setLeftChild(left); 802 p->getParent()->setLeftChild(left);
803 803
804 else if (p->isRightChild()) 804 else if (p->isRightChild())
805 p->getParent()->setRightChild(left); 805 p->getParent()->setRightChild(left);
806 806
807 else 807 else
808 { 808 {
809 // p has no parent => p is the root. 809 // p has no parent => p is the root.
810 // Let the left child be the new root. 810 // Let the left child be the new root.
811 setRoot(left); 811 setRoot(left);
812 } 812 }
813 813
814 // p is now gone from the tree in the sense that 814 // p is now gone from the tree in the sense that
815 // no one is pointing at it, so return it. 815 // no one is pointing at it, so return it.
816 816
817 --Size; 817 --Size;
818 return p; 818 return p;
819 } 819 }
820 820
821 //! Removes a node from the tree and deletes it. 821 //! Removes a node from the tree and deletes it.
822 /** \return True if the node was found and deleted */ 822 /** \return True if the node was found and deleted */
823 bool remove(const KeyType& k) 823 bool remove(const KeyType& k)
824 { 824 {
825 Node* p = find(k); 825 Node* p = find(k);
826 return remove(p); 826 return remove(p);
827 } 827 }
828 828
829 //! Removes a node from the tree and deletes it. 829 //! Removes a node from the tree and deletes it.
830 /** \return True if the node was found and deleted */ 830 /** \return True if the node was found and deleted */
831 bool remove(Node* p) 831 bool remove(Node* p)
832 { 832 {
833 if (p == 0) 833 if (p == 0)
834 { 834 {
835 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 835 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
836 return false; 836 return false;
837 } 837 }
838 838
839 // Rotate p down to the left until it has no right child, will get there 839 // Rotate p down to the left until it has no right child, will get there
840 // sooner or later. 840 // sooner or later.
841 while(p->getRightChild()) 841 while(p->getRightChild())
842 { 842 {
843 // "Pull up my right child and let it knock me down to the left" 843 // "Pull up my right child and let it knock me down to the left"
844 rotateLeft(p); 844 rotateLeft(p);
845 } 845 }
846 // p now has no right child but might have a left child 846 // p now has no right child but might have a left child
847 Node* left = p->getLeftChild(); 847 Node* left = p->getLeftChild();
848 848
849 // Let p's parent point to p's child instead of point to p 849 // Let p's parent point to p's child instead of point to p
850 if (p->isLeftChild()) 850 if (p->isLeftChild())
851 p->getParent()->setLeftChild(left); 851 p->getParent()->setLeftChild(left);
852 852
853 else if (p->isRightChild()) 853 else if (p->isRightChild())
854 p->getParent()->setRightChild(left); 854 p->getParent()->setRightChild(left);
855 855
856 else 856 else
857 { 857 {
858 // p has no parent => p is the root. 858 // p has no parent => p is the root.
859 // Let the left child be the new root. 859 // Let the left child be the new root.
860 setRoot(left); 860 setRoot(left);
861 } 861 }
862 862
863 // p is now gone from the tree in the sense that 863 // p is now gone from the tree in the sense that
864 // no one is pointing at it. Let's get rid of it. 864 // no one is pointing at it. Let's get rid of it.
865 delete p; 865 delete p;
866 866
867 --Size; 867 --Size;
868 return true; 868 return true;
869 } 869 }
870 870
871 //! Clear the entire tree 871 //! Clear the entire tree
872 void clear() 872 void clear()
873 { 873 {
874 ParentLastIterator i(getParentLastIterator()); 874 ParentLastIterator i(getParentLastIterator());
875 875
876 while(!i.atEnd()) 876 while(!i.atEnd())
877 { 877 {
878 Node* p = i.getNode(); 878 Node* p = i.getNode();
879 i++; // Increment it before it is deleted 879 i++; // Increment it before it is deleted
880 // else iterator will get quite confused. 880 // else iterator will get quite confused.
881 delete p; 881 delete p;
882 } 882 }
883 Root = 0; 883 Root = 0;
884 Size= 0; 884 Size= 0;
885 } 885 }
886 886
887 //! Is the tree empty? 887 //! Is the tree empty?
888 //! \return Returns true if empty, false if not 888 //! \return Returns true if empty, false if not
889 bool empty() const 889 bool empty() const
890 { 890 {
891 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 891 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
892 return Root == 0; 892 return Root == 0;
893 } 893 }
894 894
895 //! \deprecated Use empty() instead. This method may be removed by Irrlicht 1.9 895 //! \deprecated Use empty() instead. This method may be removed by Irrlicht 1.9
896 _IRR_DEPRECATED_ bool isEmpty() const 896 _IRR_DEPRECATED_ bool isEmpty() const
897 { 897 {
898 return empty(); 898 return empty();
899 } 899 }
900 900
901 //! Search for a node with the specified key. 901 //! Search for a node with the specified key.
902 //! \param keyToFind: The key to find 902 //! \param keyToFind: The key to find
903 //! \return Returns 0 if node couldn't be found. 903 //! \return Returns 0 if node couldn't be found.
904 Node* find(const KeyType& keyToFind) const 904 Node* find(const KeyType& keyToFind) const
905 { 905 {
906 Node* pNode = Root; 906 Node* pNode = Root;
907 907
908 while(pNode!=0) 908 while(pNode!=0)
909 { 909 {
910 const KeyType& key=pNode->getKey(); 910 const KeyType& key=pNode->getKey();
911 911
912 if (keyToFind == key) 912 if (keyToFind == key)
913 return pNode; 913 return pNode;
914 else if (keyToFind < key) 914 else if (keyToFind < key)
915 pNode = pNode->getLeftChild(); 915 pNode = pNode->getLeftChild();
916 else //keyToFind > key 916 else //keyToFind > key
917 pNode = pNode->getRightChild(); 917 pNode = pNode->getRightChild();
918 } 918 }
919 919
920 return 0; 920 return 0;
921 } 921 }
922 922
923 //! Gets the root element. 923 //! Gets the root element.
924 //! \return Returns a pointer to the root node, or 924 //! \return Returns a pointer to the root node, or
925 //! 0 if the tree is empty. 925 //! 0 if the tree is empty.
926 Node* getRoot() const 926 Node* getRoot() const
927 { 927 {
928 return Root; 928 return Root;
929 } 929 }
930 930
931 //! Returns the number of nodes in the tree. 931 //! Returns the number of nodes in the tree.
932 u32 size() const 932 u32 size() const
933 { 933 {
934 return Size; 934 return Size;
935 } 935 }
936 936
937 //! Swap the content of this map container with the content of another map 937 //! Swap the content of this map container with the content of another map
938 /** Afterwards this object will contain the content of the other object and the other 938 /** Afterwards this object will contain the content of the other object and the other
939 object will contain the content of this object. Iterators will afterwards be valid for 939 object will contain the content of this object. Iterators will afterwards be valid for
940 the swapped object. 940 the swapped object.
941 \param other Swap content with this object */ 941 \param other Swap content with this object */
942 void swap(map<KeyType, ValueType>& other) 942 void swap(map<KeyType, ValueType>& other)
943 { 943 {
944 core::swap(Root, other.Root); 944 core::swap(Root, other.Root);
945 core::swap(Size, other.Size); 945 core::swap(Size, other.Size);
946 } 946 }
947 947
948 //------------------------------ 948 //------------------------------
949 // Public Iterators 949 // Public Iterators
950 //------------------------------ 950 //------------------------------
951 951
952 //! Returns an iterator 952 //! Returns an iterator
953 Iterator getIterator() const 953 Iterator getIterator() const
954 { 954 {
955 Iterator it(getRoot()); 955 Iterator it(getRoot());
956 return it; 956 return it;
957 } 957 }
958 958
959 //! Returns a Constiterator 959 //! Returns a Constiterator
960 ConstIterator getConstIterator() const 960 ConstIterator getConstIterator() const
961 { 961 {
962 Iterator it(getRoot()); 962 Iterator it(getRoot());
963 return it; 963 return it;
964 } 964 }
965 965
966 //! Returns a ParentFirstIterator. 966 //! Returns a ParentFirstIterator.
967 //! Traverses the tree from top to bottom. Typical usage is 967 //! Traverses the tree from top to bottom. Typical usage is
968 //! when storing the tree structure, because when reading it 968 //! when storing the tree structure, because when reading it
969 //! later (and inserting elements) the tree structure will 969 //! later (and inserting elements) the tree structure will
970 //! be the same. 970 //! be the same.
971 ParentFirstIterator getParentFirstIterator() const 971 ParentFirstIterator getParentFirstIterator() const
972 { 972 {
973 ParentFirstIterator it(getRoot()); 973 ParentFirstIterator it(getRoot());
974 return it; 974 return it;
975 } 975 }
976 976
977 //! Returns a ParentLastIterator to traverse the tree from 977 //! Returns a ParentLastIterator to traverse the tree from
978 //! bottom to top. 978 //! bottom to top.
979 //! Typical usage is when deleting all elements in the tree 979 //! Typical usage is when deleting all elements in the tree
980 //! because you must delete the children before you delete 980 //! because you must delete the children before you delete
981 //! their parent. 981 //! their parent.
982 ParentLastIterator getParentLastIterator() const 982 ParentLastIterator getParentLastIterator() const
983 { 983 {
984 ParentLastIterator it(getRoot()); 984 ParentLastIterator it(getRoot());
985 return it; 985 return it;
986 } 986 }
987 987
988 //------------------------------ 988 //------------------------------
989 // Public Operators 989 // Public Operators
990 //------------------------------ 990 //------------------------------
991 991
992 //! operator [] for access to elements 992 //! operator [] for access to elements
993 /** for example myMap["key"] */ 993 /** for example myMap["key"] */
994 AccessClass operator[](const KeyType& k) 994 AccessClass operator[](const KeyType& k)
995 { 995 {
996 return AccessClass(*this, k); 996 return AccessClass(*this, k);
997 } 997 }
998 private: 998 private:
999 999
1000 //------------------------------ 1000 //------------------------------
1001 // Disabled methods 1001 // Disabled methods
1002 //------------------------------ 1002 //------------------------------
1003 // Copy constructor and assignment operator deliberately 1003 // Copy constructor and assignment operator deliberately
1004 // defined but not implemented. The tree should never be 1004 // defined but not implemented. The tree should never be
1005 // copied, pass along references to it instead. 1005 // copied, pass along references to it instead.
1006 explicit map(const map& src); 1006 explicit map(const map& src);
1007 map& operator = (const map& src); 1007 map& operator = (const map& src);
1008 1008
1009 //! Set node as new root. 1009 //! Set node as new root.
1010 /** The node will be set to black, otherwise core dumps may arise 1010 /** The node will be set to black, otherwise core dumps may arise
1011 (patch provided by rogerborg). 1011 (patch provided by rogerborg).
1012 \param newRoot Node which will be the new root 1012 \param newRoot Node which will be the new root
1013 */ 1013 */
1014 void setRoot(Node* newRoot) 1014 void setRoot(Node* newRoot)
1015 { 1015 {
1016 Root = newRoot; 1016 Root = newRoot;
1017 if (Root != 0) 1017 if (Root != 0)
1018 { 1018 {
1019 Root->setParent(0); 1019 Root->setParent(0);
1020 Root->setBlack(); 1020 Root->setBlack();
1021 } 1021 }
1022 } 1022 }
1023 1023
1024 //! Insert a node into the tree without using any fancy balancing logic. 1024 //! Insert a node into the tree without using any fancy balancing logic.
1025 /** \return false if that key already exist in the tree. */ 1025 /** \return false if that key already exist in the tree. */
1026 bool insert(Node* newNode) 1026 bool insert(Node* newNode)
1027 { 1027 {
1028 bool result=true; // Assume success 1028 bool result=true; // Assume success
1029 1029
1030 if (Root==0) 1030 if (Root==0)
1031 { 1031 {
1032 setRoot(newNode); 1032 setRoot(newNode);
1033 Size = 1; 1033 Size = 1;
1034 } 1034 }
1035 else 1035 else
1036 { 1036 {
1037 Node* pNode = Root; 1037 Node* pNode = Root;
1038 const KeyType& keyNew = newNode->getKey(); 1038 const KeyType& keyNew = newNode->getKey();
1039 while (pNode) 1039 while (pNode)
1040 { 1040 {
1041 const KeyType& key=pNode->getKey(); 1041 const KeyType& key=pNode->getKey();
1042 1042
1043 if (keyNew == key) 1043 if (keyNew == key)
1044 { 1044 {
1045 result = false; 1045 result = false;
1046 pNode = 0; 1046 pNode = 0;
1047 } 1047 }
1048 else if (keyNew < key) 1048 else if (keyNew < key)
1049 { 1049 {
1050 if (pNode->getLeftChild() == 0) 1050 if (pNode->getLeftChild() == 0)
1051 { 1051 {
1052 pNode->setLeftChild(newNode); 1052 pNode->setLeftChild(newNode);
1053 pNode = 0; 1053 pNode = 0;
1054 } 1054 }
1055 else 1055 else
1056 pNode = pNode->getLeftChild(); 1056 pNode = pNode->getLeftChild();
1057 } 1057 }
1058 else // keyNew > key 1058 else // keyNew > key
1059 { 1059 {
1060 if (pNode->getRightChild()==0) 1060 if (pNode->getRightChild()==0)
1061 { 1061 {
1062 pNode->setRightChild(newNode); 1062 pNode->setRightChild(newNode);
1063 pNode = 0; 1063 pNode = 0;
1064 } 1064 }
1065 else 1065 else
1066 { 1066 {
1067 pNode = pNode->getRightChild(); 1067 pNode = pNode->getRightChild();
1068 } 1068 }
1069 } 1069 }
1070 } 1070 }
1071 1071
1072 if (result) 1072 if (result)
1073 ++Size; 1073 ++Size;
1074 } 1074 }
1075 1075
1076 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; 1076 _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
1077 return result; 1077 return result;
1078 } 1078 }
1079 1079
1080 //! Rotate left. 1080 //! Rotate left.
1081 //! Pull up node's right child and let it knock node down to the left 1081 //! Pull up node's right child and let it knock node down to the left
1082 void rotateLeft(Node* p) 1082 void rotateLeft(Node* p)
1083 { 1083 {
1084 Node* right = p->getRightChild(); 1084 Node* right = p->getRightChild();
1085 1085
1086 p->setRightChild(right->getLeftChild()); 1086 p->setRightChild(right->getLeftChild());
1087 1087
1088 if (p->isLeftChild()) 1088 if (p->isLeftChild())
1089 p->getParent()->setLeftChild(right); 1089 p->getParent()->setLeftChild(right);
1090 else if (p->isRightChild()) 1090 else if (p->isRightChild())
1091 p->getParent()->setRightChild(right); 1091 p->getParent()->setRightChild(right);
1092 else 1092 else
1093 setRoot(right); 1093 setRoot(right);
1094 1094
1095 right->setLeftChild(p); 1095 right->setLeftChild(p);
1096 } 1096 }
1097 1097
1098 //! Rotate right. 1098 //! Rotate right.
1099 //! Pull up node's left child and let it knock node down to the right 1099 //! Pull up node's left child and let it knock node down to the right
1100 void rotateRight(Node* p) 1100 void rotateRight(Node* p)
1101 { 1101 {
1102 Node* left = p->getLeftChild(); 1102 Node* left = p->getLeftChild();
1103 1103
1104 p->setLeftChild(left->getRightChild()); 1104 p->setLeftChild(left->getRightChild());
1105 1105
1106 if (p->isLeftChild()) 1106 if (p->isLeftChild())
1107 p->getParent()->setLeftChild(left); 1107 p->getParent()->setLeftChild(left);
1108 else if (p->isRightChild()) 1108 else if (p->isRightChild())
1109 p->getParent()->setRightChild(left); 1109 p->getParent()->setRightChild(left);
1110 else 1110 else
1111 setRoot(left); 1111 setRoot(left);
1112 1112
1113 left->setRightChild(p); 1113 left->setRightChild(p);
1114 } 1114 }
1115 1115
1116 //------------------------------ 1116 //------------------------------
1117 // Private Members 1117 // Private Members
1118 //------------------------------ 1118 //------------------------------
1119 Node* Root; // The top node. 0 if empty. 1119 Node* Root; // The top node. 0 if empty.
1120 u32 Size; // Number of nodes in the tree 1120 u32 Size; // Number of nodes in the tree
1121}; 1121};
1122 1122
1123} // end namespace core 1123} // end namespace core
1124} // end namespace irr 1124} // end namespace irr
1125 1125
1126#endif // __IRR_MAP_H_INCLUDED__ 1126#endif // __IRR_MAP_H_INCLUDED__
1127 1127
diff --git a/libraries/irrlicht-1.8/include/irrMath.h b/libraries/irrlicht-1.8/include/irrMath.h
index 39229e9..a588c24 100644
--- a/libraries/irrlicht-1.8/include/irrMath.h
+++ b/libraries/irrlicht-1.8/include/irrMath.h
@@ -1,731 +1,731 @@
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#ifndef __IRR_MATH_H_INCLUDED__ 5#ifndef __IRR_MATH_H_INCLUDED__
6#define __IRR_MATH_H_INCLUDED__ 6#define __IRR_MATH_H_INCLUDED__
7 7
8#include "IrrCompileConfig.h" 8#include "IrrCompileConfig.h"
9#include "irrTypes.h" 9#include "irrTypes.h"
10#include <math.h> 10#include <math.h>
11#include <float.h> 11#include <float.h>
12#include <stdlib.h> // for abs() etc. 12#include <stdlib.h> // for abs() etc.
13#include <limits.h> // For INT_MAX / UINT_MAX 13#include <limits.h> // For INT_MAX / UINT_MAX
14 14
15#if defined(_IRR_SOLARIS_PLATFORM_) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) || defined (_WIN32_WCE) 15#if defined(_IRR_SOLARIS_PLATFORM_) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) || defined (_WIN32_WCE)
16 #define sqrtf(X) (irr::f32)sqrt((irr::f64)(X)) 16 #define sqrtf(X) (irr::f32)sqrt((irr::f64)(X))
17 #define sinf(X) (irr::f32)sin((irr::f64)(X)) 17 #define sinf(X) (irr::f32)sin((irr::f64)(X))
18 #define cosf(X) (irr::f32)cos((irr::f64)(X)) 18 #define cosf(X) (irr::f32)cos((irr::f64)(X))
19 #define asinf(X) (irr::f32)asin((irr::f64)(X)) 19 #define asinf(X) (irr::f32)asin((irr::f64)(X))
20 #define acosf(X) (irr::f32)acos((irr::f64)(X)) 20 #define acosf(X) (irr::f32)acos((irr::f64)(X))
21 #define atan2f(X,Y) (irr::f32)atan2((irr::f64)(X),(irr::f64)(Y)) 21 #define atan2f(X,Y) (irr::f32)atan2((irr::f64)(X),(irr::f64)(Y))
22 #define ceilf(X) (irr::f32)ceil((irr::f64)(X)) 22 #define ceilf(X) (irr::f32)ceil((irr::f64)(X))
23 #define floorf(X) (irr::f32)floor((irr::f64)(X)) 23 #define floorf(X) (irr::f32)floor((irr::f64)(X))
24 #define powf(X,Y) (irr::f32)pow((irr::f64)(X),(irr::f64)(Y)) 24 #define powf(X,Y) (irr::f32)pow((irr::f64)(X),(irr::f64)(Y))
25 #define fmodf(X,Y) (irr::f32)fmod((irr::f64)(X),(irr::f64)(Y)) 25 #define fmodf(X,Y) (irr::f32)fmod((irr::f64)(X),(irr::f64)(Y))
26 #define fabsf(X) (irr::f32)fabs((irr::f64)(X)) 26 #define fabsf(X) (irr::f32)fabs((irr::f64)(X))
27 #define logf(X) (irr::f32)log((irr::f64)(X)) 27 #define logf(X) (irr::f32)log((irr::f64)(X))
28#endif 28#endif
29 29
30#ifndef FLT_MAX 30#ifndef FLT_MAX
31#define FLT_MAX 3.402823466E+38F 31#define FLT_MAX 3.402823466E+38F
32#endif 32#endif
33 33
34#ifndef FLT_MIN 34#ifndef FLT_MIN
35#define FLT_MIN 1.17549435e-38F 35#define FLT_MIN 1.17549435e-38F
36#endif 36#endif
37 37
38namespace irr 38namespace irr
39{ 39{
40namespace core 40namespace core
41{ 41{
42 42
43 //! Rounding error constant often used when comparing f32 values. 43 //! Rounding error constant often used when comparing f32 values.
44 44
45 const s32 ROUNDING_ERROR_S32 = 0; 45 const s32 ROUNDING_ERROR_S32 = 0;
46#ifdef __IRR_HAS_S64 46#ifdef __IRR_HAS_S64
47 const s64 ROUNDING_ERROR_S64 = 0; 47 const s64 ROUNDING_ERROR_S64 = 0;
48#endif 48#endif
49 const f32 ROUNDING_ERROR_f32 = 0.000001f; 49 const f32 ROUNDING_ERROR_f32 = 0.000001f;
50 const f64 ROUNDING_ERROR_f64 = 0.00000001; 50 const f64 ROUNDING_ERROR_f64 = 0.00000001;
51 51
52#ifdef PI // make sure we don't collide with a define 52#ifdef PI // make sure we don't collide with a define
53#undef PI 53#undef PI
54#endif 54#endif
55 //! Constant for PI. 55 //! Constant for PI.
56 const f32 PI = 3.14159265359f; 56 const f32 PI = 3.14159265359f;
57 57
58 //! Constant for reciprocal of PI. 58 //! Constant for reciprocal of PI.
59 const f32 RECIPROCAL_PI = 1.0f/PI; 59 const f32 RECIPROCAL_PI = 1.0f/PI;
60 60
61 //! Constant for half of PI. 61 //! Constant for half of PI.
62 const f32 HALF_PI = PI/2.0f; 62 const f32 HALF_PI = PI/2.0f;
63 63
64#ifdef PI64 // make sure we don't collide with a define 64#ifdef PI64 // make sure we don't collide with a define
65#undef PI64 65#undef PI64
66#endif 66#endif
67 //! Constant for 64bit PI. 67 //! Constant for 64bit PI.
68 const f64 PI64 = 3.1415926535897932384626433832795028841971693993751; 68 const f64 PI64 = 3.1415926535897932384626433832795028841971693993751;
69 69
70 //! Constant for 64bit reciprocal of PI. 70 //! Constant for 64bit reciprocal of PI.
71 const f64 RECIPROCAL_PI64 = 1.0/PI64; 71 const f64 RECIPROCAL_PI64 = 1.0/PI64;
72 72
73 //! 32bit Constant for converting from degrees to radians 73 //! 32bit Constant for converting from degrees to radians
74 const f32 DEGTORAD = PI / 180.0f; 74 const f32 DEGTORAD = PI / 180.0f;
75 75
76 //! 32bit constant for converting from radians to degrees (formally known as GRAD_PI) 76 //! 32bit constant for converting from radians to degrees (formally known as GRAD_PI)
77 const f32 RADTODEG = 180.0f / PI; 77 const f32 RADTODEG = 180.0f / PI;
78 78
79 //! 64bit constant for converting from degrees to radians (formally known as GRAD_PI2) 79 //! 64bit constant for converting from degrees to radians (formally known as GRAD_PI2)
80 const f64 DEGTORAD64 = PI64 / 180.0; 80 const f64 DEGTORAD64 = PI64 / 180.0;
81 81
82 //! 64bit constant for converting from radians to degrees 82 //! 64bit constant for converting from radians to degrees
83 const f64 RADTODEG64 = 180.0 / PI64; 83 const f64 RADTODEG64 = 180.0 / PI64;
84 84
85 //! Utility function to convert a radian value to degrees 85 //! Utility function to convert a radian value to degrees
86 /** Provided as it can be clearer to write radToDeg(X) than RADTODEG * X 86 /** Provided as it can be clearer to write radToDeg(X) than RADTODEG * X
87 \param radians The radians value to convert to degrees. 87 \param radians The radians value to convert to degrees.
88 */ 88 */
89 inline f32 radToDeg(f32 radians) 89 inline f32 radToDeg(f32 radians)
90 { 90 {
91 return RADTODEG * radians; 91 return RADTODEG * radians;
92 } 92 }
93 93
94 //! Utility function to convert a radian value to degrees 94 //! Utility function to convert a radian value to degrees
95 /** Provided as it can be clearer to write radToDeg(X) than RADTODEG * X 95 /** Provided as it can be clearer to write radToDeg(X) than RADTODEG * X
96 \param radians The radians value to convert to degrees. 96 \param radians The radians value to convert to degrees.
97 */ 97 */
98 inline f64 radToDeg(f64 radians) 98 inline f64 radToDeg(f64 radians)
99 { 99 {
100 return RADTODEG64 * radians; 100 return RADTODEG64 * radians;
101 } 101 }
102 102
103 //! Utility function to convert a degrees value to radians 103 //! Utility function to convert a degrees value to radians
104 /** Provided as it can be clearer to write degToRad(X) than DEGTORAD * X 104 /** Provided as it can be clearer to write degToRad(X) than DEGTORAD * X
105 \param degrees The degrees value to convert to radians. 105 \param degrees The degrees value to convert to radians.
106 */ 106 */
107 inline f32 degToRad(f32 degrees) 107 inline f32 degToRad(f32 degrees)
108 { 108 {
109 return DEGTORAD * degrees; 109 return DEGTORAD * degrees;
110 } 110 }
111 111
112 //! Utility function to convert a degrees value to radians 112 //! Utility function to convert a degrees value to radians
113 /** Provided as it can be clearer to write degToRad(X) than DEGTORAD * X 113 /** Provided as it can be clearer to write degToRad(X) than DEGTORAD * X
114 \param degrees The degrees value to convert to radians. 114 \param degrees The degrees value to convert to radians.
115 */ 115 */
116 inline f64 degToRad(f64 degrees) 116 inline f64 degToRad(f64 degrees)
117 { 117 {
118 return DEGTORAD64 * degrees; 118 return DEGTORAD64 * degrees;
119 } 119 }
120 120
121 //! returns minimum of two values. Own implementation to get rid of the STL (VS6 problems) 121 //! returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)
122 template<class T> 122 template<class T>
123 inline const T& min_(const T& a, const T& b) 123 inline const T& min_(const T& a, const T& b)
124 { 124 {
125 return a < b ? a : b; 125 return a < b ? a : b;
126 } 126 }
127 127
128 //! returns minimum of three values. Own implementation to get rid of the STL (VS6 problems) 128 //! returns minimum of three values. Own implementation to get rid of the STL (VS6 problems)
129 template<class T> 129 template<class T>
130 inline const T& min_(const T& a, const T& b, const T& c) 130 inline const T& min_(const T& a, const T& b, const T& c)
131 { 131 {
132 return a < b ? min_(a, c) : min_(b, c); 132 return a < b ? min_(a, c) : min_(b, c);
133 } 133 }
134 134
135 //! returns maximum of two values. Own implementation to get rid of the STL (VS6 problems) 135 //! returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)
136 template<class T> 136 template<class T>
137 inline const T& max_(const T& a, const T& b) 137 inline const T& max_(const T& a, const T& b)
138 { 138 {
139 return a < b ? b : a; 139 return a < b ? b : a;
140 } 140 }
141 141
142 //! returns maximum of three values. Own implementation to get rid of the STL (VS6 problems) 142 //! returns maximum of three values. Own implementation to get rid of the STL (VS6 problems)
143 template<class T> 143 template<class T>
144 inline const T& max_(const T& a, const T& b, const T& c) 144 inline const T& max_(const T& a, const T& b, const T& c)
145 { 145 {
146 return a < b ? max_(b, c) : max_(a, c); 146 return a < b ? max_(b, c) : max_(a, c);
147 } 147 }
148 148
149 //! returns abs of two values. Own implementation to get rid of STL (VS6 problems) 149 //! returns abs of two values. Own implementation to get rid of STL (VS6 problems)
150 template<class T> 150 template<class T>
151 inline T abs_(const T& a) 151 inline T abs_(const T& a)
152 { 152 {
153 return a < (T)0 ? -a : a; 153 return a < (T)0 ? -a : a;
154 } 154 }
155 155
156 //! returns linear interpolation of a and b with ratio t 156 //! returns linear interpolation of a and b with ratio t
157 //! \return: a if t==0, b if t==1, and the linear interpolation else 157 //! \return: a if t==0, b if t==1, and the linear interpolation else
158 template<class T> 158 template<class T>
159 inline T lerp(const T& a, const T& b, const f32 t) 159 inline T lerp(const T& a, const T& b, const f32 t)
160 { 160 {
161 return (T)(a*(1.f-t)) + (b*t); 161 return (T)(a*(1.f-t)) + (b*t);
162 } 162 }
163 163
164 //! clamps a value between low and high 164 //! clamps a value between low and high
165 template <class T> 165 template <class T>
166 inline const T clamp (const T& value, const T& low, const T& high) 166 inline const T clamp (const T& value, const T& low, const T& high)
167 { 167 {
168 return min_ (max_(value,low), high); 168 return min_ (max_(value,low), high);
169 } 169 }
170 170
171 //! swaps the content of the passed parameters 171 //! swaps the content of the passed parameters
172 // Note: We use the same trick as boost and use two template arguments to 172 // Note: We use the same trick as boost and use two template arguments to
173 // avoid ambiguity when swapping objects of an Irrlicht type that has not 173 // avoid ambiguity when swapping objects of an Irrlicht type that has not
174 // it's own swap overload. Otherwise we get conflicts with some compilers 174 // it's own swap overload. Otherwise we get conflicts with some compilers
175 // in combination with stl. 175 // in combination with stl.
176 template <class T1, class T2> 176 template <class T1, class T2>
177 inline void swap(T1& a, T2& b) 177 inline void swap(T1& a, T2& b)
178 { 178 {
179 T1 c(a); 179 T1 c(a);
180 a = b; 180 a = b;
181 b = c; 181 b = c;
182 } 182 }
183 183
184 //! returns if a equals b, taking possible rounding errors into account 184 //! returns if a equals b, taking possible rounding errors into account
185 inline bool equals(const f64 a, const f64 b, const f64 tolerance = ROUNDING_ERROR_f64) 185 inline bool equals(const f64 a, const f64 b, const f64 tolerance = ROUNDING_ERROR_f64)
186 { 186 {
187 return (a + tolerance >= b) && (a - tolerance <= b); 187 return (a + tolerance >= b) && (a - tolerance <= b);
188 } 188 }
189 189
190 //! returns if a equals b, taking possible rounding errors into account 190 //! returns if a equals b, taking possible rounding errors into account
191 inline bool equals(const f32 a, const f32 b, const f32 tolerance = ROUNDING_ERROR_f32) 191 inline bool equals(const f32 a, const f32 b, const f32 tolerance = ROUNDING_ERROR_f32)
192 { 192 {
193 return (a + tolerance >= b) && (a - tolerance <= b); 193 return (a + tolerance >= b) && (a - tolerance <= b);
194 } 194 }
195 195
196 //! We compare the difference in ULP's (spacing between floating-point numbers, aka ULP=1 means there exists no float between). 196 //! We compare the difference in ULP's (spacing between floating-point numbers, aka ULP=1 means there exists no float between).
197 //\result true when numbers have a ULP <= maxUlpDiff AND have the same sign. 197 //\result true when numbers have a ULP <= maxUlpDiff AND have the same sign.
198 inline bool equalsByUlp(f32 a, f32 b, int maxUlpDiff) 198 inline bool equalsByUlp(f32 a, f32 b, int maxUlpDiff)
199 { 199 {
200 // Based on the ideas and code from Bruce Dawson on 200 // Based on the ideas and code from Bruce Dawson on
201 // http://www.altdevblogaday.com/2012/02/22/comparing-floating-point-numbers-2012-edition/ 201 // http://www.altdevblogaday.com/2012/02/22/comparing-floating-point-numbers-2012-edition/
202 // When floats are interpreted as integers the two nearest possible float numbers differ just 202 // When floats are interpreted as integers the two nearest possible float numbers differ just
203 // by one integer number. Also works the other way round, an integer of 1 interpreted as float 203 // by one integer number. Also works the other way round, an integer of 1 interpreted as float
204 // is for example the smallest possible float number. 204 // is for example the smallest possible float number.
205 union Float_t 205 union Float_t
206 { 206 {
207 Float_t(float f1 = 0.0f) : f(f1) {} 207 Float_t(float f1 = 0.0f) : f(f1) {}
208 // Portable sign-extraction 208 // Portable sign-extraction
209 bool sign() const { return (i >> 31) != 0; } 209 bool sign() const { return (i >> 31) != 0; }
210 210
211 int i; 211 int i;
212 float f; 212 float f;
213 }; 213 };
214 214
215 Float_t fa(a); 215 Float_t fa(a);
216 Float_t fb(b); 216 Float_t fb(b);
217 217
218 // Different signs, we could maybe get difference to 0, but so close to 0 using epsilons is better. 218 // Different signs, we could maybe get difference to 0, but so close to 0 using epsilons is better.
219 if ( fa.sign() != fb.sign() ) 219 if ( fa.sign() != fb.sign() )
220 { 220 {
221 // Check for equality to make sure +0==-0 221 // Check for equality to make sure +0==-0
222 if (fa.i == fb.i) 222 if (fa.i == fb.i)
223 return true; 223 return true;
224 return false; 224 return false;
225 } 225 }
226 226
227 // Find the difference in ULPs. 227 // Find the difference in ULPs.
228 int ulpsDiff = abs_(fa.i- fb.i); 228 int ulpsDiff = abs_(fa.i- fb.i);
229 if (ulpsDiff <= maxUlpDiff) 229 if (ulpsDiff <= maxUlpDiff)
230 return true; 230 return true;
231 231
232 return false; 232 return false;
233 } 233 }
234 234
235#if 0 235#if 0
236 //! returns if a equals b, not using any rounding tolerance 236 //! returns if a equals b, not using any rounding tolerance
237 inline bool equals(const s32 a, const s32 b) 237 inline bool equals(const s32 a, const s32 b)
238 { 238 {
239 return (a == b); 239 return (a == b);
240 } 240 }
241 241
242 //! returns if a equals b, not using any rounding tolerance 242 //! returns if a equals b, not using any rounding tolerance
243 inline bool equals(const u32 a, const u32 b) 243 inline bool equals(const u32 a, const u32 b)
244 { 244 {
245 return (a == b); 245 return (a == b);
246 } 246 }
247#endif 247#endif
248 //! returns if a equals b, taking an explicit rounding tolerance into account 248 //! returns if a equals b, taking an explicit rounding tolerance into account
249 inline bool equals(const s32 a, const s32 b, const s32 tolerance = ROUNDING_ERROR_S32) 249 inline bool equals(const s32 a, const s32 b, const s32 tolerance = ROUNDING_ERROR_S32)
250 { 250 {
251 return (a + tolerance >= b) && (a - tolerance <= b); 251 return (a + tolerance >= b) && (a - tolerance <= b);
252 } 252 }
253 253
254 //! returns if a equals b, taking an explicit rounding tolerance into account 254 //! returns if a equals b, taking an explicit rounding tolerance into account
255 inline bool equals(const u32 a, const u32 b, const s32 tolerance = ROUNDING_ERROR_S32) 255 inline bool equals(const u32 a, const u32 b, const s32 tolerance = ROUNDING_ERROR_S32)
256 { 256 {
257 return (a + tolerance >= b) && (a - tolerance <= b); 257 return (a + tolerance >= b) && (a - tolerance <= b);
258 } 258 }
259 259
260#ifdef __IRR_HAS_S64 260#ifdef __IRR_HAS_S64
261 //! returns if a equals b, taking an explicit rounding tolerance into account 261 //! returns if a equals b, taking an explicit rounding tolerance into account
262 inline bool equals(const s64 a, const s64 b, const s64 tolerance = ROUNDING_ERROR_S64) 262 inline bool equals(const s64 a, const s64 b, const s64 tolerance = ROUNDING_ERROR_S64)
263 { 263 {
264 return (a + tolerance >= b) && (a - tolerance <= b); 264 return (a + tolerance >= b) && (a - tolerance <= b);
265 } 265 }
266#endif 266#endif
267 267
268 //! returns if a equals zero, taking rounding errors into account 268 //! returns if a equals zero, taking rounding errors into account
269 inline bool iszero(const f64 a, const f64 tolerance = ROUNDING_ERROR_f64) 269 inline bool iszero(const f64 a, const f64 tolerance = ROUNDING_ERROR_f64)
270 { 270 {
271 return fabs(a) <= tolerance; 271 return fabs(a) <= tolerance;
272 } 272 }
273 273
274 //! returns if a equals zero, taking rounding errors into account 274 //! returns if a equals zero, taking rounding errors into account
275 inline bool iszero(const f32 a, const f32 tolerance = ROUNDING_ERROR_f32) 275 inline bool iszero(const f32 a, const f32 tolerance = ROUNDING_ERROR_f32)
276 { 276 {
277 return fabsf(a) <= tolerance; 277 return fabsf(a) <= tolerance;
278 } 278 }
279 279
280 //! returns if a equals not zero, taking rounding errors into account 280 //! returns if a equals not zero, taking rounding errors into account
281 inline bool isnotzero(const f32 a, const f32 tolerance = ROUNDING_ERROR_f32) 281 inline bool isnotzero(const f32 a, const f32 tolerance = ROUNDING_ERROR_f32)
282 { 282 {
283 return fabsf(a) > tolerance; 283 return fabsf(a) > tolerance;
284 } 284 }
285 285
286 //! returns if a equals zero, taking rounding errors into account 286 //! returns if a equals zero, taking rounding errors into account
287 inline bool iszero(const s32 a, const s32 tolerance = 0) 287 inline bool iszero(const s32 a, const s32 tolerance = 0)
288 { 288 {
289 return ( a & 0x7ffffff ) <= tolerance; 289 return ( a & 0x7ffffff ) <= tolerance;
290 } 290 }
291 291
292 //! returns if a equals zero, taking rounding errors into account 292 //! returns if a equals zero, taking rounding errors into account
293 inline bool iszero(const u32 a, const u32 tolerance = 0) 293 inline bool iszero(const u32 a, const u32 tolerance = 0)
294 { 294 {
295 return a <= tolerance; 295 return a <= tolerance;
296 } 296 }
297 297
298#ifdef __IRR_HAS_S64 298#ifdef __IRR_HAS_S64
299 //! returns if a equals zero, taking rounding errors into account 299 //! returns if a equals zero, taking rounding errors into account
300 inline bool iszero(const s64 a, const s64 tolerance = 0) 300 inline bool iszero(const s64 a, const s64 tolerance = 0)
301 { 301 {
302 return abs_(a) > tolerance; 302 return abs_(a) > tolerance;
303 } 303 }
304#endif 304#endif
305 305
306 inline s32 s32_min(s32 a, s32 b) 306 inline s32 s32_min(s32 a, s32 b)
307 { 307 {
308 const s32 mask = (a - b) >> 31; 308 const s32 mask = (a - b) >> 31;
309 return (a & mask) | (b & ~mask); 309 return (a & mask) | (b & ~mask);
310 } 310 }
311 311
312 inline s32 s32_max(s32 a, s32 b) 312 inline s32 s32_max(s32 a, s32 b)
313 { 313 {
314 const s32 mask = (a - b) >> 31; 314 const s32 mask = (a - b) >> 31;
315 return (b & mask) | (a & ~mask); 315 return (b & mask) | (a & ~mask);
316 } 316 }
317 317
318 inline s32 s32_clamp (s32 value, s32 low, s32 high) 318 inline s32 s32_clamp (s32 value, s32 low, s32 high)
319 { 319 {
320 return s32_min(s32_max(value,low), high); 320 return s32_min(s32_max(value,low), high);
321 } 321 }
322 322
323 /* 323 /*
324 float IEEE-754 bit represenation 324 float IEEE-754 bit represenation
325 325
326 0 0x00000000 326 0 0x00000000
327 1.0 0x3f800000 327 1.0 0x3f800000
328 0.5 0x3f000000 328 0.5 0x3f000000
329 3 0x40400000 329 3 0x40400000
330 +inf 0x7f800000 330 +inf 0x7f800000
331 -inf 0xff800000 331 -inf 0xff800000
332 +NaN 0x7fc00000 or 0x7ff00000 332 +NaN 0x7fc00000 or 0x7ff00000
333 in general: number = (sign ? -1:1) * 2^(exponent) * 1.(mantissa bits) 333 in general: number = (sign ? -1:1) * 2^(exponent) * 1.(mantissa bits)
334 */ 334 */
335 335
336 typedef union { u32 u; s32 s; f32 f; } inttofloat; 336 typedef union { u32 u; s32 s; f32 f; } inttofloat;
337 337
338 #define F32_AS_S32(f) (*((s32 *) &(f))) 338 #define F32_AS_S32(f) (*((s32 *) &(f)))
339 #define F32_AS_U32(f) (*((u32 *) &(f))) 339 #define F32_AS_U32(f) (*((u32 *) &(f)))
340 #define F32_AS_U32_POINTER(f) ( ((u32 *) &(f))) 340 #define F32_AS_U32_POINTER(f) ( ((u32 *) &(f)))
341 341
342 #define F32_VALUE_0 0x00000000 342 #define F32_VALUE_0 0x00000000
343 #define F32_VALUE_1 0x3f800000 343 #define F32_VALUE_1 0x3f800000
344 #define F32_SIGN_BIT 0x80000000U 344 #define F32_SIGN_BIT 0x80000000U
345 #define F32_EXPON_MANTISSA 0x7FFFFFFFU 345 #define F32_EXPON_MANTISSA 0x7FFFFFFFU
346 346
347 //! code is taken from IceFPU 347 //! code is taken from IceFPU
348 //! Integer representation of a floating-point value. 348 //! Integer representation of a floating-point value.
349#ifdef IRRLICHT_FAST_MATH 349#ifdef IRRLICHT_FAST_MATH
350 #define IR(x) ((u32&)(x)) 350 #define IR(x) ((u32&)(x))
351#else 351#else
352 inline u32 IR(f32 x) {inttofloat tmp; tmp.f=x; return tmp.u;} 352 inline u32 IR(f32 x) {inttofloat tmp; tmp.f=x; return tmp.u;}
353#endif 353#endif
354 354
355 //! Absolute integer representation of a floating-point value 355 //! Absolute integer representation of a floating-point value
356 #define AIR(x) (IR(x)&0x7fffffff) 356 #define AIR(x) (IR(x)&0x7fffffff)
357 357
358 //! Floating-point representation of an integer value. 358 //! Floating-point representation of an integer value.
359#ifdef IRRLICHT_FAST_MATH 359#ifdef IRRLICHT_FAST_MATH
360 #define FR(x) ((f32&)(x)) 360 #define FR(x) ((f32&)(x))
361#else 361#else
362 inline f32 FR(u32 x) {inttofloat tmp; tmp.u=x; return tmp.f;} 362 inline f32 FR(u32 x) {inttofloat tmp; tmp.u=x; return tmp.f;}
363 inline f32 FR(s32 x) {inttofloat tmp; tmp.s=x; return tmp.f;} 363 inline f32 FR(s32 x) {inttofloat tmp; tmp.s=x; return tmp.f;}
364#endif 364#endif
365 365
366 //! integer representation of 1.0 366 //! integer representation of 1.0
367 #define IEEE_1_0 0x3f800000 367 #define IEEE_1_0 0x3f800000
368 //! integer representation of 255.0 368 //! integer representation of 255.0
369 #define IEEE_255_0 0x437f0000 369 #define IEEE_255_0 0x437f0000
370 370
371#ifdef IRRLICHT_FAST_MATH 371#ifdef IRRLICHT_FAST_MATH
372 #define F32_LOWER_0(f) (F32_AS_U32(f) > F32_SIGN_BIT) 372 #define F32_LOWER_0(f) (F32_AS_U32(f) > F32_SIGN_BIT)
373 #define F32_LOWER_EQUAL_0(f) (F32_AS_S32(f) <= F32_VALUE_0) 373 #define F32_LOWER_EQUAL_0(f) (F32_AS_S32(f) <= F32_VALUE_0)
374 #define F32_GREATER_0(f) (F32_AS_S32(f) > F32_VALUE_0) 374 #define F32_GREATER_0(f) (F32_AS_S32(f) > F32_VALUE_0)
375 #define F32_GREATER_EQUAL_0(f) (F32_AS_U32(f) <= F32_SIGN_BIT) 375 #define F32_GREATER_EQUAL_0(f) (F32_AS_U32(f) <= F32_SIGN_BIT)
376 #define F32_EQUAL_1(f) (F32_AS_U32(f) == F32_VALUE_1) 376 #define F32_EQUAL_1(f) (F32_AS_U32(f) == F32_VALUE_1)
377 #define F32_EQUAL_0(f) ( (F32_AS_U32(f) & F32_EXPON_MANTISSA ) == F32_VALUE_0) 377 #define F32_EQUAL_0(f) ( (F32_AS_U32(f) & F32_EXPON_MANTISSA ) == F32_VALUE_0)
378 378
379 // only same sign 379 // only same sign
380 #define F32_A_GREATER_B(a,b) (F32_AS_S32((a)) > F32_AS_S32((b))) 380 #define F32_A_GREATER_B(a,b) (F32_AS_S32((a)) > F32_AS_S32((b)))
381 381
382#else 382#else
383 383
384 #define F32_LOWER_0(n) ((n) < 0.0f) 384 #define F32_LOWER_0(n) ((n) < 0.0f)
385 #define F32_LOWER_EQUAL_0(n) ((n) <= 0.0f) 385 #define F32_LOWER_EQUAL_0(n) ((n) <= 0.0f)
386 #define F32_GREATER_0(n) ((n) > 0.0f) 386 #define F32_GREATER_0(n) ((n) > 0.0f)
387 #define F32_GREATER_EQUAL_0(n) ((n) >= 0.0f) 387 #define F32_GREATER_EQUAL_0(n) ((n) >= 0.0f)
388 #define F32_EQUAL_1(n) ((n) == 1.0f) 388 #define F32_EQUAL_1(n) ((n) == 1.0f)
389 #define F32_EQUAL_0(n) ((n) == 0.0f) 389 #define F32_EQUAL_0(n) ((n) == 0.0f)
390 #define F32_A_GREATER_B(a,b) ((a) > (b)) 390 #define F32_A_GREATER_B(a,b) ((a) > (b))
391#endif 391#endif
392 392
393 393
394#ifndef REALINLINE 394#ifndef REALINLINE
395 #ifdef _MSC_VER 395 #ifdef _MSC_VER
396 #define REALINLINE __forceinline 396 #define REALINLINE __forceinline
397 #else 397 #else
398 #define REALINLINE inline 398 #define REALINLINE inline
399 #endif 399 #endif
400#endif 400#endif
401 401
402#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 402#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
403 403
404 // 8-bit bools in borland builder 404 // 8-bit bools in borland builder
405 405
406 //! conditional set based on mask and arithmetic shift 406 //! conditional set based on mask and arithmetic shift
407 REALINLINE u32 if_c_a_else_b ( const c8 condition, const u32 a, const u32 b ) 407 REALINLINE u32 if_c_a_else_b ( const c8 condition, const u32 a, const u32 b )
408 { 408 {
409 return ( ( -condition >> 7 ) & ( a ^ b ) ) ^ b; 409 return ( ( -condition >> 7 ) & ( a ^ b ) ) ^ b;
410 } 410 }
411 411
412 //! conditional set based on mask and arithmetic shift 412 //! conditional set based on mask and arithmetic shift
413 REALINLINE u32 if_c_a_else_0 ( const c8 condition, const u32 a ) 413 REALINLINE u32 if_c_a_else_0 ( const c8 condition, const u32 a )
414 { 414 {
415 return ( -condition >> 31 ) & a; 415 return ( -condition >> 31 ) & a;
416 } 416 }
417#else 417#else
418 418
419 //! conditional set based on mask and arithmetic shift 419 //! conditional set based on mask and arithmetic shift
420 REALINLINE u32 if_c_a_else_b ( const s32 condition, const u32 a, const u32 b ) 420 REALINLINE u32 if_c_a_else_b ( const s32 condition, const u32 a, const u32 b )
421 { 421 {
422 return ( ( -condition >> 31 ) & ( a ^ b ) ) ^ b; 422 return ( ( -condition >> 31 ) & ( a ^ b ) ) ^ b;
423 } 423 }
424 424
425 //! conditional set based on mask and arithmetic shift 425 //! conditional set based on mask and arithmetic shift
426 REALINLINE u16 if_c_a_else_b ( const s16 condition, const u16 a, const u16 b ) 426 REALINLINE u16 if_c_a_else_b ( const s16 condition, const u16 a, const u16 b )
427 { 427 {
428 return ( ( -condition >> 15 ) & ( a ^ b ) ) ^ b; 428 return ( ( -condition >> 15 ) & ( a ^ b ) ) ^ b;
429 } 429 }
430 430
431 //! conditional set based on mask and arithmetic shift 431 //! conditional set based on mask and arithmetic shift
432 REALINLINE u32 if_c_a_else_0 ( const s32 condition, const u32 a ) 432 REALINLINE u32 if_c_a_else_0 ( const s32 condition, const u32 a )
433 { 433 {
434 return ( -condition >> 31 ) & a; 434 return ( -condition >> 31 ) & a;
435 } 435 }
436#endif 436#endif
437 437
438 /* 438 /*
439 if (condition) state |= m; else state &= ~m; 439 if (condition) state |= m; else state &= ~m;
440 */ 440 */
441 REALINLINE void setbit_cond ( u32 &state, s32 condition, u32 mask ) 441 REALINLINE void setbit_cond ( u32 &state, s32 condition, u32 mask )
442 { 442 {
443 // 0, or any postive to mask 443 // 0, or any postive to mask
444 //s32 conmask = -condition >> 31; 444 //s32 conmask = -condition >> 31;
445 state ^= ( ( -condition >> 31 ) ^ state ) & mask; 445 state ^= ( ( -condition >> 31 ) ^ state ) & mask;
446 } 446 }
447 447
448 inline f32 round_( f32 x ) 448 inline f32 round_( f32 x )
449 { 449 {
450 return floorf( x + 0.5f ); 450 return floorf( x + 0.5f );
451 } 451 }
452 452
453 REALINLINE void clearFPUException () 453 REALINLINE void clearFPUException ()
454 { 454 {
455#ifdef IRRLICHT_FAST_MATH 455#ifdef IRRLICHT_FAST_MATH
456 return; 456 return;
457#ifdef feclearexcept 457#ifdef feclearexcept
458 feclearexcept(FE_ALL_EXCEPT); 458 feclearexcept(FE_ALL_EXCEPT);
459#elif defined(_MSC_VER) 459#elif defined(_MSC_VER)
460 __asm fnclex; 460 __asm fnclex;
461#elif defined(__GNUC__) && defined(__x86__) 461#elif defined(__GNUC__) && defined(__x86__)
462 __asm__ __volatile__ ("fclex \n\t"); 462 __asm__ __volatile__ ("fclex \n\t");
463#else 463#else
464# warn clearFPUException not supported. 464# warn clearFPUException not supported.
465#endif 465#endif
466#endif 466#endif
467 } 467 }
468 468
469 // calculate: sqrt ( x ) 469 // calculate: sqrt ( x )
470 REALINLINE f32 squareroot(const f32 f) 470 REALINLINE f32 squareroot(const f32 f)
471 { 471 {
472 return sqrtf(f); 472 return sqrtf(f);
473 } 473 }
474 474
475 // calculate: sqrt ( x ) 475 // calculate: sqrt ( x )
476 REALINLINE f64 squareroot(const f64 f) 476 REALINLINE f64 squareroot(const f64 f)
477 { 477 {
478 return sqrt(f); 478 return sqrt(f);
479 } 479 }
480 480
481 // calculate: sqrt ( x ) 481 // calculate: sqrt ( x )
482 REALINLINE s32 squareroot(const s32 f) 482 REALINLINE s32 squareroot(const s32 f)
483 { 483 {
484 return static_cast<s32>(squareroot(static_cast<f32>(f))); 484 return static_cast<s32>(squareroot(static_cast<f32>(f)));
485 } 485 }
486 486
487#ifdef __IRR_HAS_S64 487#ifdef __IRR_HAS_S64
488 // calculate: sqrt ( x ) 488 // calculate: sqrt ( x )
489 REALINLINE s64 squareroot(const s64 f) 489 REALINLINE s64 squareroot(const s64 f)
490 { 490 {
491 return static_cast<s64>(squareroot(static_cast<f64>(f))); 491 return static_cast<s64>(squareroot(static_cast<f64>(f)));
492 } 492 }
493#endif 493#endif
494 494
495 // calculate: 1 / sqrt ( x ) 495 // calculate: 1 / sqrt ( x )
496 REALINLINE f64 reciprocal_squareroot(const f64 x) 496 REALINLINE f64 reciprocal_squareroot(const f64 x)
497 { 497 {
498 return 1.0 / sqrt(x); 498 return 1.0 / sqrt(x);
499 } 499 }
500 500
501 // calculate: 1 / sqrtf ( x ) 501 // calculate: 1 / sqrtf ( x )
502 REALINLINE f32 reciprocal_squareroot(const f32 f) 502 REALINLINE f32 reciprocal_squareroot(const f32 f)
503 { 503 {
504#if defined ( IRRLICHT_FAST_MATH ) 504#if defined ( IRRLICHT_FAST_MATH )
505 #if defined(_MSC_VER) 505 #if defined(_MSC_VER)
506 // SSE reciprocal square root estimate, accurate to 12 significant 506 // SSE reciprocal square root estimate, accurate to 12 significant
507 // bits of the mantissa 507 // bits of the mantissa
508 f32 recsqrt; 508 f32 recsqrt;
509 __asm rsqrtss xmm0, f // xmm0 = rsqrtss(f) 509 __asm rsqrtss xmm0, f // xmm0 = rsqrtss(f)
510 __asm movss recsqrt, xmm0 // return xmm0 510 __asm movss recsqrt, xmm0 // return xmm0
511 return recsqrt; 511 return recsqrt;
512 512
513/* 513/*
514 // comes from Nvidia 514 // comes from Nvidia
515 u32 tmp = (u32(IEEE_1_0 << 1) + IEEE_1_0 - *(u32*)&x) >> 1; 515 u32 tmp = (u32(IEEE_1_0 << 1) + IEEE_1_0 - *(u32*)&x) >> 1;
516 f32 y = *(f32*)&tmp; 516 f32 y = *(f32*)&tmp;
517 return y * (1.47f - 0.47f * x * y * y); 517 return y * (1.47f - 0.47f * x * y * y);
518*/ 518*/
519 #else 519 #else
520 return 1.f / sqrtf(f); 520 return 1.f / sqrtf(f);
521 #endif 521 #endif
522#else // no fast math 522#else // no fast math
523 return 1.f / sqrtf(f); 523 return 1.f / sqrtf(f);
524#endif 524#endif
525 } 525 }
526 526
527 // calculate: 1 / sqrtf( x ) 527 // calculate: 1 / sqrtf( x )
528 REALINLINE s32 reciprocal_squareroot(const s32 x) 528 REALINLINE s32 reciprocal_squareroot(const s32 x)
529 { 529 {
530 return static_cast<s32>(reciprocal_squareroot(static_cast<f32>(x))); 530 return static_cast<s32>(reciprocal_squareroot(static_cast<f32>(x)));
531 } 531 }
532 532
533 // calculate: 1 / x 533 // calculate: 1 / x
534 REALINLINE f32 reciprocal( const f32 f ) 534 REALINLINE f32 reciprocal( const f32 f )
535 { 535 {
536#if defined (IRRLICHT_FAST_MATH) 536#if defined (IRRLICHT_FAST_MATH)
537 537
538 // SSE Newton-Raphson reciprocal estimate, accurate to 23 significant 538 // SSE Newton-Raphson reciprocal estimate, accurate to 23 significant
539 // bi ts of the mantissa 539 // bi ts of the mantissa
540 // One Newtown-Raphson Iteration: 540 // One Newtown-Raphson Iteration:
541 // f(i+1) = 2 * rcpss(f) - f * rcpss(f) * rcpss(f) 541 // f(i+1) = 2 * rcpss(f) - f * rcpss(f) * rcpss(f)
542 f32 rec; 542 f32 rec;
543 __asm rcpss xmm0, f // xmm0 = rcpss(f) 543 __asm rcpss xmm0, f // xmm0 = rcpss(f)
544 __asm movss xmm1, f // xmm1 = f 544 __asm movss xmm1, f // xmm1 = f
545 __asm mulss xmm1, xmm0 // xmm1 = f * rcpss(f) 545 __asm mulss xmm1, xmm0 // xmm1 = f * rcpss(f)
546 __asm mulss xmm1, xmm0 // xmm2 = f * rcpss(f) * rcpss(f) 546 __asm mulss xmm1, xmm0 // xmm2 = f * rcpss(f) * rcpss(f)
547 __asm addss xmm0, xmm0 // xmm0 = 2 * rcpss(f) 547 __asm addss xmm0, xmm0 // xmm0 = 2 * rcpss(f)
548 __asm subss xmm0, xmm1 // xmm0 = 2 * rcpss(f) 548 __asm subss xmm0, xmm1 // xmm0 = 2 * rcpss(f)
549 // - f * rcpss(f) * rcpss(f) 549 // - f * rcpss(f) * rcpss(f)
550 __asm movss rec, xmm0 // return xmm0 550 __asm movss rec, xmm0 // return xmm0
551 return rec; 551 return rec;
552 552
553 553
554 //! i do not divide through 0.. (fpu expection) 554 //! i do not divide through 0.. (fpu expection)
555 // instead set f to a high value to get a return value near zero.. 555 // instead set f to a high value to get a return value near zero..
556 // -1000000000000.f.. is use minus to stay negative.. 556 // -1000000000000.f.. is use minus to stay negative..
557 // must test's here (plane.normal dot anything ) checks on <= 0.f 557 // must test's here (plane.normal dot anything ) checks on <= 0.f
558 //u32 x = (-(AIR(f) != 0 ) >> 31 ) & ( IR(f) ^ 0xd368d4a5 ) ^ 0xd368d4a5; 558 //u32 x = (-(AIR(f) != 0 ) >> 31 ) & ( IR(f) ^ 0xd368d4a5 ) ^ 0xd368d4a5;
559 //return 1.f / FR ( x ); 559 //return 1.f / FR ( x );
560 560
561#else // no fast math 561#else // no fast math
562 return 1.f / f; 562 return 1.f / f;
563#endif 563#endif
564 } 564 }
565 565
566 // calculate: 1 / x 566 // calculate: 1 / x
567 REALINLINE f64 reciprocal ( const f64 f ) 567 REALINLINE f64 reciprocal ( const f64 f )
568 { 568 {
569 return 1.0 / f; 569 return 1.0 / f;
570 } 570 }
571 571
572 572
573 // calculate: 1 / x, low precision allowed 573 // calculate: 1 / x, low precision allowed
574 REALINLINE f32 reciprocal_approxim ( const f32 f ) 574 REALINLINE f32 reciprocal_approxim ( const f32 f )
575 { 575 {
576#if defined( IRRLICHT_FAST_MATH) 576#if defined( IRRLICHT_FAST_MATH)
577 577
578 // SSE Newton-Raphson reciprocal estimate, accurate to 23 significant 578 // SSE Newton-Raphson reciprocal estimate, accurate to 23 significant
579 // bi ts of the mantissa 579 // bi ts of the mantissa
580 // One Newtown-Raphson Iteration: 580 // One Newtown-Raphson Iteration:
581 // f(i+1) = 2 * rcpss(f) - f * rcpss(f) * rcpss(f) 581 // f(i+1) = 2 * rcpss(f) - f * rcpss(f) * rcpss(f)
582 f32 rec; 582 f32 rec;
583 __asm rcpss xmm0, f // xmm0 = rcpss(f) 583 __asm rcpss xmm0, f // xmm0 = rcpss(f)
584 __asm movss xmm1, f // xmm1 = f 584 __asm movss xmm1, f // xmm1 = f
585 __asm mulss xmm1, xmm0 // xmm1 = f * rcpss(f) 585 __asm mulss xmm1, xmm0 // xmm1 = f * rcpss(f)
586 __asm mulss xmm1, xmm0 // xmm2 = f * rcpss(f) * rcpss(f) 586 __asm mulss xmm1, xmm0 // xmm2 = f * rcpss(f) * rcpss(f)
587 __asm addss xmm0, xmm0 // xmm0 = 2 * rcpss(f) 587 __asm addss xmm0, xmm0 // xmm0 = 2 * rcpss(f)
588 __asm subss xmm0, xmm1 // xmm0 = 2 * rcpss(f) 588 __asm subss xmm0, xmm1 // xmm0 = 2 * rcpss(f)
589 // - f * rcpss(f) * rcpss(f) 589 // - f * rcpss(f) * rcpss(f)
590 __asm movss rec, xmm0 // return xmm0 590 __asm movss rec, xmm0 // return xmm0
591 return rec; 591 return rec;
592 592
593 593
594/* 594/*
595 // SSE reciprocal estimate, accurate to 12 significant bits of 595 // SSE reciprocal estimate, accurate to 12 significant bits of
596 f32 rec; 596 f32 rec;
597 __asm rcpss xmm0, f // xmm0 = rcpss(f) 597 __asm rcpss xmm0, f // xmm0 = rcpss(f)
598 __asm movss rec , xmm0 // return xmm0 598 __asm movss rec , xmm0 // return xmm0
599 return rec; 599 return rec;
600*/ 600*/
601/* 601/*
602 register u32 x = 0x7F000000 - IR ( p ); 602 register u32 x = 0x7F000000 - IR ( p );
603 const f32 r = FR ( x ); 603 const f32 r = FR ( x );
604 return r * (2.0f - p * r); 604 return r * (2.0f - p * r);
605*/ 605*/
606#else // no fast math 606#else // no fast math
607 return 1.f / f; 607 return 1.f / f;
608#endif 608#endif
609 } 609 }
610 610
611 611
612 REALINLINE s32 floor32(f32 x) 612 REALINLINE s32 floor32(f32 x)
613 { 613 {
614#ifdef IRRLICHT_FAST_MATH 614#ifdef IRRLICHT_FAST_MATH
615 const f32 h = 0.5f; 615 const f32 h = 0.5f;
616 616
617 s32 t; 617 s32 t;
618 618
619#if defined(_MSC_VER) 619#if defined(_MSC_VER)
620 __asm 620 __asm
621 { 621 {
622 fld x 622 fld x
623 fsub h 623 fsub h
624 fistp t 624 fistp t
625 } 625 }
626#elif defined(__GNUC__) 626#elif defined(__GNUC__)
627 __asm__ __volatile__ ( 627 __asm__ __volatile__ (
628 "fsub %2 \n\t" 628 "fsub %2 \n\t"
629 "fistpl %0" 629 "fistpl %0"
630 : "=m" (t) 630 : "=m" (t)
631 : "t" (x), "f" (h) 631 : "t" (x), "f" (h)
632 : "st" 632 : "st"
633 ); 633 );
634#else 634#else
635# warn IRRLICHT_FAST_MATH not supported. 635# warn IRRLICHT_FAST_MATH not supported.
636 return (s32) floorf ( x ); 636 return (s32) floorf ( x );
637#endif 637#endif
638 return t; 638 return t;
639#else // no fast math 639#else // no fast math
640 return (s32) floorf ( x ); 640 return (s32) floorf ( x );
641#endif 641#endif
642 } 642 }
643 643
644 644
645 REALINLINE s32 ceil32 ( f32 x ) 645 REALINLINE s32 ceil32 ( f32 x )
646 { 646 {
647#ifdef IRRLICHT_FAST_MATH 647#ifdef IRRLICHT_FAST_MATH
648 const f32 h = 0.5f; 648 const f32 h = 0.5f;
649 649
650 s32 t; 650 s32 t;
651 651
652#if defined(_MSC_VER) 652#if defined(_MSC_VER)
653 __asm 653 __asm
654 { 654 {
655 fld x 655 fld x
656 fadd h 656 fadd h
657 fistp t 657 fistp t
658 } 658 }
659#elif defined(__GNUC__) 659#elif defined(__GNUC__)
660 __asm__ __volatile__ ( 660 __asm__ __volatile__ (
661 "fadd %2 \n\t" 661 "fadd %2 \n\t"
662 "fistpl %0 \n\t" 662 "fistpl %0 \n\t"
663 : "=m"(t) 663 : "=m"(t)
664 : "t"(x), "f"(h) 664 : "t"(x), "f"(h)
665 : "st" 665 : "st"
666 ); 666 );
667#else 667#else
668# warn IRRLICHT_FAST_MATH not supported. 668# warn IRRLICHT_FAST_MATH not supported.
669 return (s32) ceilf ( x ); 669 return (s32) ceilf ( x );
670#endif 670#endif
671 return t; 671 return t;
672#else // not fast math 672#else // not fast math
673 return (s32) ceilf ( x ); 673 return (s32) ceilf ( x );
674#endif 674#endif
675 } 675 }
676 676
677 677
678 678
679 REALINLINE s32 round32(f32 x) 679 REALINLINE s32 round32(f32 x)
680 { 680 {
681#if defined(IRRLICHT_FAST_MATH) 681#if defined(IRRLICHT_FAST_MATH)
682 s32 t; 682 s32 t;
683 683
684#if defined(_MSC_VER) 684#if defined(_MSC_VER)
685 __asm 685 __asm
686 { 686 {
687 fld x 687 fld x
688 fistp t 688 fistp t
689 } 689 }
690#elif defined(__GNUC__) 690#elif defined(__GNUC__)
691 __asm__ __volatile__ ( 691 __asm__ __volatile__ (
692 "fistpl %0 \n\t" 692 "fistpl %0 \n\t"
693 : "=m"(t) 693 : "=m"(t)
694 : "t"(x) 694 : "t"(x)
695 : "st" 695 : "st"
696 ); 696 );
697#else 697#else
698# warn IRRLICHT_FAST_MATH not supported. 698# warn IRRLICHT_FAST_MATH not supported.
699 return (s32) round_(x); 699 return (s32) round_(x);
700#endif 700#endif
701 return t; 701 return t;
702#else // no fast math 702#else // no fast math
703 return (s32) round_(x); 703 return (s32) round_(x);
704#endif 704#endif
705 } 705 }
706 706
707 inline f32 f32_max3(const f32 a, const f32 b, const f32 c) 707 inline f32 f32_max3(const f32 a, const f32 b, const f32 c)
708 { 708 {
709 return a > b ? (a > c ? a : c) : (b > c ? b : c); 709 return a > b ? (a > c ? a : c) : (b > c ? b : c);
710 } 710 }
711 711
712 inline f32 f32_min3(const f32 a, const f32 b, const f32 c) 712 inline f32 f32_min3(const f32 a, const f32 b, const f32 c)
713 { 713 {
714 return a < b ? (a < c ? a : c) : (b < c ? b : c); 714 return a < b ? (a < c ? a : c) : (b < c ? b : c);
715 } 715 }
716 716
717 inline f32 fract ( f32 x ) 717 inline f32 fract ( f32 x )
718 { 718 {
719 return x - floorf ( x ); 719 return x - floorf ( x );
720 } 720 }
721 721
722} // end namespace core 722} // end namespace core
723} // end namespace irr 723} // end namespace irr
724 724
725#ifndef IRRLICHT_FAST_MATH 725#ifndef IRRLICHT_FAST_MATH
726 using irr::core::IR; 726 using irr::core::IR;
727 using irr::core::FR; 727 using irr::core::FR;
728#endif 728#endif
729 729
730#endif 730#endif
731 731
diff --git a/libraries/irrlicht-1.8/include/irrString.h b/libraries/irrlicht-1.8/include/irrString.h
index 43557cd..752ea1a 100644
--- a/libraries/irrlicht-1.8/include/irrString.h
+++ b/libraries/irrlicht-1.8/include/irrString.h
@@ -1,1368 +1,1368 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine" and the "irrXML" project. 2// This file is part of the "Irrlicht Engine" and the "irrXML" project.
3// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h 3// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
4 4
5#ifndef __IRR_STRING_H_INCLUDED__ 5#ifndef __IRR_STRING_H_INCLUDED__
6#define __IRR_STRING_H_INCLUDED__ 6#define __IRR_STRING_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include "irrAllocator.h" 9#include "irrAllocator.h"
10#include "irrMath.h" 10#include "irrMath.h"
11#include <stdio.h> 11#include <stdio.h>
12#include <string.h> 12#include <string.h>
13#include <stdlib.h> 13#include <stdlib.h>
14 14
15namespace irr 15namespace irr
16{ 16{
17namespace core 17namespace core
18{ 18{
19 19
20//! Very simple string class with some useful features. 20//! Very simple string class with some useful features.
21/** string<c8> and string<wchar_t> both accept Unicode AND ASCII/Latin-1, 21/** string<c8> and string<wchar_t> both accept Unicode AND ASCII/Latin-1,
22so you can assign Unicode to string<c8> and ASCII/Latin-1 to string<wchar_t> 22so you can assign Unicode to string<c8> and ASCII/Latin-1 to string<wchar_t>
23(and the other way round) if you want to. 23(and the other way round) if you want to.
24 24
25However, note that the conversation between both is not done using any encoding. 25However, note that the conversation between both is not done using any encoding.
26This means that c8 strings are treated as ASCII/Latin-1, not UTF-8, and 26This means that c8 strings are treated as ASCII/Latin-1, not UTF-8, and
27are simply expanded to the equivalent wchar_t, while Unicode/wchar_t 27are simply expanded to the equivalent wchar_t, while Unicode/wchar_t
28characters are truncated to 8-bit ASCII/Latin-1 characters, discarding all 28characters are truncated to 8-bit ASCII/Latin-1 characters, discarding all
29other information in the wchar_t. 29other information in the wchar_t.
30*/ 30*/
31 31
32enum eLocaleID 32enum eLocaleID
33{ 33{
34 IRR_LOCALE_ANSI = 0, 34 IRR_LOCALE_ANSI = 0,
35 IRR_LOCALE_GERMAN = 1 35 IRR_LOCALE_GERMAN = 1
36}; 36};
37 37
38static eLocaleID locale_current = IRR_LOCALE_ANSI; 38static eLocaleID locale_current = IRR_LOCALE_ANSI;
39static inline void locale_set ( eLocaleID id ) 39static inline void locale_set ( eLocaleID id )
40{ 40{
41 locale_current = id; 41 locale_current = id;
42} 42}
43 43
44//! Returns a character converted to lower case 44//! Returns a character converted to lower case
45static inline u32 locale_lower ( u32 x ) 45static inline u32 locale_lower ( u32 x )
46{ 46{
47 switch ( locale_current ) 47 switch ( locale_current )
48 { 48 {
49 case IRR_LOCALE_GERMAN: 49 case IRR_LOCALE_GERMAN:
50 case IRR_LOCALE_ANSI: 50 case IRR_LOCALE_ANSI:
51 break; 51 break;
52 } 52 }
53 // ansi 53 // ansi
54 return x >= 'A' && x <= 'Z' ? x + 0x20 : x; 54 return x >= 'A' && x <= 'Z' ? x + 0x20 : x;
55} 55}
56 56
57//! Returns a character converted to upper case 57//! Returns a character converted to upper case
58static inline u32 locale_upper ( u32 x ) 58static inline u32 locale_upper ( u32 x )
59{ 59{
60 switch ( locale_current ) 60 switch ( locale_current )
61 { 61 {
62 case IRR_LOCALE_GERMAN: 62 case IRR_LOCALE_GERMAN:
63 case IRR_LOCALE_ANSI: 63 case IRR_LOCALE_ANSI:
64 break; 64 break;
65 } 65 }
66 66
67 // ansi 67 // ansi
68 return x >= 'a' && x <= 'z' ? x + ( 'A' - 'a' ) : x; 68 return x >= 'a' && x <= 'z' ? x + ( 'A' - 'a' ) : x;
69} 69}
70 70
71 71
72template <typename T, typename TAlloc = irrAllocator<T> > 72template <typename T, typename TAlloc = irrAllocator<T> >
73class string 73class string
74{ 74{
75public: 75public:
76 76
77 typedef T char_type; 77 typedef T char_type;
78 78
79 //! Default constructor 79 //! Default constructor
80 string() 80 string()
81 : array(0), allocated(1), used(1) 81 : array(0), allocated(1), used(1)
82 { 82 {
83 array = allocator.allocate(1); // new T[1]; 83 array = allocator.allocate(1); // new T[1];
84 array[0] = 0; 84 array[0] = 0;
85 } 85 }
86 86
87 87
88 //! Constructor 88 //! Constructor
89 string(const string<T,TAlloc>& other) 89 string(const string<T,TAlloc>& other)
90 : array(0), allocated(0), used(0) 90 : array(0), allocated(0), used(0)
91 { 91 {
92 *this = other; 92 *this = other;
93 } 93 }
94 94
95 //! Constructor from other string types 95 //! Constructor from other string types
96 template <class B, class A> 96 template <class B, class A>
97 string(const string<B, A>& other) 97 string(const string<B, A>& other)
98 : array(0), allocated(0), used(0) 98 : array(0), allocated(0), used(0)
99 { 99 {
100 *this = other; 100 *this = other;
101 } 101 }
102 102
103 103
104 //! Constructs a string from a float 104 //! Constructs a string from a float
105 explicit string(const double number) 105 explicit string(const double number)
106 : array(0), allocated(0), used(0) 106 : array(0), allocated(0), used(0)
107 { 107 {
108 c8 tmpbuf[255]; 108 c8 tmpbuf[255];
109 snprintf(tmpbuf, 255, "%0.6f", number); 109 snprintf(tmpbuf, 255, "%0.6f", number);
110 *this = tmpbuf; 110 *this = tmpbuf;
111 } 111 }
112 112
113 113
114 //! Constructs a string from an int 114 //! Constructs a string from an int
115 explicit string(int number) 115 explicit string(int number)
116 : array(0), allocated(0), used(0) 116 : array(0), allocated(0), used(0)
117 { 117 {
118 // store if negative and make positive 118 // store if negative and make positive
119 119
120 bool negative = false; 120 bool negative = false;
121 if (number < 0) 121 if (number < 0)
122 { 122 {
123 number *= -1; 123 number *= -1;
124 negative = true; 124 negative = true;
125 } 125 }
126 126
127 // temporary buffer for 16 numbers 127 // temporary buffer for 16 numbers
128 128
129 c8 tmpbuf[16]={0}; 129 c8 tmpbuf[16]={0};
130 u32 idx = 15; 130 u32 idx = 15;
131 131
132 // special case '0' 132 // special case '0'
133 133
134 if (!number) 134 if (!number)
135 { 135 {
136 tmpbuf[14] = '0'; 136 tmpbuf[14] = '0';
137 *this = &tmpbuf[14]; 137 *this = &tmpbuf[14];
138 return; 138 return;
139 } 139 }
140 140
141 // add numbers 141 // add numbers
142 142
143 while(number && idx) 143 while(number && idx)
144 { 144 {
145 --idx; 145 --idx;
146 tmpbuf[idx] = (c8)('0' + (number % 10)); 146 tmpbuf[idx] = (c8)('0' + (number % 10));
147 number /= 10; 147 number /= 10;
148 } 148 }
149 149
150 // add sign 150 // add sign
151 151
152 if (negative) 152 if (negative)
153 { 153 {
154 --idx; 154 --idx;
155 tmpbuf[idx] = '-'; 155 tmpbuf[idx] = '-';
156 } 156 }
157 157
158 *this = &tmpbuf[idx]; 158 *this = &tmpbuf[idx];
159 } 159 }
160 160
161 161
162 //! Constructs a string from an unsigned int 162 //! Constructs a string from an unsigned int
163 explicit string(unsigned int number) 163 explicit string(unsigned int number)
164 : array(0), allocated(0), used(0) 164 : array(0), allocated(0), used(0)
165 { 165 {
166 // temporary buffer for 16 numbers 166 // temporary buffer for 16 numbers
167 167
168 c8 tmpbuf[16]={0}; 168 c8 tmpbuf[16]={0};
169 u32 idx = 15; 169 u32 idx = 15;
170 170
171 // special case '0' 171 // special case '0'
172 172
173 if (!number) 173 if (!number)
174 { 174 {
175 tmpbuf[14] = '0'; 175 tmpbuf[14] = '0';
176 *this = &tmpbuf[14]; 176 *this = &tmpbuf[14];
177 return; 177 return;
178 } 178 }
179 179
180 // add numbers 180 // add numbers
181 181
182 while(number && idx) 182 while(number && idx)
183 { 183 {
184 --idx; 184 --idx;
185 tmpbuf[idx] = (c8)('0' + (number % 10)); 185 tmpbuf[idx] = (c8)('0' + (number % 10));
186 number /= 10; 186 number /= 10;
187 } 187 }
188 188
189 *this = &tmpbuf[idx]; 189 *this = &tmpbuf[idx];
190 } 190 }
191 191
192 192
193 //! Constructs a string from a long 193 //! Constructs a string from a long
194 explicit string(long number) 194 explicit string(long number)
195 : array(0), allocated(0), used(0) 195 : array(0), allocated(0), used(0)
196 { 196 {
197 // store if negative and make positive 197 // store if negative and make positive
198 198
199 bool negative = false; 199 bool negative = false;
200 if (number < 0) 200 if (number < 0)
201 { 201 {
202 number *= -1; 202 number *= -1;
203 negative = true; 203 negative = true;
204 } 204 }
205 205
206 // temporary buffer for 16 numbers 206 // temporary buffer for 16 numbers
207 207
208 c8 tmpbuf[16]={0}; 208 c8 tmpbuf[16]={0};
209 u32 idx = 15; 209 u32 idx = 15;
210 210
211 // special case '0' 211 // special case '0'
212 212
213 if (!number) 213 if (!number)
214 { 214 {
215 tmpbuf[14] = '0'; 215 tmpbuf[14] = '0';
216 *this = &tmpbuf[14]; 216 *this = &tmpbuf[14];
217 return; 217 return;
218 } 218 }
219 219
220 // add numbers 220 // add numbers
221 221
222 while(number && idx) 222 while(number && idx)
223 { 223 {
224 --idx; 224 --idx;
225 tmpbuf[idx] = (c8)('0' + (number % 10)); 225 tmpbuf[idx] = (c8)('0' + (number % 10));
226 number /= 10; 226 number /= 10;
227 } 227 }
228 228
229 // add sign 229 // add sign
230 230
231 if (negative) 231 if (negative)
232 { 232 {
233 --idx; 233 --idx;
234 tmpbuf[idx] = '-'; 234 tmpbuf[idx] = '-';
235 } 235 }
236 236
237 *this = &tmpbuf[idx]; 237 *this = &tmpbuf[idx];
238 } 238 }
239 239
240 240
241 //! Constructs a string from an unsigned long 241 //! Constructs a string from an unsigned long
242 explicit string(unsigned long number) 242 explicit string(unsigned long number)
243 : array(0), allocated(0), used(0) 243 : array(0), allocated(0), used(0)
244 { 244 {
245 // temporary buffer for 16 numbers 245 // temporary buffer for 16 numbers
246 246
247 c8 tmpbuf[16]={0}; 247 c8 tmpbuf[16]={0};
248 u32 idx = 15; 248 u32 idx = 15;
249 249
250 // special case '0' 250 // special case '0'
251 251
252 if (!number) 252 if (!number)
253 { 253 {
254 tmpbuf[14] = '0'; 254 tmpbuf[14] = '0';
255 *this = &tmpbuf[14]; 255 *this = &tmpbuf[14];
256 return; 256 return;
257 } 257 }
258 258
259 // add numbers 259 // add numbers
260 260
261 while(number && idx) 261 while(number && idx)
262 { 262 {
263 --idx; 263 --idx;
264 tmpbuf[idx] = (c8)('0' + (number % 10)); 264 tmpbuf[idx] = (c8)('0' + (number % 10));
265 number /= 10; 265 number /= 10;
266 } 266 }
267 267
268 *this = &tmpbuf[idx]; 268 *this = &tmpbuf[idx];
269 } 269 }
270 270
271 271
272 //! Constructor for copying a string from a pointer with a given length 272 //! Constructor for copying a string from a pointer with a given length
273 template <class B> 273 template <class B>
274 string(const B* const c, u32 length) 274 string(const B* const c, u32 length)
275 : array(0), allocated(0), used(0) 275 : array(0), allocated(0), used(0)
276 { 276 {
277 if (!c) 277 if (!c)
278 { 278 {
279 // correctly init the string to an empty one 279 // correctly init the string to an empty one
280 *this=""; 280 *this="";
281 return; 281 return;
282 } 282 }
283 283
284 allocated = used = length+1; 284 allocated = used = length+1;
285 array = allocator.allocate(used); // new T[used]; 285 array = allocator.allocate(used); // new T[used];
286 286
287 for (u32 l = 0; l<length; ++l) 287 for (u32 l = 0; l<length; ++l)
288 array[l] = (T)c[l]; 288 array[l] = (T)c[l];
289 289
290 array[length] = 0; 290 array[length] = 0;
291 } 291 }
292 292
293 293
294 //! Constructor for unicode and ascii strings 294 //! Constructor for unicode and ascii strings
295 template <class B> 295 template <class B>
296 string(const B* const c) 296 string(const B* const c)
297 : array(0), allocated(0), used(0) 297 : array(0), allocated(0), used(0)
298 { 298 {
299 *this = c; 299 *this = c;
300 } 300 }
301 301
302 302
303 //! Destructor 303 //! Destructor
304 ~string() 304 ~string()
305 { 305 {
306 allocator.deallocate(array); // delete [] array; 306 allocator.deallocate(array); // delete [] array;
307 } 307 }
308 308
309 309
310 //! Assignment operator 310 //! Assignment operator
311 string<T,TAlloc>& operator=(const string<T,TAlloc>& other) 311 string<T,TAlloc>& operator=(const string<T,TAlloc>& other)
312 { 312 {
313 if (this == &other) 313 if (this == &other)
314 return *this; 314 return *this;
315 315
316 used = other.size()+1; 316 used = other.size()+1;
317 if (used>allocated) 317 if (used>allocated)
318 { 318 {
319 allocator.deallocate(array); // delete [] array; 319 allocator.deallocate(array); // delete [] array;
320 allocated = used; 320 allocated = used;
321 array = allocator.allocate(used); //new T[used]; 321 array = allocator.allocate(used); //new T[used];
322 } 322 }
323 323
324 const T* p = other.c_str(); 324 const T* p = other.c_str();
325 for (u32 i=0; i<used; ++i, ++p) 325 for (u32 i=0; i<used; ++i, ++p)
326 array[i] = *p; 326 array[i] = *p;
327 327
328 return *this; 328 return *this;
329 } 329 }
330 330
331 //! Assignment operator for other string types 331 //! Assignment operator for other string types
332 template <class B, class A> 332 template <class B, class A>
333 string<T,TAlloc>& operator=(const string<B,A>& other) 333 string<T,TAlloc>& operator=(const string<B,A>& other)
334 { 334 {
335 *this = other.c_str(); 335 *this = other.c_str();
336 return *this; 336 return *this;
337 } 337 }
338 338
339 339
340 //! Assignment operator for strings, ascii and unicode 340 //! Assignment operator for strings, ascii and unicode
341 template <class B> 341 template <class B>
342 string<T,TAlloc>& operator=(const B* const c) 342 string<T,TAlloc>& operator=(const B* const c)
343 { 343 {
344 if (!c) 344 if (!c)
345 { 345 {
346 if (!array) 346 if (!array)
347 { 347 {
348 array = allocator.allocate(1); //new T[1]; 348 array = allocator.allocate(1); //new T[1];
349 allocated = 1; 349 allocated = 1;
350 } 350 }
351 used = 1; 351 used = 1;
352 array[0] = 0x0; 352 array[0] = 0x0;
353 return *this; 353 return *this;
354 } 354 }
355 355
356 if ((void*)c == (void*)array) 356 if ((void*)c == (void*)array)
357 return *this; 357 return *this;
358 358
359 u32 len = 0; 359 u32 len = 0;
360 const B* p = c; 360 const B* p = c;
361 do 361 do
362 { 362 {
363 ++len; 363 ++len;
364 } while(*p++); 364 } while(*p++);
365 365
366 // we'll keep the old string for a while, because the new 366 // we'll keep the old string for a while, because the new
367 // string could be a part of the current string. 367 // string could be a part of the current string.
368 T* oldArray = array; 368 T* oldArray = array;
369 369
370 used = len; 370 used = len;
371 if (used>allocated) 371 if (used>allocated)
372 { 372 {
373 allocated = used; 373 allocated = used;
374 array = allocator.allocate(used); //new T[used]; 374 array = allocator.allocate(used); //new T[used];
375 } 375 }
376 376
377 for (u32 l = 0; l<len; ++l) 377 for (u32 l = 0; l<len; ++l)
378 array[l] = (T)c[l]; 378 array[l] = (T)c[l];
379 379
380 if (oldArray != array) 380 if (oldArray != array)
381 allocator.deallocate(oldArray); // delete [] oldArray; 381 allocator.deallocate(oldArray); // delete [] oldArray;
382 382
383 return *this; 383 return *this;
384 } 384 }
385 385
386 386
387 //! Append operator for other strings 387 //! Append operator for other strings
388 string<T,TAlloc> operator+(const string<T,TAlloc>& other) const 388 string<T,TAlloc> operator+(const string<T,TAlloc>& other) const
389 { 389 {
390 string<T,TAlloc> str(*this); 390 string<T,TAlloc> str(*this);
391 str.append(other); 391 str.append(other);
392 392
393 return str; 393 return str;
394 } 394 }
395 395
396 396
397 //! Append operator for strings, ascii and unicode 397 //! Append operator for strings, ascii and unicode
398 template <class B> 398 template <class B>
399 string<T,TAlloc> operator+(const B* const c) const 399 string<T,TAlloc> operator+(const B* const c) const
400 { 400 {
401 string<T,TAlloc> str(*this); 401 string<T,TAlloc> str(*this);
402 str.append(c); 402 str.append(c);
403 403
404 return str; 404 return str;
405 } 405 }
406 406
407 407
408 //! Direct access operator 408 //! Direct access operator
409 T& operator [](const u32 index) 409 T& operator [](const u32 index)
410 { 410 {
411 _IRR_DEBUG_BREAK_IF(index>=used) // bad index 411 _IRR_DEBUG_BREAK_IF(index>=used) // bad index
412 return array[index]; 412 return array[index];
413 } 413 }
414 414
415 415
416 //! Direct access operator 416 //! Direct access operator
417 const T& operator [](const u32 index) const 417 const T& operator [](const u32 index) const
418 { 418 {
419 _IRR_DEBUG_BREAK_IF(index>=used) // bad index 419 _IRR_DEBUG_BREAK_IF(index>=used) // bad index
420 return array[index]; 420 return array[index];
421 } 421 }
422 422
423 423
424 //! Equality operator 424 //! Equality operator
425 bool operator==(const T* const str) const 425 bool operator==(const T* const str) const
426 { 426 {
427 if (!str) 427 if (!str)
428 return false; 428 return false;
429 429
430 u32 i; 430 u32 i;
431 for (i=0; array[i] && str[i]; ++i) 431 for (i=0; array[i] && str[i]; ++i)
432 if (array[i] != str[i]) 432 if (array[i] != str[i])
433 return false; 433 return false;
434 434
435 return (!array[i] && !str[i]); 435 return (!array[i] && !str[i]);
436 } 436 }
437 437
438 438
439 //! Equality operator 439 //! Equality operator
440 bool operator==(const string<T,TAlloc>& other) const 440 bool operator==(const string<T,TAlloc>& other) const
441 { 441 {
442 for (u32 i=0; array[i] && other.array[i]; ++i) 442 for (u32 i=0; array[i] && other.array[i]; ++i)
443 if (array[i] != other.array[i]) 443 if (array[i] != other.array[i])
444 return false; 444 return false;
445 445
446 return used == other.used; 446 return used == other.used;
447 } 447 }
448 448
449 449
450 //! Is smaller comparator 450 //! Is smaller comparator
451 bool operator<(const string<T,TAlloc>& other) const 451 bool operator<(const string<T,TAlloc>& other) const
452 { 452 {
453 for (u32 i=0; array[i] && other.array[i]; ++i) 453 for (u32 i=0; array[i] && other.array[i]; ++i)
454 { 454 {
455 const s32 diff = array[i] - other.array[i]; 455 const s32 diff = array[i] - other.array[i];
456 if (diff) 456 if (diff)
457 return (diff < 0); 457 return (diff < 0);
458 } 458 }
459 459
460 return (used < other.used); 460 return (used < other.used);
461 } 461 }
462 462
463 463
464 //! Inequality operator 464 //! Inequality operator
465 bool operator!=(const T* const str) const 465 bool operator!=(const T* const str) const
466 { 466 {
467 return !(*this == str); 467 return !(*this == str);
468 } 468 }
469 469
470 470
471 //! Inequality operator 471 //! Inequality operator
472 bool operator!=(const string<T,TAlloc>& other) const 472 bool operator!=(const string<T,TAlloc>& other) const
473 { 473 {
474 return !(*this == other); 474 return !(*this == other);
475 } 475 }
476 476
477 477
478 //! Returns length of the string's content 478 //! Returns length of the string's content
479 /** \return Length of the string's content in characters, excluding 479 /** \return Length of the string's content in characters, excluding
480 the trailing NUL. */ 480 the trailing NUL. */
481 u32 size() const 481 u32 size() const
482 { 482 {
483 return used-1; 483 return used-1;
484 } 484 }
485 485
486 //! Informs if the string is empty or not. 486 //! Informs if the string is empty or not.
487 //! \return True if the string is empty, false if not. 487 //! \return True if the string is empty, false if not.
488 bool empty() const 488 bool empty() const
489 { 489 {
490 return (size() == 0); 490 return (size() == 0);
491 } 491 }
492 492
493 //! Returns character string 493 //! Returns character string
494 /** \return pointer to C-style NUL terminated string. */ 494 /** \return pointer to C-style NUL terminated string. */
495 const T* c_str() const 495 const T* c_str() const
496 { 496 {
497 return array; 497 return array;
498 } 498 }
499 499
500 500
501 //! Makes the string lower case. 501 //! Makes the string lower case.
502 string<T,TAlloc>& make_lower() 502 string<T,TAlloc>& make_lower()
503 { 503 {
504 for (u32 i=0; array[i]; ++i) 504 for (u32 i=0; array[i]; ++i)
505 array[i] = locale_lower ( array[i] ); 505 array[i] = locale_lower ( array[i] );
506 return *this; 506 return *this;
507 } 507 }
508 508
509 509
510 //! Makes the string upper case. 510 //! Makes the string upper case.
511 string<T,TAlloc>& make_upper() 511 string<T,TAlloc>& make_upper()
512 { 512 {
513 for (u32 i=0; array[i]; ++i) 513 for (u32 i=0; array[i]; ++i)
514 array[i] = locale_upper ( array[i] ); 514 array[i] = locale_upper ( array[i] );
515 return *this; 515 return *this;
516 } 516 }
517 517
518 518
519 //! Compares the strings ignoring case. 519 //! Compares the strings ignoring case.
520 /** \param other: Other string to compare. 520 /** \param other: Other string to compare.
521 \return True if the strings are equal ignoring case. */ 521 \return True if the strings are equal ignoring case. */
522 bool equals_ignore_case(const string<T,TAlloc>& other) const 522 bool equals_ignore_case(const string<T,TAlloc>& other) const
523 { 523 {
524 for(u32 i=0; array[i] && other[i]; ++i) 524 for(u32 i=0; array[i] && other[i]; ++i)
525 if (locale_lower( array[i]) != locale_lower(other[i])) 525 if (locale_lower( array[i]) != locale_lower(other[i]))
526 return false; 526 return false;
527 527
528 return used == other.used; 528 return used == other.used;
529 } 529 }
530 530
531 //! Compares the strings ignoring case. 531 //! Compares the strings ignoring case.
532 /** \param other: Other string to compare. 532 /** \param other: Other string to compare.
533 \param sourcePos: where to start to compare in the string 533 \param sourcePos: where to start to compare in the string
534 \return True if the strings are equal ignoring case. */ 534 \return True if the strings are equal ignoring case. */
535 bool equals_substring_ignore_case(const string<T,TAlloc>&other, const s32 sourcePos = 0 ) const 535 bool equals_substring_ignore_case(const string<T,TAlloc>&other, const s32 sourcePos = 0 ) const
536 { 536 {
537 if ( (u32) sourcePos >= used ) 537 if ( (u32) sourcePos >= used )
538 return false; 538 return false;
539 539
540 u32 i; 540 u32 i;
541 for( i=0; array[sourcePos + i] && other[i]; ++i) 541 for( i=0; array[sourcePos + i] && other[i]; ++i)
542 if (locale_lower( array[sourcePos + i]) != locale_lower(other[i])) 542 if (locale_lower( array[sourcePos + i]) != locale_lower(other[i]))
543 return false; 543 return false;
544 544
545 return array[sourcePos + i] == 0 && other[i] == 0; 545 return array[sourcePos + i] == 0 && other[i] == 0;
546 } 546 }
547 547
548 548
549 //! Compares the strings ignoring case. 549 //! Compares the strings ignoring case.
550 /** \param other: Other string to compare. 550 /** \param other: Other string to compare.
551 \return True if this string is smaller ignoring case. */ 551 \return True if this string is smaller ignoring case. */
552 bool lower_ignore_case(const string<T,TAlloc>& other) const 552 bool lower_ignore_case(const string<T,TAlloc>& other) const
553 { 553 {
554 for(u32 i=0; array[i] && other.array[i]; ++i) 554 for(u32 i=0; array[i] && other.array[i]; ++i)
555 { 555 {
556 s32 diff = (s32) locale_lower ( array[i] ) - (s32) locale_lower ( other.array[i] ); 556 s32 diff = (s32) locale_lower ( array[i] ) - (s32) locale_lower ( other.array[i] );
557 if ( diff ) 557 if ( diff )
558 return diff < 0; 558 return diff < 0;
559 } 559 }
560 560
561 return used < other.used; 561 return used < other.used;
562 } 562 }
563 563
564 564
565 //! compares the first n characters of the strings 565 //! compares the first n characters of the strings
566 /** \param other Other string to compare. 566 /** \param other Other string to compare.
567 \param n Number of characters to compare 567 \param n Number of characters to compare
568 \return True if the n first characters of both strings are equal. */ 568 \return True if the n first characters of both strings are equal. */
569 bool equalsn(const string<T,TAlloc>& other, u32 n) const 569 bool equalsn(const string<T,TAlloc>& other, u32 n) const
570 { 570 {
571 u32 i; 571 u32 i;
572 for(i=0; array[i] && other[i] && i < n; ++i) 572 for(i=0; array[i] && other[i] && i < n; ++i)
573 if (array[i] != other[i]) 573 if (array[i] != other[i])
574 return false; 574 return false;
575 575
576 // if one (or both) of the strings was smaller then they 576 // if one (or both) of the strings was smaller then they
577 // are only equal if they have the same length 577 // are only equal if they have the same length
578 return (i == n) || (used == other.used); 578 return (i == n) || (used == other.used);
579 } 579 }
580 580
581 581
582 //! compares the first n characters of the strings 582 //! compares the first n characters of the strings
583 /** \param str Other string to compare. 583 /** \param str Other string to compare.
584 \param n Number of characters to compare 584 \param n Number of characters to compare
585 \return True if the n first characters of both strings are equal. */ 585 \return True if the n first characters of both strings are equal. */
586 bool equalsn(const T* const str, u32 n) const 586 bool equalsn(const T* const str, u32 n) const
587 { 587 {
588 if (!str) 588 if (!str)
589 return false; 589 return false;
590 u32 i; 590 u32 i;
591 for(i=0; array[i] && str[i] && i < n; ++i) 591 for(i=0; array[i] && str[i] && i < n; ++i)
592 if (array[i] != str[i]) 592 if (array[i] != str[i])
593 return false; 593 return false;
594 594
595 // if one (or both) of the strings was smaller then they 595 // if one (or both) of the strings was smaller then they
596 // are only equal if they have the same length 596 // are only equal if they have the same length
597 return (i == n) || (array[i] == 0 && str[i] == 0); 597 return (i == n) || (array[i] == 0 && str[i] == 0);
598 } 598 }
599 599
600 600
601 //! Appends a character to this string 601 //! Appends a character to this string
602 /** \param character: Character to append. */ 602 /** \param character: Character to append. */
603 string<T,TAlloc>& append(T character) 603 string<T,TAlloc>& append(T character)
604 { 604 {
605 if (used + 1 > allocated) 605 if (used + 1 > allocated)
606 reallocate(used + 1); 606 reallocate(used + 1);
607 607
608 ++used; 608 ++used;
609 609
610 array[used-2] = character; 610 array[used-2] = character;
611 array[used-1] = 0; 611 array[used-1] = 0;
612 612
613 return *this; 613 return *this;
614 } 614 }
615 615
616 616
617 //! Appends a char string to this string 617 //! Appends a char string to this string
618 /** \param other: Char string to append. */ 618 /** \param other: Char string to append. */
619 /** \param length: The length of the string to append. */ 619 /** \param length: The length of the string to append. */
620 string<T,TAlloc>& append(const T* const other, u32 length=0xffffffff) 620 string<T,TAlloc>& append(const T* const other, u32 length=0xffffffff)
621 { 621 {
622 if (!other) 622 if (!other)
623 return *this; 623 return *this;
624 624
625 u32 len = 0; 625 u32 len = 0;
626 const T* p = other; 626 const T* p = other;
627 while(*p) 627 while(*p)
628 { 628 {
629 ++len; 629 ++len;
630 ++p; 630 ++p;
631 } 631 }
632 if (len > length) 632 if (len > length)
633 len = length; 633 len = length;
634 634
635 if (used + len > allocated) 635 if (used + len > allocated)
636 reallocate(used + len); 636 reallocate(used + len);
637 637
638 --used; 638 --used;
639 ++len; 639 ++len;
640 640
641 for (u32 l=0; l<len; ++l) 641 for (u32 l=0; l<len; ++l)
642 array[l+used] = *(other+l); 642 array[l+used] = *(other+l);
643 643
644 used += len; 644 used += len;
645 645
646 return *this; 646 return *this;
647 } 647 }
648 648
649 649
650 //! Appends a string to this string 650 //! Appends a string to this string
651 /** \param other: String to append. */ 651 /** \param other: String to append. */
652 string<T,TAlloc>& append(const string<T,TAlloc>& other) 652 string<T,TAlloc>& append(const string<T,TAlloc>& other)
653 { 653 {
654 if (other.size() == 0) 654 if (other.size() == 0)
655 return *this; 655 return *this;
656 656
657 --used; 657 --used;
658 u32 len = other.size()+1; 658 u32 len = other.size()+1;
659 659
660 if (used + len > allocated) 660 if (used + len > allocated)
661 reallocate(used + len); 661 reallocate(used + len);
662 662
663 for (u32 l=0; l<len; ++l) 663 for (u32 l=0; l<len; ++l)
664 array[used+l] = other[l]; 664 array[used+l] = other[l];
665 665
666 used += len; 666 used += len;
667 667
668 return *this; 668 return *this;
669 } 669 }
670 670
671 671
672 //! Appends a string of the length l to this string. 672 //! Appends a string of the length l to this string.
673 /** \param other: other String to append to this string. 673 /** \param other: other String to append to this string.
674 \param length: How much characters of the other string to add to this one. */ 674 \param length: How much characters of the other string to add to this one. */
675 string<T,TAlloc>& append(const string<T,TAlloc>& other, u32 length) 675 string<T,TAlloc>& append(const string<T,TAlloc>& other, u32 length)
676 { 676 {
677 if (other.size() == 0) 677 if (other.size() == 0)
678 return *this; 678 return *this;
679 679
680 if (other.size() < length) 680 if (other.size() < length)
681 { 681 {
682 append(other); 682 append(other);
683 return *this; 683 return *this;
684 } 684 }
685 685
686 if (used + length > allocated) 686 if (used + length > allocated)
687 reallocate(used + length); 687 reallocate(used + length);
688 688
689 --used; 689 --used;
690 690
691 for (u32 l=0; l<length; ++l) 691 for (u32 l=0; l<length; ++l)
692 array[l+used] = other[l]; 692 array[l+used] = other[l];
693 used += length; 693 used += length;
694 694
695 // ensure proper termination 695 // ensure proper termination
696 array[used]=0; 696 array[used]=0;
697 ++used; 697 ++used;
698 698
699 return *this; 699 return *this;
700 } 700 }
701 701
702 702
703 //! Reserves some memory. 703 //! Reserves some memory.
704 /** \param count: Amount of characters to reserve. */ 704 /** \param count: Amount of characters to reserve. */
705 void reserve(u32 count) 705 void reserve(u32 count)
706 { 706 {
707 if (count < allocated) 707 if (count < allocated)
708 return; 708 return;
709 709
710 reallocate(count); 710 reallocate(count);
711 } 711 }
712 712
713 713
714 //! finds first occurrence of character in string 714 //! finds first occurrence of character in string
715 /** \param c: Character to search for. 715 /** \param c: Character to search for.
716 \return Position where the character has been found, 716 \return Position where the character has been found,
717 or -1 if not found. */ 717 or -1 if not found. */
718 s32 findFirst(T c) const 718 s32 findFirst(T c) const
719 { 719 {
720 for (u32 i=0; i<used-1; ++i) 720 for (u32 i=0; i<used-1; ++i)
721 if (array[i] == c) 721 if (array[i] == c)
722 return i; 722 return i;
723 723
724 return -1; 724 return -1;
725 } 725 }
726 726
727 //! finds first occurrence of a character of a list in string 727 //! finds first occurrence of a character of a list in string
728 /** \param c: List of characters to find. For example if the method 728 /** \param c: List of characters to find. For example if the method
729 should find the first occurrence of 'a' or 'b', this parameter should be "ab". 729 should find the first occurrence of 'a' or 'b', this parameter should be "ab".
730 \param count: Amount of characters in the list. Usually, 730 \param count: Amount of characters in the list. Usually,
731 this should be strlen(c) 731 this should be strlen(c)
732 \return Position where one of the characters has been found, 732 \return Position where one of the characters has been found,
733 or -1 if not found. */ 733 or -1 if not found. */
734 s32 findFirstChar(const T* const c, u32 count=1) const 734 s32 findFirstChar(const T* const c, u32 count=1) const
735 { 735 {
736 if (!c || !count) 736 if (!c || !count)
737 return -1; 737 return -1;
738 738
739 for (u32 i=0; i<used-1; ++i) 739 for (u32 i=0; i<used-1; ++i)
740 for (u32 j=0; j<count; ++j) 740 for (u32 j=0; j<count; ++j)
741 if (array[i] == c[j]) 741 if (array[i] == c[j])
742 return i; 742 return i;
743 743
744 return -1; 744 return -1;
745 } 745 }
746 746
747 747
748 //! Finds first position of a character not in a given list. 748 //! Finds first position of a character not in a given list.
749 /** \param c: List of characters not to find. For example if the method 749 /** \param c: List of characters not to find. For example if the method
750 should find the first occurrence of a character not 'a' or 'b', this parameter should be "ab". 750 should find the first occurrence of a character not 'a' or 'b', this parameter should be "ab".
751 \param count: Amount of characters in the list. Usually, 751 \param count: Amount of characters in the list. Usually,
752 this should be strlen(c) 752 this should be strlen(c)
753 \return Position where the character has been found, 753 \return Position where the character has been found,
754 or -1 if not found. */ 754 or -1 if not found. */
755 template <class B> 755 template <class B>
756 s32 findFirstCharNotInList(const B* const c, u32 count=1) const 756 s32 findFirstCharNotInList(const B* const c, u32 count=1) const
757 { 757 {
758 if (!c || !count) 758 if (!c || !count)
759 return -1; 759 return -1;
760 760
761 for (u32 i=0; i<used-1; ++i) 761 for (u32 i=0; i<used-1; ++i)
762 { 762 {
763 u32 j; 763 u32 j;
764 for (j=0; j<count; ++j) 764 for (j=0; j<count; ++j)
765 if (array[i] == c[j]) 765 if (array[i] == c[j])
766 break; 766 break;
767 767
768 if (j==count) 768 if (j==count)
769 return i; 769 return i;
770 } 770 }
771 771
772 return -1; 772 return -1;
773 } 773 }
774 774
775 //! Finds last position of a character not in a given list. 775 //! Finds last position of a character not in a given list.
776 /** \param c: List of characters not to find. For example if the method 776 /** \param c: List of characters not to find. For example if the method
777 should find the first occurrence of a character not 'a' or 'b', this parameter should be "ab". 777 should find the first occurrence of a character not 'a' or 'b', this parameter should be "ab".
778 \param count: Amount of characters in the list. Usually, 778 \param count: Amount of characters in the list. Usually,
779 this should be strlen(c) 779 this should be strlen(c)
780 \return Position where the character has been found, 780 \return Position where the character has been found,
781 or -1 if not found. */ 781 or -1 if not found. */
782 template <class B> 782 template <class B>
783 s32 findLastCharNotInList(const B* const c, u32 count=1) const 783 s32 findLastCharNotInList(const B* const c, u32 count=1) const
784 { 784 {
785 if (!c || !count) 785 if (!c || !count)
786 return -1; 786 return -1;
787 787
788 for (s32 i=(s32)(used-2); i>=0; --i) 788 for (s32 i=(s32)(used-2); i>=0; --i)
789 { 789 {
790 u32 j; 790 u32 j;
791 for (j=0; j<count; ++j) 791 for (j=0; j<count; ++j)
792 if (array[i] == c[j]) 792 if (array[i] == c[j])
793 break; 793 break;
794 794
795 if (j==count) 795 if (j==count)
796 return i; 796 return i;
797 } 797 }
798 798
799 return -1; 799 return -1;
800 } 800 }
801 801
802 //! finds next occurrence of character in string 802 //! finds next occurrence of character in string
803 /** \param c: Character to search for. 803 /** \param c: Character to search for.
804 \param startPos: Position in string to start searching. 804 \param startPos: Position in string to start searching.
805 \return Position where the character has been found, 805 \return Position where the character has been found,
806 or -1 if not found. */ 806 or -1 if not found. */
807 s32 findNext(T c, u32 startPos) const 807 s32 findNext(T c, u32 startPos) const
808 { 808 {
809 for (u32 i=startPos; i<used-1; ++i) 809 for (u32 i=startPos; i<used-1; ++i)
810 if (array[i] == c) 810 if (array[i] == c)
811 return i; 811 return i;
812 812
813 return -1; 813 return -1;
814 } 814 }
815 815
816 816
817 //! finds last occurrence of character in string 817 //! finds last occurrence of character in string
818 /** \param c: Character to search for. 818 /** \param c: Character to search for.
819 \param start: start to search reverse ( default = -1, on end ) 819 \param start: start to search reverse ( default = -1, on end )
820 \return Position where the character has been found, 820 \return Position where the character has been found,
821 or -1 if not found. */ 821 or -1 if not found. */
822 s32 findLast(T c, s32 start = -1) const 822 s32 findLast(T c, s32 start = -1) const
823 { 823 {
824 start = core::clamp ( start < 0 ? (s32)(used) - 2 : start, 0, (s32)(used) - 2 ); 824 start = core::clamp ( start < 0 ? (s32)(used) - 2 : start, 0, (s32)(used) - 2 );
825 for (s32 i=start; i>=0; --i) 825 for (s32 i=start; i>=0; --i)
826 if (array[i] == c) 826 if (array[i] == c)
827 return i; 827 return i;
828 828
829 return -1; 829 return -1;
830 } 830 }
831 831
832 //! finds last occurrence of a character of a list in string 832 //! finds last occurrence of a character of a list in string
833 /** \param c: List of strings to find. For example if the method 833 /** \param c: List of strings to find. For example if the method
834 should find the last occurrence of 'a' or 'b', this parameter should be "ab". 834 should find the last occurrence of 'a' or 'b', this parameter should be "ab".
835 \param count: Amount of characters in the list. Usually, 835 \param count: Amount of characters in the list. Usually,
836 this should be strlen(c) 836 this should be strlen(c)
837 \return Position where one of the characters has been found, 837 \return Position where one of the characters has been found,
838 or -1 if not found. */ 838 or -1 if not found. */
839 s32 findLastChar(const T* const c, u32 count=1) const 839 s32 findLastChar(const T* const c, u32 count=1) const
840 { 840 {
841 if (!c || !count) 841 if (!c || !count)
842 return -1; 842 return -1;
843 843
844 for (s32 i=(s32)used-2; i>=0; --i) 844 for (s32 i=(s32)used-2; i>=0; --i)
845 for (u32 j=0; j<count; ++j) 845 for (u32 j=0; j<count; ++j)
846 if (array[i] == c[j]) 846 if (array[i] == c[j])
847 return i; 847 return i;
848 848
849 return -1; 849 return -1;
850 } 850 }
851 851
852 852
853 //! finds another string in this string 853 //! finds another string in this string
854 /** \param str: Another string 854 /** \param str: Another string
855 \param start: Start position of the search 855 \param start: Start position of the search
856 \return Positions where the string has been found, 856 \return Positions where the string has been found,
857 or -1 if not found. */ 857 or -1 if not found. */
858 template <class B> 858 template <class B>
859 s32 find(const B* const str, const u32 start = 0) const 859 s32 find(const B* const str, const u32 start = 0) const
860 { 860 {
861 if (str && *str) 861 if (str && *str)
862 { 862 {
863 u32 len = 0; 863 u32 len = 0;
864 864
865 while (str[len]) 865 while (str[len])
866 ++len; 866 ++len;
867 867
868 if (len > used-1) 868 if (len > used-1)
869 return -1; 869 return -1;
870 870
871 for (u32 i=start; i<used-len; ++i) 871 for (u32 i=start; i<used-len; ++i)
872 { 872 {
873 u32 j=0; 873 u32 j=0;
874 874
875 while(str[j] && array[i+j] == str[j]) 875 while(str[j] && array[i+j] == str[j])
876 ++j; 876 ++j;
877 877
878 if (!str[j]) 878 if (!str[j])
879 return i; 879 return i;
880 } 880 }
881 } 881 }
882 882
883 return -1; 883 return -1;
884 } 884 }
885 885
886 886
887 //! Returns a substring 887 //! Returns a substring
888 /** \param begin Start of substring. 888 /** \param begin Start of substring.
889 \param length Length of substring. 889 \param length Length of substring.
890 \param make_lower copy only lower case */ 890 \param make_lower copy only lower case */
891 string<T> subString(u32 begin, s32 length, bool make_lower = false ) const 891 string<T> subString(u32 begin, s32 length, bool make_lower = false ) const
892 { 892 {
893 // if start after string 893 // if start after string
894 // or no proper substring length 894 // or no proper substring length
895 if ((length <= 0) || (begin>=size())) 895 if ((length <= 0) || (begin>=size()))
896 return string<T>(""); 896 return string<T>("");
897 // clamp length to maximal value 897 // clamp length to maximal value
898 if ((length+begin) > size()) 898 if ((length+begin) > size())
899 length = size()-begin; 899 length = size()-begin;
900 900
901 string<T> o; 901 string<T> o;
902 o.reserve(length+1); 902 o.reserve(length+1);
903 903
904 s32 i; 904 s32 i;
905 if ( !make_lower ) 905 if ( !make_lower )
906 { 906 {
907 for (i=0; i<length; ++i) 907 for (i=0; i<length; ++i)
908 o.array[i] = array[i+begin]; 908 o.array[i] = array[i+begin];
909 } 909 }
910 else 910 else
911 { 911 {
912 for (i=0; i<length; ++i) 912 for (i=0; i<length; ++i)
913 o.array[i] = locale_lower ( array[i+begin] ); 913 o.array[i] = locale_lower ( array[i+begin] );
914 } 914 }
915 915
916 o.array[length] = 0; 916 o.array[length] = 0;
917 o.used = length + 1; 917 o.used = length + 1;
918 918
919 return o; 919 return o;
920 } 920 }
921 921
922 922
923 //! Appends a character to this string 923 //! Appends a character to this string
924 /** \param c Character to append. */ 924 /** \param c Character to append. */
925 string<T,TAlloc>& operator += (T c) 925 string<T,TAlloc>& operator += (T c)
926 { 926 {
927 append(c); 927 append(c);
928 return *this; 928 return *this;
929 } 929 }
930 930
931 931
932 //! Appends a char string to this string 932 //! Appends a char string to this string
933 /** \param c Char string to append. */ 933 /** \param c Char string to append. */
934 string<T,TAlloc>& operator += (const T* const c) 934 string<T,TAlloc>& operator += (const T* const c)
935 { 935 {
936 append(c); 936 append(c);
937 return *this; 937 return *this;
938 } 938 }
939 939
940 940
941 //! Appends a string to this string 941 //! Appends a string to this string
942 /** \param other String to append. */ 942 /** \param other String to append. */
943 string<T,TAlloc>& operator += (const string<T,TAlloc>& other) 943 string<T,TAlloc>& operator += (const string<T,TAlloc>& other)
944 { 944 {
945 append(other); 945 append(other);
946 return *this; 946 return *this;
947 } 947 }
948 948
949 949
950 //! Appends a string representation of a number to this string 950 //! Appends a string representation of a number to this string
951 /** \param i Number to append. */ 951 /** \param i Number to append. */
952 string<T,TAlloc>& operator += (const int i) 952 string<T,TAlloc>& operator += (const int i)
953 { 953 {
954 append(string<T,TAlloc>(i)); 954 append(string<T,TAlloc>(i));
955 return *this; 955 return *this;
956 } 956 }
957 957
958 958
959 //! Appends a string representation of a number to this string 959 //! Appends a string representation of a number to this string
960 /** \param i Number to append. */ 960 /** \param i Number to append. */
961 string<T,TAlloc>& operator += (const unsigned int i) 961 string<T,TAlloc>& operator += (const unsigned int i)
962 { 962 {
963 append(string<T,TAlloc>(i)); 963 append(string<T,TAlloc>(i));
964 return *this; 964 return *this;
965 } 965 }
966 966
967 967
968 //! Appends a string representation of a number to this string 968 //! Appends a string representation of a number to this string
969 /** \param i Number to append. */ 969 /** \param i Number to append. */
970 string<T,TAlloc>& operator += (const long i) 970 string<T,TAlloc>& operator += (const long i)
971 { 971 {
972 append(string<T,TAlloc>(i)); 972 append(string<T,TAlloc>(i));
973 return *this; 973 return *this;
974 } 974 }
975 975
976 976
977 //! Appends a string representation of a number to this string 977 //! Appends a string representation of a number to this string
978 /** \param i Number to append. */ 978 /** \param i Number to append. */
979 string<T,TAlloc>& operator += (const unsigned long i) 979 string<T,TAlloc>& operator += (const unsigned long i)
980 { 980 {
981 append(string<T,TAlloc>(i)); 981 append(string<T,TAlloc>(i));
982 return *this; 982 return *this;
983 } 983 }
984 984
985 985
986 //! Appends a string representation of a number to this string 986 //! Appends a string representation of a number to this string
987 /** \param i Number to append. */ 987 /** \param i Number to append. */
988 string<T,TAlloc>& operator += (const double i) 988 string<T,TAlloc>& operator += (const double i)
989 { 989 {
990 append(string<T,TAlloc>(i)); 990 append(string<T,TAlloc>(i));
991 return *this; 991 return *this;
992 } 992 }
993 993
994 994
995 //! Appends a string representation of a number to this string 995 //! Appends a string representation of a number to this string
996 /** \param i Number to append. */ 996 /** \param i Number to append. */
997 string<T,TAlloc>& operator += (const float i) 997 string<T,TAlloc>& operator += (const float i)
998 { 998 {
999 append(string<T,TAlloc>(i)); 999 append(string<T,TAlloc>(i));
1000 return *this; 1000 return *this;
1001 } 1001 }
1002 1002
1003 1003
1004 //! Replaces all characters of a special type with another one 1004 //! Replaces all characters of a special type with another one
1005 /** \param toReplace Character to replace. 1005 /** \param toReplace Character to replace.
1006 \param replaceWith Character replacing the old one. */ 1006 \param replaceWith Character replacing the old one. */
1007 string<T,TAlloc>& replace(T toReplace, T replaceWith) 1007 string<T,TAlloc>& replace(T toReplace, T replaceWith)
1008 { 1008 {
1009 for (u32 i=0; i<used-1; ++i) 1009 for (u32 i=0; i<used-1; ++i)
1010 if (array[i] == toReplace) 1010 if (array[i] == toReplace)
1011 array[i] = replaceWith; 1011 array[i] = replaceWith;
1012 return *this; 1012 return *this;
1013 } 1013 }
1014 1014
1015 1015
1016 //! Replaces all instances of a string with another one. 1016 //! Replaces all instances of a string with another one.
1017 /** \param toReplace The string to replace. 1017 /** \param toReplace The string to replace.
1018 \param replaceWith The string replacing the old one. */ 1018 \param replaceWith The string replacing the old one. */
1019 string<T,TAlloc>& replace(const string<T,TAlloc>& toReplace, const string<T,TAlloc>& replaceWith) 1019 string<T,TAlloc>& replace(const string<T,TAlloc>& toReplace, const string<T,TAlloc>& replaceWith)
1020 { 1020 {
1021 if (toReplace.size() == 0) 1021 if (toReplace.size() == 0)
1022 return *this; 1022 return *this;
1023 1023
1024 const T* other = toReplace.c_str(); 1024 const T* other = toReplace.c_str();
1025 const T* replace = replaceWith.c_str(); 1025 const T* replace = replaceWith.c_str();
1026 const u32 other_size = toReplace.size(); 1026 const u32 other_size = toReplace.size();
1027 const u32 replace_size = replaceWith.size(); 1027 const u32 replace_size = replaceWith.size();
1028 1028
1029 // Determine the delta. The algorithm will change depending on the delta. 1029 // Determine the delta. The algorithm will change depending on the delta.
1030 s32 delta = replace_size - other_size; 1030 s32 delta = replace_size - other_size;
1031 1031
1032 // A character for character replace. The string will not shrink or grow. 1032 // A character for character replace. The string will not shrink or grow.
1033 if (delta == 0) 1033 if (delta == 0)
1034 { 1034 {
1035 s32 pos = 0; 1035 s32 pos = 0;
1036 while ((pos = find(other, pos)) != -1) 1036 while ((pos = find(other, pos)) != -1)
1037 { 1037 {
1038 for (u32 i = 0; i < replace_size; ++i) 1038 for (u32 i = 0; i < replace_size; ++i)
1039 array[pos + i] = replace[i]; 1039 array[pos + i] = replace[i];
1040 ++pos; 1040 ++pos;
1041 } 1041 }
1042 return *this; 1042 return *this;
1043 } 1043 }
1044 1044
1045 // We are going to be removing some characters. The string will shrink. 1045 // We are going to be removing some characters. The string will shrink.
1046 if (delta < 0) 1046 if (delta < 0)
1047 { 1047 {
1048 u32 i = 0; 1048 u32 i = 0;
1049 for (u32 pos = 0; pos < used; ++i, ++pos) 1049 for (u32 pos = 0; pos < used; ++i, ++pos)
1050 { 1050 {
1051 // Is this potentially a match? 1051 // Is this potentially a match?
1052 if (array[pos] == *other) 1052 if (array[pos] == *other)
1053 { 1053 {
1054 // Check to see if we have a match. 1054 // Check to see if we have a match.
1055 u32 j; 1055 u32 j;
1056 for (j = 0; j < other_size; ++j) 1056 for (j = 0; j < other_size; ++j)
1057 { 1057 {
1058 if (array[pos + j] != other[j]) 1058 if (array[pos + j] != other[j])
1059 break; 1059 break;
1060 } 1060 }
1061 1061
1062 // If we have a match, replace characters. 1062 // If we have a match, replace characters.
1063 if (j == other_size) 1063 if (j == other_size)
1064 { 1064 {
1065 for (j = 0; j < replace_size; ++j) 1065 for (j = 0; j < replace_size; ++j)
1066 array[i + j] = replace[j]; 1066 array[i + j] = replace[j];
1067 i += replace_size - 1; 1067 i += replace_size - 1;
1068 pos += other_size - 1; 1068 pos += other_size - 1;
1069 continue; 1069 continue;
1070 } 1070 }
1071 } 1071 }
1072 1072
1073 // No match found, just copy characters. 1073 // No match found, just copy characters.
1074 array[i] = array[pos]; 1074 array[i] = array[pos];
1075 } 1075 }
1076 array[i-1] = 0; 1076 array[i-1] = 0;
1077 used = i; 1077 used = i;
1078 1078
1079 return *this; 1079 return *this;
1080 } 1080 }
1081 1081
1082 // We are going to be adding characters, so the string size will increase. 1082 // We are going to be adding characters, so the string size will increase.
1083 // Count the number of times toReplace exists in the string so we can allocate the new size. 1083 // Count the number of times toReplace exists in the string so we can allocate the new size.
1084 u32 find_count = 0; 1084 u32 find_count = 0;
1085 s32 pos = 0; 1085 s32 pos = 0;
1086 while ((pos = find(other, pos)) != -1) 1086 while ((pos = find(other, pos)) != -1)
1087 { 1087 {
1088 ++find_count; 1088 ++find_count;
1089 ++pos; 1089 ++pos;
1090 } 1090 }
1091 1091
1092 // Re-allocate the string now, if needed. 1092 // Re-allocate the string now, if needed.
1093 u32 len = delta * find_count; 1093 u32 len = delta * find_count;
1094 if (used + len > allocated) 1094 if (used + len > allocated)
1095 reallocate(used + len); 1095 reallocate(used + len);
1096 1096
1097 // Start replacing. 1097 // Start replacing.
1098 pos = 0; 1098 pos = 0;
1099 while ((pos = find(other, pos)) != -1) 1099 while ((pos = find(other, pos)) != -1)
1100 { 1100 {
1101 T* start = array + pos + other_size - 1; 1101 T* start = array + pos + other_size - 1;
1102 T* ptr = array + used - 1; 1102 T* ptr = array + used - 1;
1103 T* end = array + delta + used -1; 1103 T* end = array + delta + used -1;
1104 1104
1105 // Shift characters to make room for the string. 1105 // Shift characters to make room for the string.
1106 while (ptr != start) 1106 while (ptr != start)
1107 { 1107 {
1108 *end = *ptr; 1108 *end = *ptr;
1109 --ptr; 1109 --ptr;
1110 --end; 1110 --end;
1111 } 1111 }
1112 1112
1113 // Add the new string now. 1113 // Add the new string now.
1114 for (u32 i = 0; i < replace_size; ++i) 1114 for (u32 i = 0; i < replace_size; ++i)
1115 array[pos + i] = replace[i]; 1115 array[pos + i] = replace[i];
1116 1116
1117 pos += replace_size; 1117 pos += replace_size;
1118 used += delta; 1118 used += delta;
1119 } 1119 }
1120 1120
1121 return *this; 1121 return *this;
1122 } 1122 }
1123 1123
1124 1124
1125 //! Removes characters from a string. 1125 //! Removes characters from a string.
1126 /** \param c: Character to remove. */ 1126 /** \param c: Character to remove. */
1127 string<T,TAlloc>& remove(T c) 1127 string<T,TAlloc>& remove(T c)
1128 { 1128 {
1129 u32 pos = 0; 1129 u32 pos = 0;
1130 u32 found = 0; 1130 u32 found = 0;
1131 for (u32 i=0; i<used-1; ++i) 1131 for (u32 i=0; i<used-1; ++i)
1132 { 1132 {
1133 if (array[i] == c) 1133 if (array[i] == c)
1134 { 1134 {
1135 ++found; 1135 ++found;
1136 continue; 1136 continue;
1137 } 1137 }
1138 1138
1139 array[pos++] = array[i]; 1139 array[pos++] = array[i];
1140 } 1140 }
1141 used -= found; 1141 used -= found;
1142 array[used-1] = 0; 1142 array[used-1] = 0;
1143 return *this; 1143 return *this;
1144 } 1144 }
1145 1145
1146 1146
1147 //! Removes a string from the string. 1147 //! Removes a string from the string.
1148 /** \param toRemove: String to remove. */ 1148 /** \param toRemove: String to remove. */
1149 string<T,TAlloc>& remove(const string<T,TAlloc>& toRemove) 1149 string<T,TAlloc>& remove(const string<T,TAlloc>& toRemove)
1150 { 1150 {
1151 u32 size = toRemove.size(); 1151 u32 size = toRemove.size();
1152 if ( size == 0 ) 1152 if ( size == 0 )
1153 return *this; 1153 return *this;
1154 u32 pos = 0; 1154 u32 pos = 0;
1155 u32 found = 0; 1155 u32 found = 0;
1156 for (u32 i=0; i<used-1; ++i) 1156 for (u32 i=0; i<used-1; ++i)
1157 { 1157 {
1158 u32 j = 0; 1158 u32 j = 0;
1159 while (j < size) 1159 while (j < size)
1160 { 1160 {
1161 if (array[i + j] != toRemove[j]) 1161 if (array[i + j] != toRemove[j])
1162 break; 1162 break;
1163 ++j; 1163 ++j;
1164 } 1164 }
1165 if (j == size) 1165 if (j == size)
1166 { 1166 {
1167 found += size; 1167 found += size;
1168 i += size - 1; 1168 i += size - 1;
1169 continue; 1169 continue;
1170 } 1170 }
1171 1171
1172 array[pos++] = array[i]; 1172 array[pos++] = array[i];
1173 } 1173 }
1174 used -= found; 1174 used -= found;
1175 array[used-1] = 0; 1175 array[used-1] = 0;
1176 return *this; 1176 return *this;
1177 } 1177 }
1178 1178
1179 1179
1180 //! Removes characters from a string. 1180 //! Removes characters from a string.
1181 /** \param characters: Characters to remove. */ 1181 /** \param characters: Characters to remove. */
1182 string<T,TAlloc>& removeChars(const string<T,TAlloc> & characters) 1182 string<T,TAlloc>& removeChars(const string<T,TAlloc> & characters)
1183 { 1183 {
1184 if (characters.size() == 0) 1184 if (characters.size() == 0)
1185 return *this; 1185 return *this;
1186 1186
1187 u32 pos = 0; 1187 u32 pos = 0;
1188 u32 found = 0; 1188 u32 found = 0;
1189 for (u32 i=0; i<used-1; ++i) 1189 for (u32 i=0; i<used-1; ++i)
1190 { 1190 {
1191 // Don't use characters.findFirst as it finds the \0, 1191 // Don't use characters.findFirst as it finds the \0,
1192 // causing used to become incorrect. 1192 // causing used to become incorrect.
1193 bool docontinue = false; 1193 bool docontinue = false;
1194 for (u32 j=0; j<characters.size(); ++j) 1194 for (u32 j=0; j<characters.size(); ++j)
1195 { 1195 {
1196 if (characters[j] == array[i]) 1196 if (characters[j] == array[i])
1197 { 1197 {
1198 ++found; 1198 ++found;
1199 docontinue = true; 1199 docontinue = true;
1200 break; 1200 break;
1201 } 1201 }
1202 } 1202 }
1203 if (docontinue) 1203 if (docontinue)
1204 continue; 1204 continue;
1205 1205
1206 array[pos++] = array[i]; 1206 array[pos++] = array[i];
1207 } 1207 }
1208 used -= found; 1208 used -= found;
1209 array[used-1] = 0; 1209 array[used-1] = 0;
1210 1210
1211 return *this; 1211 return *this;
1212 } 1212 }
1213 1213
1214 1214
1215 //! Trims the string. 1215 //! Trims the string.
1216 /** Removes the specified characters (by default, Latin-1 whitespace) 1216 /** Removes the specified characters (by default, Latin-1 whitespace)
1217 from the begining and the end of the string. */ 1217 from the begining and the end of the string. */
1218 string<T,TAlloc>& trim(const string<T,TAlloc> & whitespace = " \t\n\r") 1218 string<T,TAlloc>& trim(const string<T,TAlloc> & whitespace = " \t\n\r")
1219 { 1219 {
1220 // find start and end of the substring without the specified characters 1220 // find start and end of the substring without the specified characters
1221 const s32 begin = findFirstCharNotInList(whitespace.c_str(), whitespace.used); 1221 const s32 begin = findFirstCharNotInList(whitespace.c_str(), whitespace.used);
1222 if (begin == -1) 1222 if (begin == -1)
1223 return (*this=""); 1223 return (*this="");
1224 1224
1225 const s32 end = findLastCharNotInList(whitespace.c_str(), whitespace.used); 1225 const s32 end = findLastCharNotInList(whitespace.c_str(), whitespace.used);
1226 1226
1227 return (*this = subString(begin, (end +1) - begin)); 1227 return (*this = subString(begin, (end +1) - begin));
1228 } 1228 }
1229 1229
1230 1230
1231 //! Erases a character from the string. 1231 //! Erases a character from the string.
1232 /** May be slow, because all elements 1232 /** May be slow, because all elements
1233 following after the erased element have to be copied. 1233 following after the erased element have to be copied.
1234 \param index: Index of element to be erased. */ 1234 \param index: Index of element to be erased. */
1235 string<T,TAlloc>& erase(u32 index) 1235 string<T,TAlloc>& erase(u32 index)
1236 { 1236 {
1237 _IRR_DEBUG_BREAK_IF(index>=used) // access violation 1237 _IRR_DEBUG_BREAK_IF(index>=used) // access violation
1238 1238
1239 for (u32 i=index+1; i<used; ++i) 1239 for (u32 i=index+1; i<used; ++i)
1240 array[i-1] = array[i]; 1240 array[i-1] = array[i];
1241 1241
1242 --used; 1242 --used;
1243 return *this; 1243 return *this;
1244 } 1244 }
1245 1245
1246 //! verify the existing string. 1246 //! verify the existing string.
1247 string<T,TAlloc>& validate() 1247 string<T,TAlloc>& validate()
1248 { 1248 {
1249 // terminate on existing null 1249 // terminate on existing null
1250 for (u32 i=0; i<allocated; ++i) 1250 for (u32 i=0; i<allocated; ++i)
1251 { 1251 {
1252 if (array[i] == 0) 1252 if (array[i] == 0)
1253 { 1253 {
1254 used = i + 1; 1254 used = i + 1;
1255 return *this; 1255 return *this;
1256 } 1256 }
1257 } 1257 }
1258 1258
1259 // terminate 1259 // terminate
1260 if ( allocated > 0 ) 1260 if ( allocated > 0 )
1261 { 1261 {
1262 used = allocated; 1262 used = allocated;
1263 array[used-1] = 0; 1263 array[used-1] = 0;
1264 } 1264 }
1265 else 1265 else
1266 { 1266 {
1267 used = 0; 1267 used = 0;
1268 } 1268 }
1269 1269
1270 return *this; 1270 return *this;
1271 } 1271 }
1272 1272
1273 //! gets the last char of a string or null 1273 //! gets the last char of a string or null
1274 T lastChar() const 1274 T lastChar() const
1275 { 1275 {
1276 return used > 1 ? array[used-2] : 0; 1276 return used > 1 ? array[used-2] : 0;
1277 } 1277 }
1278 1278
1279 //! split string into parts. 1279 //! split string into parts.
1280 /** This method will split a string at certain delimiter characters 1280 /** This method will split a string at certain delimiter characters
1281 into the container passed in as reference. The type of the container 1281 into the container passed in as reference. The type of the container
1282 has to be given as template parameter. It must provide a push_back and 1282 has to be given as template parameter. It must provide a push_back and
1283 a size method. 1283 a size method.
1284 \param ret The result container 1284 \param ret The result container
1285 \param c C-style string of delimiter characters 1285 \param c C-style string of delimiter characters
1286 \param count Number of delimiter characters 1286 \param count Number of delimiter characters
1287 \param ignoreEmptyTokens Flag to avoid empty substrings in the result 1287 \param ignoreEmptyTokens Flag to avoid empty substrings in the result
1288 container. If two delimiters occur without a character in between, an 1288 container. If two delimiters occur without a character in between, an
1289 empty substring would be placed in the result. If this flag is set, 1289 empty substring would be placed in the result. If this flag is set,
1290 only non-empty strings are stored. 1290 only non-empty strings are stored.
1291 \param keepSeparators Flag which allows to add the separator to the 1291 \param keepSeparators Flag which allows to add the separator to the
1292 result string. If this flag is true, the concatenation of the 1292 result string. If this flag is true, the concatenation of the
1293 substrings results in the original string. Otherwise, only the 1293 substrings results in the original string. Otherwise, only the
1294 characters between the delimiters are returned. 1294 characters between the delimiters are returned.
1295 \return The number of resulting substrings 1295 \return The number of resulting substrings
1296 */ 1296 */
1297 template<class container> 1297 template<class container>
1298 u32 split(container& ret, const T* const c, u32 count=1, bool ignoreEmptyTokens=true, bool keepSeparators=false) const 1298 u32 split(container& ret, const T* const c, u32 count=1, bool ignoreEmptyTokens=true, bool keepSeparators=false) const
1299 { 1299 {
1300 if (!c) 1300 if (!c)
1301 return 0; 1301 return 0;
1302 1302
1303 const u32 oldSize=ret.size(); 1303 const u32 oldSize=ret.size();
1304 u32 lastpos = 0; 1304 u32 lastpos = 0;
1305 bool lastWasSeparator = false; 1305 bool lastWasSeparator = false;
1306 for (u32 i=0; i<used; ++i) 1306 for (u32 i=0; i<used; ++i)
1307 { 1307 {
1308 bool foundSeparator = false; 1308 bool foundSeparator = false;
1309 for (u32 j=0; j<count; ++j) 1309 for (u32 j=0; j<count; ++j)
1310 { 1310 {
1311 if (array[i] == c[j]) 1311 if (array[i] == c[j])
1312 { 1312 {
1313 if ((!ignoreEmptyTokens || i - lastpos != 0) && 1313 if ((!ignoreEmptyTokens || i - lastpos != 0) &&
1314 !lastWasSeparator) 1314 !lastWasSeparator)
1315 ret.push_back(string<T,TAlloc>(&array[lastpos], i - lastpos)); 1315 ret.push_back(string<T,TAlloc>(&array[lastpos], i - lastpos));
1316 foundSeparator = true; 1316 foundSeparator = true;
1317 lastpos = (keepSeparators ? i : i + 1); 1317 lastpos = (keepSeparators ? i : i + 1);
1318 break; 1318 break;
1319 } 1319 }
1320 } 1320 }
1321 lastWasSeparator = foundSeparator; 1321 lastWasSeparator = foundSeparator;
1322 } 1322 }
1323 if ((used - 1) > lastpos) 1323 if ((used - 1) > lastpos)
1324 ret.push_back(string<T,TAlloc>(&array[lastpos], (used - 1) - lastpos)); 1324 ret.push_back(string<T,TAlloc>(&array[lastpos], (used - 1) - lastpos));
1325 return ret.size()-oldSize; 1325 return ret.size()-oldSize;
1326 } 1326 }
1327 1327
1328private: 1328private:
1329 1329
1330 //! Reallocate the array, make it bigger or smaller 1330 //! Reallocate the array, make it bigger or smaller
1331 void reallocate(u32 new_size) 1331 void reallocate(u32 new_size)
1332 { 1332 {
1333 T* old_array = array; 1333 T* old_array = array;
1334 1334
1335 array = allocator.allocate(new_size); //new T[new_size]; 1335 array = allocator.allocate(new_size); //new T[new_size];
1336 allocated = new_size; 1336 allocated = new_size;
1337 1337
1338 u32 amount = used < new_size ? used : new_size; 1338 u32 amount = used < new_size ? used : new_size;
1339 for (u32 i=0; i<amount; ++i) 1339 for (u32 i=0; i<amount; ++i)
1340 array[i] = old_array[i]; 1340 array[i] = old_array[i];
1341 1341
1342 if (allocated < used) 1342 if (allocated < used)
1343 used = allocated; 1343 used = allocated;
1344 1344
1345 allocator.deallocate(old_array); // delete [] old_array; 1345 allocator.deallocate(old_array); // delete [] old_array;
1346 } 1346 }
1347 1347
1348 //--- member variables 1348 //--- member variables
1349 1349
1350 T* array; 1350 T* array;
1351 u32 allocated; 1351 u32 allocated;
1352 u32 used; 1352 u32 used;
1353 TAlloc allocator; 1353 TAlloc allocator;
1354}; 1354};
1355 1355
1356 1356
1357//! Typedef for character strings 1357//! Typedef for character strings
1358typedef string<c8> stringc; 1358typedef string<c8> stringc;
1359 1359
1360//! Typedef for wide character strings 1360//! Typedef for wide character strings
1361typedef string<wchar_t> stringw; 1361typedef string<wchar_t> stringw;
1362 1362
1363 1363
1364} // end namespace core 1364} // end namespace core
1365} // end namespace irr 1365} // end namespace irr
1366 1366
1367#endif 1367#endif
1368 1368
diff --git a/libraries/irrlicht-1.8/include/irrTypes.h b/libraries/irrlicht-1.8/include/irrTypes.h
index 6b3cb8c..e7f8fd9 100644
--- a/libraries/irrlicht-1.8/include/irrTypes.h
+++ b/libraries/irrlicht-1.8/include/irrTypes.h
@@ -1,250 +1,250 @@
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#ifndef __IRR_TYPES_H_INCLUDED__ 5#ifndef __IRR_TYPES_H_INCLUDED__
6#define __IRR_TYPES_H_INCLUDED__ 6#define __IRR_TYPES_H_INCLUDED__
7 7
8#include "IrrCompileConfig.h" 8#include "IrrCompileConfig.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12 12
13//! 8 bit unsigned variable. 13//! 8 bit unsigned variable.
14/** This is a typedef for unsigned char, it ensures portability of the engine. */ 14/** This is a typedef for unsigned char, it ensures portability of the engine. */
15#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)) 15#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
16typedef unsigned __int8 u8; 16typedef unsigned __int8 u8;
17#else 17#else
18typedef unsigned char u8; 18typedef unsigned char u8;
19#endif 19#endif
20 20
21//! 8 bit signed variable. 21//! 8 bit signed variable.
22/** This is a typedef for signed char, it ensures portability of the engine. */ 22/** This is a typedef for signed char, it ensures portability of the engine. */
23#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)) 23#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
24typedef __int8 s8; 24typedef __int8 s8;
25#else 25#else
26typedef signed char s8; 26typedef signed char s8;
27#endif 27#endif
28 28
29//! 8 bit character variable. 29//! 8 bit character variable.
30/** This is a typedef for char, it ensures portability of the engine. */ 30/** This is a typedef for char, it ensures portability of the engine. */
31typedef char c8; 31typedef char c8;
32 32
33 33
34 34
35//! 16 bit unsigned variable. 35//! 16 bit unsigned variable.
36/** This is a typedef for unsigned short, it ensures portability of the engine. */ 36/** This is a typedef for unsigned short, it ensures portability of the engine. */
37#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)) 37#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
38typedef unsigned __int16 u16; 38typedef unsigned __int16 u16;
39#else 39#else
40typedef unsigned short u16; 40typedef unsigned short u16;
41#endif 41#endif
42 42
43//! 16 bit signed variable. 43//! 16 bit signed variable.
44/** This is a typedef for signed short, it ensures portability of the engine. */ 44/** This is a typedef for signed short, it ensures portability of the engine. */
45#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)) 45#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
46typedef __int16 s16; 46typedef __int16 s16;
47#else 47#else
48typedef signed short s16; 48typedef signed short s16;
49#endif 49#endif
50 50
51 51
52 52
53//! 32 bit unsigned variable. 53//! 32 bit unsigned variable.
54/** This is a typedef for unsigned int, it ensures portability of the engine. */ 54/** This is a typedef for unsigned int, it ensures portability of the engine. */
55#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)) 55#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
56typedef unsigned __int32 u32; 56typedef unsigned __int32 u32;
57#else 57#else
58typedef unsigned int u32; 58typedef unsigned int u32;
59#endif 59#endif
60 60
61//! 32 bit signed variable. 61//! 32 bit signed variable.
62/** This is a typedef for signed int, it ensures portability of the engine. */ 62/** This is a typedef for signed int, it ensures portability of the engine. */
63#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)) 63#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
64typedef __int32 s32; 64typedef __int32 s32;
65#else 65#else
66typedef signed int s32; 66typedef signed int s32;
67#endif 67#endif
68 68
69 69
70#ifdef __IRR_HAS_S64 70#ifdef __IRR_HAS_S64
71//! 64 bit unsigned variable. 71//! 64 bit unsigned variable.
72/** This is a typedef for 64bit uint, it ensures portability of the engine. */ 72/** This is a typedef for 64bit uint, it ensures portability of the engine. */
73#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)) 73#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
74typedef unsigned __int64 u64; 74typedef unsigned __int64 u64;
75#elif __GNUC__ 75#elif __GNUC__
76#if __WORDSIZE == 64 76#if __WORDSIZE == 64
77typedef unsigned long int u64; 77typedef unsigned long int u64;
78#else 78#else
79__extension__ typedef unsigned long long u64; 79__extension__ typedef unsigned long long u64;
80#endif 80#endif
81#else 81#else
82typedef unsigned long long u64; 82typedef unsigned long long u64;
83#endif 83#endif
84 84
85//! 64 bit signed variable. 85//! 64 bit signed variable.
86/** This is a typedef for 64bit int, it ensures portability of the engine. */ 86/** This is a typedef for 64bit int, it ensures portability of the engine. */
87#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)) 87#if defined(_MSC_VER) || ((__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__))
88typedef __int64 s64; 88typedef __int64 s64;
89#elif __GNUC__ 89#elif __GNUC__
90#if __WORDSIZE == 64 90#if __WORDSIZE == 64
91typedef long int s64; 91typedef long int s64;
92#else 92#else
93__extension__ typedef long long s64; 93__extension__ typedef long long s64;
94#endif 94#endif
95#else 95#else
96typedef long long s64; 96typedef long long s64;
97#endif 97#endif
98#endif // __IRR_HAS_S64 98#endif // __IRR_HAS_S64
99 99
100 100
101 101
102//! 32 bit floating point variable. 102//! 32 bit floating point variable.
103/** This is a typedef for float, it ensures portability of the engine. */ 103/** This is a typedef for float, it ensures portability of the engine. */
104typedef float f32; 104typedef float f32;
105 105
106//! 64 bit floating point variable. 106//! 64 bit floating point variable.
107/** This is a typedef for double, it ensures portability of the engine. */ 107/** This is a typedef for double, it ensures portability of the engine. */
108typedef double f64; 108typedef double f64;
109 109
110 110
111} // end namespace irr 111} // end namespace irr
112 112
113 113
114#include <wchar.h> 114#include <wchar.h>
115#ifdef _IRR_WINDOWS_API_ 115#ifdef _IRR_WINDOWS_API_
116//! Defines for s{w,n}printf because these methods do not match the ISO C 116//! Defines for s{w,n}printf because these methods do not match the ISO C
117//! standard on Windows platforms, but it does on all others. 117//! standard on Windows platforms, but it does on all others.
118//! These should be int snprintf(char *str, size_t size, const char *format, ...); 118//! These should be int snprintf(char *str, size_t size, const char *format, ...);
119//! and int swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...); 119//! and int swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...);
120#if defined(_MSC_VER) && _MSC_VER > 1310 && !defined (_WIN32_WCE) 120#if defined(_MSC_VER) && _MSC_VER > 1310 && !defined (_WIN32_WCE)
121#define swprintf swprintf_s 121#define swprintf swprintf_s
122#define snprintf sprintf_s 122#define snprintf sprintf_s
123#else 123#else
124#define swprintf _snwprintf 124#define swprintf _snwprintf
125#define snprintf _snprintf 125#define snprintf _snprintf
126#endif 126#endif
127 127
128// define the wchar_t type if not already built in. 128// define the wchar_t type if not already built in.
129#ifdef _MSC_VER 129#ifdef _MSC_VER
130#ifndef _WCHAR_T_DEFINED 130#ifndef _WCHAR_T_DEFINED
131//! A 16 bit wide character type. 131//! A 16 bit wide character type.
132/** 132/**
133 Defines the wchar_t-type. 133 Defines the wchar_t-type.
134 In VS6, its not possible to tell 134 In VS6, its not possible to tell
135 the standard compiler to treat wchar_t as a built-in type, and 135 the standard compiler to treat wchar_t as a built-in type, and
136 sometimes we just don't want to include the huge stdlib.h or wchar.h, 136 sometimes we just don't want to include the huge stdlib.h or wchar.h,
137 so we'll use this. 137 so we'll use this.
138*/ 138*/
139typedef unsigned short wchar_t; 139typedef unsigned short wchar_t;
140#define _WCHAR_T_DEFINED 140#define _WCHAR_T_DEFINED
141#endif // wchar is not defined 141#endif // wchar is not defined
142#endif // microsoft compiler 142#endif // microsoft compiler
143#endif // _IRR_WINDOWS_API_ 143#endif // _IRR_WINDOWS_API_
144 144
145namespace irr 145namespace irr
146{ 146{
147 147
148//! Type name for character type used by the file system. 148//! Type name for character type used by the file system.
149/** Should the wide character version of the FileSystem be used it is a 149/** Should the wide character version of the FileSystem be used it is a
15016 bit character variable. Used for unicode Filesystem and unicode strings. 15016 bit character variable. Used for unicode Filesystem and unicode strings.
151Else it is a 8 bit character variable. Used for ansi Filesystem and non-unicode 151Else it is a 8 bit character variable. Used for ansi Filesystem and non-unicode
152strings 152strings
153*/ 153*/
154#if defined(_IRR_WCHAR_FILESYSTEM) 154#if defined(_IRR_WCHAR_FILESYSTEM)
155 typedef wchar_t fschar_t; 155 typedef wchar_t fschar_t;
156 #define _IRR_TEXT(X) L##X 156 #define _IRR_TEXT(X) L##X
157#else 157#else
158 typedef char fschar_t; 158 typedef char fschar_t;
159 #define _IRR_TEXT(X) X 159 #define _IRR_TEXT(X) X
160#endif 160#endif
161 161
162} // end namespace irr 162} // end namespace irr
163 163
164//! define a break macro for debugging. 164//! define a break macro for debugging.
165#if defined(_DEBUG) 165#if defined(_DEBUG)
166#if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && !defined (_WIN32_WCE) 166#if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && !defined (_WIN32_WCE)
167 #if defined(WIN64) || defined(_WIN64) // using portable common solution for x64 configuration 167 #if defined(WIN64) || defined(_WIN64) // using portable common solution for x64 configuration
168 #include <crtdbg.h> 168 #include <crtdbg.h>
169 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();} 169 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();}
170 #else 170 #else
171 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3} 171 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3}
172 #endif 172 #endif
173#else 173#else
174#include "assert.h" 174#include "assert.h"
175#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) assert( !(_CONDITION_) ); 175#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) assert( !(_CONDITION_) );
176#endif 176#endif
177#else 177#else
178#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) 178#define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
179#endif 179#endif
180 180
181//! Defines a deprecated macro which generates a warning at compile time 181//! Defines a deprecated macro which generates a warning at compile time
182/** The usage is simple 182/** The usage is simple
183For typedef: typedef _IRR_DEPRECATED_ int test1; 183For typedef: typedef _IRR_DEPRECATED_ int test1;
184For classes/structs: class _IRR_DEPRECATED_ test2 { ... }; 184For classes/structs: class _IRR_DEPRECATED_ test2 { ... };
185For methods: class test3 { _IRR_DEPRECATED_ virtual void foo() {} }; 185For methods: class test3 { _IRR_DEPRECATED_ virtual void foo() {} };
186For functions: template<class T> _IRR_DEPRECATED_ void test4(void) {} 186For functions: template<class T> _IRR_DEPRECATED_ void test4(void) {}
187**/ 187**/
188#if defined(IGNORE_DEPRECATED_WARNING) 188#if defined(IGNORE_DEPRECATED_WARNING)
189#define _IRR_DEPRECATED_ 189#define _IRR_DEPRECATED_
190#elif _MSC_VER >= 1310 //vs 2003 or higher 190#elif _MSC_VER >= 1310 //vs 2003 or higher
191#define _IRR_DEPRECATED_ __declspec(deprecated) 191#define _IRR_DEPRECATED_ __declspec(deprecated)
192#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) // all versions above 3.0 should support this feature 192#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) // all versions above 3.0 should support this feature
193#define _IRR_DEPRECATED_ __attribute__ ((deprecated)) 193#define _IRR_DEPRECATED_ __attribute__ ((deprecated))
194#else 194#else
195#define _IRR_DEPRECATED_ 195#define _IRR_DEPRECATED_
196#endif 196#endif
197 197
198//! Defines a small statement to work around a microsoft compiler bug. 198//! Defines a small statement to work around a microsoft compiler bug.
199/** The microsoft compiler 7.0 - 7.1 has a bug: 199/** The microsoft compiler 7.0 - 7.1 has a bug:
200When you call unmanaged code that returns a bool type value of false from managed code, 200When you call unmanaged code that returns a bool type value of false from managed code,
201the return value may appear as true. See 201the return value may appear as true. See
202http://support.microsoft.com/default.aspx?kbid=823071 for details. 202http://support.microsoft.com/default.aspx?kbid=823071 for details.
203Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400*/ 203Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400*/
204#if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400) 204#if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
205#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100 205#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100
206#else 206#else
207#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX 207#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
208#endif // _IRR_MANAGED_MARSHALLING_BUGFIX 208#endif // _IRR_MANAGED_MARSHALLING_BUGFIX
209 209
210 210
211// memory debugging 211// memory debugging
212#if defined(_DEBUG) && defined(IRRLICHT_EXPORTS) && defined(_MSC_VER) && \ 212#if defined(_DEBUG) && defined(IRRLICHT_EXPORTS) && defined(_MSC_VER) && \
213 (_MSC_VER > 1299) && !defined(_IRR_DONT_DO_MEMORY_DEBUGGING_HERE) && !defined(_WIN32_WCE) 213 (_MSC_VER > 1299) && !defined(_IRR_DONT_DO_MEMORY_DEBUGGING_HERE) && !defined(_WIN32_WCE)
214 214
215 #define CRTDBG_MAP_ALLOC 215 #define CRTDBG_MAP_ALLOC
216 #define _CRTDBG_MAP_ALLOC 216 #define _CRTDBG_MAP_ALLOC
217 #define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__) 217 #define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
218 #include <stdlib.h> 218 #include <stdlib.h>
219 #include <crtdbg.h> 219 #include <crtdbg.h>
220 #define new DEBUG_CLIENTBLOCK 220 #define new DEBUG_CLIENTBLOCK
221#endif 221#endif
222 222
223// disable truncated debug information warning in visual studio 6 by default 223// disable truncated debug information warning in visual studio 6 by default
224#if defined(_MSC_VER) && (_MSC_VER < 1300 ) 224#if defined(_MSC_VER) && (_MSC_VER < 1300 )
225#pragma warning( disable: 4786) 225#pragma warning( disable: 4786)
226#endif // _MSC 226#endif // _MSC
227 227
228 228
229//! ignore VC8 warning deprecated 229//! ignore VC8 warning deprecated
230/** The microsoft compiler */ 230/** The microsoft compiler */
231#if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER >= 1400) 231#if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER >= 1400)
232 //#pragma warning( disable: 4996) 232 //#pragma warning( disable: 4996)
233 //#define _CRT_SECURE_NO_DEPRECATE 1 233 //#define _CRT_SECURE_NO_DEPRECATE 1
234 //#define _CRT_NONSTDC_NO_DEPRECATE 1 234 //#define _CRT_NONSTDC_NO_DEPRECATE 1
235#endif 235#endif
236 236
237 237
238//! creates four CC codes used in Irrlicht for simple ids 238//! creates four CC codes used in Irrlicht for simple ids
239/** some compilers can create those by directly writing the 239/** some compilers can create those by directly writing the
240code like 'code', but some generate warnings so we use this macro here */ 240code like 'code', but some generate warnings so we use this macro here */
241#define MAKE_IRR_ID(c0, c1, c2, c3) \ 241#define MAKE_IRR_ID(c0, c1, c2, c3) \
242 ((irr::u32)(irr::u8)(c0) | ((irr::u32)(irr::u8)(c1) << 8) | \ 242 ((irr::u32)(irr::u8)(c0) | ((irr::u32)(irr::u8)(c1) << 8) | \
243 ((irr::u32)(irr::u8)(c2) << 16) | ((irr::u32)(irr::u8)(c3) << 24 )) 243 ((irr::u32)(irr::u8)(c2) << 16) | ((irr::u32)(irr::u8)(c3) << 24 ))
244 244
245#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 245#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
246#define _strcmpi(a,b) strcmpi(a,b) 246#define _strcmpi(a,b) strcmpi(a,b)
247#endif 247#endif
248 248
249#endif // __IRR_TYPES_H_INCLUDED__ 249#endif // __IRR_TYPES_H_INCLUDED__
250 250
diff --git a/libraries/irrlicht-1.8/include/irrXML.h b/libraries/irrlicht-1.8/include/irrXML.h
index 024c641..b8331ac 100644
--- a/libraries/irrlicht-1.8/include/irrXML.h
+++ b/libraries/irrlicht-1.8/include/irrXML.h
@@ -1,566 +1,566 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine" and the "irrXML" project. 2// This file is part of the "Irrlicht Engine" and the "irrXML" project.
3// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h 3// For conditions of distribution and use, see copyright notice in irrlicht.h and/or irrXML.h
4 4
5#ifndef __IRR_XML_H_INCLUDED__ 5#ifndef __IRR_XML_H_INCLUDED__
6#define __IRR_XML_H_INCLUDED__ 6#define __IRR_XML_H_INCLUDED__
7 7
8#include <stdio.h> 8#include <stdio.h>
9#include "IrrCompileConfig.h" 9#include "IrrCompileConfig.h"
10 10
11/** \mainpage irrXML 1.2 API documentation 11/** \mainpage irrXML 1.2 API documentation
12 <div align="center"><img src="logobig.png" ></div> 12 <div align="center"><img src="logobig.png" ></div>
13 13
14 \section intro Introduction 14 \section intro Introduction
15 15
16 Welcome to the irrXML API documentation. 16 Welcome to the irrXML API documentation.
17 Here you'll find any information you'll need to develop applications with 17 Here you'll find any information you'll need to develop applications with
18 irrXML. If you look for a tutorial on how to start, take a look at the \ref irrxmlexample, 18 irrXML. If you look for a tutorial on how to start, take a look at the \ref irrxmlexample,
19 at the homepage of irrXML at <A HREF="http://www.ambiera.com/irrxml/">www.ambiera.com/irrxml/</A> 19 at the homepage of irrXML at <A HREF="http://www.ambiera.com/irrxml/">www.ambiera.com/irrxml/</A>
20 or into the SDK in the directory example. 20 or into the SDK in the directory example.
21 21
22 irrXML is intended to be a high speed and easy-to-use XML Parser for C++, and 22 irrXML is intended to be a high speed and easy-to-use XML Parser for C++, and
23 this documentation is an important part of it. If you have any questions or 23 this documentation is an important part of it. If you have any questions or
24 suggestions, just send a email to the author of the engine, Nikolaus Gebhardt 24 suggestions, just send a email to the author of the engine, Nikolaus Gebhardt
25 (niko (at) irrlicht3d.org). For more informations about this parser, see \ref history. 25 (niko (at) irrlicht3d.org). For more informations about this parser, see \ref history.
26 26
27 \section features Features 27 \section features Features
28 28
29 irrXML provides forward-only, read-only 29 irrXML provides forward-only, read-only
30 access to a stream of non validated XML data. It was fully implemented by 30 access to a stream of non validated XML data. It was fully implemented by
31 Nikolaus Gebhardt. Its current features are: 31 Nikolaus Gebhardt. Its current features are:
32 32
33 - It it fast as lighting and has very low memory usage. It was 33 - It it fast as lighting and has very low memory usage. It was
34 developed with the intention of being used in 3D games, as it already has been. 34 developed with the intention of being used in 3D games, as it already has been.
35 - irrXML is very small: It only consists of 60 KB of code and can be added easily 35 - irrXML is very small: It only consists of 60 KB of code and can be added easily
36 to your existing project. 36 to your existing project.
37 - Of course, it is platform independent and works with lots of compilers. 37 - Of course, it is platform independent and works with lots of compilers.
38 - It is able to parse ASCII, UTF-8, UTF-16 and UTF-32 text files, both in 38 - It is able to parse ASCII, UTF-8, UTF-16 and UTF-32 text files, both in
39 little and big endian format. 39 little and big endian format.
40 - Independent of the input file format, the parser can return all strings in ASCII, UTF-8, 40 - Independent of the input file format, the parser can return all strings in ASCII, UTF-8,
41 UTF-16 and UTF-32 format. 41 UTF-16 and UTF-32 format.
42 - With its optional file access abstraction it has the advantage that it can read not 42 - With its optional file access abstraction it has the advantage that it can read not
43 only from files but from any type of data (memory, network, ...). For example when 43 only from files but from any type of data (memory, network, ...). For example when
44 used with the Irrlicht Engine, it directly reads from compressed .zip files. 44 used with the Irrlicht Engine, it directly reads from compressed .zip files.
45 - Just like the Irrlicht Engine for which it was originally created, it is extremely easy 45 - Just like the Irrlicht Engine for which it was originally created, it is extremely easy
46 to use. 46 to use.
47 - It has no external dependencies, it does not even need the STL. 47 - It has no external dependencies, it does not even need the STL.
48 48
49 Although irrXML has some strenghts, it currently also has the following limitations: 49 Although irrXML has some strenghts, it currently also has the following limitations:
50 50
51 - The input xml file is not validated and assumed to be correct. 51 - The input xml file is not validated and assumed to be correct.
52 52
53 \section irrxmlexample Example 53 \section irrxmlexample Example
54 54
55 The following code demonstrates the basic usage of irrXML. A simple xml 55 The following code demonstrates the basic usage of irrXML. A simple xml
56 file like this is parsed: 56 file like this is parsed:
57 \code 57 \code
58 <?xml version="1.0"?> 58 <?xml version="1.0"?>
59 <config> 59 <config>
60 <!-- This is a config file for the mesh viewer --> 60 <!-- This is a config file for the mesh viewer -->
61 <model file="dwarf.dea" /> 61 <model file="dwarf.dea" />
62 <messageText caption="Irrlicht Engine Mesh Viewer"> 62 <messageText caption="Irrlicht Engine Mesh Viewer">
63 Welcome to the Mesh Viewer of the &quot;Irrlicht Engine&quot;. 63 Welcome to the Mesh Viewer of the &quot;Irrlicht Engine&quot;.
64 </messageText> 64 </messageText>
65 </config> 65 </config>
66 \endcode 66 \endcode
67 67
68 The code for parsing this file would look like this: 68 The code for parsing this file would look like this:
69 \code 69 \code
70 #include <irrXML.h> 70 #include <irrXML.h>
71 using namespace irr; // irrXML is located in the namespace irr::io 71 using namespace irr; // irrXML is located in the namespace irr::io
72 using namespace io; 72 using namespace io;
73 73
74 #include <string> // we use STL strings to store data in this example 74 #include <string> // we use STL strings to store data in this example
75 75
76 void main() 76 void main()
77 { 77 {
78 // create the reader using one of the factory functions 78 // create the reader using one of the factory functions
79 79
80 IrrXMLReader* xml = createIrrXMLReader("config.xml"); 80 IrrXMLReader* xml = createIrrXMLReader("config.xml");
81 81
82 // strings for storing the data we want to get out of the file 82 // strings for storing the data we want to get out of the file
83 std::string modelFile; 83 std::string modelFile;
84 std::string messageText; 84 std::string messageText;
85 std::string caption; 85 std::string caption;
86 86
87 // parse the file until end reached 87 // parse the file until end reached
88 88
89 while(xml && xml->read()) 89 while(xml && xml->read())
90 { 90 {
91 switch(xml->getNodeType()) 91 switch(xml->getNodeType())
92 { 92 {
93 case EXN_TEXT: 93 case EXN_TEXT:
94 // in this xml file, the only text which occurs is the messageText 94 // in this xml file, the only text which occurs is the messageText
95 messageText = xml->getNodeData(); 95 messageText = xml->getNodeData();
96 break; 96 break;
97 case EXN_ELEMENT: 97 case EXN_ELEMENT:
98 { 98 {
99 if (!strcmp("model", xml->getNodeName())) 99 if (!strcmp("model", xml->getNodeName()))
100 modelFile = xml->getAttributeValue("file"); 100 modelFile = xml->getAttributeValue("file");
101 else 101 else
102 if (!strcmp("messageText", xml->getNodeName())) 102 if (!strcmp("messageText", xml->getNodeName()))
103 caption = xml->getAttributeValue("caption"); 103 caption = xml->getAttributeValue("caption");
104 } 104 }
105 break; 105 break;
106 } 106 }
107 } 107 }
108 108
109 // delete the xml parser after usage 109 // delete the xml parser after usage
110 delete xml; 110 delete xml;
111 } 111 }
112 \endcode 112 \endcode
113 113
114 \section howto How to use 114 \section howto How to use
115 115
116 Simply add the source files in the /src directory of irrXML to your project. Done. 116 Simply add the source files in the /src directory of irrXML to your project. Done.
117 117
118 \section license License 118 \section license License
119 119
120 The irrXML license is based on the zlib license. Basicly, this means you can do with 120 The irrXML license is based on the zlib license. Basicly, this means you can do with
121 irrXML whatever you want: 121 irrXML whatever you want:
122 122
123 Copyright (C) 2002-2012 Nikolaus Gebhardt 123 Copyright (C) 2002-2012 Nikolaus Gebhardt
124 124
125 This software is provided 'as-is', without any express or implied 125 This software is provided 'as-is', without any express or implied
126 warranty. In no event will the authors be held liable for any damages 126 warranty. In no event will the authors be held liable for any damages
127 arising from the use of this software. 127 arising from the use of this software.
128 128
129 Permission is granted to anyone to use this software for any purpose, 129 Permission is granted to anyone to use this software for any purpose,
130 including commercial applications, and to alter it and redistribute it 130 including commercial applications, and to alter it and redistribute it
131 freely, subject to the following restrictions: 131 freely, subject to the following restrictions:
132 132
133 1. The origin of this software must not be misrepresented; you must not 133 1. The origin of this software must not be misrepresented; you must not
134 claim that you wrote the original software. If you use this software 134 claim that you wrote the original software. If you use this software
135 in a product, an acknowledgment in the product documentation would be 135 in a product, an acknowledgment in the product documentation would be
136 appreciated but is not required. 136 appreciated but is not required.
137 137
138 2. Altered source versions must be plainly marked as such, and must not be 138 2. Altered source versions must be plainly marked as such, and must not be
139 misrepresented as being the original software. 139 misrepresented as being the original software.
140 140
141 3. This notice may not be removed or altered from any source distribution. 141 3. This notice may not be removed or altered from any source distribution.
142 142
143 \section history History 143 \section history History
144 144
145 As lots of references in this documentation and the source show, this xml 145 As lots of references in this documentation and the source show, this xml
146 parser has originally been a part of the 146 parser has originally been a part of the
147 <A HREF="http://irrlicht.sourceforge.net" >Irrlicht Engine</A>. But because 147 <A HREF="http://irrlicht.sourceforge.net" >Irrlicht Engine</A>. But because
148 the parser has become very useful with the latest release, people asked for a 148 the parser has become very useful with the latest release, people asked for a
149 separate version of it, to be able to use it in non Irrlicht projects. With 149 separate version of it, to be able to use it in non Irrlicht projects. With
150 irrXML 1.0, this has now been done. 150 irrXML 1.0, this has now been done.
151*/ 151*/
152 152
153namespace irr 153namespace irr
154{ 154{
155namespace io 155namespace io
156{ 156{
157 //! Enumeration of all supported source text file formats 157 //! Enumeration of all supported source text file formats
158 enum ETEXT_FORMAT 158 enum ETEXT_FORMAT
159 { 159 {
160 //! ASCII, file without byte order mark, or not a text file 160 //! ASCII, file without byte order mark, or not a text file
161 ETF_ASCII, 161 ETF_ASCII,
162 162
163 //! UTF-8 format 163 //! UTF-8 format
164 ETF_UTF8, 164 ETF_UTF8,
165 165
166 //! UTF-16 format, big endian 166 //! UTF-16 format, big endian
167 ETF_UTF16_BE, 167 ETF_UTF16_BE,
168 168
169 //! UTF-16 format, little endian 169 //! UTF-16 format, little endian
170 ETF_UTF16_LE, 170 ETF_UTF16_LE,
171 171
172 //! UTF-32 format, big endian 172 //! UTF-32 format, big endian
173 ETF_UTF32_BE, 173 ETF_UTF32_BE,
174 174
175 //! UTF-32 format, little endian 175 //! UTF-32 format, little endian
176 ETF_UTF32_LE 176 ETF_UTF32_LE
177 }; 177 };
178 178
179 179
180 //! Enumeration for all xml nodes which are parsed by IrrXMLReader 180 //! Enumeration for all xml nodes which are parsed by IrrXMLReader
181 enum EXML_NODE 181 enum EXML_NODE
182 { 182 {
183 //! No xml node. This is usually the node if you did not read anything yet. 183 //! No xml node. This is usually the node if you did not read anything yet.
184 EXN_NONE, 184 EXN_NONE,
185 185
186 //! An xml element such as &lt;foo&gt; 186 //! An xml element such as &lt;foo&gt;
187 EXN_ELEMENT, 187 EXN_ELEMENT,
188 188
189 //! End of an xml element such as &lt;/foo&gt; 189 //! End of an xml element such as &lt;/foo&gt;
190 EXN_ELEMENT_END, 190 EXN_ELEMENT_END,
191 191
192 //! Text within an xml element: &lt;foo&gt; this is the text. &lt;/foo&gt; 192 //! Text within an xml element: &lt;foo&gt; this is the text. &lt;/foo&gt;
193 //! Also text between 2 xml elements: &lt;/foo&gt; this is the text. &lt;foo&gt; 193 //! Also text between 2 xml elements: &lt;/foo&gt; this is the text. &lt;foo&gt;
194 EXN_TEXT, 194 EXN_TEXT,
195 195
196 //! An xml comment like &lt;!-- I am a comment --&gt; or a DTD definition. 196 //! An xml comment like &lt;!-- I am a comment --&gt; or a DTD definition.
197 EXN_COMMENT, 197 EXN_COMMENT,
198 198
199 //! An xml cdata section like &lt;![CDATA[ this is some CDATA ]]&gt; 199 //! An xml cdata section like &lt;![CDATA[ this is some CDATA ]]&gt;
200 EXN_CDATA, 200 EXN_CDATA,
201 201
202 //! Unknown element. 202 //! Unknown element.
203 EXN_UNKNOWN 203 EXN_UNKNOWN
204 }; 204 };
205 205
206 //! Callback class for file read abstraction. 206 //! Callback class for file read abstraction.
207 /** With this, it is possible to make the xml parser read in other 207 /** With this, it is possible to make the xml parser read in other
208 things than just files. The Irrlicht engine is using this for example to 208 things than just files. The Irrlicht engine is using this for example to
209 read xml from compressed .zip files. To make the parser read in 209 read xml from compressed .zip files. To make the parser read in
210 any other data, derive a class from this interface, implement the 210 any other data, derive a class from this interface, implement the
211 two methods to read your data and give a pointer to an instance of 211 two methods to read your data and give a pointer to an instance of
212 your implementation when calling createIrrXMLReader(), 212 your implementation when calling createIrrXMLReader(),
213 createIrrXMLReaderUTF16() or createIrrXMLReaderUTF32() */ 213 createIrrXMLReaderUTF16() or createIrrXMLReaderUTF32() */
214 class IFileReadCallBack 214 class IFileReadCallBack
215 { 215 {
216 public: 216 public:
217 217
218 //! Destructor 218 //! Destructor
219 virtual ~IFileReadCallBack() {} 219 virtual ~IFileReadCallBack() {}
220 220
221 //! Reads an amount of bytes from the file. 221 //! Reads an amount of bytes from the file.
222 /** \param buffer: Pointer to buffer where to read bytes will be written to. 222 /** \param buffer: Pointer to buffer where to read bytes will be written to.
223 \param sizeToRead: Amount of bytes to read from the file. 223 \param sizeToRead: Amount of bytes to read from the file.
224 \return Returns how much bytes were read. */ 224 \return Returns how much bytes were read. */
225 virtual int read(void* buffer, int sizeToRead) = 0; 225 virtual int read(void* buffer, int sizeToRead) = 0;
226 226
227 //! Returns size of file in bytes 227 //! Returns size of file in bytes
228 virtual long getSize() const = 0; 228 virtual long getSize() const = 0;
229 }; 229 };
230 230
231 //! Empty class to be used as parent class for IrrXMLReader. 231 //! Empty class to be used as parent class for IrrXMLReader.
232 /** If you need another class as base class for the xml reader, you can do this by creating 232 /** If you need another class as base class for the xml reader, you can do this by creating
233 the reader using for example new CXMLReaderImpl<char, YourBaseClass>(yourcallback); 233 the reader using for example new CXMLReaderImpl<char, YourBaseClass>(yourcallback);
234 The Irrlicht Engine for example needs IReferenceCounted as base class for every object to 234 The Irrlicht Engine for example needs IReferenceCounted as base class for every object to
235 let it automaticly reference countend, hence it replaces IXMLBase with IReferenceCounted. 235 let it automaticly reference countend, hence it replaces IXMLBase with IReferenceCounted.
236 See irrXML.cpp on how this can be done in detail. */ 236 See irrXML.cpp on how this can be done in detail. */
237 class IXMLBase 237 class IXMLBase
238 { 238 {
239 }; 239 };
240 240
241 //! Interface providing easy read access to a XML file. 241 //! Interface providing easy read access to a XML file.
242 /** You can create an instance of this reader using one of the factory functions 242 /** You can create an instance of this reader using one of the factory functions
243 createIrrXMLReader(), createIrrXMLReaderUTF16() and createIrrXMLReaderUTF32(). 243 createIrrXMLReader(), createIrrXMLReaderUTF16() and createIrrXMLReaderUTF32().
244 If using the parser from the Irrlicht Engine, please use IFileSystem::createXMLReader() 244 If using the parser from the Irrlicht Engine, please use IFileSystem::createXMLReader()
245 instead. 245 instead.
246 For a detailed intro how to use the parser, see \ref irrxmlexample and \ref features. 246 For a detailed intro how to use the parser, see \ref irrxmlexample and \ref features.
247 247
248 The typical usage of this parser looks like this: 248 The typical usage of this parser looks like this:
249 \code 249 \code
250 #include <irrXML.h> 250 #include <irrXML.h>
251 using namespace irr; // irrXML is located in the namespace irr::io 251 using namespace irr; // irrXML is located in the namespace irr::io
252 using namespace io; 252 using namespace io;
253 253
254 void main() 254 void main()
255 { 255 {
256 // create the reader using one of the factory functions 256 // create the reader using one of the factory functions
257 IrrXMLReader* xml = createIrrXMLReader("config.xml"); 257 IrrXMLReader* xml = createIrrXMLReader("config.xml");
258 258
259 if (xml == 0) 259 if (xml == 0)
260 return; // file could not be opened 260 return; // file could not be opened
261 261
262 // parse the file until end reached 262 // parse the file until end reached
263 while(xml->read()) 263 while(xml->read())
264 { 264 {
265 // based on xml->getNodeType(), do something. 265 // based on xml->getNodeType(), do something.
266 } 266 }
267 267
268 // delete the xml parser after usage 268 // delete the xml parser after usage
269 delete xml; 269 delete xml;
270 } 270 }
271 \endcode 271 \endcode
272 See \ref irrxmlexample for a more detailed example. 272 See \ref irrxmlexample for a more detailed example.
273 */ 273 */
274 template<class char_type, class super_class> 274 template<class char_type, class super_class>
275 class IIrrXMLReader : public super_class 275 class IIrrXMLReader : public super_class
276 { 276 {
277 public: 277 public:
278 278
279 //! Destructor 279 //! Destructor
280 virtual ~IIrrXMLReader() {} 280 virtual ~IIrrXMLReader() {}
281 281
282 //! Reads forward to the next xml node. 282 //! Reads forward to the next xml node.
283 /** \return Returns false, if there was no further node. */ 283 /** \return Returns false, if there was no further node. */
284 virtual bool read() = 0; 284 virtual bool read() = 0;
285 285
286 //! Returns the type of the current XML node. 286 //! Returns the type of the current XML node.
287 virtual EXML_NODE getNodeType() const = 0; 287 virtual EXML_NODE getNodeType() const = 0;
288 288
289 //! Returns attribute count of the current XML node. 289 //! Returns attribute count of the current XML node.
290 /** This is usually 290 /** This is usually
291 non null if the current node is EXN_ELEMENT, and the element has attributes. 291 non null if the current node is EXN_ELEMENT, and the element has attributes.
292 \return Returns amount of attributes of this xml node. */ 292 \return Returns amount of attributes of this xml node. */
293 virtual unsigned int getAttributeCount() const = 0; 293 virtual unsigned int getAttributeCount() const = 0;
294 294
295 //! Returns name of an attribute. 295 //! Returns name of an attribute.
296 /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. 296 /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
297 \return Name of the attribute, 0 if an attribute with this index does not exist. */ 297 \return Name of the attribute, 0 if an attribute with this index does not exist. */
298 virtual const char_type* getAttributeName(int idx) const = 0; 298 virtual const char_type* getAttributeName(int idx) const = 0;
299 299
300 //! Returns the value of an attribute. 300 //! Returns the value of an attribute.
301 /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. 301 /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
302 \return Value of the attribute, 0 if an attribute with this index does not exist. */ 302 \return Value of the attribute, 0 if an attribute with this index does not exist. */
303 virtual const char_type* getAttributeValue(int idx) const = 0; 303 virtual const char_type* getAttributeValue(int idx) const = 0;
304 304
305 //! Returns the value of an attribute. 305 //! Returns the value of an attribute.
306 /** \param name: Name of the attribute. 306 /** \param name: Name of the attribute.
307 \return Value of the attribute, 0 if an attribute with this name does not exist. */ 307 \return Value of the attribute, 0 if an attribute with this name does not exist. */
308 virtual const char_type* getAttributeValue(const char_type* name) const = 0; 308 virtual const char_type* getAttributeValue(const char_type* name) const = 0;
309 309
310 //! Returns the value of an attribute in a safe way. 310 //! Returns the value of an attribute in a safe way.
311 /** Like getAttributeValue(), but does not 311 /** Like getAttributeValue(), but does not
312 return 0 if the attribute does not exist. An empty string ("") is returned then. 312 return 0 if the attribute does not exist. An empty string ("") is returned then.
313 \param name: Name of the attribute. 313 \param name: Name of the attribute.
314 \return Value of the attribute, and "" if an attribute with this name does not exist */ 314 \return Value of the attribute, and "" if an attribute with this name does not exist */
315 virtual const char_type* getAttributeValueSafe(const char_type* name) const = 0; 315 virtual const char_type* getAttributeValueSafe(const char_type* name) const = 0;
316 316
317 //! Returns the value of an attribute as integer. 317 //! Returns the value of an attribute as integer.
318 /** \param name Name of the attribute. 318 /** \param name Name of the attribute.
319 \return Value of the attribute as integer, and 0 if an attribute with this name does not exist or 319 \return Value of the attribute as integer, and 0 if an attribute with this name does not exist or
320 the value could not be interpreted as integer. */ 320 the value could not be interpreted as integer. */
321 virtual int getAttributeValueAsInt(const char_type* name) const = 0; 321 virtual int getAttributeValueAsInt(const char_type* name) const = 0;
322 322
323 //! Returns the value of an attribute as integer. 323 //! Returns the value of an attribute as integer.
324 /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. 324 /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
325 \return Value of the attribute as integer, and 0 if an attribute with this index does not exist or 325 \return Value of the attribute as integer, and 0 if an attribute with this index does not exist or
326 the value could not be interpreted as integer. */ 326 the value could not be interpreted as integer. */
327 virtual int getAttributeValueAsInt(int idx) const = 0; 327 virtual int getAttributeValueAsInt(int idx) const = 0;
328 328
329 //! Returns the value of an attribute as float. 329 //! Returns the value of an attribute as float.
330 /** \param name: Name of the attribute. 330 /** \param name: Name of the attribute.
331 \return Value of the attribute as float, and 0 if an attribute with this name does not exist or 331 \return Value of the attribute as float, and 0 if an attribute with this name does not exist or
332 the value could not be interpreted as float. */ 332 the value could not be interpreted as float. */
333 virtual float getAttributeValueAsFloat(const char_type* name) const = 0; 333 virtual float getAttributeValueAsFloat(const char_type* name) const = 0;
334 334
335 //! Returns the value of an attribute as float. 335 //! Returns the value of an attribute as float.
336 /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1. 336 /** \param idx: Zero based index, should be something between 0 and getAttributeCount()-1.
337 \return Value of the attribute as float, and 0 if an attribute with this index does not exist or 337 \return Value of the attribute as float, and 0 if an attribute with this index does not exist or
338 the value could not be interpreted as float. */ 338 the value could not be interpreted as float. */
339 virtual float getAttributeValueAsFloat(int idx) const = 0; 339 virtual float getAttributeValueAsFloat(int idx) const = 0;
340 340
341 //! Returns the name of the current node. 341 //! Returns the name of the current node.
342 /** Only valid, if the node type is EXN_ELEMENT. 342 /** Only valid, if the node type is EXN_ELEMENT.
343 \return Name of the current node or 0 if the node has no name. */ 343 \return Name of the current node or 0 if the node has no name. */
344 virtual const char_type* getNodeName() const = 0; 344 virtual const char_type* getNodeName() const = 0;
345 345
346 //! Returns data of the current node. 346 //! Returns data of the current node.
347 /** Only valid if the node has some 347 /** Only valid if the node has some
348 data and it is of type EXN_TEXT, EXN_COMMENT, EXN_CDATA or EXN_UNKNOWN. */ 348 data and it is of type EXN_TEXT, EXN_COMMENT, EXN_CDATA or EXN_UNKNOWN. */
349 virtual const char_type* getNodeData() const = 0; 349 virtual const char_type* getNodeData() const = 0;
350 350
351 //! Returns if an element is an empty element, like &lt;foo /> 351 //! Returns if an element is an empty element, like &lt;foo />
352 virtual bool isEmptyElement() const = 0; 352 virtual bool isEmptyElement() const = 0;
353 353
354 //! Returns format of the source xml file. 354 //! Returns format of the source xml file.
355 /** It is not necessary to use 355 /** It is not necessary to use
356 this method because the parser will convert the input file format 356 this method because the parser will convert the input file format
357 to the format wanted by the user when creating the parser. This 357 to the format wanted by the user when creating the parser. This
358 method is useful to get/display additional informations. */ 358 method is useful to get/display additional informations. */
359 virtual ETEXT_FORMAT getSourceFormat() const = 0; 359 virtual ETEXT_FORMAT getSourceFormat() const = 0;
360 360
361 //! Returns format of the strings returned by the parser. 361 //! Returns format of the strings returned by the parser.
362 /** This will be UTF8 for example when you created a parser with 362 /** This will be UTF8 for example when you created a parser with
363 IrrXMLReaderUTF8() and UTF32 when it has been created using 363 IrrXMLReaderUTF8() and UTF32 when it has been created using
364 IrrXMLReaderUTF32. It should not be necessary to call this 364 IrrXMLReaderUTF32. It should not be necessary to call this
365 method and only exists for informational purposes. */ 365 method and only exists for informational purposes. */
366 virtual ETEXT_FORMAT getParserFormat() const = 0; 366 virtual ETEXT_FORMAT getParserFormat() const = 0;
367 }; 367 };
368 368
369 369
370 template <typename T> 370 template <typename T>
371 struct xmlChar 371 struct xmlChar
372 { 372 {
373 T c; 373 T c;
374 xmlChar<T>() {} 374 xmlChar<T>() {}
375 xmlChar<T>(char in) : c(static_cast<T>(in)) {} 375 xmlChar<T>(char in) : c(static_cast<T>(in)) {}
376 xmlChar<T>(wchar_t in) : c(static_cast<T>(in)) {} 376 xmlChar<T>(wchar_t in) : c(static_cast<T>(in)) {}
377 explicit xmlChar<T>(unsigned char in) : c(static_cast<T>(in)) {} 377 explicit xmlChar<T>(unsigned char in) : c(static_cast<T>(in)) {}
378 explicit xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {} 378 explicit xmlChar<T>(unsigned short in) : c(static_cast<T>(in)) {}
379 explicit xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {} 379 explicit xmlChar<T>(unsigned int in) : c(static_cast<T>(in)) {}
380 explicit xmlChar<T>(unsigned long in) : c(static_cast<T>(in)) {} 380 explicit xmlChar<T>(unsigned long in) : c(static_cast<T>(in)) {}
381 operator T() const { return c; } 381 operator T() const { return c; }
382 void operator=(int t) { c=static_cast<T>(t); } 382 void operator=(int t) { c=static_cast<T>(t); }
383 }; 383 };
384 384
385 //! defines the utf-16 type. 385 //! defines the utf-16 type.
386 /** Not using wchar_t for this because 386 /** Not using wchar_t for this because
387 wchar_t has 16 bit on windows and 32 bit on other operating systems. */ 387 wchar_t has 16 bit on windows and 32 bit on other operating systems. */
388 typedef xmlChar<unsigned short> char16; 388 typedef xmlChar<unsigned short> char16;
389 389
390 //! defines the utf-32 type. 390 //! defines the utf-32 type.
391 /** Not using wchar_t for this because 391 /** Not using wchar_t for this because
392 wchar_t has 16 bit on windows and 32 bit on other operating systems. */ 392 wchar_t has 16 bit on windows and 32 bit on other operating systems. */
393 typedef xmlChar<unsigned int> char32; 393 typedef xmlChar<unsigned int> char32;
394 394
395 //! A UTF-8 or ASCII character xml parser. 395 //! A UTF-8 or ASCII character xml parser.
396 /** This means that all character data will be returned in 8 bit ASCII or UTF-8 by this parser. 396 /** This means that all character data will be returned in 8 bit ASCII or UTF-8 by this parser.
397 The file to read can be in any format, it will be converted to UTF-8 if it is not 397 The file to read can be in any format, it will be converted to UTF-8 if it is not
398 in this format. 398 in this format.
399 Create an instance of this with createIrrXMLReader(); 399 Create an instance of this with createIrrXMLReader();
400 See IIrrXMLReader for description on how to use it. */ 400 See IIrrXMLReader for description on how to use it. */
401 typedef IIrrXMLReader<char, IXMLBase> IrrXMLReader; 401 typedef IIrrXMLReader<char, IXMLBase> IrrXMLReader;
402 402
403 //! A UTF-16 xml parser. 403 //! A UTF-16 xml parser.
404 /** This means that all character data will be returned in UTF-16 by this parser. 404 /** This means that all character data will be returned in UTF-16 by this parser.
405 The file to read can be in any format, it will be converted to UTF-16 if it is not 405 The file to read can be in any format, it will be converted to UTF-16 if it is not
406 in this format. 406 in this format.
407 Create an instance of this with createIrrXMLReaderUTF16(); 407 Create an instance of this with createIrrXMLReaderUTF16();
408 See IIrrXMLReader for description on how to use it. */ 408 See IIrrXMLReader for description on how to use it. */
409 typedef IIrrXMLReader<char16, IXMLBase> IrrXMLReaderUTF16; 409 typedef IIrrXMLReader<char16, IXMLBase> IrrXMLReaderUTF16;
410 410
411 //! A UTF-32 xml parser. 411 //! A UTF-32 xml parser.
412 /** This means that all character data will be returned in UTF-32 by this parser. 412 /** This means that all character data will be returned in UTF-32 by this parser.
413 The file to read can be in any format, it will be converted to UTF-32 if it is not 413 The file to read can be in any format, it will be converted to UTF-32 if it is not
414 in this format. 414 in this format.
415 Create an instance of this with createIrrXMLReaderUTF32(); 415 Create an instance of this with createIrrXMLReaderUTF32();
416 See IIrrXMLReader for description on how to use it. */ 416 See IIrrXMLReader for description on how to use it. */
417 typedef IIrrXMLReader<char32, IXMLBase> IrrXMLReaderUTF32; 417 typedef IIrrXMLReader<char32, IXMLBase> IrrXMLReaderUTF32;
418 418
419 419
420 //! Creates an instance of an UFT-8 or ASCII character xml parser. 420 //! Creates an instance of an UFT-8 or ASCII character xml parser.
421 /** This means that all character data will be returned in 8 bit ASCII or UTF-8. 421 /** This means that all character data will be returned in 8 bit ASCII or UTF-8.
422 The file to read can be in any format, it will be converted to UTF-8 if it is not in this format. 422 The file to read can be in any format, it will be converted to UTF-8 if it is not in this format.
423 If you are using the Irrlicht Engine, it is better not to use this function but 423 If you are using the Irrlicht Engine, it is better not to use this function but
424 IFileSystem::createXMLReaderUTF8() instead. 424 IFileSystem::createXMLReaderUTF8() instead.
425 \param filename: Name of file to be opened. 425 \param filename: Name of file to be opened.
426 \return Returns a pointer to the created xml parser. This pointer should be 426 \return Returns a pointer to the created xml parser. This pointer should be
427 deleted using 'delete' after no longer needed. Returns 0 if an error occured 427 deleted using 'delete' after no longer needed. Returns 0 if an error occured
428 and the file could not be opened. */ 428 and the file could not be opened. */
429 IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(const char* filename); 429 IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(const char* filename);
430 430
431 //! Creates an instance of an UFT-8 or ASCII character xml parser. 431 //! Creates an instance of an UFT-8 or ASCII character xml parser.
432 /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can 432 /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can
433 be in any format, it will be converted to UTF-8 if it is not in this format. 433 be in any format, it will be converted to UTF-8 if it is not in this format.
434 If you are using the Irrlicht Engine, it is better not to use this function but 434 If you are using the Irrlicht Engine, it is better not to use this function but
435 IFileSystem::createXMLReaderUTF8() instead. 435 IFileSystem::createXMLReaderUTF8() instead.
436 \param file: Pointer to opened file, must have been opened in binary mode, e.g. 436 \param file: Pointer to opened file, must have been opened in binary mode, e.g.
437 using fopen("foo.bar", "wb"); The file will not be closed after it has been read. 437 using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
438 \return Returns a pointer to the created xml parser. This pointer should be 438 \return Returns a pointer to the created xml parser. This pointer should be
439 deleted using 'delete' after no longer needed. Returns 0 if an error occured 439 deleted using 'delete' after no longer needed. Returns 0 if an error occured
440 and the file could not be opened. */ 440 and the file could not be opened. */
441 IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(FILE* file); 441 IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(FILE* file);
442 442
443 //! Creates an instance of an UFT-8 or ASCII character xml parser. 443 //! Creates an instance of an UFT-8 or ASCII character xml parser.
444 /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can 444 /** This means that all character data will be returned in 8 bit ASCII or UTF-8. The file to read can
445 be in any format, it will be converted to UTF-8 if it is not in this format. 445 be in any format, it will be converted to UTF-8 if it is not in this format.
446 If you are using the Irrlicht Engine, it is better not to use this function but 446 If you are using the Irrlicht Engine, it is better not to use this function but
447 IFileSystem::createXMLReaderUTF8() instead. 447 IFileSystem::createXMLReaderUTF8() instead.
448 \param callback: Callback for file read abstraction. Implement your own 448 \param callback: Callback for file read abstraction. Implement your own
449 callback to make the xml parser read in other things than just files. See 449 callback to make the xml parser read in other things than just files. See
450 IFileReadCallBack for more information about this. 450 IFileReadCallBack for more information about this.
451 \param deleteCallback: if true, the callback will be deleted after the file 451 \param deleteCallback: if true, the callback will be deleted after the file
452 has been read. Otherwise the caller si responsible for cleaning it up. 452 has been read. Otherwise the caller si responsible for cleaning it up.
453 \return Returns a pointer to the created xml parser. This pointer should be 453 \return Returns a pointer to the created xml parser. This pointer should be
454 deleted using 'delete' after no longer needed. Returns 0 if an error occured 454 deleted using 'delete' after no longer needed. Returns 0 if an error occured
455 and the file could not be opened. */ 455 and the file could not be opened. */
456 IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(IFileReadCallBack* callback, 456 IRRLICHT_API IrrXMLReader* IRRCALLCONV createIrrXMLReader(IFileReadCallBack* callback,
457 bool deleteCallback = false); 457 bool deleteCallback = false);
458 458
459 //! Creates an instance of an UFT-16 xml parser. 459 //! Creates an instance of an UFT-16 xml parser.
460 /** This means that 460 /** This means that
461 all character data will be returned in UTF-16. The file to read can 461 all character data will be returned in UTF-16. The file to read can
462 be in any format, it will be converted to UTF-16 if it is not in this format. 462 be in any format, it will be converted to UTF-16 if it is not in this format.
463 If you are using the Irrlicht Engine, it is better not to use this function but 463 If you are using the Irrlicht Engine, it is better not to use this function but
464 IFileSystem::createXMLReader() instead. 464 IFileSystem::createXMLReader() instead.
465 \param filename: Name of file to be opened. 465 \param filename: Name of file to be opened.
466 \return Returns a pointer to the created xml parser. This pointer should be 466 \return Returns a pointer to the created xml parser. This pointer should be
467 deleted using 'delete' after no longer needed. Returns 0 if an error occured 467 deleted using 'delete' after no longer needed. Returns 0 if an error occured
468 and the file could not be opened. */ 468 and the file could not be opened. */
469 IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(const char* filename); 469 IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(const char* filename);
470 470
471 //! Creates an instance of an UFT-16 xml parser. 471 //! Creates an instance of an UFT-16 xml parser.
472 /** This means that all character data will be returned in UTF-16. The file to read can 472 /** This means that all character data will be returned in UTF-16. The file to read can
473 be in any format, it will be converted to UTF-16 if it is not in this format. 473 be in any format, it will be converted to UTF-16 if it is not in this format.
474 If you are using the Irrlicht Engine, it is better not to use this function but 474 If you are using the Irrlicht Engine, it is better not to use this function but
475 IFileSystem::createXMLReader() instead. 475 IFileSystem::createXMLReader() instead.
476 \param file: Pointer to opened file, must have been opened in binary mode, e.g. 476 \param file: Pointer to opened file, must have been opened in binary mode, e.g.
477 using fopen("foo.bar", "wb"); The file will not be closed after it has been read. 477 using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
478 \return Returns a pointer to the created xml parser. This pointer should be 478 \return Returns a pointer to the created xml parser. This pointer should be
479 deleted using 'delete' after no longer needed. Returns 0 if an error occured 479 deleted using 'delete' after no longer needed. Returns 0 if an error occured
480 and the file could not be opened. */ 480 and the file could not be opened. */
481 IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(FILE* file); 481 IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(FILE* file);
482 482
483 //! Creates an instance of an UFT-16 xml parser. 483 //! Creates an instance of an UFT-16 xml parser.
484 /** This means that all character data will be returned in UTF-16. The file to read can 484 /** This means that all character data will be returned in UTF-16. The file to read can
485 be in any format, it will be converted to UTF-16 if it is not in this format. 485 be in any format, it will be converted to UTF-16 if it is not in this format.
486 If you are using the Irrlicht Engine, it is better not to use this function but 486 If you are using the Irrlicht Engine, it is better not to use this function but
487 IFileSystem::createXMLReader() instead. 487 IFileSystem::createXMLReader() instead.
488 \param callback: Callback for file read abstraction. Implement your own 488 \param callback: Callback for file read abstraction. Implement your own
489 callback to make the xml parser read in other things than just files. See 489 callback to make the xml parser read in other things than just files. See
490 IFileReadCallBack for more information about this. 490 IFileReadCallBack for more information about this.
491 \param deleteCallback: if true, the callback will be deleted after the file 491 \param deleteCallback: if true, the callback will be deleted after the file
492 has been read. Otherwise the caller si responsible for cleaning it up. 492 has been read. Otherwise the caller si responsible for cleaning it up.
493 \return Returns a pointer to the created xml parser. This pointer should be 493 \return Returns a pointer to the created xml parser. This pointer should be
494 deleted using 'delete' after no longer needed. Returns 0 if an error occured 494 deleted using 'delete' after no longer needed. Returns 0 if an error occured
495 and the file could not be opened. */ 495 and the file could not be opened. */
496 IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(IFileReadCallBack* callback, 496 IRRLICHT_API IrrXMLReaderUTF16* IRRCALLCONV createIrrXMLReaderUTF16(IFileReadCallBack* callback,
497 bool deleteCallback = false); 497 bool deleteCallback = false);
498 498
499 499
500 //! Creates an instance of an UFT-32 xml parser. 500 //! Creates an instance of an UFT-32 xml parser.
501 /** This means that all character data will be returned in UTF-32. The file to read can 501 /** This means that all character data will be returned in UTF-32. The file to read can
502 be in any format, it will be converted to UTF-32 if it is not in this format. 502 be in any format, it will be converted to UTF-32 if it is not in this format.
503 If you are using the Irrlicht Engine, it is better not to use this function but 503 If you are using the Irrlicht Engine, it is better not to use this function but
504 IFileSystem::createXMLReader() instead. 504 IFileSystem::createXMLReader() instead.
505 \param filename: Name of file to be opened. 505 \param filename: Name of file to be opened.
506 \return Returns a pointer to the created xml parser. This pointer should be 506 \return Returns a pointer to the created xml parser. This pointer should be
507 deleted using 'delete' after no longer needed. Returns 0 if an error occured 507 deleted using 'delete' after no longer needed. Returns 0 if an error occured
508 and the file could not be opened. */ 508 and the file could not be opened. */
509 IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(const char* filename); 509 IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(const char* filename);
510 510
511 //! Creates an instance of an UFT-32 xml parser. 511 //! Creates an instance of an UFT-32 xml parser.
512 /** This means that all character data will be returned in UTF-32. The file to read can 512 /** This means that all character data will be returned in UTF-32. The file to read can
513 be in any format, it will be converted to UTF-32 if it is not in this format. 513 be in any format, it will be converted to UTF-32 if it is not in this format.
514 if you are using the Irrlicht Engine, it is better not to use this function but 514 if you are using the Irrlicht Engine, it is better not to use this function but
515 IFileSystem::createXMLReader() instead. 515 IFileSystem::createXMLReader() instead.
516 \param file: Pointer to opened file, must have been opened in binary mode, e.g. 516 \param file: Pointer to opened file, must have been opened in binary mode, e.g.
517 using fopen("foo.bar", "wb"); The file will not be closed after it has been read. 517 using fopen("foo.bar", "wb"); The file will not be closed after it has been read.
518 \return Returns a pointer to the created xml parser. This pointer should be 518 \return Returns a pointer to the created xml parser. This pointer should be
519 deleted using 'delete' after no longer needed. Returns 0 if an error occured 519 deleted using 'delete' after no longer needed. Returns 0 if an error occured
520 and the file could not be opened. */ 520 and the file could not be opened. */
521 IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(FILE* file); 521 IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(FILE* file);
522 522
523 //! Creates an instance of an UFT-32 xml parser. 523 //! Creates an instance of an UFT-32 xml parser.
524 /** This means that 524 /** This means that
525 all character data will be returned in UTF-32. The file to read can 525 all character data will be returned in UTF-32. The file to read can
526 be in any format, it will be converted to UTF-32 if it is not in this format. 526 be in any format, it will be converted to UTF-32 if it is not in this format.
527 If you are using the Irrlicht Engine, it is better not to use this function but 527 If you are using the Irrlicht Engine, it is better not to use this function but
528 IFileSystem::createXMLReader() instead. 528 IFileSystem::createXMLReader() instead.
529 \param callback: Callback for file read abstraction. Implement your own 529 \param callback: Callback for file read abstraction. Implement your own
530 callback to make the xml parser read in other things than just files. See 530 callback to make the xml parser read in other things than just files. See
531 IFileReadCallBack for more information about this. 531 IFileReadCallBack for more information about this.
532 \param deleteCallback: if true, the callback will be deleted after the file 532 \param deleteCallback: if true, the callback will be deleted after the file
533 has been read. Otherwise the caller si responsible for cleaning it up. 533 has been read. Otherwise the caller si responsible for cleaning it up.
534 \return Returns a pointer to the created xml parser. This pointer should be 534 \return Returns a pointer to the created xml parser. This pointer should be
535 deleted using 'delete' after no longer needed. Returns 0 if an error occured 535 deleted using 'delete' after no longer needed. Returns 0 if an error occured
536 and the file could not be opened. */ 536 and the file could not be opened. */
537 IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(IFileReadCallBack* callback, 537 IRRLICHT_API IrrXMLReaderUTF32* IRRCALLCONV createIrrXMLReaderUTF32(IFileReadCallBack* callback,
538 bool deleteCallback = false); 538 bool deleteCallback = false);
539 539
540 540
541 /*! \file irrXML.h 541 /*! \file irrXML.h
542 \brief Header file of the irrXML, the Irrlicht XML parser. 542 \brief Header file of the irrXML, the Irrlicht XML parser.
543 543
544 This file includes everything needed for using irrXML, 544 This file includes everything needed for using irrXML,
545 the XML parser of the Irrlicht Engine. To use irrXML, 545 the XML parser of the Irrlicht Engine. To use irrXML,
546 you only need to include this file in your project: 546 you only need to include this file in your project:
547 547
548 \code 548 \code
549 #include <irrXML.h> 549 #include <irrXML.h>
550 \endcode 550 \endcode
551 551
552 It is also common to use the two namespaces in which irrXML is included, 552 It is also common to use the two namespaces in which irrXML is included,
553 directly after including irrXML.h: 553 directly after including irrXML.h:
554 554
555 \code 555 \code
556 #include <irrXML.h> 556 #include <irrXML.h>
557 using namespace irr; 557 using namespace irr;
558 using namespace io; 558 using namespace io;
559 \endcode 559 \endcode
560 */ 560 */
561 561
562} // end namespace io 562} // end namespace io
563} // end namespace irr 563} // end namespace irr
564 564
565#endif // __IRR_XML_H_INCLUDED__ 565#endif // __IRR_XML_H_INCLUDED__
566 566
diff --git a/libraries/irrlicht-1.8/include/irrlicht.h b/libraries/irrlicht-1.8/include/irrlicht.h
index 74783ce..184c896 100644
--- a/libraries/irrlicht-1.8/include/irrlicht.h
+++ b/libraries/irrlicht-1.8/include/irrlicht.h
@@ -1,394 +1,394 @@
1/* irrlicht.h -- interface of the 'Irrlicht Engine' 1/* irrlicht.h -- interface of the 'Irrlicht Engine'
2 2
3 Copyright (C) 2002-2012 Nikolaus Gebhardt 3 Copyright (C) 2002-2012 Nikolaus Gebhardt
4 4
5 This software is provided 'as-is', without any express or implied 5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages 6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software. 7 arising from the use of this software.
8 8
9 Permission is granted to anyone to use this software for any purpose, 9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it 10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions: 11 freely, subject to the following restrictions:
12 12
13 1. The origin of this software must not be misrepresented; you must not 13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software 14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be 15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required. 16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be 17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software. 18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution. 19 3. This notice may not be removed or altered from any source distribution.
20 20
21 Please note that the Irrlicht Engine is based in part on the work of the 21 Please note that the Irrlicht Engine is based in part on the work of the
22 Independent JPEG Group, the zlib and the libPng. This means that if you use 22 Independent JPEG Group, the zlib and the libPng. This means that if you use
23 the Irrlicht Engine in your product, you must acknowledge somewhere in your 23 the Irrlicht Engine in your product, you must acknowledge somewhere in your
24 documentation that you've used the IJG code. It would also be nice to mention 24 documentation that you've used the IJG code. It would also be nice to mention
25 that you use the Irrlicht Engine, the zlib and libPng. See the README files 25 that you use the Irrlicht Engine, the zlib and libPng. See the README files
26 in the jpeglib, the zlib and libPng for further informations. 26 in the jpeglib, the zlib and libPng for further informations.
27*/ 27*/
28 28
29#ifndef __IRRLICHT_H_INCLUDED__ 29#ifndef __IRRLICHT_H_INCLUDED__
30#define __IRRLICHT_H_INCLUDED__ 30#define __IRRLICHT_H_INCLUDED__
31 31
32#include "IrrCompileConfig.h" 32#include "IrrCompileConfig.h"
33#include "aabbox3d.h" 33#include "aabbox3d.h"
34#include "CDynamicMeshBuffer.h" 34#include "CDynamicMeshBuffer.h"
35#include "CIndexBuffer.h" 35#include "CIndexBuffer.h"
36#include "CMeshBuffer.h" 36#include "CMeshBuffer.h"
37#include "coreutil.h" 37#include "coreutil.h"
38#include "CVertexBuffer.h" 38#include "CVertexBuffer.h"
39#include "dimension2d.h" 39#include "dimension2d.h"
40#include "ECullingTypes.h" 40#include "ECullingTypes.h"
41#include "EDebugSceneTypes.h" 41#include "EDebugSceneTypes.h"
42#include "EDriverFeatures.h" 42#include "EDriverFeatures.h"
43#include "EDriverTypes.h" 43#include "EDriverTypes.h"
44#include "EGUIAlignment.h" 44#include "EGUIAlignment.h"
45#include "EGUIElementTypes.h" 45#include "EGUIElementTypes.h"
46#include "EHardwareBufferFlags.h" 46#include "EHardwareBufferFlags.h"
47#include "EMaterialFlags.h" 47#include "EMaterialFlags.h"
48#include "EMaterialTypes.h" 48#include "EMaterialTypes.h"
49#include "EMeshWriterEnums.h" 49#include "EMeshWriterEnums.h"
50#include "EMessageBoxFlags.h" 50#include "EMessageBoxFlags.h"
51#include "ESceneNodeAnimatorTypes.h" 51#include "ESceneNodeAnimatorTypes.h"
52#include "ESceneNodeTypes.h" 52#include "ESceneNodeTypes.h"
53#include "ETerrainElements.h" 53#include "ETerrainElements.h"
54#include "fast_atof.h" 54#include "fast_atof.h"
55#include "heapsort.h" 55#include "heapsort.h"
56#include "IAnimatedMesh.h" 56#include "IAnimatedMesh.h"
57#include "IAnimatedMeshMD2.h" 57#include "IAnimatedMeshMD2.h"
58#include "IAnimatedMeshMD3.h" 58#include "IAnimatedMeshMD3.h"
59#include "IAnimatedMeshSceneNode.h" 59#include "IAnimatedMeshSceneNode.h"
60#include "IAttributeExchangingObject.h" 60#include "IAttributeExchangingObject.h"
61#include "IAttributes.h" 61#include "IAttributes.h"
62#include "IBillboardSceneNode.h" 62#include "IBillboardSceneNode.h"
63#include "IBillboardTextSceneNode.h" 63#include "IBillboardTextSceneNode.h"
64#include "IBoneSceneNode.h" 64#include "IBoneSceneNode.h"
65#include "ICameraSceneNode.h" 65#include "ICameraSceneNode.h"
66#include "ICursorControl.h" 66#include "ICursorControl.h"
67#include "IDummyTransformationSceneNode.h" 67#include "IDummyTransformationSceneNode.h"
68#include "IDynamicMeshBuffer.h" 68#include "IDynamicMeshBuffer.h"
69#include "IEventReceiver.h" 69#include "IEventReceiver.h"
70#include "IFileList.h" 70#include "IFileList.h"
71#include "IFileSystem.h" 71#include "IFileSystem.h"
72#include "IGeometryCreator.h" 72#include "IGeometryCreator.h"
73#include "IGPUProgrammingServices.h" 73#include "IGPUProgrammingServices.h"
74#include "IGUIButton.h" 74#include "IGUIButton.h"
75#include "IGUICheckBox.h" 75#include "IGUICheckBox.h"
76#include "IGUIColorSelectDialog.h" 76#include "IGUIColorSelectDialog.h"
77#include "IGUIComboBox.h" 77#include "IGUIComboBox.h"
78#include "IGUIContextMenu.h" 78#include "IGUIContextMenu.h"
79#include "IGUIEditBox.h" 79#include "IGUIEditBox.h"
80#include "IGUIElement.h" 80#include "IGUIElement.h"
81#include "IGUIElementFactory.h" 81#include "IGUIElementFactory.h"
82#include "IGUIEnvironment.h" 82#include "IGUIEnvironment.h"
83#include "IGUIFileOpenDialog.h" 83#include "IGUIFileOpenDialog.h"
84#include "IGUIFont.h" 84#include "IGUIFont.h"
85#include "IGUIFontBitmap.h" 85#include "IGUIFontBitmap.h"
86#include "IGUIImage.h" 86#include "IGUIImage.h"
87#include "IGUIInOutFader.h" 87#include "IGUIInOutFader.h"
88#include "IGUIListBox.h" 88#include "IGUIListBox.h"
89#include "IGUIMeshViewer.h" 89#include "IGUIMeshViewer.h"
90#include "IGUIScrollBar.h" 90#include "IGUIScrollBar.h"
91#include "IGUISkin.h" 91#include "IGUISkin.h"
92#include "IGUISpinBox.h" 92#include "IGUISpinBox.h"
93#include "IGUISpriteBank.h" 93#include "IGUISpriteBank.h"
94#include "IGUIStaticText.h" 94#include "IGUIStaticText.h"
95#include "IGUITabControl.h" 95#include "IGUITabControl.h"
96#include "IGUITable.h" 96#include "IGUITable.h"
97#include "IGUIToolbar.h" 97#include "IGUIToolbar.h"
98#include "IGUIWindow.h" 98#include "IGUIWindow.h"
99#include "IGUITreeView.h" 99#include "IGUITreeView.h"
100#include "IImage.h" 100#include "IImage.h"
101#include "IImageLoader.h" 101#include "IImageLoader.h"
102#include "IImageWriter.h" 102#include "IImageWriter.h"
103#include "IIndexBuffer.h" 103#include "IIndexBuffer.h"
104#include "ILightSceneNode.h" 104#include "ILightSceneNode.h"
105#include "ILogger.h" 105#include "ILogger.h"
106#include "IMaterialRenderer.h" 106#include "IMaterialRenderer.h"
107#include "IMaterialRendererServices.h" 107#include "IMaterialRendererServices.h"
108#include "IMesh.h" 108#include "IMesh.h"
109#include "IMeshBuffer.h" 109#include "IMeshBuffer.h"
110#include "IMeshCache.h" 110#include "IMeshCache.h"
111#include "IMeshLoader.h" 111#include "IMeshLoader.h"
112#include "IMeshManipulator.h" 112#include "IMeshManipulator.h"
113#include "IMeshSceneNode.h" 113#include "IMeshSceneNode.h"
114#include "IMeshWriter.h" 114#include "IMeshWriter.h"
115#include "IColladaMeshWriter.h" 115#include "IColladaMeshWriter.h"
116#include "IMetaTriangleSelector.h" 116#include "IMetaTriangleSelector.h"
117#include "IOSOperator.h" 117#include "IOSOperator.h"
118#include "IParticleSystemSceneNode.h" // also includes all emitters and attractors 118#include "IParticleSystemSceneNode.h" // also includes all emitters and attractors
119#include "IQ3LevelMesh.h" 119#include "IQ3LevelMesh.h"
120#include "IQ3Shader.h" 120#include "IQ3Shader.h"
121#include "IReadFile.h" 121#include "IReadFile.h"
122#include "IReferenceCounted.h" 122#include "IReferenceCounted.h"
123#include "irrArray.h" 123#include "irrArray.h"
124#include "IRandomizer.h" 124#include "IRandomizer.h"
125#include "IrrlichtDevice.h" 125#include "IrrlichtDevice.h"
126#include "irrList.h" 126#include "irrList.h"
127#include "irrMap.h" 127#include "irrMap.h"
128#include "irrMath.h" 128#include "irrMath.h"
129#include "irrString.h" 129#include "irrString.h"
130#include "irrTypes.h" 130#include "irrTypes.h"
131#include "path.h" 131#include "path.h"
132#include "irrXML.h" 132#include "irrXML.h"
133#include "ISceneCollisionManager.h" 133#include "ISceneCollisionManager.h"
134#include "ISceneLoader.h" 134#include "ISceneLoader.h"
135#include "ISceneManager.h" 135#include "ISceneManager.h"
136#include "ISceneNode.h" 136#include "ISceneNode.h"
137#include "ISceneNodeAnimator.h" 137#include "ISceneNodeAnimator.h"
138#include "ISceneNodeAnimatorCameraFPS.h" 138#include "ISceneNodeAnimatorCameraFPS.h"
139#include "ISceneNodeAnimatorCameraMaya.h" 139#include "ISceneNodeAnimatorCameraMaya.h"
140#include "ISceneNodeAnimatorCollisionResponse.h" 140#include "ISceneNodeAnimatorCollisionResponse.h"
141#include "ISceneNodeAnimatorFactory.h" 141#include "ISceneNodeAnimatorFactory.h"
142#include "ISceneNodeFactory.h" 142#include "ISceneNodeFactory.h"
143#include "ISceneUserDataSerializer.h" 143#include "ISceneUserDataSerializer.h"
144#include "IShaderConstantSetCallBack.h" 144#include "IShaderConstantSetCallBack.h"
145#include "IShadowVolumeSceneNode.h" 145#include "IShadowVolumeSceneNode.h"
146#include "ISkinnedMesh.h" 146#include "ISkinnedMesh.h"
147#include "ITerrainSceneNode.h" 147#include "ITerrainSceneNode.h"
148#include "ITextSceneNode.h" 148#include "ITextSceneNode.h"
149#include "ITexture.h" 149#include "ITexture.h"
150#include "ITimer.h" 150#include "ITimer.h"
151#include "ITriangleSelector.h" 151#include "ITriangleSelector.h"
152#include "IVertexBuffer.h" 152#include "IVertexBuffer.h"
153#include "IVideoDriver.h" 153#include "IVideoDriver.h"
154#include "IVideoModeList.h" 154#include "IVideoModeList.h"
155#include "IVolumeLightSceneNode.h" 155#include "IVolumeLightSceneNode.h"
156#include "IWriteFile.h" 156#include "IWriteFile.h"
157#include "IXMLReader.h" 157#include "IXMLReader.h"
158#include "IXMLWriter.h" 158#include "IXMLWriter.h"
159#include "ILightManager.h" 159#include "ILightManager.h"
160#include "Keycodes.h" 160#include "Keycodes.h"
161#include "line2d.h" 161#include "line2d.h"
162#include "line3d.h" 162#include "line3d.h"
163#include "matrix4.h" 163#include "matrix4.h"
164#include "plane3d.h" 164#include "plane3d.h"
165#include "position2d.h" 165#include "position2d.h"
166#include "quaternion.h" 166#include "quaternion.h"
167#include "rect.h" 167#include "rect.h"
168#include "S3DVertex.h" 168#include "S3DVertex.h"
169#include "SAnimatedMesh.h" 169#include "SAnimatedMesh.h"
170#include "SceneParameters.h" 170#include "SceneParameters.h"
171#include "SColor.h" 171#include "SColor.h"
172#include "SExposedVideoData.h" 172#include "SExposedVideoData.h"
173#include "SIrrCreationParameters.h" 173#include "SIrrCreationParameters.h"
174#include "SKeyMap.h" 174#include "SKeyMap.h"
175#include "SLight.h" 175#include "SLight.h"
176#include "SMaterial.h" 176#include "SMaterial.h"
177#include "SMesh.h" 177#include "SMesh.h"
178#include "SMeshBuffer.h" 178#include "SMeshBuffer.h"
179#include "SMeshBufferLightMap.h" 179#include "SMeshBufferLightMap.h"
180#include "SMeshBufferTangents.h" 180#include "SMeshBufferTangents.h"
181#include "SParticle.h" 181#include "SParticle.h"
182#include "SSharedMeshBuffer.h" 182#include "SSharedMeshBuffer.h"
183#include "SSkinMeshBuffer.h" 183#include "SSkinMeshBuffer.h"
184#include "SVertexIndex.h" 184#include "SVertexIndex.h"
185#include "SViewFrustum.h" 185#include "SViewFrustum.h"
186#include "triangle3d.h" 186#include "triangle3d.h"
187#include "vector2d.h" 187#include "vector2d.h"
188#include "vector3d.h" 188#include "vector3d.h"
189 189
190/*! \mainpage Irrlicht Engine 1.8 API documentation 190/*! \mainpage Irrlicht Engine 1.8 API documentation
191 * 191 *
192 * <div align="center"><img src="logobig.png" ></div> 192 * <div align="center"><img src="logobig.png" ></div>
193 * 193 *
194 * \section intro Introduction 194 * \section intro Introduction
195 * 195 *
196 * Welcome to the Irrlicht Engine API documentation. 196 * Welcome to the Irrlicht Engine API documentation.
197 * Here you'll find any information you'll need to develop applications with 197 * Here you'll find any information you'll need to develop applications with
198 * the Irrlicht Engine. If you are looking for a tutorial on how to start, you'll 198 * the Irrlicht Engine. If you are looking for a tutorial on how to start, you'll
199 * find some on the homepage of the Irrlicht Engine at 199 * find some on the homepage of the Irrlicht Engine at
200 * <A HREF="http://irrlicht.sourceforge.net" >irrlicht.sourceforge.net</A> 200 * <A HREF="http://irrlicht.sourceforge.net" >irrlicht.sourceforge.net</A>
201 * or inside the SDK in the examples directory. 201 * or inside the SDK in the examples directory.
202 * 202 *
203 * The Irrlicht Engine is intended to be an easy-to-use 3d engine, so 203 * The Irrlicht Engine is intended to be an easy-to-use 3d engine, so
204 * this documentation is an important part of it. If you have any questions or 204 * this documentation is an important part of it. If you have any questions or
205 * suggestions, just send a email to the author of the engine, Nikolaus Gebhardt 205 * suggestions, just send a email to the author of the engine, Nikolaus Gebhardt
206 * (niko (at) irrlicht3d.org). 206 * (niko (at) irrlicht3d.org).
207 * 207 *
208 * 208 *
209 * \section links Links 209 * \section links Links
210 * 210 *
211 * <A HREF="namespaces.html">Namespaces</A>: A very good place to start reading 211 * <A HREF="namespaces.html">Namespaces</A>: A very good place to start reading
212 * the documentation.<BR> 212 * the documentation.<BR>
213 * <A HREF="annotated.html">Class list</A>: List of all classes with descriptions.<BR> 213 * <A HREF="annotated.html">Class list</A>: List of all classes with descriptions.<BR>
214 * <A HREF="functions.html">Class members</A>: Good place to find forgotten features.<BR> 214 * <A HREF="functions.html">Class members</A>: Good place to find forgotten features.<BR>
215 * 215 *
216 * \section irrexample Short example 216 * \section irrexample Short example
217 * 217 *
218 * A simple application, starting up the engine, loading a Quake 2 animated 218 * A simple application, starting up the engine, loading a Quake 2 animated
219 * model file and the corresponding texture, animating and displaying it 219 * model file and the corresponding texture, animating and displaying it
220 * in front of a blue background and placing a user controlable 3d camera 220 * in front of a blue background and placing a user controlable 3d camera
221 * would look like the following code. I think this example shows the usage 221 * would look like the following code. I think this example shows the usage
222 * of the engine quite well: 222 * of the engine quite well:
223 * 223 *
224 * \code 224 * \code
225 * #include <irrlicht.h> 225 * #include <irrlicht.h>
226 * using namespace irr; 226 * using namespace irr;
227 * 227 *
228 * int main() 228 * int main()
229 * { 229 * {
230 * // start up the engine 230 * // start up the engine
231 * IrrlichtDevice *device = createDevice(video::EDT_DIRECT3D8, 231 * IrrlichtDevice *device = createDevice(video::EDT_DIRECT3D8,
232 * core::dimension2d<u32>(640,480)); 232 * core::dimension2d<u32>(640,480));
233 * 233 *
234 * video::IVideoDriver* driver = device->getVideoDriver(); 234 * video::IVideoDriver* driver = device->getVideoDriver();
235 * scene::ISceneManager* scenemgr = device->getSceneManager(); 235 * scene::ISceneManager* scenemgr = device->getSceneManager();
236 * 236 *
237 * device->setWindowCaption(L"Hello World!"); 237 * device->setWindowCaption(L"Hello World!");
238 * 238 *
239 * // load and show quake2 .md2 model 239 * // load and show quake2 .md2 model
240 * scene::ISceneNode* node = scenemgr->addAnimatedMeshSceneNode( 240 * scene::ISceneNode* node = scenemgr->addAnimatedMeshSceneNode(
241 * scenemgr->getMesh("quake2model.md2")); 241 * scenemgr->getMesh("quake2model.md2"));
242 * 242 *
243 * // if everything worked, add a texture and disable lighting 243 * // if everything worked, add a texture and disable lighting
244 * if (node) 244 * if (node)
245 * { 245 * {
246 * node->setMaterialTexture(0, driver->getTexture("texture.bmp")); 246 * node->setMaterialTexture(0, driver->getTexture("texture.bmp"));
247 * node->setMaterialFlag(video::EMF_LIGHTING, false); 247 * node->setMaterialFlag(video::EMF_LIGHTING, false);
248 * } 248 * }
249 * 249 *
250 * // add a first person shooter style user controlled camera 250 * // add a first person shooter style user controlled camera
251 * scenemgr->addCameraSceneNodeFPS(); 251 * scenemgr->addCameraSceneNodeFPS();
252 * 252 *
253 * // draw everything 253 * // draw everything
254 * while(device->run() && driver) 254 * while(device->run() && driver)
255 * { 255 * {
256 * driver->beginScene(true, true, video::SColor(255,0,0,255)); 256 * driver->beginScene(true, true, video::SColor(255,0,0,255));
257 * scenemgr->drawAll(); 257 * scenemgr->drawAll();
258 * driver->endScene(); 258 * driver->endScene();
259 * } 259 * }
260 * 260 *
261 * // delete device 261 * // delete device
262 * device->drop(); 262 * device->drop();
263 * return 0; 263 * return 0;
264 * } 264 * }
265 * \endcode 265 * \endcode
266 * 266 *
267 * Irrlicht can load a lot of file formats automaticly, see irr::scene::ISceneManager::getMesh() 267 * Irrlicht can load a lot of file formats automaticly, see irr::scene::ISceneManager::getMesh()
268 * for a detailed list. So if you would like to replace the simple blue screen background by 268 * for a detailed list. So if you would like to replace the simple blue screen background by
269 * a cool Quake 3 Map, optimized by an octree, just insert this code 269 * a cool Quake 3 Map, optimized by an octree, just insert this code
270 * somewhere before the while loop: 270 * somewhere before the while loop:
271 * 271 *
272 * \code 272 * \code
273 * // add .pk3 archive to the file system 273 * // add .pk3 archive to the file system
274 * device->getFileSystem()->addZipFileArchive("quake3map.pk3"); 274 * device->getFileSystem()->addZipFileArchive("quake3map.pk3");
275 * 275 *
276 * // load .bsp file and show it using an octree 276 * // load .bsp file and show it using an octree
277 * scenemgr->addOctreeSceneNode( 277 * scenemgr->addOctreeSceneNode(
278 * scenemgr->getMesh("quake3map.bsp")); 278 * scenemgr->getMesh("quake3map.bsp"));
279 * \endcode 279 * \endcode
280 * 280 *
281 * As you can see, the engine uses namespaces. Everything in the engine is 281 * As you can see, the engine uses namespaces. Everything in the engine is
282 * placed into the namespace 'irr', but there are also 5 sub namespaces. 282 * placed into the namespace 'irr', but there are also 5 sub namespaces.
283 * You can find a list of all namespaces with descriptions at the 283 * You can find a list of all namespaces with descriptions at the
284 * <A HREF="namespaces.html"> namespaces page</A>. 284 * <A HREF="namespaces.html"> namespaces page</A>.
285 * This is also a good place to start reading the documentation. If you 285 * This is also a good place to start reading the documentation. If you
286 * don't want to write the namespace names all the time, just use all namespaces like 286 * don't want to write the namespace names all the time, just use all namespaces like
287 * this: 287 * this:
288 * \code 288 * \code
289 * using namespace core; 289 * using namespace core;
290 * using namespace scene; 290 * using namespace scene;
291 * using namespace video; 291 * using namespace video;
292 * using namespace io; 292 * using namespace io;
293 * using namespace gui; 293 * using namespace gui;
294 * \endcode 294 * \endcode
295 * 295 *
296 * There is a lot more the engine can do, but I hope this gave a short 296 * There is a lot more the engine can do, but I hope this gave a short
297 * overview over the basic features of the engine. For more examples, please take 297 * overview over the basic features of the engine. For more examples, please take
298 * a look into the examples directory of the SDK. 298 * a look into the examples directory of the SDK.
299 */ 299 */
300 300
301#include "SIrrCreationParameters.h" 301#include "SIrrCreationParameters.h"
302 302
303//! Everything in the Irrlicht Engine can be found in this namespace. 303//! Everything in the Irrlicht Engine can be found in this namespace.
304namespace irr 304namespace irr
305{ 305{
306 //! Creates an Irrlicht device. The Irrlicht device is the root object for using the engine. 306 //! Creates an Irrlicht device. The Irrlicht device is the root object for using the engine.
307 /** If you need more parameters to be passed to the creation of the Irrlicht Engine device, 307 /** If you need more parameters to be passed to the creation of the Irrlicht Engine device,
308 use the createDeviceEx() function. 308 use the createDeviceEx() function.
309 \param deviceType: Type of the device. This can currently be video::EDT_NULL, 309 \param deviceType: Type of the device. This can currently be video::EDT_NULL,
310 video::EDT_SOFTWARE, video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D8, video::EDT_DIRECT3D9 and video::EDT_OPENGL. 310 video::EDT_SOFTWARE, video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D8, video::EDT_DIRECT3D9 and video::EDT_OPENGL.
311 \param windowSize: Size of the window or the video mode in fullscreen mode. 311 \param windowSize: Size of the window or the video mode in fullscreen mode.
312 \param bits: Bits per pixel in fullscreen mode. Ignored if windowed mode. 312 \param bits: Bits per pixel in fullscreen mode. Ignored if windowed mode.
313 \param fullscreen: Should be set to true if the device should run in fullscreen. Otherwise 313 \param fullscreen: Should be set to true if the device should run in fullscreen. Otherwise
314 the device runs in windowed mode. 314 the device runs in windowed mode.
315 \param stencilbuffer: Specifies if the stencil buffer should be enabled. Set this to true, 315 \param stencilbuffer: Specifies if the stencil buffer should be enabled. Set this to true,
316 if you want the engine be able to draw stencil buffer shadows. Note that not all 316 if you want the engine be able to draw stencil buffer shadows. Note that not all
317 devices are able to use the stencil buffer. If they don't no shadows will be drawn. 317 devices are able to use the stencil buffer. If they don't no shadows will be drawn.
318 \param vsync: Specifies vertical syncronisation: If set to true, the driver will wait 318 \param vsync: Specifies vertical syncronisation: If set to true, the driver will wait
319 for the vertical retrace period, otherwise not. 319 for the vertical retrace period, otherwise not.
320 \param receiver: A user created event receiver. 320 \param receiver: A user created event receiver.
321 \return Returns pointer to the created IrrlichtDevice or null if the 321 \return Returns pointer to the created IrrlichtDevice or null if the
322 device could not be created. 322 device could not be created.
323 */ 323 */
324 extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDevice( 324 extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDevice(
325 video::E_DRIVER_TYPE deviceType = video::EDT_SOFTWARE, 325 video::E_DRIVER_TYPE deviceType = video::EDT_SOFTWARE,
326 // parantheses are necessary for some compilers 326 // parantheses are necessary for some compilers
327 const core::dimension2d<u32>& windowSize = (core::dimension2d<u32>(640,480)), 327 const core::dimension2d<u32>& windowSize = (core::dimension2d<u32>(640,480)),
328 u32 bits = 16, 328 u32 bits = 16,
329 bool fullscreen = false, 329 bool fullscreen = false,
330 bool stencilbuffer = false, 330 bool stencilbuffer = false,
331 bool vsync = false, 331 bool vsync = false,
332 IEventReceiver* receiver = 0); 332 IEventReceiver* receiver = 0);
333 333
334 //! typedef for Function Pointer 334 //! typedef for Function Pointer
335 typedef IrrlichtDevice* (IRRCALLCONV *funcptr_createDevice )( 335 typedef IrrlichtDevice* (IRRCALLCONV *funcptr_createDevice )(
336 video::E_DRIVER_TYPE deviceType, 336 video::E_DRIVER_TYPE deviceType,
337 const core::dimension2d<u32>& windowSize, 337 const core::dimension2d<u32>& windowSize,
338 u32 bits, 338 u32 bits,
339 bool fullscreen, 339 bool fullscreen,
340 bool stencilbuffer, 340 bool stencilbuffer,
341 bool vsync, 341 bool vsync,
342 IEventReceiver* receiver); 342 IEventReceiver* receiver);
343 343
344 344
345 //! Creates an Irrlicht device with the option to specify advanced parameters. 345 //! Creates an Irrlicht device with the option to specify advanced parameters.
346 /** Usually you should used createDevice() for creating an Irrlicht Engine device. 346 /** Usually you should used createDevice() for creating an Irrlicht Engine device.
347 Use this function only if you wish to specify advanced parameters like a window 347 Use this function only if you wish to specify advanced parameters like a window
348 handle in which the device should be created. 348 handle in which the device should be created.
349 \param parameters: Structure containing advanced parameters for the creation of the device. 349 \param parameters: Structure containing advanced parameters for the creation of the device.
350 See irr::SIrrlichtCreationParameters for details. 350 See irr::SIrrlichtCreationParameters for details.
351 \return Returns pointer to the created IrrlichtDevice or null if the 351 \return Returns pointer to the created IrrlichtDevice or null if the
352 device could not be created. */ 352 device could not be created. */
353 extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx( 353 extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(
354 const SIrrlichtCreationParameters& parameters); 354 const SIrrlichtCreationParameters& parameters);
355 355
356 //! typedef for Function Pointer 356 //! typedef for Function Pointer
357 typedef IrrlichtDevice* (IRRCALLCONV *funcptr_createDeviceEx )( const SIrrlichtCreationParameters& parameters ); 357 typedef IrrlichtDevice* (IRRCALLCONV *funcptr_createDeviceEx )( const SIrrlichtCreationParameters& parameters );
358 358
359 359
360 // THE FOLLOWING IS AN EMPTY LIST OF ALL SUB NAMESPACES 360 // THE FOLLOWING IS AN EMPTY LIST OF ALL SUB NAMESPACES
361 // EXISTING ONLY FOR THE DOCUMENTATION SOFTWARE DOXYGEN. 361 // EXISTING ONLY FOR THE DOCUMENTATION SOFTWARE DOXYGEN.
362 362
363 //! Basic classes such as vectors, planes, arrays, lists, and so on can be found in this namespace. 363 //! Basic classes such as vectors, planes, arrays, lists, and so on can be found in this namespace.
364 namespace core 364 namespace core
365 { 365 {
366 } 366 }
367 367
368 //! The gui namespace contains useful classes for easy creation of a graphical user interface. 368 //! The gui namespace contains useful classes for easy creation of a graphical user interface.
369 namespace gui 369 namespace gui
370 { 370 {
371 } 371 }
372 372
373 //! This namespace provides interfaces for input/output: Reading and writing files, accessing zip archives, xml files, ... 373 //! This namespace provides interfaces for input/output: Reading and writing files, accessing zip archives, xml files, ...
374 namespace io 374 namespace io
375 { 375 {
376 } 376 }
377 377
378 //! All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees and billboards, ... 378 //! All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees and billboards, ...
379 namespace scene 379 namespace scene
380 { 380 {
381 } 381 }
382 382
383 //! The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done here. 383 //! The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done here.
384 namespace video 384 namespace video
385 { 385 {
386 } 386 }
387} 387}
388 388
389/*! \file irrlicht.h 389/*! \file irrlicht.h
390 \brief Main header file of the irrlicht, the only file needed to include. 390 \brief Main header file of the irrlicht, the only file needed to include.
391*/ 391*/
392 392
393#endif 393#endif
394 394
diff --git a/libraries/irrlicht-1.8/include/irrpack.h b/libraries/irrlicht-1.8/include/irrpack.h
index 3cf643f..29a16fe 100644
--- a/libraries/irrlicht-1.8/include/irrpack.h
+++ b/libraries/irrlicht-1.8/include/irrpack.h
@@ -1,39 +1,39 @@
1// Copyright (C) 2007-2012 Nikolaus Gebhardt 1// Copyright (C) 2007-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// include this file right before the data structures to be 1-aligned 5// include this file right before the data structures to be 1-aligned
6// and add to each structure the PACK_STRUCT define just like this: 6// and add to each structure the PACK_STRUCT define just like this:
7// struct mystruct 7// struct mystruct
8// { 8// {
9// ... 9// ...
10// } PACK_STRUCT; 10// } PACK_STRUCT;
11// Always include the irrunpack.h file right after the last type declared 11// Always include the irrunpack.h file right after the last type declared
12// like this, and do not put any other types with different alignment 12// like this, and do not put any other types with different alignment
13// in between! 13// in between!
14 14
15// byte-align structures 15// byte-align structures
16#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 16#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
17# pragma warning(disable: 4103) 17# pragma warning(disable: 4103)
18# pragma pack( push, packing ) 18# pragma pack( push, packing )
19# pragma pack( 1 ) 19# pragma pack( 1 )
20# define PACK_STRUCT 20# define PACK_STRUCT
21#elif defined( __DMC__ ) 21#elif defined( __DMC__ )
22# pragma pack( push, 1 ) 22# pragma pack( push, 1 )
23# define PACK_STRUCT 23# define PACK_STRUCT
24#elif defined( __GNUC__ ) 24#elif defined( __GNUC__ )
25 // Using pragma pack might work with earlier gcc versions already, but 25 // Using pragma pack might work with earlier gcc versions already, but
26 // it started to be necessary with gcc 4.7 on mingw unless compiled with -mno-ms-bitfields. 26 // it started to be necessary with gcc 4.7 on mingw unless compiled with -mno-ms-bitfields.
27 // And I found some hints on the web that older gcc versions on the other hand had sometimes 27 // And I found some hints on the web that older gcc versions on the other hand had sometimes
28 // trouble with pragma pack while they worked with __attribute__((packed)). 28 // trouble with pragma pack while they worked with __attribute__((packed)).
29# if (__GNUC__ >= 4 ) && (__GNUC_MINOR__ >= 7) 29# if (__GNUC__ >= 4 ) && (__GNUC_MINOR__ >= 7)
30# pragma pack( push, packing ) 30# pragma pack( push, packing )
31# pragma pack( 1 ) 31# pragma pack( 1 )
32# define PACK_STRUCT 32# define PACK_STRUCT
33# else 33# else
34# define PACK_STRUCT __attribute__((packed)) 34# define PACK_STRUCT __attribute__((packed))
35 #endif 35 #endif
36#else 36#else
37# error compiler not supported 37# error compiler not supported
38#endif 38#endif
39 39
diff --git a/libraries/irrlicht-1.8/include/irrunpack.h b/libraries/irrlicht-1.8/include/irrunpack.h
index b42398d..80a5a69 100644
--- a/libraries/irrlicht-1.8/include/irrunpack.h
+++ b/libraries/irrlicht-1.8/include/irrunpack.h
@@ -1,20 +1,20 @@
1// Copyright (C) 2007-2012 Nikolaus Gebhardt 1// Copyright (C) 2007-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// include this file to switch back to default alignment 5// include this file to switch back to default alignment
6// file belongs to irrpack.h, see there for more info 6// file belongs to irrpack.h, see there for more info
7 7
8// Default alignment 8// Default alignment
9#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 9#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
10# pragma pack( pop, packing ) 10# pragma pack( pop, packing )
11#elif defined (__DMC__) 11#elif defined (__DMC__)
12# pragma pack( pop ) 12# pragma pack( pop )
13#elif defined( __GNUC__ ) 13#elif defined( __GNUC__ )
14# if (__GNUC__ >= 4 ) && (__GNUC_MINOR__ >= 7) 14# if (__GNUC__ >= 4 ) && (__GNUC_MINOR__ >= 7)
15# pragma pack( pop, packing ) 15# pragma pack( pop, packing )
16# endif 16# endif
17#endif 17#endif
18 18
19#undef PACK_STRUCT 19#undef PACK_STRUCT
20 20
diff --git a/libraries/irrlicht-1.8/include/line2d.h b/libraries/irrlicht-1.8/include/line2d.h
index 2a0dee4..22590dc 100644
--- a/libraries/irrlicht-1.8/include/line2d.h
+++ b/libraries/irrlicht-1.8/include/line2d.h
@@ -1,274 +1,274 @@
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#ifndef __IRR_LINE_2D_H_INCLUDED__ 5#ifndef __IRR_LINE_2D_H_INCLUDED__
6#define __IRR_LINE_2D_H_INCLUDED__ 6#define __IRR_LINE_2D_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include "vector2d.h" 9#include "vector2d.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace core 13namespace core
14{ 14{
15 15
16//! 2D line between two points with intersection methods. 16//! 2D line between two points with intersection methods.
17template <class T> 17template <class T>
18class line2d 18class line2d
19{ 19{
20 public: 20 public:
21 //! Default constructor for line going from (0,0) to (1,1). 21 //! Default constructor for line going from (0,0) to (1,1).
22 line2d() : start(0,0), end(1,1) {} 22 line2d() : start(0,0), end(1,1) {}
23 //! Constructor for line between the two points. 23 //! Constructor for line between the two points.
24 line2d(T xa, T ya, T xb, T yb) : start(xa, ya), end(xb, yb) {} 24 line2d(T xa, T ya, T xb, T yb) : start(xa, ya), end(xb, yb) {}
25 //! Constructor for line between the two points given as vectors. 25 //! Constructor for line between the two points given as vectors.
26 line2d(const vector2d<T>& start, const vector2d<T>& end) : start(start), end(end) {} 26 line2d(const vector2d<T>& start, const vector2d<T>& end) : start(start), end(end) {}
27 //! Copy constructor. 27 //! Copy constructor.
28 line2d(const line2d<T>& other) : start(other.start), end(other.end) {} 28 line2d(const line2d<T>& other) : start(other.start), end(other.end) {}
29 29
30 // operators 30 // operators
31 31
32 line2d<T> operator+(const vector2d<T>& point) const { return line2d<T>(start + point, end + point); } 32 line2d<T> operator+(const vector2d<T>& point) const { return line2d<T>(start + point, end + point); }
33 line2d<T>& operator+=(const vector2d<T>& point) { start += point; end += point; return *this; } 33 line2d<T>& operator+=(const vector2d<T>& point) { start += point; end += point; return *this; }
34 34
35 line2d<T> operator-(const vector2d<T>& point) const { return line2d<T>(start - point, end - point); } 35 line2d<T> operator-(const vector2d<T>& point) const { return line2d<T>(start - point, end - point); }
36 line2d<T>& operator-=(const vector2d<T>& point) { start -= point; end -= point; return *this; } 36 line2d<T>& operator-=(const vector2d<T>& point) { start -= point; end -= point; return *this; }
37 37
38 bool operator==(const line2d<T>& other) const 38 bool operator==(const line2d<T>& other) const
39 { return (start==other.start && end==other.end) || (end==other.start && start==other.end);} 39 { return (start==other.start && end==other.end) || (end==other.start && start==other.end);}
40 bool operator!=(const line2d<T>& other) const 40 bool operator!=(const line2d<T>& other) const
41 { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);} 41 { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);}
42 42
43 // functions 43 // functions
44 //! Set this line to new line going through the two points. 44 //! Set this line to new line going through the two points.
45 void setLine(const T& xa, const T& ya, const T& xb, const T& yb){start.set(xa, ya); end.set(xb, yb);} 45 void setLine(const T& xa, const T& ya, const T& xb, const T& yb){start.set(xa, ya); end.set(xb, yb);}
46 //! Set this line to new line going through the two points. 46 //! Set this line to new line going through the two points.
47 void setLine(const vector2d<T>& nstart, const vector2d<T>& nend){start.set(nstart); end.set(nend);} 47 void setLine(const vector2d<T>& nstart, const vector2d<T>& nend){start.set(nstart); end.set(nend);}
48 //! Set this line to new line given as parameter. 48 //! Set this line to new line given as parameter.
49 void setLine(const line2d<T>& line){start.set(line.start); end.set(line.end);} 49 void setLine(const line2d<T>& line){start.set(line.start); end.set(line.end);}
50 50
51 //! Get length of line 51 //! Get length of line
52 /** \return Length of the line. */ 52 /** \return Length of the line. */
53 T getLength() const { return start.getDistanceFrom(end); } 53 T getLength() const { return start.getDistanceFrom(end); }
54 54
55 //! Get squared length of the line 55 //! Get squared length of the line
56 /** \return Squared length of line. */ 56 /** \return Squared length of line. */
57 T getLengthSQ() const { return start.getDistanceFromSQ(end); } 57 T getLengthSQ() const { return start.getDistanceFromSQ(end); }
58 58
59 //! Get middle of the line 59 //! Get middle of the line
60 /** \return center of the line. */ 60 /** \return center of the line. */
61 vector2d<T> getMiddle() const 61 vector2d<T> getMiddle() const
62 { 62 {
63 return (start + end)/(T)2; 63 return (start + end)/(T)2;
64 } 64 }
65 65
66 //! Get the vector of the line. 66 //! Get the vector of the line.
67 /** \return The vector of the line. */ 67 /** \return The vector of the line. */
68 vector2d<T> getVector() const { return vector2d<T>(end.X - start.X, end.Y - start.Y); } 68 vector2d<T> getVector() const { return vector2d<T>(end.X - start.X, end.Y - start.Y); }
69 69
70 //! Tests if this line intersects with another line. 70 //! Tests if this line intersects with another line.
71 /** \param l: Other line to test intersection with. 71 /** \param l: Other line to test intersection with.
72 \param checkOnlySegments: Default is to check intersection between the begin and endpoints. 72 \param checkOnlySegments: Default is to check intersection between the begin and endpoints.
73 When set to false the function will check for the first intersection point when extending the lines. 73 When set to false the function will check for the first intersection point when extending the lines.
74 \param out: If there is an intersection, the location of the 74 \param out: If there is an intersection, the location of the
75 intersection will be stored in this vector. 75 intersection will be stored in this vector.
76 \return True if there is an intersection, false if not. */ 76 \return True if there is an intersection, false if not. */
77 bool intersectWith(const line2d<T>& l, vector2d<T>& out, bool checkOnlySegments=true) const 77 bool intersectWith(const line2d<T>& l, vector2d<T>& out, bool checkOnlySegments=true) const
78 { 78 {
79 // Uses the method given at: 79 // Uses the method given at:
80 // http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ 80 // http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
81 const f32 commonDenominator = (f32)(l.end.Y - l.start.Y)*(end.X - start.X) - 81 const f32 commonDenominator = (f32)(l.end.Y - l.start.Y)*(end.X - start.X) -
82 (l.end.X - l.start.X)*(end.Y - start.Y); 82 (l.end.X - l.start.X)*(end.Y - start.Y);
83 83
84 const f32 numeratorA = (f32)(l.end.X - l.start.X)*(start.Y - l.start.Y) - 84 const f32 numeratorA = (f32)(l.end.X - l.start.X)*(start.Y - l.start.Y) -
85 (l.end.Y - l.start.Y)*(start.X -l.start.X); 85 (l.end.Y - l.start.Y)*(start.X -l.start.X);
86 86
87 const f32 numeratorB = (f32)(end.X - start.X)*(start.Y - l.start.Y) - 87 const f32 numeratorB = (f32)(end.X - start.X)*(start.Y - l.start.Y) -
88 (end.Y - start.Y)*(start.X -l.start.X); 88 (end.Y - start.Y)*(start.X -l.start.X);
89 89
90 if(equals(commonDenominator, 0.f)) 90 if(equals(commonDenominator, 0.f))
91 { 91 {
92 // The lines are either coincident or parallel 92 // The lines are either coincident or parallel
93 // if both numerators are 0, the lines are coincident 93 // if both numerators are 0, the lines are coincident
94 if(equals(numeratorA, 0.f) && equals(numeratorB, 0.f)) 94 if(equals(numeratorA, 0.f) && equals(numeratorB, 0.f))
95 { 95 {
96 // Try and find a common endpoint 96 // Try and find a common endpoint
97 if(l.start == start || l.end == start) 97 if(l.start == start || l.end == start)
98 out = start; 98 out = start;
99 else if(l.end == end || l.start == end) 99 else if(l.end == end || l.start == end)
100 out = end; 100 out = end;
101 // now check if the two segments are disjunct 101 // now check if the two segments are disjunct
102 else if (l.start.X>start.X && l.end.X>start.X && l.start.X>end.X && l.end.X>end.X) 102 else if (l.start.X>start.X && l.end.X>start.X && l.start.X>end.X && l.end.X>end.X)
103 return false; 103 return false;
104 else if (l.start.Y>start.Y && l.end.Y>start.Y && l.start.Y>end.Y && l.end.Y>end.Y) 104 else if (l.start.Y>start.Y && l.end.Y>start.Y && l.start.Y>end.Y && l.end.Y>end.Y)
105 return false; 105 return false;
106 else if (l.start.X<start.X && l.end.X<start.X && l.start.X<end.X && l.end.X<end.X) 106 else if (l.start.X<start.X && l.end.X<start.X && l.start.X<end.X && l.end.X<end.X)
107 return false; 107 return false;
108 else if (l.start.Y<start.Y && l.end.Y<start.Y && l.start.Y<end.Y && l.end.Y<end.Y) 108 else if (l.start.Y<start.Y && l.end.Y<start.Y && l.start.Y<end.Y && l.end.Y<end.Y)
109 return false; 109 return false;
110 // else the lines are overlapping to some extent 110 // else the lines are overlapping to some extent
111 else 111 else
112 { 112 {
113 // find the points which are not contributing to the 113 // find the points which are not contributing to the
114 // common part 114 // common part
115 vector2d<T> maxp; 115 vector2d<T> maxp;
116 vector2d<T> minp; 116 vector2d<T> minp;
117 if ((start.X>l.start.X && start.X>l.end.X && start.X>end.X) || (start.Y>l.start.Y && start.Y>l.end.Y && start.Y>end.Y)) 117 if ((start.X>l.start.X && start.X>l.end.X && start.X>end.X) || (start.Y>l.start.Y && start.Y>l.end.Y && start.Y>end.Y))
118 maxp=start; 118 maxp=start;
119 else if ((end.X>l.start.X && end.X>l.end.X && end.X>start.X) || (end.Y>l.start.Y && end.Y>l.end.Y && end.Y>start.Y)) 119 else if ((end.X>l.start.X && end.X>l.end.X && end.X>start.X) || (end.Y>l.start.Y && end.Y>l.end.Y && end.Y>start.Y))
120 maxp=end; 120 maxp=end;
121 else if ((l.start.X>start.X && l.start.X>l.end.X && l.start.X>end.X) || (l.start.Y>start.Y && l.start.Y>l.end.Y && l.start.Y>end.Y)) 121 else if ((l.start.X>start.X && l.start.X>l.end.X && l.start.X>end.X) || (l.start.Y>start.Y && l.start.Y>l.end.Y && l.start.Y>end.Y))
122 maxp=l.start; 122 maxp=l.start;
123 else 123 else
124 maxp=l.end; 124 maxp=l.end;
125 if (maxp != start && ((start.X<l.start.X && start.X<l.end.X && start.X<end.X) || (start.Y<l.start.Y && start.Y<l.end.Y && start.Y<end.Y))) 125 if (maxp != start && ((start.X<l.start.X && start.X<l.end.X && start.X<end.X) || (start.Y<l.start.Y && start.Y<l.end.Y && start.Y<end.Y)))
126 minp=start; 126 minp=start;
127 else if (maxp != end && ((end.X<l.start.X && end.X<l.end.X && end.X<start.X) || (end.Y<l.start.Y && end.Y<l.end.Y && end.Y<start.Y))) 127 else if (maxp != end && ((end.X<l.start.X && end.X<l.end.X && end.X<start.X) || (end.Y<l.start.Y && end.Y<l.end.Y && end.Y<start.Y)))
128 minp=end; 128 minp=end;
129 else if (maxp != l.start && ((l.start.X<start.X && l.start.X<l.end.X && l.start.X<end.X) || (l.start.Y<start.Y && l.start.Y<l.end.Y && l.start.Y<end.Y))) 129 else if (maxp != l.start && ((l.start.X<start.X && l.start.X<l.end.X && l.start.X<end.X) || (l.start.Y<start.Y && l.start.Y<l.end.Y && l.start.Y<end.Y)))
130 minp=l.start; 130 minp=l.start;
131 else 131 else
132 minp=l.end; 132 minp=l.end;
133 133
134 // one line is contained in the other. Pick the center 134 // one line is contained in the other. Pick the center
135 // of the remaining points, which overlap for sure 135 // of the remaining points, which overlap for sure
136 out = core::vector2d<T>(); 136 out = core::vector2d<T>();
137 if (start != maxp && start != minp) 137 if (start != maxp && start != minp)
138 out += start; 138 out += start;
139 if (end != maxp && end != minp) 139 if (end != maxp && end != minp)
140 out += end; 140 out += end;
141 if (l.start != maxp && l.start != minp) 141 if (l.start != maxp && l.start != minp)
142 out += l.start; 142 out += l.start;
143 if (l.end != maxp && l.end != minp) 143 if (l.end != maxp && l.end != minp)
144 out += l.end; 144 out += l.end;
145 out.X = (T)(out.X/2); 145 out.X = (T)(out.X/2);
146 out.Y = (T)(out.Y/2); 146 out.Y = (T)(out.Y/2);
147 } 147 }
148 148
149 return true; // coincident 149 return true; // coincident
150 } 150 }
151 151
152 return false; // parallel 152 return false; // parallel
153 } 153 }
154 154
155 // Get the point of intersection on this line, checking that 155 // Get the point of intersection on this line, checking that
156 // it is within the line segment. 156 // it is within the line segment.
157 const f32 uA = numeratorA / commonDenominator; 157 const f32 uA = numeratorA / commonDenominator;
158 if(checkOnlySegments && (uA < 0.f || uA > 1.f) ) 158 if(checkOnlySegments && (uA < 0.f || uA > 1.f) )
159 return false; // Outside the line segment 159 return false; // Outside the line segment
160 160
161 const f32 uB = numeratorB / commonDenominator; 161 const f32 uB = numeratorB / commonDenominator;
162 if(checkOnlySegments && (uB < 0.f || uB > 1.f)) 162 if(checkOnlySegments && (uB < 0.f || uB > 1.f))
163 return false; // Outside the line segment 163 return false; // Outside the line segment
164 164
165 // Calculate the intersection point. 165 // Calculate the intersection point.
166 out.X = (T)(start.X + uA * (end.X - start.X)); 166 out.X = (T)(start.X + uA * (end.X - start.X));
167 out.Y = (T)(start.Y + uA * (end.Y - start.Y)); 167 out.Y = (T)(start.Y + uA * (end.Y - start.Y));
168 return true; 168 return true;
169 } 169 }
170 170
171 //! Get unit vector of the line. 171 //! Get unit vector of the line.
172 /** \return Unit vector of this line. */ 172 /** \return Unit vector of this line. */
173 vector2d<T> getUnitVector() const 173 vector2d<T> getUnitVector() const
174 { 174 {
175 T len = (T)(1.0 / getLength()); 175 T len = (T)(1.0 / getLength());
176 return vector2d<T>((end.X - start.X) * len, (end.Y - start.Y) * len); 176 return vector2d<T>((end.X - start.X) * len, (end.Y - start.Y) * len);
177 } 177 }
178 178
179 //! Get angle between this line and given line. 179 //! Get angle between this line and given line.
180 /** \param l Other line for test. 180 /** \param l Other line for test.
181 \return Angle in degrees. */ 181 \return Angle in degrees. */
182 f64 getAngleWith(const line2d<T>& l) const 182 f64 getAngleWith(const line2d<T>& l) const
183 { 183 {
184 vector2d<T> vect = getVector(); 184 vector2d<T> vect = getVector();
185 vector2d<T> vect2 = l.getVector(); 185 vector2d<T> vect2 = l.getVector();
186 return vect.getAngleWith(vect2); 186 return vect.getAngleWith(vect2);
187 } 187 }
188 188
189 //! Tells us if the given point lies to the left, right, or on the line. 189 //! Tells us if the given point lies to the left, right, or on the line.
190 /** \return 0 if the point is on the line 190 /** \return 0 if the point is on the line
191 <0 if to the left, or >0 if to the right. */ 191 <0 if to the left, or >0 if to the right. */
192 T getPointOrientation(const vector2d<T>& point) const 192 T getPointOrientation(const vector2d<T>& point) const
193 { 193 {
194 return ( (end.X - start.X) * (point.Y - start.Y) - 194 return ( (end.X - start.X) * (point.Y - start.Y) -
195 (point.X - start.X) * (end.Y - start.Y) ); 195 (point.X - start.X) * (end.Y - start.Y) );
196 } 196 }
197 197
198 //! Check if the given point is a member of the line 198 //! Check if the given point is a member of the line
199 /** \return True if point is between start and end, else false. */ 199 /** \return True if point is between start and end, else false. */
200 bool isPointOnLine(const vector2d<T>& point) const 200 bool isPointOnLine(const vector2d<T>& point) const
201 { 201 {
202 T d = getPointOrientation(point); 202 T d = getPointOrientation(point);
203 return (d == 0 && point.isBetweenPoints(start, end)); 203 return (d == 0 && point.isBetweenPoints(start, end));
204 } 204 }
205 205
206 //! Check if the given point is between start and end of the line. 206 //! Check if the given point is between start and end of the line.
207 /** Assumes that the point is already somewhere on the line. */ 207 /** Assumes that the point is already somewhere on the line. */
208 bool isPointBetweenStartAndEnd(const vector2d<T>& point) const 208 bool isPointBetweenStartAndEnd(const vector2d<T>& point) const
209 { 209 {
210 return point.isBetweenPoints(start, end); 210 return point.isBetweenPoints(start, end);
211 } 211 }
212 212
213 //! Get the closest point on this line to a point 213 //! Get the closest point on this line to a point
214 /** \param checkOnlySegments: Default (true) is to return a point on the line-segment (between begin and end) of the line. 214 /** \param checkOnlySegments: Default (true) is to return a point on the line-segment (between begin and end) of the line.
215 When set to false the function will check for the first the closest point on the the line even when outside the segment. */ 215 When set to false the function will check for the first the closest point on the the line even when outside the segment. */
216 vector2d<T> getClosestPoint(const vector2d<T>& point, bool checkOnlySegments=true) const 216 vector2d<T> getClosestPoint(const vector2d<T>& point, bool checkOnlySegments=true) const
217 { 217 {
218 vector2d<f64> c((f64)(point.X-start.X), (f64)(point.Y- start.Y)); 218 vector2d<f64> c((f64)(point.X-start.X), (f64)(point.Y- start.Y));
219 vector2d<f64> v((f64)(end.X-start.X), (f64)(end.Y-start.Y)); 219 vector2d<f64> v((f64)(end.X-start.X), (f64)(end.Y-start.Y));
220 f64 d = v.getLength(); 220 f64 d = v.getLength();
221 if ( d == 0 ) // can't tell much when the line is just a single point 221 if ( d == 0 ) // can't tell much when the line is just a single point
222 return start; 222 return start;
223 v /= d; 223 v /= d;
224 f64 t = v.dotProduct(c); 224 f64 t = v.dotProduct(c);
225 225
226 if ( checkOnlySegments ) 226 if ( checkOnlySegments )
227 { 227 {
228 if (t < 0) return vector2d<T>((T)start.X, (T)start.Y); 228 if (t < 0) return vector2d<T>((T)start.X, (T)start.Y);
229 if (t > d) return vector2d<T>((T)end.X, (T)end.Y); 229 if (t > d) return vector2d<T>((T)end.X, (T)end.Y);
230 } 230 }
231 231
232 v *= t; 232 v *= t;
233 return vector2d<T>((T)(start.X + v.X), (T)(start.Y + v.Y)); 233 return vector2d<T>((T)(start.X + v.X), (T)(start.Y + v.Y));
234 } 234 }
235 235
236 //! Start point of the line. 236 //! Start point of the line.
237 vector2d<T> start; 237 vector2d<T> start;
238 //! End point of the line. 238 //! End point of the line.
239 vector2d<T> end; 239 vector2d<T> end;
240}; 240};
241 241
242 // partial specialization to optimize <f32> lines (avoiding casts) 242 // partial specialization to optimize <f32> lines (avoiding casts)
243 template <> 243 template <>
244 inline vector2df line2d<irr::f32>::getClosestPoint(const vector2df& point, bool checkOnlySegments) const 244 inline vector2df line2d<irr::f32>::getClosestPoint(const vector2df& point, bool checkOnlySegments) const
245 { 245 {
246 vector2df c = point - start; 246 vector2df c = point - start;
247 vector2df v = end - start; 247 vector2df v = end - start;
248 f32 d = (f32)v.getLength(); 248 f32 d = (f32)v.getLength();
249 if ( d == 0 ) // can't tell much when the line is just a single point 249 if ( d == 0 ) // can't tell much when the line is just a single point
250 return start; 250 return start;
251 v /= d; 251 v /= d;
252 f32 t = v.dotProduct(c); 252 f32 t = v.dotProduct(c);
253 253
254 if ( checkOnlySegments ) 254 if ( checkOnlySegments )
255 { 255 {
256 if (t < 0) return start; 256 if (t < 0) return start;
257 if (t > d) return end; 257 if (t > d) return end;
258 } 258 }
259 259
260 v *= t; 260 v *= t;
261 return start + v; 261 return start + v;
262 } 262 }
263 263
264 264
265 //! Typedef for an f32 line. 265 //! Typedef for an f32 line.
266 typedef line2d<f32> line2df; 266 typedef line2d<f32> line2df;
267 //! Typedef for an integer line. 267 //! Typedef for an integer line.
268 typedef line2d<s32> line2di; 268 typedef line2d<s32> line2di;
269 269
270} // end namespace core 270} // end namespace core
271} // end namespace irr 271} // end namespace irr
272 272
273#endif 273#endif
274 274
diff --git a/libraries/irrlicht-1.8/include/line3d.h b/libraries/irrlicht-1.8/include/line3d.h
index 6ec4e70..5e1437a 100644
--- a/libraries/irrlicht-1.8/include/line3d.h
+++ b/libraries/irrlicht-1.8/include/line3d.h
@@ -1,144 +1,144 @@
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#ifndef __IRR_LINE_3D_H_INCLUDED__ 5#ifndef __IRR_LINE_3D_H_INCLUDED__
6#define __IRR_LINE_3D_H_INCLUDED__ 6#define __IRR_LINE_3D_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include "vector3d.h" 9#include "vector3d.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace core 13namespace core
14{ 14{
15 15
16//! 3D line between two points with intersection methods. 16//! 3D line between two points with intersection methods.
17template <class T> 17template <class T>
18class line3d 18class line3d
19{ 19{
20 public: 20 public:
21 21
22 //! Default constructor 22 //! Default constructor
23 /** line from (0,0,0) to (1,1,1) */ 23 /** line from (0,0,0) to (1,1,1) */
24 line3d() : start(0,0,0), end(1,1,1) {} 24 line3d() : start(0,0,0), end(1,1,1) {}
25 //! Constructor with two points 25 //! Constructor with two points
26 line3d(T xa, T ya, T za, T xb, T yb, T zb) : start(xa, ya, za), end(xb, yb, zb) {} 26 line3d(T xa, T ya, T za, T xb, T yb, T zb) : start(xa, ya, za), end(xb, yb, zb) {}
27 //! Constructor with two points as vectors 27 //! Constructor with two points as vectors
28 line3d(const vector3d<T>& start, const vector3d<T>& end) : start(start), end(end) {} 28 line3d(const vector3d<T>& start, const vector3d<T>& end) : start(start), end(end) {}
29 29
30 // operators 30 // operators
31 31
32 line3d<T> operator+(const vector3d<T>& point) const { return line3d<T>(start + point, end + point); } 32 line3d<T> operator+(const vector3d<T>& point) const { return line3d<T>(start + point, end + point); }
33 line3d<T>& operator+=(const vector3d<T>& point) { start += point; end += point; return *this; } 33 line3d<T>& operator+=(const vector3d<T>& point) { start += point; end += point; return *this; }
34 34
35 line3d<T> operator-(const vector3d<T>& point) const { return line3d<T>(start - point, end - point); } 35 line3d<T> operator-(const vector3d<T>& point) const { return line3d<T>(start - point, end - point); }
36 line3d<T>& operator-=(const vector3d<T>& point) { start -= point; end -= point; return *this; } 36 line3d<T>& operator-=(const vector3d<T>& point) { start -= point; end -= point; return *this; }
37 37
38 bool operator==(const line3d<T>& other) const 38 bool operator==(const line3d<T>& other) const
39 { return (start==other.start && end==other.end) || (end==other.start && start==other.end);} 39 { return (start==other.start && end==other.end) || (end==other.start && start==other.end);}
40 bool operator!=(const line3d<T>& other) const 40 bool operator!=(const line3d<T>& other) const
41 { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);} 41 { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);}
42 42
43 // functions 43 // functions
44 //! Set this line to a new line going through the two points. 44 //! Set this line to a new line going through the two points.
45 void setLine(const T& xa, const T& ya, const T& za, const T& xb, const T& yb, const T& zb) 45 void setLine(const T& xa, const T& ya, const T& za, const T& xb, const T& yb, const T& zb)
46 {start.set(xa, ya, za); end.set(xb, yb, zb);} 46 {start.set(xa, ya, za); end.set(xb, yb, zb);}
47 //! Set this line to a new line going through the two points. 47 //! Set this line to a new line going through the two points.
48 void setLine(const vector3d<T>& nstart, const vector3d<T>& nend) 48 void setLine(const vector3d<T>& nstart, const vector3d<T>& nend)
49 {start.set(nstart); end.set(nend);} 49 {start.set(nstart); end.set(nend);}
50 //! Set this line to new line given as parameter. 50 //! Set this line to new line given as parameter.
51 void setLine(const line3d<T>& line) 51 void setLine(const line3d<T>& line)
52 {start.set(line.start); end.set(line.end);} 52 {start.set(line.start); end.set(line.end);}
53 53
54 //! Get length of line 54 //! Get length of line
55 /** \return Length of line. */ 55 /** \return Length of line. */
56 T getLength() const { return start.getDistanceFrom(end); } 56 T getLength() const { return start.getDistanceFrom(end); }
57 57
58 //! Get squared length of line 58 //! Get squared length of line
59 /** \return Squared length of line. */ 59 /** \return Squared length of line. */
60 T getLengthSQ() const { return start.getDistanceFromSQ(end); } 60 T getLengthSQ() const { return start.getDistanceFromSQ(end); }
61 61
62 //! Get middle of line 62 //! Get middle of line
63 /** \return Center of line. */ 63 /** \return Center of line. */
64 vector3d<T> getMiddle() const 64 vector3d<T> getMiddle() const
65 { 65 {
66 return (start + end)/(T)2; 66 return (start + end)/(T)2;
67 } 67 }
68 68
69 //! Get vector of line 69 //! Get vector of line
70 /** \return vector of line. */ 70 /** \return vector of line. */
71 vector3d<T> getVector() const 71 vector3d<T> getVector() const
72 { 72 {
73 return end - start; 73 return end - start;
74 } 74 }
75 75
76 //! Check if the given point is between start and end of the line. 76 //! Check if the given point is between start and end of the line.
77 /** Assumes that the point is already somewhere on the line. 77 /** Assumes that the point is already somewhere on the line.
78 \param point The point to test. 78 \param point The point to test.
79 \return True if point is on the line between start and end, else false. 79 \return True if point is on the line between start and end, else false.
80 */ 80 */
81 bool isPointBetweenStartAndEnd(const vector3d<T>& point) const 81 bool isPointBetweenStartAndEnd(const vector3d<T>& point) const
82 { 82 {
83 return point.isBetweenPoints(start, end); 83 return point.isBetweenPoints(start, end);
84 } 84 }
85 85
86 //! Get the closest point on this line to a point 86 //! Get the closest point on this line to a point
87 /** \param point The point to compare to. 87 /** \param point The point to compare to.
88 \return The nearest point which is part of the line. */ 88 \return The nearest point which is part of the line. */
89 vector3d<T> getClosestPoint(const vector3d<T>& point) const 89 vector3d<T> getClosestPoint(const vector3d<T>& point) const
90 { 90 {
91 vector3d<T> c = point - start; 91 vector3d<T> c = point - start;
92 vector3d<T> v = end - start; 92 vector3d<T> v = end - start;
93 T d = (T)v.getLength(); 93 T d = (T)v.getLength();
94 v /= d; 94 v /= d;
95 T t = v.dotProduct(c); 95 T t = v.dotProduct(c);
96 96
97 if (t < (T)0.0) 97 if (t < (T)0.0)
98 return start; 98 return start;
99 if (t > d) 99 if (t > d)
100 return end; 100 return end;
101 101
102 v *= t; 102 v *= t;
103 return start + v; 103 return start + v;
104 } 104 }
105 105
106 //! Check if the line intersects with a shpere 106 //! Check if the line intersects with a shpere
107 /** \param sorigin: Origin of the shpere. 107 /** \param sorigin: Origin of the shpere.
108 \param sradius: Radius of the sphere. 108 \param sradius: Radius of the sphere.
109 \param outdistance: The distance to the first intersection point. 109 \param outdistance: The distance to the first intersection point.
110 \return True if there is an intersection. 110 \return True if there is an intersection.
111 If there is one, the distance to the first intersection point 111 If there is one, the distance to the first intersection point
112 is stored in outdistance. */ 112 is stored in outdistance. */
113 bool getIntersectionWithSphere(vector3d<T> sorigin, T sradius, f64& outdistance) const 113 bool getIntersectionWithSphere(vector3d<T> sorigin, T sradius, f64& outdistance) const
114 { 114 {
115 const vector3d<T> q = sorigin - start; 115 const vector3d<T> q = sorigin - start;
116 T c = q.getLength(); 116 T c = q.getLength();
117 T v = q.dotProduct(getVector().normalize()); 117 T v = q.dotProduct(getVector().normalize());
118 T d = sradius * sradius - (c*c - v*v); 118 T d = sradius * sradius - (c*c - v*v);
119 119
120 if (d < 0.0) 120 if (d < 0.0)
121 return false; 121 return false;
122 122
123 outdistance = v - core::squareroot ( d ); 123 outdistance = v - core::squareroot ( d );
124 return true; 124 return true;
125 } 125 }
126 126
127 // member variables 127 // member variables
128 128
129 //! Start point of line 129 //! Start point of line
130 vector3d<T> start; 130 vector3d<T> start;
131 //! End point of line 131 //! End point of line
132 vector3d<T> end; 132 vector3d<T> end;
133}; 133};
134 134
135 //! Typedef for an f32 line. 135 //! Typedef for an f32 line.
136 typedef line3d<f32> line3df; 136 typedef line3d<f32> line3df;
137 //! Typedef for an integer line. 137 //! Typedef for an integer line.
138 typedef line3d<s32> line3di; 138 typedef line3d<s32> line3di;
139 139
140} // end namespace core 140} // end namespace core
141} // end namespace irr 141} // end namespace irr
142 142
143#endif 143#endif
144 144
diff --git a/libraries/irrlicht-1.8/include/matrix4.h b/libraries/irrlicht-1.8/include/matrix4.h
index df1e4ea..b04827f 100644
--- a/libraries/irrlicht-1.8/include/matrix4.h
+++ b/libraries/irrlicht-1.8/include/matrix4.h
@@ -1,2242 +1,2242 @@
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#ifndef __IRR_MATRIX_H_INCLUDED__ 5#ifndef __IRR_MATRIX_H_INCLUDED__
6#define __IRR_MATRIX_H_INCLUDED__ 6#define __IRR_MATRIX_H_INCLUDED__
7 7
8#include "irrMath.h" 8#include "irrMath.h"
9#include "vector3d.h" 9#include "vector3d.h"
10#include "vector2d.h" 10#include "vector2d.h"
11#include "plane3d.h" 11#include "plane3d.h"
12#include "aabbox3d.h" 12#include "aabbox3d.h"
13#include "rect.h" 13#include "rect.h"
14#include "irrString.h" 14#include "irrString.h"
15 15
16// enable this to keep track of changes to the matrix 16// enable this to keep track of changes to the matrix
17// and make simpler identity check for seldomly changing matrices 17// and make simpler identity check for seldomly changing matrices
18// otherwise identity check will always compare the elements 18// otherwise identity check will always compare the elements
19//#define USE_MATRIX_TEST 19//#define USE_MATRIX_TEST
20 20
21// this is only for debugging purposes 21// this is only for debugging purposes
22//#define USE_MATRIX_TEST_DEBUG 22//#define USE_MATRIX_TEST_DEBUG
23 23
24#if defined( USE_MATRIX_TEST_DEBUG ) 24#if defined( USE_MATRIX_TEST_DEBUG )
25 25
26struct MatrixTest 26struct MatrixTest
27{ 27{
28 MatrixTest () : ID(0), Calls(0) {} 28 MatrixTest () : ID(0), Calls(0) {}
29 char buf[256]; 29 char buf[256];
30 int Calls; 30 int Calls;
31 int ID; 31 int ID;
32}; 32};
33static MatrixTest MTest; 33static MatrixTest MTest;
34 34
35#endif 35#endif
36 36
37namespace irr 37namespace irr
38{ 38{
39namespace core 39namespace core
40{ 40{
41 41
42 //! 4x4 matrix. Mostly used as transformation matrix for 3d calculations. 42 //! 4x4 matrix. Mostly used as transformation matrix for 3d calculations.
43 /** The matrix is a D3D style matrix, row major with translations in the 4th row. */ 43 /** The matrix is a D3D style matrix, row major with translations in the 4th row. */
44 template <class T> 44 template <class T>
45 class CMatrix4 45 class CMatrix4
46 { 46 {
47 public: 47 public:
48 48
49 //! Constructor Flags 49 //! Constructor Flags
50 enum eConstructor 50 enum eConstructor
51 { 51 {
52 EM4CONST_NOTHING = 0, 52 EM4CONST_NOTHING = 0,
53 EM4CONST_COPY, 53 EM4CONST_COPY,
54 EM4CONST_IDENTITY, 54 EM4CONST_IDENTITY,
55 EM4CONST_TRANSPOSED, 55 EM4CONST_TRANSPOSED,
56 EM4CONST_INVERSE, 56 EM4CONST_INVERSE,
57 EM4CONST_INVERSE_TRANSPOSED 57 EM4CONST_INVERSE_TRANSPOSED
58 }; 58 };
59 59
60 //! Default constructor 60 //! Default constructor
61 /** \param constructor Choose the initialization style */ 61 /** \param constructor Choose the initialization style */
62 CMatrix4( eConstructor constructor = EM4CONST_IDENTITY ); 62 CMatrix4( eConstructor constructor = EM4CONST_IDENTITY );
63 //! Copy constructor 63 //! Copy constructor
64 /** \param other Other matrix to copy from 64 /** \param other Other matrix to copy from
65 \param constructor Choose the initialization style */ 65 \param constructor Choose the initialization style */
66 CMatrix4(const CMatrix4<T>& other, eConstructor constructor = EM4CONST_COPY); 66 CMatrix4(const CMatrix4<T>& other, eConstructor constructor = EM4CONST_COPY);
67 67
68 //! Simple operator for directly accessing every element of the matrix. 68 //! Simple operator for directly accessing every element of the matrix.
69 T& operator()(const s32 row, const s32 col) 69 T& operator()(const s32 row, const s32 col)
70 { 70 {
71#if defined ( USE_MATRIX_TEST ) 71#if defined ( USE_MATRIX_TEST )
72 definitelyIdentityMatrix=false; 72 definitelyIdentityMatrix=false;
73#endif 73#endif
74 return M[ row * 4 + col ]; 74 return M[ row * 4 + col ];
75 } 75 }
76 76
77 //! Simple operator for directly accessing every element of the matrix. 77 //! Simple operator for directly accessing every element of the matrix.
78 const T& operator()(const s32 row, const s32 col) const { return M[row * 4 + col]; } 78 const T& operator()(const s32 row, const s32 col) const { return M[row * 4 + col]; }
79 79
80 //! Simple operator for linearly accessing every element of the matrix. 80 //! Simple operator for linearly accessing every element of the matrix.
81 T& operator[](u32 index) 81 T& operator[](u32 index)
82 { 82 {
83#if defined ( USE_MATRIX_TEST ) 83#if defined ( USE_MATRIX_TEST )
84 definitelyIdentityMatrix=false; 84 definitelyIdentityMatrix=false;
85#endif 85#endif
86 return M[index]; 86 return M[index];
87 } 87 }
88 88
89 //! Simple operator for linearly accessing every element of the matrix. 89 //! Simple operator for linearly accessing every element of the matrix.
90 const T& operator[](u32 index) const { return M[index]; } 90 const T& operator[](u32 index) const { return M[index]; }
91 91
92 //! Sets this matrix equal to the other matrix. 92 //! Sets this matrix equal to the other matrix.
93 inline CMatrix4<T>& operator=(const CMatrix4<T> &other); 93 inline CMatrix4<T>& operator=(const CMatrix4<T> &other);
94 94
95 //! Sets all elements of this matrix to the value. 95 //! Sets all elements of this matrix to the value.
96 inline CMatrix4<T>& operator=(const T& scalar); 96 inline CMatrix4<T>& operator=(const T& scalar);
97 97
98 //! Returns pointer to internal array 98 //! Returns pointer to internal array
99 const T* pointer() const { return M; } 99 const T* pointer() const { return M; }
100 T* pointer() 100 T* pointer()
101 { 101 {
102#if defined ( USE_MATRIX_TEST ) 102#if defined ( USE_MATRIX_TEST )
103 definitelyIdentityMatrix=false; 103 definitelyIdentityMatrix=false;
104#endif 104#endif
105 return M; 105 return M;
106 } 106 }
107 107
108 //! Returns true if other matrix is equal to this matrix. 108 //! Returns true if other matrix is equal to this matrix.
109 bool operator==(const CMatrix4<T> &other) const; 109 bool operator==(const CMatrix4<T> &other) const;
110 110
111 //! Returns true if other matrix is not equal to this matrix. 111 //! Returns true if other matrix is not equal to this matrix.
112 bool operator!=(const CMatrix4<T> &other) const; 112 bool operator!=(const CMatrix4<T> &other) const;
113 113
114 //! Add another matrix. 114 //! Add another matrix.
115 CMatrix4<T> operator+(const CMatrix4<T>& other) const; 115 CMatrix4<T> operator+(const CMatrix4<T>& other) const;
116 116
117 //! Add another matrix. 117 //! Add another matrix.
118 CMatrix4<T>& operator+=(const CMatrix4<T>& other); 118 CMatrix4<T>& operator+=(const CMatrix4<T>& other);
119 119
120 //! Subtract another matrix. 120 //! Subtract another matrix.
121 CMatrix4<T> operator-(const CMatrix4<T>& other) const; 121 CMatrix4<T> operator-(const CMatrix4<T>& other) const;
122 122
123 //! Subtract another matrix. 123 //! Subtract another matrix.
124 CMatrix4<T>& operator-=(const CMatrix4<T>& other); 124 CMatrix4<T>& operator-=(const CMatrix4<T>& other);
125 125
126 //! set this matrix to the product of two matrices 126 //! set this matrix to the product of two matrices
127 /** Calculate b*a */ 127 /** Calculate b*a */
128 inline CMatrix4<T>& setbyproduct(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b ); 128 inline CMatrix4<T>& setbyproduct(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b );
129 129
130 //! Set this matrix to the product of two matrices 130 //! Set this matrix to the product of two matrices
131 /** Calculate b*a, no optimization used, 131 /** Calculate b*a, no optimization used,
132 use it if you know you never have a identity matrix */ 132 use it if you know you never have a identity matrix */
133 CMatrix4<T>& setbyproduct_nocheck(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b ); 133 CMatrix4<T>& setbyproduct_nocheck(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b );
134 134
135 //! Multiply by another matrix. 135 //! Multiply by another matrix.
136 /** Calculate other*this */ 136 /** Calculate other*this */
137 CMatrix4<T> operator*(const CMatrix4<T>& other) const; 137 CMatrix4<T> operator*(const CMatrix4<T>& other) const;
138 138
139 //! Multiply by another matrix. 139 //! Multiply by another matrix.
140 /** Calculate and return other*this */ 140 /** Calculate and return other*this */
141 CMatrix4<T>& operator*=(const CMatrix4<T>& other); 141 CMatrix4<T>& operator*=(const CMatrix4<T>& other);
142 142
143 //! Multiply by scalar. 143 //! Multiply by scalar.
144 CMatrix4<T> operator*(const T& scalar) const; 144 CMatrix4<T> operator*(const T& scalar) const;
145 145
146 //! Multiply by scalar. 146 //! Multiply by scalar.
147 CMatrix4<T>& operator*=(const T& scalar); 147 CMatrix4<T>& operator*=(const T& scalar);
148 148
149 //! Set matrix to identity. 149 //! Set matrix to identity.
150 inline CMatrix4<T>& makeIdentity(); 150 inline CMatrix4<T>& makeIdentity();
151 151
152 //! Returns true if the matrix is the identity matrix 152 //! Returns true if the matrix is the identity matrix
153 inline bool isIdentity() const; 153 inline bool isIdentity() const;
154 154
155 //! Returns true if the matrix is orthogonal 155 //! Returns true if the matrix is orthogonal
156 inline bool isOrthogonal() const; 156 inline bool isOrthogonal() const;
157 157
158 //! Returns true if the matrix is the identity matrix 158 //! Returns true if the matrix is the identity matrix
159 bool isIdentity_integer_base () const; 159 bool isIdentity_integer_base () const;
160 160
161 //! Set the translation of the current matrix. Will erase any previous values. 161 //! Set the translation of the current matrix. Will erase any previous values.
162 CMatrix4<T>& setTranslation( const vector3d<T>& translation ); 162 CMatrix4<T>& setTranslation( const vector3d<T>& translation );
163 163
164 //! Gets the current translation 164 //! Gets the current translation
165 vector3d<T> getTranslation() const; 165 vector3d<T> getTranslation() const;
166 166
167 //! Set the inverse translation of the current matrix. Will erase any previous values. 167 //! Set the inverse translation of the current matrix. Will erase any previous values.
168 CMatrix4<T>& setInverseTranslation( const vector3d<T>& translation ); 168 CMatrix4<T>& setInverseTranslation( const vector3d<T>& translation );
169 169
170 //! Make a rotation matrix from Euler angles. The 4th row and column are unmodified. 170 //! Make a rotation matrix from Euler angles. The 4th row and column are unmodified.
171 inline CMatrix4<T>& setRotationRadians( const vector3d<T>& rotation ); 171 inline CMatrix4<T>& setRotationRadians( const vector3d<T>& rotation );
172 172
173 //! Make a rotation matrix from Euler angles. The 4th row and column are unmodified. 173 //! Make a rotation matrix from Euler angles. The 4th row and column are unmodified.
174 CMatrix4<T>& setRotationDegrees( const vector3d<T>& rotation ); 174 CMatrix4<T>& setRotationDegrees( const vector3d<T>& rotation );
175 175
176 //! Returns the rotation, as set by setRotation(). 176 //! Returns the rotation, as set by setRotation().
177 /** This code was orginally written by by Chev. */ 177 /** This code was orginally written by by Chev. */
178 core::vector3d<T> getRotationDegrees() const; 178 core::vector3d<T> getRotationDegrees() const;
179 179
180 //! Make an inverted rotation matrix from Euler angles. 180 //! Make an inverted rotation matrix from Euler angles.
181 /** The 4th row and column are unmodified. */ 181 /** The 4th row and column are unmodified. */
182 inline CMatrix4<T>& setInverseRotationRadians( const vector3d<T>& rotation ); 182 inline CMatrix4<T>& setInverseRotationRadians( const vector3d<T>& rotation );
183 183
184 //! Make an inverted rotation matrix from Euler angles. 184 //! Make an inverted rotation matrix from Euler angles.
185 /** The 4th row and column are unmodified. */ 185 /** The 4th row and column are unmodified. */
186 inline CMatrix4<T>& setInverseRotationDegrees( const vector3d<T>& rotation ); 186 inline CMatrix4<T>& setInverseRotationDegrees( const vector3d<T>& rotation );
187 187
188 //! Make a rotation matrix from angle and axis, assuming left handed rotation. 188 //! Make a rotation matrix from angle and axis, assuming left handed rotation.
189 /** The 4th row and column are unmodified. */ 189 /** The 4th row and column are unmodified. */
190 inline CMatrix4<T>& setRotationAxisRadians(const T& angle, const vector3d<T>& axis); 190 inline CMatrix4<T>& setRotationAxisRadians(const T& angle, const vector3d<T>& axis);
191 191
192 //! Set Scale 192 //! Set Scale
193 CMatrix4<T>& setScale( const vector3d<T>& scale ); 193 CMatrix4<T>& setScale( const vector3d<T>& scale );
194 194
195 //! Set Scale 195 //! Set Scale
196 CMatrix4<T>& setScale( const T scale ) { return setScale(core::vector3d<T>(scale,scale,scale)); } 196 CMatrix4<T>& setScale( const T scale ) { return setScale(core::vector3d<T>(scale,scale,scale)); }
197 197
198 //! Get Scale 198 //! Get Scale
199 core::vector3d<T> getScale() const; 199 core::vector3d<T> getScale() const;
200 200
201 //! Translate a vector by the inverse of the translation part of this matrix. 201 //! Translate a vector by the inverse of the translation part of this matrix.
202 void inverseTranslateVect( vector3df& vect ) const; 202 void inverseTranslateVect( vector3df& vect ) const;
203 203
204 //! Rotate a vector by the inverse of the rotation part of this matrix. 204 //! Rotate a vector by the inverse of the rotation part of this matrix.
205 void inverseRotateVect( vector3df& vect ) const; 205 void inverseRotateVect( vector3df& vect ) const;
206 206
207 //! Rotate a vector by the rotation part of this matrix. 207 //! Rotate a vector by the rotation part of this matrix.
208 void rotateVect( vector3df& vect ) const; 208 void rotateVect( vector3df& vect ) const;
209 209
210 //! An alternate transform vector method, writing into a second vector 210 //! An alternate transform vector method, writing into a second vector
211 void rotateVect(core::vector3df& out, const core::vector3df& in) const; 211 void rotateVect(core::vector3df& out, const core::vector3df& in) const;
212 212
213 //! An alternate transform vector method, writing into an array of 3 floats 213 //! An alternate transform vector method, writing into an array of 3 floats
214 void rotateVect(T *out,const core::vector3df &in) const; 214 void rotateVect(T *out,const core::vector3df &in) const;
215 215
216 //! Transforms the vector by this matrix 216 //! Transforms the vector by this matrix
217 void transformVect( vector3df& vect) const; 217 void transformVect( vector3df& vect) const;
218 218
219 //! Transforms input vector by this matrix and stores result in output vector 219 //! Transforms input vector by this matrix and stores result in output vector
220 void transformVect( vector3df& out, const vector3df& in ) const; 220 void transformVect( vector3df& out, const vector3df& in ) const;
221 221
222 //! An alternate transform vector method, writing into an array of 4 floats 222 //! An alternate transform vector method, writing into an array of 4 floats
223 void transformVect(T *out,const core::vector3df &in) const; 223 void transformVect(T *out,const core::vector3df &in) const;
224 224
225 //! An alternate transform vector method, reading from and writing to an array of 3 floats 225 //! An alternate transform vector method, reading from and writing to an array of 3 floats
226 void transformVec3(T *out, const T * in) const; 226 void transformVec3(T *out, const T * in) const;
227 227
228 //! Translate a vector by the translation part of this matrix. 228 //! Translate a vector by the translation part of this matrix.
229 void translateVect( vector3df& vect ) const; 229 void translateVect( vector3df& vect ) const;
230 230
231 //! Transforms a plane by this matrix 231 //! Transforms a plane by this matrix
232 void transformPlane( core::plane3d<f32> &plane) const; 232 void transformPlane( core::plane3d<f32> &plane) const;
233 233
234 //! Transforms a plane by this matrix 234 //! Transforms a plane by this matrix
235 void transformPlane( const core::plane3d<f32> &in, core::plane3d<f32> &out) const; 235 void transformPlane( const core::plane3d<f32> &in, core::plane3d<f32> &out) const;
236 236
237 //! Transforms a axis aligned bounding box 237 //! Transforms a axis aligned bounding box
238 /** The result box of this operation may not be accurate at all. For 238 /** The result box of this operation may not be accurate at all. For
239 correct results, use transformBoxEx() */ 239 correct results, use transformBoxEx() */
240 void transformBox(core::aabbox3d<f32>& box) const; 240 void transformBox(core::aabbox3d<f32>& box) const;
241 241
242 //! Transforms a axis aligned bounding box 242 //! Transforms a axis aligned bounding box
243 /** The result box of this operation should by accurate, but this operation 243 /** The result box of this operation should by accurate, but this operation
244 is slower than transformBox(). */ 244 is slower than transformBox(). */
245 void transformBoxEx(core::aabbox3d<f32>& box) const; 245 void transformBoxEx(core::aabbox3d<f32>& box) const;
246 246
247 //! Multiplies this matrix by a 1x4 matrix 247 //! Multiplies this matrix by a 1x4 matrix
248 void multiplyWith1x4Matrix(T* matrix) const; 248 void multiplyWith1x4Matrix(T* matrix) const;
249 249
250 //! Calculates inverse of matrix. Slow. 250 //! Calculates inverse of matrix. Slow.
251 /** \return Returns false if there is no inverse matrix.*/ 251 /** \return Returns false if there is no inverse matrix.*/
252 bool makeInverse(); 252 bool makeInverse();
253 253
254 254
255 //! Inverts a primitive matrix which only contains a translation and a rotation 255 //! Inverts a primitive matrix which only contains a translation and a rotation
256 /** \param out: where result matrix is written to. */ 256 /** \param out: where result matrix is written to. */
257 bool getInversePrimitive ( CMatrix4<T>& out ) const; 257 bool getInversePrimitive ( CMatrix4<T>& out ) const;
258 258
259 //! Gets the inversed matrix of this one 259 //! Gets the inversed matrix of this one
260 /** \param out: where result matrix is written to. 260 /** \param out: where result matrix is written to.
261 \return Returns false if there is no inverse matrix. */ 261 \return Returns false if there is no inverse matrix. */
262 bool getInverse(CMatrix4<T>& out) const; 262 bool getInverse(CMatrix4<T>& out) const;
263 263
264 //! Builds a right-handed perspective projection matrix based on a field of view 264 //! Builds a right-handed perspective projection matrix based on a field of view
265 CMatrix4<T>& buildProjectionMatrixPerspectiveFovRH(f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar); 265 CMatrix4<T>& buildProjectionMatrixPerspectiveFovRH(f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar);
266 266
267 //! Builds a left-handed perspective projection matrix based on a field of view 267 //! Builds a left-handed perspective projection matrix based on a field of view
268 CMatrix4<T>& buildProjectionMatrixPerspectiveFovLH(f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar); 268 CMatrix4<T>& buildProjectionMatrixPerspectiveFovLH(f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar);
269 269
270 //! Builds a left-handed perspective projection matrix based on a field of view, with far plane at infinity 270 //! Builds a left-handed perspective projection matrix based on a field of view, with far plane at infinity
271 CMatrix4<T>& buildProjectionMatrixPerspectiveFovInfinityLH(f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 epsilon=0); 271 CMatrix4<T>& buildProjectionMatrixPerspectiveFovInfinityLH(f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 epsilon=0);
272 272
273 //! Builds a right-handed perspective projection matrix. 273 //! Builds a right-handed perspective projection matrix.
274 CMatrix4<T>& buildProjectionMatrixPerspectiveRH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar); 274 CMatrix4<T>& buildProjectionMatrixPerspectiveRH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar);
275 275
276 //! Builds a left-handed perspective projection matrix. 276 //! Builds a left-handed perspective projection matrix.
277 CMatrix4<T>& buildProjectionMatrixPerspectiveLH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar); 277 CMatrix4<T>& buildProjectionMatrixPerspectiveLH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar);
278 278
279 //! Builds a left-handed orthogonal projection matrix. 279 //! Builds a left-handed orthogonal projection matrix.
280 CMatrix4<T>& buildProjectionMatrixOrthoLH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar); 280 CMatrix4<T>& buildProjectionMatrixOrthoLH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar);
281 281
282 //! Builds a right-handed orthogonal projection matrix. 282 //! Builds a right-handed orthogonal projection matrix.
283 CMatrix4<T>& buildProjectionMatrixOrthoRH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar); 283 CMatrix4<T>& buildProjectionMatrixOrthoRH(f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar);
284 284
285 //! Builds a left-handed look-at matrix. 285 //! Builds a left-handed look-at matrix.
286 CMatrix4<T>& buildCameraLookAtMatrixLH( 286 CMatrix4<T>& buildCameraLookAtMatrixLH(
287 const vector3df& position, 287 const vector3df& position,
288 const vector3df& target, 288 const vector3df& target,
289 const vector3df& upVector); 289 const vector3df& upVector);
290 290
291 //! Builds a right-handed look-at matrix. 291 //! Builds a right-handed look-at matrix.
292 CMatrix4<T>& buildCameraLookAtMatrixRH( 292 CMatrix4<T>& buildCameraLookAtMatrixRH(
293 const vector3df& position, 293 const vector3df& position,
294 const vector3df& target, 294 const vector3df& target,
295 const vector3df& upVector); 295 const vector3df& upVector);
296 296
297 //! Builds a matrix that flattens geometry into a plane. 297 //! Builds a matrix that flattens geometry into a plane.
298 /** \param light: light source 298 /** \param light: light source
299 \param plane: plane into which the geometry if flattened into 299 \param plane: plane into which the geometry if flattened into
300 \param point: value between 0 and 1, describing the light source. 300 \param point: value between 0 and 1, describing the light source.
301 If this is 1, it is a point light, if it is 0, it is a directional light. */ 301 If this is 1, it is a point light, if it is 0, it is a directional light. */
302 CMatrix4<T>& buildShadowMatrix(const core::vector3df& light, core::plane3df plane, f32 point=1.0f); 302 CMatrix4<T>& buildShadowMatrix(const core::vector3df& light, core::plane3df plane, f32 point=1.0f);
303 303
304 //! Builds a matrix which transforms a normalized Device Coordinate to Device Coordinates. 304 //! Builds a matrix which transforms a normalized Device Coordinate to Device Coordinates.
305 /** Used to scale <-1,-1><1,1> to viewport, for example from <-1,-1> <1,1> to the viewport <0,0><0,640> */ 305 /** Used to scale <-1,-1><1,1> to viewport, for example from <-1,-1> <1,1> to the viewport <0,0><0,640> */
306 CMatrix4<T>& buildNDCToDCMatrix( const core::rect<s32>& area, f32 zScale); 306 CMatrix4<T>& buildNDCToDCMatrix( const core::rect<s32>& area, f32 zScale);
307 307
308 //! Creates a new matrix as interpolated matrix from two other ones. 308 //! Creates a new matrix as interpolated matrix from two other ones.
309 /** \param b: other matrix to interpolate with 309 /** \param b: other matrix to interpolate with
310 \param time: Must be a value between 0 and 1. */ 310 \param time: Must be a value between 0 and 1. */
311 CMatrix4<T> interpolate(const core::CMatrix4<T>& b, f32 time) const; 311 CMatrix4<T> interpolate(const core::CMatrix4<T>& b, f32 time) const;
312 312
313 //! Gets transposed matrix 313 //! Gets transposed matrix
314 CMatrix4<T> getTransposed() const; 314 CMatrix4<T> getTransposed() const;
315 315
316 //! Gets transposed matrix 316 //! Gets transposed matrix
317 inline void getTransposed( CMatrix4<T>& dest ) const; 317 inline void getTransposed( CMatrix4<T>& dest ) const;
318 318
319 //! Builds a matrix that rotates from one vector to another 319 //! Builds a matrix that rotates from one vector to another
320 /** \param from: vector to rotate from 320 /** \param from: vector to rotate from
321 \param to: vector to rotate to 321 \param to: vector to rotate to
322 */ 322 */
323 CMatrix4<T>& buildRotateFromTo(const core::vector3df& from, const core::vector3df& to); 323 CMatrix4<T>& buildRotateFromTo(const core::vector3df& from, const core::vector3df& to);
324 324
325 //! Builds a combined matrix which translates to a center before rotation and translates from origin afterwards 325 //! Builds a combined matrix which translates to a center before rotation and translates from origin afterwards
326 /** \param center Position to rotate around 326 /** \param center Position to rotate around
327 \param translate Translation applied after the rotation 327 \param translate Translation applied after the rotation
328 */ 328 */
329 void setRotationCenter(const core::vector3df& center, const core::vector3df& translate); 329 void setRotationCenter(const core::vector3df& center, const core::vector3df& translate);
330 330
331 //! Builds a matrix which rotates a source vector to a look vector over an arbitrary axis 331 //! Builds a matrix which rotates a source vector to a look vector over an arbitrary axis
332 /** \param camPos: viewer position in world coo 332 /** \param camPos: viewer position in world coo
333 \param center: object position in world-coo and rotation pivot 333 \param center: object position in world-coo and rotation pivot
334 \param translation: object final translation from center 334 \param translation: object final translation from center
335 \param axis: axis to rotate about 335 \param axis: axis to rotate about
336 \param from: source vector to rotate from 336 \param from: source vector to rotate from
337 */ 337 */
338 void buildAxisAlignedBillboard(const core::vector3df& camPos, 338 void buildAxisAlignedBillboard(const core::vector3df& camPos,
339 const core::vector3df& center, 339 const core::vector3df& center,
340 const core::vector3df& translation, 340 const core::vector3df& translation,
341 const core::vector3df& axis, 341 const core::vector3df& axis,
342 const core::vector3df& from); 342 const core::vector3df& from);
343 343
344 /* 344 /*
345 construct 2D Texture transformations 345 construct 2D Texture transformations
346 rotate about center, scale, and transform. 346 rotate about center, scale, and transform.
347 */ 347 */
348 //! Set to a texture transformation matrix with the given parameters. 348 //! Set to a texture transformation matrix with the given parameters.
349 CMatrix4<T>& buildTextureTransform( f32 rotateRad, 349 CMatrix4<T>& buildTextureTransform( f32 rotateRad,
350 const core::vector2df &rotatecenter, 350 const core::vector2df &rotatecenter,
351 const core::vector2df &translate, 351 const core::vector2df &translate,
352 const core::vector2df &scale); 352 const core::vector2df &scale);
353 353
354 //! Set texture transformation rotation 354 //! Set texture transformation rotation
355 /** Rotate about z axis, recenter at (0.5,0.5). 355 /** Rotate about z axis, recenter at (0.5,0.5).
356 Doesn't clear other elements than those affected 356 Doesn't clear other elements than those affected
357 \param radAngle Angle in radians 357 \param radAngle Angle in radians
358 \return Altered matrix */ 358 \return Altered matrix */
359 CMatrix4<T>& setTextureRotationCenter( f32 radAngle ); 359 CMatrix4<T>& setTextureRotationCenter( f32 radAngle );
360 360
361 //! Set texture transformation translation 361 //! Set texture transformation translation
362 /** Doesn't clear other elements than those affected. 362 /** Doesn't clear other elements than those affected.
363 \param x Offset on x axis 363 \param x Offset on x axis
364 \param y Offset on y axis 364 \param y Offset on y axis
365 \return Altered matrix */ 365 \return Altered matrix */
366 CMatrix4<T>& setTextureTranslate( f32 x, f32 y ); 366 CMatrix4<T>& setTextureTranslate( f32 x, f32 y );
367 367
368 //! Set texture transformation translation, using a transposed representation 368 //! Set texture transformation translation, using a transposed representation
369 /** Doesn't clear other elements than those affected. 369 /** Doesn't clear other elements than those affected.
370 \param x Offset on x axis 370 \param x Offset on x axis
371 \param y Offset on y axis 371 \param y Offset on y axis
372 \return Altered matrix */ 372 \return Altered matrix */
373 CMatrix4<T>& setTextureTranslateTransposed( f32 x, f32 y ); 373 CMatrix4<T>& setTextureTranslateTransposed( f32 x, f32 y );
374 374
375 //! Set texture transformation scale 375 //! Set texture transformation scale
376 /** Doesn't clear other elements than those affected. 376 /** Doesn't clear other elements than those affected.
377 \param sx Scale factor on x axis 377 \param sx Scale factor on x axis
378 \param sy Scale factor on y axis 378 \param sy Scale factor on y axis
379 \return Altered matrix. */ 379 \return Altered matrix. */
380 CMatrix4<T>& setTextureScale( f32 sx, f32 sy ); 380 CMatrix4<T>& setTextureScale( f32 sx, f32 sy );
381 381
382 //! Set texture transformation scale, and recenter at (0.5,0.5) 382 //! Set texture transformation scale, and recenter at (0.5,0.5)
383 /** Doesn't clear other elements than those affected. 383 /** Doesn't clear other elements than those affected.
384 \param sx Scale factor on x axis 384 \param sx Scale factor on x axis
385 \param sy Scale factor on y axis 385 \param sy Scale factor on y axis
386 \return Altered matrix. */ 386 \return Altered matrix. */
387 CMatrix4<T>& setTextureScaleCenter( f32 sx, f32 sy ); 387 CMatrix4<T>& setTextureScaleCenter( f32 sx, f32 sy );
388 388
389 //! Sets all matrix data members at once 389 //! Sets all matrix data members at once
390 CMatrix4<T>& setM(const T* data); 390 CMatrix4<T>& setM(const T* data);
391 391
392 //! Sets if the matrix is definitely identity matrix 392 //! Sets if the matrix is definitely identity matrix
393 void setDefinitelyIdentityMatrix( bool isDefinitelyIdentityMatrix); 393 void setDefinitelyIdentityMatrix( bool isDefinitelyIdentityMatrix);
394 394
395 //! Gets if the matrix is definitely identity matrix 395 //! Gets if the matrix is definitely identity matrix
396 bool getDefinitelyIdentityMatrix() const; 396 bool getDefinitelyIdentityMatrix() const;
397 397
398 //! Compare two matrices using the equal method 398 //! Compare two matrices using the equal method
399 bool equals(const core::CMatrix4<T>& other, const T tolerance=(T)ROUNDING_ERROR_f64) const; 399 bool equals(const core::CMatrix4<T>& other, const T tolerance=(T)ROUNDING_ERROR_f64) const;
400 400
401 private: 401 private:
402 //! Matrix data, stored in row-major order 402 //! Matrix data, stored in row-major order
403 T M[16]; 403 T M[16];
404#if defined ( USE_MATRIX_TEST ) 404#if defined ( USE_MATRIX_TEST )
405 //! Flag is this matrix is identity matrix 405 //! Flag is this matrix is identity matrix
406 mutable u32 definitelyIdentityMatrix; 406 mutable u32 definitelyIdentityMatrix;
407#endif 407#endif
408#if defined ( USE_MATRIX_TEST_DEBUG ) 408#if defined ( USE_MATRIX_TEST_DEBUG )
409 u32 id; 409 u32 id;
410 mutable u32 calls; 410 mutable u32 calls;
411#endif 411#endif
412 412
413 }; 413 };
414 414
415 // Default constructor 415 // Default constructor
416 template <class T> 416 template <class T>
417 inline CMatrix4<T>::CMatrix4( eConstructor constructor ) 417 inline CMatrix4<T>::CMatrix4( eConstructor constructor )
418#if defined ( USE_MATRIX_TEST ) 418#if defined ( USE_MATRIX_TEST )
419 : definitelyIdentityMatrix(BIT_UNTESTED) 419 : definitelyIdentityMatrix(BIT_UNTESTED)
420#endif 420#endif
421#if defined ( USE_MATRIX_TEST_DEBUG ) 421#if defined ( USE_MATRIX_TEST_DEBUG )
422 ,id ( MTest.ID++), calls ( 0 ) 422 ,id ( MTest.ID++), calls ( 0 )
423#endif 423#endif
424 { 424 {
425 switch ( constructor ) 425 switch ( constructor )
426 { 426 {
427 case EM4CONST_NOTHING: 427 case EM4CONST_NOTHING:
428 case EM4CONST_COPY: 428 case EM4CONST_COPY:
429 break; 429 break;
430 case EM4CONST_IDENTITY: 430 case EM4CONST_IDENTITY:
431 case EM4CONST_INVERSE: 431 case EM4CONST_INVERSE:
432 default: 432 default:
433 makeIdentity(); 433 makeIdentity();
434 break; 434 break;
435 } 435 }
436 } 436 }
437 437
438 // Copy constructor 438 // Copy constructor
439 template <class T> 439 template <class T>
440 inline CMatrix4<T>::CMatrix4( const CMatrix4<T>& other, eConstructor constructor) 440 inline CMatrix4<T>::CMatrix4( const CMatrix4<T>& other, eConstructor constructor)
441#if defined ( USE_MATRIX_TEST ) 441#if defined ( USE_MATRIX_TEST )
442 : definitelyIdentityMatrix(BIT_UNTESTED) 442 : definitelyIdentityMatrix(BIT_UNTESTED)
443#endif 443#endif
444#if defined ( USE_MATRIX_TEST_DEBUG ) 444#if defined ( USE_MATRIX_TEST_DEBUG )
445 ,id ( MTest.ID++), calls ( 0 ) 445 ,id ( MTest.ID++), calls ( 0 )
446#endif 446#endif
447 { 447 {
448 switch ( constructor ) 448 switch ( constructor )
449 { 449 {
450 case EM4CONST_IDENTITY: 450 case EM4CONST_IDENTITY:
451 makeIdentity(); 451 makeIdentity();
452 break; 452 break;
453 case EM4CONST_NOTHING: 453 case EM4CONST_NOTHING:
454 break; 454 break;
455 case EM4CONST_COPY: 455 case EM4CONST_COPY:
456 *this = other; 456 *this = other;
457 break; 457 break;
458 case EM4CONST_TRANSPOSED: 458 case EM4CONST_TRANSPOSED:
459 other.getTransposed(*this); 459 other.getTransposed(*this);
460 break; 460 break;
461 case EM4CONST_INVERSE: 461 case EM4CONST_INVERSE:
462 if (!other.getInverse(*this)) 462 if (!other.getInverse(*this))
463 memset(M, 0, 16*sizeof(T)); 463 memset(M, 0, 16*sizeof(T));
464 break; 464 break;
465 case EM4CONST_INVERSE_TRANSPOSED: 465 case EM4CONST_INVERSE_TRANSPOSED:
466 if (!other.getInverse(*this)) 466 if (!other.getInverse(*this))
467 memset(M, 0, 16*sizeof(T)); 467 memset(M, 0, 16*sizeof(T));
468 else 468 else
469 *this=getTransposed(); 469 *this=getTransposed();
470 break; 470 break;
471 } 471 }
472 } 472 }
473 473
474 //! Add another matrix. 474 //! Add another matrix.
475 template <class T> 475 template <class T>
476 inline CMatrix4<T> CMatrix4<T>::operator+(const CMatrix4<T>& other) const 476 inline CMatrix4<T> CMatrix4<T>::operator+(const CMatrix4<T>& other) const
477 { 477 {
478 CMatrix4<T> temp ( EM4CONST_NOTHING ); 478 CMatrix4<T> temp ( EM4CONST_NOTHING );
479 479
480 temp[0] = M[0]+other[0]; 480 temp[0] = M[0]+other[0];
481 temp[1] = M[1]+other[1]; 481 temp[1] = M[1]+other[1];
482 temp[2] = M[2]+other[2]; 482 temp[2] = M[2]+other[2];
483 temp[3] = M[3]+other[3]; 483 temp[3] = M[3]+other[3];
484 temp[4] = M[4]+other[4]; 484 temp[4] = M[4]+other[4];
485 temp[5] = M[5]+other[5]; 485 temp[5] = M[5]+other[5];
486 temp[6] = M[6]+other[6]; 486 temp[6] = M[6]+other[6];
487 temp[7] = M[7]+other[7]; 487 temp[7] = M[7]+other[7];
488 temp[8] = M[8]+other[8]; 488 temp[8] = M[8]+other[8];
489 temp[9] = M[9]+other[9]; 489 temp[9] = M[9]+other[9];
490 temp[10] = M[10]+other[10]; 490 temp[10] = M[10]+other[10];
491 temp[11] = M[11]+other[11]; 491 temp[11] = M[11]+other[11];
492 temp[12] = M[12]+other[12]; 492 temp[12] = M[12]+other[12];
493 temp[13] = M[13]+other[13]; 493 temp[13] = M[13]+other[13];
494 temp[14] = M[14]+other[14]; 494 temp[14] = M[14]+other[14];
495 temp[15] = M[15]+other[15]; 495 temp[15] = M[15]+other[15];
496 496
497 return temp; 497 return temp;
498 } 498 }
499 499
500 //! Add another matrix. 500 //! Add another matrix.
501 template <class T> 501 template <class T>
502 inline CMatrix4<T>& CMatrix4<T>::operator+=(const CMatrix4<T>& other) 502 inline CMatrix4<T>& CMatrix4<T>::operator+=(const CMatrix4<T>& other)
503 { 503 {
504 M[0]+=other[0]; 504 M[0]+=other[0];
505 M[1]+=other[1]; 505 M[1]+=other[1];
506 M[2]+=other[2]; 506 M[2]+=other[2];
507 M[3]+=other[3]; 507 M[3]+=other[3];
508 M[4]+=other[4]; 508 M[4]+=other[4];
509 M[5]+=other[5]; 509 M[5]+=other[5];
510 M[6]+=other[6]; 510 M[6]+=other[6];
511 M[7]+=other[7]; 511 M[7]+=other[7];
512 M[8]+=other[8]; 512 M[8]+=other[8];
513 M[9]+=other[9]; 513 M[9]+=other[9];
514 M[10]+=other[10]; 514 M[10]+=other[10];
515 M[11]+=other[11]; 515 M[11]+=other[11];
516 M[12]+=other[12]; 516 M[12]+=other[12];
517 M[13]+=other[13]; 517 M[13]+=other[13];
518 M[14]+=other[14]; 518 M[14]+=other[14];
519 M[15]+=other[15]; 519 M[15]+=other[15];
520 520
521 return *this; 521 return *this;
522 } 522 }
523 523
524 //! Subtract another matrix. 524 //! Subtract another matrix.
525 template <class T> 525 template <class T>
526 inline CMatrix4<T> CMatrix4<T>::operator-(const CMatrix4<T>& other) const 526 inline CMatrix4<T> CMatrix4<T>::operator-(const CMatrix4<T>& other) const
527 { 527 {
528 CMatrix4<T> temp ( EM4CONST_NOTHING ); 528 CMatrix4<T> temp ( EM4CONST_NOTHING );
529 529
530 temp[0] = M[0]-other[0]; 530 temp[0] = M[0]-other[0];
531 temp[1] = M[1]-other[1]; 531 temp[1] = M[1]-other[1];
532 temp[2] = M[2]-other[2]; 532 temp[2] = M[2]-other[2];
533 temp[3] = M[3]-other[3]; 533 temp[3] = M[3]-other[3];
534 temp[4] = M[4]-other[4]; 534 temp[4] = M[4]-other[4];
535 temp[5] = M[5]-other[5]; 535 temp[5] = M[5]-other[5];
536 temp[6] = M[6]-other[6]; 536 temp[6] = M[6]-other[6];
537 temp[7] = M[7]-other[7]; 537 temp[7] = M[7]-other[7];
538 temp[8] = M[8]-other[8]; 538 temp[8] = M[8]-other[8];
539 temp[9] = M[9]-other[9]; 539 temp[9] = M[9]-other[9];
540 temp[10] = M[10]-other[10]; 540 temp[10] = M[10]-other[10];
541 temp[11] = M[11]-other[11]; 541 temp[11] = M[11]-other[11];
542 temp[12] = M[12]-other[12]; 542 temp[12] = M[12]-other[12];
543 temp[13] = M[13]-other[13]; 543 temp[13] = M[13]-other[13];
544 temp[14] = M[14]-other[14]; 544 temp[14] = M[14]-other[14];
545 temp[15] = M[15]-other[15]; 545 temp[15] = M[15]-other[15];
546 546
547 return temp; 547 return temp;
548 } 548 }
549 549
550 //! Subtract another matrix. 550 //! Subtract another matrix.
551 template <class T> 551 template <class T>
552 inline CMatrix4<T>& CMatrix4<T>::operator-=(const CMatrix4<T>& other) 552 inline CMatrix4<T>& CMatrix4<T>::operator-=(const CMatrix4<T>& other)
553 { 553 {
554 M[0]-=other[0]; 554 M[0]-=other[0];
555 M[1]-=other[1]; 555 M[1]-=other[1];
556 M[2]-=other[2]; 556 M[2]-=other[2];
557 M[3]-=other[3]; 557 M[3]-=other[3];
558 M[4]-=other[4]; 558 M[4]-=other[4];
559 M[5]-=other[5]; 559 M[5]-=other[5];
560 M[6]-=other[6]; 560 M[6]-=other[6];
561 M[7]-=other[7]; 561 M[7]-=other[7];
562 M[8]-=other[8]; 562 M[8]-=other[8];
563 M[9]-=other[9]; 563 M[9]-=other[9];
564 M[10]-=other[10]; 564 M[10]-=other[10];
565 M[11]-=other[11]; 565 M[11]-=other[11];
566 M[12]-=other[12]; 566 M[12]-=other[12];
567 M[13]-=other[13]; 567 M[13]-=other[13];
568 M[14]-=other[14]; 568 M[14]-=other[14];
569 M[15]-=other[15]; 569 M[15]-=other[15];
570 570
571 return *this; 571 return *this;
572 } 572 }
573 573
574 //! Multiply by scalar. 574 //! Multiply by scalar.
575 template <class T> 575 template <class T>
576 inline CMatrix4<T> CMatrix4<T>::operator*(const T& scalar) const 576 inline CMatrix4<T> CMatrix4<T>::operator*(const T& scalar) const
577 { 577 {
578 CMatrix4<T> temp ( EM4CONST_NOTHING ); 578 CMatrix4<T> temp ( EM4CONST_NOTHING );
579 579
580 temp[0] = M[0]*scalar; 580 temp[0] = M[0]*scalar;
581 temp[1] = M[1]*scalar; 581 temp[1] = M[1]*scalar;
582 temp[2] = M[2]*scalar; 582 temp[2] = M[2]*scalar;
583 temp[3] = M[3]*scalar; 583 temp[3] = M[3]*scalar;
584 temp[4] = M[4]*scalar; 584 temp[4] = M[4]*scalar;
585 temp[5] = M[5]*scalar; 585 temp[5] = M[5]*scalar;
586 temp[6] = M[6]*scalar; 586 temp[6] = M[6]*scalar;
587 temp[7] = M[7]*scalar; 587 temp[7] = M[7]*scalar;
588 temp[8] = M[8]*scalar; 588 temp[8] = M[8]*scalar;
589 temp[9] = M[9]*scalar; 589 temp[9] = M[9]*scalar;
590 temp[10] = M[10]*scalar; 590 temp[10] = M[10]*scalar;
591 temp[11] = M[11]*scalar; 591 temp[11] = M[11]*scalar;
592 temp[12] = M[12]*scalar; 592 temp[12] = M[12]*scalar;
593 temp[13] = M[13]*scalar; 593 temp[13] = M[13]*scalar;
594 temp[14] = M[14]*scalar; 594 temp[14] = M[14]*scalar;
595 temp[15] = M[15]*scalar; 595 temp[15] = M[15]*scalar;
596 596
597 return temp; 597 return temp;
598 } 598 }
599 599
600 //! Multiply by scalar. 600 //! Multiply by scalar.
601 template <class T> 601 template <class T>
602 inline CMatrix4<T>& CMatrix4<T>::operator*=(const T& scalar) 602 inline CMatrix4<T>& CMatrix4<T>::operator*=(const T& scalar)
603 { 603 {
604 M[0]*=scalar; 604 M[0]*=scalar;
605 M[1]*=scalar; 605 M[1]*=scalar;
606 M[2]*=scalar; 606 M[2]*=scalar;
607 M[3]*=scalar; 607 M[3]*=scalar;
608 M[4]*=scalar; 608 M[4]*=scalar;
609 M[5]*=scalar; 609 M[5]*=scalar;
610 M[6]*=scalar; 610 M[6]*=scalar;
611 M[7]*=scalar; 611 M[7]*=scalar;
612 M[8]*=scalar; 612 M[8]*=scalar;
613 M[9]*=scalar; 613 M[9]*=scalar;
614 M[10]*=scalar; 614 M[10]*=scalar;
615 M[11]*=scalar; 615 M[11]*=scalar;
616 M[12]*=scalar; 616 M[12]*=scalar;
617 M[13]*=scalar; 617 M[13]*=scalar;
618 M[14]*=scalar; 618 M[14]*=scalar;
619 M[15]*=scalar; 619 M[15]*=scalar;
620 620
621 return *this; 621 return *this;
622 } 622 }
623 623
624 //! Multiply by another matrix. 624 //! Multiply by another matrix.
625 template <class T> 625 template <class T>
626 inline CMatrix4<T>& CMatrix4<T>::operator*=(const CMatrix4<T>& other) 626 inline CMatrix4<T>& CMatrix4<T>::operator*=(const CMatrix4<T>& other)
627 { 627 {
628#if defined ( USE_MATRIX_TEST ) 628#if defined ( USE_MATRIX_TEST )
629 // do checks on your own in order to avoid copy creation 629 // do checks on your own in order to avoid copy creation
630 if ( !other.isIdentity() ) 630 if ( !other.isIdentity() )
631 { 631 {
632 if ( this->isIdentity() ) 632 if ( this->isIdentity() )
633 { 633 {
634 return (*this = other); 634 return (*this = other);
635 } 635 }
636 else 636 else
637 { 637 {
638 CMatrix4<T> temp ( *this ); 638 CMatrix4<T> temp ( *this );
639 return setbyproduct_nocheck( temp, other ); 639 return setbyproduct_nocheck( temp, other );
640 } 640 }
641 } 641 }
642 return *this; 642 return *this;
643#else 643#else
644 CMatrix4<T> temp ( *this ); 644 CMatrix4<T> temp ( *this );
645 return setbyproduct_nocheck( temp, other ); 645 return setbyproduct_nocheck( temp, other );
646#endif 646#endif
647 } 647 }
648 648
649 //! multiply by another matrix 649 //! multiply by another matrix
650 // set this matrix to the product of two other matrices 650 // set this matrix to the product of two other matrices
651 // goal is to reduce stack use and copy 651 // goal is to reduce stack use and copy
652 template <class T> 652 template <class T>
653 inline CMatrix4<T>& CMatrix4<T>::setbyproduct_nocheck(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b ) 653 inline CMatrix4<T>& CMatrix4<T>::setbyproduct_nocheck(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b )
654 { 654 {
655 const T *m1 = other_a.M; 655 const T *m1 = other_a.M;
656 const T *m2 = other_b.M; 656 const T *m2 = other_b.M;
657 657
658 M[0] = m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3]; 658 M[0] = m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3];
659 M[1] = m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3]; 659 M[1] = m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3];
660 M[2] = m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3]; 660 M[2] = m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3];
661 M[3] = m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3]; 661 M[3] = m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3];
662 662
663 M[4] = m1[0]*m2[4] + m1[4]*m2[5] + m1[8]*m2[6] + m1[12]*m2[7]; 663 M[4] = m1[0]*m2[4] + m1[4]*m2[5] + m1[8]*m2[6] + m1[12]*m2[7];
664 M[5] = m1[1]*m2[4] + m1[5]*m2[5] + m1[9]*m2[6] + m1[13]*m2[7]; 664 M[5] = m1[1]*m2[4] + m1[5]*m2[5] + m1[9]*m2[6] + m1[13]*m2[7];
665 M[6] = m1[2]*m2[4] + m1[6]*m2[5] + m1[10]*m2[6] + m1[14]*m2[7]; 665 M[6] = m1[2]*m2[4] + m1[6]*m2[5] + m1[10]*m2[6] + m1[14]*m2[7];
666 M[7] = m1[3]*m2[4] + m1[7]*m2[5] + m1[11]*m2[6] + m1[15]*m2[7]; 666 M[7] = m1[3]*m2[4] + m1[7]*m2[5] + m1[11]*m2[6] + m1[15]*m2[7];
667 667
668 M[8] = m1[0]*m2[8] + m1[4]*m2[9] + m1[8]*m2[10] + m1[12]*m2[11]; 668 M[8] = m1[0]*m2[8] + m1[4]*m2[9] + m1[8]*m2[10] + m1[12]*m2[11];
669 M[9] = m1[1]*m2[8] + m1[5]*m2[9] + m1[9]*m2[10] + m1[13]*m2[11]; 669 M[9] = m1[1]*m2[8] + m1[5]*m2[9] + m1[9]*m2[10] + m1[13]*m2[11];
670 M[10] = m1[2]*m2[8] + m1[6]*m2[9] + m1[10]*m2[10] + m1[14]*m2[11]; 670 M[10] = m1[2]*m2[8] + m1[6]*m2[9] + m1[10]*m2[10] + m1[14]*m2[11];
671 M[11] = m1[3]*m2[8] + m1[7]*m2[9] + m1[11]*m2[10] + m1[15]*m2[11]; 671 M[11] = m1[3]*m2[8] + m1[7]*m2[9] + m1[11]*m2[10] + m1[15]*m2[11];
672 672
673 M[12] = m1[0]*m2[12] + m1[4]*m2[13] + m1[8]*m2[14] + m1[12]*m2[15]; 673 M[12] = m1[0]*m2[12] + m1[4]*m2[13] + m1[8]*m2[14] + m1[12]*m2[15];
674 M[13] = m1[1]*m2[12] + m1[5]*m2[13] + m1[9]*m2[14] + m1[13]*m2[15]; 674 M[13] = m1[1]*m2[12] + m1[5]*m2[13] + m1[9]*m2[14] + m1[13]*m2[15];
675 M[14] = m1[2]*m2[12] + m1[6]*m2[13] + m1[10]*m2[14] + m1[14]*m2[15]; 675 M[14] = m1[2]*m2[12] + m1[6]*m2[13] + m1[10]*m2[14] + m1[14]*m2[15];
676 M[15] = m1[3]*m2[12] + m1[7]*m2[13] + m1[11]*m2[14] + m1[15]*m2[15]; 676 M[15] = m1[3]*m2[12] + m1[7]*m2[13] + m1[11]*m2[14] + m1[15]*m2[15];
677#if defined ( USE_MATRIX_TEST ) 677#if defined ( USE_MATRIX_TEST )
678 definitelyIdentityMatrix=false; 678 definitelyIdentityMatrix=false;
679#endif 679#endif
680 return *this; 680 return *this;
681 } 681 }
682 682
683 683
684 //! multiply by another matrix 684 //! multiply by another matrix
685 // set this matrix to the product of two other matrices 685 // set this matrix to the product of two other matrices
686 // goal is to reduce stack use and copy 686 // goal is to reduce stack use and copy
687 template <class T> 687 template <class T>
688 inline CMatrix4<T>& CMatrix4<T>::setbyproduct(const CMatrix4<T>& other_a, const CMatrix4<T>& other_b ) 688 inline CMatrix4<T>& CMatrix4<T>::setbyproduct(const CMatrix4<T>& other_a, const CMatrix4<T>& other_b )
689 { 689 {
690#if defined ( USE_MATRIX_TEST ) 690#if defined ( USE_MATRIX_TEST )
691 if ( other_a.isIdentity () ) 691 if ( other_a.isIdentity () )
692 return (*this = other_b); 692 return (*this = other_b);
693 else 693 else
694 if ( other_b.isIdentity () ) 694 if ( other_b.isIdentity () )
695 return (*this = other_a); 695 return (*this = other_a);
696 else 696 else
697 return setbyproduct_nocheck(other_a,other_b); 697 return setbyproduct_nocheck(other_a,other_b);
698#else 698#else
699 return setbyproduct_nocheck(other_a,other_b); 699 return setbyproduct_nocheck(other_a,other_b);
700#endif 700#endif
701 } 701 }
702 702
703 //! multiply by another matrix 703 //! multiply by another matrix
704 template <class T> 704 template <class T>
705 inline CMatrix4<T> CMatrix4<T>::operator*(const CMatrix4<T>& m2) const 705 inline CMatrix4<T> CMatrix4<T>::operator*(const CMatrix4<T>& m2) const
706 { 706 {
707#if defined ( USE_MATRIX_TEST ) 707#if defined ( USE_MATRIX_TEST )
708 // Testing purpose.. 708 // Testing purpose..
709 if ( this->isIdentity() ) 709 if ( this->isIdentity() )
710 return m2; 710 return m2;
711 if ( m2.isIdentity() ) 711 if ( m2.isIdentity() )
712 return *this; 712 return *this;
713#endif 713#endif
714 714
715 CMatrix4<T> m3 ( EM4CONST_NOTHING ); 715 CMatrix4<T> m3 ( EM4CONST_NOTHING );
716 716
717 const T *m1 = M; 717 const T *m1 = M;
718 718
719 m3[0] = m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3]; 719 m3[0] = m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2] + m1[12]*m2[3];
720 m3[1] = m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3]; 720 m3[1] = m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2] + m1[13]*m2[3];
721 m3[2] = m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3]; 721 m3[2] = m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2] + m1[14]*m2[3];
722 m3[3] = m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3]; 722 m3[3] = m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2] + m1[15]*m2[3];
723 723
724 m3[4] = m1[0]*m2[4] + m1[4]*m2[5] + m1[8]*m2[6] + m1[12]*m2[7]; 724 m3[4] = m1[0]*m2[4] + m1[4]*m2[5] + m1[8]*m2[6] + m1[12]*m2[7];
725 m3[5] = m1[1]*m2[4] + m1[5]*m2[5] + m1[9]*m2[6] + m1[13]*m2[7]; 725 m3[5] = m1[1]*m2[4] + m1[5]*m2[5] + m1[9]*m2[6] + m1[13]*m2[7];
726 m3[6] = m1[2]*m2[4] + m1[6]*m2[5] + m1[10]*m2[6] + m1[14]*m2[7]; 726 m3[6] = m1[2]*m2[4] + m1[6]*m2[5] + m1[10]*m2[6] + m1[14]*m2[7];
727 m3[7] = m1[3]*m2[4] + m1[7]*m2[5] + m1[11]*m2[6] + m1[15]*m2[7]; 727 m3[7] = m1[3]*m2[4] + m1[7]*m2[5] + m1[11]*m2[6] + m1[15]*m2[7];
728 728
729 m3[8] = m1[0]*m2[8] + m1[4]*m2[9] + m1[8]*m2[10] + m1[12]*m2[11]; 729 m3[8] = m1[0]*m2[8] + m1[4]*m2[9] + m1[8]*m2[10] + m1[12]*m2[11];
730 m3[9] = m1[1]*m2[8] + m1[5]*m2[9] + m1[9]*m2[10] + m1[13]*m2[11]; 730 m3[9] = m1[1]*m2[8] + m1[5]*m2[9] + m1[9]*m2[10] + m1[13]*m2[11];
731 m3[10] = m1[2]*m2[8] + m1[6]*m2[9] + m1[10]*m2[10] + m1[14]*m2[11]; 731 m3[10] = m1[2]*m2[8] + m1[6]*m2[9] + m1[10]*m2[10] + m1[14]*m2[11];
732 m3[11] = m1[3]*m2[8] + m1[7]*m2[9] + m1[11]*m2[10] + m1[15]*m2[11]; 732 m3[11] = m1[3]*m2[8] + m1[7]*m2[9] + m1[11]*m2[10] + m1[15]*m2[11];
733 733
734 m3[12] = m1[0]*m2[12] + m1[4]*m2[13] + m1[8]*m2[14] + m1[12]*m2[15]; 734 m3[12] = m1[0]*m2[12] + m1[4]*m2[13] + m1[8]*m2[14] + m1[12]*m2[15];
735 m3[13] = m1[1]*m2[12] + m1[5]*m2[13] + m1[9]*m2[14] + m1[13]*m2[15]; 735 m3[13] = m1[1]*m2[12] + m1[5]*m2[13] + m1[9]*m2[14] + m1[13]*m2[15];
736 m3[14] = m1[2]*m2[12] + m1[6]*m2[13] + m1[10]*m2[14] + m1[14]*m2[15]; 736 m3[14] = m1[2]*m2[12] + m1[6]*m2[13] + m1[10]*m2[14] + m1[14]*m2[15];
737 m3[15] = m1[3]*m2[12] + m1[7]*m2[13] + m1[11]*m2[14] + m1[15]*m2[15]; 737 m3[15] = m1[3]*m2[12] + m1[7]*m2[13] + m1[11]*m2[14] + m1[15]*m2[15];
738 return m3; 738 return m3;
739 } 739 }
740 740
741 741
742 742
743 template <class T> 743 template <class T>
744 inline vector3d<T> CMatrix4<T>::getTranslation() const 744 inline vector3d<T> CMatrix4<T>::getTranslation() const
745 { 745 {
746 return vector3d<T>(M[12], M[13], M[14]); 746 return vector3d<T>(M[12], M[13], M[14]);
747 } 747 }
748 748
749 749
750 template <class T> 750 template <class T>
751 inline CMatrix4<T>& CMatrix4<T>::setTranslation( const vector3d<T>& translation ) 751 inline CMatrix4<T>& CMatrix4<T>::setTranslation( const vector3d<T>& translation )
752 { 752 {
753 M[12] = translation.X; 753 M[12] = translation.X;
754 M[13] = translation.Y; 754 M[13] = translation.Y;
755 M[14] = translation.Z; 755 M[14] = translation.Z;
756#if defined ( USE_MATRIX_TEST ) 756#if defined ( USE_MATRIX_TEST )
757 definitelyIdentityMatrix=false; 757 definitelyIdentityMatrix=false;
758#endif 758#endif
759 return *this; 759 return *this;
760 } 760 }
761 761
762 template <class T> 762 template <class T>
763 inline CMatrix4<T>& CMatrix4<T>::setInverseTranslation( const vector3d<T>& translation ) 763 inline CMatrix4<T>& CMatrix4<T>::setInverseTranslation( const vector3d<T>& translation )
764 { 764 {
765 M[12] = -translation.X; 765 M[12] = -translation.X;
766 M[13] = -translation.Y; 766 M[13] = -translation.Y;
767 M[14] = -translation.Z; 767 M[14] = -translation.Z;
768#if defined ( USE_MATRIX_TEST ) 768#if defined ( USE_MATRIX_TEST )
769 definitelyIdentityMatrix=false; 769 definitelyIdentityMatrix=false;
770#endif 770#endif
771 return *this; 771 return *this;
772 } 772 }
773 773
774 template <class T> 774 template <class T>
775 inline CMatrix4<T>& CMatrix4<T>::setScale( const vector3d<T>& scale ) 775 inline CMatrix4<T>& CMatrix4<T>::setScale( const vector3d<T>& scale )
776 { 776 {
777 M[0] = scale.X; 777 M[0] = scale.X;
778 M[5] = scale.Y; 778 M[5] = scale.Y;
779 M[10] = scale.Z; 779 M[10] = scale.Z;
780#if defined ( USE_MATRIX_TEST ) 780#if defined ( USE_MATRIX_TEST )
781 definitelyIdentityMatrix=false; 781 definitelyIdentityMatrix=false;
782#endif 782#endif
783 return *this; 783 return *this;
784 } 784 }
785 785
786 //! Returns the absolute values of the scales of the matrix. 786 //! Returns the absolute values of the scales of the matrix.
787 /** 787 /**
788 Note that this returns the absolute (positive) values unless only scale is set. 788 Note that this returns the absolute (positive) values unless only scale is set.
789 Unfortunately it does not appear to be possible to extract any original negative 789 Unfortunately it does not appear to be possible to extract any original negative
790 values. The best that we could do would be to arbitrarily make one scale 790 values. The best that we could do would be to arbitrarily make one scale
791 negative if one or three of them were negative. 791 negative if one or three of them were negative.
792 FIXME - return the original values. 792 FIXME - return the original values.
793 */ 793 */
794 template <class T> 794 template <class T>
795 inline vector3d<T> CMatrix4<T>::getScale() const 795 inline vector3d<T> CMatrix4<T>::getScale() const
796 { 796 {
797 // See http://www.robertblum.com/articles/2005/02/14/decomposing-matrices 797 // See http://www.robertblum.com/articles/2005/02/14/decomposing-matrices
798 798
799 // Deal with the 0 rotation case first 799 // Deal with the 0 rotation case first
800 // Prior to Irrlicht 1.6, we always returned this value. 800 // Prior to Irrlicht 1.6, we always returned this value.
801 if(core::iszero(M[1]) && core::iszero(M[2]) && 801 if(core::iszero(M[1]) && core::iszero(M[2]) &&
802 core::iszero(M[4]) && core::iszero(M[6]) && 802 core::iszero(M[4]) && core::iszero(M[6]) &&
803 core::iszero(M[8]) && core::iszero(M[9])) 803 core::iszero(M[8]) && core::iszero(M[9]))
804 return vector3d<T>(M[0], M[5], M[10]); 804 return vector3d<T>(M[0], M[5], M[10]);
805 805
806 // We have to do the full calculation. 806 // We have to do the full calculation.
807 return vector3d<T>(sqrtf(M[0] * M[0] + M[1] * M[1] + M[2] * M[2]), 807 return vector3d<T>(sqrtf(M[0] * M[0] + M[1] * M[1] + M[2] * M[2]),
808 sqrtf(M[4] * M[4] + M[5] * M[5] + M[6] * M[6]), 808 sqrtf(M[4] * M[4] + M[5] * M[5] + M[6] * M[6]),
809 sqrtf(M[8] * M[8] + M[9] * M[9] + M[10] * M[10])); 809 sqrtf(M[8] * M[8] + M[9] * M[9] + M[10] * M[10]));
810 } 810 }
811 811
812 template <class T> 812 template <class T>
813 inline CMatrix4<T>& CMatrix4<T>::setRotationDegrees( const vector3d<T>& rotation ) 813 inline CMatrix4<T>& CMatrix4<T>::setRotationDegrees( const vector3d<T>& rotation )
814 { 814 {
815 return setRotationRadians( rotation * core::DEGTORAD ); 815 return setRotationRadians( rotation * core::DEGTORAD );
816 } 816 }
817 817
818 template <class T> 818 template <class T>
819 inline CMatrix4<T>& CMatrix4<T>::setInverseRotationDegrees( const vector3d<T>& rotation ) 819 inline CMatrix4<T>& CMatrix4<T>::setInverseRotationDegrees( const vector3d<T>& rotation )
820 { 820 {
821 return setInverseRotationRadians( rotation * core::DEGTORAD ); 821 return setInverseRotationRadians( rotation * core::DEGTORAD );
822 } 822 }
823 823
824 template <class T> 824 template <class T>
825 inline CMatrix4<T>& CMatrix4<T>::setRotationRadians( const vector3d<T>& rotation ) 825 inline CMatrix4<T>& CMatrix4<T>::setRotationRadians( const vector3d<T>& rotation )
826 { 826 {
827 const f64 cr = cos( rotation.X ); 827 const f64 cr = cos( rotation.X );
828 const f64 sr = sin( rotation.X ); 828 const f64 sr = sin( rotation.X );
829 const f64 cp = cos( rotation.Y ); 829 const f64 cp = cos( rotation.Y );
830 const f64 sp = sin( rotation.Y ); 830 const f64 sp = sin( rotation.Y );
831 const f64 cy = cos( rotation.Z ); 831 const f64 cy = cos( rotation.Z );
832 const f64 sy = sin( rotation.Z ); 832 const f64 sy = sin( rotation.Z );
833 833
834 M[0] = (T)( cp*cy ); 834 M[0] = (T)( cp*cy );
835 M[1] = (T)( cp*sy ); 835 M[1] = (T)( cp*sy );
836 M[2] = (T)( -sp ); 836 M[2] = (T)( -sp );
837 837
838 const f64 srsp = sr*sp; 838 const f64 srsp = sr*sp;
839 const f64 crsp = cr*sp; 839 const f64 crsp = cr*sp;
840 840
841 M[4] = (T)( srsp*cy-cr*sy ); 841 M[4] = (T)( srsp*cy-cr*sy );
842 M[5] = (T)( srsp*sy+cr*cy ); 842 M[5] = (T)( srsp*sy+cr*cy );
843 M[6] = (T)( sr*cp ); 843 M[6] = (T)( sr*cp );
844 844
845 M[8] = (T)( crsp*cy+sr*sy ); 845 M[8] = (T)( crsp*cy+sr*sy );
846 M[9] = (T)( crsp*sy-sr*cy ); 846 M[9] = (T)( crsp*sy-sr*cy );
847 M[10] = (T)( cr*cp ); 847 M[10] = (T)( cr*cp );
848#if defined ( USE_MATRIX_TEST ) 848#if defined ( USE_MATRIX_TEST )
849 definitelyIdentityMatrix=false; 849 definitelyIdentityMatrix=false;
850#endif 850#endif
851 return *this; 851 return *this;
852 } 852 }
853 853
854 854
855 //! Returns a rotation that is equivalent to that set by setRotationDegrees(). 855 //! Returns a rotation that is equivalent to that set by setRotationDegrees().
856 /** This code was sent in by Chev. Note that it does not necessarily return 856 /** This code was sent in by Chev. Note that it does not necessarily return
857 the *same* Euler angles as those set by setRotationDegrees(), but the rotation will 857 the *same* Euler angles as those set by setRotationDegrees(), but the rotation will
858 be equivalent, i.e. will have the same result when used to rotate a vector or node. */ 858 be equivalent, i.e. will have the same result when used to rotate a vector or node. */
859 template <class T> 859 template <class T>
860 inline core::vector3d<T> CMatrix4<T>::getRotationDegrees() const 860 inline core::vector3d<T> CMatrix4<T>::getRotationDegrees() const
861 { 861 {
862 const CMatrix4<T> &mat = *this; 862 const CMatrix4<T> &mat = *this;
863 core::vector3d<T> scale = getScale(); 863 core::vector3d<T> scale = getScale();
864 // we need to check for negative scale on to axes, which would bring up wrong results 864 // we need to check for negative scale on to axes, which would bring up wrong results
865 if (scale.Y<0 && scale.Z<0) 865 if (scale.Y<0 && scale.Z<0)
866 { 866 {
867 scale.Y =-scale.Y; 867 scale.Y =-scale.Y;
868 scale.Z =-scale.Z; 868 scale.Z =-scale.Z;
869 } 869 }
870 else if (scale.X<0 && scale.Z<0) 870 else if (scale.X<0 && scale.Z<0)
871 { 871 {
872 scale.X =-scale.X; 872 scale.X =-scale.X;
873 scale.Z =-scale.Z; 873 scale.Z =-scale.Z;
874 } 874 }
875 else if (scale.X<0 && scale.Y<0) 875 else if (scale.X<0 && scale.Y<0)
876 { 876 {
877 scale.X =-scale.X; 877 scale.X =-scale.X;
878 scale.Y =-scale.Y; 878 scale.Y =-scale.Y;
879 } 879 }
880 const core::vector3d<f64> invScale(core::reciprocal(scale.X),core::reciprocal(scale.Y),core::reciprocal(scale.Z)); 880 const core::vector3d<f64> invScale(core::reciprocal(scale.X),core::reciprocal(scale.Y),core::reciprocal(scale.Z));
881 881
882 f64 Y = -asin(core::clamp(mat[2]*invScale.X, -1.0, 1.0)); 882 f64 Y = -asin(core::clamp(mat[2]*invScale.X, -1.0, 1.0));
883 const f64 C = cos(Y); 883 const f64 C = cos(Y);
884 Y *= RADTODEG64; 884 Y *= RADTODEG64;
885 885
886 f64 rotx, roty, X, Z; 886 f64 rotx, roty, X, Z;
887 887
888 if (!core::iszero(C)) 888 if (!core::iszero(C))
889 { 889 {
890 const f64 invC = core::reciprocal(C); 890 const f64 invC = core::reciprocal(C);
891 rotx = mat[10] * invC * invScale.Z; 891 rotx = mat[10] * invC * invScale.Z;
892 roty = mat[6] * invC * invScale.Y; 892 roty = mat[6] * invC * invScale.Y;
893 X = atan2( roty, rotx ) * RADTODEG64; 893 X = atan2( roty, rotx ) * RADTODEG64;
894 rotx = mat[0] * invC * invScale.X; 894 rotx = mat[0] * invC * invScale.X;
895 roty = mat[1] * invC * invScale.X; 895 roty = mat[1] * invC * invScale.X;
896 Z = atan2( roty, rotx ) * RADTODEG64; 896 Z = atan2( roty, rotx ) * RADTODEG64;
897 } 897 }
898 else 898 else
899 { 899 {
900 X = 0.0; 900 X = 0.0;
901 rotx = mat[5] * invScale.Y; 901 rotx = mat[5] * invScale.Y;
902 roty = -mat[4] * invScale.Y; 902 roty = -mat[4] * invScale.Y;
903 Z = atan2( roty, rotx ) * RADTODEG64; 903 Z = atan2( roty, rotx ) * RADTODEG64;
904 } 904 }
905 905
906 // fix values that get below zero 906 // fix values that get below zero
907 if (X < 0.0) X += 360.0; 907 if (X < 0.0) X += 360.0;
908 if (Y < 0.0) Y += 360.0; 908 if (Y < 0.0) Y += 360.0;
909 if (Z < 0.0) Z += 360.0; 909 if (Z < 0.0) Z += 360.0;
910 910
911 return vector3d<T>((T)X,(T)Y,(T)Z); 911 return vector3d<T>((T)X,(T)Y,(T)Z);
912 } 912 }
913 913
914 914
915 //! Sets matrix to rotation matrix of inverse angles given as parameters 915 //! Sets matrix to rotation matrix of inverse angles given as parameters
916 template <class T> 916 template <class T>
917 inline CMatrix4<T>& CMatrix4<T>::setInverseRotationRadians( const vector3d<T>& rotation ) 917 inline CMatrix4<T>& CMatrix4<T>::setInverseRotationRadians( const vector3d<T>& rotation )
918 { 918 {
919 f64 cr = cos( rotation.X ); 919 f64 cr = cos( rotation.X );
920 f64 sr = sin( rotation.X ); 920 f64 sr = sin( rotation.X );
921 f64 cp = cos( rotation.Y ); 921 f64 cp = cos( rotation.Y );
922 f64 sp = sin( rotation.Y ); 922 f64 sp = sin( rotation.Y );
923 f64 cy = cos( rotation.Z ); 923 f64 cy = cos( rotation.Z );
924 f64 sy = sin( rotation.Z ); 924 f64 sy = sin( rotation.Z );
925 925
926 M[0] = (T)( cp*cy ); 926 M[0] = (T)( cp*cy );
927 M[4] = (T)( cp*sy ); 927 M[4] = (T)( cp*sy );
928 M[8] = (T)( -sp ); 928 M[8] = (T)( -sp );
929 929
930 f64 srsp = sr*sp; 930 f64 srsp = sr*sp;
931 f64 crsp = cr*sp; 931 f64 crsp = cr*sp;
932 932
933 M[1] = (T)( srsp*cy-cr*sy ); 933 M[1] = (T)( srsp*cy-cr*sy );
934 M[5] = (T)( srsp*sy+cr*cy ); 934 M[5] = (T)( srsp*sy+cr*cy );
935 M[9] = (T)( sr*cp ); 935 M[9] = (T)( sr*cp );
936 936
937 M[2] = (T)( crsp*cy+sr*sy ); 937 M[2] = (T)( crsp*cy+sr*sy );
938 M[6] = (T)( crsp*sy-sr*cy ); 938 M[6] = (T)( crsp*sy-sr*cy );
939 M[10] = (T)( cr*cp ); 939 M[10] = (T)( cr*cp );
940#if defined ( USE_MATRIX_TEST ) 940#if defined ( USE_MATRIX_TEST )
941 definitelyIdentityMatrix=false; 941 definitelyIdentityMatrix=false;
942#endif 942#endif
943 return *this; 943 return *this;
944 } 944 }
945 945
946 //! Sets matrix to rotation matrix defined by axis and angle, assuming LH rotation 946 //! Sets matrix to rotation matrix defined by axis and angle, assuming LH rotation
947 template <class T> 947 template <class T>
948 inline CMatrix4<T>& CMatrix4<T>::setRotationAxisRadians( const T& angle, const vector3d<T>& axis ) 948 inline CMatrix4<T>& CMatrix4<T>::setRotationAxisRadians( const T& angle, const vector3d<T>& axis )
949 { 949 {
950 const f64 c = cos(angle); 950 const f64 c = cos(angle);
951 const f64 s = sin(angle); 951 const f64 s = sin(angle);
952 const f64 t = 1.0 - c; 952 const f64 t = 1.0 - c;
953 953
954 const f64 tx = t * axis.X; 954 const f64 tx = t * axis.X;
955 const f64 ty = t * axis.Y; 955 const f64 ty = t * axis.Y;
956 const f64 tz = t * axis.Z; 956 const f64 tz = t * axis.Z;
957 957
958 const f64 sx = s * axis.X; 958 const f64 sx = s * axis.X;
959 const f64 sy = s * axis.Y; 959 const f64 sy = s * axis.Y;
960 const f64 sz = s * axis.Z; 960 const f64 sz = s * axis.Z;
961 961
962 M[0] = (T)(tx * axis.X + c); 962 M[0] = (T)(tx * axis.X + c);
963 M[1] = (T)(tx * axis.Y + sz); 963 M[1] = (T)(tx * axis.Y + sz);
964 M[2] = (T)(tx * axis.Z - sy); 964 M[2] = (T)(tx * axis.Z - sy);
965 965
966 M[4] = (T)(ty * axis.X - sz); 966 M[4] = (T)(ty * axis.X - sz);
967 M[5] = (T)(ty * axis.Y + c); 967 M[5] = (T)(ty * axis.Y + c);
968 M[6] = (T)(ty * axis.Z + sx); 968 M[6] = (T)(ty * axis.Z + sx);
969 969
970 M[8] = (T)(tz * axis.X + sy); 970 M[8] = (T)(tz * axis.X + sy);
971 M[9] = (T)(tz * axis.Y - sx); 971 M[9] = (T)(tz * axis.Y - sx);
972 M[10] = (T)(tz * axis.Z + c); 972 M[10] = (T)(tz * axis.Z + c);
973 973
974#if defined ( USE_MATRIX_TEST ) 974#if defined ( USE_MATRIX_TEST )
975 definitelyIdentityMatrix=false; 975 definitelyIdentityMatrix=false;
976#endif 976#endif
977 return *this; 977 return *this;
978 } 978 }
979 979
980 980
981 /*! 981 /*!
982 */ 982 */
983 template <class T> 983 template <class T>
984 inline CMatrix4<T>& CMatrix4<T>::makeIdentity() 984 inline CMatrix4<T>& CMatrix4<T>::makeIdentity()
985 { 985 {
986 memset(M, 0, 16*sizeof(T)); 986 memset(M, 0, 16*sizeof(T));
987 M[0] = M[5] = M[10] = M[15] = (T)1; 987 M[0] = M[5] = M[10] = M[15] = (T)1;
988#if defined ( USE_MATRIX_TEST ) 988#if defined ( USE_MATRIX_TEST )
989 definitelyIdentityMatrix=true; 989 definitelyIdentityMatrix=true;
990#endif 990#endif
991 return *this; 991 return *this;
992 } 992 }
993 993
994 994
995 /* 995 /*
996 check identity with epsilon 996 check identity with epsilon
997 solve floating range problems.. 997 solve floating range problems..
998 */ 998 */
999 template <class T> 999 template <class T>
1000 inline bool CMatrix4<T>::isIdentity() const 1000 inline bool CMatrix4<T>::isIdentity() const
1001 { 1001 {
1002#if defined ( USE_MATRIX_TEST ) 1002#if defined ( USE_MATRIX_TEST )
1003 if (definitelyIdentityMatrix) 1003 if (definitelyIdentityMatrix)
1004 return true; 1004 return true;
1005#endif 1005#endif
1006 if (!core::equals( M[12], (T)0 ) || !core::equals( M[13], (T)0 ) || !core::equals( M[14], (T)0 ) || !core::equals( M[15], (T)1 )) 1006 if (!core::equals( M[12], (T)0 ) || !core::equals( M[13], (T)0 ) || !core::equals( M[14], (T)0 ) || !core::equals( M[15], (T)1 ))
1007 return false; 1007 return false;
1008 1008
1009 if (!core::equals( M[ 0], (T)1 ) || !core::equals( M[ 1], (T)0 ) || !core::equals( M[ 2], (T)0 ) || !core::equals( M[ 3], (T)0 )) 1009 if (!core::equals( M[ 0], (T)1 ) || !core::equals( M[ 1], (T)0 ) || !core::equals( M[ 2], (T)0 ) || !core::equals( M[ 3], (T)0 ))
1010 return false; 1010 return false;
1011 1011
1012 if (!core::equals( M[ 4], (T)0 ) || !core::equals( M[ 5], (T)1 ) || !core::equals( M[ 6], (T)0 ) || !core::equals( M[ 7], (T)0 )) 1012 if (!core::equals( M[ 4], (T)0 ) || !core::equals( M[ 5], (T)1 ) || !core::equals( M[ 6], (T)0 ) || !core::equals( M[ 7], (T)0 ))
1013 return false; 1013 return false;
1014 1014
1015 if (!core::equals( M[ 8], (T)0 ) || !core::equals( M[ 9], (T)0 ) || !core::equals( M[10], (T)1 ) || !core::equals( M[11], (T)0 )) 1015 if (!core::equals( M[ 8], (T)0 ) || !core::equals( M[ 9], (T)0 ) || !core::equals( M[10], (T)1 ) || !core::equals( M[11], (T)0 ))
1016 return false; 1016 return false;
1017/* 1017/*
1018 if (!core::equals( M[ 0], (T)1 ) || 1018 if (!core::equals( M[ 0], (T)1 ) ||
1019 !core::equals( M[ 5], (T)1 ) || 1019 !core::equals( M[ 5], (T)1 ) ||
1020 !core::equals( M[10], (T)1 ) || 1020 !core::equals( M[10], (T)1 ) ||
1021 !core::equals( M[15], (T)1 )) 1021 !core::equals( M[15], (T)1 ))
1022 return false; 1022 return false;
1023 1023
1024 for (s32 i=0; i<4; ++i) 1024 for (s32 i=0; i<4; ++i)
1025 for (s32 j=0; j<4; ++j) 1025 for (s32 j=0; j<4; ++j)
1026 if ((j != i) && (!iszero((*this)(i,j)))) 1026 if ((j != i) && (!iszero((*this)(i,j))))
1027 return false; 1027 return false;
1028*/ 1028*/
1029#if defined ( USE_MATRIX_TEST ) 1029#if defined ( USE_MATRIX_TEST )
1030 definitelyIdentityMatrix=true; 1030 definitelyIdentityMatrix=true;
1031#endif 1031#endif
1032 return true; 1032 return true;
1033 } 1033 }
1034 1034
1035 1035
1036 /* Check orthogonality of matrix. */ 1036 /* Check orthogonality of matrix. */
1037 template <class T> 1037 template <class T>
1038 inline bool CMatrix4<T>::isOrthogonal() const 1038 inline bool CMatrix4<T>::isOrthogonal() const
1039 { 1039 {
1040 T dp=M[0] * M[4 ] + M[1] * M[5 ] + M[2 ] * M[6 ] + M[3 ] * M[7 ]; 1040 T dp=M[0] * M[4 ] + M[1] * M[5 ] + M[2 ] * M[6 ] + M[3 ] * M[7 ];
1041 if (!iszero(dp)) 1041 if (!iszero(dp))
1042 return false; 1042 return false;
1043 dp = M[0] * M[8 ] + M[1] * M[9 ] + M[2 ] * M[10] + M[3 ] * M[11]; 1043 dp = M[0] * M[8 ] + M[1] * M[9 ] + M[2 ] * M[10] + M[3 ] * M[11];
1044 if (!iszero(dp)) 1044 if (!iszero(dp))
1045 return false; 1045 return false;
1046 dp = M[0] * M[12] + M[1] * M[13] + M[2 ] * M[14] + M[3 ] * M[15]; 1046 dp = M[0] * M[12] + M[1] * M[13] + M[2 ] * M[14] + M[3 ] * M[15];
1047 if (!iszero(dp)) 1047 if (!iszero(dp))
1048 return false; 1048 return false;
1049 dp = M[4] * M[8 ] + M[5] * M[9 ] + M[6 ] * M[10] + M[7 ] * M[11]; 1049 dp = M[4] * M[8 ] + M[5] * M[9 ] + M[6 ] * M[10] + M[7 ] * M[11];
1050 if (!iszero(dp)) 1050 if (!iszero(dp))
1051 return false; 1051 return false;
1052 dp = M[4] * M[12] + M[5] * M[13] + M[6 ] * M[14] + M[7 ] * M[15]; 1052 dp = M[4] * M[12] + M[5] * M[13] + M[6 ] * M[14] + M[7 ] * M[15];
1053 if (!iszero(dp)) 1053 if (!iszero(dp))
1054 return false; 1054 return false;
1055 dp = M[8] * M[12] + M[9] * M[13] + M[10] * M[14] + M[11] * M[15]; 1055 dp = M[8] * M[12] + M[9] * M[13] + M[10] * M[14] + M[11] * M[15];
1056 return (iszero(dp)); 1056 return (iszero(dp));
1057 } 1057 }
1058 1058
1059 1059
1060 /* 1060 /*
1061 doesn't solve floating range problems.. 1061 doesn't solve floating range problems..
1062 but takes care on +/- 0 on translation because we are changing it.. 1062 but takes care on +/- 0 on translation because we are changing it..
1063 reducing floating point branches 1063 reducing floating point branches
1064 but it needs the floats in memory.. 1064 but it needs the floats in memory..
1065 */ 1065 */
1066 template <class T> 1066 template <class T>
1067 inline bool CMatrix4<T>::isIdentity_integer_base() const 1067 inline bool CMatrix4<T>::isIdentity_integer_base() const
1068 { 1068 {
1069#if defined ( USE_MATRIX_TEST ) 1069#if defined ( USE_MATRIX_TEST )
1070 if (definitelyIdentityMatrix) 1070 if (definitelyIdentityMatrix)
1071 return true; 1071 return true;
1072#endif 1072#endif
1073 if(IR(M[0])!=F32_VALUE_1) return false; 1073 if(IR(M[0])!=F32_VALUE_1) return false;
1074 if(IR(M[1])!=0) return false; 1074 if(IR(M[1])!=0) return false;
1075 if(IR(M[2])!=0) return false; 1075 if(IR(M[2])!=0) return false;
1076 if(IR(M[3])!=0) return false; 1076 if(IR(M[3])!=0) return false;
1077 1077
1078 if(IR(M[4])!=0) return false; 1078 if(IR(M[4])!=0) return false;
1079 if(IR(M[5])!=F32_VALUE_1) return false; 1079 if(IR(M[5])!=F32_VALUE_1) return false;
1080 if(IR(M[6])!=0) return false; 1080 if(IR(M[6])!=0) return false;
1081 if(IR(M[7])!=0) return false; 1081 if(IR(M[7])!=0) return false;
1082 1082
1083 if(IR(M[8])!=0) return false; 1083 if(IR(M[8])!=0) return false;
1084 if(IR(M[9])!=0) return false; 1084 if(IR(M[9])!=0) return false;
1085 if(IR(M[10])!=F32_VALUE_1) return false; 1085 if(IR(M[10])!=F32_VALUE_1) return false;
1086 if(IR(M[11])!=0) return false; 1086 if(IR(M[11])!=0) return false;
1087 1087
1088 if(IR(M[12])!=0) return false; 1088 if(IR(M[12])!=0) return false;
1089 if(IR(M[13])!=0) return false; 1089 if(IR(M[13])!=0) return false;
1090 if(IR(M[13])!=0) return false; 1090 if(IR(M[13])!=0) return false;
1091 if(IR(M[15])!=F32_VALUE_1) return false; 1091 if(IR(M[15])!=F32_VALUE_1) return false;
1092 1092
1093#if defined ( USE_MATRIX_TEST ) 1093#if defined ( USE_MATRIX_TEST )
1094 definitelyIdentityMatrix=true; 1094 definitelyIdentityMatrix=true;
1095#endif 1095#endif
1096 return true; 1096 return true;
1097 } 1097 }
1098 1098
1099 1099
1100 template <class T> 1100 template <class T>
1101 inline void CMatrix4<T>::rotateVect( vector3df& vect ) const 1101 inline void CMatrix4<T>::rotateVect( vector3df& vect ) const
1102 { 1102 {
1103 vector3df tmp = vect; 1103 vector3df tmp = vect;
1104 vect.X = tmp.X*M[0] + tmp.Y*M[4] + tmp.Z*M[8]; 1104 vect.X = tmp.X*M[0] + tmp.Y*M[4] + tmp.Z*M[8];
1105 vect.Y = tmp.X*M[1] + tmp.Y*M[5] + tmp.Z*M[9]; 1105 vect.Y = tmp.X*M[1] + tmp.Y*M[5] + tmp.Z*M[9];
1106 vect.Z = tmp.X*M[2] + tmp.Y*M[6] + tmp.Z*M[10]; 1106 vect.Z = tmp.X*M[2] + tmp.Y*M[6] + tmp.Z*M[10];
1107 } 1107 }
1108 1108
1109 //! An alternate transform vector method, writing into a second vector 1109 //! An alternate transform vector method, writing into a second vector
1110 template <class T> 1110 template <class T>
1111 inline void CMatrix4<T>::rotateVect(core::vector3df& out, const core::vector3df& in) const 1111 inline void CMatrix4<T>::rotateVect(core::vector3df& out, const core::vector3df& in) const
1112 { 1112 {
1113 out.X = in.X*M[0] + in.Y*M[4] + in.Z*M[8]; 1113 out.X = in.X*M[0] + in.Y*M[4] + in.Z*M[8];
1114 out.Y = in.X*M[1] + in.Y*M[5] + in.Z*M[9]; 1114 out.Y = in.X*M[1] + in.Y*M[5] + in.Z*M[9];
1115 out.Z = in.X*M[2] + in.Y*M[6] + in.Z*M[10]; 1115 out.Z = in.X*M[2] + in.Y*M[6] + in.Z*M[10];
1116 } 1116 }
1117 1117
1118 //! An alternate transform vector method, writing into an array of 3 floats 1118 //! An alternate transform vector method, writing into an array of 3 floats
1119 template <class T> 1119 template <class T>
1120 inline void CMatrix4<T>::rotateVect(T *out, const core::vector3df& in) const 1120 inline void CMatrix4<T>::rotateVect(T *out, const core::vector3df& in) const
1121 { 1121 {
1122 out[0] = in.X*M[0] + in.Y*M[4] + in.Z*M[8]; 1122 out[0] = in.X*M[0] + in.Y*M[4] + in.Z*M[8];
1123 out[1] = in.X*M[1] + in.Y*M[5] + in.Z*M[9]; 1123 out[1] = in.X*M[1] + in.Y*M[5] + in.Z*M[9];
1124 out[2] = in.X*M[2] + in.Y*M[6] + in.Z*M[10]; 1124 out[2] = in.X*M[2] + in.Y*M[6] + in.Z*M[10];
1125 } 1125 }
1126 1126
1127 template <class T> 1127 template <class T>
1128 inline void CMatrix4<T>::inverseRotateVect( vector3df& vect ) const 1128 inline void CMatrix4<T>::inverseRotateVect( vector3df& vect ) const
1129 { 1129 {
1130 vector3df tmp = vect; 1130 vector3df tmp = vect;
1131 vect.X = tmp.X*M[0] + tmp.Y*M[1] + tmp.Z*M[2]; 1131 vect.X = tmp.X*M[0] + tmp.Y*M[1] + tmp.Z*M[2];
1132 vect.Y = tmp.X*M[4] + tmp.Y*M[5] + tmp.Z*M[6]; 1132 vect.Y = tmp.X*M[4] + tmp.Y*M[5] + tmp.Z*M[6];
1133 vect.Z = tmp.X*M[8] + tmp.Y*M[9] + tmp.Z*M[10]; 1133 vect.Z = tmp.X*M[8] + tmp.Y*M[9] + tmp.Z*M[10];
1134 } 1134 }
1135 1135
1136 template <class T> 1136 template <class T>
1137 inline void CMatrix4<T>::transformVect( vector3df& vect) const 1137 inline void CMatrix4<T>::transformVect( vector3df& vect) const
1138 { 1138 {
1139 f32 vector[3]; 1139 f32 vector[3];
1140 1140
1141 vector[0] = vect.X*M[0] + vect.Y*M[4] + vect.Z*M[8] + M[12]; 1141 vector[0] = vect.X*M[0] + vect.Y*M[4] + vect.Z*M[8] + M[12];
1142 vector[1] = vect.X*M[1] + vect.Y*M[5] + vect.Z*M[9] + M[13]; 1142 vector[1] = vect.X*M[1] + vect.Y*M[5] + vect.Z*M[9] + M[13];
1143 vector[2] = vect.X*M[2] + vect.Y*M[6] + vect.Z*M[10] + M[14]; 1143 vector[2] = vect.X*M[2] + vect.Y*M[6] + vect.Z*M[10] + M[14];
1144 1144
1145 vect.X = vector[0]; 1145 vect.X = vector[0];
1146 vect.Y = vector[1]; 1146 vect.Y = vector[1];
1147 vect.Z = vector[2]; 1147 vect.Z = vector[2];
1148 } 1148 }
1149 1149
1150 template <class T> 1150 template <class T>
1151 inline void CMatrix4<T>::transformVect( vector3df& out, const vector3df& in) const 1151 inline void CMatrix4<T>::transformVect( vector3df& out, const vector3df& in) const
1152 { 1152 {
1153 out.X = in.X*M[0] + in.Y*M[4] + in.Z*M[8] + M[12]; 1153 out.X = in.X*M[0] + in.Y*M[4] + in.Z*M[8] + M[12];
1154 out.Y = in.X*M[1] + in.Y*M[5] + in.Z*M[9] + M[13]; 1154 out.Y = in.X*M[1] + in.Y*M[5] + in.Z*M[9] + M[13];
1155 out.Z = in.X*M[2] + in.Y*M[6] + in.Z*M[10] + M[14]; 1155 out.Z = in.X*M[2] + in.Y*M[6] + in.Z*M[10] + M[14];
1156 } 1156 }
1157 1157
1158 1158
1159 template <class T> 1159 template <class T>
1160 inline void CMatrix4<T>::transformVect(T *out, const core::vector3df &in) const 1160 inline void CMatrix4<T>::transformVect(T *out, const core::vector3df &in) const
1161 { 1161 {
1162 out[0] = in.X*M[0] + in.Y*M[4] + in.Z*M[8] + M[12]; 1162 out[0] = in.X*M[0] + in.Y*M[4] + in.Z*M[8] + M[12];
1163 out[1] = in.X*M[1] + in.Y*M[5] + in.Z*M[9] + M[13]; 1163 out[1] = in.X*M[1] + in.Y*M[5] + in.Z*M[9] + M[13];
1164 out[2] = in.X*M[2] + in.Y*M[6] + in.Z*M[10] + M[14]; 1164 out[2] = in.X*M[2] + in.Y*M[6] + in.Z*M[10] + M[14];
1165 out[3] = in.X*M[3] + in.Y*M[7] + in.Z*M[11] + M[15]; 1165 out[3] = in.X*M[3] + in.Y*M[7] + in.Z*M[11] + M[15];
1166 } 1166 }
1167 1167
1168 template <class T> 1168 template <class T>
1169 inline void CMatrix4<T>::transformVec3(T *out, const T * in) const 1169 inline void CMatrix4<T>::transformVec3(T *out, const T * in) const
1170 { 1170 {
1171 out[0] = in[0]*M[0] + in[1]*M[4] + in[2]*M[8] + M[12]; 1171 out[0] = in[0]*M[0] + in[1]*M[4] + in[2]*M[8] + M[12];
1172 out[1] = in[0]*M[1] + in[1]*M[5] + in[2]*M[9] + M[13]; 1172 out[1] = in[0]*M[1] + in[1]*M[5] + in[2]*M[9] + M[13];
1173 out[2] = in[0]*M[2] + in[1]*M[6] + in[2]*M[10] + M[14]; 1173 out[2] = in[0]*M[2] + in[1]*M[6] + in[2]*M[10] + M[14];
1174 } 1174 }
1175 1175
1176 1176
1177 //! Transforms a plane by this matrix 1177 //! Transforms a plane by this matrix
1178 template <class T> 1178 template <class T>
1179 inline void CMatrix4<T>::transformPlane( core::plane3d<f32> &plane) const 1179 inline void CMatrix4<T>::transformPlane( core::plane3d<f32> &plane) const
1180 { 1180 {
1181 vector3df member; 1181 vector3df member;
1182 // Transform the plane member point, i.e. rotate, translate and scale it. 1182 // Transform the plane member point, i.e. rotate, translate and scale it.
1183 transformVect(member, plane.getMemberPoint()); 1183 transformVect(member, plane.getMemberPoint());
1184 1184
1185 // Transform the normal by the transposed inverse of the matrix 1185 // Transform the normal by the transposed inverse of the matrix
1186 CMatrix4<T> transposedInverse(*this, EM4CONST_INVERSE_TRANSPOSED); 1186 CMatrix4<T> transposedInverse(*this, EM4CONST_INVERSE_TRANSPOSED);
1187 vector3df normal = plane.Normal; 1187 vector3df normal = plane.Normal;
1188 transposedInverse.transformVect(normal); 1188 transposedInverse.transformVect(normal);
1189 1189
1190 plane.setPlane(member, normal); 1190 plane.setPlane(member, normal);
1191 } 1191 }
1192 1192
1193 //! Transforms a plane by this matrix 1193 //! Transforms a plane by this matrix
1194 template <class T> 1194 template <class T>
1195 inline void CMatrix4<T>::transformPlane( const core::plane3d<f32> &in, core::plane3d<f32> &out) const 1195 inline void CMatrix4<T>::transformPlane( const core::plane3d<f32> &in, core::plane3d<f32> &out) const
1196 { 1196 {
1197 out = in; 1197 out = in;
1198 transformPlane( out ); 1198 transformPlane( out );
1199 } 1199 }
1200 1200
1201 //! Transforms a axis aligned bounding box 1201 //! Transforms a axis aligned bounding box
1202 template <class T> 1202 template <class T>
1203 inline void CMatrix4<T>::transformBox(core::aabbox3d<f32>& box) const 1203 inline void CMatrix4<T>::transformBox(core::aabbox3d<f32>& box) const
1204 { 1204 {
1205#if defined ( USE_MATRIX_TEST ) 1205#if defined ( USE_MATRIX_TEST )
1206 if (isIdentity()) 1206 if (isIdentity())
1207 return; 1207 return;
1208#endif 1208#endif
1209 1209
1210 transformVect(box.MinEdge); 1210 transformVect(box.MinEdge);
1211 transformVect(box.MaxEdge); 1211 transformVect(box.MaxEdge);
1212 box.repair(); 1212 box.repair();
1213 } 1213 }
1214 1214
1215 //! Transforms a axis aligned bounding box more accurately than transformBox() 1215 //! Transforms a axis aligned bounding box more accurately than transformBox()
1216 template <class T> 1216 template <class T>
1217 inline void CMatrix4<T>::transformBoxEx(core::aabbox3d<f32>& box) const 1217 inline void CMatrix4<T>::transformBoxEx(core::aabbox3d<f32>& box) const
1218 { 1218 {
1219#if defined ( USE_MATRIX_TEST ) 1219#if defined ( USE_MATRIX_TEST )
1220 if (isIdentity()) 1220 if (isIdentity())
1221 return; 1221 return;
1222#endif 1222#endif
1223 1223
1224 const f32 Amin[3] = {box.MinEdge.X, box.MinEdge.Y, box.MinEdge.Z}; 1224 const f32 Amin[3] = {box.MinEdge.X, box.MinEdge.Y, box.MinEdge.Z};
1225 const f32 Amax[3] = {box.MaxEdge.X, box.MaxEdge.Y, box.MaxEdge.Z}; 1225 const f32 Amax[3] = {box.MaxEdge.X, box.MaxEdge.Y, box.MaxEdge.Z};
1226 1226
1227 f32 Bmin[3]; 1227 f32 Bmin[3];
1228 f32 Bmax[3]; 1228 f32 Bmax[3];
1229 1229
1230 Bmin[0] = Bmax[0] = M[12]; 1230 Bmin[0] = Bmax[0] = M[12];
1231 Bmin[1] = Bmax[1] = M[13]; 1231 Bmin[1] = Bmax[1] = M[13];
1232 Bmin[2] = Bmax[2] = M[14]; 1232 Bmin[2] = Bmax[2] = M[14];
1233 1233
1234 const CMatrix4<T> &m = *this; 1234 const CMatrix4<T> &m = *this;
1235 1235
1236 for (u32 i = 0; i < 3; ++i) 1236 for (u32 i = 0; i < 3; ++i)
1237 { 1237 {
1238 for (u32 j = 0; j < 3; ++j) 1238 for (u32 j = 0; j < 3; ++j)
1239 { 1239 {
1240 const f32 a = m(j,i) * Amin[j]; 1240 const f32 a = m(j,i) * Amin[j];
1241 const f32 b = m(j,i) * Amax[j]; 1241 const f32 b = m(j,i) * Amax[j];
1242 1242
1243 if (a < b) 1243 if (a < b)
1244 { 1244 {
1245 Bmin[i] += a; 1245 Bmin[i] += a;
1246 Bmax[i] += b; 1246 Bmax[i] += b;
1247 } 1247 }
1248 else 1248 else
1249 { 1249 {
1250 Bmin[i] += b; 1250 Bmin[i] += b;
1251 Bmax[i] += a; 1251 Bmax[i] += a;
1252 } 1252 }
1253 } 1253 }
1254 } 1254 }
1255 1255
1256 box.MinEdge.X = Bmin[0]; 1256 box.MinEdge.X = Bmin[0];
1257 box.MinEdge.Y = Bmin[1]; 1257 box.MinEdge.Y = Bmin[1];
1258 box.MinEdge.Z = Bmin[2]; 1258 box.MinEdge.Z = Bmin[2];
1259 1259
1260 box.MaxEdge.X = Bmax[0]; 1260 box.MaxEdge.X = Bmax[0];
1261 box.MaxEdge.Y = Bmax[1]; 1261 box.MaxEdge.Y = Bmax[1];
1262 box.MaxEdge.Z = Bmax[2]; 1262 box.MaxEdge.Z = Bmax[2];
1263 } 1263 }
1264 1264
1265 1265
1266 //! Multiplies this matrix by a 1x4 matrix 1266 //! Multiplies this matrix by a 1x4 matrix
1267 template <class T> 1267 template <class T>
1268 inline void CMatrix4<T>::multiplyWith1x4Matrix(T* matrix) const 1268 inline void CMatrix4<T>::multiplyWith1x4Matrix(T* matrix) const
1269 { 1269 {
1270 /* 1270 /*
1271 0 1 2 3 1271 0 1 2 3
1272 4 5 6 7 1272 4 5 6 7
1273 8 9 10 11 1273 8 9 10 11
1274 12 13 14 15 1274 12 13 14 15
1275 */ 1275 */
1276 1276
1277 T mat[4]; 1277 T mat[4];
1278 mat[0] = matrix[0]; 1278 mat[0] = matrix[0];
1279 mat[1] = matrix[1]; 1279 mat[1] = matrix[1];
1280 mat[2] = matrix[2]; 1280 mat[2] = matrix[2];
1281 mat[3] = matrix[3]; 1281 mat[3] = matrix[3];
1282 1282
1283 matrix[0] = M[0]*mat[0] + M[4]*mat[1] + M[8]*mat[2] + M[12]*mat[3]; 1283 matrix[0] = M[0]*mat[0] + M[4]*mat[1] + M[8]*mat[2] + M[12]*mat[3];
1284 matrix[1] = M[1]*mat[0] + M[5]*mat[1] + M[9]*mat[2] + M[13]*mat[3]; 1284 matrix[1] = M[1]*mat[0] + M[5]*mat[1] + M[9]*mat[2] + M[13]*mat[3];
1285 matrix[2] = M[2]*mat[0] + M[6]*mat[1] + M[10]*mat[2] + M[14]*mat[3]; 1285 matrix[2] = M[2]*mat[0] + M[6]*mat[1] + M[10]*mat[2] + M[14]*mat[3];
1286 matrix[3] = M[3]*mat[0] + M[7]*mat[1] + M[11]*mat[2] + M[15]*mat[3]; 1286 matrix[3] = M[3]*mat[0] + M[7]*mat[1] + M[11]*mat[2] + M[15]*mat[3];
1287 } 1287 }
1288 1288
1289 template <class T> 1289 template <class T>
1290 inline void CMatrix4<T>::inverseTranslateVect( vector3df& vect ) const 1290 inline void CMatrix4<T>::inverseTranslateVect( vector3df& vect ) const
1291 { 1291 {
1292 vect.X = vect.X-M[12]; 1292 vect.X = vect.X-M[12];
1293 vect.Y = vect.Y-M[13]; 1293 vect.Y = vect.Y-M[13];
1294 vect.Z = vect.Z-M[14]; 1294 vect.Z = vect.Z-M[14];
1295 } 1295 }
1296 1296
1297 template <class T> 1297 template <class T>
1298 inline void CMatrix4<T>::translateVect( vector3df& vect ) const 1298 inline void CMatrix4<T>::translateVect( vector3df& vect ) const
1299 { 1299 {
1300 vect.X = vect.X+M[12]; 1300 vect.X = vect.X+M[12];
1301 vect.Y = vect.Y+M[13]; 1301 vect.Y = vect.Y+M[13];
1302 vect.Z = vect.Z+M[14]; 1302 vect.Z = vect.Z+M[14];
1303 } 1303 }
1304 1304
1305 1305
1306 template <class T> 1306 template <class T>
1307 inline bool CMatrix4<T>::getInverse(CMatrix4<T>& out) const 1307 inline bool CMatrix4<T>::getInverse(CMatrix4<T>& out) const
1308 { 1308 {
1309 /// Calculates the inverse of this Matrix 1309 /// Calculates the inverse of this Matrix
1310 /// The inverse is calculated using Cramers rule. 1310 /// The inverse is calculated using Cramers rule.
1311 /// If no inverse exists then 'false' is returned. 1311 /// If no inverse exists then 'false' is returned.
1312 1312
1313#if defined ( USE_MATRIX_TEST ) 1313#if defined ( USE_MATRIX_TEST )
1314 if ( this->isIdentity() ) 1314 if ( this->isIdentity() )
1315 { 1315 {
1316 out=*this; 1316 out=*this;
1317 return true; 1317 return true;
1318 } 1318 }
1319#endif 1319#endif
1320 const CMatrix4<T> &m = *this; 1320 const CMatrix4<T> &m = *this;
1321 1321
1322 f32 d = (m(0, 0) * m(1, 1) - m(0, 1) * m(1, 0)) * (m(2, 2) * m(3, 3) - m(2, 3) * m(3, 2)) - 1322 f32 d = (m(0, 0) * m(1, 1) - m(0, 1) * m(1, 0)) * (m(2, 2) * m(3, 3) - m(2, 3) * m(3, 2)) -
1323 (m(0, 0) * m(1, 2) - m(0, 2) * m(1, 0)) * (m(2, 1) * m(3, 3) - m(2, 3) * m(3, 1)) + 1323 (m(0, 0) * m(1, 2) - m(0, 2) * m(1, 0)) * (m(2, 1) * m(3, 3) - m(2, 3) * m(3, 1)) +
1324 (m(0, 0) * m(1, 3) - m(0, 3) * m(1, 0)) * (m(2, 1) * m(3, 2) - m(2, 2) * m(3, 1)) + 1324 (m(0, 0) * m(1, 3) - m(0, 3) * m(1, 0)) * (m(2, 1) * m(3, 2) - m(2, 2) * m(3, 1)) +
1325 (m(0, 1) * m(1, 2) - m(0, 2) * m(1, 1)) * (m(2, 0) * m(3, 3) - m(2, 3) * m(3, 0)) - 1325 (m(0, 1) * m(1, 2) - m(0, 2) * m(1, 1)) * (m(2, 0) * m(3, 3) - m(2, 3) * m(3, 0)) -
1326 (m(0, 1) * m(1, 3) - m(0, 3) * m(1, 1)) * (m(2, 0) * m(3, 2) - m(2, 2) * m(3, 0)) + 1326 (m(0, 1) * m(1, 3) - m(0, 3) * m(1, 1)) * (m(2, 0) * m(3, 2) - m(2, 2) * m(3, 0)) +
1327 (m(0, 2) * m(1, 3) - m(0, 3) * m(1, 2)) * (m(2, 0) * m(3, 1) - m(2, 1) * m(3, 0)); 1327 (m(0, 2) * m(1, 3) - m(0, 3) * m(1, 2)) * (m(2, 0) * m(3, 1) - m(2, 1) * m(3, 0));
1328 1328
1329 if( core::iszero ( d, FLT_MIN ) ) 1329 if( core::iszero ( d, FLT_MIN ) )
1330 return false; 1330 return false;
1331 1331
1332 d = core::reciprocal ( d ); 1332 d = core::reciprocal ( d );
1333 1333
1334 out(0, 0) = d * (m(1, 1) * (m(2, 2) * m(3, 3) - m(2, 3) * m(3, 2)) + 1334 out(0, 0) = d * (m(1, 1) * (m(2, 2) * m(3, 3) - m(2, 3) * m(3, 2)) +
1335 m(1, 2) * (m(2, 3) * m(3, 1) - m(2, 1) * m(3, 3)) + 1335 m(1, 2) * (m(2, 3) * m(3, 1) - m(2, 1) * m(3, 3)) +
1336 m(1, 3) * (m(2, 1) * m(3, 2) - m(2, 2) * m(3, 1))); 1336 m(1, 3) * (m(2, 1) * m(3, 2) - m(2, 2) * m(3, 1)));
1337 out(0, 1) = d * (m(2, 1) * (m(0, 2) * m(3, 3) - m(0, 3) * m(3, 2)) + 1337 out(0, 1) = d * (m(2, 1) * (m(0, 2) * m(3, 3) - m(0, 3) * m(3, 2)) +
1338 m(2, 2) * (m(0, 3) * m(3, 1) - m(0, 1) * m(3, 3)) + 1338 m(2, 2) * (m(0, 3) * m(3, 1) - m(0, 1) * m(3, 3)) +
1339 m(2, 3) * (m(0, 1) * m(3, 2) - m(0, 2) * m(3, 1))); 1339 m(2, 3) * (m(0, 1) * m(3, 2) - m(0, 2) * m(3, 1)));
1340 out(0, 2) = d * (m(3, 1) * (m(0, 2) * m(1, 3) - m(0, 3) * m(1, 2)) + 1340 out(0, 2) = d * (m(3, 1) * (m(0, 2) * m(1, 3) - m(0, 3) * m(1, 2)) +
1341 m(3, 2) * (m(0, 3) * m(1, 1) - m(0, 1) * m(1, 3)) + 1341 m(3, 2) * (m(0, 3) * m(1, 1) - m(0, 1) * m(1, 3)) +
1342 m(3, 3) * (m(0, 1) * m(1, 2) - m(0, 2) * m(1, 1))); 1342 m(3, 3) * (m(0, 1) * m(1, 2) - m(0, 2) * m(1, 1)));
1343 out(0, 3) = d * (m(0, 1) * (m(1, 3) * m(2, 2) - m(1, 2) * m(2, 3)) + 1343 out(0, 3) = d * (m(0, 1) * (m(1, 3) * m(2, 2) - m(1, 2) * m(2, 3)) +
1344 m(0, 2) * (m(1, 1) * m(2, 3) - m(1, 3) * m(2, 1)) + 1344 m(0, 2) * (m(1, 1) * m(2, 3) - m(1, 3) * m(2, 1)) +
1345 m(0, 3) * (m(1, 2) * m(2, 1) - m(1, 1) * m(2, 2))); 1345 m(0, 3) * (m(1, 2) * m(2, 1) - m(1, 1) * m(2, 2)));
1346 out(1, 0) = d * (m(1, 2) * (m(2, 0) * m(3, 3) - m(2, 3) * m(3, 0)) + 1346 out(1, 0) = d * (m(1, 2) * (m(2, 0) * m(3, 3) - m(2, 3) * m(3, 0)) +
1347 m(1, 3) * (m(2, 2) * m(3, 0) - m(2, 0) * m(3, 2)) + 1347 m(1, 3) * (m(2, 2) * m(3, 0) - m(2, 0) * m(3, 2)) +
1348 m(1, 0) * (m(2, 3) * m(3, 2) - m(2, 2) * m(3, 3))); 1348 m(1, 0) * (m(2, 3) * m(3, 2) - m(2, 2) * m(3, 3)));
1349 out(1, 1) = d * (m(2, 2) * (m(0, 0) * m(3, 3) - m(0, 3) * m(3, 0)) + 1349 out(1, 1) = d * (m(2, 2) * (m(0, 0) * m(3, 3) - m(0, 3) * m(3, 0)) +
1350 m(2, 3) * (m(0, 2) * m(3, 0) - m(0, 0) * m(3, 2)) + 1350 m(2, 3) * (m(0, 2) * m(3, 0) - m(0, 0) * m(3, 2)) +
1351 m(2, 0) * (m(0, 3) * m(3, 2) - m(0, 2) * m(3, 3))); 1351 m(2, 0) * (m(0, 3) * m(3, 2) - m(0, 2) * m(3, 3)));
1352 out(1, 2) = d * (m(3, 2) * (m(0, 0) * m(1, 3) - m(0, 3) * m(1, 0)) + 1352 out(1, 2) = d * (m(3, 2) * (m(0, 0) * m(1, 3) - m(0, 3) * m(1, 0)) +
1353 m(3, 3) * (m(0, 2) * m(1, 0) - m(0, 0) * m(1, 2)) + 1353 m(3, 3) * (m(0, 2) * m(1, 0) - m(0, 0) * m(1, 2)) +
1354 m(3, 0) * (m(0, 3) * m(1, 2) - m(0, 2) * m(1, 3))); 1354 m(3, 0) * (m(0, 3) * m(1, 2) - m(0, 2) * m(1, 3)));
1355 out(1, 3) = d * (m(0, 2) * (m(1, 3) * m(2, 0) - m(1, 0) * m(2, 3)) + 1355 out(1, 3) = d * (m(0, 2) * (m(1, 3) * m(2, 0) - m(1, 0) * m(2, 3)) +
1356 m(0, 3) * (m(1, 0) * m(2, 2) - m(1, 2) * m(2, 0)) + 1356 m(0, 3) * (m(1, 0) * m(2, 2) - m(1, 2) * m(2, 0)) +
1357 m(0, 0) * (m(1, 2) * m(2, 3) - m(1, 3) * m(2, 2))); 1357 m(0, 0) * (m(1, 2) * m(2, 3) - m(1, 3) * m(2, 2)));
1358 out(2, 0) = d * (m(1, 3) * (m(2, 0) * m(3, 1) - m(2, 1) * m(3, 0)) + 1358 out(2, 0) = d * (m(1, 3) * (m(2, 0) * m(3, 1) - m(2, 1) * m(3, 0)) +
1359 m(1, 0) * (m(2, 1) * m(3, 3) - m(2, 3) * m(3, 1)) + 1359 m(1, 0) * (m(2, 1) * m(3, 3) - m(2, 3) * m(3, 1)) +
1360 m(1, 1) * (m(2, 3) * m(3, 0) - m(2, 0) * m(3, 3))); 1360 m(1, 1) * (m(2, 3) * m(3, 0) - m(2, 0) * m(3, 3)));
1361 out(2, 1) = d * (m(2, 3) * (m(0, 0) * m(3, 1) - m(0, 1) * m(3, 0)) + 1361 out(2, 1) = d * (m(2, 3) * (m(0, 0) * m(3, 1) - m(0, 1) * m(3, 0)) +
1362 m(2, 0) * (m(0, 1) * m(3, 3) - m(0, 3) * m(3, 1)) + 1362 m(2, 0) * (m(0, 1) * m(3, 3) - m(0, 3) * m(3, 1)) +
1363 m(2, 1) * (m(0, 3) * m(3, 0) - m(0, 0) * m(3, 3))); 1363 m(2, 1) * (m(0, 3) * m(3, 0) - m(0, 0) * m(3, 3)));
1364 out(2, 2) = d * (m(3, 3) * (m(0, 0) * m(1, 1) - m(0, 1) * m(1, 0)) + 1364 out(2, 2) = d * (m(3, 3) * (m(0, 0) * m(1, 1) - m(0, 1) * m(1, 0)) +
1365 m(3, 0) * (m(0, 1) * m(1, 3) - m(0, 3) * m(1, 1)) + 1365 m(3, 0) * (m(0, 1) * m(1, 3) - m(0, 3) * m(1, 1)) +
1366 m(3, 1) * (m(0, 3) * m(1, 0) - m(0, 0) * m(1, 3))); 1366 m(3, 1) * (m(0, 3) * m(1, 0) - m(0, 0) * m(1, 3)));
1367 out(2, 3) = d * (m(0, 3) * (m(1, 1) * m(2, 0) - m(1, 0) * m(2, 1)) + 1367 out(2, 3) = d * (m(0, 3) * (m(1, 1) * m(2, 0) - m(1, 0) * m(2, 1)) +
1368 m(0, 0) * (m(1, 3) * m(2, 1) - m(1, 1) * m(2, 3)) + 1368 m(0, 0) * (m(1, 3) * m(2, 1) - m(1, 1) * m(2, 3)) +
1369 m(0, 1) * (m(1, 0) * m(2, 3) - m(1, 3) * m(2, 0))); 1369 m(0, 1) * (m(1, 0) * m(2, 3) - m(1, 3) * m(2, 0)));
1370 out(3, 0) = d * (m(1, 0) * (m(2, 2) * m(3, 1) - m(2, 1) * m(3, 2)) + 1370 out(3, 0) = d * (m(1, 0) * (m(2, 2) * m(3, 1) - m(2, 1) * m(3, 2)) +
1371 m(1, 1) * (m(2, 0) * m(3, 2) - m(2, 2) * m(3, 0)) + 1371 m(1, 1) * (m(2, 0) * m(3, 2) - m(2, 2) * m(3, 0)) +
1372 m(1, 2) * (m(2, 1) * m(3, 0) - m(2, 0) * m(3, 1))); 1372 m(1, 2) * (m(2, 1) * m(3, 0) - m(2, 0) * m(3, 1)));
1373 out(3, 1) = d * (m(2, 0) * (m(0, 2) * m(3, 1) - m(0, 1) * m(3, 2)) + 1373 out(3, 1) = d * (m(2, 0) * (m(0, 2) * m(3, 1) - m(0, 1) * m(3, 2)) +
1374 m(2, 1) * (m(0, 0) * m(3, 2) - m(0, 2) * m(3, 0)) + 1374 m(2, 1) * (m(0, 0) * m(3, 2) - m(0, 2) * m(3, 0)) +
1375 m(2, 2) * (m(0, 1) * m(3, 0) - m(0, 0) * m(3, 1))); 1375 m(2, 2) * (m(0, 1) * m(3, 0) - m(0, 0) * m(3, 1)));
1376 out(3, 2) = d * (m(3, 0) * (m(0, 2) * m(1, 1) - m(0, 1) * m(1, 2)) + 1376 out(3, 2) = d * (m(3, 0) * (m(0, 2) * m(1, 1) - m(0, 1) * m(1, 2)) +
1377 m(3, 1) * (m(0, 0) * m(1, 2) - m(0, 2) * m(1, 0)) + 1377 m(3, 1) * (m(0, 0) * m(1, 2) - m(0, 2) * m(1, 0)) +
1378 m(3, 2) * (m(0, 1) * m(1, 0) - m(0, 0) * m(1, 1))); 1378 m(3, 2) * (m(0, 1) * m(1, 0) - m(0, 0) * m(1, 1)));
1379 out(3, 3) = d * (m(0, 0) * (m(1, 1) * m(2, 2) - m(1, 2) * m(2, 1)) + 1379 out(3, 3) = d * (m(0, 0) * (m(1, 1) * m(2, 2) - m(1, 2) * m(2, 1)) +
1380 m(0, 1) * (m(1, 2) * m(2, 0) - m(1, 0) * m(2, 2)) + 1380 m(0, 1) * (m(1, 2) * m(2, 0) - m(1, 0) * m(2, 2)) +
1381 m(0, 2) * (m(1, 0) * m(2, 1) - m(1, 1) * m(2, 0))); 1381 m(0, 2) * (m(1, 0) * m(2, 1) - m(1, 1) * m(2, 0)));
1382 1382
1383#if defined ( USE_MATRIX_TEST ) 1383#if defined ( USE_MATRIX_TEST )
1384 out.definitelyIdentityMatrix = definitelyIdentityMatrix; 1384 out.definitelyIdentityMatrix = definitelyIdentityMatrix;
1385#endif 1385#endif
1386 return true; 1386 return true;
1387 } 1387 }
1388 1388
1389 1389
1390 //! Inverts a primitive matrix which only contains a translation and a rotation 1390 //! Inverts a primitive matrix which only contains a translation and a rotation
1391 //! \param out: where result matrix is written to. 1391 //! \param out: where result matrix is written to.
1392 template <class T> 1392 template <class T>
1393 inline bool CMatrix4<T>::getInversePrimitive ( CMatrix4<T>& out ) const 1393 inline bool CMatrix4<T>::getInversePrimitive ( CMatrix4<T>& out ) const
1394 { 1394 {
1395 out.M[0 ] = M[0]; 1395 out.M[0 ] = M[0];
1396 out.M[1 ] = M[4]; 1396 out.M[1 ] = M[4];
1397 out.M[2 ] = M[8]; 1397 out.M[2 ] = M[8];
1398 out.M[3 ] = 0; 1398 out.M[3 ] = 0;
1399 1399
1400 out.M[4 ] = M[1]; 1400 out.M[4 ] = M[1];
1401 out.M[5 ] = M[5]; 1401 out.M[5 ] = M[5];
1402 out.M[6 ] = M[9]; 1402 out.M[6 ] = M[9];
1403 out.M[7 ] = 0; 1403 out.M[7 ] = 0;
1404 1404
1405 out.M[8 ] = M[2]; 1405 out.M[8 ] = M[2];
1406 out.M[9 ] = M[6]; 1406 out.M[9 ] = M[6];
1407 out.M[10] = M[10]; 1407 out.M[10] = M[10];
1408 out.M[11] = 0; 1408 out.M[11] = 0;
1409 1409
1410 out.M[12] = (T)-(M[12]*M[0] + M[13]*M[1] + M[14]*M[2]); 1410 out.M[12] = (T)-(M[12]*M[0] + M[13]*M[1] + M[14]*M[2]);
1411 out.M[13] = (T)-(M[12]*M[4] + M[13]*M[5] + M[14]*M[6]); 1411 out.M[13] = (T)-(M[12]*M[4] + M[13]*M[5] + M[14]*M[6]);
1412 out.M[14] = (T)-(M[12]*M[8] + M[13]*M[9] + M[14]*M[10]); 1412 out.M[14] = (T)-(M[12]*M[8] + M[13]*M[9] + M[14]*M[10]);
1413 out.M[15] = 1; 1413 out.M[15] = 1;
1414 1414
1415#if defined ( USE_MATRIX_TEST ) 1415#if defined ( USE_MATRIX_TEST )
1416 out.definitelyIdentityMatrix = definitelyIdentityMatrix; 1416 out.definitelyIdentityMatrix = definitelyIdentityMatrix;
1417#endif 1417#endif
1418 return true; 1418 return true;
1419 } 1419 }
1420 1420
1421 /*! 1421 /*!
1422 */ 1422 */
1423 template <class T> 1423 template <class T>
1424 inline bool CMatrix4<T>::makeInverse() 1424 inline bool CMatrix4<T>::makeInverse()
1425 { 1425 {
1426#if defined ( USE_MATRIX_TEST ) 1426#if defined ( USE_MATRIX_TEST )
1427 if (definitelyIdentityMatrix) 1427 if (definitelyIdentityMatrix)
1428 return true; 1428 return true;
1429#endif 1429#endif
1430 CMatrix4<T> temp ( EM4CONST_NOTHING ); 1430 CMatrix4<T> temp ( EM4CONST_NOTHING );
1431 1431
1432 if (getInverse(temp)) 1432 if (getInverse(temp))
1433 { 1433 {
1434 *this = temp; 1434 *this = temp;
1435 return true; 1435 return true;
1436 } 1436 }
1437 1437
1438 return false; 1438 return false;
1439 } 1439 }
1440 1440
1441 1441
1442 template <class T> 1442 template <class T>
1443 inline CMatrix4<T>& CMatrix4<T>::operator=(const CMatrix4<T> &other) 1443 inline CMatrix4<T>& CMatrix4<T>::operator=(const CMatrix4<T> &other)
1444 { 1444 {
1445 if (this==&other) 1445 if (this==&other)
1446 return *this; 1446 return *this;
1447 memcpy(M, other.M, 16*sizeof(T)); 1447 memcpy(M, other.M, 16*sizeof(T));
1448#if defined ( USE_MATRIX_TEST ) 1448#if defined ( USE_MATRIX_TEST )
1449 definitelyIdentityMatrix=other.definitelyIdentityMatrix; 1449 definitelyIdentityMatrix=other.definitelyIdentityMatrix;
1450#endif 1450#endif
1451 return *this; 1451 return *this;
1452 } 1452 }
1453 1453
1454 1454
1455 template <class T> 1455 template <class T>
1456 inline CMatrix4<T>& CMatrix4<T>::operator=(const T& scalar) 1456 inline CMatrix4<T>& CMatrix4<T>::operator=(const T& scalar)
1457 { 1457 {
1458 for (s32 i = 0; i < 16; ++i) 1458 for (s32 i = 0; i < 16; ++i)
1459 M[i]=scalar; 1459 M[i]=scalar;
1460 1460
1461#if defined ( USE_MATRIX_TEST ) 1461#if defined ( USE_MATRIX_TEST )
1462 definitelyIdentityMatrix=false; 1462 definitelyIdentityMatrix=false;
1463#endif 1463#endif
1464 return *this; 1464 return *this;
1465 } 1465 }
1466 1466
1467 1467
1468 template <class T> 1468 template <class T>
1469 inline bool CMatrix4<T>::operator==(const CMatrix4<T> &other) const 1469 inline bool CMatrix4<T>::operator==(const CMatrix4<T> &other) const
1470 { 1470 {
1471#if defined ( USE_MATRIX_TEST ) 1471#if defined ( USE_MATRIX_TEST )
1472 if (definitelyIdentityMatrix && other.definitelyIdentityMatrix) 1472 if (definitelyIdentityMatrix && other.definitelyIdentityMatrix)
1473 return true; 1473 return true;
1474#endif 1474#endif
1475 for (s32 i = 0; i < 16; ++i) 1475 for (s32 i = 0; i < 16; ++i)
1476 if (M[i] != other.M[i]) 1476 if (M[i] != other.M[i])
1477 return false; 1477 return false;
1478 1478
1479 return true; 1479 return true;
1480 } 1480 }
1481 1481
1482 1482
1483 template <class T> 1483 template <class T>
1484 inline bool CMatrix4<T>::operator!=(const CMatrix4<T> &other) const 1484 inline bool CMatrix4<T>::operator!=(const CMatrix4<T> &other) const
1485 { 1485 {
1486 return !(*this == other); 1486 return !(*this == other);
1487 } 1487 }
1488 1488
1489 1489
1490 // Builds a right-handed perspective projection matrix based on a field of view 1490 // Builds a right-handed perspective projection matrix based on a field of view
1491 template <class T> 1491 template <class T>
1492 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveFovRH( 1492 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveFovRH(
1493 f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar) 1493 f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar)
1494 { 1494 {
1495 const f64 h = reciprocal(tan(fieldOfViewRadians*0.5)); 1495 const f64 h = reciprocal(tan(fieldOfViewRadians*0.5));
1496 _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero 1496 _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero
1497 const T w = static_cast<T>(h / aspectRatio); 1497 const T w = static_cast<T>(h / aspectRatio);
1498 1498
1499 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero 1499 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero
1500 M[0] = w; 1500 M[0] = w;
1501 M[1] = 0; 1501 M[1] = 0;
1502 M[2] = 0; 1502 M[2] = 0;
1503 M[3] = 0; 1503 M[3] = 0;
1504 1504
1505 M[4] = 0; 1505 M[4] = 0;
1506 M[5] = (T)h; 1506 M[5] = (T)h;
1507 M[6] = 0; 1507 M[6] = 0;
1508 M[7] = 0; 1508 M[7] = 0;
1509 1509
1510 M[8] = 0; 1510 M[8] = 0;
1511 M[9] = 0; 1511 M[9] = 0;
1512 M[10] = (T)(zFar/(zNear-zFar)); // DirectX version 1512 M[10] = (T)(zFar/(zNear-zFar)); // DirectX version
1513// M[10] = (T)(zFar+zNear/(zNear-zFar)); // OpenGL version 1513// M[10] = (T)(zFar+zNear/(zNear-zFar)); // OpenGL version
1514 M[11] = -1; 1514 M[11] = -1;
1515 1515
1516 M[12] = 0; 1516 M[12] = 0;
1517 M[13] = 0; 1517 M[13] = 0;
1518 M[14] = (T)(zNear*zFar/(zNear-zFar)); // DirectX version 1518 M[14] = (T)(zNear*zFar/(zNear-zFar)); // DirectX version
1519// M[14] = (T)(2.0f*zNear*zFar/(zNear-zFar)); // OpenGL version 1519// M[14] = (T)(2.0f*zNear*zFar/(zNear-zFar)); // OpenGL version
1520 M[15] = 0; 1520 M[15] = 0;
1521 1521
1522#if defined ( USE_MATRIX_TEST ) 1522#if defined ( USE_MATRIX_TEST )
1523 definitelyIdentityMatrix=false; 1523 definitelyIdentityMatrix=false;
1524#endif 1524#endif
1525 return *this; 1525 return *this;
1526 } 1526 }
1527 1527
1528 1528
1529 // Builds a left-handed perspective projection matrix based on a field of view 1529 // Builds a left-handed perspective projection matrix based on a field of view
1530 template <class T> 1530 template <class T>
1531 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveFovLH( 1531 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveFovLH(
1532 f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar) 1532 f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar)
1533 { 1533 {
1534 const f64 h = reciprocal(tan(fieldOfViewRadians*0.5)); 1534 const f64 h = reciprocal(tan(fieldOfViewRadians*0.5));
1535 _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero 1535 _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero
1536 const T w = static_cast<T>(h / aspectRatio); 1536 const T w = static_cast<T>(h / aspectRatio);
1537 1537
1538 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero 1538 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero
1539 M[0] = w; 1539 M[0] = w;
1540 M[1] = 0; 1540 M[1] = 0;
1541 M[2] = 0; 1541 M[2] = 0;
1542 M[3] = 0; 1542 M[3] = 0;
1543 1543
1544 M[4] = 0; 1544 M[4] = 0;
1545 M[5] = (T)h; 1545 M[5] = (T)h;
1546 M[6] = 0; 1546 M[6] = 0;
1547 M[7] = 0; 1547 M[7] = 0;
1548 1548
1549 M[8] = 0; 1549 M[8] = 0;
1550 M[9] = 0; 1550 M[9] = 0;
1551 M[10] = (T)(zFar/(zFar-zNear)); 1551 M[10] = (T)(zFar/(zFar-zNear));
1552 M[11] = 1; 1552 M[11] = 1;
1553 1553
1554 M[12] = 0; 1554 M[12] = 0;
1555 M[13] = 0; 1555 M[13] = 0;
1556 M[14] = (T)(-zNear*zFar/(zFar-zNear)); 1556 M[14] = (T)(-zNear*zFar/(zFar-zNear));
1557 M[15] = 0; 1557 M[15] = 0;
1558 1558
1559#if defined ( USE_MATRIX_TEST ) 1559#if defined ( USE_MATRIX_TEST )
1560 definitelyIdentityMatrix=false; 1560 definitelyIdentityMatrix=false;
1561#endif 1561#endif
1562 return *this; 1562 return *this;
1563 } 1563 }
1564 1564
1565 1565
1566 // Builds a left-handed perspective projection matrix based on a field of view, with far plane culling at infinity 1566 // Builds a left-handed perspective projection matrix based on a field of view, with far plane culling at infinity
1567 template <class T> 1567 template <class T>
1568 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveFovInfinityLH( 1568 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveFovInfinityLH(
1569 f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 epsilon) 1569 f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 epsilon)
1570 { 1570 {
1571 const f64 h = reciprocal(tan(fieldOfViewRadians*0.5)); 1571 const f64 h = reciprocal(tan(fieldOfViewRadians*0.5));
1572 _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero 1572 _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero
1573 const T w = static_cast<T>(h / aspectRatio); 1573 const T w = static_cast<T>(h / aspectRatio);
1574 1574
1575 M[0] = w; 1575 M[0] = w;
1576 M[1] = 0; 1576 M[1] = 0;
1577 M[2] = 0; 1577 M[2] = 0;
1578 M[3] = 0; 1578 M[3] = 0;
1579 1579
1580 M[4] = 0; 1580 M[4] = 0;
1581 M[5] = (T)h; 1581 M[5] = (T)h;
1582 M[6] = 0; 1582 M[6] = 0;
1583 M[7] = 0; 1583 M[7] = 0;
1584 1584
1585 M[8] = 0; 1585 M[8] = 0;
1586 M[9] = 0; 1586 M[9] = 0;
1587 M[10] = (T)(1.f-epsilon); 1587 M[10] = (T)(1.f-epsilon);
1588 M[11] = 1; 1588 M[11] = 1;
1589 1589
1590 M[12] = 0; 1590 M[12] = 0;
1591 M[13] = 0; 1591 M[13] = 0;
1592 M[14] = (T)(zNear*(epsilon-1.f)); 1592 M[14] = (T)(zNear*(epsilon-1.f));
1593 M[15] = 0; 1593 M[15] = 0;
1594 1594
1595#if defined ( USE_MATRIX_TEST ) 1595#if defined ( USE_MATRIX_TEST )
1596 definitelyIdentityMatrix=false; 1596 definitelyIdentityMatrix=false;
1597#endif 1597#endif
1598 return *this; 1598 return *this;
1599 } 1599 }
1600 1600
1601 1601
1602 // Builds a left-handed orthogonal projection matrix. 1602 // Builds a left-handed orthogonal projection matrix.
1603 template <class T> 1603 template <class T>
1604 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixOrthoLH( 1604 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixOrthoLH(
1605 f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar) 1605 f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
1606 { 1606 {
1607 _IRR_DEBUG_BREAK_IF(widthOfViewVolume==0.f); //divide by zero 1607 _IRR_DEBUG_BREAK_IF(widthOfViewVolume==0.f); //divide by zero
1608 _IRR_DEBUG_BREAK_IF(heightOfViewVolume==0.f); //divide by zero 1608 _IRR_DEBUG_BREAK_IF(heightOfViewVolume==0.f); //divide by zero
1609 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero 1609 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero
1610 M[0] = (T)(2/widthOfViewVolume); 1610 M[0] = (T)(2/widthOfViewVolume);
1611 M[1] = 0; 1611 M[1] = 0;
1612 M[2] = 0; 1612 M[2] = 0;
1613 M[3] = 0; 1613 M[3] = 0;
1614 1614
1615 M[4] = 0; 1615 M[4] = 0;
1616 M[5] = (T)(2/heightOfViewVolume); 1616 M[5] = (T)(2/heightOfViewVolume);
1617 M[6] = 0; 1617 M[6] = 0;
1618 M[7] = 0; 1618 M[7] = 0;
1619 1619
1620 M[8] = 0; 1620 M[8] = 0;
1621 M[9] = 0; 1621 M[9] = 0;
1622 M[10] = (T)(1/(zFar-zNear)); 1622 M[10] = (T)(1/(zFar-zNear));
1623 M[11] = 0; 1623 M[11] = 0;
1624 1624
1625 M[12] = 0; 1625 M[12] = 0;
1626 M[13] = 0; 1626 M[13] = 0;
1627 M[14] = (T)(zNear/(zNear-zFar)); 1627 M[14] = (T)(zNear/(zNear-zFar));
1628 M[15] = 1; 1628 M[15] = 1;
1629 1629
1630#if defined ( USE_MATRIX_TEST ) 1630#if defined ( USE_MATRIX_TEST )
1631 definitelyIdentityMatrix=false; 1631 definitelyIdentityMatrix=false;
1632#endif 1632#endif
1633 return *this; 1633 return *this;
1634 } 1634 }
1635 1635
1636 1636
1637 // Builds a right-handed orthogonal projection matrix. 1637 // Builds a right-handed orthogonal projection matrix.
1638 template <class T> 1638 template <class T>
1639 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixOrthoRH( 1639 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixOrthoRH(
1640 f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar) 1640 f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
1641 { 1641 {
1642 _IRR_DEBUG_BREAK_IF(widthOfViewVolume==0.f); //divide by zero 1642 _IRR_DEBUG_BREAK_IF(widthOfViewVolume==0.f); //divide by zero
1643 _IRR_DEBUG_BREAK_IF(heightOfViewVolume==0.f); //divide by zero 1643 _IRR_DEBUG_BREAK_IF(heightOfViewVolume==0.f); //divide by zero
1644 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero 1644 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero
1645 M[0] = (T)(2/widthOfViewVolume); 1645 M[0] = (T)(2/widthOfViewVolume);
1646 M[1] = 0; 1646 M[1] = 0;
1647 M[2] = 0; 1647 M[2] = 0;
1648 M[3] = 0; 1648 M[3] = 0;
1649 1649
1650 M[4] = 0; 1650 M[4] = 0;
1651 M[5] = (T)(2/heightOfViewVolume); 1651 M[5] = (T)(2/heightOfViewVolume);
1652 M[6] = 0; 1652 M[6] = 0;
1653 M[7] = 0; 1653 M[7] = 0;
1654 1654
1655 M[8] = 0; 1655 M[8] = 0;
1656 M[9] = 0; 1656 M[9] = 0;
1657 M[10] = (T)(1/(zNear-zFar)); 1657 M[10] = (T)(1/(zNear-zFar));
1658 M[11] = 0; 1658 M[11] = 0;
1659 1659
1660 M[12] = 0; 1660 M[12] = 0;
1661 M[13] = 0; 1661 M[13] = 0;
1662 M[14] = (T)(zNear/(zNear-zFar)); 1662 M[14] = (T)(zNear/(zNear-zFar));
1663 M[15] = 1; 1663 M[15] = 1;
1664 1664
1665#if defined ( USE_MATRIX_TEST ) 1665#if defined ( USE_MATRIX_TEST )
1666 definitelyIdentityMatrix=false; 1666 definitelyIdentityMatrix=false;
1667#endif 1667#endif
1668 return *this; 1668 return *this;
1669 } 1669 }
1670 1670
1671 1671
1672 // Builds a right-handed perspective projection matrix. 1672 // Builds a right-handed perspective projection matrix.
1673 template <class T> 1673 template <class T>
1674 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveRH( 1674 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveRH(
1675 f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar) 1675 f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
1676 { 1676 {
1677 _IRR_DEBUG_BREAK_IF(widthOfViewVolume==0.f); //divide by zero 1677 _IRR_DEBUG_BREAK_IF(widthOfViewVolume==0.f); //divide by zero
1678 _IRR_DEBUG_BREAK_IF(heightOfViewVolume==0.f); //divide by zero 1678 _IRR_DEBUG_BREAK_IF(heightOfViewVolume==0.f); //divide by zero
1679 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero 1679 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero
1680 M[0] = (T)(2*zNear/widthOfViewVolume); 1680 M[0] = (T)(2*zNear/widthOfViewVolume);
1681 M[1] = 0; 1681 M[1] = 0;
1682 M[2] = 0; 1682 M[2] = 0;
1683 M[3] = 0; 1683 M[3] = 0;
1684 1684
1685 M[4] = 0; 1685 M[4] = 0;
1686 M[5] = (T)(2*zNear/heightOfViewVolume); 1686 M[5] = (T)(2*zNear/heightOfViewVolume);
1687 M[6] = 0; 1687 M[6] = 0;
1688 M[7] = 0; 1688 M[7] = 0;
1689 1689
1690 M[8] = 0; 1690 M[8] = 0;
1691 M[9] = 0; 1691 M[9] = 0;
1692 M[10] = (T)(zFar/(zNear-zFar)); 1692 M[10] = (T)(zFar/(zNear-zFar));
1693 M[11] = -1; 1693 M[11] = -1;
1694 1694
1695 M[12] = 0; 1695 M[12] = 0;
1696 M[13] = 0; 1696 M[13] = 0;
1697 M[14] = (T)(zNear*zFar/(zNear-zFar)); 1697 M[14] = (T)(zNear*zFar/(zNear-zFar));
1698 M[15] = 0; 1698 M[15] = 0;
1699 1699
1700#if defined ( USE_MATRIX_TEST ) 1700#if defined ( USE_MATRIX_TEST )
1701 definitelyIdentityMatrix=false; 1701 definitelyIdentityMatrix=false;
1702#endif 1702#endif
1703 return *this; 1703 return *this;
1704 } 1704 }
1705 1705
1706 1706
1707 // Builds a left-handed perspective projection matrix. 1707 // Builds a left-handed perspective projection matrix.
1708 template <class T> 1708 template <class T>
1709 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveLH( 1709 inline CMatrix4<T>& CMatrix4<T>::buildProjectionMatrixPerspectiveLH(
1710 f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar) 1710 f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar)
1711 { 1711 {
1712 _IRR_DEBUG_BREAK_IF(widthOfViewVolume==0.f); //divide by zero 1712 _IRR_DEBUG_BREAK_IF(widthOfViewVolume==0.f); //divide by zero
1713 _IRR_DEBUG_BREAK_IF(heightOfViewVolume==0.f); //divide by zero 1713 _IRR_DEBUG_BREAK_IF(heightOfViewVolume==0.f); //divide by zero
1714 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero 1714 _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero
1715 M[0] = (T)(2*zNear/widthOfViewVolume); 1715 M[0] = (T)(2*zNear/widthOfViewVolume);
1716 M[1] = 0; 1716 M[1] = 0;
1717 M[2] = 0; 1717 M[2] = 0;
1718 M[3] = 0; 1718 M[3] = 0;
1719 1719
1720 M[4] = 0; 1720 M[4] = 0;
1721 M[5] = (T)(2*zNear/heightOfViewVolume); 1721 M[5] = (T)(2*zNear/heightOfViewVolume);
1722 M[6] = 0; 1722 M[6] = 0;
1723 M[7] = 0; 1723 M[7] = 0;
1724 1724
1725 M[8] = 0; 1725 M[8] = 0;
1726 M[9] = 0; 1726 M[9] = 0;
1727 M[10] = (T)(zFar/(zFar-zNear)); 1727 M[10] = (T)(zFar/(zFar-zNear));
1728 M[11] = 1; 1728 M[11] = 1;
1729 1729
1730 M[12] = 0; 1730 M[12] = 0;
1731 M[13] = 0; 1731 M[13] = 0;
1732 M[14] = (T)(zNear*zFar/(zNear-zFar)); 1732 M[14] = (T)(zNear*zFar/(zNear-zFar));
1733 M[15] = 0; 1733 M[15] = 0;
1734#if defined ( USE_MATRIX_TEST ) 1734#if defined ( USE_MATRIX_TEST )
1735 definitelyIdentityMatrix=false; 1735 definitelyIdentityMatrix=false;
1736#endif 1736#endif
1737 return *this; 1737 return *this;
1738 } 1738 }
1739 1739
1740 1740
1741 // Builds a matrix that flattens geometry into a plane. 1741 // Builds a matrix that flattens geometry into a plane.
1742 template <class T> 1742 template <class T>
1743 inline CMatrix4<T>& CMatrix4<T>::buildShadowMatrix(const core::vector3df& light, core::plane3df plane, f32 point) 1743 inline CMatrix4<T>& CMatrix4<T>::buildShadowMatrix(const core::vector3df& light, core::plane3df plane, f32 point)
1744 { 1744 {
1745 plane.Normal.normalize(); 1745 plane.Normal.normalize();
1746 const f32 d = plane.Normal.dotProduct(light); 1746 const f32 d = plane.Normal.dotProduct(light);
1747 1747
1748 M[ 0] = (T)(-plane.Normal.X * light.X + d); 1748 M[ 0] = (T)(-plane.Normal.X * light.X + d);
1749 M[ 1] = (T)(-plane.Normal.X * light.Y); 1749 M[ 1] = (T)(-plane.Normal.X * light.Y);
1750 M[ 2] = (T)(-plane.Normal.X * light.Z); 1750 M[ 2] = (T)(-plane.Normal.X * light.Z);
1751 M[ 3] = (T)(-plane.Normal.X * point); 1751 M[ 3] = (T)(-plane.Normal.X * point);
1752 1752
1753 M[ 4] = (T)(-plane.Normal.Y * light.X); 1753 M[ 4] = (T)(-plane.Normal.Y * light.X);
1754 M[ 5] = (T)(-plane.Normal.Y * light.Y + d); 1754 M[ 5] = (T)(-plane.Normal.Y * light.Y + d);
1755 M[ 6] = (T)(-plane.Normal.Y * light.Z); 1755 M[ 6] = (T)(-plane.Normal.Y * light.Z);
1756 M[ 7] = (T)(-plane.Normal.Y * point); 1756 M[ 7] = (T)(-plane.Normal.Y * point);
1757 1757
1758 M[ 8] = (T)(-plane.Normal.Z * light.X); 1758 M[ 8] = (T)(-plane.Normal.Z * light.X);
1759 M[ 9] = (T)(-plane.Normal.Z * light.Y); 1759 M[ 9] = (T)(-plane.Normal.Z * light.Y);
1760 M[10] = (T)(-plane.Normal.Z * light.Z + d); 1760 M[10] = (T)(-plane.Normal.Z * light.Z + d);
1761 M[11] = (T)(-plane.Normal.Z * point); 1761 M[11] = (T)(-plane.Normal.Z * point);
1762 1762
1763 M[12] = (T)(-plane.D * light.X); 1763 M[12] = (T)(-plane.D * light.X);
1764 M[13] = (T)(-plane.D * light.Y); 1764 M[13] = (T)(-plane.D * light.Y);
1765 M[14] = (T)(-plane.D * light.Z); 1765 M[14] = (T)(-plane.D * light.Z);
1766 M[15] = (T)(-plane.D * point + d); 1766 M[15] = (T)(-plane.D * point + d);
1767#if defined ( USE_MATRIX_TEST ) 1767#if defined ( USE_MATRIX_TEST )
1768 definitelyIdentityMatrix=false; 1768 definitelyIdentityMatrix=false;
1769#endif 1769#endif
1770 return *this; 1770 return *this;
1771 } 1771 }
1772 1772
1773 // Builds a left-handed look-at matrix. 1773 // Builds a left-handed look-at matrix.
1774 template <class T> 1774 template <class T>
1775 inline CMatrix4<T>& CMatrix4<T>::buildCameraLookAtMatrixLH( 1775 inline CMatrix4<T>& CMatrix4<T>::buildCameraLookAtMatrixLH(
1776 const vector3df& position, 1776 const vector3df& position,
1777 const vector3df& target, 1777 const vector3df& target,
1778 const vector3df& upVector) 1778 const vector3df& upVector)
1779 { 1779 {
1780 vector3df zaxis = target - position; 1780 vector3df zaxis = target - position;
1781 zaxis.normalize(); 1781 zaxis.normalize();
1782 1782
1783 vector3df xaxis = upVector.crossProduct(zaxis); 1783 vector3df xaxis = upVector.crossProduct(zaxis);
1784 xaxis.normalize(); 1784 xaxis.normalize();
1785 1785
1786 vector3df yaxis = zaxis.crossProduct(xaxis); 1786 vector3df yaxis = zaxis.crossProduct(xaxis);
1787 1787
1788 M[0] = (T)xaxis.X; 1788 M[0] = (T)xaxis.X;
1789 M[1] = (T)yaxis.X; 1789 M[1] = (T)yaxis.X;
1790 M[2] = (T)zaxis.X; 1790 M[2] = (T)zaxis.X;
1791 M[3] = 0; 1791 M[3] = 0;
1792 1792
1793 M[4] = (T)xaxis.Y; 1793 M[4] = (T)xaxis.Y;
1794 M[5] = (T)yaxis.Y; 1794 M[5] = (T)yaxis.Y;
1795 M[6] = (T)zaxis.Y; 1795 M[6] = (T)zaxis.Y;
1796 M[7] = 0; 1796 M[7] = 0;
1797 1797
1798 M[8] = (T)xaxis.Z; 1798 M[8] = (T)xaxis.Z;
1799 M[9] = (T)yaxis.Z; 1799 M[9] = (T)yaxis.Z;
1800 M[10] = (T)zaxis.Z; 1800 M[10] = (T)zaxis.Z;
1801 M[11] = 0; 1801 M[11] = 0;
1802 1802
1803 M[12] = (T)-xaxis.dotProduct(position); 1803 M[12] = (T)-xaxis.dotProduct(position);
1804 M[13] = (T)-yaxis.dotProduct(position); 1804 M[13] = (T)-yaxis.dotProduct(position);
1805 M[14] = (T)-zaxis.dotProduct(position); 1805 M[14] = (T)-zaxis.dotProduct(position);
1806 M[15] = 1; 1806 M[15] = 1;
1807#if defined ( USE_MATRIX_TEST ) 1807#if defined ( USE_MATRIX_TEST )
1808 definitelyIdentityMatrix=false; 1808 definitelyIdentityMatrix=false;
1809#endif 1809#endif
1810 return *this; 1810 return *this;
1811 } 1811 }
1812 1812
1813 1813
1814 // Builds a right-handed look-at matrix. 1814 // Builds a right-handed look-at matrix.
1815 template <class T> 1815 template <class T>
1816 inline CMatrix4<T>& CMatrix4<T>::buildCameraLookAtMatrixRH( 1816 inline CMatrix4<T>& CMatrix4<T>::buildCameraLookAtMatrixRH(
1817 const vector3df& position, 1817 const vector3df& position,
1818 const vector3df& target, 1818 const vector3df& target,
1819 const vector3df& upVector) 1819 const vector3df& upVector)
1820 { 1820 {
1821 vector3df zaxis = position - target; 1821 vector3df zaxis = position - target;
1822 zaxis.normalize(); 1822 zaxis.normalize();
1823 1823
1824 vector3df xaxis = upVector.crossProduct(zaxis); 1824 vector3df xaxis = upVector.crossProduct(zaxis);
1825 xaxis.normalize(); 1825 xaxis.normalize();
1826 1826
1827 vector3df yaxis = zaxis.crossProduct(xaxis); 1827 vector3df yaxis = zaxis.crossProduct(xaxis);
1828 1828
1829 M[0] = (T)xaxis.X; 1829 M[0] = (T)xaxis.X;
1830 M[1] = (T)yaxis.X; 1830 M[1] = (T)yaxis.X;
1831 M[2] = (T)zaxis.X; 1831 M[2] = (T)zaxis.X;
1832 M[3] = 0; 1832 M[3] = 0;
1833 1833
1834 M[4] = (T)xaxis.Y; 1834 M[4] = (T)xaxis.Y;
1835 M[5] = (T)yaxis.Y; 1835 M[5] = (T)yaxis.Y;
1836 M[6] = (T)zaxis.Y; 1836 M[6] = (T)zaxis.Y;
1837 M[7] = 0; 1837 M[7] = 0;
1838 1838
1839 M[8] = (T)xaxis.Z; 1839 M[8] = (T)xaxis.Z;
1840 M[9] = (T)yaxis.Z; 1840 M[9] = (T)yaxis.Z;
1841 M[10] = (T)zaxis.Z; 1841 M[10] = (T)zaxis.Z;
1842 M[11] = 0; 1842 M[11] = 0;
1843 1843
1844 M[12] = (T)-xaxis.dotProduct(position); 1844 M[12] = (T)-xaxis.dotProduct(position);
1845 M[13] = (T)-yaxis.dotProduct(position); 1845 M[13] = (T)-yaxis.dotProduct(position);
1846 M[14] = (T)-zaxis.dotProduct(position); 1846 M[14] = (T)-zaxis.dotProduct(position);
1847 M[15] = 1; 1847 M[15] = 1;
1848#if defined ( USE_MATRIX_TEST ) 1848#if defined ( USE_MATRIX_TEST )
1849 definitelyIdentityMatrix=false; 1849 definitelyIdentityMatrix=false;
1850#endif 1850#endif
1851 return *this; 1851 return *this;
1852 } 1852 }
1853 1853
1854 1854
1855 // creates a new matrix as interpolated matrix from this and the passed one. 1855 // creates a new matrix as interpolated matrix from this and the passed one.
1856 template <class T> 1856 template <class T>
1857 inline CMatrix4<T> CMatrix4<T>::interpolate(const core::CMatrix4<T>& b, f32 time) const 1857 inline CMatrix4<T> CMatrix4<T>::interpolate(const core::CMatrix4<T>& b, f32 time) const
1858 { 1858 {
1859 CMatrix4<T> mat ( EM4CONST_NOTHING ); 1859 CMatrix4<T> mat ( EM4CONST_NOTHING );
1860 1860
1861 for (u32 i=0; i < 16; i += 4) 1861 for (u32 i=0; i < 16; i += 4)
1862 { 1862 {
1863 mat.M[i+0] = (T)(M[i+0] + ( b.M[i+0] - M[i+0] ) * time); 1863 mat.M[i+0] = (T)(M[i+0] + ( b.M[i+0] - M[i+0] ) * time);
1864 mat.M[i+1] = (T)(M[i+1] + ( b.M[i+1] - M[i+1] ) * time); 1864 mat.M[i+1] = (T)(M[i+1] + ( b.M[i+1] - M[i+1] ) * time);
1865 mat.M[i+2] = (T)(M[i+2] + ( b.M[i+2] - M[i+2] ) * time); 1865 mat.M[i+2] = (T)(M[i+2] + ( b.M[i+2] - M[i+2] ) * time);
1866 mat.M[i+3] = (T)(M[i+3] + ( b.M[i+3] - M[i+3] ) * time); 1866 mat.M[i+3] = (T)(M[i+3] + ( b.M[i+3] - M[i+3] ) * time);
1867 } 1867 }
1868 return mat; 1868 return mat;
1869 } 1869 }
1870 1870
1871 1871
1872 // returns transposed matrix 1872 // returns transposed matrix
1873 template <class T> 1873 template <class T>
1874 inline CMatrix4<T> CMatrix4<T>::getTransposed() const 1874 inline CMatrix4<T> CMatrix4<T>::getTransposed() const
1875 { 1875 {
1876 CMatrix4<T> t ( EM4CONST_NOTHING ); 1876 CMatrix4<T> t ( EM4CONST_NOTHING );
1877 getTransposed ( t ); 1877 getTransposed ( t );
1878 return t; 1878 return t;
1879 } 1879 }
1880 1880
1881 1881
1882 // returns transposed matrix 1882 // returns transposed matrix
1883 template <class T> 1883 template <class T>
1884 inline void CMatrix4<T>::getTransposed( CMatrix4<T>& o ) const 1884 inline void CMatrix4<T>::getTransposed( CMatrix4<T>& o ) const
1885 { 1885 {
1886 o[ 0] = M[ 0]; 1886 o[ 0] = M[ 0];
1887 o[ 1] = M[ 4]; 1887 o[ 1] = M[ 4];
1888 o[ 2] = M[ 8]; 1888 o[ 2] = M[ 8];
1889 o[ 3] = M[12]; 1889 o[ 3] = M[12];
1890 1890
1891 o[ 4] = M[ 1]; 1891 o[ 4] = M[ 1];
1892 o[ 5] = M[ 5]; 1892 o[ 5] = M[ 5];
1893 o[ 6] = M[ 9]; 1893 o[ 6] = M[ 9];
1894 o[ 7] = M[13]; 1894 o[ 7] = M[13];
1895 1895
1896 o[ 8] = M[ 2]; 1896 o[ 8] = M[ 2];
1897 o[ 9] = M[ 6]; 1897 o[ 9] = M[ 6];
1898 o[10] = M[10]; 1898 o[10] = M[10];
1899 o[11] = M[14]; 1899 o[11] = M[14];
1900 1900
1901 o[12] = M[ 3]; 1901 o[12] = M[ 3];
1902 o[13] = M[ 7]; 1902 o[13] = M[ 7];
1903 o[14] = M[11]; 1903 o[14] = M[11];
1904 o[15] = M[15]; 1904 o[15] = M[15];
1905#if defined ( USE_MATRIX_TEST ) 1905#if defined ( USE_MATRIX_TEST )
1906 o.definitelyIdentityMatrix=definitelyIdentityMatrix; 1906 o.definitelyIdentityMatrix=definitelyIdentityMatrix;
1907#endif 1907#endif
1908 } 1908 }
1909 1909
1910 1910
1911 // used to scale <-1,-1><1,1> to viewport 1911 // used to scale <-1,-1><1,1> to viewport
1912 template <class T> 1912 template <class T>
1913 inline CMatrix4<T>& CMatrix4<T>::buildNDCToDCMatrix( const core::rect<s32>& viewport, f32 zScale) 1913 inline CMatrix4<T>& CMatrix4<T>::buildNDCToDCMatrix( const core::rect<s32>& viewport, f32 zScale)
1914 { 1914 {
1915 const f32 scaleX = (viewport.getWidth() - 0.75f ) * 0.5f; 1915 const f32 scaleX = (viewport.getWidth() - 0.75f ) * 0.5f;
1916 const f32 scaleY = -(viewport.getHeight() - 0.75f ) * 0.5f; 1916 const f32 scaleY = -(viewport.getHeight() - 0.75f ) * 0.5f;
1917 1917
1918 const f32 dx = -0.5f + ( (viewport.UpperLeftCorner.X + viewport.LowerRightCorner.X ) * 0.5f ); 1918 const f32 dx = -0.5f + ( (viewport.UpperLeftCorner.X + viewport.LowerRightCorner.X ) * 0.5f );
1919 const f32 dy = -0.5f + ( (viewport.UpperLeftCorner.Y + viewport.LowerRightCorner.Y ) * 0.5f ); 1919 const f32 dy = -0.5f + ( (viewport.UpperLeftCorner.Y + viewport.LowerRightCorner.Y ) * 0.5f );
1920 1920
1921 makeIdentity(); 1921 makeIdentity();
1922 M[12] = (T)dx; 1922 M[12] = (T)dx;
1923 M[13] = (T)dy; 1923 M[13] = (T)dy;
1924 return setScale(core::vector3d<T>((T)scaleX, (T)scaleY, (T)zScale)); 1924 return setScale(core::vector3d<T>((T)scaleX, (T)scaleY, (T)zScale));
1925 } 1925 }
1926 1926
1927 //! Builds a matrix that rotates from one vector to another 1927 //! Builds a matrix that rotates from one vector to another
1928 /** \param from: vector to rotate from 1928 /** \param from: vector to rotate from
1929 \param to: vector to rotate to 1929 \param to: vector to rotate to
1930 1930
1931 http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToMatrix/index.htm 1931 http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToMatrix/index.htm
1932 */ 1932 */
1933 template <class T> 1933 template <class T>
1934 inline CMatrix4<T>& CMatrix4<T>::buildRotateFromTo(const core::vector3df& from, const core::vector3df& to) 1934 inline CMatrix4<T>& CMatrix4<T>::buildRotateFromTo(const core::vector3df& from, const core::vector3df& to)
1935 { 1935 {
1936 // unit vectors 1936 // unit vectors
1937 core::vector3df f(from); 1937 core::vector3df f(from);
1938 core::vector3df t(to); 1938 core::vector3df t(to);
1939 f.normalize(); 1939 f.normalize();
1940 t.normalize(); 1940 t.normalize();
1941 1941
1942 // axis multiplication by sin 1942 // axis multiplication by sin
1943 core::vector3df vs(t.crossProduct(f)); 1943 core::vector3df vs(t.crossProduct(f));
1944 1944
1945 // axis of rotation 1945 // axis of rotation
1946 core::vector3df v(vs); 1946 core::vector3df v(vs);
1947 v.normalize(); 1947 v.normalize();
1948 1948
1949 // cosinus angle 1949 // cosinus angle
1950 T ca = f.dotProduct(t); 1950 T ca = f.dotProduct(t);
1951 1951
1952 core::vector3df vt(v * (1 - ca)); 1952 core::vector3df vt(v * (1 - ca));
1953 1953
1954 M[0] = vt.X * v.X + ca; 1954 M[0] = vt.X * v.X + ca;
1955 M[5] = vt.Y * v.Y + ca; 1955 M[5] = vt.Y * v.Y + ca;
1956 M[10] = vt.Z * v.Z + ca; 1956 M[10] = vt.Z * v.Z + ca;
1957 1957
1958 vt.X *= v.Y; 1958 vt.X *= v.Y;
1959 vt.Z *= v.X; 1959 vt.Z *= v.X;
1960 vt.Y *= v.Z; 1960 vt.Y *= v.Z;
1961 1961
1962 M[1] = vt.X - vs.Z; 1962 M[1] = vt.X - vs.Z;
1963 M[2] = vt.Z + vs.Y; 1963 M[2] = vt.Z + vs.Y;
1964 M[3] = 0; 1964 M[3] = 0;
1965 1965
1966 M[4] = vt.X + vs.Z; 1966 M[4] = vt.X + vs.Z;
1967 M[6] = vt.Y - vs.X; 1967 M[6] = vt.Y - vs.X;
1968 M[7] = 0; 1968 M[7] = 0;
1969 1969
1970 M[8] = vt.Z - vs.Y; 1970 M[8] = vt.Z - vs.Y;
1971 M[9] = vt.Y + vs.X; 1971 M[9] = vt.Y + vs.X;
1972 M[11] = 0; 1972 M[11] = 0;
1973 1973
1974 M[12] = 0; 1974 M[12] = 0;
1975 M[13] = 0; 1975 M[13] = 0;
1976 M[14] = 0; 1976 M[14] = 0;
1977 M[15] = 1; 1977 M[15] = 1;
1978 1978
1979 return *this; 1979 return *this;
1980 } 1980 }
1981 1981
1982 //! Builds a matrix which rotates a source vector to a look vector over an arbitrary axis 1982 //! Builds a matrix which rotates a source vector to a look vector over an arbitrary axis
1983 /** \param camPos: viewer position in world coord 1983 /** \param camPos: viewer position in world coord
1984 \param center: object position in world-coord, rotation pivot 1984 \param center: object position in world-coord, rotation pivot
1985 \param translation: object final translation from center 1985 \param translation: object final translation from center
1986 \param axis: axis to rotate about 1986 \param axis: axis to rotate about
1987 \param from: source vector to rotate from 1987 \param from: source vector to rotate from
1988 */ 1988 */
1989 template <class T> 1989 template <class T>
1990 inline void CMatrix4<T>::buildAxisAlignedBillboard( 1990 inline void CMatrix4<T>::buildAxisAlignedBillboard(
1991 const core::vector3df& camPos, 1991 const core::vector3df& camPos,
1992 const core::vector3df& center, 1992 const core::vector3df& center,
1993 const core::vector3df& translation, 1993 const core::vector3df& translation,
1994 const core::vector3df& axis, 1994 const core::vector3df& axis,
1995 const core::vector3df& from) 1995 const core::vector3df& from)
1996 { 1996 {
1997 // axis of rotation 1997 // axis of rotation
1998 core::vector3df up = axis; 1998 core::vector3df up = axis;
1999 up.normalize(); 1999 up.normalize();
2000 const core::vector3df forward = (camPos - center).normalize(); 2000 const core::vector3df forward = (camPos - center).normalize();
2001 const core::vector3df right = up.crossProduct(forward).normalize(); 2001 const core::vector3df right = up.crossProduct(forward).normalize();
2002 2002
2003 // correct look vector 2003 // correct look vector
2004 const core::vector3df look = right.crossProduct(up); 2004 const core::vector3df look = right.crossProduct(up);
2005 2005
2006 // rotate from to 2006 // rotate from to
2007 // axis multiplication by sin 2007 // axis multiplication by sin
2008 const core::vector3df vs = look.crossProduct(from); 2008 const core::vector3df vs = look.crossProduct(from);
2009 2009
2010 // cosinus angle 2010 // cosinus angle
2011 const f32 ca = from.dotProduct(look); 2011 const f32 ca = from.dotProduct(look);
2012 2012
2013 core::vector3df vt(up * (1.f - ca)); 2013 core::vector3df vt(up * (1.f - ca));
2014 2014
2015 M[0] = static_cast<T>(vt.X * up.X + ca); 2015 M[0] = static_cast<T>(vt.X * up.X + ca);
2016 M[5] = static_cast<T>(vt.Y * up.Y + ca); 2016 M[5] = static_cast<T>(vt.Y * up.Y + ca);
2017 M[10] = static_cast<T>(vt.Z * up.Z + ca); 2017 M[10] = static_cast<T>(vt.Z * up.Z + ca);
2018 2018
2019 vt.X *= up.Y; 2019 vt.X *= up.Y;
2020 vt.Z *= up.X; 2020 vt.Z *= up.X;
2021 vt.Y *= up.Z; 2021 vt.Y *= up.Z;
2022 2022
2023 M[1] = static_cast<T>(vt.X - vs.Z); 2023 M[1] = static_cast<T>(vt.X - vs.Z);
2024 M[2] = static_cast<T>(vt.Z + vs.Y); 2024 M[2] = static_cast<T>(vt.Z + vs.Y);
2025 M[3] = 0; 2025 M[3] = 0;
2026 2026
2027 M[4] = static_cast<T>(vt.X + vs.Z); 2027 M[4] = static_cast<T>(vt.X + vs.Z);
2028 M[6] = static_cast<T>(vt.Y - vs.X); 2028 M[6] = static_cast<T>(vt.Y - vs.X);
2029 M[7] = 0; 2029 M[7] = 0;
2030 2030
2031 M[8] = static_cast<T>(vt.Z - vs.Y); 2031 M[8] = static_cast<T>(vt.Z - vs.Y);
2032 M[9] = static_cast<T>(vt.Y + vs.X); 2032 M[9] = static_cast<T>(vt.Y + vs.X);
2033 M[11] = 0; 2033 M[11] = 0;
2034 2034
2035 setRotationCenter(center, translation); 2035 setRotationCenter(center, translation);
2036 } 2036 }
2037 2037
2038 2038
2039 //! Builds a combined matrix which translate to a center before rotation and translate afterwards 2039 //! Builds a combined matrix which translate to a center before rotation and translate afterwards
2040 template <class T> 2040 template <class T>
2041 inline void CMatrix4<T>::setRotationCenter(const core::vector3df& center, const core::vector3df& translation) 2041 inline void CMatrix4<T>::setRotationCenter(const core::vector3df& center, const core::vector3df& translation)
2042 { 2042 {
2043 M[12] = -M[0]*center.X - M[4]*center.Y - M[8]*center.Z + (center.X - translation.X ); 2043 M[12] = -M[0]*center.X - M[4]*center.Y - M[8]*center.Z + (center.X - translation.X );
2044 M[13] = -M[1]*center.X - M[5]*center.Y - M[9]*center.Z + (center.Y - translation.Y ); 2044 M[13] = -M[1]*center.X - M[5]*center.Y - M[9]*center.Z + (center.Y - translation.Y );
2045 M[14] = -M[2]*center.X - M[6]*center.Y - M[10]*center.Z + (center.Z - translation.Z ); 2045 M[14] = -M[2]*center.X - M[6]*center.Y - M[10]*center.Z + (center.Z - translation.Z );
2046 M[15] = (T) 1.0; 2046 M[15] = (T) 1.0;
2047#if defined ( USE_MATRIX_TEST ) 2047#if defined ( USE_MATRIX_TEST )
2048 definitelyIdentityMatrix=false; 2048 definitelyIdentityMatrix=false;
2049#endif 2049#endif
2050 } 2050 }
2051 2051
2052 /*! 2052 /*!
2053 Generate texture coordinates as linear functions so that: 2053 Generate texture coordinates as linear functions so that:
2054 u = Ux*x + Uy*y + Uz*z + Uw 2054 u = Ux*x + Uy*y + Uz*z + Uw
2055 v = Vx*x + Vy*y + Vz*z + Vw 2055 v = Vx*x + Vy*y + Vz*z + Vw
2056 The matrix M for this case is: 2056 The matrix M for this case is:
2057 Ux Vx 0 0 2057 Ux Vx 0 0
2058 Uy Vy 0 0 2058 Uy Vy 0 0
2059 Uz Vz 0 0 2059 Uz Vz 0 0
2060 Uw Vw 0 0 2060 Uw Vw 0 0
2061 */ 2061 */
2062 2062
2063 2063
2064 template <class T> 2064 template <class T>
2065 inline CMatrix4<T>& CMatrix4<T>::buildTextureTransform( f32 rotateRad, 2065 inline CMatrix4<T>& CMatrix4<T>::buildTextureTransform( f32 rotateRad,
2066 const core::vector2df &rotatecenter, 2066 const core::vector2df &rotatecenter,
2067 const core::vector2df &translate, 2067 const core::vector2df &translate,
2068 const core::vector2df &scale) 2068 const core::vector2df &scale)
2069 { 2069 {
2070 const f32 c = cosf(rotateRad); 2070 const f32 c = cosf(rotateRad);
2071 const f32 s = sinf(rotateRad); 2071 const f32 s = sinf(rotateRad);
2072 2072
2073 M[0] = (T)(c * scale.X); 2073 M[0] = (T)(c * scale.X);
2074 M[1] = (T)(s * scale.Y); 2074 M[1] = (T)(s * scale.Y);
2075 M[2] = 0; 2075 M[2] = 0;
2076 M[3] = 0; 2076 M[3] = 0;
2077 2077
2078 M[4] = (T)(-s * scale.X); 2078 M[4] = (T)(-s * scale.X);
2079 M[5] = (T)(c * scale.Y); 2079 M[5] = (T)(c * scale.Y);
2080 M[6] = 0; 2080 M[6] = 0;
2081 M[7] = 0; 2081 M[7] = 0;
2082 2082
2083 M[8] = (T)(c * scale.X * rotatecenter.X + -s * rotatecenter.Y + translate.X); 2083 M[8] = (T)(c * scale.X * rotatecenter.X + -s * rotatecenter.Y + translate.X);
2084 M[9] = (T)(s * scale.Y * rotatecenter.X + c * rotatecenter.Y + translate.Y); 2084 M[9] = (T)(s * scale.Y * rotatecenter.X + c * rotatecenter.Y + translate.Y);
2085 M[10] = 1; 2085 M[10] = 1;
2086 M[11] = 0; 2086 M[11] = 0;
2087 2087
2088 M[12] = 0; 2088 M[12] = 0;
2089 M[13] = 0; 2089 M[13] = 0;
2090 M[14] = 0; 2090 M[14] = 0;
2091 M[15] = 1; 2091 M[15] = 1;
2092#if defined ( USE_MATRIX_TEST ) 2092#if defined ( USE_MATRIX_TEST )
2093 definitelyIdentityMatrix=false; 2093 definitelyIdentityMatrix=false;
2094#endif 2094#endif
2095 return *this; 2095 return *this;
2096 } 2096 }
2097 2097
2098 2098
2099 // rotate about z axis, center ( 0.5, 0.5 ) 2099 // rotate about z axis, center ( 0.5, 0.5 )
2100 template <class T> 2100 template <class T>
2101 inline CMatrix4<T>& CMatrix4<T>::setTextureRotationCenter( f32 rotateRad ) 2101 inline CMatrix4<T>& CMatrix4<T>::setTextureRotationCenter( f32 rotateRad )
2102 { 2102 {
2103 const f32 c = cosf(rotateRad); 2103 const f32 c = cosf(rotateRad);
2104 const f32 s = sinf(rotateRad); 2104 const f32 s = sinf(rotateRad);
2105 M[0] = (T)c; 2105 M[0] = (T)c;
2106 M[1] = (T)s; 2106 M[1] = (T)s;
2107 2107
2108 M[4] = (T)-s; 2108 M[4] = (T)-s;
2109 M[5] = (T)c; 2109 M[5] = (T)c;
2110 2110
2111 M[8] = (T)(0.5f * ( s - c) + 0.5f); 2111 M[8] = (T)(0.5f * ( s - c) + 0.5f);
2112 M[9] = (T)(-0.5f * ( s + c) + 0.5f); 2112 M[9] = (T)(-0.5f * ( s + c) + 0.5f);
2113 2113
2114#if defined ( USE_MATRIX_TEST ) 2114#if defined ( USE_MATRIX_TEST )
2115 definitelyIdentityMatrix = definitelyIdentityMatrix && (rotateRad==0.0f); 2115 definitelyIdentityMatrix = definitelyIdentityMatrix && (rotateRad==0.0f);
2116#endif 2116#endif
2117 return *this; 2117 return *this;
2118 } 2118 }
2119 2119
2120 2120
2121 template <class T> 2121 template <class T>
2122 inline CMatrix4<T>& CMatrix4<T>::setTextureTranslate ( f32 x, f32 y ) 2122 inline CMatrix4<T>& CMatrix4<T>::setTextureTranslate ( f32 x, f32 y )
2123 { 2123 {
2124 M[8] = (T)x; 2124 M[8] = (T)x;
2125 M[9] = (T)y; 2125 M[9] = (T)y;
2126 2126
2127#if defined ( USE_MATRIX_TEST ) 2127#if defined ( USE_MATRIX_TEST )
2128 definitelyIdentityMatrix = definitelyIdentityMatrix && (x==0.0f) && (y==0.0f); 2128 definitelyIdentityMatrix = definitelyIdentityMatrix && (x==0.0f) && (y==0.0f);
2129#endif 2129#endif
2130 return *this; 2130 return *this;
2131 } 2131 }
2132 2132
2133 2133
2134 template <class T> 2134 template <class T>
2135 inline CMatrix4<T>& CMatrix4<T>::setTextureTranslateTransposed ( f32 x, f32 y ) 2135 inline CMatrix4<T>& CMatrix4<T>::setTextureTranslateTransposed ( f32 x, f32 y )
2136 { 2136 {
2137 M[2] = (T)x; 2137 M[2] = (T)x;
2138 M[6] = (T)y; 2138 M[6] = (T)y;
2139 2139
2140#if defined ( USE_MATRIX_TEST ) 2140#if defined ( USE_MATRIX_TEST )
2141 definitelyIdentityMatrix = definitelyIdentityMatrix && (x==0.0f) && (y==0.0f) ; 2141 definitelyIdentityMatrix = definitelyIdentityMatrix && (x==0.0f) && (y==0.0f) ;
2142#endif 2142#endif
2143 return *this; 2143 return *this;
2144 } 2144 }
2145 2145
2146 template <class T> 2146 template <class T>
2147 inline CMatrix4<T>& CMatrix4<T>::setTextureScale ( f32 sx, f32 sy ) 2147 inline CMatrix4<T>& CMatrix4<T>::setTextureScale ( f32 sx, f32 sy )
2148 { 2148 {
2149 M[0] = (T)sx; 2149 M[0] = (T)sx;
2150 M[5] = (T)sy; 2150 M[5] = (T)sy;
2151#if defined ( USE_MATRIX_TEST ) 2151#if defined ( USE_MATRIX_TEST )
2152 definitelyIdentityMatrix = definitelyIdentityMatrix && (sx==1.0f) && (sy==1.0f); 2152 definitelyIdentityMatrix = definitelyIdentityMatrix && (sx==1.0f) && (sy==1.0f);
2153#endif 2153#endif
2154 return *this; 2154 return *this;
2155 } 2155 }
2156 2156
2157 2157
2158 template <class T> 2158 template <class T>
2159 inline CMatrix4<T>& CMatrix4<T>::setTextureScaleCenter( f32 sx, f32 sy ) 2159 inline CMatrix4<T>& CMatrix4<T>::setTextureScaleCenter( f32 sx, f32 sy )
2160 { 2160 {
2161 M[0] = (T)sx; 2161 M[0] = (T)sx;
2162 M[5] = (T)sy; 2162 M[5] = (T)sy;
2163 M[8] = (T)(0.5f - 0.5f * sx); 2163 M[8] = (T)(0.5f - 0.5f * sx);
2164 M[9] = (T)(0.5f - 0.5f * sy); 2164 M[9] = (T)(0.5f - 0.5f * sy);
2165 2165
2166#if defined ( USE_MATRIX_TEST ) 2166#if defined ( USE_MATRIX_TEST )
2167 definitelyIdentityMatrix = definitelyIdentityMatrix && (sx==1.0f) && (sy==1.0f); 2167 definitelyIdentityMatrix = definitelyIdentityMatrix && (sx==1.0f) && (sy==1.0f);
2168#endif 2168#endif
2169 return *this; 2169 return *this;
2170 } 2170 }
2171 2171
2172 2172
2173 // sets all matrix data members at once 2173 // sets all matrix data members at once
2174 template <class T> 2174 template <class T>
2175 inline CMatrix4<T>& CMatrix4<T>::setM(const T* data) 2175 inline CMatrix4<T>& CMatrix4<T>::setM(const T* data)
2176 { 2176 {
2177 memcpy(M,data, 16*sizeof(T)); 2177 memcpy(M,data, 16*sizeof(T));
2178 2178
2179#if defined ( USE_MATRIX_TEST ) 2179#if defined ( USE_MATRIX_TEST )
2180 definitelyIdentityMatrix=false; 2180 definitelyIdentityMatrix=false;
2181#endif 2181#endif
2182 return *this; 2182 return *this;
2183 } 2183 }
2184 2184
2185 2185
2186 // sets if the matrix is definitely identity matrix 2186 // sets if the matrix is definitely identity matrix
2187 template <class T> 2187 template <class T>
2188 inline void CMatrix4<T>::setDefinitelyIdentityMatrix( bool isDefinitelyIdentityMatrix) 2188 inline void CMatrix4<T>::setDefinitelyIdentityMatrix( bool isDefinitelyIdentityMatrix)
2189 { 2189 {
2190#if defined ( USE_MATRIX_TEST ) 2190#if defined ( USE_MATRIX_TEST )
2191 definitelyIdentityMatrix = isDefinitelyIdentityMatrix; 2191 definitelyIdentityMatrix = isDefinitelyIdentityMatrix;
2192#endif 2192#endif
2193 } 2193 }
2194 2194
2195 2195
2196 // gets if the matrix is definitely identity matrix 2196 // gets if the matrix is definitely identity matrix
2197 template <class T> 2197 template <class T>
2198 inline bool CMatrix4<T>::getDefinitelyIdentityMatrix() const 2198 inline bool CMatrix4<T>::getDefinitelyIdentityMatrix() const
2199 { 2199 {
2200#if defined ( USE_MATRIX_TEST ) 2200#if defined ( USE_MATRIX_TEST )
2201 return definitelyIdentityMatrix; 2201 return definitelyIdentityMatrix;
2202#else 2202#else
2203 return false; 2203 return false;
2204#endif 2204#endif
2205 } 2205 }
2206 2206
2207 2207
2208 //! Compare two matrices using the equal method 2208 //! Compare two matrices using the equal method
2209 template <class T> 2209 template <class T>
2210 inline bool CMatrix4<T>::equals(const core::CMatrix4<T>& other, const T tolerance) const 2210 inline bool CMatrix4<T>::equals(const core::CMatrix4<T>& other, const T tolerance) const
2211 { 2211 {
2212#if defined ( USE_MATRIX_TEST ) 2212#if defined ( USE_MATRIX_TEST )
2213 if (definitelyIdentityMatrix && other.definitelyIdentityMatrix) 2213 if (definitelyIdentityMatrix && other.definitelyIdentityMatrix)
2214 return true; 2214 return true;
2215#endif 2215#endif
2216 for (s32 i = 0; i < 16; ++i) 2216 for (s32 i = 0; i < 16; ++i)
2217 if (!core::equals(M[i],other.M[i], tolerance)) 2217 if (!core::equals(M[i],other.M[i], tolerance))
2218 return false; 2218 return false;
2219 2219
2220 return true; 2220 return true;
2221 } 2221 }
2222 2222
2223 2223
2224 // Multiply by scalar. 2224 // Multiply by scalar.
2225 template <class T> 2225 template <class T>
2226 inline CMatrix4<T> operator*(const T scalar, const CMatrix4<T>& mat) 2226 inline CMatrix4<T> operator*(const T scalar, const CMatrix4<T>& mat)
2227 { 2227 {
2228 return mat*scalar; 2228 return mat*scalar;
2229 } 2229 }
2230 2230
2231 2231
2232 //! Typedef for f32 matrix 2232 //! Typedef for f32 matrix
2233 typedef CMatrix4<f32> matrix4; 2233 typedef CMatrix4<f32> matrix4;
2234 2234
2235 //! global const identity matrix 2235 //! global const identity matrix
2236 IRRLICHT_API extern const matrix4 IdentityMatrix; 2236 IRRLICHT_API extern const matrix4 IdentityMatrix;
2237 2237
2238} // end namespace core 2238} // end namespace core
2239} // end namespace irr 2239} // end namespace irr
2240 2240
2241#endif 2241#endif
2242 2242
diff --git a/libraries/irrlicht-1.8/include/path.h b/libraries/irrlicht-1.8/include/path.h
index b537987..ed7661c 100644
--- a/libraries/irrlicht-1.8/include/path.h
+++ b/libraries/irrlicht-1.8/include/path.h
@@ -1,88 +1,88 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt 1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine" and the "irrXML" project. 2// This file is part of the "Irrlicht Engine" and the "irrXML" project.
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#ifndef __IRR_PATH_H_INCLUDED__ 5#ifndef __IRR_PATH_H_INCLUDED__
6#define __IRR_PATH_H_INCLUDED__ 6#define __IRR_PATH_H_INCLUDED__
7 7
8#include "irrString.h" 8#include "irrString.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace io 12namespace io
13{ 13{
14 14
15//! Type used for all file system related strings. 15//! Type used for all file system related strings.
16/** This type will transparently handle different file system encodings. */ 16/** This type will transparently handle different file system encodings. */
17typedef core::string<fschar_t> path; 17typedef core::string<fschar_t> path;
18 18
19//! Used in places where we identify objects by a filename, but don't actually work with the real filename 19//! Used in places where we identify objects by a filename, but don't actually work with the real filename
20/** Irrlicht is internally not case-sensitive when it comes to names. 20/** Irrlicht is internally not case-sensitive when it comes to names.
21 Also this class is a first step towards support for correctly serializing renamed objects. 21 Also this class is a first step towards support for correctly serializing renamed objects.
22*/ 22*/
23struct SNamedPath 23struct SNamedPath
24{ 24{
25 //! Constructor 25 //! Constructor
26 SNamedPath() {} 26 SNamedPath() {}
27 27
28 //! Constructor 28 //! Constructor
29 SNamedPath(const path& p) : Path(p), InternalName( PathToName(p) ) 29 SNamedPath(const path& p) : Path(p), InternalName( PathToName(p) )
30 { 30 {
31 } 31 }
32 32
33 //! Is smaller comparator 33 //! Is smaller comparator
34 bool operator <(const SNamedPath& other) const 34 bool operator <(const SNamedPath& other) const
35 { 35 {
36 return InternalName < other.InternalName; 36 return InternalName < other.InternalName;
37 } 37 }
38 38
39 //! Set the path. 39 //! Set the path.
40 void setPath(const path& p) 40 void setPath(const path& p)
41 { 41 {
42 Path = p; 42 Path = p;
43 InternalName = PathToName(p); 43 InternalName = PathToName(p);
44 } 44 }
45 45
46 //! Get the path. 46 //! Get the path.
47 const path& getPath() const 47 const path& getPath() const
48 { 48 {
49 return Path; 49 return Path;
50 }; 50 };
51 51
52 //! Get the name which is used to identify the file. 52 //! Get the name which is used to identify the file.
53 //! This string is similar to the names and filenames used before Irrlicht 1.7 53 //! This string is similar to the names and filenames used before Irrlicht 1.7
54 const path& getInternalName() const 54 const path& getInternalName() const
55 { 55 {
56 return InternalName; 56 return InternalName;
57 } 57 }
58 58
59 //! Implicit cast to io::path 59 //! Implicit cast to io::path
60 operator core::stringc() const 60 operator core::stringc() const
61 { 61 {
62 return core::stringc(getPath()); 62 return core::stringc(getPath());
63 } 63 }
64 //! Implicit cast to io::path 64 //! Implicit cast to io::path
65 operator core::stringw() const 65 operator core::stringw() const
66 { 66 {
67 return core::stringw(getPath()); 67 return core::stringw(getPath());
68 } 68 }
69 69
70protected: 70protected:
71 // convert the given path string to a name string. 71 // convert the given path string to a name string.
72 path PathToName(const path& p) const 72 path PathToName(const path& p) const
73 { 73 {
74 path name(p); 74 path name(p);
75 name.replace( '\\', '/' ); 75 name.replace( '\\', '/' );
76 name.make_lower(); 76 name.make_lower();
77 return name; 77 return name;
78 } 78 }
79 79
80private: 80private:
81 path Path; 81 path Path;
82 path InternalName; 82 path InternalName;
83}; 83};
84 84
85} // io 85} // io
86} // irr 86} // irr
87 87
88#endif // __IRR_PATH_H_INCLUDED__ 88#endif // __IRR_PATH_H_INCLUDED__
diff --git a/libraries/irrlicht-1.8/include/plane3d.h b/libraries/irrlicht-1.8/include/plane3d.h
index 9056dcd..02c6bf9 100644
--- a/libraries/irrlicht-1.8/include/plane3d.h
+++ b/libraries/irrlicht-1.8/include/plane3d.h
@@ -1,245 +1,245 @@
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#ifndef __IRR_PLANE_3D_H_INCLUDED__ 5#ifndef __IRR_PLANE_3D_H_INCLUDED__
6#define __IRR_PLANE_3D_H_INCLUDED__ 6#define __IRR_PLANE_3D_H_INCLUDED__
7 7
8#include "irrMath.h" 8#include "irrMath.h"
9#include "vector3d.h" 9#include "vector3d.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace core 13namespace core
14{ 14{
15 15
16//! Enumeration for intersection relations of 3d objects 16//! Enumeration for intersection relations of 3d objects
17enum EIntersectionRelation3D 17enum EIntersectionRelation3D
18{ 18{
19 ISREL3D_FRONT = 0, 19 ISREL3D_FRONT = 0,
20 ISREL3D_BACK, 20 ISREL3D_BACK,
21 ISREL3D_PLANAR, 21 ISREL3D_PLANAR,
22 ISREL3D_SPANNING, 22 ISREL3D_SPANNING,
23 ISREL3D_CLIPPED 23 ISREL3D_CLIPPED
24}; 24};
25 25
26//! Template plane class with some intersection testing methods. 26//! Template plane class with some intersection testing methods.
27/** It has to be ensured, that the normal is always normalized. The constructors 27/** It has to be ensured, that the normal is always normalized. The constructors
28 and setters of this class will not ensure this automatically. So any normal 28 and setters of this class will not ensure this automatically. So any normal
29 passed in has to be normalized in advance. No change to the normal will be 29 passed in has to be normalized in advance. No change to the normal will be
30 made by any of the class methods. 30 made by any of the class methods.
31*/ 31*/
32template <class T> 32template <class T>
33class plane3d 33class plane3d
34{ 34{
35 public: 35 public:
36 36
37 // Constructors 37 // Constructors
38 38
39 plane3d(): Normal(0,1,0) { recalculateD(vector3d<T>(0,0,0)); } 39 plane3d(): Normal(0,1,0) { recalculateD(vector3d<T>(0,0,0)); }
40 40
41 plane3d(const vector3d<T>& MPoint, const vector3d<T>& Normal) : Normal(Normal) { recalculateD(MPoint); } 41 plane3d(const vector3d<T>& MPoint, const vector3d<T>& Normal) : Normal(Normal) { recalculateD(MPoint); }
42 42
43 plane3d(T px, T py, T pz, T nx, T ny, T nz) : Normal(nx, ny, nz) { recalculateD(vector3d<T>(px, py, pz)); } 43 plane3d(T px, T py, T pz, T nx, T ny, T nz) : Normal(nx, ny, nz) { recalculateD(vector3d<T>(px, py, pz)); }
44 44
45 plane3d(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3) 45 plane3d(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3)
46 { setPlane(point1, point2, point3); } 46 { setPlane(point1, point2, point3); }
47 47
48 plane3d(const vector3d<T> & normal, const T d) : Normal(normal), D(d) { } 48 plane3d(const vector3d<T> & normal, const T d) : Normal(normal), D(d) { }
49 49
50 // operators 50 // operators
51 51
52 inline bool operator==(const plane3d<T>& other) const { return (equals(D, other.D) && Normal==other.Normal);} 52 inline bool operator==(const plane3d<T>& other) const { return (equals(D, other.D) && Normal==other.Normal);}
53 53
54 inline bool operator!=(const plane3d<T>& other) const { return !(*this == other);} 54 inline bool operator!=(const plane3d<T>& other) const { return !(*this == other);}
55 55
56 // functions 56 // functions
57 57
58 void setPlane(const vector3d<T>& point, const vector3d<T>& nvector) 58 void setPlane(const vector3d<T>& point, const vector3d<T>& nvector)
59 { 59 {
60 Normal = nvector; 60 Normal = nvector;
61 recalculateD(point); 61 recalculateD(point);
62 } 62 }
63 63
64 void setPlane(const vector3d<T>& nvect, T d) 64 void setPlane(const vector3d<T>& nvect, T d)
65 { 65 {
66 Normal = nvect; 66 Normal = nvect;
67 D = d; 67 D = d;
68 } 68 }
69 69
70 void setPlane(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3) 70 void setPlane(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3)
71 { 71 {
72 // creates the plane from 3 memberpoints 72 // creates the plane from 3 memberpoints
73 Normal = (point2 - point1).crossProduct(point3 - point1); 73 Normal = (point2 - point1).crossProduct(point3 - point1);
74 Normal.normalize(); 74 Normal.normalize();
75 75
76 recalculateD(point1); 76 recalculateD(point1);
77 } 77 }
78 78
79 79
80 //! Get an intersection with a 3d line. 80 //! Get an intersection with a 3d line.
81 /** \param lineVect Vector of the line to intersect with. 81 /** \param lineVect Vector of the line to intersect with.
82 \param linePoint Point of the line to intersect with. 82 \param linePoint Point of the line to intersect with.
83 \param outIntersection Place to store the intersection point, if there is one. 83 \param outIntersection Place to store the intersection point, if there is one.
84 \return True if there was an intersection, false if there was not. 84 \return True if there was an intersection, false if there was not.
85 */ 85 */
86 bool getIntersectionWithLine(const vector3d<T>& linePoint, 86 bool getIntersectionWithLine(const vector3d<T>& linePoint,
87 const vector3d<T>& lineVect, 87 const vector3d<T>& lineVect,
88 vector3d<T>& outIntersection) const 88 vector3d<T>& outIntersection) const
89 { 89 {
90 T t2 = Normal.dotProduct(lineVect); 90 T t2 = Normal.dotProduct(lineVect);
91 91
92 if (t2 == 0) 92 if (t2 == 0)
93 return false; 93 return false;
94 94
95 T t =- (Normal.dotProduct(linePoint) + D) / t2; 95 T t =- (Normal.dotProduct(linePoint) + D) / t2;
96 outIntersection = linePoint + (lineVect * t); 96 outIntersection = linePoint + (lineVect * t);
97 return true; 97 return true;
98 } 98 }
99 99
100 //! Get percentage of line between two points where an intersection with this plane happens. 100 //! Get percentage of line between two points where an intersection with this plane happens.
101 /** Only useful if known that there is an intersection. 101 /** Only useful if known that there is an intersection.
102 \param linePoint1 Point1 of the line to intersect with. 102 \param linePoint1 Point1 of the line to intersect with.
103 \param linePoint2 Point2 of the line to intersect with. 103 \param linePoint2 Point2 of the line to intersect with.
104 \return Where on a line between two points an intersection with this plane happened. 104 \return Where on a line between two points an intersection with this plane happened.
105 For example, 0.5 is returned if the intersection happened exactly in the middle of the two points. 105 For example, 0.5 is returned if the intersection happened exactly in the middle of the two points.
106 */ 106 */
107 f32 getKnownIntersectionWithLine(const vector3d<T>& linePoint1, 107 f32 getKnownIntersectionWithLine(const vector3d<T>& linePoint1,
108 const vector3d<T>& linePoint2) const 108 const vector3d<T>& linePoint2) const
109 { 109 {
110 vector3d<T> vect = linePoint2 - linePoint1; 110 vector3d<T> vect = linePoint2 - linePoint1;
111 T t2 = (f32)Normal.dotProduct(vect); 111 T t2 = (f32)Normal.dotProduct(vect);
112 return (f32)-((Normal.dotProduct(linePoint1) + D) / t2); 112 return (f32)-((Normal.dotProduct(linePoint1) + D) / t2);
113 } 113 }
114 114
115 //! Get an intersection with a 3d line, limited between two 3d points. 115 //! Get an intersection with a 3d line, limited between two 3d points.
116 /** \param linePoint1 Point 1 of the line. 116 /** \param linePoint1 Point 1 of the line.
117 \param linePoint2 Point 2 of the line. 117 \param linePoint2 Point 2 of the line.
118 \param outIntersection Place to store the intersection point, if there is one. 118 \param outIntersection Place to store the intersection point, if there is one.
119 \return True if there was an intersection, false if there was not. 119 \return True if there was an intersection, false if there was not.
120 */ 120 */
121 bool getIntersectionWithLimitedLine( 121 bool getIntersectionWithLimitedLine(
122 const vector3d<T>& linePoint1, 122 const vector3d<T>& linePoint1,
123 const vector3d<T>& linePoint2, 123 const vector3d<T>& linePoint2,
124 vector3d<T>& outIntersection) const 124 vector3d<T>& outIntersection) const
125 { 125 {
126 return (getIntersectionWithLine(linePoint1, linePoint2 - linePoint1, outIntersection) && 126 return (getIntersectionWithLine(linePoint1, linePoint2 - linePoint1, outIntersection) &&
127 outIntersection.isBetweenPoints(linePoint1, linePoint2)); 127 outIntersection.isBetweenPoints(linePoint1, linePoint2));
128 } 128 }
129 129
130 //! Classifies the relation of a point to this plane. 130 //! Classifies the relation of a point to this plane.
131 /** \param point Point to classify its relation. 131 /** \param point Point to classify its relation.
132 \return ISREL3D_FRONT if the point is in front of the plane, 132 \return ISREL3D_FRONT if the point is in front of the plane,
133 ISREL3D_BACK if the point is behind of the plane, and 133 ISREL3D_BACK if the point is behind of the plane, and
134 ISREL3D_PLANAR if the point is within the plane. */ 134 ISREL3D_PLANAR if the point is within the plane. */
135 EIntersectionRelation3D classifyPointRelation(const vector3d<T>& point) const 135 EIntersectionRelation3D classifyPointRelation(const vector3d<T>& point) const
136 { 136 {
137 const T d = Normal.dotProduct(point) + D; 137 const T d = Normal.dotProduct(point) + D;
138 138
139 if (d < -ROUNDING_ERROR_f32) 139 if (d < -ROUNDING_ERROR_f32)
140 return ISREL3D_BACK; 140 return ISREL3D_BACK;
141 141
142 if (d > ROUNDING_ERROR_f32) 142 if (d > ROUNDING_ERROR_f32)
143 return ISREL3D_FRONT; 143 return ISREL3D_FRONT;
144 144
145 return ISREL3D_PLANAR; 145 return ISREL3D_PLANAR;
146 } 146 }
147 147
148 //! Recalculates the distance from origin by applying a new member point to the plane. 148 //! Recalculates the distance from origin by applying a new member point to the plane.
149 void recalculateD(const vector3d<T>& MPoint) 149 void recalculateD(const vector3d<T>& MPoint)
150 { 150 {
151 D = - MPoint.dotProduct(Normal); 151 D = - MPoint.dotProduct(Normal);
152 } 152 }
153 153
154 //! Gets a member point of the plane. 154 //! Gets a member point of the plane.
155 vector3d<T> getMemberPoint() const 155 vector3d<T> getMemberPoint() const
156 { 156 {
157 return Normal * -D; 157 return Normal * -D;
158 } 158 }
159 159
160 //! Tests if there is an intersection with the other plane 160 //! Tests if there is an intersection with the other plane
161 /** \return True if there is a intersection. */ 161 /** \return True if there is a intersection. */
162 bool existsIntersection(const plane3d<T>& other) const 162 bool existsIntersection(const plane3d<T>& other) const
163 { 163 {
164 vector3d<T> cross = other.Normal.crossProduct(Normal); 164 vector3d<T> cross = other.Normal.crossProduct(Normal);
165 return cross.getLength() > core::ROUNDING_ERROR_f32; 165 return cross.getLength() > core::ROUNDING_ERROR_f32;
166 } 166 }
167 167
168 //! Intersects this plane with another. 168 //! Intersects this plane with another.
169 /** \param other Other plane to intersect with. 169 /** \param other Other plane to intersect with.
170 \param outLinePoint Base point of intersection line. 170 \param outLinePoint Base point of intersection line.
171 \param outLineVect Vector of intersection. 171 \param outLineVect Vector of intersection.
172 \return True if there is a intersection, false if not. */ 172 \return True if there is a intersection, false if not. */
173 bool getIntersectionWithPlane(const plane3d<T>& other, 173 bool getIntersectionWithPlane(const plane3d<T>& other,
174 vector3d<T>& outLinePoint, 174 vector3d<T>& outLinePoint,
175 vector3d<T>& outLineVect) const 175 vector3d<T>& outLineVect) const
176 { 176 {
177 const T fn00 = Normal.getLength(); 177 const T fn00 = Normal.getLength();
178 const T fn01 = Normal.dotProduct(other.Normal); 178 const T fn01 = Normal.dotProduct(other.Normal);
179 const T fn11 = other.Normal.getLength(); 179 const T fn11 = other.Normal.getLength();
180 const f64 det = fn00*fn11 - fn01*fn01; 180 const f64 det = fn00*fn11 - fn01*fn01;
181 181
182 if (fabs(det) < ROUNDING_ERROR_f64 ) 182 if (fabs(det) < ROUNDING_ERROR_f64 )
183 return false; 183 return false;
184 184
185 const f64 invdet = 1.0 / det; 185 const f64 invdet = 1.0 / det;
186 const f64 fc0 = (fn11*-D + fn01*other.D) * invdet; 186 const f64 fc0 = (fn11*-D + fn01*other.D) * invdet;
187 const f64 fc1 = (fn00*-other.D + fn01*D) * invdet; 187 const f64 fc1 = (fn00*-other.D + fn01*D) * invdet;
188 188
189 outLineVect = Normal.crossProduct(other.Normal); 189 outLineVect = Normal.crossProduct(other.Normal);
190 outLinePoint = Normal*(T)fc0 + other.Normal*(T)fc1; 190 outLinePoint = Normal*(T)fc0 + other.Normal*(T)fc1;
191 return true; 191 return true;
192 } 192 }
193 193
194 //! Get the intersection point with two other planes if there is one. 194 //! Get the intersection point with two other planes if there is one.
195 bool getIntersectionWithPlanes(const plane3d<T>& o1, 195 bool getIntersectionWithPlanes(const plane3d<T>& o1,
196 const plane3d<T>& o2, vector3d<T>& outPoint) const 196 const plane3d<T>& o2, vector3d<T>& outPoint) const
197 { 197 {
198 vector3d<T> linePoint, lineVect; 198 vector3d<T> linePoint, lineVect;
199 if (getIntersectionWithPlane(o1, linePoint, lineVect)) 199 if (getIntersectionWithPlane(o1, linePoint, lineVect))
200 return o2.getIntersectionWithLine(linePoint, lineVect, outPoint); 200 return o2.getIntersectionWithLine(linePoint, lineVect, outPoint);
201 201
202 return false; 202 return false;
203 } 203 }
204 204
205 //! Test if the triangle would be front or backfacing from any point. 205 //! Test if the triangle would be front or backfacing from any point.
206 /** Thus, this method assumes a camera position from 206 /** Thus, this method assumes a camera position from
207 which the triangle is definitely visible when looking into 207 which the triangle is definitely visible when looking into
208 the given direction. 208 the given direction.
209 Note that this only works if the normal is Normalized. 209 Note that this only works if the normal is Normalized.
210 Do not use this method with points as it will give wrong results! 210 Do not use this method with points as it will give wrong results!
211 \param lookDirection: Look direction. 211 \param lookDirection: Look direction.
212 \return True if the plane is front facing and 212 \return True if the plane is front facing and
213 false if it is backfacing. */ 213 false if it is backfacing. */
214 bool isFrontFacing(const vector3d<T>& lookDirection) const 214 bool isFrontFacing(const vector3d<T>& lookDirection) const
215 { 215 {
216 const f32 d = Normal.dotProduct(lookDirection); 216 const f32 d = Normal.dotProduct(lookDirection);
217 return F32_LOWER_EQUAL_0 ( d ); 217 return F32_LOWER_EQUAL_0 ( d );
218 } 218 }
219 219
220 //! Get the distance to a point. 220 //! Get the distance to a point.
221 /** Note that this only works if the normal is normalized. */ 221 /** Note that this only works if the normal is normalized. */
222 T getDistanceTo(const vector3d<T>& point) const 222 T getDistanceTo(const vector3d<T>& point) const
223 { 223 {
224 return point.dotProduct(Normal) + D; 224 return point.dotProduct(Normal) + D;
225 } 225 }
226 226
227 //! Normal vector of the plane. 227 //! Normal vector of the plane.
228 vector3d<T> Normal; 228 vector3d<T> Normal;
229 229
230 //! Distance from origin. 230 //! Distance from origin.
231 T D; 231 T D;
232}; 232};
233 233
234 234
235//! Typedef for a f32 3d plane. 235//! Typedef for a f32 3d plane.
236typedef plane3d<f32> plane3df; 236typedef plane3d<f32> plane3df;
237 237
238//! Typedef for an integer 3d plane. 238//! Typedef for an integer 3d plane.
239typedef plane3d<s32> plane3di; 239typedef plane3d<s32> plane3di;
240 240
241} // end namespace core 241} // end namespace core
242} // end namespace irr 242} // end namespace irr
243 243
244#endif 244#endif
245 245
diff --git a/libraries/irrlicht-1.8/include/position2d.h b/libraries/irrlicht-1.8/include/position2d.h
index 63275d2..05a27c6 100644
--- a/libraries/irrlicht-1.8/include/position2d.h
+++ b/libraries/irrlicht-1.8/include/position2d.h
@@ -1,32 +1,32 @@
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//! As of Irrlicht 1.6, position2d is a synonym for vector2d. 5//! As of Irrlicht 1.6, position2d is a synonym for vector2d.
6/** You should consider position2d to be deprecated, and use vector2d by preference. */ 6/** You should consider position2d to be deprecated, and use vector2d by preference. */
7 7
8#ifndef __IRR_POSITION_H_INCLUDED__ 8#ifndef __IRR_POSITION_H_INCLUDED__
9#define __IRR_POSITION_H_INCLUDED__ 9#define __IRR_POSITION_H_INCLUDED__
10 10
11#include "vector2d.h" 11#include "vector2d.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace core 15namespace core
16{ 16{
17 17
18// Use typedefs where possible as they are more explicit... 18// Use typedefs where possible as they are more explicit...
19 19
20//! \deprecated position2d is now a synonym for vector2d, but vector2d should be used directly. 20//! \deprecated position2d is now a synonym for vector2d, but vector2d should be used directly.
21typedef vector2d<f32> position2df; 21typedef vector2d<f32> position2df;
22 22
23//! \deprecated position2d is now a synonym for vector2d, but vector2d should be used directly. 23//! \deprecated position2d is now a synonym for vector2d, but vector2d should be used directly.
24typedef vector2d<s32> position2di; 24typedef vector2d<s32> position2di;
25} // namespace core 25} // namespace core
26} // namespace irr 26} // namespace irr
27 27
28// ...and use a #define to catch the rest, for (e.g.) position2d<f64> 28// ...and use a #define to catch the rest, for (e.g.) position2d<f64>
29#define position2d vector2d 29#define position2d vector2d
30 30
31#endif // __IRR_POSITION_H_INCLUDED__ 31#endif // __IRR_POSITION_H_INCLUDED__
32 32
diff --git a/libraries/irrlicht-1.8/include/quaternion.h b/libraries/irrlicht-1.8/include/quaternion.h
index 2c6f0cf..7fbe50e 100644
--- a/libraries/irrlicht-1.8/include/quaternion.h
+++ b/libraries/irrlicht-1.8/include/quaternion.h
@@ -1,696 +1,696 @@
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#ifndef __IRR_QUATERNION_H_INCLUDED__ 5#ifndef __IRR_QUATERNION_H_INCLUDED__
6#define __IRR_QUATERNION_H_INCLUDED__ 6#define __IRR_QUATERNION_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include "irrMath.h" 9#include "irrMath.h"
10#include "matrix4.h" 10#include "matrix4.h"
11#include "vector3d.h" 11#include "vector3d.h"
12 12
13// Between Irrlicht 1.7 and Irrlicht 1.8 the quaternion-matrix conversions got fixed. 13// Between Irrlicht 1.7 and Irrlicht 1.8 the quaternion-matrix conversions got fixed.
14// This define disables all involved functions completely to allow finding all places 14// This define disables all involved functions completely to allow finding all places
15// where the wrong conversions had been in use. 15// where the wrong conversions had been in use.
16#define IRR_TEST_BROKEN_QUATERNION_USE 0 16#define IRR_TEST_BROKEN_QUATERNION_USE 0
17 17
18namespace irr 18namespace irr
19{ 19{
20namespace core 20namespace core
21{ 21{
22 22
23//! Quaternion class for representing rotations. 23//! Quaternion class for representing rotations.
24/** It provides cheap combinations and avoids gimbal locks. 24/** It provides cheap combinations and avoids gimbal locks.
25Also useful for interpolations. */ 25Also useful for interpolations. */
26class quaternion 26class quaternion
27{ 27{
28 public: 28 public:
29 29
30 //! Default Constructor 30 //! Default Constructor
31 quaternion() : X(0.0f), Y(0.0f), Z(0.0f), W(1.0f) {} 31 quaternion() : X(0.0f), Y(0.0f), Z(0.0f), W(1.0f) {}
32 32
33 //! Constructor 33 //! Constructor
34 quaternion(f32 x, f32 y, f32 z, f32 w) : X(x), Y(y), Z(z), W(w) { } 34 quaternion(f32 x, f32 y, f32 z, f32 w) : X(x), Y(y), Z(z), W(w) { }
35 35
36 //! Constructor which converts euler angles (radians) to a quaternion 36 //! Constructor which converts euler angles (radians) to a quaternion
37 quaternion(f32 x, f32 y, f32 z); 37 quaternion(f32 x, f32 y, f32 z);
38 38
39 //! Constructor which converts euler angles (radians) to a quaternion 39 //! Constructor which converts euler angles (radians) to a quaternion
40 quaternion(const vector3df& vec); 40 quaternion(const vector3df& vec);
41 41
42#if !IRR_TEST_BROKEN_QUATERNION_USE 42#if !IRR_TEST_BROKEN_QUATERNION_USE
43 //! Constructor which converts a matrix to a quaternion 43 //! Constructor which converts a matrix to a quaternion
44 quaternion(const matrix4& mat); 44 quaternion(const matrix4& mat);
45#endif 45#endif
46 46
47 //! Equalilty operator 47 //! Equalilty operator
48 bool operator==(const quaternion& other) const; 48 bool operator==(const quaternion& other) const;
49 49
50 //! inequality operator 50 //! inequality operator
51 bool operator!=(const quaternion& other) const; 51 bool operator!=(const quaternion& other) const;
52 52
53 //! Assignment operator 53 //! Assignment operator
54 inline quaternion& operator=(const quaternion& other); 54 inline quaternion& operator=(const quaternion& other);
55 55
56#if !IRR_TEST_BROKEN_QUATERNION_USE 56#if !IRR_TEST_BROKEN_QUATERNION_USE
57 //! Matrix assignment operator 57 //! Matrix assignment operator
58 inline quaternion& operator=(const matrix4& other); 58 inline quaternion& operator=(const matrix4& other);
59#endif 59#endif
60 60
61 //! Add operator 61 //! Add operator
62 quaternion operator+(const quaternion& other) const; 62 quaternion operator+(const quaternion& other) const;
63 63
64 //! Multiplication operator 64 //! Multiplication operator
65 quaternion operator*(const quaternion& other) const; 65 quaternion operator*(const quaternion& other) const;
66 66
67 //! Multiplication operator with scalar 67 //! Multiplication operator with scalar
68 quaternion operator*(f32 s) const; 68 quaternion operator*(f32 s) const;
69 69
70 //! Multiplication operator with scalar 70 //! Multiplication operator with scalar
71 quaternion& operator*=(f32 s); 71 quaternion& operator*=(f32 s);
72 72
73 //! Multiplication operator 73 //! Multiplication operator
74 vector3df operator*(const vector3df& v) const; 74 vector3df operator*(const vector3df& v) const;
75 75
76 //! Multiplication operator 76 //! Multiplication operator
77 quaternion& operator*=(const quaternion& other); 77 quaternion& operator*=(const quaternion& other);
78 78
79 //! Calculates the dot product 79 //! Calculates the dot product
80 inline f32 dotProduct(const quaternion& other) const; 80 inline f32 dotProduct(const quaternion& other) const;
81 81
82 //! Sets new quaternion 82 //! Sets new quaternion
83 inline quaternion& set(f32 x, f32 y, f32 z, f32 w); 83 inline quaternion& set(f32 x, f32 y, f32 z, f32 w);
84 84
85 //! Sets new quaternion based on euler angles (radians) 85 //! Sets new quaternion based on euler angles (radians)
86 inline quaternion& set(f32 x, f32 y, f32 z); 86 inline quaternion& set(f32 x, f32 y, f32 z);
87 87
88 //! Sets new quaternion based on euler angles (radians) 88 //! Sets new quaternion based on euler angles (radians)
89 inline quaternion& set(const core::vector3df& vec); 89 inline quaternion& set(const core::vector3df& vec);
90 90
91 //! Sets new quaternion from other quaternion 91 //! Sets new quaternion from other quaternion
92 inline quaternion& set(const core::quaternion& quat); 92 inline quaternion& set(const core::quaternion& quat);
93 93
94 //! returns if this quaternion equals the other one, taking floating point rounding errors into account 94 //! returns if this quaternion equals the other one, taking floating point rounding errors into account
95 inline bool equals(const quaternion& other, 95 inline bool equals(const quaternion& other,
96 const f32 tolerance = ROUNDING_ERROR_f32 ) const; 96 const f32 tolerance = ROUNDING_ERROR_f32 ) const;
97 97
98 //! Normalizes the quaternion 98 //! Normalizes the quaternion
99 inline quaternion& normalize(); 99 inline quaternion& normalize();
100 100
101#if !IRR_TEST_BROKEN_QUATERNION_USE 101#if !IRR_TEST_BROKEN_QUATERNION_USE
102 //! Creates a matrix from this quaternion 102 //! Creates a matrix from this quaternion
103 matrix4 getMatrix() const; 103 matrix4 getMatrix() const;
104#endif 104#endif
105 105
106 //! Creates a matrix from this quaternion 106 //! Creates a matrix from this quaternion
107 void getMatrix( matrix4 &dest, const core::vector3df &translation=core::vector3df() ) const; 107 void getMatrix( matrix4 &dest, const core::vector3df &translation=core::vector3df() ) const;
108 108
109 /*! 109 /*!
110 Creates a matrix from this quaternion 110 Creates a matrix from this quaternion
111 Rotate about a center point 111 Rotate about a center point
112 shortcut for 112 shortcut for
113 core::quaternion q; 113 core::quaternion q;
114 q.rotationFromTo ( vin[i].Normal, forward ); 114 q.rotationFromTo ( vin[i].Normal, forward );
115 q.getMatrixCenter ( lookat, center, newPos ); 115 q.getMatrixCenter ( lookat, center, newPos );
116 116
117 core::matrix4 m2; 117 core::matrix4 m2;
118 m2.setInverseTranslation ( center ); 118 m2.setInverseTranslation ( center );
119 lookat *= m2; 119 lookat *= m2;
120 120
121 core::matrix4 m3; 121 core::matrix4 m3;
122 m2.setTranslation ( newPos ); 122 m2.setTranslation ( newPos );
123 lookat *= m3; 123 lookat *= m3;
124 124
125 */ 125 */
126 void getMatrixCenter( matrix4 &dest, const core::vector3df &center, const core::vector3df &translation ) const; 126 void getMatrixCenter( matrix4 &dest, const core::vector3df &center, const core::vector3df &translation ) const;
127 127
128 //! Creates a matrix from this quaternion 128 //! Creates a matrix from this quaternion
129 inline void getMatrix_transposed( matrix4 &dest ) const; 129 inline void getMatrix_transposed( matrix4 &dest ) const;
130 130
131 //! Inverts this quaternion 131 //! Inverts this quaternion
132 quaternion& makeInverse(); 132 quaternion& makeInverse();
133 133
134 //! Set this quaternion to the linear interpolation between two quaternions 134 //! Set this quaternion to the linear interpolation between two quaternions
135 /** \param q1 First quaternion to be interpolated. 135 /** \param q1 First quaternion to be interpolated.
136 \param q2 Second quaternion to be interpolated. 136 \param q2 Second quaternion to be interpolated.
137 \param time Progress of interpolation. For time=0 the result is 137 \param time Progress of interpolation. For time=0 the result is
138 q1, for time=1 the result is q2. Otherwise interpolation 138 q1, for time=1 the result is q2. Otherwise interpolation
139 between q1 and q2. 139 between q1 and q2.
140 */ 140 */
141 quaternion& lerp(quaternion q1, quaternion q2, f32 time); 141 quaternion& lerp(quaternion q1, quaternion q2, f32 time);
142 142
143 //! Set this quaternion to the result of the spherical interpolation between two quaternions 143 //! Set this quaternion to the result of the spherical interpolation between two quaternions
144 /** \param q1 First quaternion to be interpolated. 144 /** \param q1 First quaternion to be interpolated.
145 \param q2 Second quaternion to be interpolated. 145 \param q2 Second quaternion to be interpolated.
146 \param time Progress of interpolation. For time=0 the result is 146 \param time Progress of interpolation. For time=0 the result is
147 q1, for time=1 the result is q2. Otherwise interpolation 147 q1, for time=1 the result is q2. Otherwise interpolation
148 between q1 and q2. 148 between q1 and q2.
149 \param threshold To avoid inaccuracies at the end (time=1) the 149 \param threshold To avoid inaccuracies at the end (time=1) the
150 interpolation switches to linear interpolation at some point. 150 interpolation switches to linear interpolation at some point.
151 This value defines how much of the remaining interpolation will 151 This value defines how much of the remaining interpolation will
152 be calculated with lerp. Everything from 1-threshold up will be 152 be calculated with lerp. Everything from 1-threshold up will be
153 linear interpolation. 153 linear interpolation.
154 */ 154 */
155 quaternion& slerp(quaternion q1, quaternion q2, 155 quaternion& slerp(quaternion q1, quaternion q2,
156 f32 time, f32 threshold=.05f); 156 f32 time, f32 threshold=.05f);
157 157
158 //! Create quaternion from rotation angle and rotation axis. 158 //! Create quaternion from rotation angle and rotation axis.
159 /** Axis must be unit length. 159 /** Axis must be unit length.
160 The quaternion representing the rotation is 160 The quaternion representing the rotation is
161 q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k). 161 q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k).
162 \param angle Rotation Angle in radians. 162 \param angle Rotation Angle in radians.
163 \param axis Rotation axis. */ 163 \param axis Rotation axis. */
164 quaternion& fromAngleAxis (f32 angle, const vector3df& axis); 164 quaternion& fromAngleAxis (f32 angle, const vector3df& axis);
165 165
166 //! Fills an angle (radians) around an axis (unit vector) 166 //! Fills an angle (radians) around an axis (unit vector)
167 void toAngleAxis (f32 &angle, core::vector3df& axis) const; 167 void toAngleAxis (f32 &angle, core::vector3df& axis) const;
168 168
169 //! Output this quaternion to an euler angle (radians) 169 //! Output this quaternion to an euler angle (radians)
170 void toEuler(vector3df& euler) const; 170 void toEuler(vector3df& euler) const;
171 171
172 //! Set quaternion to identity 172 //! Set quaternion to identity
173 quaternion& makeIdentity(); 173 quaternion& makeIdentity();
174 174
175 //! Set quaternion to represent a rotation from one vector to another. 175 //! Set quaternion to represent a rotation from one vector to another.
176 quaternion& rotationFromTo(const vector3df& from, const vector3df& to); 176 quaternion& rotationFromTo(const vector3df& from, const vector3df& to);
177 177
178 //! Quaternion elements. 178 //! Quaternion elements.
179 f32 X; // vectorial (imaginary) part 179 f32 X; // vectorial (imaginary) part
180 f32 Y; 180 f32 Y;
181 f32 Z; 181 f32 Z;
182 f32 W; // real part 182 f32 W; // real part
183}; 183};
184 184
185 185
186// Constructor which converts euler angles to a quaternion 186// Constructor which converts euler angles to a quaternion
187inline quaternion::quaternion(f32 x, f32 y, f32 z) 187inline quaternion::quaternion(f32 x, f32 y, f32 z)
188{ 188{
189 set(x,y,z); 189 set(x,y,z);
190} 190}
191 191
192 192
193// Constructor which converts euler angles to a quaternion 193// Constructor which converts euler angles to a quaternion
194inline quaternion::quaternion(const vector3df& vec) 194inline quaternion::quaternion(const vector3df& vec)
195{ 195{
196 set(vec.X,vec.Y,vec.Z); 196 set(vec.X,vec.Y,vec.Z);
197} 197}
198 198
199#if !IRR_TEST_BROKEN_QUATERNION_USE 199#if !IRR_TEST_BROKEN_QUATERNION_USE
200// Constructor which converts a matrix to a quaternion 200// Constructor which converts a matrix to a quaternion
201inline quaternion::quaternion(const matrix4& mat) 201inline quaternion::quaternion(const matrix4& mat)
202{ 202{
203 (*this) = mat; 203 (*this) = mat;
204} 204}
205#endif 205#endif
206 206
207// equal operator 207// equal operator
208inline bool quaternion::operator==(const quaternion& other) const 208inline bool quaternion::operator==(const quaternion& other) const
209{ 209{
210 return ((X == other.X) && 210 return ((X == other.X) &&
211 (Y == other.Y) && 211 (Y == other.Y) &&
212 (Z == other.Z) && 212 (Z == other.Z) &&
213 (W == other.W)); 213 (W == other.W));
214} 214}
215 215
216// inequality operator 216// inequality operator
217inline bool quaternion::operator!=(const quaternion& other) const 217inline bool quaternion::operator!=(const quaternion& other) const
218{ 218{
219 return !(*this == other); 219 return !(*this == other);
220} 220}
221 221
222// assignment operator 222// assignment operator
223inline quaternion& quaternion::operator=(const quaternion& other) 223inline quaternion& quaternion::operator=(const quaternion& other)
224{ 224{
225 X = other.X; 225 X = other.X;
226 Y = other.Y; 226 Y = other.Y;
227 Z = other.Z; 227 Z = other.Z;
228 W = other.W; 228 W = other.W;
229 return *this; 229 return *this;
230} 230}
231 231
232#if !IRR_TEST_BROKEN_QUATERNION_USE 232#if !IRR_TEST_BROKEN_QUATERNION_USE
233// matrix assignment operator 233// matrix assignment operator
234inline quaternion& quaternion::operator=(const matrix4& m) 234inline quaternion& quaternion::operator=(const matrix4& m)
235{ 235{
236 const f32 diag = m[0] + m[5] + m[10] + 1; 236 const f32 diag = m[0] + m[5] + m[10] + 1;
237 237
238 if( diag > 0.0f ) 238 if( diag > 0.0f )
239 { 239 {
240 const f32 scale = sqrtf(diag) * 2.0f; // get scale from diagonal 240 const f32 scale = sqrtf(diag) * 2.0f; // get scale from diagonal
241 241
242 // TODO: speed this up 242 // TODO: speed this up
243 X = (m[6] - m[9]) / scale; 243 X = (m[6] - m[9]) / scale;
244 Y = (m[8] - m[2]) / scale; 244 Y = (m[8] - m[2]) / scale;
245 Z = (m[1] - m[4]) / scale; 245 Z = (m[1] - m[4]) / scale;
246 W = 0.25f * scale; 246 W = 0.25f * scale;
247 } 247 }
248 else 248 else
249 { 249 {
250 if (m[0]>m[5] && m[0]>m[10]) 250 if (m[0]>m[5] && m[0]>m[10])
251 { 251 {
252 // 1st element of diag is greatest value 252 // 1st element of diag is greatest value
253 // find scale according to 1st element, and double it 253 // find scale according to 1st element, and double it
254 const f32 scale = sqrtf(1.0f + m[0] - m[5] - m[10]) * 2.0f; 254 const f32 scale = sqrtf(1.0f + m[0] - m[5] - m[10]) * 2.0f;
255 255
256 // TODO: speed this up 256 // TODO: speed this up
257 X = 0.25f * scale; 257 X = 0.25f * scale;
258 Y = (m[4] + m[1]) / scale; 258 Y = (m[4] + m[1]) / scale;
259 Z = (m[2] + m[8]) / scale; 259 Z = (m[2] + m[8]) / scale;
260 W = (m[6] - m[9]) / scale; 260 W = (m[6] - m[9]) / scale;
261 } 261 }
262 else if (m[5]>m[10]) 262 else if (m[5]>m[10])
263 { 263 {
264 // 2nd element of diag is greatest value 264 // 2nd element of diag is greatest value
265 // find scale according to 2nd element, and double it 265 // find scale according to 2nd element, and double it
266 const f32 scale = sqrtf(1.0f + m[5] - m[0] - m[10]) * 2.0f; 266 const f32 scale = sqrtf(1.0f + m[5] - m[0] - m[10]) * 2.0f;
267 267
268 // TODO: speed this up 268 // TODO: speed this up
269 X = (m[4] + m[1]) / scale; 269 X = (m[4] + m[1]) / scale;
270 Y = 0.25f * scale; 270 Y = 0.25f * scale;
271 Z = (m[9] + m[6]) / scale; 271 Z = (m[9] + m[6]) / scale;
272 W = (m[8] - m[2]) / scale; 272 W = (m[8] - m[2]) / scale;
273 } 273 }
274 else 274 else
275 { 275 {
276 // 3rd element of diag is greatest value 276 // 3rd element of diag is greatest value
277 // find scale according to 3rd element, and double it 277 // find scale according to 3rd element, and double it
278 const f32 scale = sqrtf(1.0f + m[10] - m[0] - m[5]) * 2.0f; 278 const f32 scale = sqrtf(1.0f + m[10] - m[0] - m[5]) * 2.0f;
279 279
280 // TODO: speed this up 280 // TODO: speed this up
281 X = (m[8] + m[2]) / scale; 281 X = (m[8] + m[2]) / scale;
282 Y = (m[9] + m[6]) / scale; 282 Y = (m[9] + m[6]) / scale;
283 Z = 0.25f * scale; 283 Z = 0.25f * scale;
284 W = (m[1] - m[4]) / scale; 284 W = (m[1] - m[4]) / scale;
285 } 285 }
286 } 286 }
287 287
288 return normalize(); 288 return normalize();
289} 289}
290#endif 290#endif
291 291
292 292
293// multiplication operator 293// multiplication operator
294inline quaternion quaternion::operator*(const quaternion& other) const 294inline quaternion quaternion::operator*(const quaternion& other) const
295{ 295{
296 quaternion tmp; 296 quaternion tmp;
297 297
298 tmp.W = (other.W * W) - (other.X * X) - (other.Y * Y) - (other.Z * Z); 298 tmp.W = (other.W * W) - (other.X * X) - (other.Y * Y) - (other.Z * Z);
299 tmp.X = (other.W * X) + (other.X * W) + (other.Y * Z) - (other.Z * Y); 299 tmp.X = (other.W * X) + (other.X * W) + (other.Y * Z) - (other.Z * Y);
300 tmp.Y = (other.W * Y) + (other.Y * W) + (other.Z * X) - (other.X * Z); 300 tmp.Y = (other.W * Y) + (other.Y * W) + (other.Z * X) - (other.X * Z);
301 tmp.Z = (other.W * Z) + (other.Z * W) + (other.X * Y) - (other.Y * X); 301 tmp.Z = (other.W * Z) + (other.Z * W) + (other.X * Y) - (other.Y * X);
302 302
303 return tmp; 303 return tmp;
304} 304}
305 305
306 306
307// multiplication operator 307// multiplication operator
308inline quaternion quaternion::operator*(f32 s) const 308inline quaternion quaternion::operator*(f32 s) const
309{ 309{
310 return quaternion(s*X, s*Y, s*Z, s*W); 310 return quaternion(s*X, s*Y, s*Z, s*W);
311} 311}
312 312
313 313
314// multiplication operator 314// multiplication operator
315inline quaternion& quaternion::operator*=(f32 s) 315inline quaternion& quaternion::operator*=(f32 s)
316{ 316{
317 X*=s; 317 X*=s;
318 Y*=s; 318 Y*=s;
319 Z*=s; 319 Z*=s;
320 W*=s; 320 W*=s;
321 return *this; 321 return *this;
322} 322}
323 323
324// multiplication operator 324// multiplication operator
325inline quaternion& quaternion::operator*=(const quaternion& other) 325inline quaternion& quaternion::operator*=(const quaternion& other)
326{ 326{
327 return (*this = other * (*this)); 327 return (*this = other * (*this));
328} 328}
329 329
330// add operator 330// add operator
331inline quaternion quaternion::operator+(const quaternion& b) const 331inline quaternion quaternion::operator+(const quaternion& b) const
332{ 332{
333 return quaternion(X+b.X, Y+b.Y, Z+b.Z, W+b.W); 333 return quaternion(X+b.X, Y+b.Y, Z+b.Z, W+b.W);
334} 334}
335 335
336#if !IRR_TEST_BROKEN_QUATERNION_USE 336#if !IRR_TEST_BROKEN_QUATERNION_USE
337// Creates a matrix from this quaternion 337// Creates a matrix from this quaternion
338inline matrix4 quaternion::getMatrix() const 338inline matrix4 quaternion::getMatrix() const
339{ 339{
340 core::matrix4 m; 340 core::matrix4 m;
341 getMatrix(m); 341 getMatrix(m);
342 return m; 342 return m;
343} 343}
344#endif 344#endif
345 345
346/*! 346/*!
347 Creates a matrix from this quaternion 347 Creates a matrix from this quaternion
348*/ 348*/
349inline void quaternion::getMatrix(matrix4 &dest, 349inline void quaternion::getMatrix(matrix4 &dest,
350 const core::vector3df &center) const 350 const core::vector3df &center) const
351{ 351{
352 dest[0] = 1.0f - 2.0f*Y*Y - 2.0f*Z*Z; 352 dest[0] = 1.0f - 2.0f*Y*Y - 2.0f*Z*Z;
353 dest[1] = 2.0f*X*Y + 2.0f*Z*W; 353 dest[1] = 2.0f*X*Y + 2.0f*Z*W;
354 dest[2] = 2.0f*X*Z - 2.0f*Y*W; 354 dest[2] = 2.0f*X*Z - 2.0f*Y*W;
355 dest[3] = 0.0f; 355 dest[3] = 0.0f;
356 356
357 dest[4] = 2.0f*X*Y - 2.0f*Z*W; 357 dest[4] = 2.0f*X*Y - 2.0f*Z*W;
358 dest[5] = 1.0f - 2.0f*X*X - 2.0f*Z*Z; 358 dest[5] = 1.0f - 2.0f*X*X - 2.0f*Z*Z;
359 dest[6] = 2.0f*Z*Y + 2.0f*X*W; 359 dest[6] = 2.0f*Z*Y + 2.0f*X*W;
360 dest[7] = 0.0f; 360 dest[7] = 0.0f;
361 361
362 dest[8] = 2.0f*X*Z + 2.0f*Y*W; 362 dest[8] = 2.0f*X*Z + 2.0f*Y*W;
363 dest[9] = 2.0f*Z*Y - 2.0f*X*W; 363 dest[9] = 2.0f*Z*Y - 2.0f*X*W;
364 dest[10] = 1.0f - 2.0f*X*X - 2.0f*Y*Y; 364 dest[10] = 1.0f - 2.0f*X*X - 2.0f*Y*Y;
365 dest[11] = 0.0f; 365 dest[11] = 0.0f;
366 366
367 dest[12] = center.X; 367 dest[12] = center.X;
368 dest[13] = center.Y; 368 dest[13] = center.Y;
369 dest[14] = center.Z; 369 dest[14] = center.Z;
370 dest[15] = 1.f; 370 dest[15] = 1.f;
371 371
372 dest.setDefinitelyIdentityMatrix ( false ); 372 dest.setDefinitelyIdentityMatrix ( false );
373} 373}
374 374
375 375
376/*! 376/*!
377 Creates a matrix from this quaternion 377 Creates a matrix from this quaternion
378 Rotate about a center point 378 Rotate about a center point
379 shortcut for 379 shortcut for
380 core::quaternion q; 380 core::quaternion q;
381 q.rotationFromTo(vin[i].Normal, forward); 381 q.rotationFromTo(vin[i].Normal, forward);
382 q.getMatrix(lookat, center); 382 q.getMatrix(lookat, center);
383 383
384 core::matrix4 m2; 384 core::matrix4 m2;
385 m2.setInverseTranslation(center); 385 m2.setInverseTranslation(center);
386 lookat *= m2; 386 lookat *= m2;
387*/ 387*/
388inline void quaternion::getMatrixCenter(matrix4 &dest, 388inline void quaternion::getMatrixCenter(matrix4 &dest,
389 const core::vector3df &center, 389 const core::vector3df &center,
390 const core::vector3df &translation) const 390 const core::vector3df &translation) const
391{ 391{
392 dest[0] = 1.0f - 2.0f*Y*Y - 2.0f*Z*Z; 392 dest[0] = 1.0f - 2.0f*Y*Y - 2.0f*Z*Z;
393 dest[1] = 2.0f*X*Y + 2.0f*Z*W; 393 dest[1] = 2.0f*X*Y + 2.0f*Z*W;
394 dest[2] = 2.0f*X*Z - 2.0f*Y*W; 394 dest[2] = 2.0f*X*Z - 2.0f*Y*W;
395 dest[3] = 0.0f; 395 dest[3] = 0.0f;
396 396
397 dest[4] = 2.0f*X*Y - 2.0f*Z*W; 397 dest[4] = 2.0f*X*Y - 2.0f*Z*W;
398 dest[5] = 1.0f - 2.0f*X*X - 2.0f*Z*Z; 398 dest[5] = 1.0f - 2.0f*X*X - 2.0f*Z*Z;
399 dest[6] = 2.0f*Z*Y + 2.0f*X*W; 399 dest[6] = 2.0f*Z*Y + 2.0f*X*W;
400 dest[7] = 0.0f; 400 dest[7] = 0.0f;
401 401
402 dest[8] = 2.0f*X*Z + 2.0f*Y*W; 402 dest[8] = 2.0f*X*Z + 2.0f*Y*W;
403 dest[9] = 2.0f*Z*Y - 2.0f*X*W; 403 dest[9] = 2.0f*Z*Y - 2.0f*X*W;
404 dest[10] = 1.0f - 2.0f*X*X - 2.0f*Y*Y; 404 dest[10] = 1.0f - 2.0f*X*X - 2.0f*Y*Y;
405 dest[11] = 0.0f; 405 dest[11] = 0.0f;
406 406
407 dest.setRotationCenter ( center, translation ); 407 dest.setRotationCenter ( center, translation );
408} 408}
409 409
410// Creates a matrix from this quaternion 410// Creates a matrix from this quaternion
411inline void quaternion::getMatrix_transposed(matrix4 &dest) const 411inline void quaternion::getMatrix_transposed(matrix4 &dest) const
412{ 412{
413 dest[0] = 1.0f - 2.0f*Y*Y - 2.0f*Z*Z; 413 dest[0] = 1.0f - 2.0f*Y*Y - 2.0f*Z*Z;
414 dest[4] = 2.0f*X*Y + 2.0f*Z*W; 414 dest[4] = 2.0f*X*Y + 2.0f*Z*W;
415 dest[8] = 2.0f*X*Z - 2.0f*Y*W; 415 dest[8] = 2.0f*X*Z - 2.0f*Y*W;
416 dest[12] = 0.0f; 416 dest[12] = 0.0f;
417 417
418 dest[1] = 2.0f*X*Y - 2.0f*Z*W; 418 dest[1] = 2.0f*X*Y - 2.0f*Z*W;
419 dest[5] = 1.0f - 2.0f*X*X - 2.0f*Z*Z; 419 dest[5] = 1.0f - 2.0f*X*X - 2.0f*Z*Z;
420 dest[9] = 2.0f*Z*Y + 2.0f*X*W; 420 dest[9] = 2.0f*Z*Y + 2.0f*X*W;
421 dest[13] = 0.0f; 421 dest[13] = 0.0f;
422 422
423 dest[2] = 2.0f*X*Z + 2.0f*Y*W; 423 dest[2] = 2.0f*X*Z + 2.0f*Y*W;
424 dest[6] = 2.0f*Z*Y - 2.0f*X*W; 424 dest[6] = 2.0f*Z*Y - 2.0f*X*W;
425 dest[10] = 1.0f - 2.0f*X*X - 2.0f*Y*Y; 425 dest[10] = 1.0f - 2.0f*X*X - 2.0f*Y*Y;
426 dest[14] = 0.0f; 426 dest[14] = 0.0f;
427 427
428 dest[3] = 0.f; 428 dest[3] = 0.f;
429 dest[7] = 0.f; 429 dest[7] = 0.f;
430 dest[11] = 0.f; 430 dest[11] = 0.f;
431 dest[15] = 1.f; 431 dest[15] = 1.f;
432 432
433 dest.setDefinitelyIdentityMatrix(false); 433 dest.setDefinitelyIdentityMatrix(false);
434} 434}
435 435
436 436
437// Inverts this quaternion 437// Inverts this quaternion
438inline quaternion& quaternion::makeInverse() 438inline quaternion& quaternion::makeInverse()
439{ 439{
440 X = -X; Y = -Y; Z = -Z; 440 X = -X; Y = -Y; Z = -Z;
441 return *this; 441 return *this;
442} 442}
443 443
444 444
445// sets new quaternion 445// sets new quaternion
446inline quaternion& quaternion::set(f32 x, f32 y, f32 z, f32 w) 446inline quaternion& quaternion::set(f32 x, f32 y, f32 z, f32 w)
447{ 447{
448 X = x; 448 X = x;
449 Y = y; 449 Y = y;
450 Z = z; 450 Z = z;
451 W = w; 451 W = w;
452 return *this; 452 return *this;
453} 453}
454 454
455 455
456// sets new quaternion based on euler angles 456// sets new quaternion based on euler angles
457inline quaternion& quaternion::set(f32 x, f32 y, f32 z) 457inline quaternion& quaternion::set(f32 x, f32 y, f32 z)
458{ 458{
459 f64 angle; 459 f64 angle;
460 460
461 angle = x * 0.5; 461 angle = x * 0.5;
462 const f64 sr = sin(angle); 462 const f64 sr = sin(angle);
463 const f64 cr = cos(angle); 463 const f64 cr = cos(angle);
464 464
465 angle = y * 0.5; 465 angle = y * 0.5;
466 const f64 sp = sin(angle); 466 const f64 sp = sin(angle);
467 const f64 cp = cos(angle); 467 const f64 cp = cos(angle);
468 468
469 angle = z * 0.5; 469 angle = z * 0.5;
470 const f64 sy = sin(angle); 470 const f64 sy = sin(angle);
471 const f64 cy = cos(angle); 471 const f64 cy = cos(angle);
472 472
473 const f64 cpcy = cp * cy; 473 const f64 cpcy = cp * cy;
474 const f64 spcy = sp * cy; 474 const f64 spcy = sp * cy;
475 const f64 cpsy = cp * sy; 475 const f64 cpsy = cp * sy;
476 const f64 spsy = sp * sy; 476 const f64 spsy = sp * sy;
477 477
478 X = (f32)(sr * cpcy - cr * spsy); 478 X = (f32)(sr * cpcy - cr * spsy);
479 Y = (f32)(cr * spcy + sr * cpsy); 479 Y = (f32)(cr * spcy + sr * cpsy);
480 Z = (f32)(cr * cpsy - sr * spcy); 480 Z = (f32)(cr * cpsy - sr * spcy);
481 W = (f32)(cr * cpcy + sr * spsy); 481 W = (f32)(cr * cpcy + sr * spsy);
482 482
483 return normalize(); 483 return normalize();
484} 484}
485 485
486// sets new quaternion based on euler angles 486// sets new quaternion based on euler angles
487inline quaternion& quaternion::set(const core::vector3df& vec) 487inline quaternion& quaternion::set(const core::vector3df& vec)
488{ 488{
489 return set(vec.X, vec.Y, vec.Z); 489 return set(vec.X, vec.Y, vec.Z);
490} 490}
491 491
492// sets new quaternion based on other quaternion 492// sets new quaternion based on other quaternion
493inline quaternion& quaternion::set(const core::quaternion& quat) 493inline quaternion& quaternion::set(const core::quaternion& quat)
494{ 494{
495 return (*this=quat); 495 return (*this=quat);
496} 496}
497 497
498 498
499//! returns if this quaternion equals the other one, taking floating point rounding errors into account 499//! returns if this quaternion equals the other one, taking floating point rounding errors into account
500inline bool quaternion::equals(const quaternion& other, const f32 tolerance) const 500inline bool quaternion::equals(const quaternion& other, const f32 tolerance) const
501{ 501{
502 return core::equals(X, other.X, tolerance) && 502 return core::equals(X, other.X, tolerance) &&
503 core::equals(Y, other.Y, tolerance) && 503 core::equals(Y, other.Y, tolerance) &&
504 core::equals(Z, other.Z, tolerance) && 504 core::equals(Z, other.Z, tolerance) &&
505 core::equals(W, other.W, tolerance); 505 core::equals(W, other.W, tolerance);
506} 506}
507 507
508 508
509// normalizes the quaternion 509// normalizes the quaternion
510inline quaternion& quaternion::normalize() 510inline quaternion& quaternion::normalize()
511{ 511{
512 const f32 n = X*X + Y*Y + Z*Z + W*W; 512 const f32 n = X*X + Y*Y + Z*Z + W*W;
513 513
514 if (n == 1) 514 if (n == 1)
515 return *this; 515 return *this;
516 516
517 //n = 1.0f / sqrtf(n); 517 //n = 1.0f / sqrtf(n);
518 return (*this *= reciprocal_squareroot ( n )); 518 return (*this *= reciprocal_squareroot ( n ));
519} 519}
520 520
521 521
522// set this quaternion to the result of the linear interpolation between two quaternions 522// set this quaternion to the result of the linear interpolation between two quaternions
523inline quaternion& quaternion::lerp(quaternion q1, quaternion q2, f32 time) 523inline quaternion& quaternion::lerp(quaternion q1, quaternion q2, f32 time)
524{ 524{
525 const f32 scale = 1.0f - time; 525 const f32 scale = 1.0f - time;
526 return (*this = (q1*scale) + (q2*time)); 526 return (*this = (q1*scale) + (q2*time));
527} 527}
528 528
529 529
530// set this quaternion to the result of the interpolation between two quaternions 530// set this quaternion to the result of the interpolation between two quaternions
531inline quaternion& quaternion::slerp(quaternion q1, quaternion q2, f32 time, f32 threshold) 531inline quaternion& quaternion::slerp(quaternion q1, quaternion q2, f32 time, f32 threshold)
532{ 532{
533 f32 angle = q1.dotProduct(q2); 533 f32 angle = q1.dotProduct(q2);
534 534
535 // make sure we use the short rotation 535 // make sure we use the short rotation
536 if (angle < 0.0f) 536 if (angle < 0.0f)
537 { 537 {
538 q1 *= -1.0f; 538 q1 *= -1.0f;
539 angle *= -1.0f; 539 angle *= -1.0f;
540 } 540 }
541 541
542 if (angle <= (1-threshold)) // spherical interpolation 542 if (angle <= (1-threshold)) // spherical interpolation
543 { 543 {
544 const f32 theta = acosf(angle); 544 const f32 theta = acosf(angle);
545 const f32 invsintheta = reciprocal(sinf(theta)); 545 const f32 invsintheta = reciprocal(sinf(theta));
546 const f32 scale = sinf(theta * (1.0f-time)) * invsintheta; 546 const f32 scale = sinf(theta * (1.0f-time)) * invsintheta;
547 const f32 invscale = sinf(theta * time) * invsintheta; 547 const f32 invscale = sinf(theta * time) * invsintheta;
548 return (*this = (q1*scale) + (q2*invscale)); 548 return (*this = (q1*scale) + (q2*invscale));
549 } 549 }
550 else // linear interploation 550 else // linear interploation
551 return lerp(q1,q2,time); 551 return lerp(q1,q2,time);
552} 552}
553 553
554 554
555// calculates the dot product 555// calculates the dot product
556inline f32 quaternion::dotProduct(const quaternion& q2) const 556inline f32 quaternion::dotProduct(const quaternion& q2) const
557{ 557{
558 return (X * q2.X) + (Y * q2.Y) + (Z * q2.Z) + (W * q2.W); 558 return (X * q2.X) + (Y * q2.Y) + (Z * q2.Z) + (W * q2.W);
559} 559}
560 560
561 561
562//! axis must be unit length, angle in radians 562//! axis must be unit length, angle in radians
563inline quaternion& quaternion::fromAngleAxis(f32 angle, const vector3df& axis) 563inline quaternion& quaternion::fromAngleAxis(f32 angle, const vector3df& axis)
564{ 564{
565 const f32 fHalfAngle = 0.5f*angle; 565 const f32 fHalfAngle = 0.5f*angle;
566 const f32 fSin = sinf(fHalfAngle); 566 const f32 fSin = sinf(fHalfAngle);
567 W = cosf(fHalfAngle); 567 W = cosf(fHalfAngle);
568 X = fSin*axis.X; 568 X = fSin*axis.X;
569 Y = fSin*axis.Y; 569 Y = fSin*axis.Y;
570 Z = fSin*axis.Z; 570 Z = fSin*axis.Z;
571 return *this; 571 return *this;
572} 572}
573 573
574 574
575inline void quaternion::toAngleAxis(f32 &angle, core::vector3df &axis) const 575inline void quaternion::toAngleAxis(f32 &angle, core::vector3df &axis) const
576{ 576{
577 const f32 scale = sqrtf(X*X + Y*Y + Z*Z); 577 const f32 scale = sqrtf(X*X + Y*Y + Z*Z);
578 578
579 if (core::iszero(scale) || W > 1.0f || W < -1.0f) 579 if (core::iszero(scale) || W > 1.0f || W < -1.0f)
580 { 580 {
581 angle = 0.0f; 581 angle = 0.0f;
582 axis.X = 0.0f; 582 axis.X = 0.0f;
583 axis.Y = 1.0f; 583 axis.Y = 1.0f;
584 axis.Z = 0.0f; 584 axis.Z = 0.0f;
585 } 585 }
586 else 586 else
587 { 587 {
588 const f32 invscale = reciprocal(scale); 588 const f32 invscale = reciprocal(scale);
589 angle = 2.0f * acosf(W); 589 angle = 2.0f * acosf(W);
590 axis.X = X * invscale; 590 axis.X = X * invscale;
591 axis.Y = Y * invscale; 591 axis.Y = Y * invscale;
592 axis.Z = Z * invscale; 592 axis.Z = Z * invscale;
593 } 593 }
594} 594}
595 595
596inline void quaternion::toEuler(vector3df& euler) const 596inline void quaternion::toEuler(vector3df& euler) const
597{ 597{
598 const f64 sqw = W*W; 598 const f64 sqw = W*W;
599 const f64 sqx = X*X; 599 const f64 sqx = X*X;
600 const f64 sqy = Y*Y; 600 const f64 sqy = Y*Y;
601 const f64 sqz = Z*Z; 601 const f64 sqz = Z*Z;
602 const f64 test = 2.0 * (Y*W - X*Z); 602 const f64 test = 2.0 * (Y*W - X*Z);
603 603
604 if (core::equals(test, 1.0, 0.000001)) 604 if (core::equals(test, 1.0, 0.000001))
605 { 605 {
606 // heading = rotation about z-axis 606 // heading = rotation about z-axis
607 euler.Z = (f32) (-2.0*atan2(X, W)); 607 euler.Z = (f32) (-2.0*atan2(X, W));
608 // bank = rotation about x-axis 608 // bank = rotation about x-axis
609 euler.X = 0; 609 euler.X = 0;
610 // attitude = rotation about y-axis 610 // attitude = rotation about y-axis
611 euler.Y = (f32) (core::PI64/2.0); 611 euler.Y = (f32) (core::PI64/2.0);
612 } 612 }
613 else if (core::equals(test, -1.0, 0.000001)) 613 else if (core::equals(test, -1.0, 0.000001))
614 { 614 {
615 // heading = rotation about z-axis 615 // heading = rotation about z-axis
616 euler.Z = (f32) (2.0*atan2(X, W)); 616 euler.Z = (f32) (2.0*atan2(X, W));
617 // bank = rotation about x-axis 617 // bank = rotation about x-axis
618 euler.X = 0; 618 euler.X = 0;
619 // attitude = rotation about y-axis 619 // attitude = rotation about y-axis
620 euler.Y = (f32) (core::PI64/-2.0); 620 euler.Y = (f32) (core::PI64/-2.0);
621 } 621 }
622 else 622 else
623 { 623 {
624 // heading = rotation about z-axis 624 // heading = rotation about z-axis
625 euler.Z = (f32) atan2(2.0 * (X*Y +Z*W),(sqx - sqy - sqz + sqw)); 625 euler.Z = (f32) atan2(2.0 * (X*Y +Z*W),(sqx - sqy - sqz + sqw));
626 // bank = rotation about x-axis 626 // bank = rotation about x-axis
627 euler.X = (f32) atan2(2.0 * (Y*Z +X*W),(-sqx - sqy + sqz + sqw)); 627 euler.X = (f32) atan2(2.0 * (Y*Z +X*W),(-sqx - sqy + sqz + sqw));
628 // attitude = rotation about y-axis 628 // attitude = rotation about y-axis
629 euler.Y = (f32) asin( clamp(test, -1.0, 1.0) ); 629 euler.Y = (f32) asin( clamp(test, -1.0, 1.0) );
630 } 630 }
631} 631}
632 632
633 633
634inline vector3df quaternion::operator* (const vector3df& v) const 634inline vector3df quaternion::operator* (const vector3df& v) const
635{ 635{
636 // nVidia SDK implementation 636 // nVidia SDK implementation
637 637
638 vector3df uv, uuv; 638 vector3df uv, uuv;
639 vector3df qvec(X, Y, Z); 639 vector3df qvec(X, Y, Z);
640 uv = qvec.crossProduct(v); 640 uv = qvec.crossProduct(v);
641 uuv = qvec.crossProduct(uv); 641 uuv = qvec.crossProduct(uv);
642 uv *= (2.0f * W); 642 uv *= (2.0f * W);
643 uuv *= 2.0f; 643 uuv *= 2.0f;
644 644
645 return v + uv + uuv; 645 return v + uv + uuv;
646} 646}
647 647
648// set quaternion to identity 648// set quaternion to identity
649inline core::quaternion& quaternion::makeIdentity() 649inline core::quaternion& quaternion::makeIdentity()
650{ 650{
651 W = 1.f; 651 W = 1.f;
652 X = 0.f; 652 X = 0.f;
653 Y = 0.f; 653 Y = 0.f;
654 Z = 0.f; 654 Z = 0.f;
655 return *this; 655 return *this;
656} 656}
657 657
658inline core::quaternion& quaternion::rotationFromTo(const vector3df& from, const vector3df& to) 658inline core::quaternion& quaternion::rotationFromTo(const vector3df& from, const vector3df& to)
659{ 659{
660 // Based on Stan Melax's article in Game Programming Gems 660 // Based on Stan Melax's article in Game Programming Gems
661 // Copy, since cannot modify local 661 // Copy, since cannot modify local
662 vector3df v0 = from; 662 vector3df v0 = from;
663 vector3df v1 = to; 663 vector3df v1 = to;
664 v0.normalize(); 664 v0.normalize();
665 v1.normalize(); 665 v1.normalize();
666 666
667 const f32 d = v0.dotProduct(v1); 667 const f32 d = v0.dotProduct(v1);
668 if (d >= 1.0f) // If dot == 1, vectors are the same 668 if (d >= 1.0f) // If dot == 1, vectors are the same
669 { 669 {
670 return makeIdentity(); 670 return makeIdentity();
671 } 671 }
672 else if (d <= -1.0f) // exactly opposite 672 else if (d <= -1.0f) // exactly opposite
673 { 673 {
674 core::vector3df axis(1.0f, 0.f, 0.f); 674 core::vector3df axis(1.0f, 0.f, 0.f);
675 axis = axis.crossProduct(v0); 675 axis = axis.crossProduct(v0);
676 if (axis.getLength()==0) 676 if (axis.getLength()==0)
677 { 677 {
678 axis.set(0.f,1.f,0.f); 678 axis.set(0.f,1.f,0.f);
679 axis.crossProduct(v0); 679 axis.crossProduct(v0);
680 } 680 }
681 // same as fromAngleAxis(core::PI, axis).normalize(); 681 // same as fromAngleAxis(core::PI, axis).normalize();
682 return set(axis.X, axis.Y, axis.Z, 0).normalize(); 682 return set(axis.X, axis.Y, axis.Z, 0).normalize();
683 } 683 }
684 684
685 const f32 s = sqrtf( (1+d)*2 ); // optimize inv_sqrt 685 const f32 s = sqrtf( (1+d)*2 ); // optimize inv_sqrt
686 const f32 invs = 1.f / s; 686 const f32 invs = 1.f / s;
687 const vector3df c = v0.crossProduct(v1)*invs; 687 const vector3df c = v0.crossProduct(v1)*invs;
688 return set(c.X, c.Y, c.Z, s * 0.5f).normalize(); 688 return set(c.X, c.Y, c.Z, s * 0.5f).normalize();
689} 689}
690 690
691 691
692} // end namespace core 692} // end namespace core
693} // end namespace irr 693} // end namespace irr
694 694
695#endif 695#endif
696 696
diff --git a/libraries/irrlicht-1.8/include/rect.h b/libraries/irrlicht-1.8/include/rect.h
index 3f3883e..1e2572c 100644
--- a/libraries/irrlicht-1.8/include/rect.h
+++ b/libraries/irrlicht-1.8/include/rect.h
@@ -1,279 +1,279 @@
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#ifndef __IRR_RECT_H_INCLUDED__ 5#ifndef __IRR_RECT_H_INCLUDED__
6#define __IRR_RECT_H_INCLUDED__ 6#define __IRR_RECT_H_INCLUDED__
7 7
8#include "irrTypes.h" 8#include "irrTypes.h"
9#include "dimension2d.h" 9#include "dimension2d.h"
10#include "position2d.h" 10#include "position2d.h"
11 11
12namespace irr 12namespace irr
13{ 13{
14namespace core 14namespace core
15{ 15{
16 16
17 //! Rectangle template. 17 //! Rectangle template.
18 /** Mostly used by 2D GUI elements and for 2D drawing methods. 18 /** Mostly used by 2D GUI elements and for 2D drawing methods.
19 It has 2 positions instead of position and dimension and a fast 19 It has 2 positions instead of position and dimension and a fast
20 method for collision detection with other rectangles and points. 20 method for collision detection with other rectangles and points.
21 21
22 Coordinates are (0,0) for top-left corner, and increasing to the right 22 Coordinates are (0,0) for top-left corner, and increasing to the right
23 and to the bottom. 23 and to the bottom.
24 */ 24 */
25 template <class T> 25 template <class T>
26 class rect 26 class rect
27 { 27 {
28 public: 28 public:
29 29
30 //! Default constructor creating empty rectangle at (0,0) 30 //! Default constructor creating empty rectangle at (0,0)
31 rect() : UpperLeftCorner(0,0), LowerRightCorner(0,0) {} 31 rect() : UpperLeftCorner(0,0), LowerRightCorner(0,0) {}
32 32
33 //! Constructor with two corners 33 //! Constructor with two corners
34 rect(T x, T y, T x2, T y2) 34 rect(T x, T y, T x2, T y2)
35 : UpperLeftCorner(x,y), LowerRightCorner(x2,y2) {} 35 : UpperLeftCorner(x,y), LowerRightCorner(x2,y2) {}
36 36
37 //! Constructor with two corners 37 //! Constructor with two corners
38 rect(const position2d<T>& upperLeft, const position2d<T>& lowerRight) 38 rect(const position2d<T>& upperLeft, const position2d<T>& lowerRight)
39 : UpperLeftCorner(upperLeft), LowerRightCorner(lowerRight) {} 39 : UpperLeftCorner(upperLeft), LowerRightCorner(lowerRight) {}
40 40
41 //! Constructor with upper left corner and dimension 41 //! Constructor with upper left corner and dimension
42 template <class U> 42 template <class U>
43 rect(const position2d<T>& pos, const dimension2d<U>& size) 43 rect(const position2d<T>& pos, const dimension2d<U>& size)
44 : UpperLeftCorner(pos), LowerRightCorner(pos.X + size.Width, pos.Y + size.Height) {} 44 : UpperLeftCorner(pos), LowerRightCorner(pos.X + size.Width, pos.Y + size.Height) {}
45 45
46 //! move right by given numbers 46 //! move right by given numbers
47 rect<T> operator+(const position2d<T>& pos) const 47 rect<T> operator+(const position2d<T>& pos) const
48 { 48 {
49 rect<T> ret(*this); 49 rect<T> ret(*this);
50 return ret+=pos; 50 return ret+=pos;
51 } 51 }
52 52
53 //! move right by given numbers 53 //! move right by given numbers
54 rect<T>& operator+=(const position2d<T>& pos) 54 rect<T>& operator+=(const position2d<T>& pos)
55 { 55 {
56 UpperLeftCorner += pos; 56 UpperLeftCorner += pos;
57 LowerRightCorner += pos; 57 LowerRightCorner += pos;
58 return *this; 58 return *this;
59 } 59 }
60 60
61 //! move left by given numbers 61 //! move left by given numbers
62 rect<T> operator-(const position2d<T>& pos) const 62 rect<T> operator-(const position2d<T>& pos) const
63 { 63 {
64 rect<T> ret(*this); 64 rect<T> ret(*this);
65 return ret-=pos; 65 return ret-=pos;
66 } 66 }
67 67
68 //! move left by given numbers 68 //! move left by given numbers
69 rect<T>& operator-=(const position2d<T>& pos) 69 rect<T>& operator-=(const position2d<T>& pos)
70 { 70 {
71 UpperLeftCorner -= pos; 71 UpperLeftCorner -= pos;
72 LowerRightCorner -= pos; 72 LowerRightCorner -= pos;
73 return *this; 73 return *this;
74 } 74 }
75 75
76 //! equality operator 76 //! equality operator
77 bool operator==(const rect<T>& other) const 77 bool operator==(const rect<T>& other) const
78 { 78 {
79 return (UpperLeftCorner == other.UpperLeftCorner && 79 return (UpperLeftCorner == other.UpperLeftCorner &&
80 LowerRightCorner == other.LowerRightCorner); 80 LowerRightCorner == other.LowerRightCorner);
81 } 81 }
82 82
83 //! inequality operator 83 //! inequality operator
84 bool operator!=(const rect<T>& other) const 84 bool operator!=(const rect<T>& other) const
85 { 85 {
86 return (UpperLeftCorner != other.UpperLeftCorner || 86 return (UpperLeftCorner != other.UpperLeftCorner ||
87 LowerRightCorner != other.LowerRightCorner); 87 LowerRightCorner != other.LowerRightCorner);
88 } 88 }
89 89
90 //! compares size of rectangles 90 //! compares size of rectangles
91 bool operator<(const rect<T>& other) const 91 bool operator<(const rect<T>& other) const
92 { 92 {
93 return getArea() < other.getArea(); 93 return getArea() < other.getArea();
94 } 94 }
95 95
96 //! Returns size of rectangle 96 //! Returns size of rectangle
97 T getArea() const 97 T getArea() const
98 { 98 {
99 return getWidth() * getHeight(); 99 return getWidth() * getHeight();
100 } 100 }
101 101
102 //! Returns if a 2d point is within this rectangle. 102 //! Returns if a 2d point is within this rectangle.
103 /** \param pos Position to test if it lies within this rectangle. 103 /** \param pos Position to test if it lies within this rectangle.
104 \return True if the position is within the rectangle, false if not. */ 104 \return True if the position is within the rectangle, false if not. */
105 bool isPointInside(const position2d<T>& pos) const 105 bool isPointInside(const position2d<T>& pos) const
106 { 106 {
107 return (UpperLeftCorner.X <= pos.X && 107 return (UpperLeftCorner.X <= pos.X &&
108 UpperLeftCorner.Y <= pos.Y && 108 UpperLeftCorner.Y <= pos.Y &&
109 LowerRightCorner.X >= pos.X && 109 LowerRightCorner.X >= pos.X &&
110 LowerRightCorner.Y >= pos.Y); 110 LowerRightCorner.Y >= pos.Y);
111 } 111 }
112 112
113 //! Check if the rectangle collides with another rectangle. 113 //! Check if the rectangle collides with another rectangle.
114 /** \param other Rectangle to test collision with 114 /** \param other Rectangle to test collision with
115 \return True if the rectangles collide. */ 115 \return True if the rectangles collide. */
116 bool isRectCollided(const rect<T>& other) const 116 bool isRectCollided(const rect<T>& other) const
117 { 117 {
118 return (LowerRightCorner.Y > other.UpperLeftCorner.Y && 118 return (LowerRightCorner.Y > other.UpperLeftCorner.Y &&
119 UpperLeftCorner.Y < other.LowerRightCorner.Y && 119 UpperLeftCorner.Y < other.LowerRightCorner.Y &&
120 LowerRightCorner.X > other.UpperLeftCorner.X && 120 LowerRightCorner.X > other.UpperLeftCorner.X &&
121 UpperLeftCorner.X < other.LowerRightCorner.X); 121 UpperLeftCorner.X < other.LowerRightCorner.X);
122 } 122 }
123 123
124 //! Clips this rectangle with another one. 124 //! Clips this rectangle with another one.
125 /** \param other Rectangle to clip with */ 125 /** \param other Rectangle to clip with */
126 void clipAgainst(const rect<T>& other) 126 void clipAgainst(const rect<T>& other)
127 { 127 {
128 if (other.LowerRightCorner.X < LowerRightCorner.X) 128 if (other.LowerRightCorner.X < LowerRightCorner.X)
129 LowerRightCorner.X = other.LowerRightCorner.X; 129 LowerRightCorner.X = other.LowerRightCorner.X;
130 if (other.LowerRightCorner.Y < LowerRightCorner.Y) 130 if (other.LowerRightCorner.Y < LowerRightCorner.Y)
131 LowerRightCorner.Y = other.LowerRightCorner.Y; 131 LowerRightCorner.Y = other.LowerRightCorner.Y;
132 132
133 if (other.UpperLeftCorner.X > UpperLeftCorner.X) 133 if (other.UpperLeftCorner.X > UpperLeftCorner.X)
134 UpperLeftCorner.X = other.UpperLeftCorner.X; 134 UpperLeftCorner.X = other.UpperLeftCorner.X;
135 if (other.UpperLeftCorner.Y > UpperLeftCorner.Y) 135 if (other.UpperLeftCorner.Y > UpperLeftCorner.Y)
136 UpperLeftCorner.Y = other.UpperLeftCorner.Y; 136 UpperLeftCorner.Y = other.UpperLeftCorner.Y;
137 137
138 // correct possible invalid rect resulting from clipping 138 // correct possible invalid rect resulting from clipping
139 if (UpperLeftCorner.Y > LowerRightCorner.Y) 139 if (UpperLeftCorner.Y > LowerRightCorner.Y)
140 UpperLeftCorner.Y = LowerRightCorner.Y; 140 UpperLeftCorner.Y = LowerRightCorner.Y;
141 if (UpperLeftCorner.X > LowerRightCorner.X) 141 if (UpperLeftCorner.X > LowerRightCorner.X)
142 UpperLeftCorner.X = LowerRightCorner.X; 142 UpperLeftCorner.X = LowerRightCorner.X;
143 } 143 }
144 144
145 //! Moves this rectangle to fit inside another one. 145 //! Moves this rectangle to fit inside another one.
146 /** \return True on success, false if not possible */ 146 /** \return True on success, false if not possible */
147 bool constrainTo(const rect<T>& other) 147 bool constrainTo(const rect<T>& other)
148 { 148 {
149 if (other.getWidth() < getWidth() || other.getHeight() < getHeight()) 149 if (other.getWidth() < getWidth() || other.getHeight() < getHeight())
150 return false; 150 return false;
151 151
152 T diff = other.LowerRightCorner.X - LowerRightCorner.X; 152 T diff = other.LowerRightCorner.X - LowerRightCorner.X;
153 if (diff < 0) 153 if (diff < 0)
154 { 154 {
155 LowerRightCorner.X += diff; 155 LowerRightCorner.X += diff;
156 UpperLeftCorner.X += diff; 156 UpperLeftCorner.X += diff;
157 } 157 }
158 158
159 diff = other.LowerRightCorner.Y - LowerRightCorner.Y; 159 diff = other.LowerRightCorner.Y - LowerRightCorner.Y;
160 if (diff < 0) 160 if (diff < 0)
161 { 161 {
162 LowerRightCorner.Y += diff; 162 LowerRightCorner.Y += diff;
163 UpperLeftCorner.Y += diff; 163 UpperLeftCorner.Y += diff;
164 } 164 }
165 165
166 diff = UpperLeftCorner.X - other.UpperLeftCorner.X; 166 diff = UpperLeftCorner.X - other.UpperLeftCorner.X;
167 if (diff < 0) 167 if (diff < 0)
168 { 168 {
169 UpperLeftCorner.X -= diff; 169 UpperLeftCorner.X -= diff;
170 LowerRightCorner.X -= diff; 170 LowerRightCorner.X -= diff;
171 } 171 }
172 172
173 diff = UpperLeftCorner.Y - other.UpperLeftCorner.Y; 173 diff = UpperLeftCorner.Y - other.UpperLeftCorner.Y;
174 if (diff < 0) 174 if (diff < 0)
175 { 175 {
176 UpperLeftCorner.Y -= diff; 176 UpperLeftCorner.Y -= diff;
177 LowerRightCorner.Y -= diff; 177 LowerRightCorner.Y -= diff;
178 } 178 }
179 179
180 return true; 180 return true;
181 } 181 }
182 182
183 //! Get width of rectangle. 183 //! Get width of rectangle.
184 T getWidth() const 184 T getWidth() const
185 { 185 {
186 return LowerRightCorner.X - UpperLeftCorner.X; 186 return LowerRightCorner.X - UpperLeftCorner.X;
187 } 187 }
188 188
189 //! Get height of rectangle. 189 //! Get height of rectangle.
190 T getHeight() const 190 T getHeight() const
191 { 191 {
192 return LowerRightCorner.Y - UpperLeftCorner.Y; 192 return LowerRightCorner.Y - UpperLeftCorner.Y;
193 } 193 }
194 194
195 //! If the lower right corner of the rect is smaller then the upper left, the points are swapped. 195 //! If the lower right corner of the rect is smaller then the upper left, the points are swapped.
196 void repair() 196 void repair()
197 { 197 {
198 if (LowerRightCorner.X < UpperLeftCorner.X) 198 if (LowerRightCorner.X < UpperLeftCorner.X)
199 { 199 {
200 T t = LowerRightCorner.X; 200 T t = LowerRightCorner.X;
201 LowerRightCorner.X = UpperLeftCorner.X; 201 LowerRightCorner.X = UpperLeftCorner.X;
202 UpperLeftCorner.X = t; 202 UpperLeftCorner.X = t;
203 } 203 }
204 204
205 if (LowerRightCorner.Y < UpperLeftCorner.Y) 205 if (LowerRightCorner.Y < UpperLeftCorner.Y)
206 { 206 {
207 T t = LowerRightCorner.Y; 207 T t = LowerRightCorner.Y;
208 LowerRightCorner.Y = UpperLeftCorner.Y; 208 LowerRightCorner.Y = UpperLeftCorner.Y;
209 UpperLeftCorner.Y = t; 209 UpperLeftCorner.Y = t;
210 } 210 }
211 } 211 }
212 212
213 //! Returns if the rect is valid to draw. 213 //! Returns if the rect is valid to draw.
214 /** It would be invalid if the UpperLeftCorner is lower or more 214 /** It would be invalid if the UpperLeftCorner is lower or more
215 right than the LowerRightCorner. */ 215 right than the LowerRightCorner. */
216 bool isValid() const 216 bool isValid() const
217 { 217 {
218 return ((LowerRightCorner.X >= UpperLeftCorner.X) && 218 return ((LowerRightCorner.X >= UpperLeftCorner.X) &&
219 (LowerRightCorner.Y >= UpperLeftCorner.Y)); 219 (LowerRightCorner.Y >= UpperLeftCorner.Y));
220 } 220 }
221 221
222 //! Get the center of the rectangle 222 //! Get the center of the rectangle
223 position2d<T> getCenter() const 223 position2d<T> getCenter() const
224 { 224 {
225 return position2d<T>( 225 return position2d<T>(
226 (UpperLeftCorner.X + LowerRightCorner.X) / 2, 226 (UpperLeftCorner.X + LowerRightCorner.X) / 2,
227 (UpperLeftCorner.Y + LowerRightCorner.Y) / 2); 227 (UpperLeftCorner.Y + LowerRightCorner.Y) / 2);
228 } 228 }
229 229
230 //! Get the dimensions of the rectangle 230 //! Get the dimensions of the rectangle
231 dimension2d<T> getSize() const 231 dimension2d<T> getSize() const
232 { 232 {
233 return dimension2d<T>(getWidth(), getHeight()); 233 return dimension2d<T>(getWidth(), getHeight());
234 } 234 }
235 235
236 236
237 //! Adds a point to the rectangle 237 //! Adds a point to the rectangle
238 /** Causes the rectangle to grow bigger if point is outside of 238 /** Causes the rectangle to grow bigger if point is outside of
239 the box 239 the box
240 \param p Point to add to the box. */ 240 \param p Point to add to the box. */
241 void addInternalPoint(const position2d<T>& p) 241 void addInternalPoint(const position2d<T>& p)
242 { 242 {
243 addInternalPoint(p.X, p.Y); 243 addInternalPoint(p.X, p.Y);
244 } 244 }
245 245
246 //! Adds a point to the bounding rectangle 246 //! Adds a point to the bounding rectangle
247 /** Causes the rectangle to grow bigger if point is outside of 247 /** Causes the rectangle to grow bigger if point is outside of
248 the box 248 the box
249 \param x X-Coordinate of the point to add to this box. 249 \param x X-Coordinate of the point to add to this box.
250 \param y Y-Coordinate of the point to add to this box. */ 250 \param y Y-Coordinate of the point to add to this box. */
251 void addInternalPoint(T x, T y) 251 void addInternalPoint(T x, T y)
252 { 252 {
253 if (x>LowerRightCorner.X) 253 if (x>LowerRightCorner.X)
254 LowerRightCorner.X = x; 254 LowerRightCorner.X = x;
255 if (y>LowerRightCorner.Y) 255 if (y>LowerRightCorner.Y)
256 LowerRightCorner.Y = y; 256 LowerRightCorner.Y = y;
257 257
258 if (x<UpperLeftCorner.X) 258 if (x<UpperLeftCorner.X)
259 UpperLeftCorner.X = x; 259 UpperLeftCorner.X = x;
260 if (y<UpperLeftCorner.Y) 260 if (y<UpperLeftCorner.Y)
261 UpperLeftCorner.Y = y; 261 UpperLeftCorner.Y = y;
262 } 262 }
263 263
264 //! Upper left corner 264 //! Upper left corner
265 position2d<T> UpperLeftCorner; 265 position2d<T> UpperLeftCorner;
266 //! Lower right corner 266 //! Lower right corner
267 position2d<T> LowerRightCorner; 267 position2d<T> LowerRightCorner;
268 }; 268 };
269 269
270 //! Rectangle with float values 270 //! Rectangle with float values
271 typedef rect<f32> rectf; 271 typedef rect<f32> rectf;
272 //! Rectangle with int values 272 //! Rectangle with int values
273 typedef rect<s32> recti; 273 typedef rect<s32> recti;
274 274
275} // end namespace core 275} // end namespace core
276} // end namespace irr 276} // end namespace irr
277 277
278#endif 278#endif
279 279
diff --git a/libraries/irrlicht-1.8/include/triangle3d.h b/libraries/irrlicht-1.8/include/triangle3d.h
index 2f5a36c..dbf8a8b 100644
--- a/libraries/irrlicht-1.8/include/triangle3d.h
+++ b/libraries/irrlicht-1.8/include/triangle3d.h
@@ -1,279 +1,279 @@
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#ifndef __IRR_TRIANGLE_3D_H_INCLUDED__ 5#ifndef __IRR_TRIANGLE_3D_H_INCLUDED__
6#define __IRR_TRIANGLE_3D_H_INCLUDED__ 6#define __IRR_TRIANGLE_3D_H_INCLUDED__
7 7
8#include "vector3d.h" 8#include "vector3d.h"
9#include "line3d.h" 9#include "line3d.h"
10#include "plane3d.h" 10#include "plane3d.h"
11#include "aabbox3d.h" 11#include "aabbox3d.h"
12 12
13namespace irr 13namespace irr
14{ 14{
15namespace core 15namespace core
16{ 16{
17 17
18 //! 3d triangle template class for doing collision detection and other things. 18 //! 3d triangle template class for doing collision detection and other things.
19 template <class T> 19 template <class T>
20 class triangle3d 20 class triangle3d
21 { 21 {
22 public: 22 public:
23 23
24 //! Constructor for an all 0 triangle 24 //! Constructor for an all 0 triangle
25 triangle3d() {} 25 triangle3d() {}
26 //! Constructor for triangle with given three vertices 26 //! Constructor for triangle with given three vertices
27 triangle3d(vector3d<T> v1, vector3d<T> v2, vector3d<T> v3) : pointA(v1), pointB(v2), pointC(v3) {} 27 triangle3d(vector3d<T> v1, vector3d<T> v2, vector3d<T> v3) : pointA(v1), pointB(v2), pointC(v3) {}
28 28
29 //! Equality operator 29 //! Equality operator
30 bool operator==(const triangle3d<T>& other) const 30 bool operator==(const triangle3d<T>& other) const
31 { 31 {
32 return other.pointA==pointA && other.pointB==pointB && other.pointC==pointC; 32 return other.pointA==pointA && other.pointB==pointB && other.pointC==pointC;
33 } 33 }
34 34
35 //! Inequality operator 35 //! Inequality operator
36 bool operator!=(const triangle3d<T>& other) const 36 bool operator!=(const triangle3d<T>& other) const
37 { 37 {
38 return !(*this==other); 38 return !(*this==other);
39 } 39 }
40 40
41 //! Determines if the triangle is totally inside a bounding box. 41 //! Determines if the triangle is totally inside a bounding box.
42 /** \param box Box to check. 42 /** \param box Box to check.
43 \return True if triangle is within the box, otherwise false. */ 43 \return True if triangle is within the box, otherwise false. */
44 bool isTotalInsideBox(const aabbox3d<T>& box) const 44 bool isTotalInsideBox(const aabbox3d<T>& box) const
45 { 45 {
46 return (box.isPointInside(pointA) && 46 return (box.isPointInside(pointA) &&
47 box.isPointInside(pointB) && 47 box.isPointInside(pointB) &&
48 box.isPointInside(pointC)); 48 box.isPointInside(pointC));
49 } 49 }
50 50
51 //! Determines if the triangle is totally outside a bounding box. 51 //! Determines if the triangle is totally outside a bounding box.
52 /** \param box Box to check. 52 /** \param box Box to check.
53 \return True if triangle is outside the box, otherwise false. */ 53 \return True if triangle is outside the box, otherwise false. */
54 bool isTotalOutsideBox(const aabbox3d<T>& box) const 54 bool isTotalOutsideBox(const aabbox3d<T>& box) const
55 { 55 {
56 return ((pointA.X > box.MaxEdge.X && pointB.X > box.MaxEdge.X && pointC.X > box.MaxEdge.X) || 56 return ((pointA.X > box.MaxEdge.X && pointB.X > box.MaxEdge.X && pointC.X > box.MaxEdge.X) ||
57 57
58 (pointA.Y > box.MaxEdge.Y && pointB.Y > box.MaxEdge.Y && pointC.Y > box.MaxEdge.Y) || 58 (pointA.Y > box.MaxEdge.Y && pointB.Y > box.MaxEdge.Y && pointC.Y > box.MaxEdge.Y) ||
59 (pointA.Z > box.MaxEdge.Z && pointB.Z > box.MaxEdge.Z && pointC.Z > box.MaxEdge.Z) || 59 (pointA.Z > box.MaxEdge.Z && pointB.Z > box.MaxEdge.Z && pointC.Z > box.MaxEdge.Z) ||
60 (pointA.X < box.MinEdge.X && pointB.X < box.MinEdge.X && pointC.X < box.MinEdge.X) || 60 (pointA.X < box.MinEdge.X && pointB.X < box.MinEdge.X && pointC.X < box.MinEdge.X) ||
61 (pointA.Y < box.MinEdge.Y && pointB.Y < box.MinEdge.Y && pointC.Y < box.MinEdge.Y) || 61 (pointA.Y < box.MinEdge.Y && pointB.Y < box.MinEdge.Y && pointC.Y < box.MinEdge.Y) ||
62 (pointA.Z < box.MinEdge.Z && pointB.Z < box.MinEdge.Z && pointC.Z < box.MinEdge.Z)); 62 (pointA.Z < box.MinEdge.Z && pointB.Z < box.MinEdge.Z && pointC.Z < box.MinEdge.Z));
63 } 63 }
64 64
65 //! Get the closest point on a triangle to a point on the same plane. 65 //! Get the closest point on a triangle to a point on the same plane.
66 /** \param p Point which must be on the same plane as the triangle. 66 /** \param p Point which must be on the same plane as the triangle.
67 \return The closest point of the triangle */ 67 \return The closest point of the triangle */
68 core::vector3d<T> closestPointOnTriangle(const core::vector3d<T>& p) const 68 core::vector3d<T> closestPointOnTriangle(const core::vector3d<T>& p) const
69 { 69 {
70 const core::vector3d<T> rab = line3d<T>(pointA, pointB).getClosestPoint(p); 70 const core::vector3d<T> rab = line3d<T>(pointA, pointB).getClosestPoint(p);
71 const core::vector3d<T> rbc = line3d<T>(pointB, pointC).getClosestPoint(p); 71 const core::vector3d<T> rbc = line3d<T>(pointB, pointC).getClosestPoint(p);
72 const core::vector3d<T> rca = line3d<T>(pointC, pointA).getClosestPoint(p); 72 const core::vector3d<T> rca = line3d<T>(pointC, pointA).getClosestPoint(p);
73 73
74 const T d1 = rab.getDistanceFrom(p); 74 const T d1 = rab.getDistanceFrom(p);
75 const T d2 = rbc.getDistanceFrom(p); 75 const T d2 = rbc.getDistanceFrom(p);
76 const T d3 = rca.getDistanceFrom(p); 76 const T d3 = rca.getDistanceFrom(p);
77 77
78 if (d1 < d2) 78 if (d1 < d2)
79 return d1 < d3 ? rab : rca; 79 return d1 < d3 ? rab : rca;
80 80
81 return d2 < d3 ? rbc : rca; 81 return d2 < d3 ? rbc : rca;
82 } 82 }
83 83
84 //! Check if a point is inside the triangle (border-points count also as inside) 84 //! Check if a point is inside the triangle (border-points count also as inside)
85 /* 85 /*
86 \param p Point to test. Assumes that this point is already 86 \param p Point to test. Assumes that this point is already
87 on the plane of the triangle. 87 on the plane of the triangle.
88 \return True if the point is inside the triangle, otherwise false. */ 88 \return True if the point is inside the triangle, otherwise false. */
89 bool isPointInside(const vector3d<T>& p) const 89 bool isPointInside(const vector3d<T>& p) const
90 { 90 {
91 vector3d<f64> af64((f64)pointA.X, (f64)pointA.Y, (f64)pointA.Z); 91 vector3d<f64> af64((f64)pointA.X, (f64)pointA.Y, (f64)pointA.Z);
92 vector3d<f64> bf64((f64)pointB.X, (f64)pointB.Y, (f64)pointB.Z); 92 vector3d<f64> bf64((f64)pointB.X, (f64)pointB.Y, (f64)pointB.Z);
93 vector3d<f64> cf64((f64)pointC.X, (f64)pointC.Y, (f64)pointC.Z); 93 vector3d<f64> cf64((f64)pointC.X, (f64)pointC.Y, (f64)pointC.Z);
94 vector3d<f64> pf64((f64)p.X, (f64)p.Y, (f64)p.Z); 94 vector3d<f64> pf64((f64)p.X, (f64)p.Y, (f64)p.Z);
95 return (isOnSameSide(pf64, af64, bf64, cf64) && 95 return (isOnSameSide(pf64, af64, bf64, cf64) &&
96 isOnSameSide(pf64, bf64, af64, cf64) && 96 isOnSameSide(pf64, bf64, af64, cf64) &&
97 isOnSameSide(pf64, cf64, af64, bf64)); 97 isOnSameSide(pf64, cf64, af64, bf64));
98 } 98 }
99 99
100 //! Check if a point is inside the triangle (border-points count also as inside) 100 //! Check if a point is inside the triangle (border-points count also as inside)
101 /** This method uses a barycentric coordinate system. 101 /** This method uses a barycentric coordinate system.
102 It is faster than isPointInside but is more susceptible to floating point rounding 102 It is faster than isPointInside but is more susceptible to floating point rounding
103 errors. This will especially be noticable when the FPU is in single precision mode 103 errors. This will especially be noticable when the FPU is in single precision mode
104 (which is for example set on default by Direct3D). 104 (which is for example set on default by Direct3D).
105 \param p Point to test. Assumes that this point is already 105 \param p Point to test. Assumes that this point is already
106 on the plane of the triangle. 106 on the plane of the triangle.
107 \return True if point is inside the triangle, otherwise false. */ 107 \return True if point is inside the triangle, otherwise false. */
108 bool isPointInsideFast(const vector3d<T>& p) const 108 bool isPointInsideFast(const vector3d<T>& p) const
109 { 109 {
110 const vector3d<T> a = pointC - pointA; 110 const vector3d<T> a = pointC - pointA;
111 const vector3d<T> b = pointB - pointA; 111 const vector3d<T> b = pointB - pointA;
112 const vector3d<T> c = p - pointA; 112 const vector3d<T> c = p - pointA;
113 113
114 const f64 dotAA = a.dotProduct( a); 114 const f64 dotAA = a.dotProduct( a);
115 const f64 dotAB = a.dotProduct( b); 115 const f64 dotAB = a.dotProduct( b);
116 const f64 dotAC = a.dotProduct( c); 116 const f64 dotAC = a.dotProduct( c);
117 const f64 dotBB = b.dotProduct( b); 117 const f64 dotBB = b.dotProduct( b);
118 const f64 dotBC = b.dotProduct( c); 118 const f64 dotBC = b.dotProduct( c);
119 119
120 // get coordinates in barycentric coordinate system 120 // get coordinates in barycentric coordinate system
121 const f64 invDenom = 1/(dotAA * dotBB - dotAB * dotAB); 121 const f64 invDenom = 1/(dotAA * dotBB - dotAB * dotAB);
122 const f64 u = (dotBB * dotAC - dotAB * dotBC) * invDenom; 122 const f64 u = (dotBB * dotAC - dotAB * dotBC) * invDenom;
123 const f64 v = (dotAA * dotBC - dotAB * dotAC ) * invDenom; 123 const f64 v = (dotAA * dotBC - dotAB * dotAC ) * invDenom;
124 124
125 // We count border-points as inside to keep downward compatibility. 125 // We count border-points as inside to keep downward compatibility.
126 // Rounding-error also needed for some test-cases. 126 // Rounding-error also needed for some test-cases.
127 return (u > -ROUNDING_ERROR_f32) && (v >= 0) && (u + v < 1+ROUNDING_ERROR_f32); 127 return (u > -ROUNDING_ERROR_f32) && (v >= 0) && (u + v < 1+ROUNDING_ERROR_f32);
128 128
129 } 129 }
130 130
131 131
132 //! Get an intersection with a 3d line. 132 //! Get an intersection with a 3d line.
133 /** \param line Line to intersect with. 133 /** \param line Line to intersect with.
134 \param outIntersection Place to store the intersection point, if there is one. 134 \param outIntersection Place to store the intersection point, if there is one.
135 \return True if there was an intersection, false if not. */ 135 \return True if there was an intersection, false if not. */
136 bool getIntersectionWithLimitedLine(const line3d<T>& line, 136 bool getIntersectionWithLimitedLine(const line3d<T>& line,
137 vector3d<T>& outIntersection) const 137 vector3d<T>& outIntersection) const
138 { 138 {
139 return getIntersectionWithLine(line.start, 139 return getIntersectionWithLine(line.start,
140 line.getVector(), outIntersection) && 140 line.getVector(), outIntersection) &&
141 outIntersection.isBetweenPoints(line.start, line.end); 141 outIntersection.isBetweenPoints(line.start, line.end);
142 } 142 }
143 143
144 144
145 //! Get an intersection with a 3d line. 145 //! Get an intersection with a 3d line.
146 /** Please note that also points are returned as intersection which 146 /** Please note that also points are returned as intersection which
147 are on the line, but not between the start and end point of the line. 147 are on the line, but not between the start and end point of the line.
148 If you want the returned point be between start and end 148 If you want the returned point be between start and end
149 use getIntersectionWithLimitedLine(). 149 use getIntersectionWithLimitedLine().
150 \param linePoint Point of the line to intersect with. 150 \param linePoint Point of the line to intersect with.
151 \param lineVect Vector of the line to intersect with. 151 \param lineVect Vector of the line to intersect with.
152 \param outIntersection Place to store the intersection point, if there is one. 152 \param outIntersection Place to store the intersection point, if there is one.
153 \return True if there was an intersection, false if there was not. */ 153 \return True if there was an intersection, false if there was not. */
154 bool getIntersectionWithLine(const vector3d<T>& linePoint, 154 bool getIntersectionWithLine(const vector3d<T>& linePoint,
155 const vector3d<T>& lineVect, vector3d<T>& outIntersection) const 155 const vector3d<T>& lineVect, vector3d<T>& outIntersection) const
156 { 156 {
157 if (getIntersectionOfPlaneWithLine(linePoint, lineVect, outIntersection)) 157 if (getIntersectionOfPlaneWithLine(linePoint, lineVect, outIntersection))
158 return isPointInside(outIntersection); 158 return isPointInside(outIntersection);
159 159
160 return false; 160 return false;
161 } 161 }
162 162
163 163
164 //! Calculates the intersection between a 3d line and the plane the triangle is on. 164 //! Calculates the intersection between a 3d line and the plane the triangle is on.
165 /** \param lineVect Vector of the line to intersect with. 165 /** \param lineVect Vector of the line to intersect with.
166 \param linePoint Point of the line to intersect with. 166 \param linePoint Point of the line to intersect with.
167 \param outIntersection Place to store the intersection point, if there is one. 167 \param outIntersection Place to store the intersection point, if there is one.
168 \return True if there was an intersection, else false. */ 168 \return True if there was an intersection, else false. */
169 bool getIntersectionOfPlaneWithLine(const vector3d<T>& linePoint, 169 bool getIntersectionOfPlaneWithLine(const vector3d<T>& linePoint,
170 const vector3d<T>& lineVect, vector3d<T>& outIntersection) const 170 const vector3d<T>& lineVect, vector3d<T>& outIntersection) const
171 { 171 {
172 // Work with f64 to get more precise results (makes enough difference to be worth the casts). 172 // Work with f64 to get more precise results (makes enough difference to be worth the casts).
173 const vector3d<f64> linePointf64(linePoint.X, linePoint.Y, linePoint.Z); 173 const vector3d<f64> linePointf64(linePoint.X, linePoint.Y, linePoint.Z);
174 const vector3d<f64> lineVectf64(lineVect.X, lineVect.Y, lineVect.Z); 174 const vector3d<f64> lineVectf64(lineVect.X, lineVect.Y, lineVect.Z);
175 vector3d<f64> outIntersectionf64; 175 vector3d<f64> outIntersectionf64;
176 176
177 core::triangle3d<irr::f64> trianglef64(vector3d<f64>((f64)pointA.X, (f64)pointA.Y, (f64)pointA.Z) 177 core::triangle3d<irr::f64> trianglef64(vector3d<f64>((f64)pointA.X, (f64)pointA.Y, (f64)pointA.Z)
178 ,vector3d<f64>((f64)pointB.X, (f64)pointB.Y, (f64)pointB.Z) 178 ,vector3d<f64>((f64)pointB.X, (f64)pointB.Y, (f64)pointB.Z)
179 , vector3d<f64>((f64)pointC.X, (f64)pointC.Y, (f64)pointC.Z)); 179 , vector3d<f64>((f64)pointC.X, (f64)pointC.Y, (f64)pointC.Z));
180 const vector3d<irr::f64> normalf64 = trianglef64.getNormal().normalize(); 180 const vector3d<irr::f64> normalf64 = trianglef64.getNormal().normalize();
181 f64 t2; 181 f64 t2;
182 182
183 if ( core::iszero ( t2 = normalf64.dotProduct(lineVectf64) ) ) 183 if ( core::iszero ( t2 = normalf64.dotProduct(lineVectf64) ) )
184 return false; 184 return false;
185 185
186 f64 d = trianglef64.pointA.dotProduct(normalf64); 186 f64 d = trianglef64.pointA.dotProduct(normalf64);
187 f64 t = -(normalf64.dotProduct(linePointf64) - d) / t2; 187 f64 t = -(normalf64.dotProduct(linePointf64) - d) / t2;
188 outIntersectionf64 = linePointf64 + (lineVectf64 * t); 188 outIntersectionf64 = linePointf64 + (lineVectf64 * t);
189 189
190 outIntersection.X = (T)outIntersectionf64.X; 190 outIntersection.X = (T)outIntersectionf64.X;
191 outIntersection.Y = (T)outIntersectionf64.Y; 191 outIntersection.Y = (T)outIntersectionf64.Y;
192 outIntersection.Z = (T)outIntersectionf64.Z; 192 outIntersection.Z = (T)outIntersectionf64.Z;
193 return true; 193 return true;
194 } 194 }
195 195
196 196
197 //! Get the normal of the triangle. 197 //! Get the normal of the triangle.
198 /** Please note: The normal is not always normalized. */ 198 /** Please note: The normal is not always normalized. */
199 vector3d<T> getNormal() const 199 vector3d<T> getNormal() const
200 { 200 {
201 return (pointB - pointA).crossProduct(pointC - pointA); 201 return (pointB - pointA).crossProduct(pointC - pointA);
202 } 202 }
203 203
204 //! Test if the triangle would be front or backfacing from any point. 204 //! Test if the triangle would be front or backfacing from any point.
205 /** Thus, this method assumes a camera position from which the 205 /** Thus, this method assumes a camera position from which the
206 triangle is definitely visible when looking at the given direction. 206 triangle is definitely visible when looking at the given direction.
207 Do not use this method with points as it will give wrong results! 207 Do not use this method with points as it will give wrong results!
208 \param lookDirection Look direction. 208 \param lookDirection Look direction.
209 \return True if the plane is front facing and false if it is backfacing. */ 209 \return True if the plane is front facing and false if it is backfacing. */
210 bool isFrontFacing(const vector3d<T>& lookDirection) const 210 bool isFrontFacing(const vector3d<T>& lookDirection) const
211 { 211 {
212 const vector3d<T> n = getNormal().normalize(); 212 const vector3d<T> n = getNormal().normalize();
213 const f32 d = (f32)n.dotProduct(lookDirection); 213 const f32 d = (f32)n.dotProduct(lookDirection);
214 return F32_LOWER_EQUAL_0(d); 214 return F32_LOWER_EQUAL_0(d);
215 } 215 }
216 216
217 //! Get the plane of this triangle. 217 //! Get the plane of this triangle.
218 plane3d<T> getPlane() const 218 plane3d<T> getPlane() const
219 { 219 {
220 return plane3d<T>(pointA, pointB, pointC); 220 return plane3d<T>(pointA, pointB, pointC);
221 } 221 }
222 222
223 //! Get the area of the triangle 223 //! Get the area of the triangle
224 T getArea() const 224 T getArea() const
225 { 225 {
226 return (pointB - pointA).crossProduct(pointC - pointA).getLength() * 0.5f; 226 return (pointB - pointA).crossProduct(pointC - pointA).getLength() * 0.5f;
227 227
228 } 228 }
229 229
230 //! sets the triangle's points 230 //! sets the triangle's points
231 void set(const core::vector3d<T>& a, const core::vector3d<T>& b, const core::vector3d<T>& c) 231 void set(const core::vector3d<T>& a, const core::vector3d<T>& b, const core::vector3d<T>& c)
232 { 232 {
233 pointA = a; 233 pointA = a;
234 pointB = b; 234 pointB = b;
235 pointC = c; 235 pointC = c;
236 } 236 }
237 237
238 //! the three points of the triangle 238 //! the three points of the triangle
239 vector3d<T> pointA; 239 vector3d<T> pointA;
240 vector3d<T> pointB; 240 vector3d<T> pointB;
241 vector3d<T> pointC; 241 vector3d<T> pointC;
242 242
243 private: 243 private:
244 // Using f64 instead of <T> to avoid integer overflows when T=int (maybe also less floating point troubles). 244 // Using f64 instead of <T> to avoid integer overflows when T=int (maybe also less floating point troubles).
245 bool isOnSameSide(const vector3d<f64>& p1, const vector3d<f64>& p2, 245 bool isOnSameSide(const vector3d<f64>& p1, const vector3d<f64>& p2,
246 const vector3d<f64>& a, const vector3d<f64>& b) const 246 const vector3d<f64>& a, const vector3d<f64>& b) const
247 { 247 {
248 vector3d<f64> bminusa = b - a; 248 vector3d<f64> bminusa = b - a;
249 vector3d<f64> cp1 = bminusa.crossProduct(p1 - a); 249 vector3d<f64> cp1 = bminusa.crossProduct(p1 - a);
250 vector3d<f64> cp2 = bminusa.crossProduct(p2 - a); 250 vector3d<f64> cp2 = bminusa.crossProduct(p2 - a);
251 f64 res = cp1.dotProduct(cp2); 251 f64 res = cp1.dotProduct(cp2);
252 if ( res < 0 ) 252 if ( res < 0 )
253 { 253 {
254 // This catches some floating point troubles. 254 // This catches some floating point troubles.
255 // Unfortunately slightly expensive and we don't really know the best epsilon for iszero. 255 // Unfortunately slightly expensive and we don't really know the best epsilon for iszero.
256 vector3d<f64> cp1 = bminusa.normalize().crossProduct((p1 - a).normalize()); 256 vector3d<f64> cp1 = bminusa.normalize().crossProduct((p1 - a).normalize());
257 if ( core::iszero(cp1.X, (f64)ROUNDING_ERROR_f32) 257 if ( core::iszero(cp1.X, (f64)ROUNDING_ERROR_f32)
258 && core::iszero(cp1.Y, (f64)ROUNDING_ERROR_f32) 258 && core::iszero(cp1.Y, (f64)ROUNDING_ERROR_f32)
259 && core::iszero(cp1.Z, (f64)ROUNDING_ERROR_f32) ) 259 && core::iszero(cp1.Z, (f64)ROUNDING_ERROR_f32) )
260 { 260 {
261 res = 0.f; 261 res = 0.f;
262 } 262 }
263 } 263 }
264 return (res >= 0.0f); 264 return (res >= 0.0f);
265 } 265 }
266 }; 266 };
267 267
268 268
269 //! Typedef for a f32 3d triangle. 269 //! Typedef for a f32 3d triangle.
270 typedef triangle3d<f32> triangle3df; 270 typedef triangle3d<f32> triangle3df;
271 271
272 //! Typedef for an integer 3d triangle. 272 //! Typedef for an integer 3d triangle.
273 typedef triangle3d<s32> triangle3di; 273 typedef triangle3d<s32> triangle3di;
274 274
275} // end namespace core 275} // end namespace core
276} // end namespace irr 276} // end namespace irr
277 277
278#endif 278#endif
279 279
diff --git a/libraries/irrlicht-1.8/include/vector2d.h b/libraries/irrlicht-1.8/include/vector2d.h
index 360da8f..0927dfc 100644
--- a/libraries/irrlicht-1.8/include/vector2d.h
+++ b/libraries/irrlicht-1.8/include/vector2d.h
@@ -1,342 +1,342 @@
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#ifndef __IRR_POINT_2D_H_INCLUDED__ 5#ifndef __IRR_POINT_2D_H_INCLUDED__
6#define __IRR_POINT_2D_H_INCLUDED__ 6#define __IRR_POINT_2D_H_INCLUDED__
7 7
8#include "irrMath.h" 8#include "irrMath.h"
9#include "dimension2d.h" 9#include "dimension2d.h"
10 10
11namespace irr 11namespace irr
12{ 12{
13namespace core 13namespace core
14{ 14{
15 15
16 16
17//! 2d vector template class with lots of operators and methods. 17//! 2d vector template class with lots of operators and methods.
18/** As of Irrlicht 1.6, this class supercedes position2d, which should 18/** As of Irrlicht 1.6, this class supercedes position2d, which should
19 be considered deprecated. */ 19 be considered deprecated. */
20template <class T> 20template <class T>
21class vector2d 21class vector2d
22{ 22{
23public: 23public:
24 //! Default constructor (null vector) 24 //! Default constructor (null vector)
25 vector2d() : X(0), Y(0) {} 25 vector2d() : X(0), Y(0) {}
26 //! Constructor with two different values 26 //! Constructor with two different values
27 vector2d(T nx, T ny) : X(nx), Y(ny) {} 27 vector2d(T nx, T ny) : X(nx), Y(ny) {}
28 //! Constructor with the same value for both members 28 //! Constructor with the same value for both members
29 explicit vector2d(T n) : X(n), Y(n) {} 29 explicit vector2d(T n) : X(n), Y(n) {}
30 //! Copy constructor 30 //! Copy constructor
31 vector2d(const vector2d<T>& other) : X(other.X), Y(other.Y) {} 31 vector2d(const vector2d<T>& other) : X(other.X), Y(other.Y) {}
32 32
33 vector2d(const dimension2d<T>& other) : X(other.Width), Y(other.Height) {} 33 vector2d(const dimension2d<T>& other) : X(other.Width), Y(other.Height) {}
34 34
35 // operators 35 // operators
36 36
37 vector2d<T> operator-() const { return vector2d<T>(-X, -Y); } 37 vector2d<T> operator-() const { return vector2d<T>(-X, -Y); }
38 38
39 vector2d<T>& operator=(const vector2d<T>& other) { X = other.X; Y = other.Y; return *this; } 39 vector2d<T>& operator=(const vector2d<T>& other) { X = other.X; Y = other.Y; return *this; }
40 40
41 vector2d<T>& operator=(const dimension2d<T>& other) { X = other.Width; Y = other.Height; return *this; } 41 vector2d<T>& operator=(const dimension2d<T>& other) { X = other.Width; Y = other.Height; return *this; }
42 42
43 vector2d<T> operator+(const vector2d<T>& other) const { return vector2d<T>(X + other.X, Y + other.Y); } 43 vector2d<T> operator+(const vector2d<T>& other) const { return vector2d<T>(X + other.X, Y + other.Y); }
44 vector2d<T> operator+(const dimension2d<T>& other) const { return vector2d<T>(X + other.Width, Y + other.Height); } 44 vector2d<T> operator+(const dimension2d<T>& other) const { return vector2d<T>(X + other.Width, Y + other.Height); }
45 vector2d<T>& operator+=(const vector2d<T>& other) { X+=other.X; Y+=other.Y; return *this; } 45 vector2d<T>& operator+=(const vector2d<T>& other) { X+=other.X; Y+=other.Y; return *this; }
46 vector2d<T> operator+(const T v) const { return vector2d<T>(X + v, Y + v); } 46 vector2d<T> operator+(const T v) const { return vector2d<T>(X + v, Y + v); }
47 vector2d<T>& operator+=(const T v) { X+=v; Y+=v; return *this; } 47 vector2d<T>& operator+=(const T v) { X+=v; Y+=v; return *this; }
48 vector2d<T>& operator+=(const dimension2d<T>& other) { X += other.Width; Y += other.Height; return *this; } 48 vector2d<T>& operator+=(const dimension2d<T>& other) { X += other.Width; Y += other.Height; return *this; }
49 49
50 vector2d<T> operator-(const vector2d<T>& other) const { return vector2d<T>(X - other.X, Y - other.Y); } 50 vector2d<T> operator-(const vector2d<T>& other) const { return vector2d<T>(X - other.X, Y - other.Y); }
51 vector2d<T> operator-(const dimension2d<T>& other) const { return vector2d<T>(X - other.Width, Y - other.Height); } 51 vector2d<T> operator-(const dimension2d<T>& other) const { return vector2d<T>(X - other.Width, Y - other.Height); }
52 vector2d<T>& operator-=(const vector2d<T>& other) { X-=other.X; Y-=other.Y; return *this; } 52 vector2d<T>& operator-=(const vector2d<T>& other) { X-=other.X; Y-=other.Y; return *this; }
53 vector2d<T> operator-(const T v) const { return vector2d<T>(X - v, Y - v); } 53 vector2d<T> operator-(const T v) const { return vector2d<T>(X - v, Y - v); }
54 vector2d<T>& operator-=(const T v) { X-=v; Y-=v; return *this; } 54 vector2d<T>& operator-=(const T v) { X-=v; Y-=v; return *this; }
55 vector2d<T>& operator-=(const dimension2d<T>& other) { X -= other.Width; Y -= other.Height; return *this; } 55 vector2d<T>& operator-=(const dimension2d<T>& other) { X -= other.Width; Y -= other.Height; return *this; }
56 56
57 vector2d<T> operator*(const vector2d<T>& other) const { return vector2d<T>(X * other.X, Y * other.Y); } 57 vector2d<T> operator*(const vector2d<T>& other) const { return vector2d<T>(X * other.X, Y * other.Y); }
58 vector2d<T>& operator*=(const vector2d<T>& other) { X*=other.X; Y*=other.Y; return *this; } 58 vector2d<T>& operator*=(const vector2d<T>& other) { X*=other.X; Y*=other.Y; return *this; }
59 vector2d<T> operator*(const T v) const { return vector2d<T>(X * v, Y * v); } 59 vector2d<T> operator*(const T v) const { return vector2d<T>(X * v, Y * v); }
60 vector2d<T>& operator*=(const T v) { X*=v; Y*=v; return *this; } 60 vector2d<T>& operator*=(const T v) { X*=v; Y*=v; return *this; }
61 61
62 vector2d<T> operator/(const vector2d<T>& other) const { return vector2d<T>(X / other.X, Y / other.Y); } 62 vector2d<T> operator/(const vector2d<T>& other) const { return vector2d<T>(X / other.X, Y / other.Y); }
63 vector2d<T>& operator/=(const vector2d<T>& other) { X/=other.X; Y/=other.Y; return *this; } 63 vector2d<T>& operator/=(const vector2d<T>& other) { X/=other.X; Y/=other.Y; return *this; }
64 vector2d<T> operator/(const T v) const { return vector2d<T>(X / v, Y / v); } 64 vector2d<T> operator/(const T v) const { return vector2d<T>(X / v, Y / v); }
65 vector2d<T>& operator/=(const T v) { X/=v; Y/=v; return *this; } 65 vector2d<T>& operator/=(const T v) { X/=v; Y/=v; return *this; }
66 66
67 //! sort in order X, Y. Equality with rounding tolerance. 67 //! sort in order X, Y. Equality with rounding tolerance.
68 bool operator<=(const vector2d<T>&other) const 68 bool operator<=(const vector2d<T>&other) const
69 { 69 {
70 return (X<other.X || core::equals(X, other.X)) || 70 return (X<other.X || core::equals(X, other.X)) ||
71 (core::equals(X, other.X) && (Y<other.Y || core::equals(Y, other.Y))); 71 (core::equals(X, other.X) && (Y<other.Y || core::equals(Y, other.Y)));
72 } 72 }
73 73
74 //! sort in order X, Y. Equality with rounding tolerance. 74 //! sort in order X, Y. Equality with rounding tolerance.
75 bool operator>=(const vector2d<T>&other) const 75 bool operator>=(const vector2d<T>&other) const
76 { 76 {
77 return (X>other.X || core::equals(X, other.X)) || 77 return (X>other.X || core::equals(X, other.X)) ||
78 (core::equals(X, other.X) && (Y>other.Y || core::equals(Y, other.Y))); 78 (core::equals(X, other.X) && (Y>other.Y || core::equals(Y, other.Y)));
79 } 79 }
80 80
81 //! sort in order X, Y. Difference must be above rounding tolerance. 81 //! sort in order X, Y. Difference must be above rounding tolerance.
82 bool operator<(const vector2d<T>&other) const 82 bool operator<(const vector2d<T>&other) const
83 { 83 {
84 return (X<other.X && !core::equals(X, other.X)) || 84 return (X<other.X && !core::equals(X, other.X)) ||
85 (core::equals(X, other.X) && Y<other.Y && !core::equals(Y, other.Y)); 85 (core::equals(X, other.X) && Y<other.Y && !core::equals(Y, other.Y));
86 } 86 }
87 87
88 //! sort in order X, Y. Difference must be above rounding tolerance. 88 //! sort in order X, Y. Difference must be above rounding tolerance.
89 bool operator>(const vector2d<T>&other) const 89 bool operator>(const vector2d<T>&other) const
90 { 90 {
91 return (X>other.X && !core::equals(X, other.X)) || 91 return (X>other.X && !core::equals(X, other.X)) ||
92 (core::equals(X, other.X) && Y>other.Y && !core::equals(Y, other.Y)); 92 (core::equals(X, other.X) && Y>other.Y && !core::equals(Y, other.Y));
93 } 93 }
94 94
95 bool operator==(const vector2d<T>& other) const { return equals(other); } 95 bool operator==(const vector2d<T>& other) const { return equals(other); }
96 bool operator!=(const vector2d<T>& other) const { return !equals(other); } 96 bool operator!=(const vector2d<T>& other) const { return !equals(other); }
97 97
98 // functions 98 // functions
99 99
100 //! Checks if this vector equals the other one. 100 //! Checks if this vector equals the other one.
101 /** Takes floating point rounding errors into account. 101 /** Takes floating point rounding errors into account.
102 \param other Vector to compare with. 102 \param other Vector to compare with.
103 \return True if the two vector are (almost) equal, else false. */ 103 \return True if the two vector are (almost) equal, else false. */
104 bool equals(const vector2d<T>& other) const 104 bool equals(const vector2d<T>& other) const
105 { 105 {
106 return core::equals(X, other.X) && core::equals(Y, other.Y); 106 return core::equals(X, other.X) && core::equals(Y, other.Y);
107 } 107 }
108 108
109 vector2d<T>& set(T nx, T ny) {X=nx; Y=ny; return *this; } 109 vector2d<T>& set(T nx, T ny) {X=nx; Y=ny; return *this; }
110 vector2d<T>& set(const vector2d<T>& p) { X=p.X; Y=p.Y; return *this; } 110 vector2d<T>& set(const vector2d<T>& p) { X=p.X; Y=p.Y; return *this; }
111 111
112 //! Gets the length of the vector. 112 //! Gets the length of the vector.
113 /** \return The length of the vector. */ 113 /** \return The length of the vector. */
114 T getLength() const { return core::squareroot( X*X + Y*Y ); } 114 T getLength() const { return core::squareroot( X*X + Y*Y ); }
115 115
116 //! Get the squared length of this vector 116 //! Get the squared length of this vector
117 /** This is useful because it is much faster than getLength(). 117 /** This is useful because it is much faster than getLength().
118 \return The squared length of the vector. */ 118 \return The squared length of the vector. */
119 T getLengthSQ() const { return X*X + Y*Y; } 119 T getLengthSQ() const { return X*X + Y*Y; }
120 120
121 //! Get the dot product of this vector with another. 121 //! Get the dot product of this vector with another.
122 /** \param other Other vector to take dot product with. 122 /** \param other Other vector to take dot product with.
123 \return The dot product of the two vectors. */ 123 \return The dot product of the two vectors. */
124 T dotProduct(const vector2d<T>& other) const 124 T dotProduct(const vector2d<T>& other) const
125 { 125 {
126 return X*other.X + Y*other.Y; 126 return X*other.X + Y*other.Y;
127 } 127 }
128 128
129 //! Gets distance from another point. 129 //! Gets distance from another point.
130 /** Here, the vector is interpreted as a point in 2-dimensional space. 130 /** Here, the vector is interpreted as a point in 2-dimensional space.
131 \param other Other vector to measure from. 131 \param other Other vector to measure from.
132 \return Distance from other point. */ 132 \return Distance from other point. */
133 T getDistanceFrom(const vector2d<T>& other) const 133 T getDistanceFrom(const vector2d<T>& other) const
134 { 134 {
135 return vector2d<T>(X - other.X, Y - other.Y).getLength(); 135 return vector2d<T>(X - other.X, Y - other.Y).getLength();
136 } 136 }
137 137
138 //! Returns squared distance from another point. 138 //! Returns squared distance from another point.
139 /** Here, the vector is interpreted as a point in 2-dimensional space. 139 /** Here, the vector is interpreted as a point in 2-dimensional space.
140 \param other Other vector to measure from. 140 \param other Other vector to measure from.
141 \return Squared distance from other point. */ 141 \return Squared distance from other point. */
142 T getDistanceFromSQ(const vector2d<T>& other) const 142 T getDistanceFromSQ(const vector2d<T>& other) const
143 { 143 {
144 return vector2d<T>(X - other.X, Y - other.Y).getLengthSQ(); 144 return vector2d<T>(X - other.X, Y - other.Y).getLengthSQ();
145 } 145 }
146 146
147 //! rotates the point anticlockwise around a center by an amount of degrees. 147 //! rotates the point anticlockwise around a center by an amount of degrees.
148 /** \param degrees Amount of degrees to rotate by, anticlockwise. 148 /** \param degrees Amount of degrees to rotate by, anticlockwise.
149 \param center Rotation center. 149 \param center Rotation center.
150 \return This vector after transformation. */ 150 \return This vector after transformation. */
151 vector2d<T>& rotateBy(f64 degrees, const vector2d<T>& center=vector2d<T>()) 151 vector2d<T>& rotateBy(f64 degrees, const vector2d<T>& center=vector2d<T>())
152 { 152 {
153 degrees *= DEGTORAD64; 153 degrees *= DEGTORAD64;
154 const f64 cs = cos(degrees); 154 const f64 cs = cos(degrees);
155 const f64 sn = sin(degrees); 155 const f64 sn = sin(degrees);
156 156
157 X -= center.X; 157 X -= center.X;
158 Y -= center.Y; 158 Y -= center.Y;
159 159
160 set((T)(X*cs - Y*sn), (T)(X*sn + Y*cs)); 160 set((T)(X*cs - Y*sn), (T)(X*sn + Y*cs));
161 161
162 X += center.X; 162 X += center.X;
163 Y += center.Y; 163 Y += center.Y;
164 return *this; 164 return *this;
165 } 165 }
166 166
167 //! Normalize the vector. 167 //! Normalize the vector.
168 /** The null vector is left untouched. 168 /** The null vector is left untouched.
169 \return Reference to this vector, after normalization. */ 169 \return Reference to this vector, after normalization. */
170 vector2d<T>& normalize() 170 vector2d<T>& normalize()
171 { 171 {
172 f32 length = (f32)(X*X + Y*Y); 172 f32 length = (f32)(X*X + Y*Y);
173 if ( length == 0 ) 173 if ( length == 0 )
174 return *this; 174 return *this;
175 length = core::reciprocal_squareroot ( length ); 175 length = core::reciprocal_squareroot ( length );
176 X = (T)(X * length); 176 X = (T)(X * length);
177 Y = (T)(Y * length); 177 Y = (T)(Y * length);
178 return *this; 178 return *this;
179 } 179 }
180 180
181 //! Calculates the angle of this vector in degrees in the trigonometric sense. 181 //! Calculates the angle of this vector in degrees in the trigonometric sense.
182 /** 0 is to the right (3 o'clock), values increase counter-clockwise. 182 /** 0 is to the right (3 o'clock), values increase counter-clockwise.
183 This method has been suggested by Pr3t3nd3r. 183 This method has been suggested by Pr3t3nd3r.
184 \return Returns a value between 0 and 360. */ 184 \return Returns a value between 0 and 360. */
185 f64 getAngleTrig() const 185 f64 getAngleTrig() const
186 { 186 {
187 if (Y == 0) 187 if (Y == 0)
188 return X < 0 ? 180 : 0; 188 return X < 0 ? 180 : 0;
189 else 189 else
190 if (X == 0) 190 if (X == 0)
191 return Y < 0 ? 270 : 90; 191 return Y < 0 ? 270 : 90;
192 192
193 if ( Y > 0) 193 if ( Y > 0)
194 if (X > 0) 194 if (X > 0)
195 return atan((irr::f64)Y/(irr::f64)X) * RADTODEG64; 195 return atan((irr::f64)Y/(irr::f64)X) * RADTODEG64;
196 else 196 else
197 return 180.0-atan((irr::f64)Y/-(irr::f64)X) * RADTODEG64; 197 return 180.0-atan((irr::f64)Y/-(irr::f64)X) * RADTODEG64;
198 else 198 else
199 if (X > 0) 199 if (X > 0)
200 return 360.0-atan(-(irr::f64)Y/(irr::f64)X) * RADTODEG64; 200 return 360.0-atan(-(irr::f64)Y/(irr::f64)X) * RADTODEG64;
201 else 201 else
202 return 180.0+atan(-(irr::f64)Y/-(irr::f64)X) * RADTODEG64; 202 return 180.0+atan(-(irr::f64)Y/-(irr::f64)X) * RADTODEG64;
203 } 203 }
204 204
205 //! Calculates the angle of this vector in degrees in the counter trigonometric sense. 205 //! Calculates the angle of this vector in degrees in the counter trigonometric sense.
206 /** 0 is to the right (3 o'clock), values increase clockwise. 206 /** 0 is to the right (3 o'clock), values increase clockwise.
207 \return Returns a value between 0 and 360. */ 207 \return Returns a value between 0 and 360. */
208 inline f64 getAngle() const 208 inline f64 getAngle() const
209 { 209 {
210 if (Y == 0) // corrected thanks to a suggestion by Jox 210 if (Y == 0) // corrected thanks to a suggestion by Jox
211 return X < 0 ? 180 : 0; 211 return X < 0 ? 180 : 0;
212 else if (X == 0) 212 else if (X == 0)
213 return Y < 0 ? 90 : 270; 213 return Y < 0 ? 90 : 270;
214 214
215 // don't use getLength here to avoid precision loss with s32 vectors 215 // don't use getLength here to avoid precision loss with s32 vectors
216 // avoid floating-point trouble as sqrt(y*y) is occasionally larger than y, so clamp 216 // avoid floating-point trouble as sqrt(y*y) is occasionally larger than y, so clamp
217 const f64 tmp = core::clamp(Y / sqrt((f64)(X*X + Y*Y)), -1.0, 1.0); 217 const f64 tmp = core::clamp(Y / sqrt((f64)(X*X + Y*Y)), -1.0, 1.0);
218 const f64 angle = atan( core::squareroot(1 - tmp*tmp) / tmp) * RADTODEG64; 218 const f64 angle = atan( core::squareroot(1 - tmp*tmp) / tmp) * RADTODEG64;
219 219
220 if (X>0 && Y>0) 220 if (X>0 && Y>0)
221 return angle + 270; 221 return angle + 270;
222 else 222 else
223 if (X>0 && Y<0) 223 if (X>0 && Y<0)
224 return angle + 90; 224 return angle + 90;
225 else 225 else
226 if (X<0 && Y<0) 226 if (X<0 && Y<0)
227 return 90 - angle; 227 return 90 - angle;
228 else 228 else
229 if (X<0 && Y>0) 229 if (X<0 && Y>0)
230 return 270 - angle; 230 return 270 - angle;
231 231
232 return angle; 232 return angle;
233 } 233 }
234 234
235 //! Calculates the angle between this vector and another one in degree. 235 //! Calculates the angle between this vector and another one in degree.
236 /** \param b Other vector to test with. 236 /** \param b Other vector to test with.
237 \return Returns a value between 0 and 90. */ 237 \return Returns a value between 0 and 90. */
238 inline f64 getAngleWith(const vector2d<T>& b) const 238 inline f64 getAngleWith(const vector2d<T>& b) const
239 { 239 {
240 f64 tmp = (f64)(X*b.X + Y*b.Y); 240 f64 tmp = (f64)(X*b.X + Y*b.Y);
241 241
242 if (tmp == 0.0) 242 if (tmp == 0.0)
243 return 90.0; 243 return 90.0;
244 244
245 tmp = tmp / core::squareroot((f64)((X*X + Y*Y) * (b.X*b.X + b.Y*b.Y))); 245 tmp = tmp / core::squareroot((f64)((X*X + Y*Y) * (b.X*b.X + b.Y*b.Y)));
246 if (tmp < 0.0) 246 if (tmp < 0.0)
247 tmp = -tmp; 247 tmp = -tmp;
248 if ( tmp > 1.0 ) // avoid floating-point trouble 248 if ( tmp > 1.0 ) // avoid floating-point trouble
249 tmp = 1.0; 249 tmp = 1.0;
250 250
251 return atan(sqrt(1 - tmp*tmp) / tmp) * RADTODEG64; 251 return atan(sqrt(1 - tmp*tmp) / tmp) * RADTODEG64;
252 } 252 }
253 253
254 //! Returns if this vector interpreted as a point is on a line between two other points. 254 //! Returns if this vector interpreted as a point is on a line between two other points.
255 /** It is assumed that the point is on the line. 255 /** It is assumed that the point is on the line.
256 \param begin Beginning vector to compare between. 256 \param begin Beginning vector to compare between.
257 \param end Ending vector to compare between. 257 \param end Ending vector to compare between.
258 \return True if this vector is between begin and end, false if not. */ 258 \return True if this vector is between begin and end, false if not. */
259 bool isBetweenPoints(const vector2d<T>& begin, const vector2d<T>& end) const 259 bool isBetweenPoints(const vector2d<T>& begin, const vector2d<T>& end) const
260 { 260 {
261 if (begin.X != end.X) 261 if (begin.X != end.X)
262 { 262 {
263 return ((begin.X <= X && X <= end.X) || 263 return ((begin.X <= X && X <= end.X) ||
264 (begin.X >= X && X >= end.X)); 264 (begin.X >= X && X >= end.X));
265 } 265 }
266 else 266 else
267 { 267 {
268 return ((begin.Y <= Y && Y <= end.Y) || 268 return ((begin.Y <= Y && Y <= end.Y) ||
269 (begin.Y >= Y && Y >= end.Y)); 269 (begin.Y >= Y && Y >= end.Y));
270 } 270 }
271 } 271 }
272 272
273 //! Creates an interpolated vector between this vector and another vector. 273 //! Creates an interpolated vector between this vector and another vector.
274 /** \param other The other vector to interpolate with. 274 /** \param other The other vector to interpolate with.
275 \param d Interpolation value between 0.0f (all the other vector) and 1.0f (all this vector). 275 \param d Interpolation value between 0.0f (all the other vector) and 1.0f (all this vector).
276 Note that this is the opposite direction of interpolation to getInterpolated_quadratic() 276 Note that this is the opposite direction of interpolation to getInterpolated_quadratic()
277 \return An interpolated vector. This vector is not modified. */ 277 \return An interpolated vector. This vector is not modified. */
278 vector2d<T> getInterpolated(const vector2d<T>& other, f64 d) const 278 vector2d<T> getInterpolated(const vector2d<T>& other, f64 d) const
279 { 279 {
280 f64 inv = 1.0f - d; 280 f64 inv = 1.0f - d;
281 return vector2d<T>((T)(other.X*inv + X*d), (T)(other.Y*inv + Y*d)); 281 return vector2d<T>((T)(other.X*inv + X*d), (T)(other.Y*inv + Y*d));
282 } 282 }
283 283
284 //! Creates a quadratically interpolated vector between this and two other vectors. 284 //! Creates a quadratically interpolated vector between this and two other vectors.
285 /** \param v2 Second vector to interpolate with. 285 /** \param v2 Second vector to interpolate with.
286 \param v3 Third vector to interpolate with (maximum at 1.0f) 286 \param v3 Third vector to interpolate with (maximum at 1.0f)
287 \param d Interpolation value between 0.0f (all this vector) and 1.0f (all the 3rd vector). 287 \param d Interpolation value between 0.0f (all this vector) and 1.0f (all the 3rd vector).
288 Note that this is the opposite direction of interpolation to getInterpolated() and interpolate() 288 Note that this is the opposite direction of interpolation to getInterpolated() and interpolate()
289 \return An interpolated vector. This vector is not modified. */ 289 \return An interpolated vector. This vector is not modified. */
290 vector2d<T> getInterpolated_quadratic(const vector2d<T>& v2, const vector2d<T>& v3, f64 d) const 290 vector2d<T> getInterpolated_quadratic(const vector2d<T>& v2, const vector2d<T>& v3, f64 d) const
291 { 291 {
292 // this*(1-d)*(1-d) + 2 * v2 * (1-d) + v3 * d * d; 292 // this*(1-d)*(1-d) + 2 * v2 * (1-d) + v3 * d * d;
293 const f64 inv = 1.0f - d; 293 const f64 inv = 1.0f - d;
294 const f64 mul0 = inv * inv; 294 const f64 mul0 = inv * inv;
295 const f64 mul1 = 2.0f * d * inv; 295 const f64 mul1 = 2.0f * d * inv;
296 const f64 mul2 = d * d; 296 const f64 mul2 = d * d;
297 297
298 return vector2d<T> ( (T)(X * mul0 + v2.X * mul1 + v3.X * mul2), 298 return vector2d<T> ( (T)(X * mul0 + v2.X * mul1 + v3.X * mul2),
299 (T)(Y * mul0 + v2.Y * mul1 + v3.Y * mul2)); 299 (T)(Y * mul0 + v2.Y * mul1 + v3.Y * mul2));
300 } 300 }
301 301
302 //! Sets this vector to the linearly interpolated vector between a and b. 302 //! Sets this vector to the linearly interpolated vector between a and b.
303 /** \param a first vector to interpolate with, maximum at 1.0f 303 /** \param a first vector to interpolate with, maximum at 1.0f
304 \param b second vector to interpolate with, maximum at 0.0f 304 \param b second vector to interpolate with, maximum at 0.0f
305 \param d Interpolation value between 0.0f (all vector b) and 1.0f (all vector a) 305 \param d Interpolation value between 0.0f (all vector b) and 1.0f (all vector a)
306 Note that this is the opposite direction of interpolation to getInterpolated_quadratic() 306 Note that this is the opposite direction of interpolation to getInterpolated_quadratic()
307 */ 307 */
308 vector2d<T>& interpolate(const vector2d<T>& a, const vector2d<T>& b, f64 d) 308 vector2d<T>& interpolate(const vector2d<T>& a, const vector2d<T>& b, f64 d)
309 { 309 {
310 X = (T)((f64)b.X + ( ( a.X - b.X ) * d )); 310 X = (T)((f64)b.X + ( ( a.X - b.X ) * d ));
311 Y = (T)((f64)b.Y + ( ( a.Y - b.Y ) * d )); 311 Y = (T)((f64)b.Y + ( ( a.Y - b.Y ) * d ));
312 return *this; 312 return *this;
313 } 313 }
314 314
315 //! X coordinate of vector. 315 //! X coordinate of vector.
316 T X; 316 T X;
317 317
318 //! Y coordinate of vector. 318 //! Y coordinate of vector.
319 T Y; 319 T Y;
320}; 320};
321 321
322 //! Typedef for f32 2d vector. 322 //! Typedef for f32 2d vector.
323 typedef vector2d<f32> vector2df; 323 typedef vector2d<f32> vector2df;
324 324
325 //! Typedef for integer 2d vector. 325 //! Typedef for integer 2d vector.
326 typedef vector2d<s32> vector2di; 326 typedef vector2d<s32> vector2di;
327 327
328 template<class S, class T> 328 template<class S, class T>
329 vector2d<T> operator*(const S scalar, const vector2d<T>& vector) { return vector*scalar; } 329 vector2d<T> operator*(const S scalar, const vector2d<T>& vector) { return vector*scalar; }
330 330
331 // These methods are declared in dimension2d, but need definitions of vector2d 331 // These methods are declared in dimension2d, but need definitions of vector2d
332 template<class T> 332 template<class T>
333 dimension2d<T>::dimension2d(const vector2d<T>& other) : Width(other.X), Height(other.Y) { } 333 dimension2d<T>::dimension2d(const vector2d<T>& other) : Width(other.X), Height(other.Y) { }
334 334
335 template<class T> 335 template<class T>
336 bool dimension2d<T>::operator==(const vector2d<T>& other) const { return Width == other.X && Height == other.Y; } 336 bool dimension2d<T>::operator==(const vector2d<T>& other) const { return Width == other.X && Height == other.Y; }
337 337
338} // end namespace core 338} // end namespace core
339} // end namespace irr 339} // end namespace irr
340 340
341#endif 341#endif
342 342
diff --git a/libraries/irrlicht-1.8/include/vector3d.h b/libraries/irrlicht-1.8/include/vector3d.h
index fd6c50d..d582978 100644
--- a/libraries/irrlicht-1.8/include/vector3d.h
+++ b/libraries/irrlicht-1.8/include/vector3d.h
@@ -1,458 +1,458 @@
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#ifndef __IRR_POINT_3D_H_INCLUDED__ 5#ifndef __IRR_POINT_3D_H_INCLUDED__
6#define __IRR_POINT_3D_H_INCLUDED__ 6#define __IRR_POINT_3D_H_INCLUDED__
7 7
8#include "irrMath.h" 8#include "irrMath.h"
9 9
10namespace irr 10namespace irr
11{ 11{
12namespace core 12namespace core
13{ 13{
14 14
15 //! 3d vector template class with lots of operators and methods. 15 //! 3d vector template class with lots of operators and methods.
16 /** The vector3d class is used in Irrlicht for three main purposes: 16 /** The vector3d class is used in Irrlicht for three main purposes:
17 1) As a direction vector (most of the methods assume this). 17 1) As a direction vector (most of the methods assume this).
18 2) As a position in 3d space (which is synonymous with a direction vector from the origin to this position). 18 2) As a position in 3d space (which is synonymous with a direction vector from the origin to this position).
19 3) To hold three Euler rotations, where X is pitch, Y is yaw and Z is roll. 19 3) To hold three Euler rotations, where X is pitch, Y is yaw and Z is roll.
20 */ 20 */
21 template <class T> 21 template <class T>
22 class vector3d 22 class vector3d
23 { 23 {
24 public: 24 public:
25 //! Default constructor (null vector). 25 //! Default constructor (null vector).
26 vector3d() : X(0), Y(0), Z(0) {} 26 vector3d() : X(0), Y(0), Z(0) {}
27 //! Constructor with three different values 27 //! Constructor with three different values
28 vector3d(T nx, T ny, T nz) : X(nx), Y(ny), Z(nz) {} 28 vector3d(T nx, T ny, T nz) : X(nx), Y(ny), Z(nz) {}
29 //! Constructor with the same value for all elements 29 //! Constructor with the same value for all elements
30 explicit vector3d(T n) : X(n), Y(n), Z(n) {} 30 explicit vector3d(T n) : X(n), Y(n), Z(n) {}
31 //! Copy constructor 31 //! Copy constructor
32 vector3d(const vector3d<T>& other) : X(other.X), Y(other.Y), Z(other.Z) {} 32 vector3d(const vector3d<T>& other) : X(other.X), Y(other.Y), Z(other.Z) {}
33 33
34 // operators 34 // operators
35 35
36 vector3d<T> operator-() const { return vector3d<T>(-X, -Y, -Z); } 36 vector3d<T> operator-() const { return vector3d<T>(-X, -Y, -Z); }
37 37
38 vector3d<T>& operator=(const vector3d<T>& other) { X = other.X; Y = other.Y; Z = other.Z; return *this; } 38 vector3d<T>& operator=(const vector3d<T>& other) { X = other.X; Y = other.Y; Z = other.Z; return *this; }
39 39
40 vector3d<T> operator+(const vector3d<T>& other) const { return vector3d<T>(X + other.X, Y + other.Y, Z + other.Z); } 40 vector3d<T> operator+(const vector3d<T>& other) const { return vector3d<T>(X + other.X, Y + other.Y, Z + other.Z); }
41 vector3d<T>& operator+=(const vector3d<T>& other) { X+=other.X; Y+=other.Y; Z+=other.Z; return *this; } 41 vector3d<T>& operator+=(const vector3d<T>& other) { X+=other.X; Y+=other.Y; Z+=other.Z; return *this; }
42 vector3d<T> operator+(const T val) const { return vector3d<T>(X + val, Y + val, Z + val); } 42 vector3d<T> operator+(const T val) const { return vector3d<T>(X + val, Y + val, Z + val); }
43 vector3d<T>& operator+=(const T val) { X+=val; Y+=val; Z+=val; return *this; } 43 vector3d<T>& operator+=(const T val) { X+=val; Y+=val; Z+=val; return *this; }
44 44
45 vector3d<T> operator-(const vector3d<T>& other) const { return vector3d<T>(X - other.X, Y - other.Y, Z - other.Z); } 45 vector3d<T> operator-(const vector3d<T>& other) const { return vector3d<T>(X - other.X, Y - other.Y, Z - other.Z); }
46 vector3d<T>& operator-=(const vector3d<T>& other) { X-=other.X; Y-=other.Y; Z-=other.Z; return *this; } 46 vector3d<T>& operator-=(const vector3d<T>& other) { X-=other.X; Y-=other.Y; Z-=other.Z; return *this; }
47 vector3d<T> operator-(const T val) const { return vector3d<T>(X - val, Y - val, Z - val); } 47 vector3d<T> operator-(const T val) const { return vector3d<T>(X - val, Y - val, Z - val); }
48 vector3d<T>& operator-=(const T val) { X-=val; Y-=val; Z-=val; return *this; } 48 vector3d<T>& operator-=(const T val) { X-=val; Y-=val; Z-=val; return *this; }
49 49
50 vector3d<T> operator*(const vector3d<T>& other) const { return vector3d<T>(X * other.X, Y * other.Y, Z * other.Z); } 50 vector3d<T> operator*(const vector3d<T>& other) const { return vector3d<T>(X * other.X, Y * other.Y, Z * other.Z); }
51 vector3d<T>& operator*=(const vector3d<T>& other) { X*=other.X; Y*=other.Y; Z*=other.Z; return *this; } 51 vector3d<T>& operator*=(const vector3d<T>& other) { X*=other.X; Y*=other.Y; Z*=other.Z; return *this; }
52 vector3d<T> operator*(const T v) const { return vector3d<T>(X * v, Y * v, Z * v); } 52 vector3d<T> operator*(const T v) const { return vector3d<T>(X * v, Y * v, Z * v); }
53 vector3d<T>& operator*=(const T v) { X*=v; Y*=v; Z*=v; return *this; } 53 vector3d<T>& operator*=(const T v) { X*=v; Y*=v; Z*=v; return *this; }
54 54
55 vector3d<T> operator/(const vector3d<T>& other) const { return vector3d<T>(X / other.X, Y / other.Y, Z / other.Z); } 55 vector3d<T> operator/(const vector3d<T>& other) const { return vector3d<T>(X / other.X, Y / other.Y, Z / other.Z); }
56 vector3d<T>& operator/=(const vector3d<T>& other) { X/=other.X; Y/=other.Y; Z/=other.Z; return *this; } 56 vector3d<T>& operator/=(const vector3d<T>& other) { X/=other.X; Y/=other.Y; Z/=other.Z; return *this; }
57 vector3d<T> operator/(const T v) const { T i=(T)1.0/v; return vector3d<T>(X * i, Y * i, Z * i); } 57 vector3d<T> operator/(const T v) const { T i=(T)1.0/v; return vector3d<T>(X * i, Y * i, Z * i); }
58 vector3d<T>& operator/=(const T v) { T i=(T)1.0/v; X*=i; Y*=i; Z*=i; return *this; } 58 vector3d<T>& operator/=(const T v) { T i=(T)1.0/v; X*=i; Y*=i; Z*=i; return *this; }
59 59
60 //! sort in order X, Y, Z. Equality with rounding tolerance. 60 //! sort in order X, Y, Z. Equality with rounding tolerance.
61 bool operator<=(const vector3d<T>&other) const 61 bool operator<=(const vector3d<T>&other) const
62 { 62 {
63 return (X<other.X || core::equals(X, other.X)) || 63 return (X<other.X || core::equals(X, other.X)) ||
64 (core::equals(X, other.X) && (Y<other.Y || core::equals(Y, other.Y))) || 64 (core::equals(X, other.X) && (Y<other.Y || core::equals(Y, other.Y))) ||
65 (core::equals(X, other.X) && core::equals(Y, other.Y) && (Z<other.Z || core::equals(Z, other.Z))); 65 (core::equals(X, other.X) && core::equals(Y, other.Y) && (Z<other.Z || core::equals(Z, other.Z)));
66 } 66 }
67 67
68 //! sort in order X, Y, Z. Equality with rounding tolerance. 68 //! sort in order X, Y, Z. Equality with rounding tolerance.
69 bool operator>=(const vector3d<T>&other) const 69 bool operator>=(const vector3d<T>&other) const
70 { 70 {
71 return (X>other.X || core::equals(X, other.X)) || 71 return (X>other.X || core::equals(X, other.X)) ||
72 (core::equals(X, other.X) && (Y>other.Y || core::equals(Y, other.Y))) || 72 (core::equals(X, other.X) && (Y>other.Y || core::equals(Y, other.Y))) ||
73 (core::equals(X, other.X) && core::equals(Y, other.Y) && (Z>other.Z || core::equals(Z, other.Z))); 73 (core::equals(X, other.X) && core::equals(Y, other.Y) && (Z>other.Z || core::equals(Z, other.Z)));
74 } 74 }
75 75
76 //! sort in order X, Y, Z. Difference must be above rounding tolerance. 76 //! sort in order X, Y, Z. Difference must be above rounding tolerance.
77 bool operator<(const vector3d<T>&other) const 77 bool operator<(const vector3d<T>&other) const
78 { 78 {
79 return (X<other.X && !core::equals(X, other.X)) || 79 return (X<other.X && !core::equals(X, other.X)) ||
80 (core::equals(X, other.X) && Y<other.Y && !core::equals(Y, other.Y)) || 80 (core::equals(X, other.X) && Y<other.Y && !core::equals(Y, other.Y)) ||
81 (core::equals(X, other.X) && core::equals(Y, other.Y) && Z<other.Z && !core::equals(Z, other.Z)); 81 (core::equals(X, other.X) && core::equals(Y, other.Y) && Z<other.Z && !core::equals(Z, other.Z));
82 } 82 }
83 83
84 //! sort in order X, Y, Z. Difference must be above rounding tolerance. 84 //! sort in order X, Y, Z. Difference must be above rounding tolerance.
85 bool operator>(const vector3d<T>&other) const 85 bool operator>(const vector3d<T>&other) const
86 { 86 {
87 return (X>other.X && !core::equals(X, other.X)) || 87 return (X>other.X && !core::equals(X, other.X)) ||
88 (core::equals(X, other.X) && Y>other.Y && !core::equals(Y, other.Y)) || 88 (core::equals(X, other.X) && Y>other.Y && !core::equals(Y, other.Y)) ||
89 (core::equals(X, other.X) && core::equals(Y, other.Y) && Z>other.Z && !core::equals(Z, other.Z)); 89 (core::equals(X, other.X) && core::equals(Y, other.Y) && Z>other.Z && !core::equals(Z, other.Z));
90 } 90 }
91 91
92 //! use weak float compare 92 //! use weak float compare
93 bool operator==(const vector3d<T>& other) const 93 bool operator==(const vector3d<T>& other) const
94 { 94 {
95 return this->equals(other); 95 return this->equals(other);
96 } 96 }
97 97
98 bool operator!=(const vector3d<T>& other) const 98 bool operator!=(const vector3d<T>& other) const
99 { 99 {
100 return !this->equals(other); 100 return !this->equals(other);
101 } 101 }
102 102
103 // functions 103 // functions
104 104
105 //! returns if this vector equals the other one, taking floating point rounding errors into account 105 //! returns if this vector equals the other one, taking floating point rounding errors into account
106 bool equals(const vector3d<T>& other, const T tolerance = (T)ROUNDING_ERROR_f32 ) const 106 bool equals(const vector3d<T>& other, const T tolerance = (T)ROUNDING_ERROR_f32 ) const
107 { 107 {
108 return core::equals(X, other.X, tolerance) && 108 return core::equals(X, other.X, tolerance) &&
109 core::equals(Y, other.Y, tolerance) && 109 core::equals(Y, other.Y, tolerance) &&
110 core::equals(Z, other.Z, tolerance); 110 core::equals(Z, other.Z, tolerance);
111 } 111 }
112 112
113 vector3d<T>& set(const T nx, const T ny, const T nz) {X=nx; Y=ny; Z=nz; return *this;} 113 vector3d<T>& set(const T nx, const T ny, const T nz) {X=nx; Y=ny; Z=nz; return *this;}
114 vector3d<T>& set(const vector3d<T>& p) {X=p.X; Y=p.Y; Z=p.Z;return *this;} 114 vector3d<T>& set(const vector3d<T>& p) {X=p.X; Y=p.Y; Z=p.Z;return *this;}
115 115
116 //! Get length of the vector. 116 //! Get length of the vector.
117 T getLength() const { return core::squareroot( X*X + Y*Y + Z*Z ); } 117 T getLength() const { return core::squareroot( X*X + Y*Y + Z*Z ); }
118 118
119 //! Get squared length of the vector. 119 //! Get squared length of the vector.
120 /** This is useful because it is much faster than getLength(). 120 /** This is useful because it is much faster than getLength().
121 \return Squared length of the vector. */ 121 \return Squared length of the vector. */
122 T getLengthSQ() const { return X*X + Y*Y + Z*Z; } 122 T getLengthSQ() const { return X*X + Y*Y + Z*Z; }
123 123
124 //! Get the dot product with another vector. 124 //! Get the dot product with another vector.
125 T dotProduct(const vector3d<T>& other) const 125 T dotProduct(const vector3d<T>& other) const
126 { 126 {
127 return X*other.X + Y*other.Y + Z*other.Z; 127 return X*other.X + Y*other.Y + Z*other.Z;
128 } 128 }
129 129
130 //! Get distance from another point. 130 //! Get distance from another point.
131 /** Here, the vector is interpreted as point in 3 dimensional space. */ 131 /** Here, the vector is interpreted as point in 3 dimensional space. */
132 T getDistanceFrom(const vector3d<T>& other) const 132 T getDistanceFrom(const vector3d<T>& other) const
133 { 133 {
134 return vector3d<T>(X - other.X, Y - other.Y, Z - other.Z).getLength(); 134 return vector3d<T>(X - other.X, Y - other.Y, Z - other.Z).getLength();
135 } 135 }
136 136
137 //! Returns squared distance from another point. 137 //! Returns squared distance from another point.
138 /** Here, the vector is interpreted as point in 3 dimensional space. */ 138 /** Here, the vector is interpreted as point in 3 dimensional space. */
139 T getDistanceFromSQ(const vector3d<T>& other) const 139 T getDistanceFromSQ(const vector3d<T>& other) const
140 { 140 {
141 return vector3d<T>(X - other.X, Y - other.Y, Z - other.Z).getLengthSQ(); 141 return vector3d<T>(X - other.X, Y - other.Y, Z - other.Z).getLengthSQ();
142 } 142 }
143 143
144 //! Calculates the cross product with another vector. 144 //! Calculates the cross product with another vector.
145 /** \param p Vector to multiply with. 145 /** \param p Vector to multiply with.
146 \return Crossproduct of this vector with p. */ 146 \return Crossproduct of this vector with p. */
147 vector3d<T> crossProduct(const vector3d<T>& p) const 147 vector3d<T> crossProduct(const vector3d<T>& p) const
148 { 148 {
149 return vector3d<T>(Y * p.Z - Z * p.Y, Z * p.X - X * p.Z, X * p.Y - Y * p.X); 149 return vector3d<T>(Y * p.Z - Z * p.Y, Z * p.X - X * p.Z, X * p.Y - Y * p.X);
150 } 150 }
151 151
152 //! Returns if this vector interpreted as a point is on a line between two other points. 152 //! Returns if this vector interpreted as a point is on a line between two other points.
153 /** It is assumed that the point is on the line. 153 /** It is assumed that the point is on the line.
154 \param begin Beginning vector to compare between. 154 \param begin Beginning vector to compare between.
155 \param end Ending vector to compare between. 155 \param end Ending vector to compare between.
156 \return True if this vector is between begin and end, false if not. */ 156 \return True if this vector is between begin and end, false if not. */
157 bool isBetweenPoints(const vector3d<T>& begin, const vector3d<T>& end) const 157 bool isBetweenPoints(const vector3d<T>& begin, const vector3d<T>& end) const
158 { 158 {
159 const T f = (end - begin).getLengthSQ(); 159 const T f = (end - begin).getLengthSQ();
160 return getDistanceFromSQ(begin) <= f && 160 return getDistanceFromSQ(begin) <= f &&
161 getDistanceFromSQ(end) <= f; 161 getDistanceFromSQ(end) <= f;
162 } 162 }
163 163
164 //! Normalizes the vector. 164 //! Normalizes the vector.
165 /** In case of the 0 vector the result is still 0, otherwise 165 /** In case of the 0 vector the result is still 0, otherwise
166 the length of the vector will be 1. 166 the length of the vector will be 1.
167 \return Reference to this vector after normalization. */ 167 \return Reference to this vector after normalization. */
168 vector3d<T>& normalize() 168 vector3d<T>& normalize()
169 { 169 {
170 f64 length = X*X + Y*Y + Z*Z; 170 f64 length = X*X + Y*Y + Z*Z;
171 if (length == 0 ) // this check isn't an optimization but prevents getting NAN in the sqrt. 171 if (length == 0 ) // this check isn't an optimization but prevents getting NAN in the sqrt.
172 return *this; 172 return *this;
173 length = core::reciprocal_squareroot(length); 173 length = core::reciprocal_squareroot(length);
174 174
175 X = (T)(X * length); 175 X = (T)(X * length);
176 Y = (T)(Y * length); 176 Y = (T)(Y * length);
177 Z = (T)(Z * length); 177 Z = (T)(Z * length);
178 return *this; 178 return *this;
179 } 179 }
180 180
181 //! Sets the length of the vector to a new value 181 //! Sets the length of the vector to a new value
182 vector3d<T>& setLength(T newlength) 182 vector3d<T>& setLength(T newlength)
183 { 183 {
184 normalize(); 184 normalize();
185 return (*this *= newlength); 185 return (*this *= newlength);
186 } 186 }
187 187
188 //! Inverts the vector. 188 //! Inverts the vector.
189 vector3d<T>& invert() 189 vector3d<T>& invert()
190 { 190 {
191 X *= -1; 191 X *= -1;
192 Y *= -1; 192 Y *= -1;
193 Z *= -1; 193 Z *= -1;
194 return *this; 194 return *this;
195 } 195 }
196 196
197 //! Rotates the vector by a specified number of degrees around the Y axis and the specified center. 197 //! Rotates the vector by a specified number of degrees around the Y axis and the specified center.
198 /** \param degrees Number of degrees to rotate around the Y axis. 198 /** \param degrees Number of degrees to rotate around the Y axis.
199 \param center The center of the rotation. */ 199 \param center The center of the rotation. */
200 void rotateXZBy(f64 degrees, const vector3d<T>& center=vector3d<T>()) 200 void rotateXZBy(f64 degrees, const vector3d<T>& center=vector3d<T>())
201 { 201 {
202 degrees *= DEGTORAD64; 202 degrees *= DEGTORAD64;
203 f64 cs = cos(degrees); 203 f64 cs = cos(degrees);
204 f64 sn = sin(degrees); 204 f64 sn = sin(degrees);
205 X -= center.X; 205 X -= center.X;
206 Z -= center.Z; 206 Z -= center.Z;
207 set((T)(X*cs - Z*sn), Y, (T)(X*sn + Z*cs)); 207 set((T)(X*cs - Z*sn), Y, (T)(X*sn + Z*cs));
208 X += center.X; 208 X += center.X;
209 Z += center.Z; 209 Z += center.Z;
210 } 210 }
211 211
212 //! Rotates the vector by a specified number of degrees around the Z axis and the specified center. 212 //! Rotates the vector by a specified number of degrees around the Z axis and the specified center.
213 /** \param degrees: Number of degrees to rotate around the Z axis. 213 /** \param degrees: Number of degrees to rotate around the Z axis.
214 \param center: The center of the rotation. */ 214 \param center: The center of the rotation. */
215 void rotateXYBy(f64 degrees, const vector3d<T>& center=vector3d<T>()) 215 void rotateXYBy(f64 degrees, const vector3d<T>& center=vector3d<T>())
216 { 216 {
217 degrees *= DEGTORAD64; 217 degrees *= DEGTORAD64;
218 f64 cs = cos(degrees); 218 f64 cs = cos(degrees);
219 f64 sn = sin(degrees); 219 f64 sn = sin(degrees);
220 X -= center.X; 220 X -= center.X;
221 Y -= center.Y; 221 Y -= center.Y;
222 set((T)(X*cs - Y*sn), (T)(X*sn + Y*cs), Z); 222 set((T)(X*cs - Y*sn), (T)(X*sn + Y*cs), Z);
223 X += center.X; 223 X += center.X;
224 Y += center.Y; 224 Y += center.Y;
225 } 225 }
226 226
227 //! Rotates the vector by a specified number of degrees around the X axis and the specified center. 227 //! Rotates the vector by a specified number of degrees around the X axis and the specified center.
228 /** \param degrees: Number of degrees to rotate around the X axis. 228 /** \param degrees: Number of degrees to rotate around the X axis.
229 \param center: The center of the rotation. */ 229 \param center: The center of the rotation. */
230 void rotateYZBy(f64 degrees, const vector3d<T>& center=vector3d<T>()) 230 void rotateYZBy(f64 degrees, const vector3d<T>& center=vector3d<T>())
231 { 231 {
232 degrees *= DEGTORAD64; 232 degrees *= DEGTORAD64;
233 f64 cs = cos(degrees); 233 f64 cs = cos(degrees);
234 f64 sn = sin(degrees); 234 f64 sn = sin(degrees);
235 Z -= center.Z; 235 Z -= center.Z;
236 Y -= center.Y; 236 Y -= center.Y;
237 set(X, (T)(Y*cs - Z*sn), (T)(Y*sn + Z*cs)); 237 set(X, (T)(Y*cs - Z*sn), (T)(Y*sn + Z*cs));
238 Z += center.Z; 238 Z += center.Z;
239 Y += center.Y; 239 Y += center.Y;
240 } 240 }
241 241
242 //! Creates an interpolated vector between this vector and another vector. 242 //! Creates an interpolated vector between this vector and another vector.
243 /** \param other The other vector to interpolate with. 243 /** \param other The other vector to interpolate with.
244 \param d Interpolation value between 0.0f (all the other vector) and 1.0f (all this vector). 244 \param d Interpolation value between 0.0f (all the other vector) and 1.0f (all this vector).
245 Note that this is the opposite direction of interpolation to getInterpolated_quadratic() 245 Note that this is the opposite direction of interpolation to getInterpolated_quadratic()
246 \return An interpolated vector. This vector is not modified. */ 246 \return An interpolated vector. This vector is not modified. */
247 vector3d<T> getInterpolated(const vector3d<T>& other, f64 d) const 247 vector3d<T> getInterpolated(const vector3d<T>& other, f64 d) const
248 { 248 {
249 const f64 inv = 1.0 - d; 249 const f64 inv = 1.0 - d;
250 return vector3d<T>((T)(other.X*inv + X*d), (T)(other.Y*inv + Y*d), (T)(other.Z*inv + Z*d)); 250 return vector3d<T>((T)(other.X*inv + X*d), (T)(other.Y*inv + Y*d), (T)(other.Z*inv + Z*d));
251 } 251 }
252 252
253 //! Creates a quadratically interpolated vector between this and two other vectors. 253 //! Creates a quadratically interpolated vector between this and two other vectors.
254 /** \param v2 Second vector to interpolate with. 254 /** \param v2 Second vector to interpolate with.
255 \param v3 Third vector to interpolate with (maximum at 1.0f) 255 \param v3 Third vector to interpolate with (maximum at 1.0f)
256 \param d Interpolation value between 0.0f (all this vector) and 1.0f (all the 3rd vector). 256 \param d Interpolation value between 0.0f (all this vector) and 1.0f (all the 3rd vector).
257 Note that this is the opposite direction of interpolation to getInterpolated() and interpolate() 257 Note that this is the opposite direction of interpolation to getInterpolated() and interpolate()
258 \return An interpolated vector. This vector is not modified. */ 258 \return An interpolated vector. This vector is not modified. */
259 vector3d<T> getInterpolated_quadratic(const vector3d<T>& v2, const vector3d<T>& v3, f64 d) const 259 vector3d<T> getInterpolated_quadratic(const vector3d<T>& v2, const vector3d<T>& v3, f64 d) const
260 { 260 {
261 // this*(1-d)*(1-d) + 2 * v2 * (1-d) + v3 * d * d; 261 // this*(1-d)*(1-d) + 2 * v2 * (1-d) + v3 * d * d;
262 const f64 inv = (T) 1.0 - d; 262 const f64 inv = (T) 1.0 - d;
263 const f64 mul0 = inv * inv; 263 const f64 mul0 = inv * inv;
264 const f64 mul1 = (T) 2.0 * d * inv; 264 const f64 mul1 = (T) 2.0 * d * inv;
265 const f64 mul2 = d * d; 265 const f64 mul2 = d * d;
266 266
267 return vector3d<T> ((T)(X * mul0 + v2.X * mul1 + v3.X * mul2), 267 return vector3d<T> ((T)(X * mul0 + v2.X * mul1 + v3.X * mul2),
268 (T)(Y * mul0 + v2.Y * mul1 + v3.Y * mul2), 268 (T)(Y * mul0 + v2.Y * mul1 + v3.Y * mul2),
269 (T)(Z * mul0 + v2.Z * mul1 + v3.Z * mul2)); 269 (T)(Z * mul0 + v2.Z * mul1 + v3.Z * mul2));
270 } 270 }
271 271
272 //! Sets this vector to the linearly interpolated vector between a and b. 272 //! Sets this vector to the linearly interpolated vector between a and b.
273 /** \param a first vector to interpolate with, maximum at 1.0f 273 /** \param a first vector to interpolate with, maximum at 1.0f
274 \param b second vector to interpolate with, maximum at 0.0f 274 \param b second vector to interpolate with, maximum at 0.0f
275 \param d Interpolation value between 0.0f (all vector b) and 1.0f (all vector a) 275 \param d Interpolation value between 0.0f (all vector b) and 1.0f (all vector a)
276 Note that this is the opposite direction of interpolation to getInterpolated_quadratic() 276 Note that this is the opposite direction of interpolation to getInterpolated_quadratic()
277 */ 277 */
278 vector3d<T>& interpolate(const vector3d<T>& a, const vector3d<T>& b, f64 d) 278 vector3d<T>& interpolate(const vector3d<T>& a, const vector3d<T>& b, f64 d)
279 { 279 {
280 X = (T)((f64)b.X + ( ( a.X - b.X ) * d )); 280 X = (T)((f64)b.X + ( ( a.X - b.X ) * d ));
281 Y = (T)((f64)b.Y + ( ( a.Y - b.Y ) * d )); 281 Y = (T)((f64)b.Y + ( ( a.Y - b.Y ) * d ));
282 Z = (T)((f64)b.Z + ( ( a.Z - b.Z ) * d )); 282 Z = (T)((f64)b.Z + ( ( a.Z - b.Z ) * d ));
283 return *this; 283 return *this;
284 } 284 }
285 285
286 286
287 //! Get the rotations that would make a (0,0,1) direction vector point in the same direction as this direction vector. 287 //! Get the rotations that would make a (0,0,1) direction vector point in the same direction as this direction vector.
288 /** Thanks to Arras on the Irrlicht forums for this method. This utility method is very useful for 288 /** Thanks to Arras on the Irrlicht forums for this method. This utility method is very useful for
289 orienting scene nodes towards specific targets. For example, if this vector represents the difference 289 orienting scene nodes towards specific targets. For example, if this vector represents the difference
290 between two scene nodes, then applying the result of getHorizontalAngle() to one scene node will point 290 between two scene nodes, then applying the result of getHorizontalAngle() to one scene node will point
291 it at the other one. 291 it at the other one.
292 Example code: 292 Example code:
293 // Where target and seeker are of type ISceneNode* 293 // Where target and seeker are of type ISceneNode*
294 const vector3df toTarget(target->getAbsolutePosition() - seeker->getAbsolutePosition()); 294 const vector3df toTarget(target->getAbsolutePosition() - seeker->getAbsolutePosition());
295 const vector3df requiredRotation = toTarget.getHorizontalAngle(); 295 const vector3df requiredRotation = toTarget.getHorizontalAngle();
296 seeker->setRotation(requiredRotation); 296 seeker->setRotation(requiredRotation);
297 297
298 \return A rotation vector containing the X (pitch) and Y (raw) rotations (in degrees) that when applied to a 298 \return A rotation vector containing the X (pitch) and Y (raw) rotations (in degrees) that when applied to a
299 +Z (e.g. 0, 0, 1) direction vector would make it point in the same direction as this vector. The Z (roll) rotation 299 +Z (e.g. 0, 0, 1) direction vector would make it point in the same direction as this vector. The Z (roll) rotation
300 is always 0, since two Euler rotations are sufficient to point in any given direction. */ 300 is always 0, since two Euler rotations are sufficient to point in any given direction. */
301 vector3d<T> getHorizontalAngle() const 301 vector3d<T> getHorizontalAngle() const
302 { 302 {
303 vector3d<T> angle; 303 vector3d<T> angle;
304 304
305 const f64 tmp = (atan2((f64)X, (f64)Z) * RADTODEG64); 305 const f64 tmp = (atan2((f64)X, (f64)Z) * RADTODEG64);
306 angle.Y = (T)tmp; 306 angle.Y = (T)tmp;
307 307
308 if (angle.Y < 0) 308 if (angle.Y < 0)
309 angle.Y += 360; 309 angle.Y += 360;
310 if (angle.Y >= 360) 310 if (angle.Y >= 360)
311 angle.Y -= 360; 311 angle.Y -= 360;
312 312
313 const f64 z1 = core::squareroot(X*X + Z*Z); 313 const f64 z1 = core::squareroot(X*X + Z*Z);
314 314
315 angle.X = (T)(atan2((f64)z1, (f64)Y) * RADTODEG64 - 90.0); 315 angle.X = (T)(atan2((f64)z1, (f64)Y) * RADTODEG64 - 90.0);
316 316
317 if (angle.X < 0) 317 if (angle.X < 0)
318 angle.X += 360; 318 angle.X += 360;
319 if (angle.X >= 360) 319 if (angle.X >= 360)
320 angle.X -= 360; 320 angle.X -= 360;
321 321
322 return angle; 322 return angle;
323 } 323 }
324 324
325 //! Get the spherical coordinate angles 325 //! Get the spherical coordinate angles
326 /** This returns Euler degrees for the point represented by 326 /** This returns Euler degrees for the point represented by
327 this vector. The calculation assumes the pole at (0,1,0) and 327 this vector. The calculation assumes the pole at (0,1,0) and
328 returns the angles in X and Y. 328 returns the angles in X and Y.
329 */ 329 */
330 vector3d<T> getSphericalCoordinateAngles() const 330 vector3d<T> getSphericalCoordinateAngles() const
331 { 331 {
332 vector3d<T> angle; 332 vector3d<T> angle;
333 const f64 length = X*X + Y*Y + Z*Z; 333 const f64 length = X*X + Y*Y + Z*Z;
334 334
335 if (length) 335 if (length)
336 { 336 {
337 if (X!=0) 337 if (X!=0)
338 { 338 {
339 angle.Y = (T)(atan2((f64)Z,(f64)X) * RADTODEG64); 339 angle.Y = (T)(atan2((f64)Z,(f64)X) * RADTODEG64);
340 } 340 }
341 else if (Z<0) 341 else if (Z<0)
342 angle.Y=180; 342 angle.Y=180;
343 343
344 angle.X = (T)(acos(Y * core::reciprocal_squareroot(length)) * RADTODEG64); 344 angle.X = (T)(acos(Y * core::reciprocal_squareroot(length)) * RADTODEG64);
345 } 345 }
346 return angle; 346 return angle;
347 } 347 }
348 348
349 //! Builds a direction vector from (this) rotation vector. 349 //! Builds a direction vector from (this) rotation vector.
350 /** This vector is assumed to be a rotation vector composed of 3 Euler angle rotations, in degrees. 350 /** This vector is assumed to be a rotation vector composed of 3 Euler angle rotations, in degrees.
351 The implementation performs the same calculations as using a matrix to do the rotation. 351 The implementation performs the same calculations as using a matrix to do the rotation.
352 352
353 \param[in] forwards The direction representing "forwards" which will be rotated by this vector. 353 \param[in] forwards The direction representing "forwards" which will be rotated by this vector.
354 If you do not provide a direction, then the +Z axis (0, 0, 1) will be assumed to be forwards. 354 If you do not provide a direction, then the +Z axis (0, 0, 1) will be assumed to be forwards.
355 \return A direction vector calculated by rotating the forwards direction by the 3 Euler angles 355 \return A direction vector calculated by rotating the forwards direction by the 3 Euler angles
356 (in degrees) represented by this vector. */ 356 (in degrees) represented by this vector. */
357 vector3d<T> rotationToDirection(const vector3d<T> & forwards = vector3d<T>(0, 0, 1)) const 357 vector3d<T> rotationToDirection(const vector3d<T> & forwards = vector3d<T>(0, 0, 1)) const
358 { 358 {
359 const f64 cr = cos( core::DEGTORAD64 * X ); 359 const f64 cr = cos( core::DEGTORAD64 * X );
360 const f64 sr = sin( core::DEGTORAD64 * X ); 360 const f64 sr = sin( core::DEGTORAD64 * X );
361 const f64 cp = cos( core::DEGTORAD64 * Y ); 361 const f64 cp = cos( core::DEGTORAD64 * Y );
362 const f64 sp = sin( core::DEGTORAD64 * Y ); 362 const f64 sp = sin( core::DEGTORAD64 * Y );
363 const f64 cy = cos( core::DEGTORAD64 * Z ); 363 const f64 cy = cos( core::DEGTORAD64 * Z );
364 const f64 sy = sin( core::DEGTORAD64 * Z ); 364 const f64 sy = sin( core::DEGTORAD64 * Z );
365 365
366 const f64 srsp = sr*sp; 366 const f64 srsp = sr*sp;
367 const f64 crsp = cr*sp; 367 const f64 crsp = cr*sp;
368 368
369 const f64 pseudoMatrix[] = { 369 const f64 pseudoMatrix[] = {
370 ( cp*cy ), ( cp*sy ), ( -sp ), 370 ( cp*cy ), ( cp*sy ), ( -sp ),
371 ( srsp*cy-cr*sy ), ( srsp*sy+cr*cy ), ( sr*cp ), 371 ( srsp*cy-cr*sy ), ( srsp*sy+cr*cy ), ( sr*cp ),
372 ( crsp*cy+sr*sy ), ( crsp*sy-sr*cy ), ( cr*cp )}; 372 ( crsp*cy+sr*sy ), ( crsp*sy-sr*cy ), ( cr*cp )};
373 373
374 return vector3d<T>( 374 return vector3d<T>(
375 (T)(forwards.X * pseudoMatrix[0] + 375 (T)(forwards.X * pseudoMatrix[0] +
376 forwards.Y * pseudoMatrix[3] + 376 forwards.Y * pseudoMatrix[3] +
377 forwards.Z * pseudoMatrix[6]), 377 forwards.Z * pseudoMatrix[6]),
378 (T)(forwards.X * pseudoMatrix[1] + 378 (T)(forwards.X * pseudoMatrix[1] +
379 forwards.Y * pseudoMatrix[4] + 379 forwards.Y * pseudoMatrix[4] +
380 forwards.Z * pseudoMatrix[7]), 380 forwards.Z * pseudoMatrix[7]),
381 (T)(forwards.X * pseudoMatrix[2] + 381 (T)(forwards.X * pseudoMatrix[2] +
382 forwards.Y * pseudoMatrix[5] + 382 forwards.Y * pseudoMatrix[5] +
383 forwards.Z * pseudoMatrix[8])); 383 forwards.Z * pseudoMatrix[8]));
384 } 384 }
385 385
386 //! Fills an array of 4 values with the vector data (usually floats). 386 //! Fills an array of 4 values with the vector data (usually floats).
387 /** Useful for setting in shader constants for example. The fourth value 387 /** Useful for setting in shader constants for example. The fourth value
388 will always be 0. */ 388 will always be 0. */
389 void getAs4Values(T* array) const 389 void getAs4Values(T* array) const
390 { 390 {
391 array[0] = X; 391 array[0] = X;
392 array[1] = Y; 392 array[1] = Y;
393 array[2] = Z; 393 array[2] = Z;
394 array[3] = 0; 394 array[3] = 0;
395 } 395 }
396 396
397 //! Fills an array of 3 values with the vector data (usually floats). 397 //! Fills an array of 3 values with the vector data (usually floats).
398 /** Useful for setting in shader constants for example.*/ 398 /** Useful for setting in shader constants for example.*/
399 void getAs3Values(T* array) const 399 void getAs3Values(T* array) const
400 { 400 {
401 array[0] = X; 401 array[0] = X;
402 array[1] = Y; 402 array[1] = Y;
403 array[2] = Z; 403 array[2] = Z;
404 } 404 }
405 405
406 406
407 //! X coordinate of the vector 407 //! X coordinate of the vector
408 T X; 408 T X;
409 409
410 //! Y coordinate of the vector 410 //! Y coordinate of the vector
411 T Y; 411 T Y;
412 412
413 //! Z coordinate of the vector 413 //! Z coordinate of the vector
414 T Z; 414 T Z;
415 }; 415 };
416 416
417 //! partial specialization for integer vectors 417 //! partial specialization for integer vectors
418 // Implementor note: inline keyword needed due to template specialization for s32. Otherwise put specialization into a .cpp 418 // Implementor note: inline keyword needed due to template specialization for s32. Otherwise put specialization into a .cpp
419 template <> 419 template <>
420 inline vector3d<s32> vector3d<s32>::operator /(s32 val) const {return core::vector3d<s32>(X/val,Y/val,Z/val);} 420 inline vector3d<s32> vector3d<s32>::operator /(s32 val) const {return core::vector3d<s32>(X/val,Y/val,Z/val);}
421 template <> 421 template <>
422 inline vector3d<s32>& vector3d<s32>::operator /=(s32 val) {X/=val;Y/=val;Z/=val; return *this;} 422 inline vector3d<s32>& vector3d<s32>::operator /=(s32 val) {X/=val;Y/=val;Z/=val; return *this;}
423 423
424 template <> 424 template <>
425 inline vector3d<s32> vector3d<s32>::getSphericalCoordinateAngles() const 425 inline vector3d<s32> vector3d<s32>::getSphericalCoordinateAngles() const
426 { 426 {
427 vector3d<s32> angle; 427 vector3d<s32> angle;
428 const f64 length = X*X + Y*Y + Z*Z; 428 const f64 length = X*X + Y*Y + Z*Z;
429 429
430 if (length) 430 if (length)
431 { 431 {
432 if (X!=0) 432 if (X!=0)
433 { 433 {
434 angle.Y = round32((f32)(atan2((f64)Z,(f64)X) * RADTODEG64)); 434 angle.Y = round32((f32)(atan2((f64)Z,(f64)X) * RADTODEG64));
435 } 435 }
436 else if (Z<0) 436 else if (Z<0)
437 angle.Y=180; 437 angle.Y=180;
438 438
439 angle.X = round32((f32)(acos(Y * core::reciprocal_squareroot(length)) * RADTODEG64)); 439 angle.X = round32((f32)(acos(Y * core::reciprocal_squareroot(length)) * RADTODEG64));
440 } 440 }
441 return angle; 441 return angle;
442 } 442 }
443 443
444 //! Typedef for a f32 3d vector. 444 //! Typedef for a f32 3d vector.
445 typedef vector3d<f32> vector3df; 445 typedef vector3d<f32> vector3df;
446 446
447 //! Typedef for an integer 3d vector. 447 //! Typedef for an integer 3d vector.
448 typedef vector3d<s32> vector3di; 448 typedef vector3d<s32> vector3di;
449 449
450 //! Function multiplying a scalar and a vector component-wise. 450 //! Function multiplying a scalar and a vector component-wise.
451 template<class S, class T> 451 template<class S, class T>
452 vector3d<T> operator*(const S scalar, const vector3d<T>& vector) { return vector*scalar; } 452 vector3d<T> operator*(const S scalar, const vector3d<T>& vector) { return vector*scalar; }
453 453
454} // end namespace core 454} // end namespace core
455} // end namespace irr 455} // end namespace irr
456 456
457#endif 457#endif
458 458