From e41607e58cf697039a491e4a6ef12c38aff2891e Mon Sep 17 00:00:00 2001 From: synanesthetics Date: Sat, 7 Mar 2026 11:11:28 -0600 Subject: [PATCH 1/7] FOV Slider Tweak (Java Edition Similar) --- Minecraft.Client/Common/Consoles_App.cpp | 7 ++-- .../Common/UI/UIScene_DebugOverlay.cpp | 19 +++++---- .../UI/UIScene_SettingsGraphicsMenu.cpp | 41 +++++++++++++++---- Minecraft.Client/GameRenderer.cpp | 6 ++- Minecraft.Client/GameRenderer.h | 2 + 5 files changed, 52 insertions(+), 23 deletions(-) diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 43cf73e15..4b5902786 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -837,7 +837,7 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con SetGameSettings(iPad,eGameSetting_SoundFXVolume,DEFAULT_VOLUME_LEVEL); SetGameSettings(iPad,eGameSetting_RenderDistance,16); SetGameSettings(iPad,eGameSetting_Gamma,50); - SetGameSettings(iPad,eGameSetting_FOV,0); + SetGameSettings(iPad,eGameSetting_FOV,75); // jvnpr -- default to 75% between 30 and 110, which is 90 (70 internal) // 4J-PB - Don't reset the difficult level if we're in-game if(Minecraft::GetInstance()->level==NULL) @@ -1406,8 +1406,9 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) case eGameSetting_FOV: if(iPad==ProfileManager.GetPrimaryPad()) { - float fovDeg = 70.0f + (float)GameSettingsA[iPad]->ucFov * 40.0f / 100.0f; - pMinecraft->gameRenderer->SetFovVal(fovDeg); + float simulatedFovDeg = 30.0f + (float)GameSettingsA[iPad]->ucFov * 80.0f / 100.0f; // jvnpr -- convert 0-80 to 30-110 + float trueFovDeg = ( 55.0f / 80.0f ) * (simulatedFovDeg - 30.0f) + 30.0f; // jnvpr -- further convert 30-110 to a range from 30-85 to better reflect JE fov values + pMinecraft->gameRenderer->SetFovVal(trueFovDeg); pMinecraft->options->set(Options::Option::FOV, (float)GameSettingsA[iPad]->ucFov / 100.0f); } break; diff --git a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp index fafcea027..54aa57cd2 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp @@ -23,10 +23,10 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa Minecraft *pMinecraft = Minecraft::GetInstance(); WCHAR TempString[256]; - int fovSliderVal = app.GetGameSettings(m_iPad, eGameSetting_FOV); - int fovDeg = 70 + fovSliderVal * 40 / 100; + int fovSliderVal = app.GetGameSettings(m_iPad, eGameSetting_FOV) * 80.0f / 100.0f; + int fovDeg = 30 + fovSliderVal * 80 / 100; swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg); - m_sliderFov.init(TempString,eControl_FOV,0,100,fovSliderVal); + m_sliderFov.init(TempString,eControl_FOV,0,80,fovSliderVal); float currentTime = pMinecraft->level->getLevelData()->getGameTime() % 24000; swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime); @@ -274,16 +274,17 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue) break; case eControl_FOV: { - Minecraft *pMinecraft = Minecraft::GetInstance(); int v = (int)currentValue; + Minecraft *pMinecraft = Minecraft::GetInstance(); if (v < 0) v = 0; - if (v > 100) v = 100; - int fovDeg = 70 + v * 40 / 100; - pMinecraft->gameRenderer->SetFovVal((float)fovDeg); - app.SetGameSettings(m_iPad, eGameSetting_FOV, v); + if (v > 80) v = 80; + int simulatedFovDeg = v + 30; // jvnpr -- convert 0-80 to 30-110 + float trueFovDeg = ( 55.0f / 80.0f ) * (simulatedFovDeg - 30.0f) + 30.0f; // jvnpr -- further convert 30-110 to a range from 30-85 to better reflect JE fov values + pMinecraft->gameRenderer->SetFovVal(trueFovDeg); + app.SetGameSettings(m_iPad, eGameSetting_FOV, (v / (80.0f / 100.0f))); WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg); + swprintf( (WCHAR *)TempString, 256, L"FOV: %d (True: %d)", simulatedFovDeg, (int)trueFovDeg); m_sliderFov.setLabel(TempString); } break; diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index 423c8f4b2..aa80e7926 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -7,6 +7,10 @@ namespace { + /* + + jvnpr -- commented out this code from the kbm refactor to modify fov system :p + const int FOV_MIN = 70; const int FOV_MAX = 110; const int FOV_SLIDER_MAX = 100; @@ -30,6 +34,8 @@ namespace if (sliderValue > FOV_SLIDER_MAX) sliderValue = FOV_SLIDER_MAX; return FOV_MIN + ((sliderValue * (FOV_MAX - FOV_MIN)) / FOV_SLIDER_MAX); } + + */ } int UIScene_SettingsGraphicsMenu::LevelToDistance(int level) @@ -71,10 +77,10 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); m_sliderGamma.init(TempString,eControl_Gamma,0,100,app.GetGameSettings(m_iPad,eGameSetting_Gamma)); - int initialFovSlider = app.GetGameSettings(m_iPad, eGameSetting_FOV); - int initialFovDeg = sliderValueToFov(initialFovSlider); - swprintf((WCHAR*)TempString, 256, L"FOV: %d", initialFovDeg); - m_sliderFOV.init(TempString, eControl_FOV, 0, FOV_SLIDER_MAX, initialFovSlider); + //int initialFovSlider = app.GetGameSettings(m_iPad, eGameSetting_FOV); + //int initialFovDeg = sliderValueToFov(initialFovSlider); + swprintf((WCHAR*)TempString, 256, L"FOV: %d", (int)(30.0f + app.GetGameSettings(m_iPad, eGameSetting_FOV) * 80.0f / 100.0f)); + m_sliderFOV.init(TempString, eControl_FOV, 0, 80, (app.GetGameSettings(m_iPad, eGameSetting_FOV)) * 80.0f / 100.0f); swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); m_sliderInterfaceOpacity.init(TempString,eControl_InterfaceOpacity,0,100,app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); @@ -215,14 +221,31 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal break; case eControl_FOV: - { + { /* jvnpr -- commented code from keyboard mouse refactor m_sliderFOV.handleSliderMove(value); + int fovVal = value + 30; Minecraft* pMinecraft = Minecraft::GetInstance(); - int fovValue = sliderValueToFov(value); - pMinecraft->gameRenderer->SetFovVal((float)fovValue); - app.SetGameSettings(m_iPad, eGameSetting_FOV, value); + //int fovValue = sliderValueToFov(value); + pMinecraft->gameRenderer->SetFovVal((float)fovVal); + app.SetGameSettings(m_iPad, eGameSetting_FOV, fovVal); + WCHAR TempString[256]; + swprintf((WCHAR*)TempString, 256, L"FOV: %d", fovVal); + m_sliderFOV.setLabel(TempString); + + */ + + int v = (int)currentValue; + m_sliderFOV.handleSliderMove(v); + Minecraft *pMinecraft = Minecraft::GetInstance(); + if (v < 0) v = 0; + if (v > 80) v = 80; + int simulatedFovDeg = v + 30; // jvnpr -- convert 0-80 to 30-110 + float trueFovDeg = ( 55.0f / 80.0f ) * (simulatedFovDeg - 30.0f) + 30.0f; // jvnpr -- further convert 30-110 to a range from 30-85 to better reflect JE fov values + pMinecraft->gameRenderer->SetFovVal(trueFovDeg); + app.SetGameSettings(m_iPad, eGameSetting_FOV, (v / (80.0f / 100.0f))); + WCHAR TempString[256]; - swprintf((WCHAR*)TempString, 256, L"FOV: %d", fovValue); + swprintf( (WCHAR *)TempString, 256, L"FOV: %d (True: %d)", simulatedFovDeg, (int)trueFovDeg); m_sliderFOV.setLabel(TempString); } break; diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index 20a0f1e31..348916fdd 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -132,6 +132,8 @@ GameRenderer::GameRenderer(Minecraft *mc) m_fov=70.0f; + h_fov=70.0f; // jvnpr -- Hardcoded hand FOV to prevent scaling with main renderer fov + // 4J Stu - Init these so they are setup before the tick for( int i = 0; i < 4; i++ ) { @@ -714,14 +716,14 @@ void GameRenderer::renderItemInHand(float a, int eye) // 4J - have split out fov & aspect calculation so we can take into account viewports float fov, aspect; - getFovAndAspect(fov, aspect, a, false); + getFovAndAspect(fov, aspect, a, false); // jvnpr -- don't need to run fov calc since it's hardcoded now but it's probably better to just leave this if (zoom != 1) { glTranslatef((float) zoom_x, (float) -zoom_y, 0); glScaled(zoom, zoom, 1); } - gluPerspective(fov, aspect, 0.05f, renderDistance * 2); + gluPerspective(h_fov, aspect, 0.05f, renderDistance * 2); // jvnpr -- hardcoded h_fov to fix hand fov scaling if (mc->gameMode->isCutScene()) { diff --git a/Minecraft.Client/GameRenderer.h b/Minecraft.Client/GameRenderer.h index 21cf8acba..17ec0a2ec 100644 --- a/Minecraft.Client/GameRenderer.h +++ b/Minecraft.Client/GameRenderer.h @@ -88,6 +88,8 @@ class GameRenderer bool isInClouds; float m_fov; + + float h_fov; // jvnpr -- Hardcoded hand FOV to prevent scaling with main renderer fov public: GameRenderer(Minecraft *mc); ~GameRenderer(); From 583f906c82545631f31d3520518d42c4fc95dff9 Mon Sep 17 00:00:00 2001 From: synanesthetics Date: Sat, 7 Mar 2026 23:31:53 -0600 Subject: [PATCH 2/7] Clean up comments --- Minecraft.Client/Common/Consoles_App.cpp | 6 ++- .../Common/UI/UIScene_DebugOverlay.cpp | 3 +- .../UI/UIScene_SettingsGraphicsMenu.cpp | 51 ++----------------- 3 files changed, 10 insertions(+), 50 deletions(-) diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 4b5902786..efd09f24a 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -837,7 +837,11 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con SetGameSettings(iPad,eGameSetting_SoundFXVolume,DEFAULT_VOLUME_LEVEL); SetGameSettings(iPad,eGameSetting_RenderDistance,16); SetGameSettings(iPad,eGameSetting_Gamma,50); - SetGameSettings(iPad,eGameSetting_FOV,75); // jvnpr -- default to 75% between 30 and 110, which is 90 (70 internal) + + // jvnpr -- FOV setting is stored as 0-100 but mapped to 0-80 (offset from 30-110). FOV is calculated from the equiation: ( eGameSetting_FOV * 0.8 ) + 30 + // Default value of 75 is an FOV of 90. Displayed / stored FOV is further clamped to a range from 30-85 for internal use because an FOV of 85 on LCE is the equivalent of 110 on other platforms. (This is why 110 on LCE is so much wider than on Java) + // FOV of 90 is internally an FOV of ~70, which is the default. + SetGameSettings(iPad,eGameSetting_FOV,75); // 4J-PB - Don't reset the difficult level if we're in-game if(Minecraft::GetInstance()->level==NULL) diff --git a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp index 54aa57cd2..1045f92d0 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp @@ -274,12 +274,13 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue) break; case eControl_FOV: { + // jvnpr -- code here is copied from UIScene_SettingsGraphicsMenu.cpp for consistency int v = (int)currentValue; Minecraft *pMinecraft = Minecraft::GetInstance(); if (v < 0) v = 0; if (v > 80) v = 80; int simulatedFovDeg = v + 30; // jvnpr -- convert 0-80 to 30-110 - float trueFovDeg = ( 55.0f / 80.0f ) * (simulatedFovDeg - 30.0f) + 30.0f; // jvnpr -- further convert 30-110 to a range from 30-85 to better reflect JE fov values + float trueFovDeg = ( 55.0f / 80.0f ) * (simulatedFovDeg - 30.0f) + 30.0f; // jvnpr -- further convert 30-110 to an internal range of 30-85 to better reflect JE fov values pMinecraft->gameRenderer->SetFovVal(trueFovDeg); app.SetGameSettings(m_iPad, eGameSetting_FOV, (v / (80.0f / 100.0f))); diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index aa80e7926..7c8ec1487 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -5,39 +5,6 @@ #include "..\..\Options.h" #include "..\..\GameRenderer.h" -namespace -{ - /* - - jvnpr -- commented out this code from the kbm refactor to modify fov system :p - - const int FOV_MIN = 70; - const int FOV_MAX = 110; - const int FOV_SLIDER_MAX = 100; - - int clampFov(int value) - { - if (value < FOV_MIN) return FOV_MIN; - if (value > FOV_MAX) return FOV_MAX; - return value; - } - - int fovToSliderValue(float fov) - { - int clampedFov = clampFov((int)(fov + 0.5f)); - return ((clampedFov - FOV_MIN) * FOV_SLIDER_MAX) / (FOV_MAX - FOV_MIN); - } - - int sliderValueToFov(int sliderValue) - { - if (sliderValue < 0) sliderValue = 0; - if (sliderValue > FOV_SLIDER_MAX) sliderValue = FOV_SLIDER_MAX; - return FOV_MIN + ((sliderValue * (FOV_MAX - FOV_MIN)) / FOV_SLIDER_MAX); - } - - */ -} - int UIScene_SettingsGraphicsMenu::LevelToDistance(int level) { static const int table[6] = {2,4,8,16,32,64}; @@ -77,8 +44,6 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); m_sliderGamma.init(TempString,eControl_Gamma,0,100,app.GetGameSettings(m_iPad,eGameSetting_Gamma)); - //int initialFovSlider = app.GetGameSettings(m_iPad, eGameSetting_FOV); - //int initialFovDeg = sliderValueToFov(initialFovSlider); swprintf((WCHAR*)TempString, 256, L"FOV: %d", (int)(30.0f + app.GetGameSettings(m_iPad, eGameSetting_FOV) * 80.0f / 100.0f)); m_sliderFOV.init(TempString, eControl_FOV, 0, 80, (app.GetGameSettings(m_iPad, eGameSetting_FOV)) * 80.0f / 100.0f); @@ -221,26 +186,16 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal break; case eControl_FOV: - { /* jvnpr -- commented code from keyboard mouse refactor - m_sliderFOV.handleSliderMove(value); - int fovVal = value + 30; - Minecraft* pMinecraft = Minecraft::GetInstance(); - //int fovValue = sliderValueToFov(value); - pMinecraft->gameRenderer->SetFovVal((float)fovVal); - app.SetGameSettings(m_iPad, eGameSetting_FOV, fovVal); - WCHAR TempString[256]; - swprintf((WCHAR*)TempString, 256, L"FOV: %d", fovVal); - m_sliderFOV.setLabel(TempString); - - */ + { + // jvnpr -- code in Consoles_App.cpp should always reflect the same calculations as here so that controller and mouse inputs work the same. int v = (int)currentValue; m_sliderFOV.handleSliderMove(v); Minecraft *pMinecraft = Minecraft::GetInstance(); if (v < 0) v = 0; if (v > 80) v = 80; int simulatedFovDeg = v + 30; // jvnpr -- convert 0-80 to 30-110 - float trueFovDeg = ( 55.0f / 80.0f ) * (simulatedFovDeg - 30.0f) + 30.0f; // jvnpr -- further convert 30-110 to a range from 30-85 to better reflect JE fov values + float trueFovDeg = ( 55.0f / 80.0f ) * (simulatedFovDeg - 30.0f) + 30.0f; // jvnpr -- further convert 30-110 to an internal range of 30-85 to better reflect JE fov values pMinecraft->gameRenderer->SetFovVal(trueFovDeg); app.SetGameSettings(m_iPad, eGameSetting_FOV, (v / (80.0f / 100.0f))); From f58c0fe1a1c811a2ff597b041bbcd1cf6a11f69f Mon Sep 17 00:00:00 2001 From: synanesthetics Date: Sun, 8 Mar 2026 15:15:22 -0500 Subject: [PATCH 3/7] change FOV slider use designated FOV option instead of hooking into GameRenderer, normalize FOV --- Minecraft.Client/Common/Consoles_App.cpp | 12 ++++-------- Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp | 12 +++++++++++- .../Common/UI/UIScene_SettingsGraphicsMenu.cpp | 10 +++++----- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index efd09f24a..556ebcc5f 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -838,10 +838,8 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con SetGameSettings(iPad,eGameSetting_RenderDistance,16); SetGameSettings(iPad,eGameSetting_Gamma,50); - // jvnpr -- FOV setting is stored as 0-100 but mapped to 0-80 (offset from 30-110). FOV is calculated from the equiation: ( eGameSetting_FOV * 0.8 ) + 30 - // Default value of 75 is an FOV of 90. Displayed / stored FOV is further clamped to a range from 30-85 for internal use because an FOV of 85 on LCE is the equivalent of 110 on other platforms. (This is why 110 on LCE is so much wider than on Java) - // FOV of 90 is internally an FOV of ~70, which is the default. - SetGameSettings(iPad,eGameSetting_FOV,75); + // jvnpr -- FOV setting is stored as 0-100 but mapped to 0-80 (offset from 30-110). + SetGameSettings(iPad,eGameSetting_FOV,75); // jvnpr -- new default is fov of 90 because legacy console edition default is 90 // 4J-PB - Don't reset the difficult level if we're in-game if(Minecraft::GetInstance()->level==NULL) @@ -1410,10 +1408,8 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) case eGameSetting_FOV: if(iPad==ProfileManager.GetPrimaryPad()) { - float simulatedFovDeg = 30.0f + (float)GameSettingsA[iPad]->ucFov * 80.0f / 100.0f; // jvnpr -- convert 0-80 to 30-110 - float trueFovDeg = ( 55.0f / 80.0f ) * (simulatedFovDeg - 30.0f) + 30.0f; // jnvpr -- further convert 30-110 to a range from 30-85 to better reflect JE fov values - pMinecraft->gameRenderer->SetFovVal(trueFovDeg); - pMinecraft->options->set(Options::Option::FOV, (float)GameSettingsA[iPad]->ucFov / 100.0f); + float v = (float)GameSettingsA[iPad]->ucFov * 80.0f / 100.0f; // jvnpr -- convert 0-80 to 30-110 + pMinecraft->options->fov = ( v / 40.0f ) - 1; } break; case eGameSetting_Difficulty: diff --git a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp index 1045f92d0..40b3e4096 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp @@ -6,6 +6,7 @@ #include "..\..\Minecraft.h" #include "..\..\MinecraftServer.h" #include "..\..\GameRenderer.h" +#include "..\..\Options.h" #include "..\..\MultiPlayerLevel.h" #include "ClientConnection.h" #include "MultiPlayerLocalPlayer.h" @@ -279,14 +280,23 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue) Minecraft *pMinecraft = Minecraft::GetInstance(); if (v < 0) v = 0; if (v > 80) v = 80; + int displayFOV = v + 30; // jvnpr -- convert 0-80 to 30-110 + + pMinecraft->options->fov = ( v / 40.0f ) - 1; + WCHAR TempString[256]; + swprintf( (WCHAR *)TempString, 256, L"FOV: %d", displayFOV); + m_sliderFov.setLabel(TempString); + + /* int simulatedFovDeg = v + 30; // jvnpr -- convert 0-80 to 30-110 - float trueFovDeg = ( 55.0f / 80.0f ) * (simulatedFovDeg - 30.0f) + 30.0f; // jvnpr -- further convert 30-110 to an internal range of 30-85 to better reflect JE fov values + float trueFovDeg = (30.0f + (v / ( 80.0f / 100.0f )) * (50.0f / 100.0f)); // jvnpr -- further convert 30-110 to an internal range of 30-85 to better reflect JE fov values pMinecraft->gameRenderer->SetFovVal(trueFovDeg); app.SetGameSettings(m_iPad, eGameSetting_FOV, (v / (80.0f / 100.0f))); WCHAR TempString[256]; swprintf( (WCHAR *)TempString, 256, L"FOV: %d (True: %d)", simulatedFovDeg, (int)trueFovDeg); m_sliderFov.setLabel(TempString); + */ } break; }; diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index 7c8ec1487..ed1f14ebc 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -194,14 +194,14 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal Minecraft *pMinecraft = Minecraft::GetInstance(); if (v < 0) v = 0; if (v > 80) v = 80; - int simulatedFovDeg = v + 30; // jvnpr -- convert 0-80 to 30-110 - float trueFovDeg = ( 55.0f / 80.0f ) * (simulatedFovDeg - 30.0f) + 30.0f; // jvnpr -- further convert 30-110 to an internal range of 30-85 to better reflect JE fov values - pMinecraft->gameRenderer->SetFovVal(trueFovDeg); - app.SetGameSettings(m_iPad, eGameSetting_FOV, (v / (80.0f / 100.0f))); + int displayFOV = v + 30; // jvnpr -- convert 0-80 to 30-110 + pMinecraft->options->fov = ( v / 40.0f ) - 1 ; // jvnpr -- use FOV option instead of hooking into gamerenderer (range from -1 to 1 for 30-110) WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"FOV: %d (True: %d)", simulatedFovDeg, (int)trueFovDeg); + swprintf( (WCHAR *)TempString, 256, L"FOV: %d", displayFOV); m_sliderFOV.setLabel(TempString); + + app.SetGameSettings(m_iPad, eGameSetting_FOV, (v / ( 80.0f / 100.0f ))); } break; From d7bfeb910369d904aa891d3398d0ec3790e006a7 Mon Sep 17 00:00:00 2001 From: synanesthetics Date: Mon, 9 Mar 2026 04:56:47 -0500 Subject: [PATCH 4/7] change how fov is stored and add a converter for old settings. --- Minecraft.Client/Common/Consoles_App.cpp | 2 +- .../Common/UI/UIScene_DebugOverlay.cpp | 12 +------ .../Common/UI/UIScene_MainMenu.cpp | 13 ++++++++ .../UI/UIScene_SettingsGraphicsMenu.cpp | 32 +++++++++++++------ 4 files changed, 38 insertions(+), 21 deletions(-) diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 556ebcc5f..d1fb0cd4b 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -1408,7 +1408,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) case eGameSetting_FOV: if(iPad==ProfileManager.GetPrimaryPad()) { - float v = (float)GameSettingsA[iPad]->ucFov * 80.0f / 100.0f; // jvnpr -- convert 0-80 to 30-110 + float v = ((float)GameSettingsA[iPad]->ucFov - 101) * 80.0f / 100.0f; // jvnpr -- convert 0-80 to 30-110 pMinecraft->options->fov = ( v / 40.0f ) - 1; } break; diff --git a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp index 40b3e4096..ab6cd41a8 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp @@ -24,7 +24,7 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa Minecraft *pMinecraft = Minecraft::GetInstance(); WCHAR TempString[256]; - int fovSliderVal = app.GetGameSettings(m_iPad, eGameSetting_FOV) * 80.0f / 100.0f; + int fovSliderVal = (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f; int fovDeg = 30 + fovSliderVal * 80 / 100; swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg); m_sliderFov.init(TempString,eControl_FOV,0,80,fovSliderVal); @@ -287,16 +287,6 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue) swprintf( (WCHAR *)TempString, 256, L"FOV: %d", displayFOV); m_sliderFov.setLabel(TempString); - /* - int simulatedFovDeg = v + 30; // jvnpr -- convert 0-80 to 30-110 - float trueFovDeg = (30.0f + (v / ( 80.0f / 100.0f )) * (50.0f / 100.0f)); // jvnpr -- further convert 30-110 to an internal range of 30-85 to better reflect JE fov values - pMinecraft->gameRenderer->SetFovVal(trueFovDeg); - app.SetGameSettings(m_iPad, eGameSetting_FOV, (v / (80.0f / 100.0f))); - - WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"FOV: %d (True: %d)", simulatedFovDeg, (int)trueFovDeg); - m_sliderFov.setLabel(TempString); - */ } break; }; diff --git a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp index fe743adc2..a1089534b 100644 --- a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp @@ -3,6 +3,7 @@ #include "..\..\..\Minecraft.World\StringHelpers.h" #include "..\..\..\Minecraft.World\Random.h" #include "..\..\User.h" +#include "..\..\Options.h" #include "..\..\MinecraftServer.h" #include "UI.h" #include "UIScene_MainMenu.h" @@ -32,6 +33,18 @@ UIScene_MainMenu::UIScene_MainMenu(int iPad, void *initData, UILayer *parentLaye m_eAction=eAction_None; m_bIgnorePress=false; + Minecraft* pMinecraft = Minecraft::GetInstance(); + + // jvnpr -- convert old FOV setting to new + if (app.GetGameSettings(m_iPad, eGameSetting_FOV) < 101) { + float newFov = app.GetGameSettings(m_iPad, eGameSetting_FOV) * 40.0f / 100.0f; // old system stores 70-110 as 0-100. divide by 4 to get 0-40 for 70-110 + if (newFov > 15) newFov = 15; // FOV of 85 in the old system is the same as 110 in new system, so if set higher than that we need to cap it. + newFov *= (20.0f / 15.0f); // we need to map the old range from 70-85 to 90-110 so we can convert to a new equivalent FOV + // if old FOV was 70, newFov = 0. if old FOV was >= 85, new newFov = 20. + newFov += 60; // apply offset so now our FOV is between 60-80 (which is 90-110 in new system) + app.SetGameSettings(m_iPad, eGameSetting_FOV, (newFov / (80.0f / 100.0f)) + 101); // store new value in range from 101-201 + pMinecraft->options->fov = (newFov / 40.0f) - 1; + } m_buttons[(int)eControl_PlayGame].init(IDS_PLAY_GAME,eControl_PlayGame); diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index ed1f14ebc..9d3c029bf 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -28,14 +28,14 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD // Setup all the Iggy references we need for this scene initialiseMovie(); Minecraft* pMinecraft = Minecraft::GetInstance(); - + m_bNotInGame=(Minecraft::GetInstance()->level==NULL); m_checkboxClouds.init(app.GetString(IDS_CHECKBOX_RENDER_CLOUDS),eControl_Clouds,(app.GetGameSettings(m_iPad,eGameSetting_Clouds)!=0)); m_checkboxBedrockFog.init(app.GetString(IDS_CHECKBOX_RENDER_BEDROCKFOG),eControl_BedrockFog,(app.GetGameSettings(m_iPad,eGameSetting_BedrockFog)!=0)); m_checkboxCustomSkinAnim.init(app.GetString(IDS_CHECKBOX_CUSTOM_SKIN_ANIM),eControl_CustomSkinAnim,(app.GetGameSettings(m_iPad,eGameSetting_CustomSkinAnim)!=0)); - + WCHAR TempString[256]; swprintf((WCHAR*)TempString, 256, L"Render Distance: %d",app.GetGameSettings(m_iPad,eGameSetting_RenderDistance)); @@ -44,14 +44,21 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); m_sliderGamma.init(TempString,eControl_Gamma,0,100,app.GetGameSettings(m_iPad,eGameSetting_Gamma)); - swprintf((WCHAR*)TempString, 256, L"FOV: %d", (int)(30.0f + app.GetGameSettings(m_iPad, eGameSetting_FOV) * 80.0f / 100.0f)); - m_sliderFOV.init(TempString, eControl_FOV, 0, 80, (app.GetGameSettings(m_iPad, eGameSetting_FOV)) * 80.0f / 100.0f); + if ((int)(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f) == 90) + { + swprintf((WCHAR*)TempString, 256, L"FOV: Default"); + } + else + { + swprintf((WCHAR*)TempString, 256, L"FOV: %d", (int)(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f)); + } + m_sliderFOV.init(TempString, eControl_FOV, 0, 80, ((app.GetGameSettings(m_iPad, eGameSetting_FOV)) - 101) * 80.0f / 100.0f); swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); m_sliderInterfaceOpacity.init(TempString,eControl_InterfaceOpacity,0,100,app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); - doHorizontalResizeCheck(); - + doHorizontalResizeCheck(); + bool bInGame=(Minecraft::GetInstance()->level!=NULL); bool bIsPrimaryPad=(ProfileManager.GetPrimaryPad()==m_iPad); // if we're not in the game, we need to use basescene 0 @@ -196,12 +203,19 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal if (v > 80) v = 80; int displayFOV = v + 30; // jvnpr -- convert 0-80 to 30-110 - pMinecraft->options->fov = ( v / 40.0f ) - 1 ; // jvnpr -- use FOV option instead of hooking into gamerenderer (range from -1 to 1 for 30-110) + pMinecraft->options->fov = (v / 40.0f) - 1; // jvnpr -- use FOV option instead of hooking into gamerenderer (range from -1 to 1 for 30-110) WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"FOV: %d", displayFOV); + + if (v + 30 == 90) { + swprintf((WCHAR*)TempString, 256, L"FOV: Default", displayFOV); // when fov is 90 display "FOV: Default (90)" + } + else { + swprintf((WCHAR*)TempString, 256, L"FOV: %d", displayFOV); + } + m_sliderFOV.setLabel(TempString); - app.SetGameSettings(m_iPad, eGameSetting_FOV, (v / ( 80.0f / 100.0f ))); + app.SetGameSettings(m_iPad, eGameSetting_FOV, (v / ( 80.0f / 100.0f )) + 101); // offset from storing as 0-100 to 101-201 to detect whether we use old system and convert } break; From 05ee16ff240ae6c164ab5bfe65e018026def1ba9 Mon Sep 17 00:00:00 2001 From: synanesthetics Date: Mon, 9 Mar 2026 05:46:44 -0500 Subject: [PATCH 5/7] adjust fov defualts and conversion mapping --- Minecraft.Client/Common/Consoles_App.cpp | 4 ++-- Minecraft.Client/Common/UI/UIScene_MainMenu.cpp | 5 ++--- Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index d0fee5aaa..59e4efaf7 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -838,8 +838,8 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con SetGameSettings(iPad,eGameSetting_RenderDistance,16); SetGameSettings(iPad,eGameSetting_Gamma,50); - // jvnpr -- FOV setting is stored as 0-100 but mapped to 0-80 (offset from 30-110). - SetGameSettings(iPad,eGameSetting_FOV,75); // jvnpr -- new default is fov of 90 because legacy console edition default is 90 + // jvnpr -- FOV setting is stored as 101-201 but mapped to 0-80 (offset from 30-110). + SetGameSettings(iPad,eGameSetting_FOV,151); // 4J-PB - Don't reset the difficult level if we're in-game if(Minecraft::GetInstance()->level==nullptr) diff --git a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp index 92bd6d0f9..b520bbf70 100644 --- a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp @@ -39,9 +39,8 @@ UIScene_MainMenu::UIScene_MainMenu(int iPad, void *initData, UILayer *parentLaye if (app.GetGameSettings(m_iPad, eGameSetting_FOV) < 101) { float newFov = app.GetGameSettings(m_iPad, eGameSetting_FOV) * 40.0f / 100.0f; // old system stores 70-110 as 0-100. divide by 4 to get 0-40 for 70-110 if (newFov > 15) newFov = 15; // FOV of 85 in the old system is the same as 110 in new system, so if set higher than that we need to cap it. - newFov *= (20.0f / 15.0f); // we need to map the old range from 70-85 to 90-110 so we can convert to a new equivalent FOV - // if old FOV was 70, newFov = 0. if old FOV was >= 85, new newFov = 20. - newFov += 60; // apply offset so now our FOV is between 60-80 (which is 90-110 in new system) + newFov *= (40.0f / 15.0f); // we need to map the old range from 70-85 to 70-110 so we can convert to a new equivalent FOV + newFov += 40; // apply offset so now our FOV is between 40-80 (which is 70-110 in new system) app.SetGameSettings(m_iPad, eGameSetting_FOV, (newFov / (80.0f / 100.0f)) + 101); // store new value in range from 101-201 pMinecraft->options->fov = (newFov / 40.0f) - 1; } diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index 7b59c4431..292617f0e 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -44,7 +44,7 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD swprintf( TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); m_sliderGamma.init(TempString,eControl_Gamma,0,100,app.GetGameSettings(m_iPad,eGameSetting_Gamma)); - if ((int)(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f) == 90) + if ((int)(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f) == 70) { swprintf((WCHAR*)TempString, 256, L"FOV: Default"); } @@ -206,8 +206,8 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal pMinecraft->options->fov = (v / 40.0f) - 1; // jvnpr -- use FOV option instead of hooking into gamerenderer (range from -1 to 1 for 30-110) WCHAR TempString[256]; - if (v + 30 == 90) { - swprintf((WCHAR*)TempString, 256, L"FOV: Default", displayFOV); // when fov is 90 display "FOV: Default (90)" + if (v + 30 == 70) { + swprintf((WCHAR*)TempString, 256, L"FOV: Default", displayFOV); // when fov is 70 display "FOV: Default (90)" } else { swprintf((WCHAR*)TempString, 256, L"FOV: %d", displayFOV); From 0b270adf77305e645dec1dcc6b20d9eb5c85d3dc Mon Sep 17 00:00:00 2001 From: synanesthetics Date: Mon, 9 Mar 2026 05:46:44 -0500 Subject: [PATCH 6/7] adjust fov defaults and conversion mapping --- Minecraft.Client/Common/Consoles_App.cpp | 4 ++-- Minecraft.Client/Common/UI/UIScene_MainMenu.cpp | 5 ++--- Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index d0fee5aaa..59e4efaf7 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -838,8 +838,8 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con SetGameSettings(iPad,eGameSetting_RenderDistance,16); SetGameSettings(iPad,eGameSetting_Gamma,50); - // jvnpr -- FOV setting is stored as 0-100 but mapped to 0-80 (offset from 30-110). - SetGameSettings(iPad,eGameSetting_FOV,75); // jvnpr -- new default is fov of 90 because legacy console edition default is 90 + // jvnpr -- FOV setting is stored as 101-201 but mapped to 0-80 (offset from 30-110). + SetGameSettings(iPad,eGameSetting_FOV,151); // 4J-PB - Don't reset the difficult level if we're in-game if(Minecraft::GetInstance()->level==nullptr) diff --git a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp index 92bd6d0f9..b520bbf70 100644 --- a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp @@ -39,9 +39,8 @@ UIScene_MainMenu::UIScene_MainMenu(int iPad, void *initData, UILayer *parentLaye if (app.GetGameSettings(m_iPad, eGameSetting_FOV) < 101) { float newFov = app.GetGameSettings(m_iPad, eGameSetting_FOV) * 40.0f / 100.0f; // old system stores 70-110 as 0-100. divide by 4 to get 0-40 for 70-110 if (newFov > 15) newFov = 15; // FOV of 85 in the old system is the same as 110 in new system, so if set higher than that we need to cap it. - newFov *= (20.0f / 15.0f); // we need to map the old range from 70-85 to 90-110 so we can convert to a new equivalent FOV - // if old FOV was 70, newFov = 0. if old FOV was >= 85, new newFov = 20. - newFov += 60; // apply offset so now our FOV is between 60-80 (which is 90-110 in new system) + newFov *= (40.0f / 15.0f); // we need to map the old range from 70-85 to 70-110 so we can convert to a new equivalent FOV + newFov += 40; // apply offset so now our FOV is between 40-80 (which is 70-110 in new system) app.SetGameSettings(m_iPad, eGameSetting_FOV, (newFov / (80.0f / 100.0f)) + 101); // store new value in range from 101-201 pMinecraft->options->fov = (newFov / 40.0f) - 1; } diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index 7b59c4431..292617f0e 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -44,7 +44,7 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD swprintf( TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); m_sliderGamma.init(TempString,eControl_Gamma,0,100,app.GetGameSettings(m_iPad,eGameSetting_Gamma)); - if ((int)(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f) == 90) + if ((int)(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f) == 70) { swprintf((WCHAR*)TempString, 256, L"FOV: Default"); } @@ -206,8 +206,8 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal pMinecraft->options->fov = (v / 40.0f) - 1; // jvnpr -- use FOV option instead of hooking into gamerenderer (range from -1 to 1 for 30-110) WCHAR TempString[256]; - if (v + 30 == 90) { - swprintf((WCHAR*)TempString, 256, L"FOV: Default", displayFOV); // when fov is 90 display "FOV: Default (90)" + if (v + 30 == 70) { + swprintf((WCHAR*)TempString, 256, L"FOV: Default", displayFOV); // when fov is 70 display "FOV: Default (90)" } else { swprintf((WCHAR*)TempString, 256, L"FOV: %d", displayFOV); From 998b442afe44cfde572dc0cf1098be54feba41ed Mon Sep 17 00:00:00 2001 From: jvnpr Date: Mon, 9 Mar 2026 12:31:02 -0500 Subject: [PATCH 7/7] update casts to static_cast and fix variable name issue --- Minecraft.Client/Common/Consoles_App.cpp | 2 +- Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp | 6 +++--- Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 59e4efaf7..c2fd04cc4 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -1408,7 +1408,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) case eGameSetting_FOV: if(iPad==ProfileManager.GetPrimaryPad()) { - float v = ((float)GameSettingsA[iPad]->ucFov - 101) * 80.0f / 100.0f; // jvnpr -- convert 0-80 to 30-110 + float v = (static_cast(GameSettingsA[iPad]->ucFov) - 101) * 80.0f / 100.0f; // jvnpr -- convert 0-80 to 30-110 pMinecraft->options->fov = ( v / 40.0f ) - 1; } break; diff --git a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp index d9092bc9f..c58a0c905 100644 --- a/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DebugOverlay.cpp @@ -30,8 +30,8 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa m_sliderFov.init(TempString,eControl_FOV,0,80,fovSliderVal); const float currentTime = pMinecraft->level->getLevelData()->getGameTime() % 24000; - swprintf( tempString, 256, L"Set time (unsafe) (%d)", static_cast(currentTime)); - m_sliderTime.init(tempString,eControl_Time,0,240,currentTime/100); + swprintf(TempString, 256, L"Set time (unsafe) (%d)", static_cast(currentTime)); + m_sliderTime.init(TempString,eControl_Time,0,240,currentTime/100); m_buttonRain.init(L"Toggle Rain",eControl_Rain); m_buttonThunder.init(L"Toggle Thunder",eControl_Thunder); @@ -276,7 +276,7 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue) case eControl_FOV: { // jvnpr -- code here is copied from UIScene_SettingsGraphicsMenu.cpp for consistency - int v = (int)currentValue; + int v = static_cast(currentValue); Minecraft *pMinecraft = Minecraft::GetInstance(); if (v < 0) v = 0; if (v > 80) v = 80; diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index 292617f0e..3212e4b50 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -44,13 +44,13 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD swprintf( TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); m_sliderGamma.init(TempString,eControl_Gamma,0,100,app.GetGameSettings(m_iPad,eGameSetting_Gamma)); - if ((int)(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f) == 70) + if (static_cast(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f) == 70) { swprintf((WCHAR*)TempString, 256, L"FOV: Default"); } else { - swprintf((WCHAR*)TempString, 256, L"FOV: %d", (int)(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f)); + swprintf((WCHAR*)TempString, 256, L"FOV: %d", static_cast(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f)); } m_sliderFOV.init(TempString, eControl_FOV, 0, 80, ((app.GetGameSettings(m_iPad, eGameSetting_FOV)) - 101) * 80.0f / 100.0f); @@ -196,7 +196,7 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal { // jvnpr -- code in Consoles_App.cpp should always reflect the same calculations as here so that controller and mouse inputs work the same. - int v = (int)currentValue; + int v = static_cast(currentValue); m_sliderFOV.handleSliderMove(v); Minecraft *pMinecraft = Minecraft::GetInstance(); if (v < 0) v = 0;