Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2020
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1.  
  2. /**
  3. * Process a master list node.
  4. Also need to change GFX_NUM_MASTER_LISTS to 9 (or higher) and move all desired geo-layout parts (in this case Mario's opaque display lists) to layer 8. I did this by temporarily defining LAYER_OPAQUE to be 8 in actors/mario/geo.inc.c
  5. Oh and I just realized I made a really stupid inefficient thing. You can move the first while loop to start after the gDPSetAlphaCompare line. The setup for the silhouette doesn't need to be done for every display list, since none of them alter it anyways.
  6. 366c0 in baserom
  7. */
  8. static void geo_process_master_list_sub(struct GraphNodeMasterList *node) {
  9. struct DisplayListNode *currList;
  10. s32 i;
  11. s32 enableZBuffer = (node->node.flags & GRAPH_RENDER_Z_BUFFER) != 0;
  12. struct RenderModeContainer *modeList = &renderModeTable_1Cycle[enableZBuffer];
  13. struct RenderModeContainer *mode2List = &renderModeTable_2Cycle[enableZBuffer];
  14.  
  15. // @bug This is where the LookAt values should be calculated but aren't.
  16. // As a result, environment mapping is broken on Fast3DEX2 without the
  17. // changes below.
  18. #ifdef F3DEX_GBI_2
  19. Mtx lMtx;
  20. guLookAtReflect(&lMtx, &lookAt, 0, 0, 0, /* eye */ 0, 0, 1, /* at */ 1, 0, 0 /* up */);
  21. #endif
  22.  
  23. if (enableZBuffer != 0) {
  24. gDPPipeSync(gDisplayListHead++);
  25. gSPSetGeometryMode(gDisplayListHead++, G_ZBUFFER);
  26. }
  27.  
  28. for (i = 0; i < GFX_NUM_MASTER_LISTS; i++) {
  29. if (i == 5) //Render Mario silhouette
  30. {
  31. if ((currList = node->listHeads[8]) != NULL)
  32. {
  33. while (currList != NULL) {
  34. #define SCHWA AA_EN | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL
  35.  
  36. gDPSetFogColor(gDisplayListHead++, 0x0, 0x0, 0x0, 0x80);
  37. gSPFogPosition(gDisplayListHead++, 0, 0);
  38. gSPSetGeometryMode(gDisplayListHead++, G_FOG);
  39. gDPSetRenderMode(gDisplayListHead++, SCHWA | GBL_c1(G_BL_CLR_FOG, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), SCHWA | GBL_c2(G_BL_CLR_FOG, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
  40. gDPSetEnvColor(gDisplayListHead++, 0x80, 0x80, 0x80, 0xA0);
  41. gDPSetAlphaCompare(gDisplayListHead++, G_AC_DITHER);
  42. gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(currList->transform),
  43. G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_LOAD);
  44. gSPDisplayList(gDisplayListHead++, currList->displayList);
  45. currList = currList->next;
  46. }
  47. gSPClearGeometryMode(gDisplayListHead++, G_FOG);
  48. gDPSetEnvColor(gDisplayListHead++, 0xFF, 0xFF, 0xFF, 0xFF);
  49. currList = node->listHeads[8];
  50. while (currList != NULL) {
  51. gDPSetRenderMode(gDisplayListHead++, modeList->modes[1], mode2List->modes[1]);
  52. gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(currList->transform),
  53. G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_LOAD);
  54. gSPDisplayList(gDisplayListHead++, currList->displayList);
  55. currList = currList->next;
  56. }
  57. }
  58. }
  59. if (i < 8 && (currList = node->listHeads[i]) != NULL)
  60. while (currList != NULL) {
  61. gDPSetRenderMode(gDisplayListHead++, modeList->modes[i], mode2List->modes[i]);
  62. gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(currList->transform),
  63. G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_LOAD);
  64. gSPDisplayList(gDisplayListHead++, currList->displayList);
  65. currList = currList->next;
  66. }
  67. }
  68. if (enableZBuffer != 0) {
  69. gDPPipeSync(gDisplayListHead++);
  70. gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER);
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement