From cec34fc79b52784d5e4f3c13fbc6b92b9f0a8423 Mon Sep 17 00:00:00 2001 From: coco875 Date: Sun, 5 Jan 2025 17:38:06 +0100 Subject: [PATCH] simplify load_menu_img_comp_type --- src/menu_items.c | 51 ++---------------------------------------------- src/menu_items.h | 12 ++++++------ 2 files changed, 8 insertions(+), 55 deletions(-) diff --git a/src/menu_items.c b/src/menu_items.c index f98a07e64..5830d68b7 100644 --- a/src/menu_items.c +++ b/src/menu_items.c @@ -3628,7 +3628,6 @@ void load_menu_img_mio0_forced(MenuTexture* addr) { } void load_menu_img_comp_type(MenuTexture* addr, s32 compType) { - u16 size; s32 i; s32 imgLoaded; u8 clearBit; @@ -3646,56 +3645,10 @@ void load_menu_img_comp_type(MenuTexture* addr, s32 compType) { } if ((imgLoaded == false) || (compType > LOAD_MENU_IMG_FORCE)) { - if (texAddr->size != 0) { - size = texAddr->size; - } else { - size = 0x1000; - } - if (size % 8) { - size = ((size / 8) * 8) + 8; - } - - // dma a compressed texture to the compressed texture buffer - switch (compType) { - case LOAD_MENU_IMG_MIO0_ONCE: - case LOAD_MENU_IMG_MIO0_FORCE: - // dma_compressed_mio0_texture_segA(texAddr->textureData, size, gMenuCompressedBuffer); - break; - case LOAD_MENU_IMG_TKMK00_ONCE: - case LOAD_MENU_IMG_TKMK00_FORCE: - // dma_tkmk00_textures(texAddr->textureData, size, gMenuCompressedBuffer); - break; - } - // Extract compressed texture to the texture buffer - switch (compType) { - case LOAD_MENU_IMG_MIO0_ONCE: - case LOAD_MENU_IMG_MIO0_FORCE: - mio0decode(gMenuCompressedBuffer, (u8*) &sMenuTextureList[sMenuTextureListIndex]); - // strcpy(&sMenuTextureList[sMenuTextureListIndex], texAddr->textureData); - load_texture(texAddr->textureData); - break; - case LOAD_MENU_IMG_TKMK00_ONCE: - case LOAD_MENU_IMG_TKMK00_FORCE: - if (texAddr->type == 1) { - clearBit = 0xBE; - } else { - clearBit = 1; - } - if (1) {} - tkmk00decode(gMenuCompressedBuffer, sTKMK00_LowResBuffer, - (u8*) &sMenuTextureList[sMenuTextureListIndex], clearBit); - load_texture(texAddr->textureData); + sMenuTextureList[sMenuTextureListIndex] = gMenuCompressedBuffer; - // strcpy(&sMenuTextureList[sMenuTextureListIndex], texAddr->textureData); - break; - } - - // texMap[sMenuTextureEntries].textureData = texAddr->textureData; - // texMap[sMenuTextureEntries].offset = sMenuTextureListIndex; - // sMenuTextureListIndex += 1; - // sMenuTextureListIndex = ((sMenuTextureListIndex / 8) * 8) + 8; - // sMenuTextureEntries += 1; + load_texture(texAddr->textureData); } texAddr++; } diff --git a/src/menu_items.h b/src/menu_items.h index a55baaafc..9feb688d6 100644 --- a/src/menu_items.h +++ b/src/menu_items.h @@ -26,9 +26,9 @@ it last longer See `func_80096CD8` for the actual drawing of the static */ typedef struct { - /* 0x00 */ s32 type; // id maybe? - /* 0x04 */ s32 state; // sound mode, maybe some other stuff - /* 0x08 */ s32 subState; // This is used but I can't tell what for + /* 0x00 */ s32 type; // id maybe? + /* 0x04 */ s32 state; // sound mode, maybe some other stuff + /* 0x08 */ s32 subState; // This is used but I can't tell what for /* 0x0C */ s32 column; /* 0x10 */ s32 row; /* 0x14 */ u8 priority; // priority/depth/z-level. Higher values are drawn on top of lower values @@ -37,11 +37,11 @@ typedef struct { // These seem to be generic space available for use by the struct, no 1 purpose for any given member /* 0x16 */ s16 unk16; // Potentially unused /* 0x18 */ s32 D_8018DEE0_index; // Index in D_8018DEE0, an array of some other struct type - /* 0x1C */ s32 param1; // Multi use. Sometimes cup selection, sometimes course index. + /* 0x1C */ s32 param1; // Multi use. Sometimes cup selection, sometimes course index. /* 0x20 */ s32 param2; // Multi use, hard to tell what for though. Sometimes a random number, sometimes GP points /* 0x24 */ f32 paramf; // Multi use, x scaling for some things, rotation multiplier for the question box in some - // menus, probably some other things -} MenuItem; // size = 0x28 + // menus, probably some other things +} MenuItem; // size = 0x28 typedef struct { /* 0x00 */ MkAnimation* textureSequence;