2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "vt.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
#define FLAGS 0x00000010
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
#define THIS ((EnAObj*)thisx)
|
|
|
|
|
|
|
|
void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
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);
|
|
|
|
|
|
|
|
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,
|
|
|
|
};
|
|
|
|
|
2020-05-31 09:55:48 +00:00
|
|
|
static ColliderCylinderInit sCylinderInit = {
|
|
|
|
{ COLTYPE_UNK10, 0x00, 0x39, 0x39, 0x20, COLSHAPE_CYLINDER },
|
|
|
|
{ 0x02, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
|
|
|
|
{ 25, 60, 0, { 0, 0, 0 } },
|
|
|
|
};
|
|
|
|
|
|
|
|
static UNK_PTR D_8011546C[] = {
|
|
|
|
0x040394B0, 0x040394B0, 0x0403A120, 0x0403A480, 0x0403A7F0, 0x06000730,
|
|
|
|
};
|
|
|
|
|
|
|
|
static Gfx* D_80115484[] = {
|
|
|
|
0x04039C00, 0x04039C00, 0x04039C00, 0x0403A2D0, 0x0403A2D0, 0x0403A630,
|
|
|
|
0x06000210, 0x0403AB80, 0x0403A9B0, 0x0403C050, 0x0403C5B0, 0x0400D340,
|
|
|
|
};
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-05 22:53:15 +00:00
|
|
|
void EnAObj_SetupAction(EnAObj* this, EnAObjActionFunc actionFunc) {
|
2020-05-01 18:26:16 +00:00
|
|
|
this->actionFunc = actionFunc;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|
|
|
u32 sp34 = 0;
|
2020-05-03 21:04:11 +00:00
|
|
|
s32 pad;
|
2020-05-04 19:02:51 +00:00
|
|
|
EnAObj* this = THIS;
|
2020-03-17 04:31:30 +00:00
|
|
|
f32 sp28;
|
|
|
|
|
|
|
|
sp28 = 6.0f;
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
this->textId = (thisx->params >> 8) & 0xFF;
|
|
|
|
thisx->params &= 0xFF;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
switch (thisx->params) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case A_OBJ_BLOCK_SMALL:
|
2020-05-04 19:02:51 +00:00
|
|
|
Actor_SetScale(thisx, 0.025f);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case A_OBJ_BLOCK_LARGE:
|
2020-05-04 19:02:51 +00:00
|
|
|
Actor_SetScale(thisx, 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:
|
2020-05-04 19:02:51 +00:00
|
|
|
Actor_SetScale(thisx, 0.1f);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case A_OBJ_BLOCK_SMALL_ROT:
|
2020-05-04 19:02:51 +00:00
|
|
|
Actor_SetScale(thisx, 0.005f);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case A_OBJ_BLOCK_LARGE_ROT:
|
|
|
|
default:
|
2020-05-04 19:02:51 +00:00
|
|
|
Actor_SetScale(thisx, 0.01f);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
if (thisx->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
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, sp28);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
thisx->posRot2.pos = thisx->posRot.pos;
|
2020-05-01 18:26:16 +00:00
|
|
|
this->dyna.dynaPolyId = -1;
|
|
|
|
this->dyna.unk_160 = 0;
|
|
|
|
this->dyna.unk_15C = 0;
|
2020-06-25 01:20:31 +00:00
|
|
|
thisx->uncullZoneDownward = 1200.0f;
|
|
|
|
thisx->uncullZoneScale = 200.0f;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
switch (thisx->params) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case A_OBJ_BLOCK_LARGE:
|
|
|
|
case A_OBJ_BLOCK_HUGE:
|
2020-05-04 19:02:51 +00:00
|
|
|
this->dyna.dynaPolyId = 1;
|
|
|
|
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG);
|
|
|
|
func_8001D5C8(this, thisx->params);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case A_OBJ_BLOCK_SMALL_ROT:
|
|
|
|
case A_OBJ_BLOCK_LARGE_ROT:
|
2020-05-04 19:02:51 +00:00
|
|
|
this->dyna.dynaPolyId = 3;
|
|
|
|
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG);
|
|
|
|
func_8001D310(this, thisx->params);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case A_OBJ_UNKNOWN_6:
|
2020-05-03 21:04:11 +00:00
|
|
|
// clang-format off
|
2020-05-04 19:02:51 +00:00
|
|
|
thisx->flags |= 0x1; this->dyna.dynaPolyId = 5; this->unk_178 = 10.0f;
|
2020-05-03 21:04:11 +00:00
|
|
|
// clang-format on
|
2020-05-04 19:02:51 +00:00
|
|
|
thisx->gravity = -2.0f;
|
|
|
|
func_8001D234(this, thisx->params);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case A_OBJ_GRASS_CLUMP:
|
|
|
|
case A_OBJ_TREE_STUMP:
|
2020-05-04 19:02:51 +00:00
|
|
|
this->dyna.dynaPolyId = 0;
|
|
|
|
func_8001D234(this, thisx->params);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case A_OBJ_SIGNPOST_OBLONG:
|
|
|
|
case A_OBJ_SIGNPOST_ARROW:
|
2020-05-04 19:02:51 +00:00
|
|
|
thisx->textId = (this->textId & 0xFF) | 0x300;
|
2020-05-03 21:04:11 +00:00
|
|
|
// clang-format off
|
2020-05-04 19:02:51 +00:00
|
|
|
thisx->flags |= 0x1 | 0x8; thisx->unk_4C = 500.0f;
|
2020-05-03 21:04:11 +00:00
|
|
|
// clang-format on
|
2020-05-04 19:02:51 +00:00
|
|
|
this->unk_178 = 45.0f;
|
|
|
|
func_8001D234(this, thisx->params);
|
|
|
|
Collider_InitCylinder(globalCtx, &this->collider);
|
2020-05-31 09:55:48 +00:00
|
|
|
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
|
2020-05-04 19:02:51 +00:00
|
|
|
thisx->colChkInfo.mass = 0xFF;
|
|
|
|
thisx->unk_1F = 0;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case A_OBJ_KNOB:
|
2020-05-04 19:02:51 +00:00
|
|
|
thisx->gravity = -1.5f;
|
|
|
|
func_8001D480(this, thisx->params);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
default:
|
2020-05-04 19:02:51 +00:00
|
|
|
thisx->gravity = -2.0f;
|
|
|
|
func_8001D234(this, thisx->params);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
2020-03-22 21:19:43 +00:00
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
if (thisx->params < 5) {
|
|
|
|
thisx->colChkInfo.mass = 0xFF;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
if (this->dyna.dynaPolyId != -1) {
|
|
|
|
DynaPolyInfo_Alloc(D_8011546C[this->dyna.dynaPolyId], &sp34);
|
2020-05-04 19:02:51 +00:00
|
|
|
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, sp34);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|
|
|
EnAObj* this = THIS;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-01 18:26:16 +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:
|
2020-05-04 19:02:51 +00:00
|
|
|
Collider_DestroyCylinder(globalCtx, &this->collider);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +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
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
void func_8001D234(EnAObj* this, s16 params) {
|
2020-05-05 22:53:15 +00:00
|
|
|
EnAObj_SetupAction(this, func_8001D25C);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s16 var;
|
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
if (this->dyna.actor.textId != 0) {
|
2020-06-14 04:09:51 +00:00
|
|
|
var = this->dyna.actor.yawTowardsLink - this->dyna.actor.shape.rot.y;
|
2020-05-01 18:26:16 +00:00
|
|
|
if ((ABS(var) < 0x2800) || ((this->dyna.actor.params == 0xA) && (ABS(var) > 0x5800))) {
|
|
|
|
if (func_8002F194(&this->dyna.actor, globalCtx)) {
|
2020-05-05 22:53:15 +00:00
|
|
|
EnAObj_SetupAction(this, func_8001D204);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-05-01 18:26:16 +00:00
|
|
|
func_8002F2F4(&this->dyna.actor, globalCtx);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +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;
|
2020-05-01 18:26:16 +00:00
|
|
|
this->dyna.actor.posRot.rot.y = 0;
|
|
|
|
this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot;
|
2020-05-05 22:53:15 +00:00
|
|
|
EnAObj_SetupAction(this, func_8001D360);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
void func_8001D360(EnAObj* this, GlobalContext* globalCtx) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (this->unk_16E == 0) {
|
2020-05-01 18:26:16 +00:00
|
|
|
if (this->dyna.unk_160 != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
this->unk_16E++;
|
|
|
|
this->unk_170 = 20;
|
|
|
|
|
2020-06-14 04:09:51 +00:00
|
|
|
if ((s16)(this->dyna.actor.yawTowardsLink + 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
|
|
|
|
2020-06-14 04:09:51 +00:00
|
|
|
if (this->dyna.actor.yawTowardsLink < 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 {
|
2020-05-01 18:26:16 +00:00
|
|
|
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--;
|
2020-05-01 18:26:16 +00:00
|
|
|
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) {
|
2020-05-01 18:26:16 +00:00
|
|
|
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;
|
2020-05-01 18:26:16 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
void func_8001D480(EnAObj* this, s16 params) {
|
2020-05-05 22:53:15 +00:00
|
|
|
EnAObj_SetupAction(this, func_8001D4A8);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +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
|
|
|
|
2020-05-01 18:26:16 +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
|
2020-05-01 18:26:16 +00:00
|
|
|
this->dyna.actor.posRot.rot.y =
|
2020-05-07 23:18:09 +00:00
|
|
|
((this->dyna.actor.wallPolyRot - this->dyna.actor.posRot.rot.y) + this->dyna.actor.wallPolyRot) -
|
|
|
|
0x8000;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-05-01 18:26:16 +00:00
|
|
|
this->dyna.actor.bgCheckFlags &= ~0x8;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +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 {
|
2020-05-01 18:26:16 +00:00
|
|
|
Actor_Kill(&this->dyna.actor);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
void func_8001D5C8(EnAObj* this, s16 params) {
|
2020-06-25 01:20:31 +00:00
|
|
|
this->dyna.actor.uncullZoneDownward = 1200.0f;
|
|
|
|
this->dyna.actor.uncullZoneScale = 720.0f;
|
2020-05-05 22:53:15 +00:00
|
|
|
EnAObj_SetupAction(this, func_8001D608);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +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
|
|
|
|
2020-05-01 18:26:16 +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
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
Math_SmoothScaleMaxMinF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
if (this->dyna.actor.speedXZ != 0.0f) {
|
2020-07-05 03:30:21 +00:00
|
|
|
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
this->dyna.unk_154 = 0.0f;
|
|
|
|
this->dyna.unk_150 = 0.0f;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|
|
|
EnAObj* this = THIS;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-01 18:26:16 +00:00
|
|
|
this->actionFunc(this, globalCtx);
|
|
|
|
Actor_MoveForward(&this->dyna.actor);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-05-01 18:26:16 +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 {
|
2020-05-01 18:26:16 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2020-05-01 18:26:16 +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
|
|
|
|
2020-05-01 18:26:16 +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:
|
2020-05-01 18:26:16 +00:00
|
|
|
Collider_CylinderUpdate(&this->dyna.actor, &this->collider);
|
2020-05-04 19:02:51 +00:00
|
|
|
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|
|
|
s32 type = thisx->params;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-08-29 23:00:17 +00:00
|
|
|
OPEN_DISPS(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
|
|
|
|
2020-05-04 19:02:51 +00:00
|
|
|
if (thisx->params == A_OBJ_KNOB) {
|
2020-10-29 21:31:09 +00:00
|
|
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 60, 60, 60, 50);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-10-29 21:31:09 +00:00
|
|
|
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712),
|
2020-03-22 21:19:43 +00:00
|
|
|
G_MTX_MODELVIEW | G_MTX_LOAD);
|
2020-10-29 21:31:09 +00:00
|
|
|
gSPDisplayList(POLY_OPA_DISP++, D_80115484[type]);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-08-29 23:00:17 +00:00
|
|
|
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 715);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|