diff --git a/include/string_format.h b/include/string_format.h index 4f33a207e..185897ed6 100644 --- a/include/string_format.h +++ b/include/string_format.h @@ -39,12 +39,6 @@ struct MonPortraitMsg u8 unkE; }; -struct FileMonPortraits -{ - /* 0x0 */ File *file; - /* 0x4 */ struct PortraitGfx *data; -}; - #define FORMAT_BUFFER_LEN 80 #define FRIEND_AREA_BUFFER_LEN 184 diff --git a/src/personality_test1.c b/src/personality_test1.c index 24e5958dc..481acb4d1 100644 --- a/src/personality_test1.c +++ b/src/personality_test1.c @@ -383,7 +383,7 @@ static void PrintPersonalityTypeDescription(void) static void PersonalityTest_DisplayStarterSprite(void) { s32 starterID; - struct FileMonPortraits *faceFile; + struct OpenedFile *faceFile; s32 palleteIndex; s32 emotionId; const u8 *gfx; @@ -397,14 +397,14 @@ static void PersonalityTest_DisplayStarterSprite(void) CallPrepareTextbox_8008C54(1); sub_80073B8(1); - faceFile = (void*) GetDialogueSpriteDataPtr(starterID); - gfx = faceFile->data->sprites[EMOTION_HAPPY].gfx; + faceFile = GetDialogueSpriteDataPtr(starterID); + gfx = ((struct PortraitGfx *)(faceFile->data))->sprites[EMOTION_HAPPY].gfx; emotionId = EMOTION_HAPPY; for (palleteIndex = 0; palleteIndex < 0x10; palleteIndex++) { - SetBGPaletteBufferColorArray(palleteIndex + 0xE0, &faceFile->data->sprites[emotionId].pal[palleteIndex]); + SetBGPaletteBufferColorArray(palleteIndex + 0xE0, &((struct PortraitGfx *)(faceFile->data))->sprites[emotionId].pal[palleteIndex]); } DisplayMonPortraitSpriteFlipped(1, gfx, 14); - CloseFile((void*)faceFile); + CloseFile(faceFile); sub_80073E0(1); } diff --git a/src/personality_test2.c b/src/personality_test2.c index d51f11e71..0c2334dc8 100644 --- a/src/personality_test2.c +++ b/src/personality_test2.c @@ -244,7 +244,7 @@ static void RedrawPartnerSelectionMenu(void) static void PersonalityTest_DisplayPartnerSprite(void) { s32 partnerID; - struct FileMonPortraits *faceFile; + struct OpenedFile *faceFile; s32 palleteIndex; const u8 *gfx; s32 emotionId; @@ -252,15 +252,15 @@ static void PersonalityTest_DisplayPartnerSprite(void) partnerID = gUnknown_203B404->PartnerArray[gUnknown_203B404->s18.s0.input.menuIndex]; CallPrepareTextbox_8008C54(1); sub_80073B8(1); - faceFile = (void*) GetDialogueSpriteDataPtr(partnerID); - gfx = faceFile->data->sprites[EMOTION_NORMAL].gfx; + faceFile = GetDialogueSpriteDataPtr(partnerID); + gfx = ((struct PortraitGfx *)(faceFile->data))->sprites[EMOTION_NORMAL].gfx; emotionId = EMOTION_NORMAL; for (palleteIndex = 0; palleteIndex < 0x10; palleteIndex++) { - SetBGPaletteBufferColorArray(palleteIndex + 0xE0, &faceFile->data->sprites[emotionId].pal[palleteIndex]); + SetBGPaletteBufferColorArray(palleteIndex + 0xE0, &((struct PortraitGfx *)(faceFile->data))->sprites[emotionId].pal[palleteIndex]); } DisplayMonPortraitSpriteFlipped(1, gfx, 14); - CloseFile((void*)faceFile); + CloseFile(faceFile); sub_80073E0(1); gUnknown_203B404->unk16 = 1; }