mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
graphics: Add slider for graphics settings
* Potato Mode for very low end devices, sets particules to minimal, graphics to fast and disables Ambient Occlusion. * Fast Mode for low/mid end devices, sets particules to decreased, graphics to fast with Ambient Occlusion. * Fancy Mode for mid/hight end devices, sets particules to maximum, graphics to fancy with Ambient Occlusion
This commit is contained in:
parent
714462b130
commit
0427748f3b
|
|
@ -136,6 +136,7 @@ enum eGameSetting
|
||||||
eGameSetting_RenderDistance,
|
eGameSetting_RenderDistance,
|
||||||
eGameSetting_Gamma,
|
eGameSetting_Gamma,
|
||||||
eGameSetting_FOV,
|
eGameSetting_FOV,
|
||||||
|
eGameSetting_GraphicsMode,
|
||||||
eGameSetting_Difficulty,
|
eGameSetting_Difficulty,
|
||||||
eGameSetting_Sensitivity_InGame,
|
eGameSetting_Sensitivity_InGame,
|
||||||
eGameSetting_Sensitivity_InMenu,
|
eGameSetting_Sensitivity_InMenu,
|
||||||
|
|
@ -948,4 +949,4 @@ enum eMCLang
|
||||||
|
|
||||||
eMCLang_hans,
|
eMCLang_hans,
|
||||||
eMCLang_hant,
|
eMCLang_hant,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ typedef struct
|
||||||
unsigned char ucSoundFXVolume;
|
unsigned char ucSoundFXVolume;
|
||||||
unsigned char ucSensitivity;
|
unsigned char ucSensitivity;
|
||||||
unsigned char ucGamma;
|
unsigned char ucGamma;
|
||||||
unsigned char ucPad01; // 1 byte of padding inserted here
|
unsigned char ucGraphicsMode;
|
||||||
unsigned short usBitmaskValues; // bit 0,1 - difficulty
|
unsigned short usBitmaskValues; // bit 0,1 - difficulty
|
||||||
// bit 2 - view bob
|
// bit 2 - view bob
|
||||||
// bit 3 - player visible in a map
|
// bit 3 - player visible in a map
|
||||||
|
|
|
||||||
|
|
@ -838,6 +838,7 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con
|
||||||
SetGameSettings(iPad,eGameSetting_RenderDistance,16);
|
SetGameSettings(iPad,eGameSetting_RenderDistance,16);
|
||||||
SetGameSettings(iPad,eGameSetting_Gamma,50);
|
SetGameSettings(iPad,eGameSetting_Gamma,50);
|
||||||
SetGameSettings(iPad,eGameSetting_FOV,0);
|
SetGameSettings(iPad,eGameSetting_FOV,0);
|
||||||
|
SetGameSettings(iPad,eGameSetting_GraphicsMode,1);
|
||||||
|
|
||||||
// 4J-PB - Don't reset the difficult level if we're in-game
|
// 4J-PB - Don't reset the difficult level if we're in-game
|
||||||
if(Minecraft::GetInstance()->level==nullptr)
|
if(Minecraft::GetInstance()->level==nullptr)
|
||||||
|
|
@ -1334,6 +1335,7 @@ void CMinecraftApp::ApplyGameSettingsChanged(int iPad)
|
||||||
ActionGameSettings(iPad,eGameSetting_RenderDistance );
|
ActionGameSettings(iPad,eGameSetting_RenderDistance );
|
||||||
ActionGameSettings(iPad,eGameSetting_Gamma );
|
ActionGameSettings(iPad,eGameSetting_Gamma );
|
||||||
ActionGameSettings(iPad,eGameSetting_FOV );
|
ActionGameSettings(iPad,eGameSetting_FOV );
|
||||||
|
ActionGameSettings(iPad,eGameSetting_GraphicsMode );
|
||||||
ActionGameSettings(iPad,eGameSetting_Difficulty );
|
ActionGameSettings(iPad,eGameSetting_Difficulty );
|
||||||
ActionGameSettings(iPad,eGameSetting_Sensitivity_InGame );
|
ActionGameSettings(iPad,eGameSetting_Sensitivity_InGame );
|
||||||
ActionGameSettings(iPad,eGameSetting_ViewBob );
|
ActionGameSettings(iPad,eGameSetting_ViewBob );
|
||||||
|
|
@ -1390,6 +1392,28 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
|
||||||
pMinecraft->options->set(Options::Option::RENDER_DISTANCE, 3 - level);
|
pMinecraft->options->set(Options::Option::RENDER_DISTANCE, 3 - level);
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
case eGameSetting_GraphicsMode:
|
||||||
|
if(iPad == ProfileManager.GetPrimaryPad())
|
||||||
|
{
|
||||||
|
int graphicsLevel = GameSettingsA[iPad]->ucGraphicsMode;
|
||||||
|
|
||||||
|
if (graphicsLevel == 0) {
|
||||||
|
pMinecraft->options->set(Options::Option::GRAPHICS, false);
|
||||||
|
pMinecraft->options->set(Options::Option::AMBIENT_OCCLUSION, false);
|
||||||
|
pMinecraft->options->set(Options::Option::PARTICLES, 2);
|
||||||
|
}
|
||||||
|
else if (graphicsLevel == 1) {
|
||||||
|
pMinecraft->options->set(Options::Option::GRAPHICS, false);
|
||||||
|
pMinecraft->options->set(Options::Option::AMBIENT_OCCLUSION, true);
|
||||||
|
if (graphicsLevel == 0) pMinecraft->options->set(Options::Option::PARTICLES, 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pMinecraft->options->set(Options::Option::GRAPHICS, true);
|
||||||
|
pMinecraft->options->set(Options::Option::AMBIENT_OCCLUSION, true);
|
||||||
|
if (graphicsLevel == 0) pMinecraft->options->set(Options::Option::PARTICLES, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case eGameSetting_Gamma:
|
case eGameSetting_Gamma:
|
||||||
if(iPad==ProfileManager.GetPrimaryPad())
|
if(iPad==ProfileManager.GetPrimaryPad())
|
||||||
{
|
{
|
||||||
|
|
@ -1868,6 +1892,17 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV
|
||||||
GameSettingsA[iPad]->bSettingsChanged = true;
|
GameSettingsA[iPad]->bSettingsChanged = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case eGameSetting_GraphicsMode:
|
||||||
|
if(GameSettingsA[iPad]->ucGraphicsMode != ucVal)
|
||||||
|
{
|
||||||
|
GameSettingsA[iPad]->ucGraphicsMode = ucVal;
|
||||||
|
if(iPad == ProfileManager.GetPrimaryPad())
|
||||||
|
{
|
||||||
|
ActionGameSettings(iPad, eVal);
|
||||||
|
}
|
||||||
|
GameSettingsA[iPad]->bSettingsChanged = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case eGameSetting_Gamma:
|
case eGameSetting_Gamma:
|
||||||
if(GameSettingsA[iPad]->ucGamma!=ucVal)
|
if(GameSettingsA[iPad]->ucGamma!=ucVal)
|
||||||
{
|
{
|
||||||
|
|
@ -2334,6 +2369,9 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal)
|
||||||
return val;
|
return val;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case eGameSetting_GraphicsMode:
|
||||||
|
return GameSettingsA[iPad]->ucGraphicsMode;
|
||||||
|
break;
|
||||||
case eGameSetting_Gamma:
|
case eGameSetting_Gamma:
|
||||||
return GameSettingsA[iPad]->ucGamma;
|
return GameSettingsA[iPad]->ucGamma;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,20 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD
|
||||||
|
|
||||||
swprintf(TempString, 256, L"Render Distance: %d",app.GetGameSettings(m_iPad,eGameSetting_RenderDistance));
|
swprintf(TempString, 256, L"Render Distance: %d",app.GetGameSettings(m_iPad,eGameSetting_RenderDistance));
|
||||||
m_sliderRenderDistance.init(TempString,eControl_RenderDistance,0,5,DistanceToLevel(app.GetGameSettings(m_iPad,eGameSetting_RenderDistance)));
|
m_sliderRenderDistance.init(TempString,eControl_RenderDistance,0,5,DistanceToLevel(app.GetGameSettings(m_iPad,eGameSetting_RenderDistance)));
|
||||||
|
|
||||||
swprintf( TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma));
|
int currentGraphics = app.GetGameSettings(m_iPad, eGameSetting_GraphicsMode);
|
||||||
|
|
||||||
|
const wchar_t* graphicsText = L"";
|
||||||
|
if (currentGraphics == 0) graphicsText = L"Graphics: Potato";
|
||||||
|
else if (currentGraphics == 1) graphicsText = L"Graphics: Fast";
|
||||||
|
else graphicsText = L"Graphics: Fancy";
|
||||||
|
|
||||||
|
swprintf((WCHAR*)TempString, 256, L"%ls", graphicsText);
|
||||||
|
|
||||||
|
m_sliderGraphicsMode.init(TempString, eControl_GraphicsMode, 0, 2, currentGraphics);
|
||||||
|
|
||||||
|
swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma));
|
||||||
|
Minecraft.Client/Common/UI/UIScene_SettingsGraphicsMenu.cpp
|
||||||
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));
|
||||||
|
|
||||||
const int initialFovSlider = app.GetGameSettings(m_iPad, eGameSetting_FOV);
|
const int initialFovSlider = app.GetGameSettings(m_iPad, eGameSetting_FOV);
|
||||||
|
|
@ -205,7 +217,21 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal
|
||||||
m_sliderRenderDistance.setLabel(TempString);
|
m_sliderRenderDistance.setLabel(TempString);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case eControl_GraphicsMode:
|
||||||
|
{
|
||||||
|
m_sliderGraphicsMode.handleSliderMove(value);
|
||||||
|
|
||||||
|
app.SetGameSettings(m_iPad, eGameSetting_GraphicsMode, value);
|
||||||
|
|
||||||
|
const wchar_t* modeName = L"Potato";
|
||||||
|
if (value == 1) modeName = L"Fast";
|
||||||
|
else if (value == 2) modeName = L"Fancy";
|
||||||
|
|
||||||
|
swprintf(TempString, 256, L"Graphics: %ls", modeName);
|
||||||
|
|
||||||
|
m_sliderGraphicsMode.setLabel(TempString);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case eControl_Gamma:
|
case eControl_Gamma:
|
||||||
m_sliderGamma.handleSliderMove(value);
|
m_sliderGamma.handleSliderMove(value);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,12 @@ private:
|
||||||
eControl_RenderDistance,
|
eControl_RenderDistance,
|
||||||
eControl_Gamma,
|
eControl_Gamma,
|
||||||
eControl_FOV,
|
eControl_FOV,
|
||||||
eControl_InterfaceOpacity
|
eControl_InterfaceOpacity,
|
||||||
|
eControl_GraphicsMode
|
||||||
};
|
};
|
||||||
|
|
||||||
UIControl_CheckBox m_checkboxClouds, m_checkboxBedrockFog, m_checkboxCustomSkinAnim; // Checkboxes
|
UIControl_CheckBox m_checkboxClouds, m_checkboxBedrockFog, m_checkboxCustomSkinAnim; // Checkboxes
|
||||||
UIControl_Slider m_sliderRenderDistance, m_sliderGamma, m_sliderFOV, m_sliderInterfaceOpacity; // Sliders
|
UIControl_Slider m_sliderRenderDistance, m_sliderGamma, m_sliderFOV, m_sliderInterfaceOpacity, m_sliderGraphicsMode; // Sliders
|
||||||
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
||||||
UI_MAP_ELEMENT( m_checkboxClouds, "Clouds")
|
UI_MAP_ELEMENT( m_checkboxClouds, "Clouds")
|
||||||
UI_MAP_ELEMENT( m_checkboxBedrockFog, "BedrockFog")
|
UI_MAP_ELEMENT( m_checkboxBedrockFog, "BedrockFog")
|
||||||
|
|
@ -28,6 +29,7 @@ private:
|
||||||
UI_MAP_ELEMENT( m_sliderGamma, "Gamma")
|
UI_MAP_ELEMENT( m_sliderGamma, "Gamma")
|
||||||
UI_MAP_ELEMENT(m_sliderFOV, "FOV")
|
UI_MAP_ELEMENT(m_sliderFOV, "FOV")
|
||||||
UI_MAP_ELEMENT( m_sliderInterfaceOpacity, "InterfaceOpacity")
|
UI_MAP_ELEMENT( m_sliderInterfaceOpacity, "InterfaceOpacity")
|
||||||
|
UI_MAP_ELEMENT( m_sliderGraphicsMode, "GraphicsMode")
|
||||||
UI_END_MAP_ELEMENTS_AND_NAMES()
|
UI_END_MAP_ELEMENTS_AND_NAMES()
|
||||||
|
|
||||||
bool m_bNotInGame;
|
bool m_bNotInGame;
|
||||||
|
|
@ -53,4 +55,4 @@ public:
|
||||||
static int LevelToDistance(int dist);
|
static int LevelToDistance(int dist);
|
||||||
|
|
||||||
static int DistanceToLevel(int dist);
|
static int DistanceToLevel(int dist);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1524,7 +1524,7 @@ void GameRenderer::renderLevel(float a, int64_t until)
|
||||||
// 4J - have changed this fancy rendering option to work with our command buffers. The original used to use frame buffer flags to disable
|
// 4J - have changed this fancy rendering option to work with our command buffers. The original used to use frame buffer flags to disable
|
||||||
// writing to colour when doing the z-only pass, but that value gets obliterated by our command buffers. Using alpha blend function instead
|
// writing to colour when doing the z-only pass, but that value gets obliterated by our command buffers. Using alpha blend function instead
|
||||||
// to achieve the same effect.
|
// to achieve the same effect.
|
||||||
if (true) // (mc->options->fancyGraphics)
|
if (mc->options->fancyGraphics)
|
||||||
{
|
{
|
||||||
if (mc->options->ambientOcclusion)
|
if (mc->options->ambientOcclusion)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ void Options::init()
|
||||||
anaglyph3d = false;
|
anaglyph3d = false;
|
||||||
advancedOpengl = false;
|
advancedOpengl = false;
|
||||||
framerateLimit = 0;
|
framerateLimit = 0;
|
||||||
fancyGraphics = true;
|
fancyGraphics = false;
|
||||||
ambientOcclusion = true;
|
ambientOcclusion = true;
|
||||||
renderClouds = true;
|
renderClouds = true;
|
||||||
skin = L"Default";
|
skin = L"Default";
|
||||||
|
|
@ -242,6 +242,14 @@ void Options::set(const Options::Option *item, float fVal)
|
||||||
{
|
{
|
||||||
viewDistance = fVal;
|
viewDistance = fVal;
|
||||||
}
|
}
|
||||||
|
if (item == Option::GRAPHICS)
|
||||||
|
{
|
||||||
|
fancyGraphics = fVal;
|
||||||
|
}
|
||||||
|
if (item == Option::AMBIENT_OCCLUSION)
|
||||||
|
{
|
||||||
|
ambientOcclusion = fVal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Options::toggle(const Options::Option *option, int dir)
|
void Options::toggle(const Options::Option *option, int dir)
|
||||||
|
|
@ -297,6 +305,8 @@ float Options::getProgressValue(const Options::Option *item)
|
||||||
if (item == Option::SOUND) return sound;
|
if (item == Option::SOUND) return sound;
|
||||||
if (item == Option::SENSITIVITY) return sensitivity;
|
if (item == Option::SENSITIVITY) return sensitivity;
|
||||||
if (item == Option::RENDER_DISTANCE) return viewDistance;
|
if (item == Option::RENDER_DISTANCE) return viewDistance;
|
||||||
|
if (item == Option::GRAPHICS) return fancyGraphics;
|
||||||
|
if (item == Option::AMBIENT_OCCLUSION) return ambientOcclusion;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
#include "EntityTileRenderer.h"
|
#include "EntityTileRenderer.h"
|
||||||
#include "Options.h"
|
#include "Options.h"
|
||||||
|
|
||||||
bool TileRenderer::fancy = true;
|
bool TileRenderer::fancy = false;
|
||||||
|
|
||||||
const float smallUV = ( 1.0f / 16.0f );
|
const float smallUV = ( 1.0f / 16.0f );
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue