• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*!****************************************************************************
2 
3  @file         PVRTBoneBatch.h
4  @copyright    Copyright (c) Imagination Technologies Limited.
5  @brief        Utility functions which process vertices.
6 
7 ******************************************************************************/
8 #ifndef _PVRTBONEBATCH_H_
9 #define _PVRTBONEBATCH_H_
10 
11 #include "PVRTVertex.h"
12 #include <stdlib.h>
13 
14 /*!***************************************************************************
15  Handles a batch of bones
16 *****************************************************************************/
17 /*!***************************************************************************
18  @class CPVRTBoneBatches
19  @brief A class for processing vertices into bone batches
20 *****************************************************************************/
21 class CPVRTBoneBatches
22 {
23 public:
24 	int	*pnBatches;			/*!< Space for nBatchBoneMax bone indices, per batch */
25 	int	*pnBatchBoneCnt;	/*!< Actual number of bone indices, per batch */
26 	int	*pnBatchOffset;		/*!< Offset into triangle array, per batch */
27 	int nBatchBoneMax;		/*!< Stored value as was passed into Create() */
28 	int	nBatchCnt;			/*!< Number of batches to render */
29 
30 	/*!***********************************************************************
31 	 @brief      	Fills the bone batch structure
32 	 @param[out]	pnVtxNumOut		vertex count
33 	 @param[out]	pVtxOut			Output vertices (program must free() this)
34 	 @param[in,out]	pui32Idx		index array for triangle list
35 	 @param[in]		nVtxNum			vertex count
36 	 @param[in]		pVtx			vertices
37 	 @param[in]		nStride			Size of a vertex (in bytes)
38 	 @param[in]		nOffsetWeight	Offset in bytes to the vertex bone-weights
39 	 @param[in]		eTypeWeight		Data type of the vertex bone-weights
40 	 @param[in]		nOffsetIdx		Offset in bytes to the vertex bone-indices
41 	 @param[in]		eTypeIdx		Data type of the vertex bone-indices
42 	 @param[in]		nTriNum			Number of triangles
43 	 @param[in]		nBatchBoneMax	Number of bones a batch can reference
44 	 @param[in]		nVertexBones	Number of bones affecting each vertex
45 	 @return		PVR_SUCCESS if successful
46 	*************************************************************************/
47 	EPVRTError Create(
48 		int					* const pnVtxNumOut,
49 		char				** const pVtxOut,
50 		unsigned int		* const pui32Idx,
51 		const int			nVtxNum,
52 		const char			* const pVtx,
53 		const int			nStride,
54 		const int			nOffsetWeight,
55 		const EPVRTDataType	eTypeWeight,
56 		const int			nOffsetIdx,
57 		const EPVRTDataType	eTypeIdx,
58 		const int			nTriNum,
59 		const int			nBatchBoneMax,
60 		const int			nVertexBones);
61 
62 	/*!***********************************************************************
63 	 @brief      	Destroy the bone batch structure
64 	*************************************************************************/
Release()65 	void Release()
66 	{
67 		FREE(pnBatches);
68 		FREE(pnBatchBoneCnt);
69 		FREE(pnBatchOffset);
70 		nBatchCnt = 0;
71 	}
72 };
73 
74 
75 #endif /* _PVRTBONEBATCH_H_ */
76 
77 /*****************************************************************************
78  End of file (PVRTBoneBatch.h)
79 *****************************************************************************/
80 
81