diff --git a/port/src/main.c b/port/src/main.c index 589a18675..0791d8580 100644 --- a/port/src/main.c +++ b/port/src/main.c @@ -73,6 +73,8 @@ 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_ViShakeIntensityMult = configGetFloatClamped("Game.ScreenShakeIntensity", 1.f, 0.f, 100.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 eb30682d8..182cefd75 100644 --- a/src/game/bondgunreset.c +++ b/src/game/bondgunreset.c @@ -239,9 +239,9 @@ void bgunReset(void) g_Vars.currentplayer->gunammooff = 0; g_Vars.currentplayer->gunsightoff = GUNSIGHTREASON_NOTAIMING; - g_Vars.currentplayer->gunzoomfovs[0] = 15; - g_Vars.currentplayer->gunzoomfovs[1] = 60; - g_Vars.currentplayer->gunzoomfovs[2] = 30; + 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 949dcecbd..35baf9bcf 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -1712,8 +1712,8 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } #endif - if (eraserfov < 2) { - eraserfov = 2; + if (eraserfov < ADJUST_ZOOM_FOV(2)) { + eraserfov = ADJUST_ZOOM_FOV(2); } g_Vars.currentplayer->gunzoomfovs[1] = eraserfov; diff --git a/src/game/bondview.c b/src/game/bondview.c index 6c794a2c5..783b68936 100644 --- a/src/game/bondview.c +++ b/src/game/bondview.c @@ -2395,7 +2395,7 @@ Gfx *bviewDrawHorizonScanner(Gfx *gdl) if (fovy == 0 || fovy == 60.0f) { fovy = 1; } else { - fovy = 60.0f / fovy + 1; + fovy = ADJUST_ZOOM_FOV(60.0f) / 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 49c7bd777..8e56c4aef 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -209,7 +209,7 @@ f32 currentPlayerGetGunZoomFov(void) if (weapon) { f32 fov = weapon->aimsettings->zoomfov; - return fov; + return ADJUST_ZOOM_FOV(fov); } return 0; @@ -240,8 +240,8 @@ void currentPlayerZoomOut(f32 fovpersec) g_Vars.currentplayer->gunzoomfovs[index] *= 1.0f + amount * 0.1f; - 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); } } } @@ -271,8 +271,8 @@ void currentPlayerZoomIn(f32 fovpersec) g_Vars.currentplayer->gunzoomfovs[index] /= 1 + amount * 0.1f; - 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); } } } 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; } diff --git a/src/game/player.c b/src/game/player.c index 905ac95e5..8d1aa244a 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -208,6 +208,8 @@ f32 g_PlayerCrosshairSway = 1.f; 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 cf2554829..8423a3242 100644 --- a/src/include/data.h +++ b/src/include/data.h @@ -537,6 +537,8 @@ extern s32 g_PlayerMouseAimMode; extern f32 g_PlayerMouseAimSpeedX; extern f32 g_PlayerMouseAimSpeedY; extern f32 g_ViShakeIntensityMult; +extern s32 g_PlayerFovAffectsZoom; +extern f32 g_PlayerFovZoomMultiplier; extern u32 g_TexFilter2D; #define TEX_FILTER_2D g_TexFilter2D @@ -547,4 +549,10 @@ extern u32 g_TexFilter2D; #endif +#ifdef PLATFORM_N64 +#define ADJUST_ZOOM_FOV(x) (x) +#else +#define ADJUST_ZOOM_FOV(x) ((x) * g_PlayerFovZoomMultiplier) +#endif + #endif