Advertisement
Dimitri_UA

Untitled

Jun 25th, 2014
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.23 KB | None | 0 0
  1. #define RpMeshPS2AllClipInfoUploadMacro(_ps2AllPipeData) \
  2. MACRO_START \
  3. { \
  4. RxPS2AllPipeData *_p2apd = (_ps2AllPipeData); \
  5. \
  6. u_long128 __ltmp = 0; \
  7. RwUInt64 __tmp1; \
  8. RwUInt32 __skySwitchFlag; \
  9. \
  10. __skySwitchFlag = _p2apd->transType & (rxSKYTRANSTYPEFOG|rxSKYTRANSTYPECLIP|rxSKYTRANSTYPELIST); \
  11. \
  12. /* A VIFTag to transfer the Clip Vectors and SwitchQW to VU1 memory */ \
  13. __tmp1 = (((0x6CL << 24) | /* VIF unpack 4-32 */ \
  14. (0x03L << 16) | /* Transfer 3 QWs */ \
  15. /* vuSDClipvec1 = 0x03FD, Destination address in VU1 memory (in QWs) */ \
  16. /* [vuSDClipvec2 and vuSDVUSwitch follow directly] */ \
  17. (vuSDClipvec1) ) << 32) | \
  18. ((1L << 24) | (4 << 8) | (4)); /* How to unpack, length 4W, stride 4W */ \
  19. MAKE128(__ltmp, __tmp1, 0L); \
  20. RWDMA_ADD_TO_PKT(__ltmp); \
  21. \
  22. /* Upload camera clipping info */ \
  23. if((skyTSClipperMode && (!(__skySwitchFlag & rxSKYTRANSTYPELIST))) || \
  24. (skyTLClipperMode && (__skySwitchFlag & rxSKYTRANSTYPELIST) ) ) \
  25. { \
  26. /* True clipping. Use small frustum */ \
  27. __skySwitchFlag |= 8; \
  28. RWDMA_ADD_TO_PKT(skyCClipVect1); \
  29. RWDMA_ADD_TO_PKT(skyCClipVect2); \
  30. } \
  31. else \
  32. { \
  33. /* Fast-culling. Use large frustum */ \
  34. RWDMA_ADD_TO_PKT(skyClipVect1); \
  35. RWDMA_ADD_TO_PKT(skyClipVect2); \
  36. } \
  37. \
  38. /* Back/front-face culling flag */ \
  39. skyUserSwitch1 = 0; \
  40. if (gSkyCullState == rwCULLMODECULLFRONT) \
  41. { \
  42. skyUserSwitch1 = 0x20; \
  43. } \
  44. \
  45. /* Combine skyUserSwitch1 and skyUserSwitch2 (skyUserSwitch2 ignored */ \
  46. /* if VUCONTINUE is defined) and upload with __skySwitchFlag */ \
  47. RpPS2AllClipTmp1Setup(__tmp1); \
  48. MAKE128(__ltmp, __tmp1, __skySwitchFlag); \
  49. RWDMA_ADD_TO_PKT(__ltmp); \
  50. } \
  51. MACRO_STOP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement