RpLight* _rpAtomicPS2AllDoApplyLight(RpLight *light, void *pData); { rpAtomicPS2AllLightData *lightdata = (rpAtomicPS2AllLightData*)pData; if(RpLightGetFlags(light) & rpLIGHTLIGHTATOMICS) RxPipelineNodePS2AllApplyLight(light, lightdata->invMat, lightdata->invScale, lightdata->recipInvScale); return light; } RwBool RpAtomicPS2AllObjectSetupCallBack(RxPS2AllPipeData *ps2AllPipeData, RwMatrix **transform) { RpAtomic *atomic; RwFrustumTestResult inFrustum; atomic = (RpAtomic*)ps2AllPipeData->sourceObject; RpAtomicPS2AllGetMeshHeaderMeshCache(atomic, ps2AllPipeData); RpAtomicPS2AllGatherObjMetrics(atomic); RpAtomicPS2AllMorphSetup(atomic, ps2AllPipeData); RpAtomicPS2AllObjInstanceTest(atomic, ps2AllPipeData); RpAtomicPS2AllClear(atomic); RpAtomicPS2AllTransformSetup(atomic, transform); RpAtomicPS2AllFrustumTest(atomic, &inFrustum); RpAtomicPS2AllPrimTypeTransTypeSetup(ps2AllPipeData, inFrustum); RpAtomicPS2AllMatModulateSetup(atomic, ps2AllPipeData); RpAtomicPS2AllLightingSetup(ps2AllPipeData); return (TRUE); } RwBool RpMeshPS2AllBridgeCallBack(RxPS2AllPipeData *ps2AllPipeData) { RwUInt32 numInitialQW = 0, numExtraQW = 0; /* Asynchronously upload the texture if necessary and possible */ RpMeshPS2AllAsyncTextureUpload(ps2AllPipeData); /* If changed, updates global renderstate and calls skyTexCacheAccessRaster */ RpMeshPS2AllSyncTextureUpload(ps2AllPipeData); /* Open a VIF transfer packet, with a header DMA tag */ numInitialQW += rpMESHPS2ALLGIFTAGNUMINITIALQW + rpMESHPS2ALLMATCOLNUMINITIALQW + rpMESHPS2ALLSURFPROPSNUMINITIALQW + rpMESHPS2ALLCLIPINFONUMINITIALQW + rpMESHPS2ALLTEXTURESTATENUMINITIALQW; numExtraQW = rpMESHPS2ALLVU1CODEUPLOADNUMEXTRAQW; RpMeshPS2AllStartVIFUploads(numInitialQW, numExtraQW); /* Extra user VIF uploads would go here... VIF tag(s) necessary. * Would have called _rxPS2AllStartVIFUploads with FALSE if needed * DMA tags in the user uploads (would have had to fix up with a * terminal DMA tag so the following standard transfers work). */ /* Here follow the standard VIF uploads */ /* Upload a GIF tag for the code to submit geom to the GS under */ RpMeshPS2AllGIFTagUpload(ps2AllPipeData); /* Upload material colour, dependent on whether there's a texture * (also does some renderstate setup based on alpha - that's why * this needs to be before the texture state setup func) */ RpMeshPS2AllMatColUpload(ps2AllPipeData); /* Upload surface properties, including the 'extra' float in W */ RpMeshPS2AllSurfPropsUpload(ps2AllPipeData); /* Sets up clipping info and J-C's switch QWs (NOTE: uses "transType&7") */ RpMeshPS2AllClipInfoUpload(ps2AllPipeData); /* Upload texture renderstate to the GS (this sends stuff thru VIF * only, ergo it can be combined with other VIF stuff! :) ) */ RpMeshPS2AllTextureStateUpload(ps2AllPipeData); /* Set up vu1CodeIndex */ RpMeshPS2AllVU1CodeIndexSetup(ps2AllPipeData); /* Upload the VU1 code (if it changed) last, since it uses a DMA tag (ref transfer of the code) */ RpMeshPS2AllVU1CodeUpload(ps2AllPipeData); /* Kicks off geometry transfer, sets up refCnt/clrCnt */ RpMeshPS2AllEndVIFUploads(ps2AllPipeData); return (TRUE); }