Some documentation changes for zplayer (#3172)

* Documentation changes for zplayer

* Update soh/include/z64player.h

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>

---------

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>
This commit is contained in:
Garrett Cox
2023-09-15 13:39:46 -05:00
committed by GitHub
parent a4b5d569b1
commit c11a6a17e9
47 changed files with 576 additions and 576 deletions

View File

@@ -53,7 +53,7 @@ u8 gPlayerModelTypes[][5] = {
{ 0, 0, 13, 18, 20 }, { 0, 0, 14, 18, 20 }, { 0, 7, 8, 18, 20 }, { 0, 2, 8, 19, 20 },
};
Gfx* D_80125CE8[] = {
Gfx* sPlayerRightHandShieldDLs[] = {
gLinkAdultRightHandClosedNearDL,
gLinkChildRightHandClosedNearDL,
gLinkAdultRightHandClosedFarDL,
@@ -72,7 +72,7 @@ Gfx* D_80125CE8[] = {
gLinkChildRightHandClosedFarDL,
};
Gfx* D_80125D28[] = {
Gfx* sSheathWithSwordDLs[] = {
gLinkAdultMasterSwordAndSheathNearDL, gLinkChildSwordAndSheathNearDL,
gLinkAdultMasterSwordAndSheathFarDL, gLinkChildSwordAndSheathFarDL,
gLinkAdultMasterSwordAndSheathNearDL, gLinkChildDekuShieldSwordAndSheathNearDL,
@@ -87,7 +87,7 @@ Gfx* D_80125D28[] = {
NULL, gLinkChildDekuShieldWithMatrixDL,
};
Gfx* D_80125D88[] = {
Gfx* sSheathWithoutSwordDLs[] = {
gLinkAdultSheathNearDL,
gLinkChildSheathNearDL,
gLinkAdultSheathFarDL,
@@ -114,162 +114,162 @@ Gfx* D_80125D88[] = {
gLinkChildDekuShieldWithMatrixDL,
};
Gfx* D_80125DE8[] = {
Gfx* gPlayerLeftHandBgsDLs[] = {
gLinkAdultLeftHandHoldingBgsNearDL, gLinkChildLeftHandHoldingMasterSwordDL,
gLinkAdultLeftHandHoldingBgsFarDL, gLinkChildLeftHandHoldingMasterSwordDL,
gLinkAdultHandHoldingBrokenGiantsKnifeDL, gLinkChildLeftHandHoldingMasterSwordDL,
gLinkAdultHandHoldingBrokenGiantsKnifeFarDL, gLinkChildLeftHandHoldingMasterSwordDL,
};
Gfx* D_80125E08[] = {
Gfx* gPlayerLeftHandOpenDLs[] = {
gLinkAdultLeftHandNearDL,
gLinkChildLeftHandNearDL,
gLinkAdultLeftHandFarDL,
gLinkChildLeftHandFarDL,
};
Gfx* D_80125E18[] = {
Gfx* gPlayerLeftHandClosedDLs[] = {
gLinkAdultLeftHandClosedNearDL,
gLinkChildLeftFistNearDL,
gLinkAdultLeftHandClosedFarDL,
gLinkChildLeftFistFarDL,
};
Gfx* D_80125E28[] = {
Gfx* sPlayerLeftHandSwordDLs2[] = {
gLinkAdultLeftHandHoldingMasterSwordNearDL,
gLinkChildLeftFistAndKokiriSwordNearDL,
gLinkAdultLeftHandHoldingMasterSwordFarDL,
gLinkChildLeftFistAndKokiriSwordFarDL,
};
Gfx* D_80125E38[] = {
Gfx* sPlayerLeftHandSwordDLs[] = {
gLinkAdultLeftHandHoldingMasterSwordNearDL,
gLinkChildLeftFistAndKokiriSwordNearDL,
gLinkAdultLeftHandHoldingMasterSwordFarDL,
gLinkChildLeftFistAndKokiriSwordFarDL,
};
Gfx* D_80125E48[] = {
Gfx* sPlayerRightHandOpenDLs[] = {
gLinkAdultRightHandNearDL,
gLinkChildRightHandNearDL,
gLinkAdultRightHandFarDL,
gLinkChildRightHandFarDL,
};
Gfx* D_80125E58[] = {
Gfx* sPlayerRightHandClosedDLs[] = {
gLinkAdultRightHandClosedNearDL,
gLinkChildRightHandClosedNearDL,
gLinkAdultRightHandClosedFarDL,
gLinkChildRightHandClosedFarDL,
};
Gfx* D_80125E68[] = {
Gfx* sPlayerRightHandBowSlingshotDLs[] = {
gLinkAdultRightHandHoldingBowNearDL,
gLinkChildRightHandHoldingSlingshotNearDL,
gLinkAdultRightHandHoldingBowFarDL,
gLinkChildRightHandHoldingSlingshotFarDL,
};
Gfx* D_80125E78[] = {
Gfx* sSwordAndSheathDLs[] = {
gLinkAdultMasterSwordAndSheathNearDL,
gLinkChildSwordAndSheathNearDL,
gLinkAdultMasterSwordAndSheathFarDL,
gLinkChildSwordAndSheathFarDL,
};
Gfx* D_80125E88[] = {
Gfx* sSheathDLs[] = {
gLinkAdultSheathNearDL,
gLinkChildSheathNearDL,
gLinkAdultSheathFarDL,
gLinkChildSheathFarDL,
};
Gfx* D_80125E98[] = {
Gfx* sPlayerWaistDLs[] = {
gLinkAdultWaistNearDL,
gLinkChildWaistNearDL,
gLinkAdultWaistFarDL,
gLinkChildWaistFarDL,
};
Gfx* D_80125EA8[] = {
Gfx* sPlayerRightHandBowSlingshotDLs2[] = {
gLinkAdultRightHandHoldingBowNearDL,
gLinkChildRightHandHoldingSlingshotNearDL,
gLinkAdultRightHandHoldingBowFarDL,
gLinkChildRightHandHoldingSlingshotFarDL,
};
Gfx* D_80125EB8[] = {
Gfx* sPlayerRightHandOcarinaDLs[] = {
gLinkAdultRightHandHoldingOotNearDL,
gLinkChildRightHandHoldingFairyOcarinaNearDL,
gLinkAdultRightHandHoldingOotFarDL,
gLinkChildRightHandHoldingFairyOcarinaFarDL,
};
Gfx* D_80125EC8[] = {
Gfx* sPlayerRightHandOotDLs[] = {
gLinkAdultRightHandHoldingOotNearDL,
gLinkChildRightHandAndOotNearDL,
gLinkAdultRightHandHoldingOotFarDL,
gLinkChildRightHandHoldingOOTFarDL,
};
Gfx* D_80125ED8[] = {
Gfx* sPlayerRightHandHookshotDLs[] = {
gLinkAdultRightHandHoldingHookshotNearDL,
gLinkChildRightHandNearDL,
gLinkAdultRightHandHoldingHookshotNearDL, // The 'far' display list exists but is not used
gLinkChildRightHandFarDL,
};
Gfx* D_80125EE8[] = {
Gfx* sPlayerLeftHandHammerDLs[] = {
gLinkAdultLeftHandHoldingHammerNearDL,
gLinkChildLeftHandNearDL,
gLinkAdultLeftHandHoldingHammerFarDL,
gLinkChildLeftHandFarDL,
};
Gfx* D_80125EF8[] = {
Gfx* gPlayerLeftHandBoomerangDLs[] = {
gLinkAdultLeftHandNearDL,
gLinkChildLeftFistAndBoomerangNearDL,
gLinkAdultLeftHandFarDL,
gLinkChildLeftFistAndBoomerangFarDL,
};
Gfx* D_80125F08[] = {
Gfx* sPlayerLeftHandBottleDLs[] = {
gLinkAdultLeftHandOutNearDL,
gLinkChildLeftHandUpNearDL,
gLinkAdultLeftHandOutNearDL,
gLinkChildLeftHandUpNearDL,
};
Gfx* sArmOutDLs[] = {
Gfx* sFirstPersonLeftForearmDLs[] = {
gLinkAdultRightArmOutNearDL,
NULL,
};
Gfx* sHandOutDLs[] = {
Gfx* sFirstPersonLeftHandDLs[] = {
gLinkAdultRightHandOutNearDL,
NULL,
};
Gfx* sRightShoulderNearDLs[] = {
Gfx* sFirstPersonRightShoulderDLs[] = {
gLinkAdultRightShoulderNearDL,
gLinkChildRightShoulderNearDL,
};
Gfx* D_80125F30[] = {
Gfx* sFirstPersonForearmDLs[] = {
gLinkAdultLeftArmOutNearDL,
NULL,
};
Gfx* sHoldingFirstPersonWeaponDLs[] = {
Gfx* sFirstPersonRightHandHoldingWeaponDLs[] = {
gLinkAdultRightHandHoldingBowFirstPersonDL,
gLinkChildRightArmStretchedSlingshotDL,
};
// Indexed by model types (left hand, right hand, sheath or waist)
Gfx** sPlayerDListGroups[] = {
D_80125E08, D_80125E18, D_80125E38, D_80125E28, D_80125DE8, D_80125EE8, D_80125EF8,
D_80125F08, D_80125E48, D_80125E58, D_80125CE8, D_80125E68, D_80125EA8, D_80125EB8,
D_80125EC8, D_80125ED8, D_80125E78, D_80125E88, D_80125D28, D_80125D88, D_80125E98,
gPlayerLeftHandOpenDLs, gPlayerLeftHandClosedDLs, sPlayerLeftHandSwordDLs, sPlayerLeftHandSwordDLs2, gPlayerLeftHandBgsDLs, sPlayerLeftHandHammerDLs, gPlayerLeftHandBoomerangDLs,
sPlayerLeftHandBottleDLs, sPlayerRightHandOpenDLs, sPlayerRightHandClosedDLs, sPlayerRightHandShieldDLs, sPlayerRightHandBowSlingshotDLs, sPlayerRightHandBowSlingshotDLs2, sPlayerRightHandOcarinaDLs,
sPlayerRightHandOotDLs, sPlayerRightHandHookshotDLs, sSwordAndSheathDLs, sSheathDLs, sSheathWithSwordDLs, sSheathWithoutSwordDLs, sPlayerWaistDLs,
};
Gfx gCullBackDList[] = {
@@ -285,8 +285,8 @@ Gfx gCullFrontDList[] = {
Vec3f* D_80160000;
s32 sDListsLodOffset;
Vec3f sGetItemRefPos;
s32 D_80160014;
s32 D_80160018;
s32 sLeftHandType;
s32 sRightHandType;
void Player_SetBootData(PlayState* play, Player* this) {
s32 currentBoots;
@@ -371,7 +371,7 @@ s32 Player_ActionToModelGroup(Player* this, s32 actionParam) {
void Player_SetModelsForHoldingShield(Player* this) {
if ((this->stateFlags1 & 0x400000) &&
((this->itemAction < 0) || (this->itemAction == this->heldItemAction))) {
if ((CVarGetInteger("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK) ||
if ((CVarGetInteger("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_DEKU_STICK) ||
!Player_HoldsTwoHandedWeapon(this)) && !Player_IsChildWithHylianShield(this)) {
this->rightHandType = 10;
this->rightHandDLists = &sPlayerDListGroups[10][gSaveContext.linkAge];
@@ -497,7 +497,7 @@ s32 Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 y
Vec3f diff;
s32 pad;
if ((this->heldItemAction == PLAYER_IA_STICK) && (this->unk_860 != 0)) {
if ((this->heldItemAction == PLAYER_IA_DEKU_STICK) && (this->unk_860 != 0)) {
Math_Vec3f_Diff(&this->meleeWeaponInfo[0].tip, pos, &diff);
return ((SQ(diff.x) + SQ(diff.z)) <= SQ(xzRange)) && (0.0f <= diff.y) && (diff.y <= yRange);
} else {
@@ -577,7 +577,7 @@ s32 func_8008F128(Player* this) {
return Player_HoldsHookshot(this) && (this->heldActor == NULL);
}
s32 Player_ActionToSword(s32 actionParam) {
s32 Player_ActionToMeleeWeapon(s32 actionParam) {
s32 sword = actionParam - PLAYER_IA_FISHING_POLE;
if ((sword > 0) && (sword < 6)) {
@@ -587,12 +587,12 @@ s32 Player_ActionToSword(s32 actionParam) {
}
}
s32 Player_GetSwordHeld(Player* this) {
return Player_ActionToSword(this->heldItemAction);
s32 Player_GetMeleeWeaponHeld(Player* this) {
return Player_ActionToMeleeWeapon(this->heldItemAction);
}
s32 Player_HoldsTwoHandedWeapon(Player* this) {
if ((this->heldItemAction >= PLAYER_IA_SWORD_BGS) && (this->heldItemAction <= PLAYER_IA_HAMMER)) {
if ((this->heldItemAction >= PLAYER_IA_SWORD_BIGGORON) && (this->heldItemAction <= PLAYER_IA_HAMMER)) {
return 1;
} else {
return 0;
@@ -600,7 +600,7 @@ s32 Player_HoldsTwoHandedWeapon(Player* this) {
}
s32 Player_HoldsBrokenKnife(Player* this) {
return (this->heldItemAction == PLAYER_IA_SWORD_BGS) && (gSaveContext.swordHealth <= 0.0f);
return (this->heldItemAction == PLAYER_IA_SWORD_BIGGORON) && (gSaveContext.swordHealth <= 0.0f);
}
s32 Player_ActionToBottle(Player* this, s32 actionParam) {
@@ -647,7 +647,7 @@ return_neg:
return -1;
}
s32 func_8008F2F8(PlayState* play) {
s32 Player_GetEnvironmentalHazard(PlayState* play) {
Player* this = GET_PLAYER(play);
TextTriggerEntry* triggerEntry;
s32 var;
@@ -747,7 +747,7 @@ Gfx* sBootDListGroups[][2] = {
{ gLinkAdultLeftHoverBootDL, gLinkAdultRightHoverBootDL },
};
void func_8008F470(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic,
void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, s32 lod, s32 tunic,
s32 boots, s32 face, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
void* data) {
Color_RGB8* color;
@@ -805,8 +805,8 @@ void func_8008F470(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dLis
SkelAnime_DrawFlexLod(play, skeleton, jointTable, dListCount, overrideLimbDraw, postLimbDraw, data, lod);
if (((CVarGetInteger("gFPSGauntlets", 0) && LINK_IS_ADULT) || (overrideLimbDraw != func_800902F0)) &&
(overrideLimbDraw != func_80090440) &&
if (((CVarGetInteger("gFPSGauntlets", 0) && LINK_IS_ADULT) || (overrideLimbDraw != Player_OverrideLimbDrawGameplayFirstPerson)) &&
(overrideLimbDraw != Player_OverrideLimbDrawGameplayCrawling) &&
(gSaveContext.gameMode != 3)) {
if (LINK_IS_ADULT) {
s32 strengthUpgrade = CUR_UPG_VALUE(UPG_STRENGTH);
@@ -827,9 +827,9 @@ void func_8008F470(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dLis
gSPDisplayList(POLY_OPA_DISP++, gLinkAdultLeftGauntletPlate1DL);
gSPDisplayList(POLY_OPA_DISP++, gLinkAdultRightGauntletPlate1DL);
gSPDisplayList(POLY_OPA_DISP++,
(D_80160014 == 0) ? gLinkAdultLeftGauntletPlate2DL : gLinkAdultLeftGauntletPlate3DL);
(sLeftHandType == 0) ? gLinkAdultLeftGauntletPlate2DL : gLinkAdultLeftGauntletPlate3DL);
gSPDisplayList(POLY_OPA_DISP++,
(D_80160018 == 8) ? gLinkAdultRightGauntletPlate2DL : gLinkAdultRightGauntletPlate3DL);
(sRightHandType == 8) ? gLinkAdultRightGauntletPlate2DL : gLinkAdultRightGauntletPlate3DL);
}
if (boots != 0) {
@@ -848,7 +848,7 @@ void func_8008F470(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dLis
CLOSE_DISPS(play->state.gfxCtx);
}
Vec3f D_8012602C = { 0.0f, 0.0f, 0.0f };
Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f };
Vec3f D_80126038[] = {
{ 1304.0f, 0.0f, 0.0f },
@@ -896,10 +896,10 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p
Matrix_Push();
Matrix_TranslateRotateZYX(pos, rot);
Matrix_MultVec3f(&D_8012602C, &spA4);
Matrix_MultVec3f(&sZeroVec, &spA4);
Matrix_TranslateRotateZYX(&D_80126038[gSaveContext.linkAge], &skelAnime->jointTable[shinLimbIndex]);
Matrix_Translate(D_80126050[gSaveContext.linkAge], 0.0f, 0.0f, MTXMODE_APPLY);
Matrix_MultVec3f(&D_8012602C, &sp98);
Matrix_MultVec3f(&sZeroVec, &sp98);
Matrix_MultVec3f(&D_80126070, &footprintPos);
Matrix_Pop();
@@ -955,12 +955,12 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p
}
}
s32 func_8008FCC8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
Player* this = (Player*)thisx;
if (limbIndex == PLAYER_LIMB_ROOT) {
D_80160014 = this->leftHandType;
D_80160018 = this->rightHandType;
sLeftHandType = this->leftHandType;
sRightHandType = this->rightHandType;
D_80160000 = &this->meleeWeaponInfo[2].base;
if (!LINK_IS_ADULT) {
@@ -1036,33 +1036,33 @@ s32 func_8008FCC8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
return false;
}
s32 func_80090014(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
Player* this = (Player*)thisx;
if (!func_8008FCC8(play, limbIndex, dList, pos, rot, thisx))
if (!Player_OverrideLimbDrawGameplayCommon(play, limbIndex, dList, pos, rot, thisx))
{
if (limbIndex == PLAYER_LIMB_L_HAND) {
Gfx** dLists = this->leftHandDLists;
if ((D_80160014 == 4) && (gSaveContext.swordHealth <= 0.0f)) {
if ((sLeftHandType == 4) && (gSaveContext.swordHealth <= 0.0f)) {
dLists += 4;
} else if ((D_80160014 == 6) && (this->stateFlags1 & 0x2000000)) {
dLists = &D_80125E08[gSaveContext.linkAge];
D_80160014 = 0;
} else if ((sLeftHandType == 6) && (this->stateFlags1 & 0x2000000)) {
dLists = &gPlayerLeftHandOpenDLs[gSaveContext.linkAge];
sLeftHandType = 0;
} else if ((this->leftHandType == 0) && (this->actor.speedXZ > 2.0f) && !(this->stateFlags1 & 0x8000000)) {
dLists = &D_80125E18[gSaveContext.linkAge];
D_80160014 = 1;
dLists = &gPlayerLeftHandClosedDLs[gSaveContext.linkAge];
sLeftHandType = 1;
}
*dList = ResourceMgr_LoadGfxByName(dLists[sDListsLodOffset]);
} else if (limbIndex == PLAYER_LIMB_R_HAND) {
Gfx** dLists = this->rightHandDLists;
if (D_80160018 == 10) {
if (sRightHandType == 10) {
dLists += this->currentShield * 4;
} else if ((this->rightHandType == 8) && (this->actor.speedXZ > 2.0f) && !(this->stateFlags1 & 0x8000000)) {
dLists = &D_80125E58[gSaveContext.linkAge];
D_80160018 = 9;
dLists = &sPlayerRightHandClosedDLs[gSaveContext.linkAge];
sRightHandType = 9;
}
*dList = ResourceMgr_LoadGfxByName(dLists[sDListsLodOffset]);
@@ -1077,7 +1077,7 @@ s32 func_80090014(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
}
} else if (!LINK_IS_ADULT && ((this->sheathType == 16) || (this->sheathType == 17)) &&
(gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) {
dLists = &D_80125D28[16];
dLists = &sSheathWithSwordDLs[16];
}
if (dLists[sDListsLodOffset] != NULL) {
@@ -1105,24 +1105,24 @@ s32 func_80090014(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
return false;
}
s32 func_800902F0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
s32 Player_OverrideLimbDrawGameplayFirstPerson(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
Player* this = (Player*)thisx;
if (!func_8008FCC8(play, limbIndex, dList, pos, rot, thisx)) {
if (!Player_OverrideLimbDrawGameplayCommon(play, limbIndex, dList, pos, rot, thisx)) {
if (this->unk_6AD != 2) {
*dList = NULL;
} else if (limbIndex == PLAYER_LIMB_L_FOREARM) {
*dList = sArmOutDLs[gSaveContext.linkAge];
*dList = sFirstPersonLeftForearmDLs[gSaveContext.linkAge];
} else if (limbIndex == PLAYER_LIMB_L_HAND) {
s32 handOutDlIndex = gSaveContext.linkAge;
if (CVarGetInteger("gBowSlingShotAmmoFix", 0) && LINK_IS_ADULT && Player_HoldsSlingshot(this)) {
handOutDlIndex = 1;
}
*dList = sHandOutDLs[handOutDlIndex];
*dList = sFirstPersonLeftHandDLs[handOutDlIndex];
} else if (limbIndex == PLAYER_LIMB_R_SHOULDER) {
*dList = sRightShoulderNearDLs[gSaveContext.linkAge];
*dList = sFirstPersonRightShoulderDLs[gSaveContext.linkAge];
} else if (limbIndex == PLAYER_LIMB_R_FOREARM) {
*dList = D_80125F30[gSaveContext.linkAge];
*dList = sFirstPersonForearmDLs[gSaveContext.linkAge];
} else if (limbIndex == PLAYER_LIMB_R_HAND) {
s32 firstPersonWeaponIndex = gSaveContext.linkAge;
if (CVarGetInteger("gBowSlingShotAmmoFix", 0)) {
@@ -1133,7 +1133,7 @@ s32 func_800902F0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
}
}
*dList = Player_HoldsHookshot(this) ? gLinkAdultRightHandHoldingHookshotFarDL
: sHoldingFirstPersonWeaponDLs[firstPersonWeaponIndex];
: sFirstPersonRightHandHoldingWeaponDLs[firstPersonWeaponIndex];
} else {
*dList = NULL;
}
@@ -1142,8 +1142,8 @@ s32 func_800902F0(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
return false;
}
s32 func_80090440(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
if (!func_8008FCC8(play, limbIndex, dList, pos, rot, thisx)) {
s32 Player_OverrideLimbDrawGameplayCrawling(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
if (!Player_OverrideLimbDrawGameplayCommon(play, limbIndex, dList, pos, rot, thisx)) {
*dList = NULL;
}
@@ -1179,7 +1179,7 @@ u8 func_80090480(PlayState* play, ColliderQuad* collider, WeaponInfo* weaponInfo
}
}
void func_80090604(PlayState* play, Player* this, ColliderQuad* collider, Vec3f* quadSrc) {
void Player_UpdateShieldCollider(PlayState* play, Player* this, ColliderQuad* collider, Vec3f* quadSrc) {
static u8 shieldColTypes[PLAYER_SHIELD_MAX] = {
COLTYPE_METAL,
COLTYPE_WOOD,
@@ -1226,7 +1226,7 @@ void func_800906D4(PlayState* play, Player* this, Vec3f* newTipPos) {
&this->meleeWeaponInfo[0].base);
}
if ((this->swordState > 0) && ((this->meleeWeaponAnimation < 0x18) || (this->stateFlags2 & 0x20000))) {
if ((this->meleeWeaponState > 0) && ((this->meleeWeaponAnimation < 0x18) || (this->stateFlags2 & 0x20000))) {
func_80090480(play, &this->meleeWeaponQuads[0], &this->meleeWeaponInfo[1], &newTipPos[1], &newBasePos[1]);
func_80090480(play, &this->meleeWeaponQuads[1], &this->meleeWeaponInfo[2], &newTipPos[2], &newBasePos[2]);
}
@@ -1375,7 +1375,7 @@ void Player_DrawHookshotReticle(PlayState* play, Player* this, f32 hookshotRange
Vec3f D_801260D4 = { 1100.0f, -700.0f, 0.0f };
f32 sSwordLengths[] = {
f32 sMeleeWeaponLengths[] = {
0.0f, 4000.0f, 3000.0f, 5500.0f, 0.0f, 2500.0f,
};
@@ -1391,14 +1391,14 @@ Color_RGB8 sBottleColors[] = {
{ 255, 255, 255 }, { 255, 255, 255 }, { 80, 80, 255 },
};
Vec3f D_80126128 = { 398.0f, 1419.0f, 244.0f };
Vec3f sLeftHandArrowVec3 = { 398.0f, 1419.0f, 244.0f };
BowStringData sBowStringData[] = {
{ gLinkAdultBowStringDL, { 0.0f, -360.4f, 0.0f } }, // bow
{ gLinkChildSlinghotStringDL, { 606.0f, 236.0f, 0.0f } }, // slingshot
};
Vec3f D_80126154[] = {
Vec3f sRightHandLimbModelShieldQuadVertices[] = {
{ -4500.0f, -3000.0f, -600.0f },
{ 1500.0f, -3000.0f, -600.0f },
{ -4500.0f, 3000.0f, -600.0f },
@@ -1408,17 +1408,17 @@ Vec3f D_80126154[] = {
Vec3f D_80126184 = { 100.0f, 1500.0f, 0.0f };
Vec3f D_80126190 = { 100.0f, 1640.0f, 0.0f };
Vec3f D_8012619C[] = {
Vec3f sSheathLimbModelShieldQuadVertices[] = {
{ -3000.0f, -3000.0f, -900.0f },
{ 3000.0f, -3000.0f, -900.0f },
{ -3000.0f, 3000.0f, -900.0f },
{ 3000.0f, 3000.0f, -900.0f },
};
Vec3f D_801261CC = { 630.0f, 100.0f, -30.0f };
Vec3s D_801261D8 = { 0, 0, 0x7FFF };
Vec3f sSheathLimbModelShieldOnBackPos = { 630.0f, 100.0f, -30.0f };
Vec3s sSheathLimbModelShieldOnBackZyxRot = { 0, 0, 0x7FFF };
Vec3f D_801261E0[] = {
Vec3f sLeftRightFootLimbModelFootPos[] = {
{ 200.0f, 300.0f, 0.0f },
{ 200.0f, 200.0f, 0.0f },
};
@@ -1428,11 +1428,11 @@ Vec3f D_801261E0[] = {
// started working out properly
#define RETICLE_MAX 3.402823466e+12f
void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
Player* this = (Player*)thisx;
if (*dList != NULL) {
Matrix_MultVec3f(&D_8012602C, D_80160000);
Matrix_MultVec3f(&sZeroVec, D_80160000);
}
if (limbIndex == PLAYER_LIMB_L_HAND) {
@@ -1441,7 +1441,7 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
Math_Vec3f_Copy(&this->leftHandPos, D_80160000);
if (this->itemAction == PLAYER_IA_STICK) {
if (this->itemAction == PLAYER_IA_DEKU_STICK) {
Vec3f sp124[3];
OPEN_DISPS(play->state.gfxCtx);
@@ -1449,7 +1449,7 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
if (this->actor.scale.y >= 0.0f) {
D_80126080.x = this->unk_85C * 5000.0f;
func_80090A28(this, sp124);
if (this->swordState != 0) {
if (this->meleeWeaponState != 0) {
EffectBlure_ChangeType(Effect_GetByIndex(this->meleeWeaponEffectIndex), 7); // stick sword type
func_800906D4(play, this, sp124);
} else {
@@ -1466,14 +1466,14 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
gSPDisplayList(POLY_OPA_DISP++, gLinkChildLinkDekuStickDL);
CLOSE_DISPS(play->state.gfxCtx);
} else if ((this->actor.scale.y >= 0.0f) && (this->swordState != 0)) {
} else if ((this->actor.scale.y >= 0.0f) && (this->meleeWeaponState != 0)) {
Vec3f spE4[3];
if (Player_HoldsBrokenKnife(this)) {
D_80126080.x = 1500.0f;
} else {
D_80126080.x = sSwordLengths[Player_GetSwordHeld(this)];
EffectBlure_ChangeType(Effect_GetByIndex(this->meleeWeaponEffectIndex), sSwordTypes[Player_GetSwordHeld(this)]);
D_80126080.x = sMeleeWeaponLengths[Player_GetMeleeWeaponHeld(this)];
EffectBlure_ChangeType(Effect_GetByIndex(this->meleeWeaponEffectIndex), sSwordTypes[Player_GetMeleeWeaponHeld(this)]);
}
func_80090A28(this, spE4);
@@ -1494,7 +1494,7 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
if (this->actor.scale.y >= 0.0f) {
if (!Player_HoldsHookshot(this) && ((hookedActor = this->heldActor) != NULL)) {
if (this->stateFlags1 & 0x200) {
Matrix_MultVec3f(&D_80126128, &hookedActor->world.pos);
Matrix_MultVec3f(&sLeftHandArrowVec3, &hookedActor->world.pos);
Matrix_RotateZYX(0x69E8, -0x5708, 0x458E, MTXMODE_APPLY);
Matrix_Get(&sp14C);
Matrix_MtxFToYXZRotS(&sp14C, &hookedActor->world.rot, 0);
@@ -1537,7 +1537,7 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
Vec3f sp90;
f32 distXYZ;
Matrix_MultVec3f(&D_8012602C, &sp90);
Matrix_MultVec3f(&sZeroVec, &sp90);
distXYZ = Math_Vec3f_DistXYZ(D_80160000, &sp90);
this->unk_858 = distXYZ - 3.0f;
@@ -1568,7 +1568,7 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
CLOSE_DISPS(play->state.gfxCtx);
} else if ((this->actor.scale.y >= 0.0f) && (this->rightHandType == 10)) {
Matrix_Get(&this->shieldMf);
func_80090604(play, this, &this->shieldQuad, D_80126154);
Player_UpdateShieldCollider(play, this, &this->shieldQuad, sRightHandLimbModelShieldQuadVertices);
}
if (this->actor.scale.y >= 0.0f) {
@@ -1630,16 +1630,16 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
if (limbIndex == PLAYER_LIMB_SHEATH) {
if ((this->rightHandType != 10) && (this->rightHandType != 0xFF)) {
if (Player_IsChildWithHylianShield(this)) {
func_80090604(play, this, &this->shieldQuad, D_8012619C);
Player_UpdateShieldCollider(play, this, &this->shieldQuad, sSheathLimbModelShieldQuadVertices);
}
Matrix_TranslateRotateZYX(&D_801261CC, &D_801261D8);
Matrix_TranslateRotateZYX(&sSheathLimbModelShieldOnBackPos, &sSheathLimbModelShieldOnBackZyxRot);
Matrix_Get(&this->shieldMf);
}
} else if (limbIndex == PLAYER_LIMB_HEAD) {
Matrix_MultVec3f(&D_801260D4, &this->actor.focus.pos);
} else {
Vec3f* vec = &D_801261E0[(gSaveContext.linkAge)];
Vec3f* vec = &sLeftRightFootLimbModelFootPos[(gSaveContext.linkAge)];
Actor_SetFeetPos(&this->actor, limbIndex, PLAYER_LIMB_L_FOOT, vec, PLAYER_LIMB_R_FOOT, vec);
}
@@ -1670,11 +1670,11 @@ u32 func_80091738(PlayState* play, u8* segment, SkelAnime* skelAnime) {
return size + 0x8800 + 0x90;
}
u8 D_801261F8[] = { 2, 2, 5 };
u8 sPauseModelGroupBySword[] = { 2, 2, 5 };
s32 func_80091880(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* arg) {
s32 Player_OverrideLimbDrawPause(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* arg) {
u8* ptr = arg;
u8 modelGroup = D_801261F8[ptr[0] > 0 ? ptr[0] - 1 : 0];
u8 modelGroup = sPauseModelGroupBySword[ptr[0] > 0 ? ptr[0] - 1 : 0];
s32 type;
s32 dListOffset = 0;
Gfx** dLists;
@@ -1686,7 +1686,7 @@ s32 func_80091880(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
if (limbIndex == PLAYER_LIMB_L_HAND) {
type = gPlayerModelTypes[modelGroup][1];
D_80160014 = type;
sLeftHandType = type;
if (ptr[0] == 0)
type = 0;
@@ -1696,7 +1696,7 @@ s32 func_80091880(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
}
} else if (limbIndex == PLAYER_LIMB_R_HAND) {
type = gPlayerModelTypes[modelGroup][2];
D_80160018 = type;
sRightHandType = type;
if (type == 10) {
dListOffset = ptr[1] * ptrSize;
}
@@ -1741,7 +1741,7 @@ void Pause_DrawTriforceSpot(PlayState* play, s32 showLightColumn) {
rotation += 0x03E8;
}
void func_80091A24(PlayState* play, void* seg04, void* seg06, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot,
void Player_DrawPauseImpl(PlayState* play, void* seg04, void* seg06, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot,
f32 scale, s32 sword, s32 tunic, s32 shield, s32 boots, s32 width, s32 height, Vec3f* eye, Vec3f* at,
f32 fovy, void* img1, void* img2) {
static Vp viewport = { 128, 224, 511, 0, 128, 224, 511, 0 };
@@ -1805,8 +1805,8 @@ void func_80091A24(PlayState* play, void* seg04, void* seg06, SkelAnime* skelAni
gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList);
func_8008F470(play, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, 0, tunic, boots, 0,
func_80091880, NULL, &sp12C);
Player_DrawImpl(play, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, 0, tunic, boots, 0,
Player_OverrideLimbDrawPause, NULL, &sp12C);
if (CVarGetInteger("gPauseTriforce", 0)) {
@@ -1833,7 +1833,7 @@ s16 EquipedStance; // Link's current mode (Two handed, One handed...)
s16 FrameCountSinceLastAnim = 0; // Time since last animation
s16 MinFrameCount; // Frame to wait before checking if we need to change the animation
void func_8009214C(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale,
void Player_DrawPause(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale,
s32 sword, s32 tunic, s32 shield, s32 boots) {
Input* p1Input = &play->state.input[0];
Vec3f eye = { 0.0f, 0.0f, -400.0f };
@@ -2068,7 +2068,7 @@ void func_8009214C(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* po
}
func_80091A24(play, segment + 0x3800, segment + 0x8800, skelAnime, pos, rot, scale, sword, tunic, shield,
Player_DrawPauseImpl(play, segment + 0x3800, segment + 0x8800, skelAnime, pos, rot, scale, sword, tunic, shield,
boots, 64, 112, &eye, &at, 60.0f, play->state.gfxCtx->curFrameBuffer,
play->state.gfxCtx->curFrameBuffer + 0x1C00);
}