From 76fc258b2a742576495f43246e108a962b035ee7 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Thu, 20 Mar 2025 15:01:35 +0100 Subject: [PATCH] Remove wrong palette label --- include/structs/axdata.h | 6 +++--- src/code_800558C.c | 18 +++++++++--------- src/sprite.c | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/structs/axdata.h b/include/structs/axdata.h index c02cf18be..21c00e667 100644 --- a/include/structs/axdata.h +++ b/include/structs/axdata.h @@ -64,7 +64,7 @@ typedef struct axdata /* 0x8 */ axdata1 sub1; /* 0x28 */ ax_anim *nextAnimData; // next animation data (if flags&0x1000) /* 0x2C */ ax_anim *activeAnimData; // current animation data - /* 0x30 */ void *paletteData; // ? + /* 0x30 */ DungeonPos *positions; /* 0x34 */ ax_pose **poseData; /* 0x38 */ UnkSpriteMem **spriteData; } axdata; @@ -75,8 +75,8 @@ typedef struct axmain /* 0x0 */ ax_pose **poses; /* 0x4 */ ax_anim ***animations; /* 0x8 */ u32 animCount; - /* 0xC */ void *spriteData; // ? - /* 0x10 */ void *palettes; // ? + /* 0xC */ UnkSpriteMem **spriteData; + /* 0x10 */ DungeonPos *positions; } axmain; // size: 0x4C diff --git a/src/code_800558C.c b/src/code_800558C.c index 6442c8a7d..1664dfa48 100644 --- a/src/code_800558C.c +++ b/src/code_800558C.c @@ -74,10 +74,10 @@ void sub_800569C(DungeonPos *a0, struct axObject *a1, u8 a2) if (!(a1->axdata.flags >> 15) || a2 >= 4) return; - if (a1->axdata.paletteData != NULL) { - ptr = &((DungeonPos*)a1->axdata.paletteData)[a1->axdata.sub1.poseId * 4]; + if (a1->axdata.positions != NULL) { + ptr = &(a1->axdata.positions)[a1->axdata.sub1.poseId * 4]; ptr2 = &ptr[a2]; - if (*&ptr2->x == 99 && *&ptr2->y == 99) { + if (*&ptr2->x == 99 && ptr2->y == 99) { a0->x = 99; a0->y = 99; } @@ -96,21 +96,21 @@ void sub_800569C(DungeonPos *a0, struct axObject *a1, u8 a2) void sub_8005700(DungeonPos *a0, struct axObject *a1) { s32 i; - DungeonPos *ptr; if (!(a1->axdata.flags >> 15)) return; - if (a1->axdata.paletteData != NULL) { - ptr = &((DungeonPos*)a1->axdata.paletteData)[a1->axdata.sub1.poseId * 4]; + if (a1->axdata.positions != NULL) { + DungeonPos *positions = &(a1->axdata.positions)[a1->axdata.sub1.poseId * 4]; for (i = 0; i < 4; i++) { - if (*&ptr[i].x == 99 && *&ptr[i].y == 99) { + s32 x = positions[i].x; + if (x == 99 && positions[i].y == 99) { a0->x = 99; a0->y = 99; } else { - a0->x = a1->axdata.sub1.offset.x + ptr[i].x; - a0->y = a1->axdata.sub1.offset.y + ptr[i].y; + a0->x = a1->axdata.sub1.offset.x + positions[i].x; + a0->y = a1->axdata.sub1.offset.y + positions[i].y; } a0++; } diff --git a/src/sprite.c b/src/sprite.c index c71476106..4e7d78202 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -487,7 +487,7 @@ void AxResInit(axdata *a0, axmain *a1, u32 a2, u32 direction, u32 a4, u32 sprite a0->activeAnimData = a0->nextAnimData; a0->poseData = a1->poses; a0->spriteData = a1->spriteData; - a0->paletteData = a1->palettes; + a0->positions = a1->positions; } void AxResInitUnorientedFile(axdata *a0, OpenedFile *a1, u32 a2, u32 a3, u32 spriteAnimIndex, bool8 a5) @@ -514,7 +514,7 @@ static void AxResInitUnoriented(axdata *a0, axmain *a1, u32 a2, u32 a3, u32 spri a0->nextAnimData = a1->animations[a2][0]; a0->activeAnimData = a0->nextAnimData; a0->poseData = a1->poses; - a0->paletteData = 0; + a0->positions = NULL; } static inline s16 check_flag_for_80054BC(u16 flags) {