From 406959e56843814966ff9e58a16364c58a4c6ad5 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 26 Nov 2023 17:30:32 -0800 Subject: [PATCH] Make all player models reset texture2 --- actors/toad_player/model.inc.c | 29 ++++++++++++++------ actors/waluigi/model.inc.c | 48 +++++++++++++++++++++------------- actors/wario/geo.inc.c | 3 +++ actors/wario/geo_header.h | 3 ++- actors/wario/model.inc.c | 24 +++++++++++++++++ src/pc/gfx/gfx_pc.c | 2 ++ 6 files changed, 82 insertions(+), 27 deletions(-) diff --git a/actors/toad_player/model.inc.c b/actors/toad_player/model.inc.c index f07226fa..251dd070 100644 --- a/actors/toad_player/model.inc.c +++ b/actors/toad_player/model.inc.c @@ -2796,13 +2796,26 @@ Gfx toad_Right_Shoe_DL_mesh_layer_1_mat_override_metal_0[] = { }; Gfx toad_material_revert_render_settings[] = { - gsDPPipeSync(), - gsSPSetGeometryMode(G_LIGHTING), - gsSPClearGeometryMode(G_TEXTURE_GEN), - gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT), - gsSPTexture(65535, 65535, 0, 0, 0), - gsDPSetEnvColor(255, 255, 255, 255), - gsDPSetAlphaCompare(G_AC_NONE), - gsSPEndDisplayList(), + gsDPPipeSync(), + gsSPSetGeometryMode(G_LIGHTING), + gsSPClearGeometryMode(G_TEXTURE_GEN), + gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT), + gsSPTexture(65535, 65535, 0, 0, 0), + gsDPSetEnvColor(255, 255, 255, 255), + gsDPSetAlphaCompare(G_AC_NONE), + + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 1, 0), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 0, 0, 7, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0), + gsDPLoadBlock(7, 0, 0, 1023, 256), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0), + gsDPSetTileSize(0, 0, 0, 124, 124), + + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 1, 0), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 0, 256, 6, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0), + gsDPLoadBlock(6, 0, 0, 1023, 256), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 256, 1, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0), + gsDPSetTileSize(1, 0, 0, 124, 124), + + gsSPEndDisplayList(), }; diff --git a/actors/waluigi/model.inc.c b/actors/waluigi/model.inc.c index 972aee29..1c17d3ff 100644 --- a/actors/waluigi/model.inc.c +++ b/actors/waluigi/model.inc.c @@ -4738,7 +4738,7 @@ Gfx mat_waluigi_body[] = { gsDPLoadBlock(7, 0, 0, 1023, 256), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, 0), gsDPSetTileSize(0, 0, 0, 124, 124), - gsSPCopyLightsPlayerPart(PANTS), + gsSPCopyLightsPlayerPart(PANTS), gsSPEndDisplayList(), }; @@ -4752,7 +4752,7 @@ Gfx mat_waluigi_metal[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), 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), - gsSPCopyLightsPlayerPart(METAL), + gsSPCopyLightsPlayerPart(METAL), gsSPEndDisplayList(), }; @@ -4766,7 +4766,7 @@ Gfx mat_waluigi_shirt[] = { gsDPPipeSync(), gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT), gsSPTexture(65535, 65535, 0, 0, 1), - gsSPCopyLightsPlayerPart(SHIRT), + gsSPCopyLightsPlayerPart(SHIRT), gsSPEndDisplayList(), }; @@ -4774,7 +4774,7 @@ Gfx mat_waluigi_cap[] = { gsDPPipeSync(), gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT), gsSPTexture(65535, 65535, 0, 0, 1), - gsSPCopyLightsPlayerPart(CAP), + gsSPCopyLightsPlayerPart(CAP), gsSPEndDisplayList(), }; @@ -4787,7 +4787,7 @@ Gfx mat_waluigi_eyes_open[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), 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), - gsSPCopyLightsPlayerPart(SKIN), + gsSPCopyLightsPlayerPart(SKIN), gsSPEndDisplayList(), }; @@ -4795,7 +4795,7 @@ Gfx mat_waluigi_hair[] = { gsDPPipeSync(), gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT), gsSPTexture(65535, 65535, 0, 0, 1), - gsSPCopyLightsPlayerPart(HAIR), + gsSPCopyLightsPlayerPart(HAIR), gsSPEndDisplayList(), }; @@ -4816,7 +4816,7 @@ Gfx mat_waluigi_mouth_closed[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), - gsSPCopyLightsPlayerPart(SKIN), + gsSPCopyLightsPlayerPart(SKIN), gsSPEndDisplayList(), }; @@ -4845,7 +4845,7 @@ Gfx mat_waluigi_sideburns[] = { gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0), gsDPSetTileSize(0, 0, 0, 124, 124), gsDPSetPrimColor(0, 0, 255, 255, 255, 255), - gsSPCopyLightsPlayerPart(HAIR), + gsSPCopyLightsPlayerPart(HAIR), gsSPEndDisplayList(), }; @@ -4900,7 +4900,7 @@ Gfx mat_waluigi_eyes_half[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), - gsSPCopyLightsPlayerPart(SKIN), + gsSPCopyLightsPlayerPart(SKIN), gsSPEndDisplayList(), }; @@ -4913,7 +4913,7 @@ Gfx mat_waluigi_eyes_closed[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), - gsSPCopyLightsPlayerPart(SKIN), + gsSPCopyLightsPlayerPart(SKIN), gsSPEndDisplayList(), }; @@ -4926,7 +4926,7 @@ Gfx mat_waluigi_eyes_left[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), - gsSPCopyLightsPlayerPart(SKIN), + gsSPCopyLightsPlayerPart(SKIN), gsSPEndDisplayList(), }; @@ -4939,7 +4939,7 @@ Gfx mat_waluigi_eyes_right[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), - gsSPCopyLightsPlayerPart(SKIN), + gsSPCopyLightsPlayerPart(SKIN), gsSPEndDisplayList(), }; @@ -4952,7 +4952,7 @@ Gfx mat_waluigi_eyes_up[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), - gsSPCopyLightsPlayerPart(SKIN), + gsSPCopyLightsPlayerPart(SKIN), gsSPEndDisplayList(), }; @@ -4965,7 +4965,7 @@ Gfx mat_waluigi_eyes_down[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), - gsSPCopyLightsPlayerPart(SKIN), + gsSPCopyLightsPlayerPart(SKIN), gsSPEndDisplayList(), }; @@ -4978,7 +4978,7 @@ Gfx mat_waluigi_waluigi_mouth_open[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), - gsSPCopyLightsPlayerPart(SKIN), + gsSPCopyLightsPlayerPart(SKIN), gsSPEndDisplayList(), }; @@ -4991,7 +4991,7 @@ Gfx mat_waluigi_eyes_dead[] = { gsDPLoadBlock(7, 0, 0, 2047, 128), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 16, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 6, 0), gsDPSetTileSize(0, 0, 0, 252, 124), - gsSPCopyLightsPlayerPart(SKIN), + gsSPCopyLightsPlayerPart(SKIN), gsSPEndDisplayList(), }; @@ -5037,7 +5037,7 @@ Gfx mat_waluigi_gloves[] = { gsDPPipeSync(), gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT), gsSPTexture(65535, 65535, 0, 0, 1), - gsSPCopyLightsPlayerPart(GLOVES), + gsSPCopyLightsPlayerPart(GLOVES), gsSPEndDisplayList(), }; @@ -5045,7 +5045,7 @@ Gfx mat_waluigi_shoes[] = { gsDPPipeSync(), gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT), gsSPTexture(65535, 65535, 0, 0, 1), - gsSPCopyLightsPlayerPart(SHOES), + gsSPCopyLightsPlayerPart(SHOES), gsSPEndDisplayList(), }; @@ -6258,6 +6258,18 @@ Gfx waluigi_material_revert_render_settings[] = { gsSPTexture(65535, 65535, 0, 0, 0), gsDPSetEnvColor(255, 255, 255, 255), gsDPSetAlphaCompare(G_AC_NONE), + + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 1, 0), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 0, 0, 7, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0), + gsDPLoadBlock(7, 0, 0, 1023, 256), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0), + gsDPSetTileSize(0, 0, 0, 124, 124), + + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 1, 0), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 0, 256, 6, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0), + gsDPLoadBlock(6, 0, 0, 1023, 256), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 256, 1, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0), + gsDPSetTileSize(1, 0, 0, 124, 124), gsSPEndDisplayList(), }; diff --git a/actors/wario/geo.inc.c b/actors/wario/geo.inc.c index 99b50220..1fdaa137 100644 --- a/actors/wario/geo.inc.c +++ b/actors/wario/geo.inc.c @@ -684,6 +684,9 @@ const GeoLayout wario_geo[] = { GEO_CLOSE_NODE(), GEO_ASM(1, geo_mirror_mario_backface_culling), GEO_CLOSE_NODE(), + GEO_DISPLAY_LIST(LAYER_OPAQUE, wario_material_revert_render_settings), + GEO_DISPLAY_LIST(LAYER_ALPHA, wario_material_revert_render_settings), + GEO_DISPLAY_LIST(LAYER_TRANSPARENT, wario_material_revert_render_settings), GEO_CLOSE_NODE(), GEO_END(), }; diff --git a/actors/wario/geo_header.h b/actors/wario/geo_header.h index 2ca6e9cf..32e69648 100644 --- a/actors/wario/geo_header.h +++ b/actors/wario/geo_header.h @@ -116,4 +116,5 @@ extern const Gfx wario_wings_half_2_dl[]; extern const Gfx wario_cap_wings[]; extern const Gfx wario_cap_wings_transparent[]; extern const Gfx wario_metal_cap_wings[]; -extern const Gfx wario_metal_cap_wings_transparent[]; \ No newline at end of file +extern const Gfx wario_metal_cap_wings_transparent[]; +extern const Gfx wario_material_revert_render_settings[]; \ No newline at end of file diff --git a/actors/wario/model.inc.c b/actors/wario/model.inc.c index 86b41939..69e8b35c 100644 --- a/actors/wario/model.inc.c +++ b/actors/wario/model.inc.c @@ -4350,3 +4350,27 @@ const Gfx wario_metal_cap_wings_transparent[] = { gsSPTexture(0x0F80, 0x07C0, 0, G_TX_RENDERTILE, G_ON), gsSPEndDisplayList(), }; + +const Gfx wario_material_revert_render_settings[] = { + gsDPPipeSync(), + gsSPSetGeometryMode(G_LIGHTING), + gsSPClearGeometryMode(G_TEXTURE_GEN), + gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT), + gsSPTexture(65535, 65535, 0, 0, 0), + gsDPSetEnvColor(255, 255, 255, 255), + gsDPSetAlphaCompare(G_AC_NONE), + + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 1, 0), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 0, 0, 7, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0), + gsDPLoadBlock(7, 0, 0, 1023, 256), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, 0, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0), + gsDPSetTileSize(0, 0, 0, 124, 124), + + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 1, 0), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b_LOAD_BLOCK, 0, 256, 6, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0, G_TX_WRAP | G_TX_NOMIRROR, 0, 0), + gsDPLoadBlock(6, 0, 0, 1023, 256), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 256, 1, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0, G_TX_CLAMP | G_TX_NOMIRROR, 5, 0), + gsDPSetTileSize(1, 0, 0, 124, 124), + + gsSPEndDisplayList(), +}; diff --git a/src/pc/gfx/gfx_pc.c b/src/pc/gfx/gfx_pc.c index d070358e..336915ac 100644 --- a/src/pc/gfx/gfx_pc.c +++ b/src/pc/gfx/gfx_pc.c @@ -603,8 +603,10 @@ static void import_texture(int tile) { if (!rdp.loaded_texture[tile].addr) { #ifdef DEVELOPMENT +/* fprintf(stderr, "NULL texture: tile %d, format %d/%d, size %d\n", tile, (int)fmt, (int)siz, (int)rdp.loaded_texture[tile].size_bytes); +*/ #endif return; }