OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Ogre::Mesh::ChunkGeometryVertexDeclElement Class Reference

#include <StdMeshLoaderBinaryChunks.h>

Inheritance diagram for Ogre::Mesh::ChunkGeometryVertexDeclElement:
[legend]
Collaboration diagram for Ogre::Mesh::ChunkGeometryVertexDeclElement:
[legend]

Public Types

enum  Type {
  VDET_Float1 = 0, VDET_Float2 = 1, VDET_Float3 = 2, VDET_Float4 = 3,
  VDET_Short1 = 5, VDET_Short2 = 6, VDET_Short3 = 7, VDET_Short4 = 8,
  VDET_UByte4 = 9, VDET_Color_ARGB = 10, VDET_Color_ABGR = 11, VDET_MIN = VDET_Float1,
  VDET_MAX = VDET_Color_ABGR
}
 
enum  Semantic {
  VDES_Position = 1, VDES_Blend_Weights = 2, VDES_Blend_Indices = 3, VDES_Normals = 4,
  VDES_Diffuse = 5, VDES_Specular = 6, VDES_Texcoords = 7, VDES_Binormal = 8,
  VDES_Tangent = 9, VDES_MIN = VDES_Position, VDES_MAX = VDES_Tangent
}
 

Public Member Functions

Type GetType () const
 
size_t GetSize () const
 

Static Public Member Functions

static std::unique_ptr< ChunkRead (DataStream *stream)
 
static Type Peek (const DataStream *stream)
 

Public Attributes

uint16_t source
 
uint16_t offset
 
enum
Ogre::Mesh::ChunkGeometryVertexDeclElement::Type 
type
 
enum
Ogre::Mesh::ChunkGeometryVertexDeclElement::Semantic 
semantic
 
uint16_t index
 

Static Public Attributes

static const size_t ChunkHeaderLength
 

Protected Member Functions

virtual void ReadImpl (DataStream *stream)
 

Protected Attributes

size_t size
 

Detailed Description

Definition at line 472 of file StdMeshLoaderBinaryChunks.h.

Member Enumeration Documentation

Enumerator
VDES_Position 
VDES_Blend_Weights 
VDES_Blend_Indices 
VDES_Normals 
VDES_Diffuse 
VDES_Specular 
VDES_Texcoords 
VDES_Binormal 
VDES_Tangent 
VDES_MIN 
VDES_MAX 

Definition at line 494 of file StdMeshLoaderBinaryChunks.h.

495  {
496  VDES_Position = 1,
497  VDES_Blend_Weights = 2,
498  VDES_Blend_Indices = 3,
499  VDES_Normals = 4,
500  VDES_Diffuse = 5,
501  VDES_Specular = 6,
502  VDES_Texcoords = 7,
503  VDES_Binormal = 8,
504  VDES_Tangent = 9,
507  } semantic;
enum Ogre::Mesh::ChunkGeometryVertexDeclElement::Semantic semantic
Enumerator
VDET_Float1 
VDET_Float2 
VDET_Float3 
VDET_Float4 
VDET_Short1 
VDET_Short2 
VDET_Short3 
VDET_Short4 
VDET_UByte4 
VDET_Color_ARGB 
VDET_Color_ABGR 
VDET_MIN 
VDET_MAX 

Definition at line 477 of file StdMeshLoaderBinaryChunks.h.

478  {
479  VDET_Float1 = 0,
480  VDET_Float2 = 1,
481  VDET_Float3 = 2,
482  VDET_Float4 = 3,
483  /* 4 omitted intentionally */
484  VDET_Short1 = 5,
485  VDET_Short2 = 6,
486  VDET_Short3 = 7,
487  VDET_Short4 = 8,
488  VDET_UByte4 = 9,
489  VDET_Color_ARGB = 10,
490  VDET_Color_ABGR = 11,
493  } type;
enum Ogre::Mesh::ChunkGeometryVertexDeclElement::Type type

Member Function Documentation

size_t Ogre::ChunkBase< ChunkID >::GetSize ( ) const
inlineinherited

