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
//! The value of a spin box has changed
EGET_SPINBOX_CHANGED,
//! A table has changed
EGET_TABLE_CHANGED,
EGET_TABLE_HEADER_CHANGED,
......@@ -272,13 +273,13 @@ struct SEvent
EKEY_CODE Key;
//! If not true, then the key was left up
bool PressedDown;
bool PressedDown:1;
//! True if shift was also pressed
bool Shift;
bool Shift:1;
//! True if ctrl was also pressed
bool Control;
bool Control:1;
};
//! A joystick event.
......
......@@ -156,10 +156,12 @@ namespace irr
}
private:
//! The reference counter. Mutable to do reference counting on const objects.
mutable s32 ReferenceCounter;
//! The debug name.
const c8* DebugName;
//! The reference counter. Mutable to do reference counting on const objects.
mutable s32 ReferenceCounter;
};
} // end namespace irr
......
......@@ -164,10 +164,12 @@ namespace scene
Meshes[i]->setDirty(buffer);
}
//! The bounding box of this mesh
core::aabbox3d<f32> Box;
//! All meshes defining the animated mesh
core::array<IMesh*> Meshes;
//! The bounding box of this mesh
core::aabbox3d<f32> Box;
//! Tyhe type fo the mesh.
E_ANIMATED_MESH_TYPE Type;
};
......
......@@ -85,7 +85,7 @@ struct SLight
E_LIGHT_TYPE Type;
//! Read-ONLY! Does the light cast shadows?
bool CastShadows;
bool CastShadows:1;
};
} // end namespace video
......
......@@ -208,6 +208,9 @@ namespace video
return *this;
}
//! Texture layer array.
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES];
//! Type of the material. Specifies how everything is blended together
E_MATERIAL_TYPE MaterialType;
......@@ -273,56 +276,53 @@ namespace video
//! Thickness of non-3dimensional elements such as lines and points.
f32 Thickness;
//! Texture layer array.
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES];
//! 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;
//! Draw as wireframe or filled triangles? Default: false
/** The user can access a material flag using
\code material.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
bool PointCloud;
bool PointCloud:1;
//! Flat or Gouraud shading? Default: true
bool GouraudShading;
bool GouraudShading:1;
//! Will this material be lighted? Default: true
bool Lighting;
bool Lighting:1;
//! Is the zbuffer writeable or is it read-only. Default: true.
/** This flag is ignored if the MaterialType is a transparent
type. */
bool ZWriteEnable;
bool ZWriteEnable:1;
//! Is backface culling enabled? Default: true
bool BackfaceCulling;
bool BackfaceCulling:1;
//! Is frontface culling enabled? Default: false
bool FrontfaceCulling;
bool FrontfaceCulling:1;
//! Is fog enabled? Default: false
bool FogEnable;
bool FogEnable:1;
//! Should normals be normalized? Default: false
bool NormalizeNormals;
//! 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;
bool NormalizeNormals:1;
//! Gets the texture transformation matrix for level i
/** \param i The desired level. Must not be larger than MATERIAL_MAX_TEXTURES.
......
......@@ -116,6 +116,7 @@ namespace scene
//! The meshbuffers of this mesh
core::array<IMeshBuffer*> MeshBuffers;
//! The bounding box of this mesh
core::aabbox3d<f32> BoundingBox;
};
......
......@@ -156,20 +156,24 @@ namespace scene
/** This shouldn't be used for anything outside the VideoDriver. */
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
video::SMaterial Material;
//! Shared Array of vertices
core::array<video::S3DVertex> *Vertices;
//! Array of 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
core::aabbox3df BoundingBox;
//! hardware mapping hint
E_HARDWARE_MAPPING MappingHint;
......
......@@ -369,24 +369,26 @@ struct SSkinMeshBuffer : public IMeshBuffer
//! Call this after changing the positions of any vertex.
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_Index;
// hardware mapping hint
E_HARDWARE_MAPPING MappingHint_Vertex;
E_HARDWARE_MAPPING MappingHint_Index;
//ISkinnedMesh::SJoint *AttachedJoint;
core::matrix4 Transformation;
video::SMaterial Material;
video::E_VERTEX_TYPE VertexType;
core::array<video::S3DVertexTangents> Vertices_Tangents;
core::array<video::S3DVertex2TCoords> Vertices_2TCoords;
core::array<video::S3DVertex> Vertices_Standard;
core::array<u16> Indices;
// hardware mapping hint
E_HARDWARE_MAPPING MappingHint_Vertex;
E_HARDWARE_MAPPING MappingHint_Index;
core::aabbox3d<f32> BoundingBox;
bool BoundingBoxNeedsRecalculated;
bool BoundingBoxNeedsRecalculated:1;
};
......
......@@ -316,6 +316,7 @@ class aabbox3d
//! The near edge
vector3d<T> MinEdge;
//! The far edge
vector3d<T> MaxEdge;
};
......
......@@ -546,12 +546,12 @@ public:
private:
T* data;
TAlloc allocator;
u32 allocated;
u32 used;
bool free_when_destroyed;
bool is_sorted;
eAllocStrategy strategy;
TAlloc allocator;
bool free_when_destroyed:1;
bool is_sorted:1;
};
......
......@@ -964,9 +964,9 @@ private:
//--- member variables
T* array;
TAlloc allocator;
u32 allocated;
u32 used;
TAlloc allocator;
};
......
......@@ -2082,6 +2082,7 @@ namespace core
//! Typedef for f32 matrix
typedef CMatrix4<f32> matrix4;
//! global const identity matrix
IRRLICHT_API extern const matrix4 IdentityMatrix;
......
......@@ -221,6 +221,7 @@ class plane3d
//! Normal vector of the plane.
vector3d<T> Normal;
//! Distance from origin.
T D;
};
......@@ -228,6 +229,7 @@ class plane3d
//! Typedef for a f32 3d plane.
typedef plane3d<f32> plane3df;
//! Typedef for an integer 3d plane.
typedef plane3d<s32> plane3di;
......
......@@ -288,12 +288,14 @@ public:
//! X coordinate of vector.
T X;
//! Y coordinate of vector.
T Y;
};
//! Typedef for f32 2d vector.
typedef vector2d<f32> vector2df;
//! Typedef for integer 2d vector.
typedef vector2d<s32> vector2di;
......
......@@ -341,8 +341,10 @@ namespace core
//! X coordinate of the vector
T X;
//! Y coordinate of the vector
T Y;
//! Z coordinate of the vector
T Z;
};
......@@ -350,6 +352,7 @@ namespace core
//! Typedef for a f32 3d vector.
typedef vector3d<f32> vector3df;
//! Typedef for an integer 3d vector.
typedef vector3d<s32> vector3di;
......
......@@ -570,7 +570,7 @@
RelativePath=".\..\..\include\IFileSystem.h">
</File>
<File
RelativePath=".\..\..\include\IReadFile.H">
RelativePath=".\..\..\include\IReadFile.h">
</File>
<File
RelativePath=".\..\..\include\irrXML.h">
......
......@@ -806,7 +806,7 @@
>
</File>
<File
RelativePath=".\..\..\include\IReadFile.H"
RelativePath=".\..\..\include\IReadFile.h"
>
</File>
<File
......
......@@ -798,7 +798,7 @@
>
</File>
<File
RelativePath="..\..\include\IReadFile.H"
RelativePath="..\..\include\IReadFile.h"
>
</File>
<File
......
......@@ -537,7 +537,7 @@
>
</File>
<File
RelativePath="..\..\include\IReadFile.H"
RelativePath="..\..\include\IReadFile.h"
>
</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