From e540a42c9c86fbdbf9120b07367b5f901ebb916b Mon Sep 17 00:00:00 2001 From: Phnod Date: Thu, 31 Aug 2023 18:36:39 -0400 Subject: [PATCH 01/12] port: modify zoom range hud to use player FOV --- src/game/hudmsg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/hudmsg.c b/src/game/hudmsg.c index b477e64fa..64ca1ea5d 100644 --- a/src/game/hudmsg.c +++ b/src/game/hudmsg.c @@ -269,7 +269,11 @@ Gfx *hudmsgRenderZoomRange(Gfx *gdl, u32 alpha) return gdl; } } else { +#ifdef PLATFORM_N64 maxzoom = 60.0f / zoomfov; +#else + maxzoom = g_PlayerDefaultFovY / zoomfov; +#endif curzoom = maxzoom - 1.0f / (zoomfov / zoominfovy) + 1; } From 85c1adb258196949f1fdec812301292433a66bec Mon Sep 17 00:00:00 2001 From: Phnod Date: Thu, 31 Aug 2023 18:54:22 -0400 Subject: [PATCH 02/12] port: adjust max zoom range by FOV ini value --- src/game/game_0b0fd0.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/game_0b0fd0.c b/src/game/game_0b0fd0.c index 49c7bd777..f801c2503 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -209,7 +209,11 @@ f32 currentPlayerGetGunZoomFov(void) if (weapon) { f32 fov = weapon->aimsettings->zoomfov; +#ifdef PLATFORM_N64 return fov; +#else + return fov * (g_PlayerDefaultFovY / 60.0f); +#endif } return 0; From 96bd8e05aaeebcf67505b84ae3b79af1c08149e7 Mon Sep 17 00:00:00 2001 From: Phnod Date: Thu, 31 Aug 2023 19:09:31 -0400 Subject: [PATCH 03/12] port: add ini config parameter to control whether ini FOV change should affect the max zoom of weapons --- port/src/main.c | 1 + src/game/game_0b0fd0.c | 7 ++++++- src/game/player.c | 1 + src/include/data.h | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/port/src/main.c b/port/src/main.c index ae6abc84f..2ae3ccc61 100644 --- a/port/src/main.c +++ b/port/src/main.c @@ -71,6 +71,7 @@ static void gameLoadConfig(void) g_PlayerMouseAimMode = configGetIntClamped("Game.MouseAimMode", g_PlayerMouseAimMode, 0, 1); g_PlayerMouseAimSpeedX = configGetFloatClamped("Game.MouseAimSpeedX", g_PlayerMouseAimSpeedX, 0.f, 10.f); g_PlayerMouseAimSpeedY = configGetFloatClamped("Game.MouseAimSpeedY", g_PlayerMouseAimSpeedY, 0.f, 10.f); + g_PlayerFovAffectsZoom = configGetIntClamped("Game.FovAffectsZoom", g_PlayerFovAffectsZoom, 0, 1); } int main(int argc, const char **argv) diff --git a/src/game/game_0b0fd0.c b/src/game/game_0b0fd0.c index f801c2503..99a670f25 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -212,7 +212,12 @@ f32 currentPlayerGetGunZoomFov(void) #ifdef PLATFORM_N64 return fov; #else - return fov * (g_PlayerDefaultFovY / 60.0f); + if (g_PlayerFovAffectsZoom) { + return fov * (g_PlayerDefaultFovY / 60.0f); + } + else { + return fov; + } #endif } diff --git a/src/game/player.c b/src/game/player.c index e68aede10..0cbb7789e 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -208,6 +208,7 @@ f32 g_PlayerCrosshairSway = 1.f; s32 g_PlayerMouseAimMode = MOUSEAIM_CLASSIC; f32 g_PlayerMouseAimSpeedX = 0.75f; f32 g_PlayerMouseAimSpeedY = 0.75f; +s32 g_PlayerFovAffectsZoom = 1; #endif /** diff --git a/src/include/data.h b/src/include/data.h index c70056c8c..001a122c1 100644 --- a/src/include/data.h +++ b/src/include/data.h @@ -534,6 +534,7 @@ extern f32 g_PlayerDefaultFovY; extern s32 g_PlayerMouseAimMode; extern f32 g_PlayerMouseAimSpeedX; extern f32 g_PlayerMouseAimSpeedY; +extern s32 g_PlayerFovAffectsZoom; #endif #endif From 35386bbd2ceeeca83badccef88fa4509c6a68557 Mon Sep 17 00:00:00 2001 From: Phnod Date: Thu, 31 Aug 2023 19:36:31 -0400 Subject: [PATCH 04/12] port: modify default zoom level for dynamic zoom weapons if fovzoom ini option is enabled This affects the Sniper Rifle, Farsight, and Horizon Scanner --- src/game/bondgunreset.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/game/bondgunreset.c b/src/game/bondgunreset.c index eb30682d8..f5ba9690c 100644 --- a/src/game/bondgunreset.c +++ b/src/game/bondgunreset.c @@ -239,9 +239,22 @@ void bgunReset(void) g_Vars.currentplayer->gunammooff = 0; g_Vars.currentplayer->gunsightoff = GUNSIGHTREASON_NOTAIMING; +#ifdef PLATFORM_N64 g_Vars.currentplayer->gunzoomfovs[0] = 15; g_Vars.currentplayer->gunzoomfovs[1] = 60; g_Vars.currentplayer->gunzoomfovs[2] = 30; +#else + if (g_PlayerFovAffectsZoom) { + g_Vars.currentplayer->gunzoomfovs[0] = 15 * (g_PlayerDefaultFovY / 60.0f); + g_Vars.currentplayer->gunzoomfovs[1] = 60 * (g_PlayerDefaultFovY / 60.0f); + g_Vars.currentplayer->gunzoomfovs[2] = 30 * (g_PlayerDefaultFovY / 60.0f); + } + else { + g_Vars.currentplayer->gunzoomfovs[0] = 15; + g_Vars.currentplayer->gunzoomfovs[1] = 60; + g_Vars.currentplayer->gunzoomfovs[2] = 30; + } +#endif if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_AIRBASE) { g_Weapons[WEAPON_EYESPY]->name = L_GUN_061; // "DrugSpy" From 1c1164d9e81a45d56fde11e107d13f87fa5f9e1d Mon Sep 17 00:00:00 2001 From: Phnod Date: Thu, 31 Aug 2023 20:03:56 -0400 Subject: [PATCH 05/12] port: apply FovAffectsZoom changes to max zoom level for sniper, farsight and horizon scanner --- src/game/game_0b0fd0.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/game/game_0b0fd0.c b/src/game/game_0b0fd0.c index 99a670f25..bb0937703 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -280,9 +280,22 @@ void currentPlayerZoomIn(f32 fovpersec) g_Vars.currentplayer->gunzoomfovs[index] /= 1 + amount * 0.1f; +#ifdef PLATFORM_N64 if (g_Vars.currentplayer->gunzoomfovs[index] < 2) { g_Vars.currentplayer->gunzoomfovs[index] = 2; } +#else + if (g_PlayerFovAffectsZoom) { + if (g_Vars.currentplayer->gunzoomfovs[index] < 2 * (g_PlayerDefaultFovY / 60.0f)) { + g_Vars.currentplayer->gunzoomfovs[index] = 2 * (g_PlayerDefaultFovY / 60.0f); + } + } + else { + if (g_Vars.currentplayer->gunzoomfovs[index] < 2) { + g_Vars.currentplayer->gunzoomfovs[index] = 2; + } + } +#endif } } From 349b5021498c6c7e8ca5efcaf3dd53bd8a901d12 Mon Sep 17 00:00:00 2001 From: Phnod Date: Thu, 31 Aug 2023 20:12:45 -0400 Subject: [PATCH 06/12] port: apply FovAffectsZoom to Farsight's secondary fire mode --- src/game/bondmove.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/game/bondmove.c b/src/game/bondmove.c index 62d42ee54..85465d78b 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -1705,9 +1705,22 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } #endif +#ifdef PLATFORM_N64 if (eraserfov < 2) { eraserfov = 2; } +#else + if (g_PlayerFovAffectsZoom) { + if (eraserfov < 2 * (g_PlayerDefaultFovY / 60.0f)) { + eraserfov = 2 * (g_PlayerDefaultFovY / 60.0f); + } + } + else { + if (eraserfov < 2) { + eraserfov = 2; + } + } +#endif g_Vars.currentplayer->gunzoomfovs[1] = eraserfov; From 2a5160c51951093d4f509c479d3b55a148a77e30 Mon Sep 17 00:00:00 2001 From: Phnod Date: Thu, 31 Aug 2023 20:37:53 -0400 Subject: [PATCH 07/12] cleanup: move repetitive zoom fov logic to single multiplier value --- port/src/main.c | 1 + src/game/bondgunreset.c | 13 +++---------- src/game/bondmove.c | 11 ++--------- src/game/game_0b0fd0.c | 18 +++--------------- src/game/player.c | 1 + src/include/data.h | 1 + 6 files changed, 11 insertions(+), 34 deletions(-) diff --git a/port/src/main.c b/port/src/main.c index 2ae3ccc61..fa9e512bb 100644 --- a/port/src/main.c +++ b/port/src/main.c @@ -72,6 +72,7 @@ static void gameLoadConfig(void) g_PlayerMouseAimSpeedX = configGetFloatClamped("Game.MouseAimSpeedX", g_PlayerMouseAimSpeedX, 0.f, 10.f); g_PlayerMouseAimSpeedY = configGetFloatClamped("Game.MouseAimSpeedY", g_PlayerMouseAimSpeedY, 0.f, 10.f); g_PlayerFovAffectsZoom = configGetIntClamped("Game.FovAffectsZoom", g_PlayerFovAffectsZoom, 0, 1); + g_PlayerFovZoomMultiplier = g_PlayerFovAffectsZoom ? g_PlayerDefaultFovY / 60.0f : 1.0f; } int main(int argc, const char **argv) diff --git a/src/game/bondgunreset.c b/src/game/bondgunreset.c index f5ba9690c..ed301b20f 100644 --- a/src/game/bondgunreset.c +++ b/src/game/bondgunreset.c @@ -244,16 +244,9 @@ void bgunReset(void) g_Vars.currentplayer->gunzoomfovs[1] = 60; g_Vars.currentplayer->gunzoomfovs[2] = 30; #else - if (g_PlayerFovAffectsZoom) { - g_Vars.currentplayer->gunzoomfovs[0] = 15 * (g_PlayerDefaultFovY / 60.0f); - g_Vars.currentplayer->gunzoomfovs[1] = 60 * (g_PlayerDefaultFovY / 60.0f); - g_Vars.currentplayer->gunzoomfovs[2] = 30 * (g_PlayerDefaultFovY / 60.0f); - } - else { - g_Vars.currentplayer->gunzoomfovs[0] = 15; - g_Vars.currentplayer->gunzoomfovs[1] = 60; - g_Vars.currentplayer->gunzoomfovs[2] = 30; - } + g_Vars.currentplayer->gunzoomfovs[0] = 15 * g_PlayerFovZoomMultiplier; + g_Vars.currentplayer->gunzoomfovs[1] = 60 * g_PlayerFovZoomMultiplier; + g_Vars.currentplayer->gunzoomfovs[2] = 30 * g_PlayerFovZoomMultiplier; #endif if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_AIRBASE) { diff --git a/src/game/bondmove.c b/src/game/bondmove.c index 85465d78b..d01809f90 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -1710,15 +1710,8 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i eraserfov = 2; } #else - if (g_PlayerFovAffectsZoom) { - if (eraserfov < 2 * (g_PlayerDefaultFovY / 60.0f)) { - eraserfov = 2 * (g_PlayerDefaultFovY / 60.0f); - } - } - else { - if (eraserfov < 2) { - eraserfov = 2; - } + if (eraserfov < 2 * g_PlayerFovZoomMultiplier) { + eraserfov = 2 * g_PlayerFovZoomMultiplier; } #endif diff --git a/src/game/game_0b0fd0.c b/src/game/game_0b0fd0.c index bb0937703..5840e0063 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -212,12 +212,7 @@ f32 currentPlayerGetGunZoomFov(void) #ifdef PLATFORM_N64 return fov; #else - if (g_PlayerFovAffectsZoom) { - return fov * (g_PlayerDefaultFovY / 60.0f); - } - else { - return fov; - } + return fov * g_PlayerFovZoomMultiplier; #endif } @@ -285,15 +280,8 @@ void currentPlayerZoomIn(f32 fovpersec) g_Vars.currentplayer->gunzoomfovs[index] = 2; } #else - if (g_PlayerFovAffectsZoom) { - if (g_Vars.currentplayer->gunzoomfovs[index] < 2 * (g_PlayerDefaultFovY / 60.0f)) { - g_Vars.currentplayer->gunzoomfovs[index] = 2 * (g_PlayerDefaultFovY / 60.0f); - } - } - else { - if (g_Vars.currentplayer->gunzoomfovs[index] < 2) { - g_Vars.currentplayer->gunzoomfovs[index] = 2; - } + if (g_Vars.currentplayer->gunzoomfovs[index] < 2 * g_PlayerFovZoomMultiplier) { + g_Vars.currentplayer->gunzoomfovs[index] = 2 * g_PlayerFovZoomMultiplier; } #endif } diff --git a/src/game/player.c b/src/game/player.c index 0cbb7789e..4f81bd2d9 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -209,6 +209,7 @@ s32 g_PlayerMouseAimMode = MOUSEAIM_CLASSIC; f32 g_PlayerMouseAimSpeedX = 0.75f; f32 g_PlayerMouseAimSpeedY = 0.75f; s32 g_PlayerFovAffectsZoom = 1; +f32 g_PlayerFovZoomMultiplier = 1.0f; #endif /** diff --git a/src/include/data.h b/src/include/data.h index 001a122c1..2848e34cb 100644 --- a/src/include/data.h +++ b/src/include/data.h @@ -535,6 +535,7 @@ extern s32 g_PlayerMouseAimMode; extern f32 g_PlayerMouseAimSpeedX; extern f32 g_PlayerMouseAimSpeedY; extern s32 g_PlayerFovAffectsZoom; +extern f32 g_PlayerFovZoomMultiplier; #endif #endif From fb009ae52fa1effb0e5eef71d0da6cdb9a7f7bf5 Mon Sep 17 00:00:00 2001 From: Phnod Date: Thu, 31 Aug 2023 20:58:33 -0400 Subject: [PATCH 08/12] fix: allow dynamic zoom weapons to fully zoom out to 1x zoom --- src/game/game_0b0fd0.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/game_0b0fd0.c b/src/game/game_0b0fd0.c index 5840e0063..0904f03b3 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -244,9 +244,15 @@ void currentPlayerZoomOut(f32 fovpersec) g_Vars.currentplayer->gunzoomfovs[index] *= 1.0f + amount * 0.1f; +#if PLATFORM_N64 if (g_Vars.currentplayer->gunzoomfovs[index] > 60) { g_Vars.currentplayer->gunzoomfovs[index] = 60; } +#else + if (g_Vars.currentplayer->gunzoomfovs[index] > 60 * g_PlayerFovZoomMultiplier) { + g_Vars.currentplayer->gunzoomfovs[index] = 60 * g_PlayerFovZoomMultiplier; + } +#endif } } From 0bf57ddd486e2db51231f639b110a6b2a809a2ed Mon Sep 17 00:00:00 2001 From: Phnod Date: Thu, 31 Aug 2023 21:26:00 -0400 Subject: [PATCH 09/12] fix: apply FovAffectsZoom to horizon scanner zoom --- src/game/bondview.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/bondview.c b/src/game/bondview.c index 2b24a6516..d66dc06dd 100644 --- a/src/game/bondview.c +++ b/src/game/bondview.c @@ -2377,7 +2377,11 @@ Gfx *bviewDrawHorizonScanner(Gfx *gdl) if (fovy == 0 || fovy == 60.0f) { fovy = 1; } else { +#ifdef PLATFORM_N64 fovy = 60.0f / fovy + 1; +#else + fovy = 60.0f / fovy * g_PlayerFovZoomMultiplier + 1; +#endif } sprintf(zoomtext, "%s %s%s%4.2fX", arrows, "", "", fovy); From 917209cb659daac30d67b14ab09f68db6647ba1a Mon Sep 17 00:00:00 2001 From: Phnod Date: Thu, 31 Aug 2023 21:31:31 -0400 Subject: [PATCH 10/12] fix: remove +1 from horizon scanner's displayed zoom level to show the accurate zoom level Previously the display would instantly jump from 1.00x to 2.01x, and show 31.00x instead of 30.00 at the max zoom level --- src/game/bondview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/bondview.c b/src/game/bondview.c index d66dc06dd..6e345ef96 100644 --- a/src/game/bondview.c +++ b/src/game/bondview.c @@ -2380,7 +2380,7 @@ Gfx *bviewDrawHorizonScanner(Gfx *gdl) #ifdef PLATFORM_N64 fovy = 60.0f / fovy + 1; #else - fovy = 60.0f / fovy * g_PlayerFovZoomMultiplier + 1; + fovy = 60.0f / fovy * g_PlayerFovZoomMultiplier; #endif } From 5033c096a2d2cd7366cc6c75ac87d0a5f133cb1d Mon Sep 17 00:00:00 2001 From: Phnod Date: Fri, 1 Sep 2023 09:48:53 -0400 Subject: [PATCH 11/12] cleanup: move PLATFORM_N64 preprocessor checks for fov zoom into a separate macro to reduce clutter --- src/game/bondgunreset.c | 12 +++--------- src/game/bondmove.c | 10 ++-------- src/game/bondview.c | 6 +----- src/game/game_0b0fd0.c | 26 +++++--------------------- src/include/data.h | 6 ++++++ 5 files changed, 17 insertions(+), 43 deletions(-) diff --git a/src/game/bondgunreset.c b/src/game/bondgunreset.c index ed301b20f..182cefd75 100644 --- a/src/game/bondgunreset.c +++ b/src/game/bondgunreset.c @@ -239,15 +239,9 @@ void bgunReset(void) g_Vars.currentplayer->gunammooff = 0; g_Vars.currentplayer->gunsightoff = GUNSIGHTREASON_NOTAIMING; -#ifdef PLATFORM_N64 - g_Vars.currentplayer->gunzoomfovs[0] = 15; - g_Vars.currentplayer->gunzoomfovs[1] = 60; - g_Vars.currentplayer->gunzoomfovs[2] = 30; -#else - g_Vars.currentplayer->gunzoomfovs[0] = 15 * g_PlayerFovZoomMultiplier; - g_Vars.currentplayer->gunzoomfovs[1] = 60 * g_PlayerFovZoomMultiplier; - g_Vars.currentplayer->gunzoomfovs[2] = 30 * g_PlayerFovZoomMultiplier; -#endif + g_Vars.currentplayer->gunzoomfovs[0] = ADJUST_ZOOM_FOV(15); + g_Vars.currentplayer->gunzoomfovs[1] = ADJUST_ZOOM_FOV(60); + g_Vars.currentplayer->gunzoomfovs[2] = ADJUST_ZOOM_FOV(30); if (stageGetIndex(g_Vars.stagenum) == STAGEINDEX_AIRBASE) { g_Weapons[WEAPON_EYESPY]->name = L_GUN_061; // "DrugSpy" diff --git a/src/game/bondmove.c b/src/game/bondmove.c index d01809f90..1d2a33de1 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -1705,15 +1705,9 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } #endif -#ifdef PLATFORM_N64 - if (eraserfov < 2) { - eraserfov = 2; + if (eraserfov < ADJUST_ZOOM_FOV(2)) { + eraserfov = ADJUST_ZOOM_FOV(2); } -#else - if (eraserfov < 2 * g_PlayerFovZoomMultiplier) { - eraserfov = 2 * g_PlayerFovZoomMultiplier; - } -#endif g_Vars.currentplayer->gunzoomfovs[1] = eraserfov; diff --git a/src/game/bondview.c b/src/game/bondview.c index 6e345ef96..bed52d33a 100644 --- a/src/game/bondview.c +++ b/src/game/bondview.c @@ -2377,11 +2377,7 @@ Gfx *bviewDrawHorizonScanner(Gfx *gdl) if (fovy == 0 || fovy == 60.0f) { fovy = 1; } else { -#ifdef PLATFORM_N64 - fovy = 60.0f / fovy + 1; -#else - fovy = 60.0f / fovy * g_PlayerFovZoomMultiplier; -#endif + fovy = 60.0f / ADJUST_ZOOM_FOV(fovy); } sprintf(zoomtext, "%s %s%s%4.2fX", arrows, "", "", fovy); diff --git a/src/game/game_0b0fd0.c b/src/game/game_0b0fd0.c index 0904f03b3..8e56c4aef 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -209,11 +209,7 @@ f32 currentPlayerGetGunZoomFov(void) if (weapon) { f32 fov = weapon->aimsettings->zoomfov; -#ifdef PLATFORM_N64 - return fov; -#else - return fov * g_PlayerFovZoomMultiplier; -#endif + return ADJUST_ZOOM_FOV(fov); } return 0; @@ -244,15 +240,9 @@ void currentPlayerZoomOut(f32 fovpersec) g_Vars.currentplayer->gunzoomfovs[index] *= 1.0f + amount * 0.1f; -#if PLATFORM_N64 - if (g_Vars.currentplayer->gunzoomfovs[index] > 60) { - g_Vars.currentplayer->gunzoomfovs[index] = 60; + if (g_Vars.currentplayer->gunzoomfovs[index] > ADJUST_ZOOM_FOV(60)) { + g_Vars.currentplayer->gunzoomfovs[index] = ADJUST_ZOOM_FOV(60); } -#else - if (g_Vars.currentplayer->gunzoomfovs[index] > 60 * g_PlayerFovZoomMultiplier) { - g_Vars.currentplayer->gunzoomfovs[index] = 60 * g_PlayerFovZoomMultiplier; - } -#endif } } @@ -281,15 +271,9 @@ void currentPlayerZoomIn(f32 fovpersec) g_Vars.currentplayer->gunzoomfovs[index] /= 1 + amount * 0.1f; -#ifdef PLATFORM_N64 - if (g_Vars.currentplayer->gunzoomfovs[index] < 2) { - g_Vars.currentplayer->gunzoomfovs[index] = 2; + if (g_Vars.currentplayer->gunzoomfovs[index] < ADJUST_ZOOM_FOV(2)) { + g_Vars.currentplayer->gunzoomfovs[index] = ADJUST_ZOOM_FOV(2); } -#else - if (g_Vars.currentplayer->gunzoomfovs[index] < 2 * g_PlayerFovZoomMultiplier) { - g_Vars.currentplayer->gunzoomfovs[index] = 2 * g_PlayerFovZoomMultiplier; - } -#endif } } diff --git a/src/include/data.h b/src/include/data.h index 2848e34cb..b0a0a3589 100644 --- a/src/include/data.h +++ b/src/include/data.h @@ -538,4 +538,10 @@ extern s32 g_PlayerFovAffectsZoom; extern f32 g_PlayerFovZoomMultiplier; #endif +#ifdef PLATFORM_N64 +#define ADJUST_ZOOM_FOV(x) (x) +#else +#define ADJUST_ZOOM_FOV(x) ((x) * g_PlayerFovZoomMultiplier) +#endif + #endif From 810db26bf4e393061336803e0ac905b989d04522 Mon Sep 17 00:00:00 2001 From: Phnod Date: Fri, 1 Sep 2023 10:07:15 -0400 Subject: [PATCH 12/12] fix: undo regression with previous cleanup, horizon scanner previously showed the wrong zoom level relative to FOV change --- src/game/bondview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/bondview.c b/src/game/bondview.c index bed52d33a..71e0a5403 100644 --- a/src/game/bondview.c +++ b/src/game/bondview.c @@ -2377,7 +2377,7 @@ Gfx *bviewDrawHorizonScanner(Gfx *gdl) if (fovy == 0 || fovy == 60.0f) { fovy = 1; } else { - fovy = 60.0f / ADJUST_ZOOM_FOV(fovy); + fovy = ADJUST_ZOOM_FOV(60.0f) / fovy; } sprintf(zoomtext, "%s %s%s%4.2fX", arrows, "", "", fovy);