Definition at line 292 of file StdMeshLoaderBinaryChunks.h.

References Ogre::ChunkBase< _Type >::size.

Referenced by Ogre::Mesh::ChunkUnknown::ReadImpl(), Ogre::Mesh::ChunkMeshBoneAssignments::ReadImpl(), Ogre::Mesh::ChunkGeometryVertexData::ReadImpl(), Ogre::Skeleton::ChunkUnknown::ReadImpl(), Ogre::Skeleton::ChunkBone::ReadImpl(), and Ogre::Skeleton::ChunkAnimationTrackKF::ReadImpl().

Here is the caller graph for this function:

Type Ogre::ChunkBase< ChunkID >::GetType ( ) const
inlineinherited
static Type Ogre::ChunkBase< ChunkID >::Peek ( const DataStream stream)
inlinestaticinherited

Definition at line 295 of file StdMeshLoaderBinaryChunks.h.

References Ogre::DataStream::Peek().

Referenced by StdMeshSkeletonLoader::LoadSkeletonBinary(), Ogre::Mesh::ChunkMesh::ReadImpl(), Ogre::Mesh::ChunkSubmesh::ReadImpl(), Ogre::Mesh::ChunkGeometry::ReadImpl(), Ogre::Mesh::ChunkGeometryVertexDecl::ReadImpl(), Ogre::Mesh::ChunkGeometryVertexBuffer::ReadImpl(), Ogre::Skeleton::ChunkAnimation::ReadImpl(), and Ogre::Skeleton::ChunkAnimationTrack::ReadImpl().

296  {
297  return static_cast<Type>(stream->Peek<uint16_t>());
298  }

Here is the call graph for this function:

Here is the caller graph for this function:

std::unique_ptr< Chunk > Ogre::Mesh::Chunk::Read ( DataStream stream)
staticinherited

Definition at line 46 of file StdMeshLoaderBinaryChunks.cpp.

References Ogre::ChunkBase< ChunkID >::ChunkHeaderLength, Ogre::Mesh::CID_Edge_List, Ogre::Mesh::CID_Geometry, Ogre::Mesh::CID_Geometry_Vertex_Buffer, Ogre::Mesh::CID_Geometry_Vertex_Data, Ogre::Mesh::CID_Geometry_Vertex_Decl, Ogre::Mesh::CID_Geometry_Vertex_Decl_Element, Ogre::Mesh::CID_Header, Ogre::Mesh::CID_Invalid, Ogre::Mesh::CID_Mesh, Ogre::Mesh::CID_Mesh_Bone_Assignment, Ogre::Mesh::CID_Mesh_Bounds, Ogre::Mesh::CID_Mesh_Skeleton_Link, Ogre::Mesh::CID_Submesh, Ogre::Mesh::CID_Submesh_Bone_Assignment, Ogre::Mesh::CID_Submesh_Name_Table, Ogre::Mesh::CID_Submesh_Op, Ogre::DataStream::GetRemainingBytes(), LogF(), Ogre::DataStream::Read(), and Ogre::ChunkBase< ChunkID >::size.

Referenced by StdMeshLoader::LoadMeshBinary(), Ogre::Mesh::ChunkMesh::ReadImpl(), Ogre::Mesh::ChunkSubmesh::ReadImpl(), Ogre::Mesh::ChunkGeometry::ReadImpl(), Ogre::Mesh::ChunkGeometryVertexDecl::ReadImpl(), and Ogre::Mesh::ChunkGeometryVertexBuffer::ReadImpl().

