port: alternate fix for #548

This commit is contained in:
fgsfds committed 2024-12-08 13:39:21 +01:00
1 parent 05e462b680
commit 903dd82ebf
3 files changed
+19

No files matched your search

+2
View File
@@ -9,6 +9,7 @@
#include "game/mainmenu.h"
#include "game/menu.h"
#include "game/gamefile.h"
#include "game/player.h"
#include "video.h"
#include "input.h"
#include "config.h"
@@ -990,6 +991,7 @@ static MenuItemHandlerResult menuhandlerFieldOfView(s32 operation, struct menuit
g_PlayerExtCfg[g_ExtMenuPlayer].fovy = data->slider.value;
if (g_PlayerExtCfg[g_ExtMenuPlayer].fovzoom) {
g_PlayerExtCfg[g_ExtMenuPlayer].fovzoommult = g_PlayerExtCfg[g_ExtMenuPlayer].fovy / 60.f;
playerClampGunZoomFovY(g_ExtMenuPlayer);
}
}
break;
+16
View File
@@ -2103,6 +2103,22 @@ f32 playerGetCutsceneBlurFrac(void)
return g_CutsceneBlurFrac;
}
void playerClampGunZoomFovY(s32 playernum)
{
struct player *player = g_Vars.players[playernum];
if (!player) {
return;
}
for (s32 index = 0; index < ARRAYCOUNT(player->gunzoomfovs); ++index) {
if (player->gunzoomfovs[index] < ADJUST_ZOOM_FOV(2)) {
player->gunzoomfovs[index] = ADJUST_ZOOM_FOV(2);
} else if (player->gunzoomfovs[index] > ADJUST_ZOOM_FOV(60)) {
player->gunzoomfovs[index] = ADJUST_ZOOM_FOV(60);
}
}
}
void playerSetZoomFovY(f32 fovy, f32 timemax)
{
g_Vars.currentplayer->zoomintime = 0;
+1
View File
@@ -21,6 +21,7 @@ void playerStartCutscene(s16 anim_id);
void playerReorientForCutsceneStop(s32 tweenduration60);
void playerTickCutscene(bool arg0);
f32 playerGetCutsceneBlurFrac(void);
void playerClampGunZoomFovY(s32 playernum);
void playerSetZoomFovY(f32 fovy, f32 timemax);
f32 playerGetZoomFovY(void);
void playerTweenFovY(f32 targetfovy);