Make names related to animations more consistent (#998)

* Make names related to animations more consistent

* Standardize on sAnimationInfo

* Respond to hensldm's review

* Standardize on ChangeAnim

* Respond to hensldm's review

* Small formatting thing

* Consistency after merging master

* A few more things I missed

* Respond to Elliptic's review

* Some more stuff that was requested
This commit is contained in:
Tom Overton
2022-08-15 11:51:38 -07:00
committed by GitHub
parent 132dd6a373
commit 78684187fe
134 changed files with 2115 additions and 2100 deletions
+7 -7
View File
@@ -4293,18 +4293,18 @@ s16 func_800BDB6C(Actor* actor, PlayState* play, s16 arg2, f32 arg3) {
return arg2;
}
void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animation, s32 index) {
void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 animIndex) {
f32 frameCount;
animation += index;
if (animation->frameCount > 0.0f) {
frameCount = animation->frameCount;
animationInfo += animIndex;
if (animationInfo->frameCount > 0.0f) {
frameCount = animationInfo->frameCount;
} else {
frameCount = Animation_GetLastFrame(&animation->animation->common);
frameCount = Animation_GetLastFrame(&animationInfo->animation->common);
}
Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, frameCount,
animation->mode, animation->morphFrames);
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame,
frameCount, animationInfo->mode, animationInfo->morphFrames);
}
// Unused
+7 -7
View File
@@ -11,7 +11,7 @@
#include "objects/object_boj/object_boj.h"
#include "objects/object_os_anime/object_os_anime.h"
static AnimationInfoS sAnimations[] = {
static AnimationInfoS sAnimationInfo[] = {
{ &gMamamuYanUnusedIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_boj_Anim_001494, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_boj_Anim_001494, 1.0f, 0, -1, ANIMMODE_LOOP, -8 },
@@ -45,15 +45,15 @@ s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) {
s16 frameCount;
s32 isChanged = false;
if (animIndex >= ENHY_ANIMATION_AOB_0 && animIndex < ENHY_ANIMATION_MAX) {
if (animIndex >= ENHY_ANIM_AOB_0 && animIndex < ENHY_ANIM_MAX) {
isChanged = true;
frameCount = sAnimations[animIndex].frameCount;
frameCount = sAnimationInfo[animIndex].frameCount;
if (frameCount < 0) {
frameCount = Animation_GetLastFrame(&sAnimations[animIndex].animation->common);
frameCount = Animation_GetLastFrame(&sAnimationInfo[animIndex].animation->common);
}
Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed,
sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode,
sAnimations[animIndex].morphFrames);
Animation_Change(skelAnime, sAnimationInfo[animIndex].animation, sAnimationInfo[animIndex].playSpeed,
sAnimationInfo[animIndex].startFrame, frameCount, sAnimationInfo[animIndex].mode,
sAnimationInfo[animIndex].morphFrames);
}
return isChanged;
}
+10 -10
View File
@@ -924,30 +924,30 @@ s16 Animation_GetLastFrame2(LegacyAnimationHeader* animation) {
}
/**
* Linearly interpolates the start and tactoret frame tables with the given weight, putting the result in dst
* Linearly interpolates the start and target frame tables with the given weight, putting the result in dst
*/
void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* start, Vec3s* tactoret, f32 weight) {
void SkelAnime_InterpFrameTable(s32 limbCount, Vec3s* dst, Vec3s* start, Vec3s* target, f32 weight) {
s32 i;
s16 diff;
s16 base;
if (weight < 1.0f) {
for (i = 0; i < limbCount; i++, dst++, start++, tactoret++) {
for (i = 0; i < limbCount; i++, dst++, start++, target++) {
base = start->x;
diff = tactoret->x - base;
diff = target->x - base;
dst->x = (s16)(diff * weight) + base;
base = start->y;
diff = tactoret->y - base;
diff = target->y - base;
dst->y = (s16)(diff * weight) + base;
base = start->z;
diff = tactoret->z - base;
diff = target->z - base;
dst->z = (s16)(diff * weight) + base;
}
} else {
for (i = 0; i < limbCount; i++, dst++, tactoret++) {
dst->x = tactoret->x;
dst->y = tactoret->y;
dst->z = tactoret->z;
for (i = 0; i < limbCount; i++, dst++, target++) {
dst->x = target->x;
dst->y = target->y;
dst->z = target->z;
}
}
}
+16 -16
View File
@@ -531,24 +531,24 @@ Actor* SubS_FindNearestActor(Actor* actor, PlayState* play, u8 actorCategory, s1
return closestActor;
}
s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index) {
s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animationInfo, s32 animIndex) {
s32 endFrame;
s32 startFrame;
animations += index;
endFrame = animations->frameCount;
if (animations->frameCount < 0) {
endFrame = Animation_GetLastFrame(&animations->animation->common);
animationInfo += animIndex;
endFrame = animationInfo->frameCount;
if (animationInfo->frameCount < 0) {
endFrame = Animation_GetLastFrame(&animationInfo->animation->common);
}
startFrame = animations->startFrame;
startFrame = animationInfo->startFrame;
if (startFrame >= endFrame || startFrame < 0) {
return false;
}
if (animations->playSpeed < 0.0f) {
if (animationInfo->playSpeed < 0.0f) {
SWAP(s32, endFrame, startFrame);
}
Animation_Change(skelAnime, animations->animation, animations->playSpeed, startFrame, endFrame, animations->mode,
animations->morphFrames);
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, startFrame, endFrame,
animationInfo->mode, animationInfo->morphFrames);
return true;
}
@@ -1357,21 +1357,21 @@ s32 SubS_ActorPathing_SetNextPoint(PlayState* play, ActorPathing* actorPath) {
return reupdate;
}
void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animations, s32 nextIndex,
s32* curIndex) {
AnimationSpeedInfo* animation = &animations[nextIndex];
void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animationInfo, s32 nextAnimIndex,
s32* curAnimIndex) {
AnimationSpeedInfo* animation = &animationInfo[nextAnimIndex];
f32 startFrame = skelAnime->curFrame;
f32 endFrame;
f32 morphFrames;
if ((*curIndex < 0) || (nextIndex == *curIndex)) {
if ((*curAnimIndex < 0) || (nextAnimIndex == *curAnimIndex)) {
morphFrames = 0.0f;
if (*curIndex < 0) {
if (*curAnimIndex < 0) {
startFrame = 0.0f;
}
} else {
morphFrames = animation->morphFrames;
if (nextIndex != *curIndex) {
if (nextAnimIndex != *curAnimIndex) {
startFrame = 0.0f;
}
}
@@ -1383,7 +1383,7 @@ void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* a
}
Animation_Change(skelAnime, animation->animation, animation->playSpeed, startFrame, endFrame, animation->mode,
morphFrames);
*curIndex = nextIndex;
*curAnimIndex = nextAnimIndex;
}
s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type) {