1
0
mirror of https://github.com/blawar/ooot.git synced 2024-07-02 09:03:36 +00:00

fix: link animation LUT added

Signed-off-by: Blake Warner <blake@null3d.com>
This commit is contained in:
Hayden Kowalchuk 2022-02-07 22:16:53 -05:00 committed by Blake Warner
parent 02a0769fc1
commit 8185f70634
2 changed files with 22 additions and 6 deletions

View File

@ -978,18 +978,24 @@ s32 func_80090014(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
*dList = dLists[sDListsLodOffset];
} else if (limbIndex == PLAYER_LIMB_SHEATH) {
Gfx** dLists = this->sheathDLists;
int dListOffset = 0;
if ((this->sheathType == 18) || (this->sheathType == 19)) {
dLists += this->currentShield * 4;
if (!LINK_IS_ADULT && (this->currentShield < PLAYER_SHIELD_HYLIAN) &&
(gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) {
dLists += 16;
/* Figure out which array we want to truly be in */
if( (uintptr_t)dLists >= (uintptr_t)D_80125D28 + (sizeof(Gfx*)*16) ) {
dListOffset = ((uintptr_t)(dLists) - ((uintptr_t)D_80125D28 + (sizeof(Gfx*)*16))) / sizeof(Gfx *);
dLists = D_80125D68;
}
}
} else if (!LINK_IS_ADULT && ((this->sheathType == 16) || (this->sheathType == 17)) &&
(gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) {
dLists = D_80125D68;
}
dList = dLists[sDListsLodOffset+dListOffset];
*dList = dLists[sDListsLodOffset];
} else if (limbIndex == PLAYER_LIMB_WAIST) {
*dList = this->waistDLists[sDListsLodOffset];
@ -1464,6 +1470,8 @@ u8 D_801261F8[] = { 2, 2, 5 };
s32 func_80091880(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* arg) {
u8* ptr = arg;
/* AddressSanitizer: global-buffer-overflow on address ptr[0] = 0 */
ptr[0] = MAX(ptr[0], 1);
u8 modelGroup = D_801261F8[ptr[0] - 1];
s32 type;
s32 dListOffset = 0;

View File

@ -919,6 +919,15 @@ static LinkAnimationHeader* D_80853D7C[][2] = {
{ &gPlayerAnim_003418, &gPlayerAnim_003418 }, { &gPlayerAnim_003428, &gPlayerAnim_003428 }
};
static LinkAnimationHeader** AnimHeaderLut[] = {
D_80853914,D_8085392C,D_80853944,D_8085395C,D_80853974,D_8085398C,D_808539A4,D_808539BC,
D_808539D4,D_808539EC,D_80853A04,D_80853A1C,D_80853A34,D_80853A4C,D_80853A64,D_80853A7C,
D_80853A94,D_80853AAC,D_80853AC4,D_80853ADC,D_80853AF4,D_80853B0C,D_80853B24,D_80853B3C,
D_80853B54,D_80853B6C,D_80853B84,D_80853B9C,D_80853BB4,D_80853BCC,D_80853BE4,D_80853BFC,
D_80853C14,D_80853C2C,D_80853C44,D_80853C5C,D_80853C74,D_80853C8C,D_80853CA4,D_80853CBC,
D_80853CD4,D_80853CEC,D_80853D04,D_80853D1C,D_80853D34,D_80853D4C,D_80853D7C,
};
static struct_80832924 D_80853DEC[] = {
{ NA_SE_VO_LI_SNEEZE, -0x2008 },
};
@ -1721,16 +1730,15 @@ void func_80833664(GlobalContext* globalCtx, Player* this, s8 actionParam) {
this->stateFlags1 &= ~0x1000008;
for (i = 0; i < 45; i++) {
if (current == *iter) {
if (current == AnimHeaderLut[i][this->modelAnimType]) {
break;
}
iter += 6;
}
func_8083399C(globalCtx, this, actionParam);
if (i < 45) {
this->skelAnime.animation = D_80853914[i * 6 + this->modelAnimType];
this->skelAnime.animation = AnimHeaderLut[i][this->modelAnimType];
}
}
@ -7095,8 +7103,8 @@ void func_808417FC(Player* this, GlobalContext* globalCtx) {
void func_80841860(GlobalContext* globalCtx, Player* this) {
f32 frame;
LinkAnimationHeader* sp38 = D_80853914[this->modelAnimType + 144];
LinkAnimationHeader* sp34 = D_80853914[this->modelAnimType + 150];
LinkAnimationHeader* sp38 = D_80853B54[this->modelAnimType];
LinkAnimationHeader* sp34 = D_80853B6C[this->modelAnimType];
this->skelAnime.animation = sp38;