From 054cb1a79d8fb90539b81fac8a8059f05160e4f3 Mon Sep 17 00:00:00 2001 From: aglab2 Date: Fri, 27 Dec 2024 22:42:43 +0800 Subject: [PATCH] Added coin batching --- actors/coin/geo.inc.c | 168 ++------------- actors/coin/model.inc.c | 360 ++++++------------------------- actors/common1.h | 69 ++---- include/config/config_graphics.h | 2 +- include/geo_commands.h | 16 ++ include/sm64.h | 23 ++ src/engine/batch_list.c | 39 ++++ src/engine/batch_list.h | 8 + src/engine/geo_layout.c | 16 ++ src/engine/geo_layout.h | 1 + src/engine/graph_node.c | 22 ++ src/engine/graph_node.h | 14 ++ src/game/ingame_menu.c | 54 +++-- src/game/rendering_graph_node.c | 17 ++ 14 files changed, 293 insertions(+), 516 deletions(-) diff --git a/actors/coin/geo.inc.c b/actors/coin/geo.inc.c index 43599bd463..5be259afd1 100644 --- a/actors/coin/geo.inc.c +++ b/actors/coin/geo.inc.c @@ -3,17 +3,7 @@ const GeoLayout yellow_coin_geo[] = { GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 50), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_0), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_22_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_45), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_67_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_90), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_67_5_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_45_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_22_5_r), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_yellow_draw, coin_seg3_sub_dl_yellow_draw_r), GEO_CLOSE_NODE(), GEO_END(), }; @@ -22,17 +12,7 @@ const GeoLayout yellow_coin_geo[] = { const GeoLayout yellow_coin_no_shadow_geo[] = { GEO_NODE_START(), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_0), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_22_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_45), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_67_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_90), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_67_5_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_45_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_22_5_r), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_yellow_draw, coin_seg3_sub_dl_yellow_draw_r), GEO_CLOSE_NODE(), GEO_END(), }; @@ -41,17 +21,7 @@ const GeoLayout yellow_coin_no_shadow_geo[] = { const GeoLayout blue_coin_geo[] = { GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 80), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_0), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_22_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_45), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_67_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_90), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_67_5_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_45_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_22_5_r), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_blue_draw, coin_seg3_sub_dl_blue_draw_r), GEO_CLOSE_NODE(), GEO_END(), }; @@ -60,17 +30,7 @@ const GeoLayout blue_coin_geo[] = { const GeoLayout blue_coin_no_shadow_geo[] = { GEO_NODE_START(), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_0), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_22_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_45), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_67_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_90), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_67_5_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_45_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_22_5_r), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_blue_draw, coin_seg3_sub_dl_blue_draw_r), GEO_CLOSE_NODE(), GEO_END(), }; @@ -79,17 +39,7 @@ const GeoLayout blue_coin_no_shadow_geo[] = { const GeoLayout red_coin_geo[] = { GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 80), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_0), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_22_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_45), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_67_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_90), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_67_5_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_45_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_22_5_r), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_red_draw, coin_seg3_sub_dl_red_draw_r), GEO_CLOSE_NODE(), GEO_END(), }; @@ -98,17 +48,7 @@ const GeoLayout red_coin_geo[] = { const GeoLayout red_coin_no_shadow_geo[] = { GEO_NODE_START(), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_0), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_22_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_45), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_67_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_90), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_67_5_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_45_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_22_5_r), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_red_draw, coin_seg3_sub_dl_red_draw_r), GEO_CLOSE_NODE(), GEO_END(), }; @@ -117,17 +57,7 @@ const GeoLayout red_coin_no_shadow_geo[] = { const GeoLayout silver_coin_geo[] = { GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 80), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_0), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_22_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_45), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_67_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_90), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_67_5_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_45_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_22_5_r), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_secret_draw, coin_seg3_sub_dl_secret_draw_r), GEO_CLOSE_NODE(), GEO_END(), }; @@ -136,17 +66,7 @@ const GeoLayout silver_coin_geo[] = { const GeoLayout silver_coin_no_shadow_geo[] = { GEO_NODE_START(), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_0), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_22_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_45), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_67_5), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_90), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_67_5_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_45_r), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_secret_22_5_r), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_secret_draw, coin_seg3_sub_dl_secret_draw_r), GEO_CLOSE_NODE(), GEO_END(), }; @@ -156,17 +76,7 @@ const GeoLayout silver_coin_no_shadow_geo[] = { const GeoLayout yellow_coin_geo[] = { GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 50), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_tilt_left), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_tilt_left), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_yellow_draw), GEO_CLOSE_NODE(), GEO_END(), }; @@ -175,17 +85,7 @@ const GeoLayout yellow_coin_geo[] = { const GeoLayout yellow_coin_no_shadow_geo[] = { GEO_NODE_START(), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_tilt_left), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_yellow_tilt_left), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_yellow_draw), GEO_CLOSE_NODE(), GEO_END(), }; @@ -194,17 +94,7 @@ const GeoLayout yellow_coin_no_shadow_geo[] = { const GeoLayout blue_coin_geo[] = { GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 80), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_tilt_left), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_tilt_left), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_blue_draw), GEO_CLOSE_NODE(), GEO_END(), }; @@ -213,17 +103,7 @@ const GeoLayout blue_coin_geo[] = { const GeoLayout blue_coin_no_shadow_geo[] = { GEO_NODE_START(), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_tilt_left), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_blue_tilt_left), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_blue_draw), GEO_CLOSE_NODE(), GEO_END(), }; @@ -232,17 +112,7 @@ const GeoLayout blue_coin_no_shadow_geo[] = { const GeoLayout red_coin_geo[] = { GEO_SHADOW(SHADOW_CIRCLE_4_VERTS, 0xB4, 80), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_tilt_left), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_tilt_left), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_red_draw), GEO_CLOSE_NODE(), GEO_END(), }; @@ -251,17 +121,7 @@ const GeoLayout red_coin_geo[] = { const GeoLayout red_coin_no_shadow_geo[] = { GEO_NODE_START(), GEO_OPEN_NODE(), - GEO_SWITCH_CASE(8, geo_switch_anim_state), - GEO_OPEN_NODE(), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_front), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_tilt_right), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_side), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_tilt_left), - GEO_DISPLAY_LIST(LAYER_OCCLUDE_SILHOUETTE_ALPHA, coin_seg3_dl_red_tilt_left), - GEO_CLOSE_NODE(), + GEO_COIN(coin_seg3_sub_dl_red_draw), GEO_CLOSE_NODE(), GEO_END(), }; diff --git a/actors/coin/model.inc.c b/actors/coin/model.inc.c index 146f9c1625..87e37d98b1 100644 --- a/actors/coin/model.inc.c +++ b/actors/coin/model.inc.c @@ -103,7 +103,7 @@ ALIGNED8 static const Texture coin_seg3_texture_90_ia8[] = { // set geo // 0x03007780 - 0x030077D0 -const Gfx coin_seg3_dl_start[] = { +static const Gfx coin_seg3_dl_start[] = { gsDPPipeSync(), gsSPClearGeometryMode(G_LIGHTING), gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA), @@ -121,7 +121,7 @@ const Gfx coin_seg3_dl_start[] = { // clear geo // 0x030077D0 - 0x03007800 const Gfx coin_seg3_dl_end[] = { - gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsDPPipeSync(), gsSPTexture(0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), @@ -130,264 +130,100 @@ const Gfx coin_seg3_dl_end[] = { }; // YELLOW -const Gfx coin_seg3_dl_yellow_0[] = { +const Gfx coin_seg3_dl_0[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_0_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_yellow, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSPBranchList(coin_seg3_dl_start), }; -const Gfx coin_seg3_dl_yellow_22_5[] = { +const Gfx coin_seg3_dl_22_5[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_22_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_yellow, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSPBranchList(coin_seg3_dl_start), }; -const Gfx coin_seg3_dl_yellow_45[] = { +const Gfx coin_seg3_dl_45[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_45_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_yellow, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSPBranchList(coin_seg3_dl_start), }; -const Gfx coin_seg3_dl_yellow_67_5[] = { +const Gfx coin_seg3_dl_67_5[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_67_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_yellow, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSPBranchList(coin_seg3_dl_start), }; -const Gfx coin_seg3_dl_yellow_90[] = { +const Gfx coin_seg3_dl_90[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_90_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_yellow, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSPBranchList(coin_seg3_dl_start), }; -const Gfx coin_seg3_dl_yellow_67_5_r[] = { +const Gfx coin_seg3_dl_67_5_r[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_67_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_yellow_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSPBranchList(coin_seg3_dl_start), }; -const Gfx coin_seg3_dl_yellow_45_r[] = { +const Gfx coin_seg3_dl_45_r[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_45_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_yellow_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSPBranchList(coin_seg3_dl_start), }; -const Gfx coin_seg3_dl_yellow_22_5_r[] = { +const Gfx coin_seg3_dl_22_5_r[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_22_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_yellow_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSPBranchList(coin_seg3_dl_start), }; -// BLUE -const Gfx coin_seg3_dl_blue_0[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_0_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_blue, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_blue_22_5[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_22_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_blue, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_blue_45[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_45_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_blue, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_blue_67_5[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_67_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_blue, 4, 0), - gsSPBranchList(coin_seg3_dl_end), +const Gfx coin_seg3_sub_dl_yellow_draw[] = { + gsSPVertex(coin_seg3_vertex_yellow, 4, 0), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; -const Gfx coin_seg3_dl_blue_90[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_90_ia8), - gsSPDisplayList(coin_seg3_dl_start), +const Gfx coin_seg3_sub_dl_blue_draw[] = { gsSPVertex(coin_seg3_vertex_blue, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_blue_67_5_r[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_67_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_blue_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_blue_22_5_r[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_22_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_blue_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_blue_45_r[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_45_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_blue_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -// RED -const Gfx coin_seg3_dl_red_0[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_0_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_red, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_red_22_5[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_22_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_red, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_red_45[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_45_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_red, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_red_67_5[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_67_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_red, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; -const Gfx coin_seg3_dl_red_90[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_90_ia8), - gsSPDisplayList(coin_seg3_dl_start), +const Gfx coin_seg3_sub_dl_red_draw[] = { gsSPVertex(coin_seg3_vertex_red, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_red_67_5_r[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_67_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_red_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_red_45_r[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_45_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_red_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - - -const Gfx coin_seg3_dl_red_22_5_r[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_22_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_red_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; -// SECRET -const Gfx coin_seg3_dl_secret_0[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_0_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_secret, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_secret_22_5[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_22_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_secret, 4, 0), - gsSPBranchList(coin_seg3_dl_end), -}; - -const Gfx coin_seg3_dl_secret_45[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_45_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_secret, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; -const Gfx coin_seg3_dl_secret_67_5[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_67_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), +const Gfx coin_seg3_sub_dl_secret_draw[] = { gsSPVertex(coin_seg3_vertex_secret, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; -const Gfx coin_seg3_dl_secret_90[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_90_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_secret, 4, 0), - gsSPBranchList(coin_seg3_dl_end), +const Gfx coin_seg3_sub_dl_yellow_draw_r[] = { + gsSPVertex(coin_seg3_vertex_yellow_r, 4, 0), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; -const Gfx coin_seg3_dl_secret_67_5_r[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_67_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_secret_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), +const Gfx coin_seg3_sub_dl_blue_draw_r[] = { + gsSPVertex(coin_seg3_vertex_blue_r, 4, 0), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; -const Gfx coin_seg3_dl_secret_45_r[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_45_ia8), - gsSPDisplayList(coin_seg3_dl_start), - gsSPVertex(coin_seg3_vertex_secret_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), +const Gfx coin_seg3_sub_dl_red_draw_r[] = { + gsSPVertex(coin_seg3_vertex_red_r, 4, 0), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; - -const Gfx coin_seg3_dl_secret_22_5_r[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_8b, 64, coin_seg3_texture_22_5_ia8), - gsSPDisplayList(coin_seg3_dl_start), +const Gfx coin_seg3_sub_dl_secret_draw_r[] = { gsSPVertex(coin_seg3_vertex_secret_r, 4, 0), - gsSPBranchList(coin_seg3_dl_end), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; #else @@ -479,7 +315,7 @@ ALIGNED8 static const Texture coin_seg3_texture_tilt_left[] = { #endif // 0x03007780 - 0x030077D0 -const Gfx coin_seg3_sub_dl_begin[] = { +static const Gfx coin_seg3_sub_dl_begin[] = { gsDPPipeSync(), gsSPClearGeometryMode(G_LIGHTING), gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA), @@ -501,8 +337,8 @@ const Gfx coin_seg3_sub_dl_begin[] = { }; // 0x030077D0 - 0x03007800 -const Gfx coin_seg3_sub_dl_end[] = { - gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), +const Gfx coin_seg3_dl_end[] = { + gsDPPipeSync(), gsSPTexture(0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), @@ -511,111 +347,49 @@ const Gfx coin_seg3_sub_dl_end[] = { }; // 0x03007800 - 0x03007828 -const Gfx coin_seg3_dl_yellow_front[] = { +const Gfx coin_seg3_dl_front[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_front), - gsSPDisplayList(coin_seg3_sub_dl_begin), - gsSPVertex(coin_seg3_vertex_yellow, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), + gsSPBranchList(coin_seg3_sub_dl_begin), }; // 0x03007828 - 0x03007850 -const Gfx coin_seg3_dl_yellow_tilt_right[] = { +const Gfx coin_seg3_dl_tilt_right[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_tilt_right), - gsSPDisplayList(coin_seg3_sub_dl_begin), - gsSPVertex(coin_seg3_vertex_yellow, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), + gsSPBranchList(coin_seg3_sub_dl_begin), }; // 0x03007850 - 0x03007878 -const Gfx coin_seg3_dl_yellow_side[] = { +const Gfx coin_seg3_dl_side[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_side), - gsSPDisplayList(coin_seg3_sub_dl_begin), - gsSPVertex(coin_seg3_vertex_yellow, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), + gsSPBranchList(coin_seg3_sub_dl_begin), }; // 0x03007878 - 0x030078A0 -const Gfx coin_seg3_dl_yellow_tilt_left[] = { +const Gfx coin_seg3_dl_tilt_left[] = { gsDPPipeSync(), gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_tilt_left), - gsSPDisplayList(coin_seg3_sub_dl_begin), - gsSPVertex(coin_seg3_vertex_yellow, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), + gsSPBranchList(coin_seg3_sub_dl_begin), }; -// 0x030078A0 - 0x030078C8 -const Gfx coin_seg3_dl_blue_front[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_front), - gsSPDisplayList(coin_seg3_sub_dl_begin), - gsSPVertex(coin_seg3_vertex_blue, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), -}; - -// 0x030078C8 - 0x030078F0 -const Gfx coin_seg3_dl_blue_tilt_right[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_tilt_right), - gsSPDisplayList(coin_seg3_sub_dl_begin), - gsSPVertex(coin_seg3_vertex_blue, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), +const Gfx coin_seg3_sub_dl_yellow_draw[] = { + gsSPVertex(coin_seg3_vertex_yellow, 4, 0), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; -// 0x030078F0 - 0x03007918 -const Gfx coin_seg3_dl_blue_side[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_side), - gsSPDisplayList(coin_seg3_sub_dl_begin), +const Gfx coin_seg3_sub_dl_blue_draw[] = { gsSPVertex(coin_seg3_vertex_blue, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), -}; - -// 0x03007918 - 0x03007940 -const Gfx coin_seg3_dl_blue_tilt_left[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_tilt_left), - gsSPDisplayList(coin_seg3_sub_dl_begin), - gsSPVertex(coin_seg3_vertex_blue, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), -}; - -// 0x03007940 - 0x03007968 -const Gfx coin_seg3_dl_red_front[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_front), - gsSPDisplayList(coin_seg3_sub_dl_begin), - gsSPVertex(coin_seg3_vertex_red, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), -}; - -// 0x03007968 - 0x03007990 -const Gfx coin_seg3_dl_red_tilt_right[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_tilt_right), - gsSPDisplayList(coin_seg3_sub_dl_begin), - gsSPVertex(coin_seg3_vertex_red, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), -}; - -// 0x03007990 - 0x030079B8 -const Gfx coin_seg3_dl_red_side[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_side), - gsSPDisplayList(coin_seg3_sub_dl_begin), - gsSPVertex(coin_seg3_vertex_red, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; -// 0x030079B8 - 0x030079E0 -const Gfx coin_seg3_dl_red_tilt_left[] = { - gsDPPipeSync(), - gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, coin_seg3_texture_tilt_left), - gsSPDisplayList(coin_seg3_sub_dl_begin), +const Gfx coin_seg3_sub_dl_red_draw[] = { gsSPVertex(coin_seg3_vertex_red, 4, 0), - gsSPBranchList(coin_seg3_sub_dl_end), + gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSPEndDisplayList(), }; #endif diff --git a/actors/common1.h b/actors/common1.h index 179032ca2d..4523f8d57d 100644 --- a/actors/common1.h +++ b/actors/common1.h @@ -35,59 +35,34 @@ extern const GeoLayout red_coin_no_shadow_geo[]; extern const GeoLayout silver_coin_geo[]; extern const GeoLayout silver_coin_no_shadow_geo[]; -extern const Gfx coin_seg3_dl_yellow_0[]; -extern const Gfx coin_seg3_dl_yellow_22_5[]; -extern const Gfx coin_seg3_dl_yellow_45[]; -extern const Gfx coin_seg3_dl_yellow_67_5[]; -extern const Gfx coin_seg3_dl_yellow_90[]; -extern const Gfx coin_seg3_dl_yellow_67_5_r[]; -extern const Gfx coin_seg3_dl_yellow_45_r[]; -extern const Gfx coin_seg3_dl_yellow_22_5_r[]; +extern const Gfx coin_seg3_dl_0[]; +extern const Gfx coin_seg3_dl_22_5[]; +extern const Gfx coin_seg3_dl_45[]; +extern const Gfx coin_seg3_dl_67_5[]; +extern const Gfx coin_seg3_dl_90[]; +extern const Gfx coin_seg3_dl_67_5_r[]; +extern const Gfx coin_seg3_dl_45_r[]; +extern const Gfx coin_seg3_dl_22_5_r[]; -extern const Gfx coin_seg3_dl_blue_0[]; -extern const Gfx coin_seg3_dl_blue_22_5[]; -extern const Gfx coin_seg3_dl_blue_45[]; -extern const Gfx coin_seg3_dl_blue_67_5[]; -extern const Gfx coin_seg3_dl_blue_90[]; -extern const Gfx coin_seg3_dl_blue_67_5_r[]; -extern const Gfx coin_seg3_dl_blue_45_r[]; -extern const Gfx coin_seg3_dl_blue_22_5_r[]; +extern const Gfx coin_seg3_sub_dl_secret_draw[]; -extern const Gfx coin_seg3_dl_red_0[]; -extern const Gfx coin_seg3_dl_red_22_5[]; -extern const Gfx coin_seg3_dl_red_45[]; -extern const Gfx coin_seg3_dl_red_67_5[]; -extern const Gfx coin_seg3_dl_red_90[]; -extern const Gfx coin_seg3_dl_red_67_5_r[]; -extern const Gfx coin_seg3_dl_red_45_r[]; -extern const Gfx coin_seg3_dl_red_22_5_r[]; - -extern const Gfx coin_seg3_dl_secret_0[]; -extern const Gfx coin_seg3_dl_secret_22_5[]; -extern const Gfx coin_seg3_dl_secret_45[]; -extern const Gfx coin_seg3_dl_secret_67_5[]; -extern const Gfx coin_seg3_dl_secret_90[]; -extern const Gfx coin_seg3_dl_secret_67_5_r[]; -extern const Gfx coin_seg3_dl_secret_45_r[]; -extern const Gfx coin_seg3_dl_secret_22_5_r[]; +extern const Gfx coin_seg3_sub_dl_yellow_draw_r[]; +extern const Gfx coin_seg3_sub_dl_blue_draw_r[]; +extern const Gfx coin_seg3_sub_dl_red_draw_r[]; +extern const Gfx coin_seg3_sub_dl_secret_draw_r[]; #else -extern const Gfx coin_seg3_sub_dl_begin[]; -extern const Gfx coin_seg3_sub_dl_end[]; -extern const Gfx coin_seg3_dl_yellow_front[]; -extern const Gfx coin_seg3_dl_yellow_tilt_right[]; -extern const Gfx coin_seg3_dl_yellow_side[]; -extern const Gfx coin_seg3_dl_yellow_tilt_left[]; -extern const Gfx coin_seg3_dl_blue_front[]; -extern const Gfx coin_seg3_dl_blue_tilt_right[]; -extern const Gfx coin_seg3_dl_blue_side[]; -extern const Gfx coin_seg3_dl_blue_tilt_left[]; -extern const Gfx coin_seg3_dl_red_front[]; -extern const Gfx coin_seg3_dl_red_tilt_right[]; -extern const Gfx coin_seg3_dl_red_side[]; -extern const Gfx coin_seg3_dl_red_tilt_left[]; +extern const Gfx coin_seg3_dl_front[]; +extern const Gfx coin_seg3_dl_tilt_right[]; +extern const Gfx coin_seg3_dl_side[]; +extern const Gfx coin_seg3_dl_tilt_left[]; #endif +extern const Gfx coin_seg3_sub_dl_yellow_draw[]; +extern const Gfx coin_seg3_sub_dl_blue_draw[]; +extern const Gfx coin_seg3_sub_dl_red_draw[]; +extern const Gfx coin_seg3_dl_end[]; + // dirt extern const GeoLayout dirt_animation_geo[]; extern const GeoLayout cartoon_star_geo[]; diff --git a/include/config/config_graphics.h b/include/config/config_graphics.h index ada7912218..28b1b97324 100644 --- a/include/config/config_graphics.h +++ b/include/config/config_graphics.h @@ -65,7 +65,7 @@ /** * Similar to the above, but 30 FPS (Textures by InTheBeef, cleaned up by Arceveti). */ -// #define IA8_30FPS_COINS +#define IA8_30FPS_COINS /** * Use .rej microcode for certain objects (experimental - only should be used when F3DEX_GBI_2 is defined). diff --git a/include/geo_commands.h b/include/geo_commands.h index 56706cc7e8..0ab3102872 100644 --- a/include/geo_commands.h +++ b/include/geo_commands.h @@ -58,6 +58,7 @@ enum GeoLayoutCommands { /*0x1E*/ GEO_CMD_NOP_1E, /*0x1F*/ GEO_CMD_NOP_1F, /*0x20*/ GEO_CMD_NODE_CULLING_RADIUS, + /*0x21*/ GEO_CMD_NODE_COIN, GEO_CMD_COUNT, }; @@ -360,6 +361,10 @@ enum GeoLayoutCommands { CMD_BBH(GEO_CMD_NODE_DISPLAY_LIST, layer, 0x0000), \ CMD_PTR(displayList) +#define GEO_BATCH_DISPLAY_LIST(layer, batch, displayList) \ + CMD_BBH(GEO_CMD_NODE_BATCH_DISPLAY_LIST, layer, batch), \ + CMD_PTR(displayList) + /** * 0x16: Create shadow scene graph node * 0x01: unused @@ -469,4 +474,15 @@ enum GeoLayoutCommands { #define GEO_CULLING_RADIUS(cullingRadius) \ CMD_BBH(GEO_CMD_NODE_CULLING_RADIUS, 0x00, cullingRadius) +#ifdef IA8_30FPS_COINS +#define GEO_COIN(displayList, displayListR) \ + CMD_BBH(GEO_CMD_NODE_COIN, 0x00, 0x0000), \ + CMD_PTR(displayList), \ + CMD_PTR(displayListR) +#else +#define GEO_COIN(displayList) \ + CMD_BBH(GEO_CMD_NODE_COIN, 0x00, 0x0000), \ + CMD_PTR(displayList) +#endif + #endif // GEO_COMMANDS_H diff --git a/include/sm64.h b/include/sm64.h index 4f405cb857..8884addb43 100644 --- a/include/sm64.h +++ b/include/sm64.h @@ -77,6 +77,29 @@ enum RenderLayers { LAYER_COUNT }; +#ifdef IA8_30FPS_COINS +#define BATCH_COIN_COUNT 8 +#else +#define BATCH_COIN_COUNT 4 +#endif + +enum BatchAlpha { +#if SILHOUETTE + BATCH_ALPHA_COUNT, +}; + +enum BatchSilhouetteAlpha { +#endif + BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST, + BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_LAST = BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + BATCH_COIN_COUNT - 1, + +#if SILHOUETTE + BATCH_OCCLUDE_SILHOUETTE_ALPHA_COUNT, +#else + BATCH_ALPHA_COUNT, +#endif +}; + enum BatchTransparentDecal { BATCH_TRANSPARENT_DECAL_SHADOW_CIRCLE, BATCH_TRANSPARENT_DECAL_SHADOW_SQUARE, diff --git a/src/engine/batch_list.c b/src/engine/batch_list.c index 5bc9743cc3..6247462f9a 100644 --- a/src/engine/batch_list.c +++ b/src/engine/batch_list.c @@ -1,5 +1,6 @@ #include "batch_list.h" +#include "actors/common1.h" #include "game/segment2.h" static const struct BatchDisplayLists DecalBatchesTransparent[] = { @@ -14,6 +15,34 @@ static const struct BatchDisplayLists DecalBatchesCLD[] = { }; STATIC_ASSERT(BATCH_CLD_COUNT == sizeof(DecalBatchesCLD) / sizeof(*DecalBatchesCLD), "Mismatch in CLD batch count"); +static const struct BatchDisplayLists BatchesAlpha[] = { +#if SILHOUETTE +}; +static const struct BatchDisplayLists BatchesOccludeSilhouetteAlpha[] = { +#endif + +#ifdef IA8_30FPS_COINS + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 0 ] = { coin_seg3_dl_0 , coin_seg3_dl_end }, + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 1 ] = { coin_seg3_dl_22_5 , coin_seg3_dl_end }, + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 2 ] = { coin_seg3_dl_45 , coin_seg3_dl_end }, + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 3 ] = { coin_seg3_dl_67_5 , coin_seg3_dl_end }, + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 4 ] = { coin_seg3_dl_90 , coin_seg3_dl_end }, + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 5 ] = { coin_seg3_dl_67_5_r , coin_seg3_dl_end }, + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 6 ] = { coin_seg3_dl_45_r , coin_seg3_dl_end }, + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 7 ] = { coin_seg3_dl_22_5_r , coin_seg3_dl_end }, +#else + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 0 ] = { coin_seg3_dl_front , coin_seg3_dl_end }, + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 1 ] = { coin_seg3_dl_tilt_right, coin_seg3_dl_end }, + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 2 ] = { coin_seg3_dl_side , coin_seg3_dl_end }, + [ BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + 3 ] = { coin_seg3_dl_tilt_left , coin_seg3_dl_end }, +#endif +}; + +STATIC_ASSERT(BATCH_ALPHA_COUNT == sizeof(BatchesAlpha) / sizeof(*BatchesAlpha), "Mismatch in alpha batch count"); +#if SILHOUETTE +STATIC_ASSERT(BATCH_OCCLUDE_SILHOUETTE_ALPHA_COUNT == sizeof(BatchesOccludeSilhouetteAlpha) / sizeof(*BatchesOccludeSilhouetteAlpha), "Mismatch in occlude silhouette alpha batch count"); +#endif + static inline struct BatchArray* batch_array_alloc(struct AllocOnlyPool *pool, int count, const struct BatchDisplayLists* dls) { struct BatchArray* batches = alloc_only_pool_alloc(pool, sizeof(struct BatchArray) + count * sizeof(struct DisplayListLinks)); batches->count = count; @@ -28,3 +57,13 @@ struct BatchArray* batch_list_objects_alloc_xlu_decal(struct AllocOnlyPool *pool struct BatchArray* batch_list_objects_alloc_cld(struct AllocOnlyPool *pool) { return batch_array_alloc(pool, BATCH_CLD_COUNT, DecalBatchesCLD); } + +struct BatchArray* batch_list_objects_alloc_alpha(struct AllocOnlyPool *pool) { + return batch_array_alloc(pool, BATCH_ALPHA_COUNT, BatchesAlpha); +} + +#if SILHOUETTE +struct BatchArray* batch_list_objects_alloc_occlude_silhouette_alpha(struct AllocOnlyPool *pool) { + return batch_array_alloc(pool, BATCH_OCCLUDE_SILHOUETTE_ALPHA_COUNT, BatchesOccludeSilhouetteAlpha); +} +#endif diff --git a/src/engine/batch_list.h b/src/engine/batch_list.h index 71fb18cd7c..a604070065 100644 --- a/src/engine/batch_list.h +++ b/src/engine/batch_list.h @@ -5,6 +5,8 @@ struct BatchArray* batch_list_objects_alloc_xlu_decal(struct AllocOnlyPool *pool); struct BatchArray* batch_list_objects_alloc_cld(struct AllocOnlyPool *pool); +struct BatchArray* batch_list_objects_alloc_alpha(struct AllocOnlyPool *pool); +struct BatchArray* batch_list_objects_alloc_occlude_silhouette_alpha(struct AllocOnlyPool *pool); static inline struct BatchArray* batch_list_objects_alloc(struct AllocOnlyPool *pool, enum RenderLayers layer) { switch (layer) { @@ -12,6 +14,12 @@ static inline struct BatchArray* batch_list_objects_alloc(struct AllocOnlyPool * return batch_list_objects_alloc_xlu_decal(pool); case LAYER_CLD: return batch_list_objects_alloc_cld(pool); + case LAYER_ALPHA: + return batch_list_objects_alloc_alpha(pool); +#if SILHOUETTE + case LAYER_OCCLUDE_SILHOUETTE_ALPHA: + return batch_list_objects_alloc_occlude_silhouette_alpha(pool); +#endif default: return 0; } diff --git a/src/engine/geo_layout.c b/src/engine/geo_layout.c index 3d81a5e657..1e66b83a88 100644 --- a/src/engine/geo_layout.c +++ b/src/engine/geo_layout.c @@ -43,6 +43,7 @@ GeoLayoutCommandProc GeoLayoutJumpTable[] = { /*GEO_CMD_NOP_1E */ geo_layout_cmd_nop2, /*GEO_CMD_NOP_1F */ geo_layout_cmd_nop3, /*GEO_CMD_NODE_CULLING_RADIUS */ geo_layout_cmd_node_culling_radius, + /*GEO_CMD_NODE_COIN */ geo_layout_cmd_node_coin, }; struct GraphNode gObjParentGraphNode; @@ -751,6 +752,21 @@ void geo_layout_cmd_node_culling_radius(void) { gGeoLayoutCommand += 0x04 << CMD_SIZE_SHIFT; } +void geo_layout_cmd_node_coin(void) { +#ifdef IA8_30FPS_COINS + void *displayList = cur_geo_cmd_ptr(0x04); + void *displayListR = cur_geo_cmd_ptr(0x08); + struct GraphNodeCoin *graphNode = init_graph_node_coin(gGraphNodePool, NULL, displayList, displayListR); + register_scene_graph_node(&graphNode->node); + gGeoLayoutCommand += 0x0C << CMD_SIZE_SHIFT; +#else + void *displayList = cur_geo_cmd_ptr(0x04); + struct GraphNodeCoin *graphNode = init_graph_node_coin(gGraphNodePool, NULL, displayList); + register_scene_graph_node(&graphNode->node); + gGeoLayoutCommand += 0x08 << CMD_SIZE_SHIFT; +#endif +} + struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr) { // set by register_scene_graph_node when gCurGraphNodeIndex is 0 // and gCurRootGraphNode is NULL diff --git a/src/engine/geo_layout.h b/src/engine/geo_layout.h index fdfb0bffa3..c97ffc2538 100644 --- a/src/engine/geo_layout.h +++ b/src/engine/geo_layout.h @@ -82,6 +82,7 @@ void geo_layout_cmd_nop(void); void geo_layout_cmd_copy_view(void); void geo_layout_cmd_node_held_obj(void); void geo_layout_cmd_node_culling_radius(void); +void geo_layout_cmd_node_coin(void); struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr); diff --git a/src/engine/graph_node.c b/src/engine/graph_node.c index 95796090fb..bba42e5e09 100644 --- a/src/engine/graph_node.c +++ b/src/engine/graph_node.c @@ -530,6 +530,28 @@ struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *po return graphNode; } +#ifdef IA8_30FPS_COINS +struct GraphNodeCoin *init_graph_node_coin(struct AllocOnlyPool *pool, struct GraphNodeCoin* graphNode, void *displayList, void *displayListR) +#else +struct GraphNodeCoin *init_graph_node_coin(struct AllocOnlyPool *pool, struct GraphNodeCoin* graphNode, void *displayList) +#endif +{ + if (pool != NULL) { + graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeCoin)); + } + + if (graphNode != NULL) { + init_scene_graph_node_links(&graphNode->node, GRAPH_NODE_TYPE_COIN); + SET_GRAPH_NODE_LAYER(graphNode->node.flags, LAYER_OCCLUDE_SILHOUETTE_ALPHA); + graphNode->displayList = displayList; +#ifdef IA8_30FPS_COINS + graphNode->displayListR = displayListR; +#endif + } + + return graphNode; +} + /** * Adds 'childNode' to the end of the list children from 'parent' */ diff --git a/src/engine/graph_node.h b/src/engine/graph_node.h index 5387703159..4eed507e72 100644 --- a/src/engine/graph_node.h +++ b/src/engine/graph_node.h @@ -65,6 +65,7 @@ enum GraphNodeTypes { GRAPH_NODE_TYPE_CULLING_RADIUS, GRAPH_NODE_TYPE_ROOT, GRAPH_NODE_TYPE_START, + GRAPH_NODE_TYPE_COIN, }; // Passed as first argument to a GraphNodeFunc to give information about in @@ -367,6 +368,14 @@ struct GraphNodeCullingRadius { // u8 filler[2]; }; +struct GraphNodeCoin { + struct GraphNode node; + void* displayList; +#ifdef IA8_30FPS_COINS + void* displayListR; +#endif +}; + extern struct GraphNodeMasterList *gCurGraphNodeMasterList; extern struct GraphNodePerspective *gCurGraphNodeCamFrustum; extern struct GraphNodeCamera *gCurGraphNodeCamera; @@ -403,6 +412,11 @@ struct GraphNodeObjectParent *init_graph_node_object_parent (struct struct GraphNodeGenerated *init_graph_node_generated (struct AllocOnlyPool *pool, struct GraphNodeGenerated *graphNode, GraphNodeFunc gfxFunc, s32 parameter); struct GraphNodeBackground *init_graph_node_background (struct AllocOnlyPool *pool, struct GraphNodeBackground *graphNode, u16 background, GraphNodeFunc backgroundFunc, s32 zero); struct GraphNodeHeldObject *init_graph_node_held_object (struct AllocOnlyPool *pool, struct GraphNodeHeldObject *graphNode, struct Object *objNode, Vec3s translation, GraphNodeFunc nodeFunc, s32 playerIndex); +#ifdef IA8_30FPS_COINS +struct GraphNodeCoin *init_graph_node_coin (struct AllocOnlyPool *pool, struct GraphNodeCoin *graphNode, void *displayList, void *displayListR); +#else +struct GraphNodeCoin *init_graph_node_coin (struct AllocOnlyPool *pool, struct GraphNodeCoin *graphNode, void *displayList); +#endif struct GraphNode *geo_add_child (struct GraphNode *parent, struct GraphNode *childNode); struct GraphNode *geo_remove_child (struct GraphNode *graphNode); diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c index 2f59482a3b..514e27d066 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c @@ -1478,34 +1478,42 @@ void shade_screen(void) { gDisplayListHead = dlHead; } -void print_animated_red_coin(s16 x, s16 y) { - s32 globalTimer = gGlobalTimer; - - create_dl_translation_matrix(MENU_MTX_PUSH, x, y, 0); - create_dl_scale_matrix(MENU_MTX_NOPUSH, 0.2f, 0.2f, 1.0f); - gDPSetRenderMode(gDisplayListHead++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2); - +static void print_animated_red_coin_start(void) { #ifdef IA8_30FPS_COINS - switch (globalTimer & 0x7) { - case 0: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_0 ); break; - case 1: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_22_5 ); break; - case 2: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_45 ); break; - case 3: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_67_5 ); break; - case 4: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_90 ); break; - case 5: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_67_5_r); break; - case 6: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_45_r ); break; - case 7: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_22_5_r); break; + switch (gGlobalTimer & 0x7) { + case 0: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_0 ); break; + case 1: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_22_5 ); break; + case 2: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_45 ); break; + case 3: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_67_5 ); break; + case 4: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_90 ); break; + case 5: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_67_5_r); break; + case 6: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_45_r ); break; + case 7: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_22_5_r); break; } #else - switch (globalTimer & 0x6) { - case 0: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_front ); break; - case 2: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_tilt_right); break; - case 4: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_side ); break; - case 6: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_red_tilt_left ); break; + switch (gGlobalTimer & 0x6) { + case 0: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_front ); break; + case 2: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_tilt_right); break; + case 4: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_side ); break; + case 6: gSPDisplayList(gDisplayListHead++, coin_seg3_dl_tilt_left ); break; } #endif + gDPSetRenderMode(gDisplayListHead++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2); +} +static void print_animated_red_coin_end(void) { + gSPDisplayList(gDisplayListHead++, coin_seg3_dl_end); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); +} + +static void print_animated_red_coin(s16 x, s16 y) { + create_dl_translation_matrix(MENU_MTX_PUSH, x, y, 0); + create_dl_scale_matrix(MENU_MTX_NOPUSH, 0.2f, 0.2f, 1.0f); +#ifdef IA8_30FPS_COINS + gSPDisplayList(gDisplayListHead++, (gGlobalTimer & 0x7) < 5 ? coin_seg3_sub_dl_red_draw : coin_seg3_sub_dl_red_draw_r); +#else + gSPDisplayList(gDisplayListHead++, coin_seg3_sub_dl_red_draw); +#endif gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); } @@ -1513,12 +1521,16 @@ void render_pause_red_coins(void) { s8 x; if (gRedCoinsCollected <= 9) { + print_animated_red_coin_start(); for (x = 0; x < gRedCoinsCollected; x++) { print_animated_red_coin(GFX_DIMENSIONS_FROM_RIGHT_EDGE(30) - x * 20, 16); } + print_animated_red_coin_end(); } else { + print_animated_red_coin_start(); print_animated_red_coin(GFX_DIMENSIONS_FROM_RIGHT_EDGE(108), 16); + print_animated_red_coin_end(); Mtx *mtx; mtx = alloc_display_list(sizeof(*mtx)); diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c index 64bf729973..baaa15e548 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -1253,6 +1253,22 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { } } +void geo_process_coin(struct GraphNodeCoin *node) { + int *panimState = &gCurGraphNodeObjectNode->oAnimState; + if (*panimState >= 8) + *panimState = 0; + + int frame = *panimState; +#ifdef IA8_30FPS_COINS + void* dl = frame < 5 ? node->displayList : node->displayListR; +#else + void* dl = node->displayList; + frame /= 2; +#endif + + geo_append_batched_display_list(dl, LAYER_OCCLUDE_SILHOUETTE_ALPHA, BATCH_OCCLUDE_SILHOUETTE_ALPHA_COIN_FIRST + frame); +} + /** * Processes the children of the given GraphNode if it has any */ @@ -1288,6 +1304,7 @@ static GeoProcessFunc GeoProcessJumpTable[] = { [GRAPH_NODE_TYPE_CULLING_RADIUS ] = geo_try_process_children, [GRAPH_NODE_TYPE_ROOT ] = geo_try_process_children, [GRAPH_NODE_TYPE_START ] = geo_try_process_children, + [GRAPH_NODE_TYPE_COIN ] = geo_process_coin, }; /**