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

z_collision_check.c (#73)

* func_8005B280 ok

* func_8005B65C OK

* split out func_8005BD50

* func_8005B7C0 OK

* func_8005B7F4 OK

* func_8005B824 OK

* func_8005B860 ok

* improve sanity

* func_8005B6B0 ok, ColliderInit_Actor structs added

* func_8005B884 ok

* func_8005BBF8 ok, split out func_8005BF50

* split more stuff out of func_8005C050.s

* func_8005C050 OK

* func_8005BA30 fakish OK, func_8005BAD8 real OK

* func_8005BB48 OK, func_8005BA84 almost decomp'd, but type issues

* func_8005BB10 Ok

* func_8005BF50 OK

* func_8005BE50 OK

* func_8005BD50 OK

* func_8005BCC8 Ok

* func_8005BC28

* func_8005BB8C func_8005BBB0 func_8005BBD4 Ok

* save my work commit

* func_8005C2BC fake OK

* func_8005C5B0 ok

* func_8005C608 ok

* func_8005C6C0 ok

* func_8005C6F8 ok

* func_8005C730 ok

* func_8005C774 func_8005C798 func_8005C7BC OK

* func_8005C7E0 ok, func_8005C810 split

* func_8005C810 OK

* func_8005C8C8 ok

* func_8005C964 OK

* func_8005CA88 ok

* func_8005CBAC ok

* func_8005C124 func_8005C1AC func_8005C234 func_8005CC98 OK

* func_8005CD34 func_8005CDD0 Ok

* func_8005CE6C ok

* func_8005CEC4 ok

* func_8005CEDC ok

* func_8005CF90 Ok

* standardize type names/vars more

* func_8005D3BC ok

* func_8005D40C OK, z64.h CollisionCheckContext

* func_8005D4B4 func_8005D4C8 ok

* partial data section migration

* improve function documentation, OT->OC

* Actor_CollisionCheck_SetOC ok

* Actor_CollisionCheck_SetAT Actor_CollisionCheck_SetAC Ok

* func_8005BA84 ok

* func_800611A0 ok

* func_80061274 ok

* clean up func_80061274

* func_8006139C ok

* func_8005E9C0 and dependencies OK

* minor cleanup to func_8005E9C0

* func_8005EC6C OK!

* func_8005E81C ok

* func_8005E604 ok

* func_8005E2EC func_8005E4F8 OK

* func_8005DE9C OK func_8005D8AC disassembled

* func_8006146C func_8006268C ok

* func_8005EEE0 ok

* func_8005F17C

* func_8005F39C ok

* func_8005F5B0 decompiled, not matching

* func_8005F7D0 decomp, func_8005D218 and func_8005D324 OK

* func_8005FA30 ok, split more functions

* func_8005FC04 ok

* func_8005FDCC k

* func_8005FF90 OK OK OK

* func_80060204 dead

* func_800604B0 ok

* func_80060704 func_80060994 ok, func_80060C2C somewhat disassembled. AT to AC matrix doneish

* func_800635D0 ok, func_80062ECC not so much

* OcLine oks

* D_8011DF28 functions disassembled

* D_8011DF5C functions OK

* setAT_SAC. setAC_SAC, setOC_SAC OK

* func_80061C98 decompiled, func_80061BF4, func_80061C18 OK

* func_800617D4 ok, func_800614A4 disassembled

* CollisionCheck_OC D_8011DFAC functions OK

* func_80062530 ok

* CollisionCheck_generalLineOcCheck subfunctions OK

* func_800622E4 ok

* after a long fought battle, func_80061F64 has fallen.

* func_800628A4 disassembled

* func_800627A0 func_8006285C OK

* ActorCollider_Cylinder_Update, func_80062718, func_80062734 ok

* func_80062CD4 decompiled, import EffShield/EffSpark types from MM

* various SubActor98 struct functions OK

* func_8005D4DC func_8005D62C ok

* .data section migrated, more OKs, fix NON_MATCHINGs to use effect structs

* func_80060C2C ok

* minor code tweaks

* func_80061C98 ok somehow

* Attempt to fix some unknowns, move types out of z64actor, add set3 ColliderInit types

* Apply changes

* formatting

* tweak a couple function names

* krim changes, func naming

* missed some things

* function renames

* Implement GenColliderInit.py utility

* Implement pr changes, GenColliderInit.py, DamageTable.py, z_collision_btltbls.c fully matching

* func_800614A4 ok

* Implement Roman's fixes, name Collider unknowns, rename COLTYPE -> COLSHAPE and define new COLTYPE

* collisionCheckCtx -> colChkCtx, fix small things
This commit is contained in:
mzxrules 2020-04-25 22:43:35 -04:00 committed by GitHub
parent f9bdb1d58a
commit aa91a7ee32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
873 changed files with 6121 additions and 10660 deletions

View file

@ -33,12 +33,12 @@ const ActorInit En_Dog_InitVars = {
};
static ColliderCylinderInit cylinderInit = {
0x06, 0x00, 0x09, 0x39, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x01, 0x00, 0x0010, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000,
{ COLTYPE_UNK6, 0x00, 0x09, 0x39, 0x10, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 16, 20, 0, { 0 } },
};
static Sub98Init5 sub98Data = {
static CollisionCheckInfoInit2 colChkInfoInit = {
0x00, // health
0x0000, // unk_10
0x0000, // unk_12
@ -155,8 +155,8 @@ s32 EnDog_PlayAnimAndSFX(EnDog* this) {
}
s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) {
if ((this->collider.base.collideFlags & 2)) {
this->collider.base.collideFlags &= ~2;
if (this->collider.base.acFlags & 2) {
this->collider.base.acFlags &= ~2;
return 2;
}
@ -164,7 +164,7 @@ s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) {
return 0;
}
if ((this->collider.base.maskB & 1)) {
if (this->collider.base.maskB & 1) {
this->collider.base.maskB &= ~1;
if (gSaveContext.dogParams != 0) {
return 0;
@ -221,7 +221,7 @@ s32 EnDog_Orient(EnDog* this, GlobalContext* globalCtx) {
void EnDog_Init(EnDog* this, GlobalContext* globalCtx) {
SkelAnime* skelAnime;
s16 followingDog;
ColliderCylinderMain* collider;
ColliderCylinder* collider;
collider = &this->collider;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f);
@ -239,9 +239,9 @@ void EnDog_Init(EnDog* this, GlobalContext* globalCtx) {
return;
}
ActorCollider_AllocCylinder(globalCtx, collider);
ActorCollider_InitCylinder(globalCtx, collider, &this->actor, &cylinderInit);
func_80061EFC(&this->actor.sub_98, 0, &sub98Data);
Collider_InitCylinder(globalCtx, collider);
Collider_SetCylinder(globalCtx, collider, &this->actor, &cylinderInit);
func_80061EFC(&this->actor.colChkInfo, 0, &colChkInfoInit);
Actor_SetScale(&this->actor, 0.0075f);
this->waypoint = 0;
this->actor.gravity = -1.0f;
@ -278,8 +278,8 @@ void EnDog_Init(EnDog* this, GlobalContext* globalCtx) {
}
void EnDog_Destroy(EnDog* this, GlobalContext* globalCtx) {
ColliderCylinderMain* collider = &this->collider;
ActorCollider_FreeCylinder(globalCtx, collider);
ColliderCylinder* collider = &this->collider;
Collider_DestroyCylinder(globalCtx, collider);
}
void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) {
@ -437,8 +437,8 @@ void EnDog_Update(EnDog* this, GlobalContext* globalCtx) {
func_8002E4B4(globalCtx, &this->actor, this->collider.dim.radius, this->collider.dim.height * 0.5f, 0.0f, 5);
Actor_MoveForward(&this->actor);
this->actionFunc(this, globalCtx);
ActorCollider_Cylinder_Update(&this->actor, &this->collider);
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider);
Collider_CylinderUpdate(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
}
s32 EnDog_Callback1(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor) {

View file

@ -8,7 +8,7 @@ typedef struct {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ ActorFunc actionFunc;
/* 0x0194 */ ColliderCylinderMain collider;
/* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ Path* path;
/* 0x01E4 */ u8 reverse;
/* 0x01E6 */ s16 waypoint;