From 2802d0e7a44d1367a0d488f405964755163f16e3 Mon Sep 17 00:00:00 2001 From: Sonicxryan <38291306+Sonicxryan@users.noreply.github.com> Date: Mon, 14 Mar 2022 00:32:27 +0000 Subject: [PATCH 1/2] Color metal textures based on palette (#26) --- actors/luigi/model.inc.c | 4 ++- actors/luigi_cap/model.inc.c | 12 +++---- actors/mario/model.inc.c | 50 ++++++++++++++--------------- actors/mario_cap/model.inc.c | 20 ++++++------ actors/toad_player/model.inc.c | 57 ++++++++++++++++++++++++++++++---- actors/waluigi/model.inc.c | 4 ++- actors/waluigi_cap/model.inc.c | 8 ++--- actors/wario/model.inc.c | 4 ++- actors/wario_cap/model.inc.c | 12 +++---- 9 files changed, 111 insertions(+), 60 deletions(-) diff --git a/actors/luigi/model.inc.c b/actors/luigi/model.inc.c index 6716c56a..40df0bbe 100644 --- a/actors/luigi/model.inc.c +++ b/actors/luigi/model.inc.c @@ -3233,7 +3233,7 @@ Gfx mat_luigi_body[] = { Gfx mat_luigi_metal[] = { gsDPPipeSync(), - gsDPSetCombineLERP(0, 0, 0, TEXEL0, 0, 0, 0, ENVIRONMENT, 0, 0, 0, TEXEL0, 0, 0, 0, ENVIRONMENT), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsSPSetGeometryMode(G_TEXTURE_GEN), gsSPTexture(4031, 1983, 0, 0, 1), gsDPTileSync(), @@ -3244,6 +3244,8 @@ Gfx mat_luigi_metal[] = { gsDPPipeSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, 0, G_TX_WRAP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPEndDisplayList(), }; diff --git a/actors/luigi_cap/model.inc.c b/actors/luigi_cap/model.inc.c index a46cdc2e..9ceb00e3 100644 --- a/actors/luigi_cap/model.inc.c +++ b/actors/luigi_cap/model.inc.c @@ -288,11 +288,11 @@ const Gfx luigi_cap_seg3_dl_03022F48[] = { const Gfx luigi_cap_seg3_dl_03022FF8[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), 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), - gsSPLight(&luigi_cap_seg3_lights_white.l, 1), - gsSPLight(&luigi_cap_seg3_lights_white.a, 2), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPDisplayList(luigi_cap_seg3_dl_03022B30), gsSPDisplayList(luigi_cap_seg3_dl_03022B68), gsSPDisplayList(luigi_cap_seg3_dl_03022CC8), @@ -382,7 +382,7 @@ const Gfx luigi_cap_seg3_dl_03023160[] = { const Gfx luigi_cap_seg3_dl_03023298[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, luigi_cap_seg3_texture_0301CF50), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 6, G_TX_NOLOD), gsDPLoadSync(), @@ -391,8 +391,8 @@ const Gfx luigi_cap_seg3_dl_03023298[] = { gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 6, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (64 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_ON), - gsSPLight(&luigi_cap_seg3_lights_white.l, 1), - gsSPLight(&luigi_cap_seg3_lights_white.a, 2), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPDisplayList(luigi_cap_seg3_dl_03022B30), gsSPDisplayList(luigi_cap_seg3_dl_03022B68), gsSPDisplayList(luigi_cap_seg3_dl_03022CC8), diff --git a/actors/mario/model.inc.c b/actors/mario/model.inc.c index a9591336..7f125f5f 100644 --- a/actors/mario/model.inc.c +++ b/actors/mario/model.inc.c @@ -37,99 +37,99 @@ static const Lights1 mario_brown2_lights_group = gdSPDefLights1( ); // 0x04000090 -ALIGNED8 static const Texture mario_texture_metal[] = { +ALIGNED8 static const u8 mario_texture_metal[] = { #include "actors/mario/mario_metal.rgba16.inc.c" }; // 0x04001090 -ALIGNED8 static const Texture mario_texture_yellow_button[] = { +ALIGNED8 static const u8 mario_texture_yellow_button[] = { #include "actors/mario/mario_overalls_button.rgba16.inc.c" }; // 0x04001890 -ALIGNED8 static const Texture mario_texture_m_logo[] = { +ALIGNED8 static const u8 mario_texture_m_logo[] = { #include "actors/mario/custom_mario_logo.rgba16.inc.c" }; // 0x04002090 -ALIGNED8 static const Texture mario_texture_hair_sideburn[] = { +ALIGNED8 static const u8 mario_texture_hair_sideburn[] = { #include "actors/mario/mario_sideburn.rgba16.inc.c" }; // 0x04002890 -ALIGNED8 static const Texture mario_texture_mustache[] = { +ALIGNED8 static const u8 mario_texture_mustache[] = { #include "actors/mario/mario_mustache.rgba16.inc.c" }; // 0x04003090 -ALIGNED8 static const Texture mario_texture_eyes_front[] = { +ALIGNED8 static const u8 mario_texture_eyes_front[] = { #include "actors/mario/mario_eyes_center.rgba16.inc.c" }; // 0x04003890 -ALIGNED8 static const Texture mario_texture_eyes_half_closed[] = { +ALIGNED8 static const u8 mario_texture_eyes_half_closed[] = { #include "actors/mario/mario_eyes_half_closed.rgba16.inc.c" }; // 0x04004090 -ALIGNED8 static const Texture mario_texture_eyes_closed[] = { +ALIGNED8 static const u8 mario_texture_eyes_closed[] = { #include "actors/mario/mario_eyes_closed.rgba16.inc.c" }; // Unreferenced // 0x04004890 -ALIGNED8 static const Texture mario_texture_eyes_closed_unused1[] = { +ALIGNED8 static const u8 mario_texture_eyes_closed_unused1[] = { #include "actors/mario/mario_eyes_closed_unused_0.rgba16.inc.c" }; // Unreferenced // 0x04005090 -ALIGNED8 static const Texture mario_texture_eyes_closed_unused2[] = { +ALIGNED8 static const u8 mario_texture_eyes_closed_unused2[] = { #include "actors/mario/mario_eyes_closed_unused_1.rgba16.inc.c" }; // 0x04005890 -ALIGNED8 static const Texture mario_texture_eyes_right[] = { +ALIGNED8 static const u8 mario_texture_eyes_right[] = { #include "actors/mario/mario_eyes_left_unused.rgba16.inc.c" }; // 0x04006090 -ALIGNED8 static const Texture mario_texture_eyes_left[] = { +ALIGNED8 static const u8 mario_texture_eyes_left[] = { #include "actors/mario/mario_eyes_right_unused.rgba16.inc.c" }; // 0x04006890 -ALIGNED8 static const Texture mario_texture_eyes_up[] = { +ALIGNED8 static const u8 mario_texture_eyes_up[] = { #include "actors/mario/mario_eyes_up_unused.rgba16.inc.c" }; // 0x04007090 -ALIGNED8 static const Texture mario_texture_eyes_down[] = { +ALIGNED8 static const u8 mario_texture_eyes_down[] = { #include "actors/mario/mario_eyes_down_unused.rgba16.inc.c" }; // 0x04007890 -ALIGNED8 static const Texture mario_texture_eyes_dead[] = { +ALIGNED8 static const u8 mario_texture_eyes_dead[] = { #include "actors/mario/mario_eyes_dead.rgba16.inc.c" }; // 0x04008090 -ALIGNED8 static const Texture mario_texture_wings_half_1[] = { +ALIGNED8 static const u8 mario_texture_wings_half_1[] = { #include "actors/mario/mario_wing.rgba16.inc.c" }; // 0x04009090 -ALIGNED8 static const Texture mario_texture_wings_half_2[] = { +ALIGNED8 static const u8 mario_texture_wings_half_2[] = { #include "actors/mario/mario_wing_tip.rgba16.inc.c" }; // 0x0400A090 -ALIGNED8 static const Texture mario_texture_metal_wings_half_1[] = { +ALIGNED8 static const u8 mario_texture_metal_wings_half_1[] = { #include "actors/mario/mario_metal_wing_unused.rgba16.inc.c" }; // 0x0400B090 -ALIGNED8 static const Texture mario_texture_metal_wings_half_2[] = { +ALIGNED8 static const u8 mario_texture_metal_wings_half_2[] = { #include "actors/mario/mario_metal_wing_tip_unused.rgba16.inc.c" }; @@ -391,11 +391,11 @@ const Gfx mario_butt[] = { const Gfx mario_metal_butt[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_DECALFADE, G_CC_DECALFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsDPLoadTextureBlock(mario_texture_metal, 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), - gsSPLight(&mario_white_lights_group.l, 1), - gsSPLight(&mario_white_lights_group.a, 2), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPDisplayList(mario_butt_dl), gsSPEndDisplayList(), }; @@ -989,11 +989,11 @@ const Gfx mario_left_thigh[] = { const Gfx mario_metal_left_thigh[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_DECALFADE, G_CC_DECALFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsDPLoadTextureBlock(mario_texture_metal, 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), - gsSPLight(&mario_white_lights_group.l, 1), - gsSPLight(&mario_white_lights_group.a, 2), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPDisplayList(mario_left_thigh_dl), gsSPEndDisplayList(), }; diff --git a/actors/mario_cap/model.inc.c b/actors/mario_cap/model.inc.c index 78fe8a39..78542c79 100644 --- a/actors/mario_cap/model.inc.c +++ b/actors/mario_cap/model.inc.c @@ -19,32 +19,32 @@ static const Lights1 mario_cap_seg3_lights_0301CF38 = gdSPDefLights1( ); // 0x0301CF50 -ALIGNED8 static const Texture mario_cap_seg3_texture_0301CF50[] = { +ALIGNED8 static const u8 mario_cap_seg3_texture_0301CF50[] = { #include "actors/mario_cap/mario_cap_metal.rgba16.inc.c" }; // 0x0301DF50 -ALIGNED8 static const Texture mario_cap_seg3_texture_0301DF50[] = { +ALIGNED8 static const u8 mario_cap_seg3_texture_0301DF50[] = { #include "actors/mario_cap/custom_mario_cap_logo.rgba16.inc.c" }; // 0x0301E750 -ALIGNED8 static const Texture mario_cap_seg3_texture_0301E750[] = { +ALIGNED8 static const u8 mario_cap_seg3_texture_0301E750[] = { #include "actors/mario_cap/mario_cap_wing.rgba16.inc.c" }; // 0x0301F750 -ALIGNED8 static const Texture mario_cap_seg3_texture_0301F750[] = { +ALIGNED8 static const u8 mario_cap_seg3_texture_0301F750[] = { #include "actors/mario_cap/mario_cap_wing_tip.rgba16.inc.c" }; // 0x03020750 -ALIGNED8 static const Texture mario_cap_seg3_texture_03020750[] = { +ALIGNED8 static const u8 mario_cap_seg3_texture_03020750[] = { #include "actors/mario_cap/mario_cap_metal_wing_unused.rgba16.inc.c" }; // 0x03021750 -ALIGNED8 static const Texture mario_cap_seg3_texture_03021750[] = { +ALIGNED8 static const u8 mario_cap_seg3_texture_03021750[] = { #include "actors/mario_cap/mario_cap_metal_wing_tip_unused.rgba16.inc.c" }; @@ -282,11 +282,11 @@ const Gfx mario_cap_seg3_dl_03022F48[] = { const Gfx mario_cap_seg3_dl_03022FF8[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), 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), - gsSPLight(&mario_cap_seg3_lights_0301CF20.l, 1), - gsSPLight(&mario_cap_seg3_lights_0301CF20.a, 2), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPDisplayList(mario_cap_seg3_dl_03022B30), gsSPDisplayList(mario_cap_seg3_dl_03022B68), gsSPDisplayList(mario_cap_seg3_dl_03022CC8), @@ -376,7 +376,7 @@ const Gfx mario_cap_seg3_dl_03023160[] = { const Gfx mario_cap_seg3_dl_03023298[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, mario_cap_seg3_texture_0301CF50), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 6, G_TX_NOLOD), gsDPLoadSync(), diff --git a/actors/toad_player/model.inc.c b/actors/toad_player/model.inc.c index e11a7139..8d6eb5ba 100644 --- a/actors/toad_player/model.inc.c +++ b/actors/toad_player/model.inc.c @@ -14,18 +14,22 @@ ALIGNED8 static const u8 toad_player_texture_metal[] = { const Gfx toad_player_metal_start[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_DECALFADE, G_CC_DECALFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsDPLoadTextureBlock(toad_player_texture_metal, 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), - gsSPLight(&toad_player_lights_white.l, 1), - gsSPLight(&toad_player_lights_white.a, 2), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPEndDisplayList(), }; const Gfx toad_player_metal_stop[] = { gsDPPipeSync(), gsSPClearGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_OFF), gsDPSetEnvColor(255, 255, 255, 255), gsDPSetAlphaCompare(G_AC_NONE), @@ -1067,6 +1071,38 @@ const Gfx toad_player_dl_body_inner[] = { gsSPEndDisplayList(), }; +const Gfx toad_player_metal_dl_body_inner[] = { + gsSPVertex(toad_player_vertex_body_1, 14, 0), + gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), + gsSP2Triangles( 3, 5, 6, 0x0, 3, 6, 7, 0x0), + gsSP2Triangles( 7, 8, 3, 0x0, 3, 9, 4, 0x0), + gsSP2Triangles( 3, 8, 9, 0x0, 10, 7, 6, 0x0), + gsSP2Triangles(10, 6, 11, 0x0, 11, 6, 5, 0x0), + gsSP2Triangles( 7, 0, 8, 0x0, 0, 7, 10, 0x0), + gsSP2Triangles( 2, 12, 13, 0x0, 2, 1, 12, 0x0), + gsSP2Triangles( 2, 8, 0, 0x0, 2, 13, 9, 0x0), + gsSP1Triangle( 2, 9, 8, 0x0), + gsSPVertex(toad_player_vertex_body_2, 12, 0), + gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), + gsSP2Triangles( 3, 5, 6, 0x0, 7, 8, 1, 0x0), + gsSP2Triangles( 7, 1, 9, 0x0, 7, 10, 8, 0x0), + gsSP2Triangles( 7, 9, 4, 0x0, 5, 4, 9, 0x0), + gsSP2Triangles( 5, 9, 0, 0x0, 0, 9, 1, 0x0), + gsSP2Triangles(11, 6, 0, 0x0, 11, 0, 2, 0x0), + gsSP1Triangle( 0, 6, 5, 0x0), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), + gsSPVertex(toad_player_vertex_body_3, 12, 0), + gsSP2Triangles( 0, 1, 2, 0x0, 2, 3, 0, 0x0), + gsSP2Triangles( 4, 2, 1, 0x0, 4, 1, 5, 0x0), + gsSP2Triangles( 6, 7, 2, 0x0, 6, 2, 4, 0x0), + gsSP2Triangles( 2, 7, 3, 0x0, 5, 8, 4, 0x0), + gsSP2Triangles( 6, 8, 9, 0x0, 6, 4, 8, 0x0), + gsSP2Triangles(10, 3, 7, 0x0, 7, 11, 10, 0x0), + gsSP2Triangles( 7, 6, 11, 0x0, 9, 11, 6, 0x0), + gsSPEndDisplayList(), +}; + const Gfx toad_player_dl_body[] = { gsDPPipeSync(), gsDPSetCombineMode(G_CC_SHADEFADEA, G_CC_SHADEFADEA), @@ -1080,8 +1116,13 @@ const Gfx toad_player_dl_body[] = { }; const Gfx toad_player_metal_dl_body[] = { - gsSPDisplayList(toad_player_dl_body_inner), + gsSPDisplayList(toad_player_metal_dl_body_inner), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), + gsSPDisplayList(toad_player_dl_jacket_inner), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPEndDisplayList(), }; @@ -1383,9 +1424,13 @@ const Gfx toad_player_dl_foot_right_metal[] = { gsSPDisplayList(toad_player_dl_foot_right_inner), gsDPPipeSync(), gsSPClearGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_OFF), gsDPSetEnvColor(255, 255, 255, 255), gsDPSetAlphaCompare(G_AC_NONE), + + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), + gsSPEndDisplayList(), }; diff --git a/actors/waluigi/model.inc.c b/actors/waluigi/model.inc.c index 642fa4f9..d5444882 100644 --- a/actors/waluigi/model.inc.c +++ b/actors/waluigi/model.inc.c @@ -3473,7 +3473,7 @@ Gfx mat_waluigi_body_v3[] = { Gfx mat_waluigi_metal_v3[] = { gsDPPipeSync(), - gsDPSetCombineLERP(0, 0, 0, TEXEL0, 0, 0, 0, ENVIRONMENT, 0, 0, 0, TEXEL0, 0, 0, 0, ENVIRONMENT), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsSPSetGeometryMode(G_TEXTURE_GEN), gsSPTexture(4031, 1983, 0, 0, 1), gsDPTileSync(), @@ -3484,6 +3484,8 @@ Gfx mat_waluigi_metal_v3[] = { gsDPPipeSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, 0, G_TX_WRAP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPEndDisplayList(), }; diff --git a/actors/waluigi_cap/model.inc.c b/actors/waluigi_cap/model.inc.c index d642254a..fd340faf 100644 --- a/actors/waluigi_cap/model.inc.c +++ b/actors/waluigi_cap/model.inc.c @@ -282,11 +282,11 @@ const Gfx waluigi_cap_seg3_dl_03022F48[] = { const Gfx waluigi_cap_seg3_dl_03022FF8[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsDPLoadTextureBlock(waluigi_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), - gsSPLight(&waluigi_cap_seg3_lights_0301CF20.l, 1), - gsSPLight(&waluigi_cap_seg3_lights_0301CF20.a, 2), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPDisplayList(waluigi_cap_seg3_dl_03022B30), gsSPDisplayList(waluigi_cap_seg3_dl_03022B68), gsSPDisplayList(waluigi_cap_seg3_dl_03022CC8), @@ -376,7 +376,7 @@ const Gfx waluigi_cap_seg3_dl_03023160[] = { const Gfx waluigi_cap_seg3_dl_03023298[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, waluigi_cap_seg3_texture_0301CF50), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 6, G_TX_NOLOD), gsDPLoadSync(), diff --git a/actors/wario/model.inc.c b/actors/wario/model.inc.c index 619f0fd3..d136fc20 100644 --- a/actors/wario/model.inc.c +++ b/actors/wario/model.inc.c @@ -3422,7 +3422,7 @@ Gfx mat_wario_overalls[] = { Gfx mat_wario_metal[] = { gsDPPipeSync(), - gsDPSetCombineLERP(0, 0, 0, TEXEL0, 0, 0, 0, ENVIRONMENT, 0, 0, 0, TEXEL0, 0, 0, 0, ENVIRONMENT), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsSPSetGeometryMode(G_TEXTURE_GEN), gsSPTexture(4031, 1983, 0, 0, 1), gsDPTileSync(), @@ -3433,6 +3433,8 @@ Gfx mat_wario_metal[] = { gsDPPipeSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, 0, G_TX_WRAP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPEndDisplayList(), }; diff --git a/actors/wario_cap/model.inc.c b/actors/wario_cap/model.inc.c index 1a8a88f7..500070b6 100644 --- a/actors/wario_cap/model.inc.c +++ b/actors/wario_cap/model.inc.c @@ -288,11 +288,11 @@ const Gfx wario_cap_seg3_dl_03022F48[] = { const Gfx wario_cap_seg3_dl_03022FF8[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsDPLoadTextureBlock(wario_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), - gsSPLight(&wario_cap_seg3_lights_white.l, 1), - gsSPLight(&wario_cap_seg3_lights_white.a, 2), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPDisplayList(wario_cap_seg3_dl_03022B30), gsSPDisplayList(wario_cap_seg3_dl_03022B68), gsSPDisplayList(wario_cap_seg3_dl_03022CC8), @@ -382,7 +382,7 @@ const Gfx wario_cap_seg3_dl_03023160[] = { const Gfx wario_cap_seg3_dl_03023298[] = { gsDPPipeSync(), gsSPSetGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT, TEXEL0, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, wario_cap_seg3_texture_0301CF50), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 6, G_TX_NOLOD), gsDPLoadSync(), @@ -391,8 +391,8 @@ const Gfx wario_cap_seg3_dl_03023298[] = { gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 6, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (64 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_ON), - gsSPLight(&wario_cap_seg3_lights_white.l, 1), - gsSPLight(&wario_cap_seg3_lights_white.a, 2), + gsSPCopyLightEXT(1, 5), + gsSPCopyLightEXT(2, 6), gsSPDisplayList(wario_cap_seg3_dl_03022B30), gsSPDisplayList(wario_cap_seg3_dl_03022B68), gsSPDisplayList(wario_cap_seg3_dl_03022CC8), From 1ed29175d641e230cf09ea93734bc16cd1f65311 Mon Sep 17 00:00:00 2001 From: Isaac <62234577+Isaac0-dev@users.noreply.github.com> Date: Mon, 14 Mar 2022 11:09:57 +1000 Subject: [PATCH 2/2] Allowed DynOS Packs to be placed in %appdata%/sm64ex-coop (#27) --- data/dynos_gfx_init.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/data/dynos_gfx_init.cpp b/data/dynos_gfx_init.cpp index 4f758cc2..53a8c1be 100644 --- a/data/dynos_gfx_init.cpp +++ b/data/dynos_gfx_init.cpp @@ -70,5 +70,46 @@ Array DynOS_Gfx_Init() { SysPath _DirName = _Pack->mPath.substr(MAX(_DirSep1, _DirSep2)); _PackNames.Add(_DirName.c_str()); } + +#ifdef COOP + Array &pDynosUserPacks = DynOS_Gfx_GetPacks(); + SysPath _DynosPacksUserFolder = fstring("%s/%s", DYNOS_USER_FOLDER, DYNOS_PACKS_FOLDER); + DIR *_DynosPacksUserDir = opendir(_DynosPacksUserFolder.c_str()); + if (_DynosPacksUserDir) { + struct dirent *_DynosPacksUserEnt = NULL; + while ((_DynosPacksUserEnt = readdir(_DynosPacksUserDir)) != NULL) { + + // Skip . and .. + if (SysPath(_DynosPacksUserEnt->d_name) == ".") continue; + if (SysPath(_DynosPacksUserEnt->d_name) == "..") continue; + + // If pack folder exists, add it to the pack list + SysPath _PackFolder = fstring("%s/%s", _DynosPacksUserFolder.c_str(), _DynosPacksUserEnt->d_name); + if (fs_sys_dir_exists(_PackFolder.c_str())) { + PackData *_Pack = New(); + + // Scan folder for subfolders to convert into .bin files + _Pack->mPath = _PackFolder; + DynOS_Gfx_GeneratePack(_PackFolder); + + // Add pack to pack list + pDynosPacks.Add(_Pack); + + // Add enabled flag + DynOS_Gfx_GetPacksEnabled().Add(true); + + } + } + closedir(_DynosPacksUserDir); + } + for (const auto& _Pack : pDynosUserPacks) { + u64 _DirSep1 = _Pack->mPath.find_last_of('\\'); + u64 _DirSep2 = _Pack->mPath.find_last_of('/'); + if (_DirSep1++ == SysPath::npos) _DirSep1 = 0; + if (_DirSep2++ == SysPath::npos) _DirSep2 = 0; + SysPath _DirName = _Pack->mPath.substr(MAX(_DirSep1, _DirSep2)); + _PackNames.Add(_DirName.c_str()); + } +#endif return _PackNames; }