Adjust FOV zoom speed when using non-default FOV

This commit is contained in:
tmyqlfpir authored and GitHub committed 2023-08-21 18:23:40 +10:00
1 parent 58e13db613
commit 5aa8474d2b
1 file changed
+10 -2
+10 -2
View File
@@ -2063,11 +2063,19 @@ f32 playerGetZoomFovY(void)
void playerTweenFovY(f32 targetfovy)
{
f32 speed = 15.0f / 30.0f;
#ifndef PLATFORM_N64
if (videoGetPlayerFovY() > 60.0f) { // adjust zoom speed depending on non-default fov setting (higher fov == faster zoom)
speed /= videoGetPlayerFovY() / 60.0f;
}
#endif
if (playerGetZoomFovY() != targetfovy) {
if (g_Vars.currentplayer->zoominfovy > targetfovy) {
playerSetZoomFovY(targetfovy, (g_Vars.currentplayer->zoominfovy - targetfovy) * 15.0f / 30.0f);
playerSetZoomFovY(targetfovy, (g_Vars.currentplayer->zoominfovy - targetfovy) * speed);
} else {
playerSetZoomFovY(targetfovy, (targetfovy - g_Vars.currentplayer->zoominfovy) * 15.0f / 30.0f);
playerSetZoomFovY(targetfovy, (targetfovy - g_Vars.currentplayer->zoominfovy) * speed);
}
}
}