mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-10 22:11:46 -04:00
Moves func_800CB000 to z_bg_item, decompiles func_800CB000, and documents z_bg_item and a few DynaPolyActor struct members. (#407)
* Moves func_800CB000 to z_bg_item, decompiles func_800CB000, and documents z_bg_item and a few DynaPolyActor struct members. * Adding usage of dynapoly state flag defines. * Formats z_bg_item * Update z_bg_item.c * Update z_bg_collect.c * Update z_bg_item.c * Update z_bg_item.c * Renames z_bg_item system to DynaPolyActor * Format
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
#include "global.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800CB000/func_800CB000.s")
|
||||
+2
-2
@@ -509,8 +509,8 @@ f32 Actor_YDistance(Actor* actor1, Actor* actor2) {
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800B72E0.s")
|
||||
|
||||
void func_800B72F8(DynaPolyActor* dpactor, f32 a1, s16 a2) {
|
||||
dpactor->unk150 = a2;
|
||||
dpactor->unk148 += a1;
|
||||
dpactor->yRotation = a2;
|
||||
dpactor->pushForce += a1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/Actor_IsLinkFacingActor.s")
|
||||
|
||||
@@ -61,13 +61,13 @@ void BgCheck2_AttachToMesh(CollisionContext* colCtx, Actor* actor, s32 index) {
|
||||
|
||||
meshActor = BgCheck_GetActorOfMesh(colCtx, index);
|
||||
if (meshActor != NULL) {
|
||||
func_800CAE88(meshActor);
|
||||
DynaPolyActor_SetRidingFallingState(meshActor);
|
||||
|
||||
if ((actor->flags & 0x4000000) == 0x4000000) {
|
||||
func_800CAF24(meshActor);
|
||||
DynaPolyActor_SetSwitchPressedState(meshActor);
|
||||
}
|
||||
if ((actor->flags & 0x20000) == 0x20000) {
|
||||
func_800CAF38(meshActor);
|
||||
DynaPolyActor_SetHeavySwitchPressedState(meshActor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* colCtx, s32 index, Acto
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (((colCtx->dyna.bgActorFlags[index] & 2) != 0) || ((colCtx->dyna.bgActorFlags[index] & 1) == 0)) {
|
||||
if (colCtx->dyna.bgActorFlags[index] & 2 || !(colCtx->dyna.bgActorFlags[index] & 1)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -90,12 +90,12 @@ u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* colCtx, s32 index, Acto
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((meshActor->unk154 & 1) != 0) {
|
||||
if (meshActor->flags & 1) {
|
||||
BgCheck2_UpdateActorPosition(colCtx, index, actor);
|
||||
wasUpdated = 1;
|
||||
}
|
||||
|
||||
if ((meshActor->unk154 & 2) != 0) {
|
||||
if (meshActor->flags & 2) {
|
||||
BgCheck2_UpdateActorYRotation(colCtx, index, actor);
|
||||
wasUpdated = 1;
|
||||
}
|
||||
|
||||
+94
-52
@@ -1,99 +1,141 @@
|
||||
#include "global.h"
|
||||
|
||||
void BcCheck3_BgActorInit(DynaPolyActor* actor, UNK_TYPE4 param_2) {
|
||||
actor->bgId = -1;
|
||||
actor->unk148 = 0;
|
||||
actor->unk14C = 0;
|
||||
actor->unk154 = param_2;
|
||||
actor->unk_158 = 0;
|
||||
#define DYNAPOLY_STATE_NONE 0
|
||||
#define DYNAPOLY_STATE_RIDING_FALLING (1 << 0)
|
||||
#define DYNAPOLY_STATE_RIDING_MOVING (1 << 1)
|
||||
#define DYNAPOLY_STATE_RIDING_ROTATING (1 << 2)
|
||||
#define DYNAPOLY_STATE_SWITCH_PRESSED (1 << 3)
|
||||
#define DYNAPOLY_STATE_HEAVY_SWITCH_PRESSED (1 << 4)
|
||||
|
||||
void DynaPolyActor_Init(DynaPolyActor* dynaActor, s32 flags) {
|
||||
dynaActor->bgId = -1;
|
||||
dynaActor->pushForce = 0.0f;
|
||||
dynaActor->unk14C = 0.0f;
|
||||
dynaActor->flags = flags;
|
||||
dynaActor->stateFlags = DYNAPOLY_STATE_NONE;
|
||||
}
|
||||
|
||||
void BgCheck3_LoadMesh(GlobalContext* globalCtx, DynaPolyActor* actor, CollisionHeader* meshHeader) {
|
||||
CollisionHeader* header;
|
||||
void DynaPolyActor_LoadMesh(GlobalContext* globalCtx, DynaPolyActor* dynaActor, CollisionHeader* meshHeader) {
|
||||
CollisionHeader* header = NULL;
|
||||
|
||||
header = NULL;
|
||||
BgCheck_RelocateMeshHeader(meshHeader, &header);
|
||||
actor->bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, actor, header);
|
||||
dynaActor->bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, dynaActor, header);
|
||||
}
|
||||
|
||||
void BgCheck3_ResetFlags(DynaPolyActor* actor) {
|
||||
actor->unk_158 = 0;
|
||||
void DynaPolyActor_ResetState(DynaPolyActor* dynaActor) {
|
||||
dynaActor->stateFlags = DYNAPOLY_STATE_NONE;
|
||||
}
|
||||
|
||||
void func_800CAE88(DynaPolyActor* actor) {
|
||||
actor->unk_158 |= 1;
|
||||
void DynaPolyActor_SetRidingFallingState(DynaPolyActor* dynaActor) {
|
||||
dynaActor->stateFlags |= DYNAPOLY_STATE_RIDING_FALLING;
|
||||
}
|
||||
|
||||
void func_800CAE9C(DynaPolyActor* actor) {
|
||||
actor->unk_158 |= 2;
|
||||
void DynaPolyActor_SetRidingMovingState(DynaPolyActor* dynaActor) {
|
||||
dynaActor->stateFlags |= DYNAPOLY_STATE_RIDING_MOVING;
|
||||
}
|
||||
|
||||
void func_800CAEB0(CollisionContext* colCtx, s32 index) {
|
||||
DynaPolyActor* actor;
|
||||
void DynaPolyActor_SetRidingMovingStateByIndex(CollisionContext* colCtx, s32 index) {
|
||||
DynaPolyActor* dynaActor = BgCheck_GetActorOfMesh(colCtx, index);
|
||||
|
||||
actor = BgCheck_GetActorOfMesh(colCtx, index);
|
||||
if (actor != (DynaPolyActor*)0x0) {
|
||||
func_800CAE9C(actor);
|
||||
if (dynaActor != NULL) {
|
||||
DynaPolyActor_SetRidingMovingState(dynaActor);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800CAEE0(DynaPolyActor* actor) {
|
||||
actor->unk_158 |= 4;
|
||||
void DynaPolyActor_SetRidingRotatingState(DynaPolyActor* dynaActor) {
|
||||
dynaActor->stateFlags |= DYNAPOLY_STATE_RIDING_ROTATING;
|
||||
}
|
||||
|
||||
void func_800CAEF4(CollisionContext* colCtx, s32 index) {
|
||||
DynaPolyActor* actor;
|
||||
void DynaPolyActor_SetRidingRotatingStateByIndex(CollisionContext* colCtx, s32 index) {
|
||||
DynaPolyActor* dynaActor = BgCheck_GetActorOfMesh(colCtx, index);
|
||||
|
||||
actor = BgCheck_GetActorOfMesh(colCtx, index);
|
||||
if (actor != (DynaPolyActor*)0x0) {
|
||||
func_800CAEE0(actor);
|
||||
if (dynaActor != NULL) {
|
||||
DynaPolyActor_SetRidingRotatingState(dynaActor);
|
||||
}
|
||||
}
|
||||
|
||||
void func_800CAF24(DynaPolyActor* actor) {
|
||||
actor->unk_158 |= 8;
|
||||
void DynaPolyActor_SetSwitchPressedState(DynaPolyActor* dynaActor) {
|
||||
dynaActor->stateFlags |= DYNAPOLY_STATE_SWITCH_PRESSED;
|
||||
}
|
||||
|
||||
void func_800CAF38(DynaPolyActor* actor) {
|
||||
actor->unk_158 |= 0x10;
|
||||
void DynaPolyActor_SetHeavySwitchPressedState(DynaPolyActor* dynaActor) {
|
||||
dynaActor->stateFlags |= DYNAPOLY_STATE_HEAVY_SWITCH_PRESSED;
|
||||
}
|
||||
|
||||
s32 func_800CAF4C(DynaPolyActor* actor) {
|
||||
if (actor->unk_158 & 1) {
|
||||
return 1;
|
||||
s32 DynaPolyActor_IsInRidingFallingState(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->stateFlags & DYNAPOLY_STATE_RIDING_FALLING) {
|
||||
return true;
|
||||
} else {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800CAF70(DynaPolyActor* actor) {
|
||||
if (actor->unk_158 & 2) {
|
||||
return 1;
|
||||
s32 DynaPolyActor_IsInRidingMovingState(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->stateFlags & DYNAPOLY_STATE_RIDING_MOVING) {
|
||||
return true;
|
||||
} else {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800CAF94(DynaPolyActor* actor) {
|
||||
if (actor->unk_158 & 4) {
|
||||
return 1;
|
||||
s32 DynaPolyActor_IsInRidingRotatingState(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->stateFlags & DYNAPOLY_STATE_RIDING_ROTATING) {
|
||||
return true;
|
||||
} else {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800CAFB8(DynaPolyActor* actor) {
|
||||
if (actor->unk_158 & 8) {
|
||||
return 1;
|
||||
s32 DynaPolyActor_IsInSwitchPressedState(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->stateFlags & DYNAPOLY_STATE_SWITCH_PRESSED) {
|
||||
return true;
|
||||
} else {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
s32 func_800CAFDC(DynaPolyActor* actor) {
|
||||
if (actor->unk_158 & 0x10) {
|
||||
return 1;
|
||||
s32 DynaPolyActor_IsInHeavySwitchPressedState(DynaPolyActor* dynaActor) {
|
||||
if (dynaActor->stateFlags & DYNAPOLY_STATE_HEAVY_SWITCH_PRESSED) {
|
||||
return true;
|
||||
} else {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
s32 DynaPolyActor_ValidateMove(GlobalContext* globalCtx, DynaPolyActor* dynaActor, s16 startRadius, s16 endRadius,
|
||||
s16 startHeight) {
|
||||
Vec3f startPos;
|
||||
Vec3f endPos;
|
||||
Vec3f intersectionPos;
|
||||
f32 sin = Math_SinS(dynaActor->yRotation);
|
||||
f32 cos = Math_CosS(dynaActor->yRotation);
|
||||
s32 bgId;
|
||||
CollisionPoly* poly;
|
||||
f32 adjustedStartRadius;
|
||||
f32 adjustedEndRadius;
|
||||
f32 sign = (0.0f <= dynaActor->pushForce) ? 1.0f : -1.0f;
|
||||
|
||||
adjustedStartRadius = (f32)startRadius - 0.1f;
|
||||
startPos.x = dynaActor->actor.world.pos.x + (adjustedStartRadius * cos);
|
||||
startPos.y = dynaActor->actor.world.pos.y + startHeight;
|
||||
startPos.z = dynaActor->actor.world.pos.z - (adjustedStartRadius * sin);
|
||||
|
||||
adjustedEndRadius = (f32)endRadius - 0.1f;
|
||||
endPos.x = sign * adjustedEndRadius * sin + startPos.x;
|
||||
endPos.y = startPos.y;
|
||||
endPos.z = sign * adjustedEndRadius * cos + startPos.z;
|
||||
|
||||
if (func_800C56E0(&globalCtx->colCtx, &startPos, &endPos, &intersectionPos, &poly, true, false, false, true, &bgId,
|
||||
&dynaActor->actor, 0.0f)) {
|
||||
return false;
|
||||
}
|
||||
startPos.x = (dynaActor->actor.world.pos.x * 2.0f) - startPos.x;
|
||||
startPos.z = (dynaActor->actor.world.pos.z * 2.0f) - startPos.z;
|
||||
endPos.x = sign * adjustedEndRadius * sin + startPos.x;
|
||||
endPos.z = sign * adjustedEndRadius * cos + startPos.z;
|
||||
if (func_800C56E0(&globalCtx->colCtx, &startPos, &endPos, &intersectionPos, &poly, true, false, false, true, &bgId,
|
||||
&dynaActor->actor, 0.0f)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -143,11 +143,11 @@ void BgCtowerGear_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
}
|
||||
if (type == WATER_WHEEL) {
|
||||
BcCheck3_BgActorInit(&this->dyna, 3);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06018588);
|
||||
DynaPolyActor_Init(&this->dyna, 3);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06018588);
|
||||
} else if (type == ORGAN) {
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06016E70);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06016E70);
|
||||
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,18 +53,18 @@ void BgCtowerRot_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Vec3f offset;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
if (this->dyna.actor.params == CORRIDOR) {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060142E8);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060142E8);
|
||||
this->actionFunc = BgCtowerRot_CorridorRotate;
|
||||
return;
|
||||
}
|
||||
player = GET_PLAYER(globalCtx);
|
||||
if (this->dyna.actor.params == MAIN_DOOR) {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06017410);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06017410);
|
||||
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x4000;
|
||||
} else {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06017650);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06017650);
|
||||
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y - 0x4000;
|
||||
}
|
||||
Actor_CalcOffsetOrientedToDrawRotation(&this->dyna.actor, &offset, &player->actor.world.pos);
|
||||
|
||||
@@ -36,7 +36,7 @@ void BgFuKaiten_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
CollisionHeader* header = 0;
|
||||
|
||||
Actor_SetScale(thisx, 1.0);
|
||||
BcCheck3_BgActorInit(&THIS->bg, 3);
|
||||
DynaPolyActor_Init(&THIS->bg, 3);
|
||||
BgCheck_RelocateMeshHeader(&D_06002D30, &header);
|
||||
THIS->bg.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &THIS->bg, header);
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ void BgHakaCurtain_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgHakaCurtain* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06001588);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06001588);
|
||||
if (Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) {
|
||||
func_80B6DE80(this);
|
||||
return;
|
||||
|
||||
@@ -47,8 +47,8 @@ void BgHakaTomb_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgHakaTomb* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, D_06000EE8);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, D_06000EE8);
|
||||
func_8013E3B8(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
|
||||
func_80BD6624(this);
|
||||
}
|
||||
|
||||
@@ -704,8 +704,8 @@ void BgHakuginPost_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->dyna.actor.world.rot.z = 0;
|
||||
this->dyna.actor.shape.rot.x = 0;
|
||||
this->dyna.actor.shape.rot.z = 0;
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_0600D3B0);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600D3B0);
|
||||
func_80A9B3BC(this, globalCtx);
|
||||
func_80A9CA94(this);
|
||||
} else {
|
||||
|
||||
@@ -70,8 +70,8 @@ void BgIcicle_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 paramsMid;
|
||||
|
||||
Actor_ProcessInitChain(thisx, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000294);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000294);
|
||||
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
|
||||
Collider_UpdateCylinder(thisx, &this->collider);
|
||||
|
||||
@@ -67,8 +67,8 @@ void BgIkanaShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgIkanaShutter* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000F28);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000F28);
|
||||
if (!((this->dyna.actor.params >> 8) & 1)) {
|
||||
if (BgIkanaShutter_AllSwitchesPressed(this, globalCtx)) {
|
||||
func_80BD599C(this);
|
||||
|
||||
@@ -115,8 +115,8 @@ void BgIkninSusceil_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgIkninSusceil* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_0600CBAC);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600CBAC);
|
||||
this->animatedTexture = Lib_SegmentedToVirtual(&D_0600C670);
|
||||
func_80C0AC74(this);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ void BgIknvObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
break;
|
||||
case IKNV_OBJ_RAISED_DOOR:
|
||||
this->displayListPtr = D_06011880;
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
BgCheck_RelocateMeshHeader(&D_060119D4, &colHeader);
|
||||
this->dyna.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &this->dyna, colHeader);
|
||||
this->actionFunc = BgIknvObj_UpdateRaisedDoor;
|
||||
@@ -83,7 +83,7 @@ void BgIknvObj_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
case IKNV_OBJ_SAKON_DOOR:
|
||||
this->displayListPtr = D_060129C8;
|
||||
this->actionFunc = BgIknvObj_UpdateSakonDoor;
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
BgCheck_RelocateMeshHeader(&D_06012CA4, &colHeader);
|
||||
this->dyna.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &this->dyna, colHeader);
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit);
|
||||
|
||||
@@ -158,8 +158,8 @@ void BgKin2Fence_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 i = 0;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000908);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000908);
|
||||
Collider_InitJntSph(globalCtx, &this->collider);
|
||||
Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
|
||||
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
|
||||
|
||||
@@ -61,17 +61,17 @@ void BgLadder_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
// Has to be `thisx` instead of `&this->actor` to match
|
||||
this->switchFlag = GET_BGLADDER_SWITCHFLAG(thisx);
|
||||
thisx->params = GET_BGLADDER_SIZE(thisx);
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
size = thisx->params;
|
||||
|
||||
if (size == LADDER_SIZE_12RUNG) {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060001D8);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060001D8);
|
||||
} else if (size == LADDER_SIZE_16RUNG) {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000408);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000408);
|
||||
} else if (size == LADDER_SIZE_20RUNG) {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000638);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000638);
|
||||
} else if (size == LADDER_SIZE_24RUNG) {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000868);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000868);
|
||||
} else {
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
return;
|
||||
|
||||
@@ -38,8 +38,8 @@ void BgLbfshot_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
this->dyna.actor.uncullZoneForward = 4000.0f;
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060014D8);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060014D8);
|
||||
}
|
||||
void BgLbfshot_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgLbfshot* this = THIS;
|
||||
|
||||
@@ -44,8 +44,8 @@ void BgLotus_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 sp2C;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000A20);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000A20);
|
||||
this->dyna.actor.floorHeight =
|
||||
func_800C411C(&globalCtx->colCtx, &thisx->floorPoly, &sp2C, &this->dyna.actor, &this->dyna.actor.world.pos);
|
||||
this->timer2 = 96;
|
||||
@@ -93,7 +93,7 @@ void BgLotus_Wait(BgLotus* this, GlobalContext* globalCtx) {
|
||||
} else {
|
||||
this->dyna.actor.world.pos.y = this->height;
|
||||
|
||||
if (func_800CAF70(&this->dyna)) {
|
||||
if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
|
||||
if (this->hasSpawnedRipples == 0) {
|
||||
EffectSsGRipple_Spawn(globalCtx, &this->dyna.actor.world.pos, 1000, 1400, 0);
|
||||
EffectSsGRipple_Spawn(globalCtx, &this->dyna.actor.world.pos, 1000, 1400, 8);
|
||||
|
||||
@@ -41,8 +41,8 @@ void BgMbarChair_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgMbarChair* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060019B4);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060019B4);
|
||||
}
|
||||
|
||||
void BgMbarChair_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
@@ -78,8 +78,8 @@ void BgTobira01_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgTobira01* this = THIS;
|
||||
s32 pad;
|
||||
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060011C0);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060011C0);
|
||||
gSaveContext.weekEventReg[88] &= (u8)~0x40;
|
||||
Actor_SetScale(&this->dyna.actor, 1.0f);
|
||||
this->timer2 = gSaveContext.isNight;
|
||||
|
||||
@@ -61,8 +61,8 @@ void DmChar07_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
if (this->dyna.actor.params == DMCHAR07_STAGE) {
|
||||
Actor_SetScale(&this->dyna.actor, 0.1f);
|
||||
this->isStage = 1;
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06006688);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06006688);
|
||||
} else {
|
||||
Actor_SetScale(&this->dyna.actor, 1.0f);
|
||||
}
|
||||
|
||||
@@ -108,8 +108,8 @@ void EnDnb_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 i;
|
||||
s16* alloc;
|
||||
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06004D8C);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06004D8C);
|
||||
|
||||
alloc = (s16*)Lib_SegmentedToVirtual(D_06004710);
|
||||
for (i = 0; i < ARRAY_COUNT(this->particles); i++) {
|
||||
|
||||
@@ -106,7 +106,7 @@ void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
CollisionHeader* colHeader = NULL;
|
||||
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
BgCheck_RelocateMeshHeader(&D_06002420, &colHeader);
|
||||
this->dyna.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &this->dyna, colHeader);
|
||||
ActorShape_Init(&this->dyna.actor.shape, 0.0f, func_800B3FC0, 25.0f);
|
||||
|
||||
@@ -781,7 +781,8 @@ void func_80962F4C(EnFu* this, GlobalContext* globalCtx) {
|
||||
func_801518B0(globalCtx, 0x288B, &this->actor);
|
||||
}
|
||||
|
||||
if ((!func_800CAF94((DynaPolyActor*)this->actor.child) && (player->actor.bgCheckFlags & 1)) ||
|
||||
if ((!DynaPolyActor_IsInRidingRotatingState((DynaPolyActor*)this->actor.child) &&
|
||||
(player->actor.bgCheckFlags & 1)) ||
|
||||
(gSaveContext.unk_3DE0[4] < 1) || (this->unk_548 == this->unk_54C)) {
|
||||
player->stateFlags3 &= ~0x400000;
|
||||
func_80961E88(globalCtx);
|
||||
|
||||
@@ -264,8 +264,8 @@ void func_80A35BD4(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void ObjBell_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjBell* this = THIS;
|
||||
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06001BA8);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06001BA8);
|
||||
Actor_SetScale(&this->dyna.actor, 0.08f);
|
||||
Collider_InitAndSetSphere(globalCtx, &this->collider1, &this->dyna.actor, &sCylinderInit1);
|
||||
Collider_InitAndSetSphere(globalCtx, &this->collider2, &this->dyna.actor, &sCylinderInit2);
|
||||
|
||||
@@ -147,7 +147,7 @@ void ObjEtcetera_Idle(ObjEtcetera* this, GlobalContext* globalCtx) {
|
||||
this->oscillationTimer = minOscillationTimer;
|
||||
}
|
||||
} else {
|
||||
if (func_800CAF70(&this->dyna)) {
|
||||
if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
|
||||
if (!(this->burrowFlag & 1)) {
|
||||
// Player is walking onto the Deku Flower, or falling on it from a height
|
||||
this->oscillationTimer = 10;
|
||||
@@ -175,7 +175,7 @@ void ObjEtcetera_Idle(ObjEtcetera* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void ObjEtcetera_PlaySmallFlutterAnimation(ObjEtcetera* this, GlobalContext* globalCtx) {
|
||||
if (func_800CAF70(&this->dyna)) {
|
||||
if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
|
||||
this->burrowFlag |= 1;
|
||||
} else {
|
||||
this->burrowFlag &= ~1;
|
||||
@@ -190,11 +190,11 @@ void ObjEtcetera_PlaySmallFlutterAnimation(ObjEtcetera* this, GlobalContext* glo
|
||||
void ObjEtcetera_DoIntenseOscillation(ObjEtcetera* this, GlobalContext* globalCtx) {
|
||||
// In order to match, we are seemingly required to access scale.x at one point
|
||||
// without using this. We can create a thisx or dyna pointer to achieve that, but
|
||||
// it's more likely they used dyna given that func_800CAF70 takes a DynaPolyActor.
|
||||
// it's more likely they used dyna given that DynaPolyActor_IsInRidingMovingState takes a DynaPolyActor.
|
||||
DynaPolyActor* dyna = &this->dyna;
|
||||
f32 scaleTemp;
|
||||
|
||||
if (func_800CAF70(dyna)) {
|
||||
if (DynaPolyActor_IsInRidingMovingState(dyna)) {
|
||||
this->burrowFlag |= 1;
|
||||
} else {
|
||||
this->burrowFlag &= ~1;
|
||||
@@ -233,7 +233,7 @@ void ObjEtcetera_Setup(ObjEtcetera* this, GlobalContext* globalCtx) {
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, this->objIndex)) {
|
||||
this->dyna.actor.objBankIndex = this->objIndex;
|
||||
Actor_SetObjectSegment(globalCtx, &this->dyna.actor);
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
thisCollisionHeader = collisionHeaders[type];
|
||||
if (thisCollisionHeader != 0) {
|
||||
BgCheck_RelocateMeshHeader(thisCollisionHeader, &colHeader);
|
||||
|
||||
@@ -87,12 +87,12 @@ void func_80B3C39C(ObjGhaka* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this->dyna.unk148 < 0.0f && !(gSaveContext.weekEventReg[20] & 0x20) &&
|
||||
if (this->dyna.pushForce < 0.0f && !(gSaveContext.weekEventReg[20] & 0x20) &&
|
||||
player->transformation == PLAYER_FORM_GORON) {
|
||||
func_80B3C2B0(this);
|
||||
} else {
|
||||
player->stateFlags2 &= ~0x10;
|
||||
this->dyna.unk148 = 0.0f;
|
||||
this->dyna.pushForce = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ void func_80B3C624(ObjGhaka* this, GlobalContext* globalCtx) {
|
||||
|
||||
if (stepTemp) {
|
||||
player->stateFlags2 &= ~0x10;
|
||||
this->dyna.unk148 = 0.0f;
|
||||
this->dyna.pushForce = 0.0f;
|
||||
func_80B3C2C4(this, globalCtx);
|
||||
gSaveContext.weekEventReg[20] |= 0x20;
|
||||
func_80B3C260(this);
|
||||
@@ -153,7 +153,7 @@ void ObjGhaka_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, D_80B3C96C);
|
||||
Actor_SetScale(&this->dyna.actor, 0.1f);
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
BgCheck_RelocateMeshHeader(&D_06003CD0, &colHeader);
|
||||
this->dyna.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &this->dyna, colHeader);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x4);
|
||||
|
||||
@@ -78,7 +78,7 @@ void ObjHgdoor_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
CollisionHeader* header = NULL;
|
||||
|
||||
Actor_SetScale(&this->dyna.actor, 0.1f);
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
if (OBJHGDOOR_IS_RIGHT_DOOR(&this->dyna.actor)) {
|
||||
BgCheck_RelocateMeshHeader(&D_06001D10, &header);
|
||||
} else {
|
||||
|
||||
@@ -47,8 +47,8 @@ void ObjHsStump_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
this->isHidden = OBJHSSTUMP_GET_ISHIDDEN(thisx);
|
||||
this->switchFlag = OBJHSSTUMP_GET_SWITCHFLAG(thisx); // Must be thisx to match
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060011B0);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060011B0);
|
||||
switch (this->isHidden) {
|
||||
case true:
|
||||
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
|
||||
@@ -40,8 +40,8 @@ void ObjKepnKoya_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
Actor_SetScale(&this->dyna.actor, 0.1f);
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_0600805C);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600805C);
|
||||
if (this->dyna.bgId == 0x32) {
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
}
|
||||
|
||||
@@ -149,10 +149,10 @@ void ObjKibako2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
ObjKibako2Contents contents = KIBAKO2_CONTENTS(&this->dyna.actor);
|
||||
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000B70);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000B70);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit);
|
||||
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
|
||||
this->dyna.actor.home.rot.z = 0;
|
||||
|
||||
@@ -91,12 +91,12 @@ void ObjLightblock_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
Actor_SetScale(&this->dyna.actor, typeVars->scale);
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
if (Flags_GetSwitch(globalCtx, LIGHTBLOCK_DESTROYED(&this->dyna.actor))) {
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
} else {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000B80);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000B80);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit);
|
||||
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
|
||||
this->collider.dim.radius = typeVars->radius;
|
||||
|
||||
@@ -70,8 +70,8 @@ void ObjRaillift_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
thisx->world.rot.x = 0;
|
||||
thisx->shape.rot.z = 0;
|
||||
thisx->world.rot.z = 0;
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, sColHeaders[type]);
|
||||
DynaPolyActor_Init(&this->dyna, 1);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, sColHeaders[type]);
|
||||
this->speed = OBJRAILLIFT_GET_SPEED(thisx);
|
||||
if (this->speed < 0.0f) {
|
||||
this->speed = -this->speed;
|
||||
@@ -187,7 +187,7 @@ void ObjRaillift_Move(ObjRaillift* this, GlobalContext* globalCtx) {
|
||||
Will teleport to what ever curpoint is set to
|
||||
*/
|
||||
void ObjRaillift_Teleport(ObjRaillift* this, GlobalContext* globalCtx) {
|
||||
if (!func_800CAF70(&this->dyna)) {
|
||||
if (!DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
|
||||
ObjRaillift_UpdatePosition(this, this->curPoint);
|
||||
func_800C6314(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
this->actionFunc = ObjRaillift_Move;
|
||||
@@ -237,7 +237,7 @@ void ObjRaillift_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s32 requiredScopeTemp;
|
||||
|
||||
this->isWeightOnPrev = this->isWeightOn;
|
||||
if (func_800CAF70(&this->dyna)) {
|
||||
if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
|
||||
this->isWeightOn = true;
|
||||
} else {
|
||||
this->isWeightOn = false;
|
||||
|
||||
@@ -195,9 +195,9 @@ void ObjTokeiStep_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjTokeiStep* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
if ((globalCtx->sceneNum == 0x6F) && (gSaveContext.sceneSetupIndex == 2) && (globalCtx->csCtx.unk_12 == 0)) {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000968);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000968);
|
||||
ObjTokeiStep_InitSteps(this);
|
||||
ObjTokeiStep_SetupBeginOpen(this);
|
||||
} else if (!((CURRENT_DAY != 3) || (gSaveContext.time >= 0x4000)) || gSaveContext.day >= 4) {
|
||||
@@ -205,7 +205,7 @@ void ObjTokeiStep_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjTokeiStep_InitStepsOpen(this);
|
||||
ObjTokeiStep_SetupDoNothingOpen(this);
|
||||
} else {
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000968);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000968);
|
||||
ObjTokeiStep_InitSteps(this);
|
||||
ObjTokeiStep_SetupDoNothing(this);
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ void ObjVisiblock_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ObjVisiblock* this = THIS;
|
||||
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 0);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000AD0);
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000AD0);
|
||||
}
|
||||
|
||||
void ObjVisiblock_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
Reference in New Issue
Block a user