diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2023-05-28 17:41:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-28 17:41:37 -0400 |
| commit | efc9df3f56046bf11097715204aee96d433a952e (patch) | |
| tree | ef2785a9edfd7b3debe1364723f700047f031973 /src/code | |
| parent | 20f7e2199ac4c53095f3bc60ec30958f1bfb5e41 (diff) | |
`ovl_player_actor`: Dawn of a new PR (#1227)
* Rename Player_UpdateBottleHeld
* Match func_808497A0
* func_80852290 NON_MATCHING
* Match func_8083B3B4
* Params cleanup
* Match func_8083FBC4
* sfxId cleanups and others
* Fix declaration of functions from D_8085D990
* Change D_8085BE84 to be a 2D array
* ARRAY_COUNT_2D
* Match func_8085ADA0
* func_808426F0 nonmatching
* Match func_80852290
* Match func_808426F0
Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
* Add notes to Player_SetDoAction
* Name putAwayCountdown
* rebase
* Match func_80856918
* format
* func_8084933C nonmatching
small amount of boomerang documentation
* Progress on moving data near where it is used
* finish moving data
* format
* cleanup up remaining data
* more match
* Some minor cleanups
* PlayerCsMode enum
* func_80851F18 nonmatching
* Fix unk_B10
* Purge ExchangeItemID enum
* Rename `targetActor` to `talkActor`
* Name `targetedActor`
* PLAYER_LIMB_BUF_SIZE
Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com>
* Change SkelAnime Player functions to take a void pointer for the corresponding buffers
* Use PlayerAnimationFrame on Player_DrawImpl
* Match func_8082F1AC
* Match func_8083D23C
* cleanup
* Match and clean up func_808373F8
* Match and document func_8083A98C
* PLAYER_PARAMS macro and PlayerInitMode enum
* Preliminary names for InitMode functions
* Match func_8083C8E8
* remove redundant externs
* Match func_8084933C
* cleanup func_8084933C
* Access D_8085BE84 directly instead of using a macro
* Match func_8084AC84
* Fix boomearng typo
* OK boomerang
* cleanup func_8083D168
* untargetedRotY
* this->unk_14E = ABS_ALT(var_v1);
* GIFIELD macros
* sort of a match
* Match func_8084C16C
Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com>
* Use the same trick to match func_808573A4
* Add note on Deku spinning
* Match func_8084D18C
* Match func_80850D68
* Improve func_80832660
* Match func_80854EFC
Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com>
* Rename unk_B2A to getItemDrawId
* Some cleanup
* fix merge issues
* format
* minor anim docs
* Match func_808553F4
* Cleanup func_808553F4
* func_8083D860 nonmatching
* Match func_8083D860
* Defake func_80859BA8
* ()
* Add notes to PlayerAnimGroup enum
* underwaterTimer
Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
* some stateFlags cleaning
* more stateFlags cleaning
* some notes and minor cleanups
* more general cleanups
* Slightly less fake func_80832CAC
* Document some melee weapon damage stuff
* Mark lunge storage
* Note PCS patch
* match
* add notes to bss
* yeet extra indentation
* add reloc as nonmatching to spec
* floorSfxOffset
* Player_GetFloorSfx
* Player_GetFloorSfxByAge
* Comments for AnimSfx dunctions
* Name some AnimSfx functions
* Name AnimSfx stuff
* Some PlayerAgeProperties notes
* use animflag defines
* Player_SpawnExplosive
* fix enum and some other minor fixes
* Bit more misc. cleanup
* Use OoT's version of func_808333CC
* Note on quickspin buffer
* Final nonmatching, func_80851F18
Co-authored-by: Synray <31429825+Synray@users.noreply.github.com>
* RIP player.c
* Name Player_StopHorizontalMovement
* misc fixes
* Actor_DeactivateLens
* fixes
* typos and tweaks
* minor stuff
* add names as comments on the animgoup array
* Correct some function names and data type
* add anim commets to ageproperties
* some notes
* De-fake func_80840F90
* Defake & clean up func_8085ADA0
* Improve func_80859BA8
* Enums in func_80852B28
* Name some secret-related things
* 3 small things
* stuff
* Player_TalkWithPlayer
* SurfaceType_GetFloorType
* SurfaceType_GetWallFlags
* and more bgcheck stuff
* more bss naming
* sPlayerControlInput
* clean up func_80836F10 a bit
* name the parameters of func_80835BF8
* door stuff
* remove NON_MATCHING
* remove D_8085D2B0 padding
* Name some Player_Cutscene_ functions
* various cleanups
* format
* remainingHopsCounter
* some cleanups on the struct
* Actor_RequestRumble
* this->exchangeItemId = PLAYER_AP_NONE;
* fix merge stuff
* format
* PlayerUnkAA5
* Name two cylinder-related functions
* BSS
* Add MagicConsume's enum, treat lensActive as bool
* Update func_808332A0 based on better info
* fix merge
* fix merge issues
* remove redundant comments
* Name Player_AddQuake
* ANIM_FLAG_UPDATE*_*Y
* Format
* AT_TYPE_ENEMY
* fix merge issues
* format
* fix uintptr_ts
* Rename
* Name leftHandMf
* fix merge issues
* format
* exchangeItemId <= PLAYER_IA_MINUS1
* getItemDrawIdPlusOne
* currentActorCsIndex
* <= PLAYER_IA_MINUS1
* fix merge issues
* format
* namefixer and bss
* fix build
* bombs parameters cleanup
* bss
* Fix building
* fix building
* Fix building
* Fix building and cleanups
* Pre-PR cleanup
* really...
* format
* review
* stateFlag Mistakes
* 268 * 0.1f
* z64door.h
* fix cutscene stuff
* bss
* Update include/z64player.h
Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
* Update include/z64player.h
Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
* reiew
* PR Review
* collision
* review
* format and a few stuff i missed
* EnBomExplosiveType
* weekeventregconvert and eventinfconvert
* more review
* review
* bss
* review
* re format sGetItemTable
* Entangle PlayerMask and PlayerItemAction
* a few extra cases i missed
* bss
* review
* EnArrow stuff
* ARROW_MAGIC_DEKU_BUBBLE
* minor format
* merge
* fix bss
* review
* !ARROW_IS_ARROW
* review
* bool cleanup
* fix merge
* review
* Player_StopCutscene
* Player_RequestQuake
* quakeIndex
* Player_RequestQuakeAndRumble
* knobDoor and slidingDoor
* bss
* fix
* review
* dog and float
---------
Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com>
Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
Co-authored-by: petrie911 <pmontag@PHYS-S129.iowa.uiowa.edu>
Co-authored-by: petrie911 <69443847+petrie911@users.noreply.github.com>
Co-authored-by: Synray <31429825+Synray@users.noreply.github.com>
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 75 | ||||
| -rw-r--r-- | src/code/z_camera.c | 10 | ||||
| -rw-r--r-- | src/code/z_eff_blure.c | 84 | ||||
| -rw-r--r-- | src/code/z_en_hy_code.c | 16 | ||||
| -rw-r--r-- | src/code/z_play.c | 4 | ||||
| -rw-r--r-- | src/code/z_player_lib.c | 58 | ||||
| -rw-r--r-- | src/code/z_skelanime.c | 2 | ||||
| -rw-r--r-- | src/code/z_sub_s.c | 4 |
8 files changed, 123 insertions, 130 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index a5ca767dc..ffa77e9bf 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1374,7 +1374,7 @@ s32 func_800B724C(PlayState* play, Actor* actor, u8 csMode) { player->csMode = csMode; player->unk_398 = actor; - player->unk_3BA = 0; + player->doorBgCamIndex = 0; return true; } @@ -1382,7 +1382,7 @@ s32 func_800B7298(PlayState* play, Actor* actor, u8 csMode) { Player* player = GET_PLAYER(play); if (func_800B724C(play, actor, csMode)) { - player->unk_3BA = 1; + player->doorBgCamIndex = 1; return true; } return false; @@ -3490,49 +3490,50 @@ void Enemy_StartFinishingBlow(PlayState* play, Actor* actor) { } // blinking routine -s16 func_800BBAC0(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) { - if (DECR(arg0[1]) == 0) { - arg0[1] = Rand_S16Offset(arg1, arg2); +s16 func_800BBAC0(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3) { + if (DECR(info->blinkTimer) == 0) { + info->blinkTimer = Rand_S16Offset(arg1, arg2); } - if (arg0[1] - arg3 > 0) { - arg0[0] = 0; - } else if ((arg0[1] - arg3 >= -1) || (arg0[1] < 2)) { - arg0[0] = 1; + if (info->blinkTimer - arg3 > 0) { + info->eyeTexIndex = 0; + } else if ((info->blinkTimer - arg3 >= -1) || (info->blinkTimer < 2)) { + info->eyeTexIndex = 1; } else { - arg0[0] = 2; + info->eyeTexIndex = 2; } - return arg0[0]; + return info->eyeTexIndex; } // blinking routine -s16 func_800BBB74(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) { - if (DECR(arg0[1]) == 0) { - arg0[1] = Rand_S16Offset(arg1, arg2); +s16 func_800BBB74(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3) { + if (DECR(info->blinkTimer) == 0) { + info->blinkTimer = Rand_S16Offset(arg1, arg2); } - if (arg0[1] - arg3 > 0) { - arg0[0] = 0; - } else if (arg0[1] - arg3 == 0) { - arg0[0] = 1; + if (info->blinkTimer - arg3 > 0) { + info->eyeTexIndex = 0; + } else if (info->blinkTimer - arg3 == 0) { + info->eyeTexIndex = 1; } else { - arg0[0] = 2; + info->eyeTexIndex = 2; } - return arg0[0]; + return info->eyeTexIndex; } // unused blinking routine -s16 func_800BBC20(s16 arg0[2], s16 arg1, s16 arg2, s16 arg3) { - if (DECR(arg0[1]) == 0) { - arg0[1] = Rand_S16Offset(arg1, arg2); - arg0[0]++; - if ((arg0[0] % 3) == 0) { - arg0[0] = (s32)(Rand_ZeroOne() * arg3) * 3; +s16 func_800BBC20(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3) { + if (DECR(info->blinkTimer) == 0) { + info->blinkTimer = Rand_S16Offset(arg1, arg2); + info->eyeTexIndex++; + if ((info->eyeTexIndex % 3) == 0) { + info->eyeTexIndex = (s32)(Rand_ZeroOne() * arg3) * 3; } } - return arg0[0]; + + return info->eyeTexIndex; } void Actor_SpawnBodyParts(Actor* actor, PlayState* play, s32 partParams, Gfx** dList) { @@ -3614,15 +3615,15 @@ void func_800BC154(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 act // Damage flags for EnArrow u32 sArrowDmgFlags[] = { - DMG_FIRE_ARROW, // ENARROW_0 - DMG_NORMAL_ARROW, // ENARROW_1 - DMG_NORMAL_ARROW, // ENARROW_2 - DMG_FIRE_ARROW, // ENARROW_3 - DMG_ICE_ARROW, // ENARROW_4 - DMG_LIGHT_ARROW, // ENARROW_5 - DMG_DEKU_NUT, // ENARROW_6 - DMG_DEKU_BUBBLE, // ENARROW_7 - DMG_DEKU_NUT, // ENARROW_8 + DMG_FIRE_ARROW, // ARROW_TYPE_NORMAL_LIT + DMG_NORMAL_ARROW, // ARROW_TYPE_NORMAL_HORSE + DMG_NORMAL_ARROW, // ARROW_TYPE_NORMAL + DMG_FIRE_ARROW, // ARROW_TYPE_FIRE + DMG_ICE_ARROW, // ARROW_TYPE_ICE + DMG_LIGHT_ARROW, // ARROW_TYPE_LIGHT + DMG_DEKU_NUT, // ARROW_TYPE_SLINGSHOT + DMG_DEKU_BUBBLE, // ARROW_TYPE_DEKU_BUBBLE + DMG_DEKU_NUT, // ARROW_TYPE_DEKU_NUT }; u32 Actor_GetArrowDmgFlags(s32 params) { @@ -4476,7 +4477,7 @@ s32 func_800BE184(PlayState* play, Actor* actor, f32 xzDist, s16 arg3, s16 arg4, s16 phi_v0 = BINANG_SUB(BINANG_ROT180(actor->yawTowardsPlayer), player->actor.shape.rot.y); s16 temp_t0 = actor->yawTowardsPlayer - arg5; - if ((actor->xzDistToPlayer <= xzDist) && (player->meleeWeaponState != 0)) { + if ((actor->xzDistToPlayer <= xzDist) && (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0)) { if ((arg4 >= ABS_ALT(phi_v0)) && (arg3 >= ABS_ALT(temp_t0))) { return true; } diff --git a/src/code/z_camera.c b/src/code/z_camera.c index ea600b30e..89b148942 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -465,13 +465,13 @@ s32 func_800CBA7C(Camera* camera) { } } -s32 func_800CBAAC(Camera* camera) { +PlayerMeleeWeaponState func_800CBAAC(Camera* camera) { Actor* focalActor = camera->focalActor; if (camera->focalActor == &GET_PLAYER(camera->play)->actor) { return ((Player*)focalActor)->meleeWeaponState; } else { - return 0; + return PLAYER_MELEE_WEAPON_STATE_0; } } @@ -506,13 +506,13 @@ s32 func_800CBB88(Camera* camera) { Actor* focalActor = camera->focalActor; if (camera->focalActor == &GET_PLAYER(camera->play)->actor) { - if ((((Player*)focalActor)->meleeWeaponState != 0) && + if ((((Player*)focalActor)->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) && (((Player*)focalActor)->meleeWeaponAnimation == PLAYER_MWA_GORON_PUNCH_BUTT)) { return 3; } if ((((Player*)focalActor)->stateFlags2 & PLAYER_STATE2_20000) || - ((((Player*)focalActor)->meleeWeaponState != 0) && + ((((Player*)focalActor)->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) && (((Player*)focalActor)->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_KICK))) { return 1; } @@ -3958,7 +3958,7 @@ s32 Camera_Battle1(Camera* camera) { } camera->roll = Camera_ScaledStepToCeilS(sp88, camera->roll, 0.06f, 5); - if (func_800CBAAC(camera) != 0) { + if (func_800CBAAC(camera) != PLAYER_MELEE_WEAPON_STATE_0) { phi_f12 = ((camera->play->state.frames & 8) != 0) ? roData->unk_20 - (roData->unk_20 * 0.5f) : roData->unk_20; } else { phi_f12 = ((gSaveContext.save.saveInfo.playerData.health <= 16) ? 0.8f : 1.0f) * (sp78 - (sp78 * 0.05f * spEC)); diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c index 5f0221969..520431401 100644 --- a/src/code/z_eff_blure.c +++ b/src/code/z_eff_blure.c @@ -114,23 +114,17 @@ void EffectBlure_Init1(void* thisx, void* initParamsx) { EffectBlureInit1* initParams = (EffectBlureInit1*)initParamsx; if ((this != NULL) && (initParams != NULL)) { + s32 i; + EffectBlure_InitElements(this); - this->p1StartColor.r = initParams->p1StartColor[0]; - this->p2StartColor.r = initParams->p2StartColor[0]; - this->p1EndColor.r = initParams->p1EndColor[0]; - this->p2EndColor.r = initParams->p2EndColor[0]; - this->p1StartColor.g = initParams->p1StartColor[1]; - this->p2StartColor.g = initParams->p2StartColor[1]; - this->p1EndColor.g = initParams->p1EndColor[1]; - this->p2EndColor.g = initParams->p2EndColor[1]; - this->p1StartColor.b = initParams->p1StartColor[2]; - this->p2StartColor.b = initParams->p2StartColor[2]; - this->p1EndColor.b = initParams->p1EndColor[2]; - this->p2EndColor.b = initParams->p2EndColor[2]; - this->p1StartColor.a = initParams->p1StartColor[3]; - this->p2StartColor.a = initParams->p2StartColor[3]; - this->p1EndColor.a = initParams->p1EndColor[3]; - this->p2EndColor.a = initParams->p2EndColor[3]; + + for (i = 0; i < 4; i++) { + this->p1StartColor[i] = initParams->p1StartColor[i]; + this->p2StartColor[i] = initParams->p2StartColor[i]; + this->p1EndColor[i] = initParams->p1EndColor[i]; + this->p2EndColor[i] = initParams->p2EndColor[i]; + } + this->elemDuration = initParams->elemDuration; this->unkFlag = initParams->unkFlag; this->calcMode = initParams->calcMode; @@ -155,23 +149,17 @@ void EffectBlure_Init2(void* thisx, void* initParamsx) { EffectBlureInit2* initParams = (EffectBlureInit2*)initParamsx; if ((this != NULL) && (initParams != NULL)) { + s32 i; + EffectBlure_InitElements(this); - this->p1StartColor.r = initParams->p1StartColor[0]; - this->p2StartColor.r = initParams->p2StartColor[0]; - this->p1EndColor.r = initParams->p1EndColor[0]; - this->p2EndColor.r = initParams->p2EndColor[0]; - this->p1StartColor.g = initParams->p1StartColor[1]; - this->p2StartColor.g = initParams->p2StartColor[1]; - this->p1EndColor.g = initParams->p1EndColor[1]; - this->p2EndColor.g = initParams->p2EndColor[1]; - this->p1StartColor.b = initParams->p1StartColor[2]; - this->p2StartColor.b = initParams->p2StartColor[2]; - this->p1EndColor.b = initParams->p1EndColor[2]; - this->p2EndColor.b = initParams->p2EndColor[2]; - this->p1StartColor.a = initParams->p1StartColor[3]; - this->p2StartColor.a = initParams->p2StartColor[3]; - this->p1EndColor.a = initParams->p1EndColor[3]; - this->p2EndColor.a = initParams->p2EndColor[3]; + + for (i = 0; i < 4; i++) { + this->p1StartColor[i] = initParams->p1StartColor[i]; + this->p2StartColor[i] = initParams->p2StartColor[i]; + this->p1EndColor[i] = initParams->p1EndColor[i]; + this->p2EndColor[i] = initParams->p2EndColor[i]; + } + this->elemDuration = initParams->elemDuration; this->unkFlag = initParams->unkFlag; this->calcMode = initParams->calcMode; @@ -372,14 +360,14 @@ void EffectBlure_GetComputedValues(EffectBlure* this, s32 index, f32 ratio, Vec3 color1->r = color1->g = color1->b = color1->a = 255; color2->r = color2->g = color2->b = color2->a = 255; } else { - color1->r = func_800B0A24(this->p1StartColor.r, this->p1EndColor.r, ratio); - color1->g = func_800B0A24(this->p1StartColor.g, this->p1EndColor.g, ratio); - color1->b = func_800B0A24(this->p1StartColor.b, this->p1EndColor.b, ratio); - color1->a = func_800B0A24(this->p1StartColor.a, this->p1EndColor.a, ratio); - color2->r = func_800B0A24(this->p2StartColor.r, this->p2EndColor.r, ratio); - color2->g = func_800B0A24(this->p2StartColor.g, this->p2EndColor.g, ratio); - color2->b = func_800B0A24(this->p2StartColor.b, this->p2EndColor.b, ratio); - color2->a = func_800B0A24(this->p2StartColor.a, this->p2EndColor.a, ratio); + color1->r = func_800B0A24(this->p1StartColor[0], this->p1EndColor[0], ratio); + color1->g = func_800B0A24(this->p1StartColor[1], this->p1EndColor[1], ratio); + color1->b = func_800B0A24(this->p1StartColor[2], this->p1EndColor[2], ratio); + color1->a = func_800B0A24(this->p1StartColor[3], this->p1EndColor[3], ratio); + color2->r = func_800B0A24(this->p2StartColor[0], this->p2EndColor[0], ratio); + color2->g = func_800B0A24(this->p2StartColor[1], this->p2EndColor[1], ratio); + color2->b = func_800B0A24(this->p2StartColor[2], this->p2EndColor[2], ratio); + color2->a = func_800B0A24(this->p2StartColor[3], this->p2EndColor[3], ratio); } } @@ -992,19 +980,19 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) { vtx[j].v.flag = 0; vtx[j].v.tc[0] = 0; vtx[j].v.tc[1] = 0; - vtx[j].v.cn[0] = func_800B0A24(this->p1StartColor.r, this->p1EndColor.r, ratio); - vtx[j].v.cn[1] = func_800B0A24(this->p1StartColor.g, this->p1EndColor.g, ratio); - vtx[j].v.cn[2] = func_800B0A24(this->p1StartColor.b, this->p1EndColor.b, ratio); - vtx[j].v.cn[3] = func_800B0A24(this->p1StartColor.a, this->p1EndColor.a, ratio); + vtx[j].v.cn[0] = func_800B0A24(this->p1StartColor[0], this->p1EndColor[0], ratio); + vtx[j].v.cn[1] = func_800B0A24(this->p1StartColor[1], this->p1EndColor[1], ratio); + vtx[j].v.cn[2] = func_800B0A24(this->p1StartColor[2], this->p1EndColor[2], ratio); + vtx[j].v.cn[3] = func_800B0A24(this->p1StartColor[3], this->p1EndColor[3], ratio); j++; vtx[j].v.flag = 0; vtx[j].v.tc[0] = 0; vtx[j].v.tc[1] = 0; - vtx[j].v.cn[0] = func_800B0A24(this->p2StartColor.r, this->p2EndColor.r, ratio); - vtx[j].v.cn[1] = func_800B0A24(this->p2StartColor.g, this->p2EndColor.g, ratio); - vtx[j].v.cn[2] = func_800B0A24(this->p2StartColor.b, this->p2EndColor.b, ratio); - vtx[j].v.cn[3] = func_800B0A24(this->p2StartColor.a, this->p2EndColor.a, ratio); + vtx[j].v.cn[0] = func_800B0A24(this->p2StartColor[0], this->p2EndColor[0], ratio); + vtx[j].v.cn[1] = func_800B0A24(this->p2StartColor[1], this->p2EndColor[1], ratio); + vtx[j].v.cn[2] = func_800B0A24(this->p2StartColor[2], this->p2EndColor[2], ratio); + vtx[j].v.cn[3] = func_800B0A24(this->p2StartColor[3], this->p2EndColor[3], ratio); j++; } } diff --git a/src/code/z_en_hy_code.c b/src/code/z_en_hy_code.c index 674f4bfa4..b5992dec4 100644 --- a/src/code/z_en_hy_code.c +++ b/src/code/z_en_hy_code.c @@ -69,13 +69,13 @@ EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play) { do { doorIter = SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR); door = (EnDoor*)doorIter; - dist = Actor_WorldDistXYZToActor(actor, &door->dyna.actor); + dist = Actor_WorldDistXYZToActor(actor, &door->knobDoor.dyna.actor); if (!isSetup || (dist < minDist)) { nearestDoor = door; minDist = dist; isSetup = true; } - doorIter = door->dyna.actor.next; + doorIter = door->knobDoor.dyna.actor.next; } while (doorIter != NULL); if (1) {} @@ -134,16 +134,16 @@ void func_800F0BB4(EnHy* enHy, PlayState* play, EnDoor* door, s16 arg3, s16 arg4 Vec3f offset; f32 phi_f0; - Actor_OffsetOfPointInActorCoords(&door->dyna.actor, &offset, &enHy->actor.world.pos); + Actor_OffsetOfPointInActorCoords(&door->knobDoor.dyna.actor, &offset, &enHy->actor.world.pos); phi_f0 = (offset.z >= 0.0f) ? 1.0f : -1.0f; animIndex = ((s8)phi_f0 < 0) ? 0 : 2; EnHy_ChangeObjectAndAnim(enHy, play, (animIndex == 0) ? arg3 : arg4); enHy->skelAnime.baseTransl = *enHy->skelAnime.jointTable; enHy->skelAnime.prevTransl = *enHy->skelAnime.jointTable; - enHy->skelAnime.moveFlags |= (ANIM_FLAG_UPDATEY | ANIM_FLAG_1); + enHy->skelAnime.moveFlags |= (ANIM_FLAG_UPDATE_Y | ANIM_FLAG_1); AnimationContext_SetMoveActor(play, &enHy->actor, &enHy->skelAnime, 1.0f); - door->unk_1A1 = 1; - door->animIndex = animIndex; + door->knobDoor.playOpenAnim = true; + door->knobDoor.animIndex = animIndex; } s32 func_800F0CE4(EnHy* enHy, PlayState* play, ActorFunc draw, s16 arg3, s16 arg4, f32 arg5) { @@ -157,7 +157,7 @@ s32 func_800F0CE4(EnHy* enHy, PlayState* play, ActorFunc draw, s16 arg3, s16 arg if (door != NULL) { ret = true; func_800F0BB4(enHy, play, door, arg3, arg4); - yaw = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->dyna.actor.world.pos); + yaw = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->knobDoor.dyna.actor.world.pos); enHy->actor.world.pos.x += arg5 * Math_SinS(yaw); enHy->actor.world.pos.z += arg5 * Math_CosS(yaw); enHy->actor.world.rot.y = -yaw; @@ -179,7 +179,7 @@ s32 func_800F0DD4(EnHy* enHy, PlayState* play, s16 arg2, s16 arg3) { if (door != NULL) { ret = true; func_800F0BB4(enHy, play, door, arg2, arg3); - enHy->actor.shape.rot.y = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->dyna.actor.world.pos); + enHy->actor.shape.rot.y = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->knobDoor.dyna.actor.world.pos); enHy->actor.world.rot.y = enHy->actor.shape.rot.y; enHy->actor.gravity = 0.0f; enHy->actor.flags &= ~ACTOR_FLAG_1; diff --git a/src/code/z_play.c b/src/code/z_play.c index 7f615018e..e25b50b4b 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -2327,8 +2327,8 @@ void Play_Init(GameState* thisx) { Camera_InitFocalActorSettings(&this->mainCamera, &player->actor); gDbgCamEnabled = false; - if ((player->actor.params & 0xFF) != 0xFF) { - Camera_ChangeActorCsCamIndex(&this->mainCamera, player->actor.params & 0xFF); + if (PLAYER_GET_BG_CAM_INDEX(&player->actor) != 0xFF) { + Camera_ChangeActorCsCamIndex(&this->mainCamera, PLAYER_GET_BG_CAM_INDEX(&player->actor)); } CutsceneManager_StoreCamera(&this->mainCamera); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index f8b33b853..5509fd4a1 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -472,7 +472,7 @@ void func_80123140(PlayState* play, Player* player) { REG(39) = bootRegs[8]; REG(43) = bootRegs[9]; R_RUN_SPEED_LIMIT = bootRegs[10]; - REG(68) = bootRegs[11]; + REG(68) = bootRegs[11]; // gravity REG(69) = bootRegs[12]; IREG(66) = bootRegs[13]; IREG(67) = bootRegs[14]; @@ -503,7 +503,7 @@ s32 Player_InBlockingCsMode(PlayState* play, Player* player) { s32 Player_InCsMode(PlayState* play) { Player* player = GET_PLAYER(play); - return Player_InBlockingCsMode(play, player) || player->unk_AA5 == 5; + return Player_InBlockingCsMode(play, player) || (player->unk_AA5 == PLAYER_UNKAA5_5); } s32 func_80123420(Player* player) { @@ -556,8 +556,8 @@ s32 func_801235DC(PlayState* play, f32 arg1, s16 arg2) { Player* player = GET_PLAYER(play); if (player->stateFlags3 & PLAYER_STATE3_1000) { - player->unk_B08[0] = arg1; - player->unk_B08[1] += arg1 * 0.05f; + player->unk_B08 = arg1; + player->unk_B0C += arg1 * 0.05f; player->currentYaw = arg2; player->actor.home.rot.y = arg2; player->actor.shape.rot.y = arg2; @@ -659,7 +659,7 @@ u8 sActionModelGroups[PLAYER_IA_MAX] = { PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_KOKIRI PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_RAZOR PLAYER_MODELGROUP_ONE_HAND_SWORD, // PLAYER_IA_SWORD_GILDED - PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_IA_SWORD_GREAT_FAIRY + PLAYER_MODELGROUP_TWO_HAND_SWORD, // PLAYER_IA_SWORD_TWO_HANDED PLAYER_MODELGROUP_STICK, // PLAYER_IA_STICK PLAYER_MODELGROUP_ZORA_FINS, // PLAYER_IA_ZORA_FINS PLAYER_MODELGROUP_BOW, // PLAYER_IA_BOW @@ -1316,6 +1316,7 @@ void Player_UpdateBottleHeld(PlayState* play, Player* player, ItemId itemId, Pla player->itemAction = itemAction; } +// Player_Untarget / Player_StopTargeting? void func_80123DA4(Player* player) { player->targetedActor = NULL; player->stateFlags2 &= ~PLAYER_STATE2_2000; @@ -1445,7 +1446,7 @@ PlayerMeleeWeapon Player_GetMeleeWeaponHeld(Player* player) { s32 Player_IsHoldingTwoHandedWeapon(Player* player) { // Relies on the itemActions for two-handed weapons being contiguous. - if ((player->heldItemAction >= PLAYER_IA_SWORD_GREAT_FAIRY) && (player->heldItemAction <= PLAYER_IA_STICK)) { + if ((player->heldItemAction >= PLAYER_IA_SWORD_TWO_HANDED) && (player->heldItemAction <= PLAYER_IA_STICK)) { return true; } @@ -2038,7 +2039,7 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** pos->x *= player->ageProperties->unk_08; pos->z *= player->ageProperties->unk_08; } - if (!(player->skelAnime.moveFlags & ANIM_FLAG_4) || (player->skelAnime.moveFlags & ANIM_FLAG_UPDATEY)) { + if (!(player->skelAnime.moveFlags & ANIM_FLAG_4) || (player->skelAnime.moveFlags & ANIM_FLAG_UPDATE_Y)) { pos->y *= player->ageProperties->unk_08; } } @@ -2552,14 +2553,16 @@ void func_8012669C(PlayState* play, Player* player, Vec3f* arg2, Vec3f* arg3) { Matrix_MultVec3f(arg2, &sp3C); Matrix_MultVec3f(arg3, &sp30); - if (player->meleeWeaponState != 0) { + if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) { if (func_80126440(play, NULL, &player->meleeWeaponInfo[0], &sp3C, &sp30) && (player->transformation != PLAYER_FORM_GORON) && (!(player->stateFlags1 & PLAYER_STATE1_400000))) { EffectBlure_AddVertex(Effect_GetByIndex(player->meleeWeaponEffectIndex[0]), &player->meleeWeaponInfo[0].tip, &player->meleeWeaponInfo[0].base); } - if ((player->meleeWeaponState > 0) && ((player->meleeWeaponAnimation < PLAYER_MWA_SPIN_ATTACK_1H) || - (player->stateFlags2 & PLAYER_STATE2_20000))) { + + if ((player->meleeWeaponState >= PLAYER_MELEE_WEAPON_STATE_1) && + ((player->meleeWeaponAnimation < PLAYER_MWA_SPIN_ATTACK_1H) || + (player->stateFlags2 & PLAYER_STATE2_20000))) { Matrix_MultVec3f(&arg2[1], &sp3C); Matrix_MultVec3f(&arg3[1], &sp30); func_80126440(play, &player->meleeWeaponQuads[0], &player->meleeWeaponInfo[1], &sp3C, &sp30); @@ -2714,7 +2717,7 @@ void func_80126BD0(PlayState* play, Player* player, s32 arg2) { gSPDisplayList(POLY_OPA_DISP++, D_801C0AB4[arg2]); - if (player->meleeWeaponState != 0) { + if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) { if ((((player->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_LEFT)) && (arg2 == 0)) || ((player->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_COMBO) && (arg2 != 0))) { func_8012669C(play, player, D_801C0A00, D_801C09DC); @@ -3296,7 +3299,7 @@ s32 func_80128640(PlayState* play, Player* player, Gfx* dlist) { Matrix_Push(); Matrix_Translate(-428.26f, 267.2f, -33.82f, MTXMODE_APPLY); Matrix_RotateZYX(-0x8000, 0, 0x4000, MTXMODE_APPLY); - Matrix_Scale(1.0f, player->unk_B08[1], 1.0f, MTXMODE_APPLY); + Matrix_Scale(1.0f, player->unk_B0C, 1.0f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gDekuStickDL); @@ -3413,7 +3416,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G 3000.0f, // PLAYER_MELEEWEAPON_SWORD_KOKIRI 3000.0f, // PLAYER_MELEEWEAPON_SWORD_RAZOR 4000.0f, // PLAYER_MELEEWEAPON_SWORD_GILDED - 5500.0f, // PLAYER_MELEEWEAPON_SWORD_GREAT_FAIRY + 5500.0f, // PLAYER_MELEEWEAPON_SWORD_TWO_HANDED -1.0f, // PLAYER_MELEEWEAPON_STICK 2500.0f, // PLAYER_MELEEWEAPON_ZORA_FINS }; @@ -3421,19 +3424,19 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G if ((player->transformation == PLAYER_FORM_FIERCE_DEITY) || ((player->transformation != PLAYER_FORM_ZORA) && ((player->itemAction == PLAYER_IA_STICK) || - ((player->meleeWeaponState != 0) && + ((player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) && (player->meleeWeaponAnimation != PLAYER_MWA_GORON_PUNCH_RIGHT) && (player->meleeWeaponAnimation != PLAYER_MWA_GORON_PUNCH_BUTT))))) { if (player->itemAction == PLAYER_IA_STICK) { - D_801C0994->x = player->unk_B08[1] * 5000.0f; + D_801C0994->x = player->unk_B0C * 5000.0f; } else { D_801C0994->x = sMeleeWeaponLengths[Player_GetMeleeWeaponHeld(player)]; } func_80126B8C(play, player); } - Matrix_Get(&player->mf_CC4); - Matrix_MtxFToYXZRot(&player->mf_CC4, &player->leftHandWorld.rot, false); + Matrix_Get(&player->leftHandMf); + Matrix_MtxFToYXZRot(&player->leftHandMf, &player->leftHandWorld.rot, false); } } } else if (limbIndex == PLAYER_LIMB_RIGHT_HAND) { @@ -3458,18 +3461,18 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G Matrix_MultZero(&sp20C); temp_fv0 = Math_Vec3f_DistXYZ(sPlayerCurBodyPartPos, &sp20C); - player->unk_B08[0] = temp_fv0 - 3.0f; + player->unk_B08 = temp_fv0 - 3.0f; if (temp_fv0 < 3.0f) { - player->unk_B08[0] = 0.0f; + player->unk_B08 = 0.0f; } else { - player->unk_B08[0] *= 1.6f; - if (player->unk_B08[0] > 1.0f) { - player->unk_B08[0] = 1.0f; + player->unk_B08 *= 1.6f; + if (player->unk_B08 > 1.0f) { + player->unk_B08 = 1.0f; } } - player->unk_B08[1] = -0.5f; + player->unk_B0C = -0.5f; } - Matrix_Scale(1.0f, player->unk_B08[0], 1.0f, MTXMODE_APPLY); + Matrix_Scale(1.0f, player->unk_B08, 1.0f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -3518,7 +3521,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G Player_DrawHookshotReticle(play, player, 77600.0f); } } - } else if (player->meleeWeaponState != 0) { + } else if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) { if (player->meleeWeaponAnimation == PLAYER_MWA_GORON_PUNCH_RIGHT) { func_80126B8C(play, player); } @@ -3590,6 +3593,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G for (i = 0; i < ARRAY_COUNT(sp178); i++) { Matrix_Push(); Matrix_Scale(sp178[i].x, sp178[i].y, sp178[i].z, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -3811,7 +3815,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G &player->meleeWeaponInfo[0].base); } } else if (limbIndex == PLAYER_LIMB_RIGHT_SHIN) { - if (player->meleeWeaponState != 0) { + if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) { if ((player->meleeWeaponAnimation == PLAYER_MWA_ZORA_PUNCH_KICK) || (player->meleeWeaponAnimation == PLAYER_MWA_ZORA_JUMPKICK_START) || (player->meleeWeaponAnimation == PLAYER_MWA_ZORA_JUMPKICK_FINISH)) { @@ -3819,7 +3823,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G } } } else if (limbIndex == PLAYER_LIMB_WAIST) { - if (player->meleeWeaponState != 0) { + if (player->meleeWeaponState != PLAYER_MELEE_WEAPON_STATE_0) { if (player->meleeWeaponAnimation == PLAYER_MWA_GORON_PUNCH_BUTT) { Math_Vec3f_Copy(&player->unk_AF0[1], &player->meleeWeaponInfo[0].base); func_8012669C(play, player, D_801C0A90, D_801C0A6C); diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 085cb4de2..cff66dacb 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1944,7 +1944,7 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) { skelAnime->jointTable->x = skelAnime->baseTransl.x; skelAnime->prevTransl.z = skelAnime->jointTable->z; skelAnime->jointTable->z = skelAnime->baseTransl.z; - if (skelAnime->moveFlags & ANIM_FLAG_UPDATEY) { + if (skelAnime->moveFlags & ANIM_FLAG_UPDATE_Y) { if (skelAnime->moveFlags & ANIM_FLAG_NOMOVE) { diff->y = 0.0f; } else { diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c index a4d95af64..d19253df5 100644 --- a/src/code/z_sub_s.c +++ b/src/code/z_sub_s.c @@ -15,7 +15,7 @@ Vec3f gOneVec3f = { 1.0f, 1.0f, 1.0f }; s32 D_801C5DBC[] = { 0, 1 }; // Unused /** - * Finds the first EnDoor instance with unk_1A4 == 5 and the specified switchFlag. + * Finds the first EnDoor instance with doorType == ENDOOR_TYPE_5 and the specified switchFlag. */ EnDoor* SubS_FindDoor(PlayState* play, s32 switchFlag) { Actor* actor = NULL; @@ -29,7 +29,7 @@ EnDoor* SubS_FindDoor(PlayState* play, s32 switchFlag) { break; } - if ((door->unk_1A4 == 5) && (door->switchFlag == (u8)switchFlag)) { + if ((door->doorType == ENDOOR_TYPE_5) && (door->switchFlag == (u8)switchFlag)) { break; } |
