1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-08 00:44:42 +00:00

Standardize "ActorMovement" over "ActorMove" (#2214)

* ActorMove -> ActorMovement

* more move -> movement

* ANIM_FLAG_ENABLE_MOVEMENT

* format
This commit is contained in:
fig02 2024-09-23 10:07:11 -04:00 committed by GitHub
parent ebd2b8dd50
commit bb3848262d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 124 additions and 117 deletions

View file

@ -1263,14 +1263,14 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
sCurBodyPartPos = &this->bodyPartsPos[0] - 1;
if (!LINK_IS_ADULT) {
if (!(this->skelAnime.moveFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT) ||
(this->skelAnime.moveFlags & ANIM_FLAG_UPDATE_XZ)) {
if (!(this->skelAnime.movementFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT) ||
(this->skelAnime.movementFlags & ANIM_FLAG_UPDATE_XZ)) {
pos->x *= 0.64f;
pos->z *= 0.64f;
}
if (!(this->skelAnime.moveFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT) ||
(this->skelAnime.moveFlags & ANIM_FLAG_UPDATE_Y)) {
if (!(this->skelAnime.movementFlags & ANIM_FLAG_DISABLE_CHILD_ROOT_ADJUSTMENT) ||
(this->skelAnime.movementFlags & ANIM_FLAG_UPDATE_Y)) {
pos->y *= 0.64f;
}
}

View file

@ -818,7 +818,7 @@ void AnimTaskQueue_SetNextGroup(PlayState* play) {
* A transformative task is one that will alter the appearance of an animation.
* These include Copy, Interp, CopyUsingMap, and CopyUsingMapInverted.
*
* LoadPlayerFrame and ActorMove, which don't alter the appearance of an existing animation,
* LoadPlayerFrame and ActorMovement, which don't alter the appearance of an existing animation,
* will always run even if a group has its transformative tasks disabled.
*/
void AnimTaskQueue_DisableTransformTasksForGroup(PlayState* play) {
@ -960,13 +960,13 @@ void AnimTaskQueue_AddCopyUsingMapInverted(PlayState* play, s32 vecCount, Vec3s*
/**
* Creates a task which will move an actor according to the translation of its root limb for the current frame.
*/
void AnimTaskQueue_AddActorMove(PlayState* play, Actor* actor, SkelAnime* skelAnime, f32 moveDiffScaleY) {
void AnimTaskQueue_AddActorMovement(PlayState* play, Actor* actor, SkelAnime* skelAnime, f32 moveDiffScaleY) {
AnimTask* task = AnimTaskQueue_NewTask(&play->animTaskQueue, ANIMTASK_ACTOR_MOVE);
if (task != NULL) {
task->data.actorMove.actor = actor;
task->data.actorMove.skelAnime = skelAnime;
task->data.actorMove.diffScaleY = moveDiffScaleY;
task->data.actorMovement.actor = actor;
task->data.actorMovement.skelAnime = skelAnime;
task->data.actorMovement.diffScaleY = moveDiffScaleY;
}
}
@ -1049,9 +1049,10 @@ void AnimTask_CopyUsingMapInverted(PlayState* play, AnimTaskData* data) {
/**
* Move an actor according to the translation of its root limb for the current animation frame.
* The actor's current shape yaw will factor into the resulting movement.
*/
void AnimTask_ActorMove(PlayState* play, AnimTaskData* data) {
AnimTaskActorMove* task = &data->actorMove;
void AnimTask_ActorMovement(PlayState* play, AnimTaskData* data) {
AnimTaskActorMovement* task = &data->actorMovement;
Actor* actor = task->actor;
Vec3f diff;
@ -1070,8 +1071,8 @@ typedef void (*AnimTaskFunc)(struct PlayState* play, AnimTaskData* data);
*/
void AnimTaskQueue_Update(PlayState* play, AnimTaskQueue* animTaskQueue) {
static AnimTaskFunc animTaskFuncs[] = {
AnimTask_LoadPlayerFrame, AnimTask_Copy, AnimTask_Interp, AnimTask_CopyUsingMap,
AnimTask_CopyUsingMapInverted, AnimTask_ActorMove,
AnimTask_LoadPlayerFrame, AnimTask_Copy, AnimTask_Interp, AnimTask_CopyUsingMap,
AnimTask_CopyUsingMapInverted, AnimTask_ActorMovement,
};
AnimTask* task = animTaskQueue->tasks;
@ -1838,7 +1839,7 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) {
f32 cos;
// If `ANIM_FLAG_UPDATE_XZ` behaved as expected, it would also be checked here
if (skelAnime->moveFlags & ANIM_FLAG_ADJUST_STARTING_POS) {
if (skelAnime->movementFlags & ANIM_FLAG_ADJUST_STARTING_POS) {
diff->x = diff->z = 0.0f;
} else {
x = skelAnime->jointTable[0].x;
@ -1864,8 +1865,8 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) {
skelAnime->prevTransl.z = skelAnime->jointTable[0].z;
skelAnime->jointTable[0].z = skelAnime->baseTransl.z;
if (skelAnime->moveFlags & ANIM_FLAG_UPDATE_Y) {
if (skelAnime->moveFlags & ANIM_FLAG_ADJUST_STARTING_POS) {
if (skelAnime->movementFlags & ANIM_FLAG_UPDATE_Y) {
if (skelAnime->movementFlags & ANIM_FLAG_ADJUST_STARTING_POS) {
diff->y = 0.0f;
} else {
diff->y = skelAnime->jointTable[0].y - skelAnime->prevTransl.y;
@ -1878,7 +1879,7 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) {
skelAnime->prevTransl.y = skelAnime->jointTable[0].y;
}
skelAnime->moveFlags &= ~ANIM_FLAG_ADJUST_STARTING_POS;
skelAnime->movementFlags &= ~ANIM_FLAG_ADJUST_STARTING_POS;
}
/**