47  {
48  assert(stream->GetRemainingBytes() >= ChunkHeaderLength);
49 
50  // Read metadata
51  ChunkID id = CID_Invalid;
52  id = static_cast<ChunkID>(stream->Read<uint16_t>());
53  size_t size = 0;
54  // Special case: CID_Header doesn't have any size info.
55  if (id != CID_Header)
56  {
57  // All others are proper chunks.
58  size = stream->Read<uint32_t>();
59  size -= ChunkHeaderLength;
60  }
61 
62  // Create chunk
63  std::unique_ptr<Chunk> chunk;
64  switch (id)
65  {
66  case CID_Header: chunk.reset(new ChunkFileHeader()); break;
67  case CID_Mesh: chunk.reset(new ChunkMesh()); break;
70  chunk.reset(new ChunkMeshBoneAssignments()); break;
71  case CID_Mesh_Skeleton_Link: chunk.reset(new ChunkMeshSkeletonLink()); break;
72  case CID_Mesh_Bounds: chunk.reset(new ChunkMeshBounds()); break;
73  case CID_Submesh: chunk.reset(new ChunkSubmesh()); break;
74  case CID_Submesh_Op: chunk.reset(new ChunkSubmeshOp()); break;
75  case CID_Geometry: chunk.reset(new ChunkGeometry()); break;
76  case CID_Geometry_Vertex_Buffer: chunk.reset(new ChunkGeometryVertexBuffer()); break;
77  case CID_Geometry_Vertex_Data: chunk.reset(new ChunkGeometryVertexData()); break;
78  case CID_Geometry_Vertex_Decl: chunk.reset(new ChunkGeometryVertexDecl()); break;
79  case CID_Geometry_Vertex_Decl_Element: chunk.reset(new ChunkGeometryVertexDeclElement()); break;
80  default:
81  LogF("StdMeshLoader: I don't know what to do with a chunk of type 0x%xu", id);
82  // Fall through
84  // We don't care about these
85  chunk.reset(new ChunkUnknown()); break;
86  };
87  chunk->type = id;
88  chunk->size = size;
89  chunk->ReadImpl(stream);
90  return chunk;
91  }
bool LogF(const char *strMessage,...)
Definition: C4Log.cpp:253

Here is the call graph for this function:

Here is the caller graph for this function:

void Ogre::Mesh::ChunkGeometryVertexDeclElement::ReadImpl ( DataStream stream)
protectedvirtual

Implements Ogre::ChunkBase< ChunkID >.

Definition at line 278 of file StdMeshLoaderBinaryChunks.cpp.

References index, offset, Ogre::DataStream::Read(), semantic, source, type, VDES_MAX, and VDET_MAX.

279  {
280  source = stream->Read<uint16_t>();
281  int32_t t = stream->Read<uint16_t>();
282  if (t < VDET_MIN || t > VDET_MAX)
283  throw InvalidVertexType();
284  type = static_cast<Type>(t);
285  t = stream->Read<uint16_t>();
286  if (t < VDES_MIN || t > VDES_MAX)
287  throw InvalidVertexSemantic();
288  semantic = static_cast<Semantic>(t);
289  offset = stream->Read<uint16_t>();
290  index = stream->Read<uint16_t>();
291  }
enum Ogre::Mesh::ChunkGeometryVertexDeclElement::Type type
enum Ogre::Mesh::ChunkGeometryVertexDeclElement::Semantic semantic

Here is the call graph for this function:

Member Data Documentation

const size_t Ogre::ChunkBase< ChunkID >::ChunkHeaderLength
staticinherited
uint16_t Ogre::Mesh::ChunkGeometryVertexDeclElement::index

Definition at line 508 of file StdMeshLoaderBinaryChunks.h.

Referenced by ReadImpl().

uint16_t Ogre::Mesh::ChunkGeometryVertexDeclElement::offset

Definition at line 476 of file StdMeshLoaderBinaryChunks.h.

Referenced by ReadImpl().

enum Ogre::Mesh::ChunkGeometryVertexDeclElement::Semantic Ogre::Mesh::ChunkGeometryVertexDeclElement::semantic

Referenced by ReadImpl().

size_t Ogre::ChunkBase< ChunkID >::size
protectedinherited
uint16_t Ogre::Mesh::ChunkGeometryVertexDeclElement::source

Definition at line 475 of file StdMeshLoaderBinaryChunks.h.

Referenced by ReadImpl().

enum Ogre::Mesh::ChunkGeometryVertexDeclElement::Type Ogre::Mesh::ChunkGeometryVertexDeclElement::type

Referenced by ReadImpl().


The documentation for this class was generated from the following files: