static RxPipeline * Sprite1CreateMaterialPipe(void) { static void *codeArray[VU1CODEARRAYSIZE] = { &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def, &sprite_def }; RxPipeline *newPipe = (RxPipeline *)NULL; RxPipelineNode *plNode, *result; RxLockedPipe *lPipe; RxNodeDefinition *ps2AllMat; newPipe = RxPipelineCreate(); lPipe = RxPipelineLock(newPipe); ps2AllMat = RxNodeDefinitionGetPS2AllMat(); lPipe = RxLockedPipeAddFragment( lPipe, (RwUInt32 *)NULL, ps2AllMat, (RxNodeDefinition *)NULL ); plNode = RxPipelineFindNodeByName( lPipe, ps2AllMat->name, (RxPipelineNode *)NULL, (RwInt32 *)NULL ); result = RxPipelineNodePS2AllMatGenerateCluster( plNode, &RxClPS2xyz, CL_XYZ); plNode = RxPipelineNodePS2AllMatGenerateCluster( plNode, &RxClPS2uv, CL_UV); plNode = RxPipelineNodePS2AllMatGenerateCluster( plNode, &RxClPS2rgba, CL_RGBA); plNode = RxPipelineNodePS2AllMatGenerateCluster( plNode, &RxClPS2normal, CL_NORMAL); result = RxPipelineNodePS2AllMatSetTriangleVUBufferSizes( plNode, pipeASymbStrideOfInputCluster, pipeASymbTSVertexCount, pipeASymbTLTriCount ); /* Unlock! */ newPipe = RxLockedPipeUnlock(lPipe); /* Best to re-find nodes after an unlock */ plNode = RxPipelineFindNodeByName( lPipe, ps2AllMat->name, (RxPipelineNode *)NULL, (RwInt32 *)NULL ); result = RxPipelineNodePS2AllMatSetVIFOffset( plNode, pipeASymbVIFOffset); /* Set the VU code array to point to our Custom VU pipeline */ codeArray[TRANSNFOG|TRANSNCL |TRANSSTRIP|TRANSPER] = &sprite1_0; codeArray[TRANSFOG |TRANSNCL |TRANSSTRIP|TRANSPER] = &sprite1_1; /* Adding the VU code to the pipeline */ result = RxPipelineNodePS2AllMatSetVU1CodeArray( plNode, codeArray, VU1CODEARRAYSIZE); /* Set up the necessary callbacks */ RxPipelineNodePS2AllMatSetCallBack( plNode, rxPS2ALLMATCALLBACKMESHINSTANCETEST, RpMeshPS2AllMeshInstanceTestCallBack); RxPipelineNodePS2AllMatSetCallBack( plNode, rxPS2ALLMATCALLBACKRESENTRYALLOC, RpMeshPS2AllResEntryAllocCallBack); RxPipelineNodePS2AllMatSetCallBack( plNode, rxPS2ALLMATCALLBACKINSTANCE, RpMeshPS2AllInstanceCallBack); RxPipelineNodePS2AllMatSetCallBack( plNode, rxPS2ALLMATCALLBACKBRIDGE, SkyCustomFXBridgeCallBack); return(newPipe); }