Add GUI scale setting and volume contrast setting

GUI scale (#737):
- add display.gui-scale setting (0 - auto, 1..4 - fixed integer scale)
- auto mode picks the largest scale keeping at least 640x480 UI units
- apply scale in GUI (root size, camera, cursor, tooltips, scissors)
- HUD layout and ModelViewer use scaled coordinates
- add GUI Scale trackbar to display settings

Volume contrast (#399):
- add audio.volume-contrast setting (100% - unchanged sounds,
  0% - loud sounds are lowered to the level of quiet ones)
- loudness (RMS) of a sound is calculated once and cached
- add trackbar to audio settings and reset page
This commit is contained in:
loki5512344 2026-10-03 12:56:54 +00:00
parent dacebf94bc
commit 708c276787
14 changed files with 158 additions and 17 deletions

View file

@ -17,6 +17,9 @@ struct AudioSettings {
NumberSetting volumeUI {1.0f, 0.0f, 1.0f, setting_format::percent};
NumberSetting volumeAmbient {1.0f, 0.0f, 1.0f, setting_format::percent};
NumberSetting volumeMusic {1.0f, 0.0f, 1.0f, setting_format::percent};
/// @brief Volume contrast: 100% - sounds are played as is,
/// 0% - loud sounds are lowered to the level of quiet ones ("night mode")
NumberSetting volumeContrast {1.0f, 0.0f, 1.0f, setting_format::percent};
StringSetting inputDevice {""};
@ -38,6 +41,8 @@ struct DisplaySettings {
FlagSetting limitFpsIconified {false};
/// @brief Adaptive framerate in menu (experimental)
FlagSetting adaptiveFpsInMenu {false};
/// @brief GUI scale factor (0 - auto, 1..4 - fixed integer scale)
IntegerSetting guiScale {0, 0, 4};
};
struct ChunksSettings {