forked from Ports/perfect_dark
Merge pull request #126 from Phnod/zoom-hud-fov
Zoom HUD fov fix and zoom fov config option
This commit is contained in:
8 files changed
+27
-11
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
Reference in new issue
Block a user