Skip to content

Commit

Permalink
Increase Door Cull range (#3888)
Browse files Browse the repository at this point in the history
* cullzone

* better cvar name

* Update soh/src/code/z_actor.c

* Update soh/src/code/z_actor.c

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
  • Loading branch information
inspectredc and garrettjoecox committed Feb 2, 2024
1 parent 61cf2bd commit 2529dc5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions soh/src/code/z_actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2860,11 +2860,19 @@ 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 [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)) {
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;
}
// #endregion
}

return false;
Expand Down

0 comments on commit 2529dc5

Please sign in to comment.