mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
update casts to static_cast and fix variable name issue
This commit is contained in:
parent
0946cb5348
commit
998b442afe
|
|
@ -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 - 101) * 80.0f / 100.0f; // jvnpr -- convert 0-80 to 30-110
|
float v = (static_cast<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;
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa
|
||||||
m_sliderFov.init(TempString,eControl_FOV,0,80,fovSliderVal);
|
m_sliderFov.init(TempString,eControl_FOV,0,80,fovSliderVal);
|
||||||
|
|
||||||
const float currentTime = pMinecraft->level->getLevelData()->getGameTime() % 24000;
|
const float currentTime = pMinecraft->level->getLevelData()->getGameTime() % 24000;
|
||||||
swprintf( tempString, 256, L"Set time (unsafe) (%d)", static_cast<int>(currentTime));
|
swprintf(TempString, 256, L"Set time (unsafe) (%d)", static_cast<int>(currentTime));
|
||||||
m_sliderTime.init(tempString,eControl_Time,0,240,currentTime/100);
|
m_sliderTime.init(TempString,eControl_Time,0,240,currentTime/100);
|
||||||
|
|
||||||
m_buttonRain.init(L"Toggle Rain",eControl_Rain);
|
m_buttonRain.init(L"Toggle Rain",eControl_Rain);
|
||||||
m_buttonThunder.init(L"Toggle Thunder",eControl_Thunder);
|
m_buttonThunder.init(L"Toggle Thunder",eControl_Thunder);
|
||||||
|
|
@ -276,7 +276,7 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue)
|
||||||
case eControl_FOV:
|
case eControl_FOV:
|
||||||
{
|
{
|
||||||
// jvnpr -- code here is copied from UIScene_SettingsGraphicsMenu.cpp for consistency
|
// jvnpr -- code here is copied from UIScene_SettingsGraphicsMenu.cpp for consistency
|
||||||
int v = (int)currentValue;
|
int v = static_cast<int>(currentValue);
|
||||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||||
if (v < 0) v = 0;
|
if (v < 0) v = 0;
|
||||||
if (v > 80) v = 80;
|
if (v > 80) v = 80;
|
||||||
|
|
|
||||||
|
|
@ -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));
|
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));
|
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<int>(30.0f + (app.GetGameSettings(m_iPad, eGameSetting_FOV) - 101) * 80.0f / 100.0f) == 70)
|
||||||
{
|
{
|
||||||
swprintf((WCHAR*)TempString, 256, L"FOV: Default");
|
swprintf((WCHAR*)TempString, 256, L"FOV: Default");
|
||||||
}
|
}
|
||||||
else
|
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<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);
|
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.
|
// 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<int>(currentValue);
|
||||||
m_sliderFOV.handleSliderMove(v);
|
m_sliderFOV.handleSliderMove(v);
|
||||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||||
if (v < 0) v = 0;
|
if (v < 0) v = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue