small docs

This commit is contained in:
louist103
2023-10-30 17:31:58 -04:00
parent eab7aa28b5
commit 7899de4688
2 changed files with 59 additions and 64 deletions
+57 -62
View File
@@ -23,11 +23,10 @@ void func_809613E8(ObjMure2* this);
void func_8096147C(ObjMure2* this);
void func_80961018(s16*, ObjMure2*);
void func_80960CF0(Vec3f*, ObjMure2*);
void func_80960E0C(Vec3f*, ObjMure2*);
void func_80960F0C(Vec3f*, ObjMure2*);
void func_80960CF0(Vec3f pos[12], ObjMure2* this);
void func_80960E0C(Vec3f pos[12], ObjMure2* this);
void func_80960F0C(Vec3f pos[12], ObjMure2* this);
#if 1
ActorInit Obj_Mure2_InitVars = {
ACTOR_OBJ_MURE2,
ACTORCAT_PROP,
@@ -52,18 +51,17 @@ f32 D_8096159C[] = {
2907025.0,
};
s16 D_809615A8[] = {
static s16 sChildCounts[] = {
9,
12,
8,
0,
};
s16 D_809615B0[] = {
0x0090,
0x0090,
0x00B0,
0x0000,
static s16 sActorIds[] = {
ACTOR_EN_KUSA,
ACTOR_EN_KUSA,
ACTOR_EN_ISHI,
};
typedef struct Mure2SpawnInfo {
s16 dist;
@@ -76,52 +74,48 @@ Mure2SpawnInfo D_809615B8[] = {
{ 0x0050, 0x9333 }, { 0x0050, 0xACCC }, { 0x0050, 0xC666 }, { 0x003C, 0xE000 },
};
typedef void (*ObjMure2UnkFunc)(Vec3f*, ObjMure2*);
ObjMure2UnkFunc D_809615E8[] = {
typedef void (*ObjMure2SpawnPosFunc)(Vec3f[12], ObjMure2*);
static ObjMure2SpawnPosFunc sSpawnPosFuncs[] = {
func_80960CF0,
func_80960E0C,
func_80960F0C,
};
// static InitChainEntry sInitChain[] = {
static InitChainEntry D_809615F4[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 2100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_STOP),
};
#endif
extern InitChainEntry D_809615F4[];
void func_80960CF0(Vec3f* arg0, ObjMure2* arg1) {
void func_80960CF0(Vec3f pos[12], ObjMure2* this) {
s32 i;
Math_Vec3f_Copy(&arg0[0], &arg1->actor.world.pos);
for (i = 1; i < D_809615A8[arg1->actor.params & 3]; i++) {
Math_Vec3f_Copy(&arg0[i], &arg1->actor.world.pos);
(arg0 + i)->x += 80.0f * Math_SinS((i - 1) * 0x2000);
(arg0 + i)->z += 80.0f * Math_CosS((i - 1) * 0x2000);
Math_Vec3f_Copy(&pos[0], &this->actor.world.pos);
for (i = 1; i < sChildCounts[this->actor.params & 3]; i++) {
Math_Vec3f_Copy(&pos[i], &this->actor.world.pos);
(pos + i)->x += 80.0f * Math_SinS((i - 1) * 0x2000);
(pos + i)->z += 80.0f * Math_CosS((i - 1) * 0x2000);
}
}
void func_80960E0C(Vec3f* arg0, ObjMure2* arg1) {
void func_80960E0C(Vec3f pos[12], ObjMure2* this) {
s32 i;
for (i = 0; i < D_809615A8[arg1->actor.params & 3]; i++) {
Math_Vec3f_Copy(arg0 + i, &arg1->actor.world.pos);
(arg0 + i)->x += D_809615B8[i].dist * Math_CosS(D_809615B8[i].angle);
(arg0 + i)->z -= D_809615B8[i].dist * Math_SinS(D_809615B8[i].angle);
for (i = 0; i < sChildCounts[this->actor.params & 3]; i++) {
Math_Vec3f_Copy(pos + i, &this->actor.world.pos);
(pos + i)->x += D_809615B8[i].dist * Math_CosS(D_809615B8[i].angle);
(pos + i)->z -= D_809615B8[i].dist * Math_SinS(D_809615B8[i].angle);
}
}
void func_80960F0C(Vec3f* arg0, ObjMure2* arg1) {
void func_80960F0C(Vec3f pos[12], ObjMure2* this) {
s32 i;
for (i = 0; i < D_809615A8[arg1->actor.params & 3]; i++) {
Math_Vec3f_Copy(&arg0[i], &arg1->actor.world.pos);
(arg0 + i)->x += 80.0f * Math_SinS(i * 0x2000);
(arg0 + i)->z += 80.0f * Math_CosS(i * 0x2000);
for (i = 0; i < sChildCounts[this->actor.params & 3]; i++) {
Math_Vec3f_Copy(&pos[i], &this->actor.world.pos);
(pos + i)->x += 80.0f * Math_SinS(i * 0x2000);
(pos + i)->z += 80.0f * Math_CosS(i * 0x2000);
}
}
@@ -138,26 +132,26 @@ void func_80961018(s16* arg0, ObjMure2* this) {
*arg0 = temp_a2 << 8;
}
void func_8096104C(ObjMure2* this, PlayState* play) {
Vec3f* temp_v0;
Vec3f* pos;
s32 temp_s0;
Vec3f sp80[12];
Vec3f spawnPos[12];
s16 sp7E;
s32 i;
temp_s0 = this->actor.params & 3;
D_809615E8[temp_s0](&sp80, this);
sSpawnPosFuncs[temp_s0](spawnPos, this);
func_80961018(&sp7E, this);
for (i = 0; i < D_809615A8[temp_s0]; i++) {
if (this->unk_148[i] != NULL) {
for (i = 0; i < sChildCounts[temp_s0]; i++) {
if (this->actors[i] != NULL) {
continue;
}
if (((this->unk_178 >> i) & 1) == 0) {
temp_v0 = &sp80[i];
this->unk_148[i] = Actor_SpawnAsChildAndCutscene(
&play->actorCtx, play, D_809615B0[temp_s0], temp_v0->x, temp_v0->y, temp_v0->z, this->actor.world.rot.x,
0, this->actor.world.rot.z, sp7E, this->actor.csId, this->actor.halfDaysBits, NULL);
if (this->unk_148[i] != NULL) {
this->unk_148[i]->room = this->actor.room;
if (((this->spawnFlags >> i) & 1) == 0) {
pos = &spawnPos[i];
this->actors[i] = Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, sActorIds[temp_s0], pos->x, pos->y,
pos->z, this->actor.world.rot.x, 0, this->actor.world.rot.z,
sp7E, this->actor.csId, this->actor.halfDaysBits, NULL);
if (this->actors[i] != NULL) {
this->actors[i]->room = this->actor.room;
}
}
}
@@ -166,32 +160,32 @@ void func_8096104C(ObjMure2* this, PlayState* play) {
void func_809611BC(ObjMure2* this, PlayState* play) {
s32 i;
for (i = 0; i < D_809615A8[this->actor.params & 3]; i++) {
if (((this->unk_178 >> i) & 1) == 0) {
if (this->unk_148[i] != NULL) {
if (Actor_HasParent(this->unk_148[i], play)) {
this->unk_178 |= 1 << i;
for (i = 0; i < sChildCounts[this->actor.params & 3]; i++) {
if (((this->spawnFlags >> i) & 1) == 0) {
if (this->actors[i] != NULL) {
if (Actor_HasParent(this->actors[i], play)) {
this->spawnFlags |= 1 << i;
} else {
Actor_Kill(this->unk_148[i]);
Actor_Kill(this->actors[i]);
}
this->unk_148[i] = NULL;
this->actors[i] = NULL;
}
} else {
this->unk_148[i] = NULL;
this->actors[i] = NULL;
}
}
}
void func_809612BC(ObjMure2* this) {
void ObjMure2_ClearChildrenList(ObjMure2* this) {
s32 i;
for (i = 0; i < D_809615A8[this->actor.params & 3]; i++) {
if (this->unk_148[i] == NULL) {
for (i = 0; i < sChildCounts[this->actor.params & 3]; i++) {
if (this->actors[i] == NULL) {
continue;
}
if ((((this->unk_178 >> i) & 1) == 0) && (this->unk_148[i]->update == NULL)) {
this->unk_178 |= (1 << i);
this->unk_148[i] = NULL;
if ((((this->spawnFlags >> i) & 1) == 0) && (this->actors[i]->update == NULL)) {
this->spawnFlags |= (1 << i);
this->actors[i] = NULL;
}
}
}
@@ -199,7 +193,7 @@ void func_809612BC(ObjMure2* this) {
void ObjMure2_Init(Actor* thisx, PlayState* play) {
ObjMure2* this = THIS;
Actor_ProcessInitChain(&this->actor, D_809615F4);
Actor_ProcessInitChain(&this->actor, sInitChain);
if (play->csCtx.state != 0) {
this->actor.uncullZoneForward += 1200.0f;
}
@@ -232,8 +226,9 @@ void func_8096147C(ObjMure2* this) {
}
void func_80961490(ObjMure2* this, PlayState* play) {
func_809612BC(this);
if ((D_8096159C[this->actor.params & 3] * this->unk_17C) <= Math3D_XZLengthSquared(this->actor.projectedPos.x, this->actor.projectedPos.z)) {
ObjMure2_ClearChildrenList(this);
if ((D_8096159C[this->actor.params & 3] * this->unk_17C) <=
Math3D_XZLengthSquared(this->actor.projectedPos.x, this->actor.projectedPos.z)) {
this->actor.flags &= ~0x10;
func_809611BC(this, play);
func_809613E8(this);
@@ -10,8 +10,8 @@ typedef void (*ObjMure2ActionFunc)(struct ObjMure2*, PlayState*);
typedef struct ObjMure2 {
/* 0x000 */ Actor actor;
/* 0x144 */ ObjMure2ActionFunc actionFunc;
/* 0x148 */ Actor* unk_148[12];
u16 unk_178;
/* 0x148 */ Actor* actors[12];
/* 0x178*/ u16 spawnFlags;
/* 0x17C */ f32 unk_17C;
} ObjMure2; // size = 0x180