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

Clean up SkelAnime_GetFrameCount usage (#245)

* fix colliderinit typo

* clean up SkelAnime_GetFrameCount usage

* line breaks
This commit is contained in:
fig02 2020-07-11 22:39:34 -04:00 committed by GitHub
parent 4fb01c6b21
commit c589285826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 60 additions and 40 deletions

View file

@ -140,9 +140,10 @@ void EnHeishi1_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnHeishi1_SetupWalk(EnHeishi1* this, GlobalContext* globalCtx) {
s16 frameCount = (f32)SkelAnime_GetFrameCount(&D_06005880.genericHeader);
f32 frameCount = SkelAnime_GetFrameCount(&D_06005880.genericHeader);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005880, this->animSpeed, 0.0f, frameCount, 0, this->transitionRate);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005880, this->animSpeed, 0.0f, (s16)frameCount, 0,
this->transitionRate);
this->bodyTurnSpeed = 0.0f;
this->moveSpeed = 0.0f;
this->headDirection = Math_Rand_ZeroFloat(1.99f);
@ -223,9 +224,9 @@ void EnHeishi1_Walk(EnHeishi1* this, GlobalContext* globalCtx) {
}
void EnHeishi1_SetupMoveToLink(EnHeishi1* this, GlobalContext* globalCtx) {
s16 frameCount = (f32)SkelAnime_GetFrameCount(&D_06005880.genericHeader);
f32 frameCount = SkelAnime_GetFrameCount(&D_06005880.genericHeader);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005880, 3.0f, 0.0f, frameCount, 0, -3.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005880, 3.0f, 0.0f, (s16)frameCount, 0, -3.0f);
this->bodyTurnSpeed = 0.0f;
this->moveSpeed = 0.0f;
func_8010B680(globalCtx, 0x702D, &this->actor);
@ -251,9 +252,10 @@ void EnHeishi1_MoveToLink(EnHeishi1* this, GlobalContext* globalCtx) {
void EnHeishi1_SetupWait(EnHeishi1* this, GlobalContext* globalCtx) {
s16 rand;
s16 frameCount = (f32)SkelAnime_GetFrameCount(&D_06005C30.genericHeader);
f32 frameCount = SkelAnime_GetFrameCount(&D_06005C30.genericHeader);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, this->animSpeed, 0.0f, frameCount, 0, this->transitionRate);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, this->animSpeed, 0.0f, (s16)frameCount, 0,
this->transitionRate);
this->headBehaviorDecided = false;
this->headDirection = Math_Rand_ZeroFloat(1.99f);
rand = Math_Rand_ZeroFloat(50.0f);
@ -320,9 +322,9 @@ void EnHeishi1_Wait(EnHeishi1* this, GlobalContext* globalCtx) {
}
void EnHeishi1_SetupTurnTowardLink(EnHeishi1* this, GlobalContext* globalCtx) {
s16 frameCount = (f32)SkelAnime_GetFrameCount(&D_06005C30.genericHeader);
f32 frameCount = SkelAnime_GetFrameCount(&D_06005C30.genericHeader);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, frameCount, 0, -10.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
this->kickTimer = 30;
this->actionFunc = EnHeishi1_TurnTowardLink;
}
@ -342,9 +344,9 @@ void EnHeishi1_TurnTowardLink(EnHeishi1* this, GlobalContext* globalCtx) {
}
void EnHeishi1_SetupKick(EnHeishi1* this, GlobalContext* globalCtx) {
s16 frameCount = (f32)SkelAnime_GetFrameCount(&D_06005C30.genericHeader);
f32 frameCount = SkelAnime_GetFrameCount(&D_06005C30.genericHeader);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, frameCount, 0, -10.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
this->actionFunc = EnHeishi1_Kick;
}
@ -368,9 +370,9 @@ void EnHeishi1_Kick(EnHeishi1* this, GlobalContext* globalCtx) {
}
void EnHeishi1_SetupWaitNight(EnHeishi1* this, GlobalContext* globalCtx) {
s16 frameCount = (f32)SkelAnime_GetFrameCount(&D_06005C30.genericHeader);
f32 frameCount = SkelAnime_GetFrameCount(&D_06005C30.genericHeader);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, frameCount, 0, -10.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
this->actionFunc = EnHeishi1_WaitNight;
}