typedef struct RwMeshCache RwMeshCache; /** * \ingroup ps2all * \struct RwMeshCache * Holds pointers to RwResEntrys for all the meshes in an object. */ struct RwMeshCache { RwUInt32 lengthOfMeshesArray; /**< Number of meshes in the object */ RwResEntry *meshes[1]; /**< The RwMeshCache structure will be * allocated sufficiently big that this tail * array can hold lengthOfMeshesArray pointers to * \ref RwResEntry's */ }; extern RwInt32 rwPip2GeometryOffset; extern RwInt32 rwPip2AtomicOffset; extern RwInt32 rwPip2WorldSectorOffset; /* Access to the atomic/worldsector extension data * we use for per-mesh cacheing. */ #define RWMESHCACHEFROMGEOMETRY(_geometry) \ ( *(RwMeshCache * *) \ (((RwUInt8 *) (_geometry)) + rwPip2GeometryOffset) ) #define RWMESHCACHEFROMCONSTGEOMETRY(_geometry) \ ( *(RwMeshCache * const *) \ (((RwUInt32) (_geometry)) + rwPip2GeometryOffset) ) #define RWMESHCACHEFROMATOMIC(_atomic) \ ( *(RwMeshCache * *) \ (((RwUInt8 *) (_atomic)) + rwPip2AtomicOffset) ) #define RWMESHCACHEFROMCONSTATOMIC(_atomic) \ ( *(RwMeshCache * const *) \ (((RwUInt32) (_atomic)) + rwPip2AtomicOffset) ) #define RWMESHCACHEFROMWORLDSECTOR(_worldSector) \ ( *(RwMeshCache * *) \ (((RwUInt8 *) (_worldSector)) + rwPip2WorldSectorOffset) ) #define RWMESHCACHEFROMCONSTWORLDSECTOR(_worldSector) \ ( *(RwMeshCache * const *) \ (((RwUInt32) (_worldSector)) + rwPip2WorldSectorOffset) ) /* These are used in matInstance. These are the properties * which, if changed, should cause a full reinstance. * * Notice that rpWORLDLIGHT and rpWORLDMODULATEMATERIALCOLOR don't cause a * reinstance (former is tested in objAllInOne lighting code and latter in * the matBridge material setup code). */ #define WORLDRENDERTYPEMASK (rpWORLDTRISTRIP | \ rpWORLDTEXTURED | \ rpWORLDPRELIT | \ rpWORLDNORMALS | \ rpWORLDTEXTURED2) /* rpGEOMETRYPOSITIONS included for completeness... why not? */ #define ATOMICRENDERTYPEMASK (rpGEOMETRYTRISTRIP | \ rpGEOMETRYPOSITIONS | \ rpGEOMETRYTEXTURED | \ rpGEOMETRYPRELIT | \ rpGEOMETRYNORMALS | \ rpGEOMETRYTEXTURED2)