Bring over some player documentation from decomp (#3380)

* Document static variables

* Document enums and structs

* Document some functions

* Document more functions

* actionParam to itemAction and fix build

* Document some local variables and a define

* General cleanup

* Use PlayerMeleeWeaponAnimation enum when appropiate

* Document some function parameters and local variables

* Document some of player struct
This commit is contained in:
Pepe20129
2023-11-26 17:54:54 +01:00
committed by GitHub
parent d0d1d9c487
commit 5b81964ea5
15 changed files with 1916 additions and 1562 deletions

View File

@@ -1426,27 +1426,27 @@ void Actor_MountHorse(PlayState* play, Player* player, Actor* horse) {
}
s32 func_8002DEEC(Player* player) {
return (player->stateFlags1 & 0x20000080) || (player->csMode != 0);
return (player->stateFlags1 & 0x20000080) || (player->csAction != 0);
}
void func_8002DF18(PlayState* play, Player* player) {
func_8006DC68(play, player);
}
s32 func_8002DF38(PlayState* play, Actor* actor, u8 csMode) {
s32 func_8002DF38(PlayState* play, Actor* actor, u8 csAction) {
Player* player = GET_PLAYER(play);
player->csMode = csMode;
player->unk_448 = actor;
player->csAction = csAction;
player->csActor = actor;
player->doorBgCamIndex = 0;
return true;
}
s32 func_8002DF54(PlayState* play, Actor* actor, u8 csMode) {
s32 func_8002DF54(PlayState* play, Actor* actor, u8 csAction) {
Player* player = GET_PLAYER(play);
func_8002DF38(play, actor, csMode);
func_8002DF38(play, actor, csAction);
player->doorBgCamIndex = 1;
return true;
@@ -2121,8 +2121,8 @@ void func_8002F5C4(Actor* actorA, Actor* actorB, PlayState* play) {
void func_8002F5F0(Actor* actor, PlayState* play) {
Player* player = GET_PLAYER(play);
if (actor->xyzDistToPlayerSq < player->unk_6A4) {
player->unk_6A4 = actor->xyzDistToPlayerSq;
if (actor->xyzDistToPlayerSq < player->closestSecretDistSq) {
player->closestSecretDistSq = actor->xyzDistToPlayerSq;
}
}

View File

@@ -4521,7 +4521,7 @@ s32 Camera_Subj4(Camera* camera) {
if ((anim->unk_28 < temp_f16) && !anim->unk_2E) {
player = camera->player;
anim->unk_2E = true;
func_800F4010(&player->actor.projectedPos, player->unk_89E + 0x8B0, 4.0f);
func_800F4010(&player->actor.projectedPos, player->floorSfxOffset + 0x8B0, 4.0f);
} else if (anim->unk_28 > temp_f16) {
anim->unk_2E = false;
}
@@ -7732,7 +7732,7 @@ void Camera_Finish(Camera* camera) {
player->actor.freezeTimer = 0;
player->stateFlags1 &= ~0x20000000;
if (player->csMode != 0) {
if (player->csAction != 0) {
func_8002DF54(camera->play, &player->actor, 7);
osSyncPrintf("camera: player demo end!!\n");
}

View File

@@ -573,7 +573,7 @@ uint8_t Player_IsCustomLinkModel() {
}
s32 Player_InBlockingCsMode(PlayState* play, Player* this) {
return (this->stateFlags1 & 0x20000080) || (this->csMode != 0) || (play->transitionTrigger == TRANS_TRIGGER_START) ||
return (this->stateFlags1 & 0x20000080) || (this->csAction != 0) || (play->transitionTrigger == TRANS_TRIGGER_START) ||
(this->stateFlags1 & 1) || (this->stateFlags3 & 0x80) ||
((gSaveContext.magicState != MAGIC_STATE_IDLE) && (Player_ActionToMagicSpell(this, this->itemAction) >= 0));
}
@@ -668,7 +668,7 @@ void func_8008EC70(Player* this) {
}
void Player_SetEquipmentData(PlayState* play, Player* this) {
if (this->csMode != 0x56) {
if (this->csAction != 0x56) {
this->currentShield = SHIELD_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_SHIELD));
this->currentTunic = TUNIC_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_TUNIC));
this->currentBoots = BOOTS_EQUIP_TO_PLAYER(CUR_EQUIP_VALUE(EQUIP_TYPE_BOOTS));
@@ -893,8 +893,8 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) {
if (play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) { // Room is hot
var = 0;
} else if ((this->unk_840 > 80) &&
((this->currentBoots == PLAYER_BOOTS_IRON) || (this->unk_840 >= 300))) { // Deep underwater
} else if ((this->underwaterTimer > 80) &&
((this->currentBoots == PLAYER_BOOTS_IRON) || (this->underwaterTimer >= 300))) { // Deep underwater
var = ((this->currentBoots == PLAYER_BOOTS_IRON) && (this->actor.bgCheckFlags & 1)) ? 1 : 3;
} else if (this->stateFlags1 & 0x8000000) { // Swimming
var = 2;