mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-17 19:33:52 +00:00
Save FOV value to settings (#670)
* Save FOV value to settings.dat
* Batch font drawing to fix debug overlay FPS
* Revert "Batch font drawing to fix debug overlay FPS"
This reverts commit 7dcecdbd4d.
This commit is contained in:
parent
4e67706dc3
commit
eeedbf08d3
5 changed files with 46 additions and 12 deletions
|
|
@ -23,8 +23,10 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa
|
|||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
WCHAR TempString[256];
|
||||
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", (int)pMinecraft->gameRenderer->GetFovVal());
|
||||
m_sliderFov.init(TempString,eControl_FOV,0,100,(int)pMinecraft->gameRenderer->GetFovVal());
|
||||
int fovSliderVal = app.GetGameSettings(m_iPad, eGameSetting_FOV);
|
||||
int fovDeg = 70 + fovSliderVal * 40 / 100;
|
||||
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg);
|
||||
m_sliderFov.init(TempString,eControl_FOV,0,100,fovSliderVal);
|
||||
|
||||
float currentTime = pMinecraft->level->getLevelData()->getGameTime() % 24000;
|
||||
swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime);
|
||||
|
|
@ -273,10 +275,15 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue)
|
|||
case eControl_FOV:
|
||||
{
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
pMinecraft->gameRenderer->SetFovVal((float)currentValue);
|
||||
int v = (int)currentValue;
|
||||
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);
|
||||
|
||||
WCHAR TempString[256];
|
||||
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", (int)currentValue);
|
||||
swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", fovDeg);
|
||||
m_sliderFov.setLabel(TempString);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue