mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
port: alternate fix for #548
This commit is contained in:
1 parent
05e462b680
commit
903dd82ebf
3 files changed
+19
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user