mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-18 21:38:25 +00:00
refactor: rework meson options, fix ENABLE_VSYNC
This commit is contained in:
@@ -89,8 +89,15 @@ const std::wstring Options::DIFFICULTY_NAMES[] = {
|
||||
const std::wstring Options::GUI_SCALE[] = {
|
||||
L"options.guiScale.auto", L"options.guiScale.small",
|
||||
L"options.guiScale.normal", L"options.guiScale.large"};
|
||||
|
||||
#ifdef ENABLE_VSYNC
|
||||
const std::wstring Options::FRAMERATE_LIMITS[] = {
|
||||
L"performance.max", L"performance.balanced", L"performance.powersaver"};
|
||||
#else
|
||||
const std::wstring Options::FRAMERATE_LIMITS[] = {
|
||||
L"performance.max", L"performance.balanced", L"performance.powersaver",
|
||||
L"performance.unlimited"};
|
||||
#endif
|
||||
|
||||
const std::wstring Options::PARTICLES[] = {L"options.particles.all",
|
||||
L"options.particles.decreased",
|
||||
@@ -237,15 +244,19 @@ void Options::toggle(const Options::Option* option, int dir) {
|
||||
if (option == Option::RENDER_CLOUDS) renderClouds = !renderClouds;
|
||||
if (option == Option::ADVANCED_OPENGL) {
|
||||
advancedOpengl = !advancedOpengl;
|
||||
// 4jcraft: ensure level exists before applying
|
||||
if(minecraft->level) minecraft->levelRenderer->allChanged();
|
||||
// 4jcraft: ensure level exists before applying
|
||||
if (minecraft->level) minecraft->levelRenderer->allChanged();
|
||||
}
|
||||
if (option == Option::ANAGLYPH) {
|
||||
anaglyph3d = !anaglyph3d;
|
||||
minecraft->textures->reloadAll();
|
||||
}
|
||||
if (option == Option::FRAMERATE_LIMIT)
|
||||
#ifdef ENABLE_VSYNC
|
||||
framerateLimit = (framerateLimit + dir + 3) % 3;
|
||||
#else
|
||||
framerateLimit = (framerateLimit + dir + 4) % 4;
|
||||
#endif
|
||||
|
||||
// 4J-PB - Change for Xbox
|
||||
// if (option == Option::DIFFICULTY) difficulty = (difficulty + dir) & 3;
|
||||
@@ -255,13 +266,13 @@ void Options::toggle(const Options::Option* option, int dir) {
|
||||
|
||||
if (option == Option::GRAPHICS) {
|
||||
fancyGraphics = !fancyGraphics;
|
||||
// 4jcraft: ensure level exists before applying
|
||||
if(minecraft->level) minecraft->levelRenderer->allChanged();
|
||||
// 4jcraft: ensure level exists before applying
|
||||
if (minecraft->level) minecraft->levelRenderer->allChanged();
|
||||
}
|
||||
if (option == Option::AMBIENT_OCCLUSION) {
|
||||
ambientOcclusion = !ambientOcclusion;
|
||||
// 4jcraft: ensure level exists before applying
|
||||
if(minecraft->level) minecraft->levelRenderer->allChanged();
|
||||
// 4jcraft: ensure level exists before applying
|
||||
if (minecraft->level) minecraft->levelRenderer->allChanged();
|
||||
}
|
||||
|
||||
// 4J-PB - don't do the file save on the xbox
|
||||
|
||||
Reference in New Issue
Block a user