1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-22 21:35:27 +00:00
oot/src/code/z_en_a_keep.c

360 lines
12 KiB
C
Raw Normal View History

2020-03-17 04:31:30 +00:00
#include <ultra64.h>
#include <global.h>
2020-03-22 21:19:43 +00:00
typedef enum {
2020-03-17 04:31:30 +00:00
/* 0x00 */ A_OBJ_BLOCK_SMALL,
/* 0x01 */ A_OBJ_BLOCK_LARGE,
/* 0x02 */ A_OBJ_BLOCK_HUGE,
/* 0x03 */ A_OBJ_BLOCK_SMALL_ROT,
/* 0x04 */ A_OBJ_BLOCK_LARGE_ROT,
/* 0x05 */ A_OBJ_CUBE_SMALL,
/* 0x06 */ A_OBJ_UNKNOWN_6,
/* 0x07 */ A_OBJ_GRASS_CLUMP,
/* 0x08 */ A_OBJ_TREE_STUMP,
/* 0x09 */ A_OBJ_SIGNPOST_OBLONG,
/* 0x0A */ A_OBJ_SIGNPOST_ARROW,
/* 0x0B */ A_OBJ_KNOB
} AObjType;
2020-03-22 21:19:43 +00:00
typedef struct {
/* 0x000 */ DynaPolyActor dyna;
/* 0x164 */ ActorFunc actionFunc;
2020-03-22 21:19:43 +00:00
/* 0x168 */ s32 unk_168;
/* 0x16C */ s16 textId;
/* 0x16E */ s16 unk_16E;
/* 0x170 */ s16 unk_170;
/* 0x172 */ s16 unk_172;
/* 0x174 */ s16 unk_174;
/* 0x178 */ f32 unk_178;
/* 0x17C */ ColliderCylinder collider;
} EnAObj; // size = 0x1C8
#define FLAGS 0x00000010
void func_8001D204(EnAObj* this, GlobalContext* globalCtx);
void func_8001D25C(EnAObj* this, GlobalContext* globalCtx);
void func_8001D360(EnAObj* this, GlobalContext* globalCtx);
void func_8001D4A8(EnAObj* this, GlobalContext* globalCtx);
void func_8001D608(EnAObj* this, GlobalContext* globalCtx);
void func_8001D234(EnAObj* this, s16 params);
void func_8001D310(EnAObj* this, s16 params);
void func_8001D480(EnAObj* this, s16 params);
void func_8001D5C8(EnAObj* this, s16 params);
void EnAObj_Init(EnAObj* this, GlobalContext* globalCtx);
void EnAObj_Destroy(EnAObj* this, GlobalContext* globalCtx);
void EnAObj_Update(EnAObj* this, GlobalContext* globalCtx);
void EnAObj_Draw(EnAObj* this, GlobalContext* globalCtx);
const ActorInit En_A_Obj_InitVars = {
ACTOR_EN_A_OBJ,
ACTORTYPE_PROP,
FLAGS,
OBJECT_GAMEPLAY_KEEP,
sizeof(EnAObj),
(ActorFunc)EnAObj_Init,
(ActorFunc)EnAObj_Destroy,
(ActorFunc)EnAObj_Update,
(ActorFunc)EnAObj_Draw,
};
// TODO: Define this section of .data here and rename the symbols
2020-03-17 04:31:30 +00:00
extern ColliderCylinderInit D_80115440;
extern u32 D_8011546C[];
extern u32 D_80115484[];
void EnAObj_SetupAction(EnAObj* this, ActorFunc actionFunc) {
this->actionFunc = actionFunc;
2020-03-17 04:31:30 +00:00
}
void EnAObj_Init(EnAObj* this, GlobalContext* globalCtx) {
2020-03-17 04:31:30 +00:00
u32 sp34;
s32 pad;
EnAObj* this2 = this;
2020-03-17 04:31:30 +00:00
f32 sp28;
sp34 = 0;
sp28 = 6.0f;
this->textId = (this->dyna.actor.params >> 8) & 0xFF;
this->dyna.actor.params &= 0xFF;
2020-03-17 04:31:30 +00:00
switch (this->dyna.actor.params) {
2020-03-17 04:31:30 +00:00
case A_OBJ_BLOCK_SMALL:
Actor_SetScale(&this->dyna.actor, 0.025f);
2020-03-17 04:31:30 +00:00
break;
case A_OBJ_BLOCK_LARGE:
Actor_SetScale(&this->dyna.actor, 0.05f);
2020-03-17 04:31:30 +00:00
break;
case A_OBJ_BLOCK_HUGE:
case A_OBJ_CUBE_SMALL:
case A_OBJ_UNKNOWN_6:
Actor_SetScale(&this->dyna.actor, 0.1f);
2020-03-17 04:31:30 +00:00
break;
case A_OBJ_BLOCK_SMALL_ROT:
Actor_SetScale(&this->dyna.actor, 0.005f);
2020-03-17 04:31:30 +00:00
break;
case A_OBJ_BLOCK_LARGE_ROT:
default:
Actor_SetScale(&this->dyna.actor, 0.01f);
2020-03-17 04:31:30 +00:00
break;
}
if (this->dyna.actor.params >= 9) {
2020-03-17 04:31:30 +00:00
sp28 = 12.0f;
2020-03-23 23:11:21 +00:00
}
2020-03-17 04:31:30 +00:00
ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, sp28);
2020-03-17 04:31:30 +00:00
this->dyna.actor.posRot2.pos = this->dyna.actor.posRot.pos;
this->dyna.dynaPolyId = -1;
this->dyna.unk_160 = 0;
this->dyna.unk_15C = 0;
this->dyna.actor.unk_FC = 1200.0f;
this->dyna.actor.unk_F8 = 200.0f;
2020-03-17 04:31:30 +00:00
switch (this->dyna.actor.params) {
2020-03-17 04:31:30 +00:00
case A_OBJ_BLOCK_LARGE:
case A_OBJ_BLOCK_HUGE:
this2->dyna.dynaPolyId = 1;
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->dyna.actor, ACTORTYPE_BG);
func_8001D5C8(this2, this->dyna.actor.params);
2020-03-17 04:31:30 +00:00
break;
case A_OBJ_BLOCK_SMALL_ROT:
case A_OBJ_BLOCK_LARGE_ROT:
this2->dyna.dynaPolyId = 3;
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->dyna.actor, ACTORTYPE_BG);
func_8001D310(this2, this->dyna.actor.params);
2020-03-17 04:31:30 +00:00
break;
case A_OBJ_UNKNOWN_6:
// clang-format off
this->dyna.actor.flags |= 0x1; this2->dyna.dynaPolyId = 5; this2->unk_178 = 10.0f;
// clang-format on
this->dyna.actor.gravity = -2.0f;
func_8001D234(this2, this->dyna.actor.params);
2020-03-17 04:31:30 +00:00
break;
case A_OBJ_GRASS_CLUMP:
case A_OBJ_TREE_STUMP:
this2->dyna.dynaPolyId = 0;
func_8001D234(this2, this->dyna.actor.params);
2020-03-17 04:31:30 +00:00
break;
case A_OBJ_SIGNPOST_OBLONG:
case A_OBJ_SIGNPOST_ARROW:
this->dyna.actor.textId = (this2->textId & 0xFF) | 0x300;
// clang-format off
this->dyna.actor.flags |= 0x1 | 0x8; this->dyna.actor.unk_4C = 500.0f;
// clang-format on
this2->unk_178 = 45.0f;
func_8001D234(this2, this->dyna.actor.params);
Collider_InitCylinder(globalCtx, &this2->collider);
Collider_SetCylinder(globalCtx, &this2->collider, &this->dyna.actor, &D_80115440);
this->dyna.actor.colChkInfo.mass = 0xFF;
this->dyna.actor.unk_1F = 0;
2020-03-17 04:31:30 +00:00
break;
case A_OBJ_KNOB:
this->dyna.actor.gravity = -1.5f;
func_8001D480(this2, this->dyna.actor.params);
2020-03-17 04:31:30 +00:00
break;
default:
this->dyna.actor.gravity = -2.0f;
func_8001D234(this2, this->dyna.actor.params);
2020-03-17 04:31:30 +00:00
break;
}
2020-03-22 21:19:43 +00:00
if (this->dyna.actor.params < 5) {
this->dyna.actor.colChkInfo.mass = 0xFF;
2020-03-23 23:11:21 +00:00
}
2020-03-17 04:31:30 +00:00
if (this->dyna.dynaPolyId != -1) {
DynaPolyInfo_Alloc(D_8011546C[this->dyna.dynaPolyId], &sp34);
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp34);
2020-03-17 04:31:30 +00:00
}
}
void EnAObj_Destroy(EnAObj* this, GlobalContext* globalCtx) {
ColliderCylinder* collider = &this->collider;
2020-03-17 04:31:30 +00:00
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
2020-03-17 04:31:30 +00:00
switch (this->dyna.actor.params) {
2020-03-17 04:31:30 +00:00
case A_OBJ_SIGNPOST_OBLONG:
case A_OBJ_SIGNPOST_ARROW:
Collider_DestroyCylinder(globalCtx, collider);
2020-03-17 04:31:30 +00:00
}
}
void func_8001D204(EnAObj* this, GlobalContext* globalCtx) {
if (func_8002F334(&this->dyna.actor, globalCtx)) {
func_8001D234(this, this->dyna.actor.params);
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
}
void func_8001D234(EnAObj* this, s16 params) {
EnAObj_SetupAction(this, (ActorFunc)func_8001D25C);
2020-03-17 04:31:30 +00:00
}
void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) {
2020-03-17 04:31:30 +00:00
s16 var;
if (this->dyna.actor.textId != 0) {
var = this->dyna.actor.rotTowardsLinkY - this->dyna.actor.shape.rot.y;
if ((ABS(var) < 0x2800) || ((this->dyna.actor.params == 0xA) && (ABS(var) > 0x5800))) {
if (func_8002F194(&this->dyna.actor, globalCtx)) {
EnAObj_SetupAction(this, (ActorFunc)func_8001D204);
2020-03-22 21:19:43 +00:00
} else {
func_8002F2F4(&this->dyna.actor, globalCtx);
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
}
}
}
void func_8001D310(EnAObj* this, s16 params) {
2020-03-17 04:31:30 +00:00
this->unk_16E = 0;
this->unk_168 = 10;
this->dyna.actor.posRot.rot.y = 0;
this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot;
EnAObj_SetupAction(this, (ActorFunc)func_8001D360);
2020-03-17 04:31:30 +00:00
}
void func_8001D360(EnAObj* this, GlobalContext* globalCtx) {
2020-03-22 21:19:43 +00:00
if (this->unk_16E == 0) {
if (this->dyna.unk_160 != 0) {
2020-03-17 04:31:30 +00:00
this->unk_16E++;
this->unk_170 = 20;
if ((s16)(this->dyna.actor.rotTowardsLinkY + 0x4000) < 0) {
2020-03-17 04:31:30 +00:00
this->unk_174 = -1000;
2020-03-22 21:19:43 +00:00
} else {
2020-03-17 04:31:30 +00:00
this->unk_174 = 1000;
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
if (this->dyna.actor.rotTowardsLinkY < 0) {
2020-03-17 04:31:30 +00:00
this->unk_172 = -this->unk_174;
2020-03-22 21:19:43 +00:00
} else {
2020-03-17 04:31:30 +00:00
this->unk_172 = this->unk_174;
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
}
2020-03-22 21:19:43 +00:00
} else {
if (this->unk_168 != 0) {
2020-03-17 04:31:30 +00:00
this->unk_168--;
2020-03-22 21:19:43 +00:00
} else {
this->dyna.actor.shape.rot.y += this->unk_172;
this->dyna.actor.shape.rot.x += this->unk_174;
2020-03-17 04:31:30 +00:00
this->unk_170--;
this->dyna.actor.gravity = -1.0f;
2020-03-17 04:31:30 +00:00
2020-03-22 21:19:43 +00:00
if (this->unk_170 == 0) {
this->dyna.actor.posRot.pos = this->dyna.actor.initPosRot.pos;
2020-03-17 04:31:30 +00:00
this->unk_16E = 0;
this->unk_168 = 10;
this->dyna.actor.velocity.y = 0.0f;
this->dyna.actor.gravity = 0.0f;
this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot;
2020-03-17 04:31:30 +00:00
}
}
}
}
void func_8001D480(EnAObj* this, s16 params) {
EnAObj_SetupAction(this, (ActorFunc)func_8001D4A8);
2020-03-17 04:31:30 +00:00
}
void func_8001D4A8(EnAObj* this, GlobalContext* globalCtx) {
Math_SmoothScaleMaxMinF(&this->dyna.actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f);
this->dyna.actor.shape.rot.x = this->dyna.actor.shape.rot.x + (this->dyna.actor.posRot.rot.x >> 1);
this->dyna.actor.shape.rot.z = this->dyna.actor.shape.rot.z + (this->dyna.actor.posRot.rot.z >> 1);
2020-03-17 04:31:30 +00:00
if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & 0x8)) {
2020-03-22 21:19:43 +00:00
if (1) { // Necessary to match
this->dyna.actor.posRot.rot.y =
((this->dyna.actor.unk_7E - this->dyna.actor.posRot.rot.y) + this->dyna.actor.unk_7E) - 0x8000;
2020-03-22 21:19:43 +00:00
}
this->dyna.actor.bgCheckFlags &= ~0x8;
2020-03-17 04:31:30 +00:00
}
if (this->dyna.actor.bgCheckFlags & 0x2) {
if (this->dyna.actor.velocity.y < -8.0f) {
this->dyna.actor.velocity.y *= -0.6f;
this->dyna.actor.speedXZ *= 0.6f;
this->dyna.actor.bgCheckFlags &= ~0x3;
2020-03-22 21:19:43 +00:00
} else {
Actor_Kill(&this->dyna.actor);
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
}
}
void func_8001D5C8(EnAObj* this, s16 params) {
this->dyna.actor.unk_FC = 1200.0f;
this->dyna.actor.unk_F8 = 720.0f;
EnAObj_SetupAction(this, (ActorFunc)func_8001D608);
2020-03-17 04:31:30 +00:00
}
void func_8001D608(EnAObj* this, GlobalContext* globalCtx) {
this->dyna.actor.speedXZ += this->dyna.unk_150;
this->dyna.actor.posRot.rot.y = this->dyna.unk_158;
2020-03-17 04:31:30 +00:00
this->dyna.actor.speedXZ = (this->dyna.actor.speedXZ < -2.5f)
? -2.5f
: ((this->dyna.actor.speedXZ > 2.5f) ? 2.5f : this->dyna.actor.speedXZ);
2020-03-17 04:31:30 +00:00
Math_SmoothScaleMaxMinF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
2020-03-17 04:31:30 +00:00
if (this->dyna.actor.speedXZ != 0.0f) {
Audio_PlayActorSound2(&this->dyna.actor, 0x200A);
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
this->dyna.unk_154 = 0.0f;
this->dyna.unk_150 = 0.0f;
2020-03-17 04:31:30 +00:00
}
void EnAObj_Update(EnAObj* this, GlobalContext* globalCtx) {
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
2020-04-26 02:43:35 +00:00
Collider* collider;
2020-03-17 04:31:30 +00:00
this->actionFunc(this, globalCtx);
Actor_MoveForward(&this->dyna.actor);
2020-03-17 04:31:30 +00:00
if (this->dyna.actor.gravity != 0.0f) {
if (this->dyna.actor.params != A_OBJ_KNOB) {
func_8002E4B4(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D);
2020-03-22 21:19:43 +00:00
} else {
func_8002E4B4(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D);
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
}
this->dyna.actor.posRot2.pos = this->dyna.actor.posRot.pos;
this->dyna.actor.posRot2.pos.y += this->unk_178;
2020-03-17 04:31:30 +00:00
switch (this->dyna.actor.params) {
2020-03-17 04:31:30 +00:00
case A_OBJ_SIGNPOST_OBLONG:
case A_OBJ_SIGNPOST_ARROW:
collider = (Collider*)&this->collider;
Collider_CylinderUpdate(&this->dyna.actor, &this->collider);
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
2020-04-26 02:43:35 +00:00
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider);
2020-03-17 04:31:30 +00:00
}
}
void EnAObj_Draw(EnAObj* this, GlobalContext* globalCtx) {
s32 type = this->dyna.actor.params;
2020-03-17 04:31:30 +00:00
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* dispRefs[4];
2020-03-17 04:31:30 +00:00
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_a_keep.c", 701);
2020-03-17 04:31:30 +00:00
func_80093D18(globalCtx->state.gfxCtx);
2020-03-22 21:19:43 +00:00
if (type > A_OBJ_KNOB) {
2020-03-17 04:31:30 +00:00
type = A_OBJ_KNOB;
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
if (this->dyna.actor.params == A_OBJ_KNOB) {
2020-03-17 04:31:30 +00:00
gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 1, 0x3C, 0x3C, 0x3C, 0x32);
2020-03-22 21:19:43 +00:00
}
2020-03-17 04:31:30 +00:00
2020-03-22 21:19:43 +00:00
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712),
G_MTX_MODELVIEW | G_MTX_LOAD);
2020-03-17 04:31:30 +00:00
gSPDisplayList(gfxCtx->polyOpa.p++, D_80115484[type]);
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_a_keep.c", 715);
2020-03-17 04:31:30 +00:00
}