mirror of
https://github.com/zeldaret/mm.git
synced 2026-09-01 01:21:56 -04:00
Animation system updated, some more boot files decompiled (+6%), z_fcurve_data_skelanime decompiled (1 non-matching), some asm files split, etc (#89)
* Progress on various files * gfxprint stuff * split some rodata, add iconv for rodata string parsing * z_std_dma rodata * 2 nonmatchings in gfxprint * mtxuty-cvt ok * more * match a function in idle.c * progress * Cleanup * Rename BgPolygon to CollisionPoly * progress * some effect stuff * more effect progress * updates * made suggested changes * z_effect_soft_sprite_old_init mostly ok * remove old effects enum * gamealloc.c OK * added more files * motor.c almost done * motor.c OK * updates * migration of two files * listalloc.c oK * z_fcurve_data_skelanime split * z_fcurve_data_skelanime.c decompiled * more files split * z_malloc.c OK * contpfs.c OK * fault.c rodata migrated * migrated fault_drawer rodata * update * update preprocess.py * renamed functions in z_skelanime * started z_skelanime cleanup * like halfway through fixing z_skelanime * animation system updated to meet oot standards * remove unused animation structs * rename matrix structs to fit oot * Add -woff 712 * fix diff_settings.py because i accidentally broke it before * fixed merge conflict, doesn't match though * It matches now * Updates * Fixed warnings...added gcc code syntax checking * Remove gcc check, added in Tharo's PR * warnings fixed (i think) * fixed all warnings i think * ok * not sure what to do * Fix all warnings i think (z_en_a_keep needs some file cleanup thouguh) * it matches if i do this * remove comment * accidentally put osPfsFreeBlocks in epilinkhandle.c * memcmp -> bcmp * change u32 size to size_t size, delete string.h because it caused unnecessary confusion with defining size_t twice * format.sh * MTXMODE_NEW and MTXMODE_APPLY to matrix functions * Made suggested changes * pragma sFaultDrawerFont instead of including in repo * add some functions to functions.h * Bss reordering fixed in z_collision_check...added hack to disasm.py * Updated z_en_a_keep.c * Missed suggestion in EnAObj_Destroy * . * update z_fcurve_Data_skelanime and z_skelanime with suggestions * devmgr.c ok * minor changes * Addressed comments * remove redundant file * gfxp -> dlist in game.c * updated actorfixer.py * fixed warnings in z_malloc * Change void* back to Actor* * format * Add the soft_sprit comments back * Rename SV->Flex * remove .common * run format * Update src/code/z_skelanime.c * u32 channel Co-authored-by: Lucas Shaw <lucas.shaw1123@gmail.com> Co-authored-by: angie <angheloalf95@gmail.com> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com>
This commit is contained in:
+40
-31
@@ -1,48 +1,57 @@
|
||||
#include "global.h"
|
||||
|
||||
void EnAObj_Init(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
ActorEnAObj* s0 = (ActorEnAObj*)this;
|
||||
s0->base.textId = ((s0->base.params >> 8) & 0xFF) | 0x300;
|
||||
s0->base.params = (s0->base.params & 0xFF) - 9;
|
||||
Actor_ProcessInitChain((Actor*)s0, &enAObjInitVar);
|
||||
ActorShape_Init(&s0->base.shape, 0, (ActorShadowFunc)func_800B3FC0, 12);
|
||||
Collider_InitAndSetCylinder(globalCtx, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
|
||||
Collider_UpdateCylinder((Actor*)s0, &s0->collision);
|
||||
s0->base.colChkInfo.mass = 255;
|
||||
s0->update = (ActorFunc)EnAObj_Update1;
|
||||
#define THIS ((EnAObj*)thisx)
|
||||
|
||||
void EnAObj_Update1(EnAObj* this, GlobalContext* globalCtx);
|
||||
void EnAObj_Update2(EnAObj* this, GlobalContext* globalCtx);
|
||||
|
||||
void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnAObj* this = THIS;
|
||||
|
||||
this->actor.textId = ((this->actor.params >> 8) & 0xFF) | 0x300;
|
||||
this->actor.params = (this->actor.params & 0xFF) - 9;
|
||||
Actor_ProcessInitChain(&this->actor, &enAObjInitVar);
|
||||
ActorShape_Init(&this->actor.shape, 0, func_800B3FC0, 12);
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collision, &this->actor, &enAObjCylinderInit);
|
||||
Collider_UpdateCylinder(&this->actor, &this->collision);
|
||||
this->actor.colChkInfo.mass = 255;
|
||||
this->actionFunc = EnAObj_Update1;
|
||||
}
|
||||
|
||||
void EnAObj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
ColliderCylinder* a2 = &this->collision;
|
||||
Collider_DestroyCylinder(globalCtx, a2);
|
||||
void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnAObj* this = THIS;
|
||||
|
||||
Collider_DestroyCylinder(globalCtx, &this->collision);
|
||||
}
|
||||
|
||||
void EnAObj_Update1(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
s16 v0;
|
||||
s32 v1;
|
||||
if (func_800B84D0((Actor*)this, globalCtx) != 0) {
|
||||
this->update = (ActorFunc)EnAObj_Update2;
|
||||
void EnAObj_Update1(EnAObj* this, GlobalContext* globalCtx) {
|
||||
s32 yawDiff;
|
||||
|
||||
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||
this->actionFunc = EnAObj_Update2;
|
||||
} else {
|
||||
v0 = this->base.yawTowardsPlayer - this->base.shape.rot.y;
|
||||
v1 = (v0 < 0) ? -v0 : v0;
|
||||
if ((v1 < 10240) || ((this->base.params == 1) && (v1 > 22528))) {
|
||||
func_800B863C((Actor*)this, globalCtx);
|
||||
yawDiff = ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y));
|
||||
|
||||
if ((yawDiff < 0x2800) || ((this->actor.params == 1) && (yawDiff > 0x5800))) {
|
||||
func_800B863C(&this->actor, globalCtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnAObj_Update2(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
if (func_800B867C((Actor*)this, globalCtx) != 0) {
|
||||
this->update = (ActorFunc)EnAObj_Update1;
|
||||
void EnAObj_Update2(EnAObj* this, GlobalContext* globalCtx) {
|
||||
if (func_800B867C(&this->actor, globalCtx)) {
|
||||
this->actionFunc = EnAObj_Update1;
|
||||
}
|
||||
}
|
||||
|
||||
void EnAObj_Update(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
(this->update)((Actor*)this, (GlobalContext*)globalCtx);
|
||||
Actor_SetHeight((Actor*)this, 45.0f);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, (Collider*)&this->collision);
|
||||
void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnAObj* this = THIS;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
Actor_SetHeight(&this->actor, 45.0f);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collision.base);
|
||||
}
|
||||
|
||||
void EnAObj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) {
|
||||
func_800BDFC0(globalCtx, enAObjDisplayLists[this->base.params]);
|
||||
void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
func_800BDFC0(globalCtx, enAObjDisplayLists[thisx->params]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user