z_bgcheck.c (#357)

* first few functions

* two more almost matching functions

* Rebase to NBS, get it to compile

* BgCheck_RaycastFloorStaticList OK, fix-up some functions

* BgCheck_SphVsStaticWall OK! and a few others

* more z_bgcheck NON_MATCHINGS

* OK more functions, reorganize external reference #defines

* More functions OK, more struct fixes

* More OKs

* Decomp all the way to the end of bgcheck

* All functions attempted

* Rename functions

* formatting, data migration

* Give names to unk structs, rename some structs, fix some non-equivalent functions

* WaterBox_GetSurfaceImpl OK

* BgCheck_ResetPolyCheckTbl OK, improve WaterBox_GetSurface2 codegen, eliminate warnings and clean up source.

* BcCheck3_BgActorInit ->BgCheck3_BgActorInit, fix warnings

* pr change requests

* fix crc maybe

* implement more changes

* implement alf's changes
This commit is contained in:
mzxrules
2021-11-23 11:29:18 -05:00
committed by GitHub
parent 837eb1c806
commit 6b493d3f9d
74 changed files with 5551 additions and 1293 deletions
+25 -25
View File
@@ -2,7 +2,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_Normalize.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_80179678.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_PlaneVsLineSegClosestPoint.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_80179798.s")
@@ -46,7 +46,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_Vec3fMagnitude.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_DistanceSquared.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_Vec3fDistSq.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_Distance.s")
@@ -60,15 +60,15 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_CrossProduct.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_NormalVector.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_SurfaceNorm.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017A954.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_PointRelativeToCubeFaces.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017AA0C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_PointRelativeToCubeEdges.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017ABBC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_PointRelativeToCubeVertices.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017AD38.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_LineVsCube.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017B68C.s")
@@ -80,51 +80,51 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017B9D8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_NormalizedDistanceFromPlane.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_UDistPlaneToPos.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_NormalizedSignedDistanceFromPlane.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_DistPlaneToPos.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017BAD0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkPointParaYDist.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017BD98.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017BDE0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017BE30.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkPointParaYIntersectDist.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017BEE0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkPointParaYIntersectInsideTri.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017BF8C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017C008.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkLineSegParaYIntersect.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017C17C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017C1F0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017C494.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkPointParaYIntersectInsideTri2.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017C540.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkPointParaXDist.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017C808.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017C850.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkPointParaXIntersect.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017C904.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017C980.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkLineSegParaXIntersect.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017CB08.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017CB7C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkLineSegParaZDist.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017CEA8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017CEF0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkPointParaZIntersect.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017CFA4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D020.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_TriChkLineSegParaZIntersect.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D1AC.s")
@@ -148,7 +148,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017DA24.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_ColSphereLineSeg.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_LineVsSph.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017DD34.s")
@@ -162,7 +162,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017F1A0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_ColSphereSphere.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_SphVsSph.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_ColSphereSphereIntersect.s")
@@ -178,11 +178,11 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3d_ColTriTri.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017F9C0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_XZInSphere.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017FA34.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_XYInSphere.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017FAA8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_YZInSphere.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017FB1C.s")
+24 -24
View File
@@ -1,33 +1,33 @@
#include "global.h"
void BgCheck2_UpdateActorPosition(CollisionContext* colCtx, s32 index, Actor* actor) {
void BgCheck2_UpdateActorPosition(CollisionContext* colCtx, s32 bgId, Actor* actor) {
MtxF prevMatrix;
MtxF prevMatrixInv;
MtxF currMatrix;
Vec3f newPos;
Vec3f posWithInv;
if (BgCheck_IsActorMeshIndexValid(index) == 0) {
if (!DynaPoly_IsBgIdBgActor(bgId)) {
return;
}
SkinMatrix_SetScaleRotateYRPTranslate(
&prevMatrix, colCtx->dyna.bgActors[index].prevTransform.scale.x,
colCtx->dyna.bgActors[index].prevTransform.scale.y, colCtx->dyna.bgActors[index].prevTransform.scale.z,
colCtx->dyna.bgActors[index].prevTransform.rot.x, colCtx->dyna.bgActors[index].prevTransform.rot.y,
colCtx->dyna.bgActors[index].prevTransform.rot.z, colCtx->dyna.bgActors[index].prevTransform.pos.x,
colCtx->dyna.bgActors[index].prevTransform.pos.y, colCtx->dyna.bgActors[index].prevTransform.pos.z);
&prevMatrix, colCtx->dyna.bgActors[bgId].prevTransform.scale.x,
colCtx->dyna.bgActors[bgId].prevTransform.scale.y, colCtx->dyna.bgActors[bgId].prevTransform.scale.z,
colCtx->dyna.bgActors[bgId].prevTransform.rot.x, colCtx->dyna.bgActors[bgId].prevTransform.rot.y,
colCtx->dyna.bgActors[bgId].prevTransform.rot.z, colCtx->dyna.bgActors[bgId].prevTransform.pos.x,
colCtx->dyna.bgActors[bgId].prevTransform.pos.y, colCtx->dyna.bgActors[bgId].prevTransform.pos.z);
if (SkinMatrix_Invert(&prevMatrix, &prevMatrixInv) == 2) {
return;
}
SkinMatrix_SetScaleRotateYRPTranslate(
&currMatrix, colCtx->dyna.bgActors[index].curTransform.scale.x,
colCtx->dyna.bgActors[index].curTransform.scale.y, colCtx->dyna.bgActors[index].curTransform.scale.z,
colCtx->dyna.bgActors[index].curTransform.rot.x, colCtx->dyna.bgActors[index].curTransform.rot.y,
colCtx->dyna.bgActors[index].curTransform.rot.z, colCtx->dyna.bgActors[index].curTransform.pos.x,
colCtx->dyna.bgActors[index].curTransform.pos.y, colCtx->dyna.bgActors[index].curTransform.pos.z);
&currMatrix, colCtx->dyna.bgActors[bgId].curTransform.scale.x, colCtx->dyna.bgActors[bgId].curTransform.scale.y,
colCtx->dyna.bgActors[bgId].curTransform.scale.z, colCtx->dyna.bgActors[bgId].curTransform.rot.x,
colCtx->dyna.bgActors[bgId].curTransform.rot.y, colCtx->dyna.bgActors[bgId].curTransform.rot.z,
colCtx->dyna.bgActors[bgId].curTransform.pos.x, colCtx->dyna.bgActors[bgId].curTransform.pos.y,
colCtx->dyna.bgActors[bgId].curTransform.pos.z);
SkinMatrix_Vec3fMtxFMultXYZ(&prevMatrixInv, &actor->world.pos, &posWithInv);
SkinMatrix_Vec3fMtxFMultXYZ(&currMatrix, &posWithInv, &newPos);
@@ -35,14 +35,14 @@ void BgCheck2_UpdateActorPosition(CollisionContext* colCtx, s32 index, Actor* ac
actor->world.pos = newPos;
}
void BgCheck2_UpdateActorYRotation(CollisionContext* colCtx, s32 index, Actor* actor) {
void BgCheck2_UpdateActorYRotation(CollisionContext* colCtx, s32 bgId, Actor* actor) {
s16 angleChange;
if (BgCheck_IsActorMeshIndexValid(index) == 0) {
if (!DynaPoly_IsBgIdBgActor(bgId)) {
return;
}
angleChange = colCtx->dyna.bgActors[index].curTransform.rot.y - colCtx->dyna.bgActors[index].prevTransform.rot.y;
angleChange = colCtx->dyna.bgActors[bgId].curTransform.rot.y - colCtx->dyna.bgActors[bgId].prevTransform.rot.y;
if (actor->id == 0) {
((Player*)actor)->currentYaw += angleChange;
@@ -52,14 +52,14 @@ void BgCheck2_UpdateActorYRotation(CollisionContext* colCtx, s32 index, Actor* a
actor->world.rot.y += angleChange;
}
void BgCheck2_AttachToMesh(CollisionContext* colCtx, Actor* actor, s32 index) {
void BgCheck2_AttachToMesh(CollisionContext* colCtx, Actor* actor, s32 bgId) {
DynaPolyActor* meshActor;
if (BgCheck_IsActorMeshIndexValid(index) == 0) {
if (!DynaPoly_IsBgIdBgActor(bgId)) {
return;
}
meshActor = BgCheck_GetActorOfMesh(colCtx, index);
meshActor = DynaPoly_GetActor(colCtx, bgId);
if (meshActor != NULL) {
DynaPolyActor_SetRidingFallingState(meshActor);
@@ -72,31 +72,31 @@ void BgCheck2_AttachToMesh(CollisionContext* colCtx, Actor* actor, s32 index) {
}
}
u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* colCtx, s32 index, Actor* actor) {
u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* colCtx, s32 bgId, Actor* actor) {
u32 wasUpdated = 0;
DynaPolyActor* meshActor;
if (BgCheck_IsActorMeshIndexValid(index) == 0) {
if (!DynaPoly_IsBgIdBgActor(bgId)) {
return 0;
}
if (colCtx->dyna.bgActorFlags[index] & 2 || !(colCtx->dyna.bgActorFlags[index] & 1)) {
if (colCtx->dyna.bgActorFlags[bgId] & 2 || !(colCtx->dyna.bgActorFlags[bgId] & 1)) {
return 0;
}
meshActor = BgCheck_GetActorOfMesh(colCtx, index);
meshActor = DynaPoly_GetActor(colCtx, bgId);
if (meshActor == NULL) {
return 0;
}
if (meshActor->flags & 1) {
BgCheck2_UpdateActorPosition(colCtx, index, actor);
BgCheck2_UpdateActorPosition(colCtx, bgId, actor);
wasUpdated = 1;
}
if (meshActor->flags & 2) {
BgCheck2_UpdateActorYRotation(colCtx, index, actor);
BgCheck2_UpdateActorYRotation(colCtx, bgId, actor);
wasUpdated = 1;
}
+10 -10
View File
@@ -18,8 +18,8 @@ void DynaPolyActor_Init(DynaPolyActor* dynaActor, s32 flags) {
void DynaPolyActor_LoadMesh(GlobalContext* globalCtx, DynaPolyActor* dynaActor, CollisionHeader* meshHeader) {
CollisionHeader* header = NULL;
BgCheck_RelocateMeshHeader(meshHeader, &header);
dynaActor->bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, dynaActor, header);
CollisionHeader_GetVirtual(meshHeader, &header);
dynaActor->bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &dynaActor->actor, header);
}
void DynaPolyActor_ResetState(DynaPolyActor* dynaActor) {
@@ -34,8 +34,8 @@ void DynaPolyActor_SetRidingMovingState(DynaPolyActor* dynaActor) {
dynaActor->stateFlags |= DYNAPOLY_STATE_RIDING_MOVING;
}
void DynaPolyActor_SetRidingMovingStateByIndex(CollisionContext* colCtx, s32 index) {
DynaPolyActor* dynaActor = BgCheck_GetActorOfMesh(colCtx, index);
void DynaPolyActor_SetRidingMovingStateByIndex(CollisionContext* colCtx, s32 bgId) {
DynaPolyActor* dynaActor = DynaPoly_GetActor(colCtx, bgId);
if (dynaActor != NULL) {
DynaPolyActor_SetRidingMovingState(dynaActor);
@@ -46,8 +46,8 @@ void DynaPolyActor_SetRidingRotatingState(DynaPolyActor* dynaActor) {
dynaActor->stateFlags |= DYNAPOLY_STATE_RIDING_ROTATING;
}
void DynaPolyActor_SetRidingRotatingStateByIndex(CollisionContext* colCtx, s32 index) {
DynaPolyActor* dynaActor = BgCheck_GetActorOfMesh(colCtx, index);
void DynaPolyActor_SetRidingRotatingStateByIndex(CollisionContext* colCtx, s32 bgId) {
DynaPolyActor* dynaActor = DynaPoly_GetActor(colCtx, bgId);
if (dynaActor != NULL) {
DynaPolyActor_SetRidingRotatingState(dynaActor);
@@ -125,16 +125,16 @@ s32 DynaPolyActor_ValidateMove(GlobalContext* globalCtx, DynaPolyActor* dynaActo
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)) {
if (BgCheck_EntityLineTest3(&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)) {
if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &startPos, &endPos, &intersectionPos, &poly, true, false, false,
true, &bgId, &dynaActor->actor, 0.0f)) {
return false;
}
return true;
+4680 -391
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -941,7 +941,7 @@ s32 Collider_QuadSetNearestAC(GlobalContext* globalCtx, ColliderQuad* quad, Vec3
return 1;
}
Math_Vec3s_ToVec3f(&dcMid, &quad->dim.dcMid);
acDist = Math3D_DistanceSquared(&dcMid, hitPos);
acDist = Math3D_Vec3fDistSq(&dcMid, hitPos);
if (acDist < quad->dim.acDist) {
quad->dim.acDist = acDist;
@@ -3510,7 +3510,7 @@ s32 CollisionCheck_LineOC_JntSph(GlobalContext* globalCtx, CollisionCheckContext
D_801EDEB0.a = *a;
D_801EDEB0.b = *b;
if (Math3D_ColSphereLineSeg(&element->dim.worldSphere, &D_801EDEB0) != 0) {
if (Math3D_LineVsSph(&element->dim.worldSphere, &D_801EDEB0) != 0) {
return 1;
}
}
@@ -3548,7 +3548,7 @@ s32 CollisionCheck_LineOC_Sphere(GlobalContext* globalCtx, CollisionCheckContext
D_801EDFC8.a = *a;
D_801EDFC8.b = *b;
if (Math3D_ColSphereLineSeg(&sphere->dim.worldSphere, &D_801EDFC8) != 0) {
if (Math3D_LineVsSph(&sphere->dim.worldSphere, &D_801EDFC8) != 0) {
return 1;
}
+3 -3
View File
@@ -94,7 +94,7 @@ void FireObj_StepSize(FireObj* fire) {
void FireObj_UpdateStateTransitions(GlobalContext* globalCtx, FireObj* fire) {
Player* player = GET_PLAYER(globalCtx);
WaterBox* waterBox;
f32 sp44;
f32 waterY;
s32 sp40 = 0;
u8 nextState;
Vec3f dist;
@@ -113,8 +113,8 @@ void FireObj_UpdateStateTransitions(GlobalContext* globalCtx, FireObj* fire) {
FireObj_SetState(fire, fire->dynamicSizeStep, nextState);
}
if ((fire->flags & 1) && (fire->state != FIRE_STATE_3) &&
(func_800CA1E8(globalCtx, &globalCtx->colCtx, fire->position.x, fire->position.z, &sp44, &waterBox) != 0) &&
((fire->yScale * ((void)0, 6500.0f)) < (sp44 - fire->position.y))) { // Fake but IDK what else
WaterBox_GetSurface1_2(globalCtx, &globalCtx->colCtx, fire->position.x, fire->position.z, &waterY, &waterBox) &&
((fire->yScale * ((void)0, 6500.0f)) < (waterY - fire->position.y))) { // Fake but IDK what else
FireObj_SetState(fire, fire->dynamicSizeStep, FIRE_STATE_3);
}
if ((fire->flags & 2) && (player->itemActionParam == PLAYER_AP_STICK)) {
+3 -2
View File
@@ -416,8 +416,9 @@ void Quake2_ClearType(s32 type) {
}
s32 Quake2_GetFloorQuake(Player* player) {
if (func_800C9D8C(&sQuake2Context.globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId) == 0) {
return func_800C9E18(&sQuake2Context.globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId);
if (!SurfaceType_IsConveyor(&sQuake2Context.globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId)) {
return SurfaceType_GetConveyorSpeed(&sQuake2Context.globalCtx->colCtx, player->actor.floorPoly,
player->actor.floorBgId);
}
return 0;
}
+1 -1
View File
@@ -204,7 +204,7 @@ void Scene_HeaderCmdColHeader(GlobalContext* globalCtx, SceneCmd* cmd) {
colHeader->waterBoxes = (WaterBox*)Lib_SegmentedToVirtual(colHeader->waterBoxes);
}
BgCheck_Init(&globalCtx->colCtx, globalCtx, colHeader);
BgCheck_Allocate(&globalCtx->colCtx, globalCtx, colHeader);
}
// SceneTableEntry Header Command 0x04: Room List
+2 -2
View File
@@ -722,9 +722,9 @@ void Scene_DrawConfigGreatBayTemple(GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, 0x33) && Flags_GetSwitch(globalCtx, 0x34) && Flags_GetSwitch(globalCtx, 0x35) &&
Flags_GetSwitch(globalCtx, 0x36)) {
func_800C3C00(&globalCtx->colCtx, 1);
BgCheck_SetContextFlags(&globalCtx->colCtx, BGCHECK_FLAG_REVERSE_CONVEYOR_FLOW);
} else {
func_800C3C14(&globalCtx->colCtx, 1);
BgCheck_UnsetContextFlags(&globalCtx->colCtx, BGCHECK_FLAG_REVERSE_CONVEYOR_FLOW);
}
dList = (Gfx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(Gfx) * 18);
+4 -3
View File
@@ -113,11 +113,11 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
s16 x;
s16 y;
f32 distance;
CollisionPoly* unk1;
CollisionPoly* poly;
Camera* camera;
Actor* actors[2];
s32 ret = 0;
u32 unk2;
s32 bgId;
camera = GET_ACTIVE_CAM(globalCtx);
@@ -142,7 +142,8 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
ret |= 0x3d;
}
if (func_800C576C(&globalCtx->colCtx, pos, &camera->eye, &screenSpace, &unk1, 1, 1, 1, 1, &unk2) != 0) {
if (BgCheck_ProjectileLineTest(&globalCtx->colCtx, pos, &camera->eye, &screenSpace, &poly, true, true, true, true,
&bgId)) {
func_8013A41C(0x3c);
ret |= 0x3c;
}