From 8fa8fc47995cd1708f0423a4048d75177a175d8c Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 22 Aug 2021 16:30:27 -0700 Subject: [PATCH] Prevented Toad's face from getting corrupted in certain areas --- actors/toad_player/model.inc.c | 73 ++++++++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 13 deletions(-) diff --git a/actors/toad_player/model.inc.c b/actors/toad_player/model.inc.c index f4c268e6..e11a7139 100644 --- a/actors/toad_player/model.inc.c +++ b/actors/toad_player/model.inc.c @@ -282,44 +282,91 @@ const Gfx toad_player_dl_face_inner[] = { gsSPEndDisplayList(), }; -const Gfx toad_player_dl_face_textured[] = { +const Gfx toad_player_dl_face[] = { gsDPPipeSync(), gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), + gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), + gsDPTileSync(), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), - + gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, toad_player_texture_face), gsDPLoadSync(), + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), + gsSPLight(&toad_player_lights_face.l, 1), gsSPLight(&toad_player_lights_face.a, 2), - gsSPDisplayList(toad_player_dl_face_inner), - gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), - gsSPEndDisplayList(), -}; - -const Gfx toad_player_dl_face[] = { - gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, toad_player_texture_face), - gsSPDisplayList(toad_player_dl_face_textured), + gsDPTileSync(), gsSPEndDisplayList(), }; const Gfx toad_player_dl_eyes_closed[] = { + gsDPPipeSync(), + gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), + gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), + gsDPTileSync(), + + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD), + gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, toad_player_texture_eyes_closed), - gsSPDisplayList(toad_player_dl_face_textured), + gsDPLoadSync(), + + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), + + gsSPLight(&toad_player_lights_face.l, 1), + gsSPLight(&toad_player_lights_face.a, 2), + gsSPDisplayList(toad_player_dl_face_inner), + + gsDPTileSync(), gsSPEndDisplayList(), }; const Gfx toad_player_dl_eyes_half_closed[] = { + gsDPPipeSync(), + gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), + gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), + gsDPTileSync(), + + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD), + gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, toad_player_texture_eyes_half_closed), - gsSPDisplayList(toad_player_dl_face_textured), + gsDPLoadSync(), + + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), + + gsSPLight(&toad_player_lights_face.l, 1), + gsSPLight(&toad_player_lights_face.a, 2), + gsSPDisplayList(toad_player_dl_face_inner), + + gsDPTileSync(), gsSPEndDisplayList(), }; const Gfx toad_player_dl_eyes_dead[] = { + gsDPPipeSync(), + gsDPSetCombineMode(G_CC_MODULATERGBFADE, G_CC_MODULATERGBFADE), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), + gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), + gsDPTileSync(), + + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD), + gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, toad_player_texture_eyes_dead), - gsSPDisplayList(toad_player_dl_face_textured), + gsDPLoadSync(), + + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), + + gsSPLight(&toad_player_lights_face.l, 1), + gsSPLight(&toad_player_lights_face.a, 2), + gsSPDisplayList(toad_player_dl_face_inner), + + gsDPTileSync(), gsSPEndDisplayList(), };