From f04a82e7189fde8a70f9edea4801d04e5f17ca90 Mon Sep 17 00:00:00 2001 From: inspectredc Date: Tue, 30 Jan 2024 18:06:52 +0000 Subject: [PATCH 1/4] cullzone --- soh/src/code/z_actor.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index df9b6c75833..469513d604d 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -2860,9 +2860,16 @@ s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) { if ((arg2->z > -actor->uncullZoneScale) && (arg2->z < (actor->uncullZoneForward + actor->uncullZoneScale))) { var = (arg3 < 1.0f) ? 1.0f : 1.0f / arg3; - if ((((fabsf(arg2->x) - actor->uncullZoneScale) * var) < 1.0f) && - (((arg2->y + actor->uncullZoneDownward) * var) > -1.0f) && - (((arg2->y - actor->uncullZoneScale) * var) < 1.0f)) { + // #Region SoH + // Doors will cull quite noticeably on wider screens. For these actors the zone is increased + f32 limit = 1.0f; + if (((actor->id == ACTOR_EN_DOOR) || (actor->id == ACTOR_DOOR_SHUTTER)) && CVarGetInteger("gIncreaseDoorCullZones", 1)) { + limit = 2.0f; + } + + if ((((fabsf(arg2->x) - actor->uncullZoneScale) * var) < limit) && + (((arg2->y + actor->uncullZoneDownward) * var) > -limit) && + (((arg2->y - actor->uncullZoneScale) * var) < limit)) { return true; } } From bd1568b6af6d05d27862ee07c3bd394cdb8c9d36 Mon Sep 17 00:00:00 2001 From: inspectredc Date: Tue, 30 Jan 2024 19:11:44 +0000 Subject: [PATCH 2/4] better cvar name --- soh/src/code/z_actor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 469513d604d..64ecdb4ed0b 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -2863,7 +2863,7 @@ s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) { // #Region SoH // Doors will cull quite noticeably on wider screens. For these actors the zone is increased f32 limit = 1.0f; - if (((actor->id == ACTOR_EN_DOOR) || (actor->id == ACTOR_DOOR_SHUTTER)) && CVarGetInteger("gIncreaseDoorCullZones", 1)) { + if (((actor->id == ACTOR_EN_DOOR) || (actor->id == ACTOR_DOOR_SHUTTER)) && CVarGetInteger("gIncreaseDoorUncullZones", 1)) { limit = 2.0f; } From 214737bfec84a1ed82da25f45410cdee9aee909f Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Thu, 1 Feb 2024 19:18:04 -0600 Subject: [PATCH 3/4] Update soh/src/code/z_actor.c --- soh/src/code/z_actor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 64ecdb4ed0b..165a64b2b52 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -2860,7 +2860,7 @@ s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) { if ((arg2->z > -actor->uncullZoneScale) && (arg2->z < (actor->uncullZoneForward + actor->uncullZoneScale))) { var = (arg3 < 1.0f) ? 1.0f : 1.0f / arg3; - // #Region SoH + // #region SoH [Widescreen support] // Doors will cull quite noticeably on wider screens. For these actors the zone is increased f32 limit = 1.0f; if (((actor->id == ACTOR_EN_DOOR) || (actor->id == ACTOR_DOOR_SHUTTER)) && CVarGetInteger("gIncreaseDoorUncullZones", 1)) { From 74d740e757950ffd2c752492a754fe274c5a3a78 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Thu, 1 Feb 2024 19:18:09 -0600 Subject: [PATCH 4/4] Update soh/src/code/z_actor.c --- soh/src/code/z_actor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 165a64b2b52..c1dc66e23bf 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -2872,6 +2872,7 @@ s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) { (((arg2->y - actor->uncullZoneScale) * var) < limit)) { return true; } + // #endregion } return false;