removed getVertexPitch() method
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@923 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
7c965509aa
commit
7b734957d8
|
@ -105,11 +105,6 @@ namespace scene
|
|||
return T().getType();
|
||||
}
|
||||
|
||||
//! returns the byte size (stride, pitch) of the vertex
|
||||
virtual u32 getVertexPitch() const
|
||||
{
|
||||
return sizeof ( T );
|
||||
}
|
||||
|
||||
//! append the vertices and indices to the current buffer
|
||||
virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices)
|
||||
|
|
|
@ -14,44 +14,47 @@ namespace irr
|
|||
{
|
||||
namespace scene
|
||||
{
|
||||
//! Enumeration for all vertex types there are.
|
||||
enum E_PRIMITIVE_TYPE
|
||||
{
|
||||
//! All vertices are non-connected points.
|
||||
EPT_POINTS=0,
|
||||
|
||||
//! All vertices form a single connected line.
|
||||
EPT_LINE_STRIP,
|
||||
//! Enumeration for all primitive types there are.
|
||||
enum E_PRIMITIVE_TYPE
|
||||
{
|
||||
//! All vertices are non-connected points.
|
||||
EPT_POINTS=0,
|
||||
|
||||
//! Just as LINE_STRIP, but the last and the first vertex is also connected.
|
||||
EPT_LINE_LOOP,
|
||||
//! All vertices form a single connected line.
|
||||
EPT_LINE_STRIP,
|
||||
|
||||
//! Every two vertices are connected creating n/2 lines.
|
||||
EPT_LINES,
|
||||
//! Just as LINE_STRIP, but the last and the first vertex is also connected.
|
||||
EPT_LINE_LOOP,
|
||||
|
||||
//! After the first two vertices each vertex defines a new triangle.
|
||||
//! Always the two last and the new one form a new triangle.
|
||||
EPT_TRIANGLE_STRIP,
|
||||
//! Every two vertices are connected creating n/2 lines.
|
||||
EPT_LINES,
|
||||
|
||||
//! After the first two vertices each vertex defines a new triangle.
|
||||
//! All around the common first vertex.
|
||||
EPT_TRIANGLE_FAN,
|
||||
//! After the first two vertices each vertex defines a new triangle.
|
||||
//! Always the two last and the new one form a new triangle.
|
||||
EPT_TRIANGLE_STRIP,
|
||||
|
||||
//! Explicitly set all vertices for each triangle.
|
||||
EPT_TRIANGLES,
|
||||
//! After the first two vertices each vertex defines a new triangle.
|
||||
//! All around the common first vertex.
|
||||
EPT_TRIANGLE_FAN,
|
||||
|
||||
//! After the first two vertices each further tw vetices create a quad with the preceding two.
|
||||
EPT_QUAD_STRIP,
|
||||
//! Explicitly set all vertices for each triangle.
|
||||
EPT_TRIANGLES,
|
||||
|
||||
//! Every four vertices create a quad.
|
||||
EPT_QUADS,
|
||||
//! After the first two vertices each further tw vetices create a quad with the preceding two.
|
||||
EPT_QUAD_STRIP,
|
||||
|
||||
//! Every four vertices create a quad.
|
||||
EPT_QUADS,
|
||||
|
||||
//! Just as LINE_LOOP, but filled.
|
||||
EPT_POLYGON,
|
||||
|
||||
//! The single vertices are expanded to quad billboards on the GPU.
|
||||
EPT_POINT_SPRITES
|
||||
};
|
||||
|
||||
//! Just as LINE_LOOP, but filled.
|
||||
EPT_POLYGON,
|
||||
|
||||
//! The single vertices are expanded to quad billboards on the GPU.
|
||||
EPT_POINT_SPRITES
|
||||
};
|
||||
|
||||
//! Struct for holding a mesh with a single material
|
||||
/** SMeshBuffer is a simple implementation of a MeshBuffer. */
|
||||
|
@ -71,9 +74,6 @@ enum E_PRIMITIVE_TYPE
|
|||
//! returns which type of vertex data is stored.
|
||||
virtual video::E_VERTEX_TYPE getVertexType() const = 0;
|
||||
|
||||
//! returns the byte size (stride, pitch) of the vertex
|
||||
virtual u32 getVertexPitch() const = 0;
|
||||
|
||||
//! returns pointer to vertex data. The data is an array of vertices. Which vertex
|
||||
//! type is used can be determined with getVertexType().
|
||||
virtual const void* getVertices() const = 0;
|
||||
|
|
|
@ -189,6 +189,20 @@ struct S3DVertexTangents : S3DVertex
|
|||
|
||||
|
||||
|
||||
inline u32 getVertexPitchFromType(E_VERTEX_TYPE vertexType)
|
||||
{
|
||||
switch (vertexType)
|
||||
{
|
||||
case video::EVT_2TCOORDS:
|
||||
return sizeof(video::S3DVertex2TCoords);
|
||||
case video::EVT_TANGENTS:
|
||||
return sizeof(video::S3DVertexTangents);
|
||||
}
|
||||
|
||||
return sizeof(video::S3DVertex);
|
||||
}
|
||||
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
||||
|
|
|
@ -108,12 +108,6 @@ namespace scene
|
|||
return video::EVT_STANDARD;
|
||||
}
|
||||
|
||||
//! returns the byte size (stride, pitch) of the vertex
|
||||
virtual u32 getVertexPitch() const
|
||||
{
|
||||
return sizeof(video::S3DVertex);
|
||||
}
|
||||
|
||||
//! recalculates the bounding box. should be called if the mesh changed.
|
||||
virtual void recalculateBoundingBox()
|
||||
{
|
||||
|
|
|
@ -149,17 +149,6 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||
return VertexType;
|
||||
}
|
||||
|
||||
//! returns the byte size (stride, pitch) of the vertex
|
||||
virtual u32 getVertexPitch() const
|
||||
{
|
||||
switch (VertexType)
|
||||
{
|
||||
case video::EVT_2TCOORDS: return sizeof(video::S3DVertex2TCoords);
|
||||
case video::EVT_TANGENTS: return sizeof(video::S3DVertexTangents);
|
||||
default: return sizeof(video::S3DVertex);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void MoveTo_2TCoords()
|
||||
{
|
||||
if (VertexType==video::EVT_STANDARD)
|
||||
|
|
|
@ -443,7 +443,7 @@ void CAnimatedMeshSceneNode::render()
|
|||
for ( g=0; g<m->getMeshBufferCount(); ++g)
|
||||
{
|
||||
scene::IMeshBuffer* mb = m->getMeshBuffer(g);
|
||||
const u32 vSize = mb->getVertexPitch();
|
||||
const u32 vSize = video::getVertexPitchFromType(mb->getVertexType());
|
||||
const video::S3DVertex* v = ( const video::S3DVertex*)mb->getVertices();
|
||||
for ( i = 0; i != mb->getVertexCount(); ++i )
|
||||
{
|
||||
|
|
|
@ -291,7 +291,7 @@ void CMeshManipulator::transformMesh(scene::IMesh* mesh, const core::matrix4& m)
|
|||
IMeshBuffer* buffer = mesh->getMeshBuffer(b);
|
||||
|
||||
const u32 vtxcnt = buffer->getVertexCount();
|
||||
const u32 vtxPitch = buffer->getVertexPitch ();
|
||||
const u32 vtxPitch = video::getVertexPitchFromType(buffer->getVertexType());
|
||||
|
||||
video::S3DVertex* v = (video::S3DVertex*) buffer->getVertices();
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ void CMeshSceneNode::render()
|
|||
|
||||
u32 vSize;
|
||||
u32 i;
|
||||
vSize = mb->getVertexPitch ();
|
||||
vSize = video::getVertexPitchFromType(mb->getVertexType());
|
||||
|
||||
const video::S3DVertex* v = ( const video::S3DVertex*)mb->getVertices();
|
||||
video::SColor c ( 255, 128 ,0, 0 );
|
||||
|
|
Loading…
Reference in New Issue