From d772764c4e13cfd29203b6cd0813f35f87bf4386 Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 9 Aug 2021 23:39:29 -0700 Subject: [PATCH] Fixed cap-on-ground colorization behavior --- actors/luigi_cap/geo.inc.c | 8 ++++---- actors/luigi_cap/model.inc.c | 4 ++-- actors/mario_cap/geo.inc.c | 8 ++++---- actors/mario_cap/model.inc.c | 4 ++-- src/game/behaviors/exclamation_box.inc.c | 1 + src/game/mario_misc.c | 11 +++++++++-- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/actors/luigi_cap/geo.inc.c b/actors/luigi_cap/geo.inc.c index 58cfad09..890280b8 100644 --- a/actors/luigi_cap/geo.inc.c +++ b/actors/luigi_cap/geo.inc.c @@ -4,7 +4,7 @@ const GeoLayout luigis_cap_geo[] = { GEO_OPEN_NODE(), GEO_SCALE(0x00, 16384), GEO_OPEN_NODE(), - GEO_ASM(0, geo_mario_set_player_colors), + GEO_ASM(1, geo_mario_set_player_colors), GEO_ASM(10, geo_update_layer_transparency), GEO_SWITCH_CASE(2, geo_switch_anim_state), GEO_OPEN_NODE(), @@ -22,7 +22,7 @@ const GeoLayout luigis_metal_cap_geo[] = { GEO_OPEN_NODE(), GEO_SCALE(0x00, 16384), GEO_OPEN_NODE(), - GEO_ASM(0, geo_mario_set_player_colors), + GEO_ASM(1, geo_mario_set_player_colors), GEO_ASM(10, geo_update_layer_transparency), GEO_SWITCH_CASE(2, geo_switch_anim_state), GEO_OPEN_NODE(), @@ -40,7 +40,7 @@ const GeoLayout luigis_wing_cap_geo[] = { GEO_OPEN_NODE(), GEO_SCALE(0x00, 16384), GEO_OPEN_NODE(), - GEO_ASM(0, geo_mario_set_player_colors), + GEO_ASM(1, geo_mario_set_player_colors), GEO_ASM(10, geo_update_layer_transparency), GEO_SWITCH_CASE(2, geo_switch_anim_state), GEO_OPEN_NODE(), @@ -65,7 +65,7 @@ const GeoLayout luigis_winged_metal_cap_geo[] = { GEO_OPEN_NODE(), GEO_SCALE(0x00, 16384), GEO_OPEN_NODE(), - GEO_ASM(0, geo_mario_set_player_colors), + GEO_ASM(1, geo_mario_set_player_colors), GEO_ASM(10, geo_update_layer_transparency), GEO_SWITCH_CASE(2, geo_switch_anim_state), GEO_OPEN_NODE(), diff --git a/actors/luigi_cap/model.inc.c b/actors/luigi_cap/model.inc.c index d27d761a..a9fa4c63 100644 --- a/actors/luigi_cap/model.inc.c +++ b/actors/luigi_cap/model.inc.c @@ -285,8 +285,8 @@ const Gfx luigi_cap_seg3_dl_03022FF8[] = { gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), gsDPLoadTextureBlock(luigi_cap_seg3_texture_0301CF50, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_ON), - gsSPCopyLightEXT(1, 5), //gsSPLight(&luigi_cap_seg3_lights_0301CF20.l, 1), - gsSPCopyLightEXT(2, 6), //gsSPLight(&luigi_cap_seg3_lights_0301CF20.a, 2), + gsSPLight(&luigi_cap_seg3_lights_0301CF20.l, 1), + gsSPLight(&luigi_cap_seg3_lights_0301CF20.a, 2), gsSPDisplayList(luigi_cap_seg3_dl_03022B30), gsSPDisplayList(luigi_cap_seg3_dl_03022B68), gsSPDisplayList(luigi_cap_seg3_dl_03022CC8), diff --git a/actors/mario_cap/geo.inc.c b/actors/mario_cap/geo.inc.c index 1167b500..f19ba481 100644 --- a/actors/mario_cap/geo.inc.c +++ b/actors/mario_cap/geo.inc.c @@ -4,7 +4,7 @@ const GeoLayout marios_cap_geo[] = { GEO_OPEN_NODE(), GEO_SCALE(0x00, 16384), GEO_OPEN_NODE(), - GEO_ASM(0, geo_mario_set_player_colors), + GEO_ASM(1, geo_mario_set_player_colors), GEO_ASM(10, geo_update_layer_transparency), GEO_SWITCH_CASE(2, geo_switch_anim_state), GEO_OPEN_NODE(), @@ -22,7 +22,7 @@ const GeoLayout marios_metal_cap_geo[] = { GEO_OPEN_NODE(), GEO_SCALE(0x00, 16384), GEO_OPEN_NODE(), - GEO_ASM(0, geo_mario_set_player_colors), + GEO_ASM(1, geo_mario_set_player_colors), GEO_ASM(10, geo_update_layer_transparency), GEO_SWITCH_CASE(2, geo_switch_anim_state), GEO_OPEN_NODE(), @@ -40,7 +40,7 @@ const GeoLayout marios_wing_cap_geo[] = { GEO_OPEN_NODE(), GEO_SCALE(0x00, 16384), GEO_OPEN_NODE(), - GEO_ASM(0, geo_mario_set_player_colors), + GEO_ASM(1, geo_mario_set_player_colors), GEO_ASM(10, geo_update_layer_transparency), GEO_SWITCH_CASE(2, geo_switch_anim_state), GEO_OPEN_NODE(), @@ -65,7 +65,7 @@ const GeoLayout marios_winged_metal_cap_geo[] = { GEO_OPEN_NODE(), GEO_SCALE(0x00, 16384), GEO_OPEN_NODE(), - GEO_ASM(0, geo_mario_set_player_colors), + GEO_ASM(1, geo_mario_set_player_colors), GEO_ASM(10, geo_update_layer_transparency), GEO_SWITCH_CASE(2, geo_switch_anim_state), GEO_OPEN_NODE(), diff --git a/actors/mario_cap/model.inc.c b/actors/mario_cap/model.inc.c index 65ac89f2..3a2e964a 100644 --- a/actors/mario_cap/model.inc.c +++ b/actors/mario_cap/model.inc.c @@ -285,8 +285,8 @@ const Gfx mario_cap_seg3_dl_03022FF8[] = { gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), gsDPLoadTextureBlock(mario_cap_seg3_texture_0301CF50, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 32, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 6, 5, G_TX_NOLOD, G_TX_NOLOD), gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_ON), - gsSPCopyLightEXT(1, 5), //gsSPLight(&mario_cap_seg3_lights_0301CF20.l, 1), - gsSPCopyLightEXT(2, 6), //gsSPLight(&mario_cap_seg3_lights_0301CF20.a, 2), + gsSPLight(&mario_cap_seg3_lights_0301CF20.l, 1), + gsSPLight(&mario_cap_seg3_lights_0301CF20.a, 2), gsSPDisplayList(mario_cap_seg3_dl_03022B30), gsSPDisplayList(mario_cap_seg3_dl_03022B68), gsSPDisplayList(mario_cap_seg3_dl_03022CC8), diff --git a/src/game/behaviors/exclamation_box.inc.c b/src/game/behaviors/exclamation_box.inc.c index 81675e58..15c61c3f 100644 --- a/src/game/behaviors/exclamation_box.inc.c +++ b/src/game/behaviors/exclamation_box.inc.c @@ -126,6 +126,7 @@ void exclamation_box_spawn_contents(struct Struct802C0DF0 *a0, u8 a1) { sp1C->oVelY = 20.0f; sp1C->oForwardVel = 3.0f; sp1C->oMoveAngleYaw = player->oMoveAngleYaw; + sp1C->globalPlayerIndex = player->globalPlayerIndex; o->oBehParams |= a0->unk2 << 24; if (a0->model == 122) o->oFlags |= 0x4000; diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c index a9d6a700..9705466b 100644 --- a/src/game/mario_misc.c +++ b/src/game/mario_misc.c @@ -819,8 +819,15 @@ Gfx* geo_mario_set_player_colors(s32 callContext, struct GraphNode* node, UNUSED gSPLight(gfx + 2, &gPlayerColors[colorIndex].shirt.l, 5); gSPLight(gfx + 3, &gPlayerColors[colorIndex].shirt.a, 6); gSPEndDisplayList(gfx + 4); - // put on transparent layer if vanish effect, opaque otherwise - const u32 layer = ((bodyState->modelState >> 8) & 1) ? LAYER_TRANSPARENT : LAYER_OPAQUE; + u32 layer = LAYER_OPAQUE; + if (asGenerated->parameter == 1) { + layer = LAYER_OPAQUE; + } else if (asGenerated->parameter == 2) { + layer = LAYER_TRANSPARENT; + } else { + // put on transparent layer if vanish effect, opaque otherwise + layer = ((bodyState->modelState >> 8) & 1) ? LAYER_TRANSPARENT : LAYER_OPAQUE; + } asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & 0xFF) | (layer << 8); } return gfx;