Show skinvertexbuffer.h syntax highlighted
/***************************************************************************
skinvertexbuffer.h - Skin vertex buffer chunk
-------------------
begin : Wed Feb 26 2003
copyright : (C) 2003 by Reality Rift Studios
email : mattias@realityrift.com
***************************************************************************
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is the NeoEngine, NeoChunkIO, skinvertexbuffer.h
The Initial Developer of the Original Code is Mattias Jansson.
Portions created by Mattias Jansson are Copyright (C) 2003
Reality Rift Studios. All Rights Reserved.
***************************************************************************/
#ifndef _NECHUNKIO_SKINVERTEXBUFFER_H_
#define _NECHUNKIO_SKINVERTEXBUFFER_H_
/**
* \file skinvertexbuffer.h
* Skin vertex buffer chunk
*/
#include "base.h"
#include "complex.h"
// External classes
namespace NeoEngine
{
class SkinVertex;
};
namespace NeoChunkIO
{
/**
* \class SkinVertexBufferChunk
* \brief Vertex buffer chunk
* \author Mattias Jansson (mattias@realityrift.com)
**/
class NEOCHUNKIO_API SkinVertexBufferChunk : public ComplexChunk
{
public:
/*! Skin vertices */
NeoEngine::SkinVertex *m_pkBuffer;
/*! Number of skin vertices */
unsigned int m_uiNumVertices;
/**
* Initialize chunk
* \param usType Chunk type
* \param rstrType Chunk type as string
* \param rstrID Chunk ID string
*/
SkinVertexBufferChunk( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID = "" ) : ComplexChunk( usType, rstrType, rstrID ), m_pkBuffer( 0 ), m_uiNumVertices( 0 ) {}
/**
* Setup chunk with default values
* \param pkBuffer Skin vertex buffer
* \param uiNumVertices Number of vertices in skin vertex buffer
* \param rstrID Chunk ID string, default empty
*/
SkinVertexBufferChunk( NeoEngine::SkinVertex *pkBuffer, unsigned int uiNumVertices, const NeoEngine::HashString &rstrID = "" ) : ComplexChunk( ChunkType::SKINVERTEXBUFFER, "skinvertexbuf", rstrID ), m_pkBuffer( pkBuffer ), m_uiNumVertices( uiNumVertices ) {}
/**
* Deallocate data and subchunks
*/
virtual ~SkinVertexBufferChunk();
/**
* Get size of chunk in binary mode
* \param bIncludeHeader Add header of chunk (type + ID) to size as well as subchunks and data
* \return Size of chunk data in bytes as if read/written from/to file
*/
virtual int GetSize( bool bIncludeHeader = false ) const;
/**
* Read chunk data from file
* \param pkFile File
* \param eMode Chunk mode (ChunkIO::ASCII or ChunkIO::BINARY)
* \param uiEnd Bytes to end of chunk (in binary mode)
* \return <0 if error, number of bytes read if successful
*/
virtual int ReadData( NeoEngine::File *pkFile, ChunkIO::CHUNKIOMODE eMode, unsigned int uiEnd );
/**
* Write chunk data to file
* \param pkFile File
* \param eMode Chunk mode (ChunkIO::ASCII or ChunkIO::BINARY)
* \param uiLevel Recursion level for ascii format
* \return <0 if error, number of bytes written if successful
*/
virtual int WriteData( NeoEngine::File *pkFile, ChunkIO::CHUNKIOMODE eMode, unsigned int uiLevel );
/**
* Allocate new chunk
* \param usType Type identifier
* \param rstrType Type identifier as string
* \param rstrID ID string
* \return New chunk
*/
static Chunk *Allocator( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID ) { return new SkinVertexBufferChunk( usType, rstrType, rstrID ); }
};
}; // namespace NeoChunkIO
#endif
See more files for this project here