mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
change how fov is stored and add a converter for old settings.
This commit is contained in:
parent
1e72339d45
commit
d7bfeb9103
|
|
@ -1408,7 +1408,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
|
||||||
case eGameSetting_FOV:
|
case eGameSetting_FOV:
|
||||||
if(iPad==ProfileManager.GetPrimaryPad())
|
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;
|
pMinecraft->options->fov = ( v / 40.0f ) - 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa
|
||||||
|
|
||||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||||
WCHAR TempString[256];
|
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;
|
int fovDeg = 30 + fovSliderVal * 80 / 100;
|
||||||
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg);
|
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg);
|
||||||
m_sliderFov.init(TempString,eControl_FOV,0,80,fovSliderVal);
|
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);
|
swprintf( (WCHAR *)TempString, 256, L"FOV: %d", displayFOV);
|
||||||
m_sliderFov.setLabel(TempString);
|
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;
|
break;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||||
#include "..\..\..\Minecraft.World\Random.h"
|
#include "..\..\..\Minecraft.World\Random.h"
|
||||||
#include "..\..\User.h"
|
#include "..\..\User.h"
|
||||||
|
#include "..\..\Options.h"
|
||||||
#include "..\..\MinecraftServer.h"
|
#include "..\..\MinecraftServer.h"
|
||||||
#include "UI.h"
|
#include "UI.h"
|
||||||
#include "UIScene_MainMenu.h"
|
#include "UIScene_MainMenu.h"
|
||||||
|
|
@ -32,6 +33,18 @@ UIScene_MainMenu::UIScene_MainMenu(int iPad, void *initData, UILayer *parentLaye
|
||||||
m_eAction=eAction_None;
|
m_eAction=eAction_None;
|
||||||
m_bIgnorePress=false;
|
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);
|
m_buttons[(int)eControl_PlayGame].init(IDS_PLAY_GAME,eControl_PlayGame);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,14 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD
|
||||||
// Setup all the Iggy references we need for this scene
|
// Setup all the Iggy references we need for this scene
|
||||||
initialiseMovie();
|
initialiseMovie();
|
||||||
Minecraft* pMinecraft = Minecraft::GetInstance();
|
Minecraft* pMinecraft = Minecraft::GetInstance();
|
||||||
|
|
||||||
m_bNotInGame=(Minecraft::GetInstance()->level==NULL);
|
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_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_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));
|
m_checkboxCustomSkinAnim.init(app.GetString(IDS_CHECKBOX_CUSTOM_SKIN_ANIM),eControl_CustomSkinAnim,(app.GetGameSettings(m_iPad,eGameSetting_CustomSkinAnim)!=0));
|
||||||
|
|
||||||
|
|
||||||
WCHAR TempString[256];
|
WCHAR TempString[256];
|
||||||
|
|
||||||
swprintf((WCHAR*)TempString, 256, L"Render Distance: %d",app.GetGameSettings(m_iPad,eGameSetting_RenderDistance));
|
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));
|
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));
|
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));
|
if ((int)(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f) == 90)
|
||||||
m_sliderFOV.init(TempString, eControl_FOV, 0, 80, (app.GetGameSettings(m_iPad, eGameSetting_FOV)) * 80.0f / 100.0f);
|
{
|
||||||
|
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));
|
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));
|
m_sliderInterfaceOpacity.init(TempString,eControl_InterfaceOpacity,0,100,app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity));
|
||||||
|
|
||||||
doHorizontalResizeCheck();
|
doHorizontalResizeCheck();
|
||||||
|
|
||||||
bool bInGame=(Minecraft::GetInstance()->level!=NULL);
|
bool bInGame=(Minecraft::GetInstance()->level!=NULL);
|
||||||
bool bIsPrimaryPad=(ProfileManager.GetPrimaryPad()==m_iPad);
|
bool bIsPrimaryPad=(ProfileManager.GetPrimaryPad()==m_iPad);
|
||||||
// if we're not in the game, we need to use basescene 0
|
// 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;
|
if (v > 80) v = 80;
|
||||||
int displayFOV = v + 30; // jvnpr -- convert 0-80 to 30-110
|
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];
|
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);
|
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;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue