summaryrefslogtreecommitdiff
path: root/src/code/z_bg_item.c
diff options
context:
space:
mode:
authormzxrules <mzxrules@gmail.com>2021-11-23 11:29:18 -0500
committerGitHub <noreply@github.com>2021-11-23 13:29:18 -0300
commit6b493d3f9d79dd2546e833998f3b9ba8a747223a (patch)
treebde8720d11cca4fec61b4493e709342e27519706 /src/code/z_bg_item.c
parent837eb1c80687fe9b57a3c7b841547c33feeed6c7 (diff)
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
Diffstat (limited to 'src/code/z_bg_item.c')
-rw-r--r--src/code/z_bg_item.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/code/z_bg_item.c b/src/code/z_bg_item.c
index 92a300e43..74adbe695 100644
--- a/src/code/z_bg_item.c
+++ b/src/code/z_bg_item.c
@@ -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;