/* PS2ALLMACROASSERT is a NOP in rpworld.h, for app code */ #if (defined(RWASSERT)) #define PS2ALLMACROASSERT(args) RWASSERT(args) #else /* (!defined(RWASSERT)) */ #define PS2ALLMACROASSERT(args) /* No op */ #endif /* (!defined(RWASSERT)) */ #if (!defined(REDEBUGPrintf)) #define REDEBUGPrintf(args) /* no op */ #endif /* (!defined()) */ #define DMAALIGN #define FASTMORPH #if (!defined(FASTMORPH)) #define FMADD (0) #else /* (!defined(FASTMORPH)) */ #define FMADD (2) #endif /* (!defined(FASTMORPH)) */ typedef struct rwPS2AllClusterInstanceInfo rwPS2AllClusterInstanceInfo; #if (!defined(DOXYGEN)) struct rwPS2AllClusterInstanceInfo { RwUInt32 attrib; /**< Internal Use */ RwUInt32 stride; /**< Internal Use */ }; /**< Internal Use */ typedef struct rwPS2AllFieldRec rwPS2AllFieldRec; struct rwPS2AllFieldRec { int numVerts; /**< Internal Use */ #if (defined(FASTMORPH)) int morphNumVerts; /**< Internal Use */ #endif /* (defined(FASTMORPH)) */ int dataoffset; /**< Internal Use */ #if (defined(FASTMORPH)) int morphDataoffset; /**< Internal Use */ #endif /* (defined(FASTMORPH)) */ short skip; /**< Internal Use */ #if (defined(FASTMORPH)) short morphSkip; /**< Internal Use */ #endif /* (defined(FASTMORPH)) */ short reverse; /**< Internal Use */ unsigned char vuoffset; /**< Internal Use */ #if (!defined(FASTMORPH)) unsigned char pad[3]; /**< Internal Use */ #else /* (!defined(FASTMORPH)) */ unsigned char pad[1]; /**< Internal Use */ #endif /* (!defined(FASTMORPH)) */ }; typedef struct rwPS2AllResEntryFormat rwPS2AllResEntryFormat; struct rwPS2AllResEntryFormat { RwUInt8 batchRound; /**< Internal Use */ RwUInt8 stripReverse; /**< Internal Use */ RwUInt8 pad[2]; RwUInt32 maxInputSize; /**< Internal Use */ RwInt32 batchSize; /**< Internal Use */ RwInt32 batchesPerTag; /**< Internal Use */ #if (defined(FASTMORPH)) RwInt32 morphBatchSize; /**< Internal Use */ RwInt32 morphBatchesPerTag; /**< Internal Use */ #endif /* (defined(FASTMORPH)) */ rwPS2AllFieldRec fieldRec[CL_MAXCL + FMADD]; /**< Internal Use */ }; #endif /* (!defined(DOXYGEN)) */ /** * \ingroup ps2all * \ref RxPipelineNodePS2AllMatCallBackType * PS2AllMat.csl callback types (see \ref RxPipelineNodePS2AllMatSetCallBack * and \ref RxPipelineNodePS2AllSetCallBack), in order of execution within * the node. */ enum RxPipelineNodePS2AllMatCallBackType { rxPS2ALLMATCALLBACKNACALLBACK = 0, rxPS2ALLMATCALLBACKMESHINSTANCETEST = 1, /**< Performs per-mesh reinstance tests * (see \ref RxPipelineNodePS2AllMatMeshInstanceTestCallBack) */ rxPS2ALLMATCALLBACKRESENTRYALLOC = 2, /**< Allocates memory for instance data * (see \ref RxPipelineNodePS2AllMatResEntryAllocCallBack) */ rxPS2ALLMATCALLBACKINSTANCE = 3, /**< Instances a mesh and performs static data uploads * (see \ref RxPipelineNodePS2AllMatInstanceCallBack) */ rxPS2ALLMATCALLBACKBRIDGE = 4, /**< Selects VU code and sets up material properties * (see \ref RxPipelineNodePS2AllMatBridgeCallBack) */ rxPS2ALLMATCALLBACKPOSTMESH = 5, /**< Performs per-mesh post-render tasks * (see \ref RxPipelineNodePS2AllMatPostMeshCallBack) */ rxPS2ALLMATCALLBACKFORCEENUMSIZEINT = RWFORCEENUMSIZEINT }; typedef enum RxPipelineNodePS2AllMatCallBackType RxPipelineNodePS2AllMatCallBackType; typedef struct RxPS2AllPipeData RxPS2AllPipeData; typedef RwBool (*RxPipelineNodePS2AllMatMeshInstanceTestCallBack) (RxPS2AllPipeData *ps2AllPipeData); typedef RwResEntry *(*RxPipelineNodePS2AllMatResEntryAllocCallBack) (RxPS2AllPipeData *ps2AllPipeData, RwResEntry **repEntry, RwUInt32 size, RwResEntryDestroyNotify destroyNotify); typedef RwBool (*RxPipelineNodePS2AllMatInstanceCallBack) (RxPS2AllPipeData *ps2AllPipeData, void **clusterData, RwUInt32 numClusters); typedef RwBool (*RxPipelineNodePS2AllMatBridgeCallBack) (RxPS2AllPipeData *ps2AllPipeData); typedef RwBool (*RxPipelineNodePS2AllMatPostMeshCallBack) (RxPS2AllPipeData *ps2AllPipeData); typedef struct rxNodePS2AllMatPvtData rxNodePS2AllMatPvtData; #if (!defined(DOXYGEN)) struct rxNodePS2AllMatPvtData { /* Callbacks */ RxPipelineNodePS2AllMatMeshInstanceTestCallBack meshInstanceTestCB; /**< Internal Use */ RxPipelineNodePS2AllMatResEntryAllocCallBack resEntryAllocCB; /**< Internal Use */ RxPipelineNodePS2AllMatInstanceCallBack instanceCB; /**< Internal Use */ RxPipelineNodePS2AllMatBridgeCallBack bridgeCB; /**< Internal Use */ RxPipelineNodePS2AllMatPostMeshCallBack postMeshCB; /**< Internal Use */ /* MatBridge sub-section [first for memory coherence, * instance stuff is not fast-path] */ int vifOffset; /**< Internal Use */ void **vu1CodeArray; /**< Internal Use */ RwUInt32 codeArrayLength; /**< Internal Use */ /* MatInstance sub-section * [Arrays are indexed by CL_xxx defines in PS2ClusterAttribs.h] */ rwPS2AllClusterInstanceInfo clinfo[CL_MAXCL + FMADD]; /**< Internal Use */ RwUInt32 cliIndex[CL_MAXCL + FMADD]; /**< Internal Use */ RpMeshHeaderFlags pipeType; /**< Internal Use */ RwUInt8 totallyOpaque; /**< Internal Use */ RwUInt8 numStripes; /**< Internal Use */ RwUInt8 sizeOnVU; /**< Internal Use */ RwUInt8 pad0; /**< Internal Use */ rwPS2AllResEntryFormat strip; /**< Internal Use */ rwPS2AllResEntryFormat list; /**< Internal Use */ RwUInt32 magicValue; /**< Internal Use */ }; #endif /* (!defined(DOXYGEN)) */ #if (defined(__cplusplus)) extern "C" { #endif /* (defined(__cplusplus)) */ extern RxNodeDefinition * RxNodeDefinitionGetPS2AllMat(void); /* Pre-unlock API functions (set up permanent properties * of the pipeline at construction time) */ extern RxPipelineNode * RxPipelineNodePS2AllMatGenerateCluster(RxPipelineNode *self, RxClusterDefinition *cluster2generate, RwUInt32 type); extern RxPipelineNode * RxPipelineNodePS2AllMatSetTriangleVUBufferSizes(RxPipelineNode *self, RwInt32 strideOfInputVertex, RwInt32 vuTSVertexMaxCount, RwInt32 vuTLTriMaxCount); /* LEGACY-SUPPORT MACRO */ #define RxPipelineNodePS2AllMatSetVUBufferSizes \ RxPipelineNodePS2AllMatSetTriangleVUBufferSizes extern RxPipelineNode * RxPipelineNodePS2AllMatSetLineVUBufferSizes(RxPipelineNode *self, RwInt32 strideOfInputVertex, RwInt32 vuLSVertexMaxCount, RwInt32 vuLLLineMaxCount); extern RxPipelineNode * RxPipelineNodePS2AllMatSetPointListVUBufferSize(RxPipelineNode *self, RwInt32 strideOfInputVertex, RwInt32 vuPLVertexMaxCount); /* Post-unlock API functions (these may be called more than * once, to change pipe behaviour between pipe executions) */ /* Find out the batch size that's actually used (not what you asked for) */ extern RwInt32 RxPipelineNodePS2AllMatGetVUBatchSize( RxPipelineNode *self, RpMeshHeaderFlags flags); extern RxPipelineNode * RxPipelineNodePS2AllMatSetVIFOffset( RxPipelineNode *self, int vifOffset); extern RxPipelineNode * RxPipelineNodePS2AllMatSetVU1CodeArray(RxPipelineNode *self, void **vu1CodeArray, RwUInt32 length); extern const void ** RxPipelineNodePS2AllMatGetVU1CodeArray(RxPipelineNode * self, RwUInt32 *length); extern RxPipelineNode * RxPipelineNodePS2AllMatSetCallBack( RxPipelineNode *self, RxPipelineNodePS2AllMatCallBackType type, void *func); #if (defined(__cplusplus)) } #endif /* (defined(__cplusplus)) */