Commit 0ce6ba20 authored by bitplane's avatar bitplane

Re-ordered some member variables so that padding on 64-bit pointers don't use...

Re-ordered some member variables so that padding on 64-bit pointers don't use unnecessary space, also defined bit fields for some bools and moved them to the end of memory. Some minor formatting changes, and got rid of the annoying upper case .H in the VC projects.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2269 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 2a5a21fc
...@@ -193,6 +193,7 @@ namespace irr ...@@ -193,6 +193,7 @@ namespace irr
//! The value of a spin box has changed //! The value of a spin box has changed
EGET_SPINBOX_CHANGED, EGET_SPINBOX_CHANGED,
//! A table has changed //! A table has changed
EGET_TABLE_CHANGED, EGET_TABLE_CHANGED,
EGET_TABLE_HEADER_CHANGED, EGET_TABLE_HEADER_CHANGED,
...@@ -272,13 +273,13 @@ struct SEvent ...@@ -272,13 +273,13 @@ struct SEvent
EKEY_CODE Key; EKEY_CODE Key;
//! If not true, then the key was left up //! If not true, then the key was left up
bool PressedDown; bool PressedDown:1;
//! True if shift was also pressed //! True if shift was also pressed
bool Shift; bool Shift:1;
//! True if ctrl was also pressed //! True if ctrl was also pressed
bool Control; bool Control:1;
}; };
//! A joystick event. //! A joystick event.
......
...@@ -156,10 +156,12 @@ namespace irr ...@@ -156,10 +156,12 @@ namespace irr
} }
private: private:
//! The reference counter. Mutable to do reference counting on const objects.
mutable s32 ReferenceCounter;
//! The debug name. //! The debug name.
const c8* DebugName; const c8* DebugName;
//! The reference counter. Mutable to do reference counting on const objects.
mutable s32 ReferenceCounter;
}; };
} // end namespace irr } // end namespace irr
......
...@@ -164,10 +164,12 @@ namespace scene ...@@ -164,10 +164,12 @@ namespace scene
Meshes[i]->setDirty(buffer); Meshes[i]->setDirty(buffer);
} }
//! The bounding box of this mesh
core::aabbox3d<f32> Box;
//! All meshes defining the animated mesh //! All meshes defining the animated mesh
core::array<IMesh*> Meshes; core::array<IMesh*> Meshes;
//! The bounding box of this mesh
core::aabbox3d<f32> Box;
//! Tyhe type fo the mesh. //! Tyhe type fo the mesh.
E_ANIMATED_MESH_TYPE Type; E_ANIMATED_MESH_TYPE Type;
}; };
......
...@@ -85,7 +85,7 @@ struct SLight ...@@ -85,7 +85,7 @@ struct SLight
E_LIGHT_TYPE Type; E_LIGHT_TYPE Type;
//! Read-ONLY! Does the light cast shadows? //! Read-ONLY! Does the light cast shadows?
bool CastShadows; bool CastShadows:1;
}; };
} // end namespace video } // end namespace video
......
...@@ -208,6 +208,9 @@ namespace video ...@@ -208,6 +208,9 @@ namespace video
return *this; return *this;
} }
//! Texture layer array.
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES];
//! Type of the material. Specifies how everything is blended together //! Type of the material. Specifies how everything is blended together
E_MATERIAL_TYPE MaterialType; E_MATERIAL_TYPE MaterialType;
...@@ -273,56 +276,53 @@ namespace video ...@@ -273,56 +276,53 @@ namespace video
//! Thickness of non-3dimensional elements such as lines and points. //! Thickness of non-3dimensional elements such as lines and points.
f32 Thickness; f32 Thickness;
//! Texture layer array. //! Is the ZBuffer enabled? Default: 1
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES]; /** Changed from bool to integer
(0 == ZBuffer Off, 1 == ZBuffer LessEqual, 2 == ZBuffer Equal)
*/
u8 ZBuffer;
//! Sets the antialiasing mode
u8 AntiAliasing;
//! Defines the enabled color planes
/** Values are defined as or'ed values of the E_COLOR_PLANE enum.
Only enabled color planes will be rendered to the current render
target. Typical use is to disable all colors when rendering only to
depth or stencil buffer, or using Red and Green for Stereo rendering. */
u8 ColorMask;
//! Draw as wireframe or filled triangles? Default: false //! Draw as wireframe or filled triangles? Default: false
/** The user can access a material flag using /** The user can access a material flag using
\code material.Wireframe=true \endcode \code material.Wireframe=true \endcode
or \code material.setFlag(EMF_WIREFRAME, true); \endcode */ or \code material.setFlag(EMF_WIREFRAME, true); \endcode */
bool Wireframe; bool Wireframe:1;
//! Draw as point cloud or filled triangles? Default: false //! Draw as point cloud or filled triangles? Default: false
bool PointCloud; bool PointCloud:1;
//! Flat or Gouraud shading? Default: true //! Flat or Gouraud shading? Default: true
bool GouraudShading; bool GouraudShading:1;
//! Will this material be lighted? Default: true //! Will this material be lighted? Default: true
bool Lighting; bool Lighting:1;
//! Is the zbuffer writeable or is it read-only. Default: true. //! Is the zbuffer writeable or is it read-only. Default: true.
/** This flag is ignored if the MaterialType is a transparent /** This flag is ignored if the MaterialType is a transparent
type. */ type. */
bool ZWriteEnable; bool ZWriteEnable:1;
//! Is backface culling enabled? Default: true //! Is backface culling enabled? Default: true
bool BackfaceCulling; bool BackfaceCulling:1;
//! Is frontface culling enabled? Default: false //! Is frontface culling enabled? Default: false
bool FrontfaceCulling; bool FrontfaceCulling:1;
//! Is fog enabled? Default: false //! Is fog enabled? Default: false
bool FogEnable; bool FogEnable:1;
//! Should normals be normalized? Default: false //! Should normals be normalized? Default: false
bool NormalizeNormals; bool NormalizeNormals:1;
//! Is the ZBuffer enabled? Default: 1
/** Changed from bool to integer
(0 == ZBuffer Off, 1 == ZBuffer LessEqual, 2 == ZBuffer Equal)
*/
u8 ZBuffer;
//! Sets the antialiasing mode
u8 AntiAliasing;
//! Defines the enabled color planes
/** Values are defined as or'ed values of the E_COLOR_PLANE enum.
Only enabled color planes will be rendered to the current render
target. Typical use is to disable all colors when rendering only to
depth or stencil buffer, or using Red and Green for Stereo rendering. */
u8 ColorMask;
//! Gets the texture transformation matrix for level i //! Gets the texture transformation matrix for level i
/** \param i The desired level. Must not be larger than MATERIAL_MAX_TEXTURES. /** \param i The desired level. Must not be larger than MATERIAL_MAX_TEXTURES.
......
...@@ -116,6 +116,7 @@ namespace scene ...@@ -116,6 +116,7 @@ namespace scene
//! The meshbuffers of this mesh //! The meshbuffers of this mesh
core::array<IMeshBuffer*> MeshBuffers; core::array<IMeshBuffer*> MeshBuffers;
//! The bounding box of this mesh //! The bounding box of this mesh
core::aabbox3d<f32> BoundingBox; core::aabbox3d<f32> BoundingBox;
}; };
......
...@@ -156,20 +156,24 @@ namespace scene ...@@ -156,20 +156,24 @@ namespace scene
/** This shouldn't be used for anything outside the VideoDriver. */ /** This shouldn't be used for anything outside the VideoDriver. */
virtual u32 getChangedID_Index() const {return ChangedID_Index;} virtual u32 getChangedID_Index() const {return ChangedID_Index;}
//! ID used for hardware buffer management
u32 ChangedID_Vertex;
//! ID used for hardware buffer management
u32 ChangedID_Index;
//! Material of this meshBuffer //! Material of this meshBuffer
video::SMaterial Material; video::SMaterial Material;
//! Shared Array of vertices //! Shared Array of vertices
core::array<video::S3DVertex> *Vertices; core::array<video::S3DVertex> *Vertices;
//! Array of Indices //! Array of Indices
core::array<u16> Indices; core::array<u16> Indices;
//! ID used for hardware buffer management
u32 ChangedID_Vertex;
//! ID used for hardware buffer management
u32 ChangedID_Index;
//! Bounding box //! Bounding box
core::aabbox3df BoundingBox; core::aabbox3df BoundingBox;
//! hardware mapping hint //! hardware mapping hint
E_HARDWARE_MAPPING MappingHint; E_HARDWARE_MAPPING MappingHint;
......
...@@ -369,24 +369,26 @@ struct SSkinMeshBuffer : public IMeshBuffer ...@@ -369,24 +369,26 @@ struct SSkinMeshBuffer : public IMeshBuffer
//! Call this after changing the positions of any vertex. //! Call this after changing the positions of any vertex.
void boundingBoxNeedsRecalculated(void) { BoundingBoxNeedsRecalculated = true; } void boundingBoxNeedsRecalculated(void) { BoundingBoxNeedsRecalculated = true; }
core::array<video::S3DVertexTangents> Vertices_Tangents;
core::array<video::S3DVertex2TCoords> Vertices_2TCoords;
core::array<video::S3DVertex> Vertices_Standard;
core::array<u16> Indices;
u32 ChangedID_Vertex; u32 ChangedID_Vertex;
u32 ChangedID_Index; u32 ChangedID_Index;
// hardware mapping hint
E_HARDWARE_MAPPING MappingHint_Vertex;
E_HARDWARE_MAPPING MappingHint_Index;
//ISkinnedMesh::SJoint *AttachedJoint; //ISkinnedMesh::SJoint *AttachedJoint;
core::matrix4 Transformation; core::matrix4 Transformation;
video::SMaterial Material; video::SMaterial Material;
video::E_VERTEX_TYPE VertexType; video::E_VERTEX_TYPE VertexType;
core::array<video::S3DVertexTangents> Vertices_Tangents;
core::array<video::S3DVertex2TCoords> Vertices_2TCoords; // hardware mapping hint
core::array<video::S3DVertex> Vertices_Standard; E_HARDWARE_MAPPING MappingHint_Vertex;
core::array<u16> Indices; E_HARDWARE_MAPPING MappingHint_Index;
core::aabbox3d<f32> BoundingBox; core::aabbox3d<f32> BoundingBox;
bool BoundingBoxNeedsRecalculated; bool BoundingBoxNeedsRecalculated:1;
}; };
......
...@@ -316,6 +316,7 @@ class aabbox3d ...@@ -316,6 +316,7 @@ class aabbox3d
//! The near edge //! The near edge
vector3d<T> MinEdge; vector3d<T> MinEdge;
//! The far edge //! The far edge
vector3d<T> MaxEdge; vector3d<T> MaxEdge;
}; };
......
...@@ -110,9 +110,9 @@ public: ...@@ -110,9 +110,9 @@ public:
//! defines an allocation strategy //! defines an allocation strategy
enum eAllocStrategy enum eAllocStrategy
{ {
ALLOC_STRATEGY_SAFE = 0, ALLOC_STRATEGY_SAFE = 0,
ALLOC_STRATEGY_DOUBLE = 1, ALLOC_STRATEGY_DOUBLE = 1,
ALLOC_STRATEGY_SQRT = 2, ALLOC_STRATEGY_SQRT = 2,
}; };
......
...@@ -546,12 +546,12 @@ public: ...@@ -546,12 +546,12 @@ public:
private: private:
T* data; T* data;
TAlloc allocator;
u32 allocated; u32 allocated;
u32 used; u32 used;
bool free_when_destroyed;
bool is_sorted;
eAllocStrategy strategy; eAllocStrategy strategy;
TAlloc allocator; bool free_when_destroyed:1;
bool is_sorted:1;
}; };
......
...@@ -964,9 +964,9 @@ private: ...@@ -964,9 +964,9 @@ private:
//--- member variables //--- member variables
T* array; T* array;
TAlloc allocator;
u32 allocated; u32 allocated;
u32 used; u32 used;
TAlloc allocator;
}; };
......
...@@ -2082,6 +2082,7 @@ namespace core ...@@ -2082,6 +2082,7 @@ namespace core
//! Typedef for f32 matrix //! Typedef for f32 matrix
typedef CMatrix4<f32> matrix4; typedef CMatrix4<f32> matrix4;
//! global const identity matrix //! global const identity matrix
IRRLICHT_API extern const matrix4 IdentityMatrix; IRRLICHT_API extern const matrix4 IdentityMatrix;
......
...@@ -221,6 +221,7 @@ class plane3d ...@@ -221,6 +221,7 @@ class plane3d
//! Normal vector of the plane. //! Normal vector of the plane.
vector3d<T> Normal; vector3d<T> Normal;
//! Distance from origin. //! Distance from origin.
T D; T D;
}; };
...@@ -228,6 +229,7 @@ class plane3d ...@@ -228,6 +229,7 @@ class plane3d
//! Typedef for a f32 3d plane. //! Typedef for a f32 3d plane.
typedef plane3d<f32> plane3df; typedef plane3d<f32> plane3df;
//! Typedef for an integer 3d plane. //! Typedef for an integer 3d plane.
typedef plane3d<s32> plane3di; typedef plane3d<s32> plane3di;
......
...@@ -288,12 +288,14 @@ public: ...@@ -288,12 +288,14 @@ public:
//! X coordinate of vector. //! X coordinate of vector.
T X; T X;
//! Y coordinate of vector. //! Y coordinate of vector.
T Y; T Y;
}; };
//! Typedef for f32 2d vector. //! Typedef for f32 2d vector.
typedef vector2d<f32> vector2df; typedef vector2d<f32> vector2df;
//! Typedef for integer 2d vector. //! Typedef for integer 2d vector.
typedef vector2d<s32> vector2di; typedef vector2d<s32> vector2di;
......
...@@ -341,8 +341,10 @@ namespace core ...@@ -341,8 +341,10 @@ namespace core
//! X coordinate of the vector //! X coordinate of the vector
T X; T X;
//! Y coordinate of the vector //! Y coordinate of the vector
T Y; T Y;
//! Z coordinate of the vector //! Z coordinate of the vector
T Z; T Z;
}; };
...@@ -350,6 +352,7 @@ namespace core ...@@ -350,6 +352,7 @@ namespace core
//! Typedef for a f32 3d vector. //! Typedef for a f32 3d vector.
typedef vector3d<f32> vector3df; typedef vector3d<f32> vector3df;
//! Typedef for an integer 3d vector. //! Typedef for an integer 3d vector.
typedef vector3d<s32> vector3di; typedef vector3d<s32> vector3di;
......
...@@ -570,7 +570,7 @@ ...@@ -570,7 +570,7 @@
RelativePath=".\..\..\include\IFileSystem.h"> RelativePath=".\..\..\include\IFileSystem.h">
</File> </File>
<File <File
RelativePath=".\..\..\include\IReadFile.H"> RelativePath=".\..\..\include\IReadFile.h">
</File> </File>
<File <File
RelativePath=".\..\..\include\irrXML.h"> RelativePath=".\..\..\include\irrXML.h">
......
...@@ -806,7 +806,7 @@ ...@@ -806,7 +806,7 @@
> >
</File> </File>
<File <File
RelativePath=".\..\..\include\IReadFile.H" RelativePath=".\..\..\include\IReadFile.h"
> >
</File> </File>
<File <File
......
...@@ -798,7 +798,7 @@ ...@@ -798,7 +798,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\include\IReadFile.H" RelativePath="..\..\include\IReadFile.h"
> >
</File> </File>
<File <File
......
...@@ -537,7 +537,7 @@ ...@@ -537,7 +537,7 @@
> >
</File> </File>
<File <File
RelativePath="..\..\include\IReadFile.H" RelativePath="..\..\include\IReadFile.h"
> >
</File> </File>
<File <File
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment