1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Small setting-related fixes (#13755)

This commit is contained in:
Gregor Parzefall 2023-08-27 20:18:41 +02:00 committed by GitHub
parent 852d6a7976
commit 7b56daa236
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 9 deletions

View file

@ -124,7 +124,7 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
// bpp, fsaa, vsync
bool vsync = g_settings->getBool("vsync");
bool enable_fsaa = g_settings->get("antialiasing") == "fsaa";
u16 fsaa = enable_fsaa ? g_settings->getU16("fsaa") : 0;
u16 fsaa = enable_fsaa ? MYMAX(2, g_settings->getU16("fsaa")) : 0;
// Determine driver
auto driverType = chooseVideoDriver();

View file

@ -172,7 +172,7 @@ void set_default_settings()
#else
settings->setDefault("show_debug", "true");
#endif
settings->setDefault("fsaa", "0");
settings->setDefault("fsaa", "2");
settings->setDefault("undersampling", "1");
settings->setDefault("world_aligned_mode", "enable");
settings->setDefault("autoscale_mode", "disable");
@ -473,7 +473,8 @@ void set_default_settings()
#endif
#ifdef HAVE_TOUCHSCREENGUI
settings->setDefault("touchscreen_threshold","20");
settings->setDefault("touchscreen_threshold", "20");
settings->setDefault("touchscreen_sensitivity", "0.2");
settings->setDefault("touch_use_crosshair", "false");
settings->setDefault("fixed_virtual_joystick", "false");
settings->setDefault("virtual_joystick_triggers_aux1", "false");

View file

@ -829,7 +829,7 @@ void TouchScreenGUI::translateEvent(const SEvent &event)
m_pointer_pos[event.TouchInput.ID] = touch_pos;
// adapt to similar behavior as pc screen
const double d = g_settings->getFloat("mouse_sensitivity", 0.001f, 10.0f) * 3.0f;
const double d = g_settings->getFloat("touchscreen_sensitivity", 0.001f, 10.0f) * 3.0f;
m_camera_yaw_change -= dir_free.X * d;
m_camera_pitch = MYMIN(MYMAX(m_camera_pitch + (dir_free.Y * d), -180.0f), 180.0f);