animation struct documentation

This commit is contained in:
Banjo Kazooie
2023-03-12 23:11:39 -05:00
parent 7dd7a0b60c
commit af75d8b32d
293 changed files with 2031 additions and 1986 deletions

View File

@@ -1,28 +1,29 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "animation.h"
void func_802EA060(struct58s **arg0, BKAnimationList *anim_list){
struct58s * sp24;
void animMtxList_setBoneless(AnimMtxList **this_ptr, BKAnimationList *anim_list){
AnimMtxList * this;
Mtx *end_ptr;
Mtx *i_ptr;
sp24 = *arg0;
if(sp24->capacity_44 < anim_list->cnt_4){
sp24 = (struct58s *)realloc(sp24, anim_list->cnt_4 * sizeof(Mtx) + sizeof(struct58s));
sp24->capacity_44 = anim_list->cnt_4;
(*arg0) = sp24;
this = *this_ptr;
if(this->capacity_44 < anim_list->cnt_4){
this = (AnimMtxList *)realloc(this, anim_list->cnt_4 * sizeof(Mtx) + sizeof(AnimMtxList));
this->capacity_44 = anim_list->cnt_4;
(*this_ptr) = this;
}
sp24->size_40 = anim_list->cnt_4;
end_ptr = (Mtx *)(sp24->size_40*sizeof(Mtx) + (s32)sp24 +sizeof(struct58s));
this->size_40 = anim_list->cnt_4;
end_ptr = (Mtx *)(this->size_40*sizeof(Mtx) + (s32)this +sizeof(AnimMtxList));
mlMtxIdent();
for(i_ptr = sp24->data; i_ptr < end_ptr; i_ptr++){
for(i_ptr = this->data; i_ptr < end_ptr; i_ptr++){
mlMtxGet(i_ptr);
}
}
Mtx *func_802EA110(struct58s *this, s32 arg1){
Mtx *animMtxList_get(AnimMtxList *this, s32 arg1){
if (arg1 == -1){
return &this->mtx_0;
}
@@ -30,12 +31,12 @@ Mtx *func_802EA110(struct58s *this, s32 arg1){
}
void func_802EA134(struct58s *this){
void animMtxList_free(AnimMtxList *this){
free(this);
}
struct58s *func_802EA154(void){
struct58s *this = malloc(sizeof(struct58s));
AnimMtxList *animMtxList_new(void){
AnimMtxList *this = malloc(sizeof(AnimMtxList));
this->size_40 = 0;
this->capacity_44 = 0;
mlMtxIdent();
@@ -43,17 +44,17 @@ struct58s *func_802EA154(void){
return this;
}
s32 func_802EA190(struct58s* this){
s32 animMtxList_len(AnimMtxList* this){
if(this)
return this->size_40;
return 1;
}
void func_80251BCC(Mtx*);
void func_8033A5B8(s32, s32, f32[3],f32[3], f32[3]);
void mlMtxSet(Mtx*);
void func_8033A5B8(s32, s32, f32[4],f32[3], f32[3]);
void func_802EA1A8(struct58s **arg0, BKAnimationList *anim_list, s32 arg2){
struct58s * this;
void animMtxList_setBoned(AnimMtxList **this_ptr, BKAnimationList *anim_list, BoneTransformList *arg2){
AnimMtxList * this;
Mtx *start_ptr;
Mtx *end_ptr;
Mtx *i_ptr;
@@ -61,18 +62,18 @@ void func_802EA1A8(struct58s **arg0, BKAnimationList *anim_list, s32 arg2){
f32 tmp_f0;
s32 pad94[1];
f32 sp88[3];
s32 pad80[2];
f32 sp74[3];
s32 pad80[1];
f32 sp74[4];
f32 sp68[3];
f32 sp5C[3];
s32 sp50[3];
//resize animation matrices
this = *arg0;
this = *this_ptr;
if(this->capacity_44 < anim_list->cnt_4){
this = (struct58s *)realloc(this, anim_list->cnt_4 * sizeof(Mtx) + sizeof(struct58s));
this = (AnimMtxList *)realloc(this, anim_list->cnt_4 * sizeof(Mtx) + sizeof(AnimMtxList));
this->capacity_44 = anim_list->cnt_4;
(*arg0) = this;
(*this_ptr) = this;
}
this->size_40 = anim_list->cnt_4;
@@ -80,15 +81,15 @@ void func_802EA1A8(struct58s **arg0, BKAnimationList *anim_list, s32 arg2){
end_ptr = &start_ptr[this->size_40];
s0 = anim_list->anim;
for(i_ptr = start_ptr; i_ptr < end_ptr; s0++, i_ptr++){
func_8033A5B8(arg2, s0->unkC, sp74, sp68, sp5C);
if(s0->unkE == -1)
func_8033A5B8(arg2, s0->bone_id, sp74, sp68, sp5C);
if(s0->mtx_id == -1)
mlMtxIdent();
else if(s0->unkE + 1 != i_ptr - start_ptr)
func_80251BCC(&start_ptr[s0->unkE]);
else if(s0->mtx_id + 1 != i_ptr - start_ptr)
mlMtxSet(&start_ptr[s0->mtx_id]);
tmp_f0 = anim_list->unk0;
mlMtxTranslate(s0->unk0[0] + tmp_f0*sp5C[0], s0->unk0[1] + tmp_f0*sp5C[1], s0->unk0[2] + tmp_f0*sp5C[2] );
if(!func_80345434(sp74)){
if(!vec4f_isZero(sp74)){
func_80345274(sp74, sp88);
func_802515D4(sp88);
}
@@ -99,6 +100,6 @@ void func_802EA1A8(struct58s **arg0, BKAnimationList *anim_list, s32 arg2){
}
}
struct58s *func_802EA374(struct58s *this){
AnimMtxList *animMtxList_defrag(AnimMtxList *this){
return defrag(this);
}