From b67572c0e9002cde57d4ee5e3cb9efcf6ab23f84 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Thu, 27 May 2021 15:20:34 +0000 Subject: [PATCH] Fixed crash on cake end screen --- src/game/geo_misc.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/game/geo_misc.c b/src/game/geo_misc.c index bb8d15b1..4067a8d1 100644 --- a/src/game/geo_misc.c +++ b/src/game/geo_misc.c @@ -200,9 +200,29 @@ Gfx *geo_exec_cake_end_screen(s32 callContext, struct GraphNode *node, UNUSED f3 displayListHead = displayList; generatedNode->fnNode.node.flags = (generatedNode->fnNode.node.flags & 0xFF) | 0x100; + + s32 x = 0; + s32 y = 0; + u32 w = SCREEN_HEIGHT * 2560 / 1920; + u32 h = SCREEN_HEIGHT; u8 *texture = "levels/ending/cake"; - moon_draw_texture(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, texture); + + gSPDisplayList(displayListHead++, dl_proj_mtx_fullscreen); + + gSPDisplayList(displayListHead++, dl_hud_img_begin); + gDPSetTile(displayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD); + gDPTileSync(displayListHead++); + gDPSetTile(displayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 2, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR, 3, G_TX_NOLOD, G_TX_NOMIRROR, 3, G_TX_NOLOD); + gDPSetTileSize(displayListHead++, G_TX_RENDERTILE, 0, 0, w << G_TEXTURE_IMAGE_FRAC, h << G_TEXTURE_IMAGE_FRAC); + gDPPipeSync(displayListHead++); + gDPSetTextureImage(displayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 1, texture); + gDPLoadSync(displayListHead++); + gDPLoadBlock(displayListHead++, G_TX_LOADTILE, 0, 0, w * h - 1, CALC_DXT(w, G_IM_SIZ_32b_BYTES)); + gSPTextureRectangle(displayListHead++, x << 2, y << 2, (x + w) << 2, (y + h) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10); + gSPDisplayList(displayListHead++, dl_hud_img_end); + + gSPEndDisplayList(displayListHead); } return displayList; -} +} \ No newline at end of file