From 35bbdf5ee97961ecca7cda2c3ad98aed558ace60 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 14:15:49 +0100 Subject: Remove gamma slider; keep HDR brightness Wayland/XWayland discards window gamma ramps, so mat_monitorgamma could not work on the development setup. Drop the slider, config key and readback. Keep the in-engine HDR tonemap brightness and document that Fullbright turns tonemapping off. --- src/gui.cpp | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'src/gui.cpp') diff --git a/src/gui.cpp b/src/gui.cpp index 83dc0a5..59c4364 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -411,20 +411,17 @@ static void build_cards() { g_ctrls[g_nctrl - 1].zero_unlimited = true; int view = add_card(2, nullptr, "Camera / display", - "Camera FOV, viewmodel FOV and monitor gamma.", true); + "Camera FOV, viewmodel FOV and HDR brightness.", true); add_slider(view, "Camera FOV", "World camera field of view (40-140; stock 75).", 40, 140, &g_fov_camera); add_slider(view, "Viewmodel FOV", "Weapon model field of view (20-120; stock 54).", 20, 120, &g_fov_viewmodel); - add_slider(view, "Gamma x10", - "mat_monitorgamma x10: 16 = 1.6, 26 = 2.6 (engine max), stock " - "is 22. Uses the OS gamma ramp; some compositors ignore it.", - 16, 26, &g_gamma); add_slider(view, "HDR brightness", "mat_force_tonemap_scale x10 (0 = automatic). In-engine " - "brightness for HDR maps; 10 = 1.0.", + "brightness for HDR maps; 10 = 1.0. No effect while Fullbright " + "is on.", 0, 30, &g_tonemap); add_card(2, &g_fullbright, "Fullbright", @@ -2245,22 +2242,6 @@ SDL_WarpMouseGlobal(int x, int y) { real_warp_global(x, y); } -// Diagnostic: tell whether mat_monitorgamma reaches the SDL gamma ramp at all. -static int (*real_set_gamma_ramp)(void *, const unsigned short *, - const unsigned short *, - const unsigned short *) = nullptr; - -extern "C" __attribute__((visibility("default"))) int -SDL_SetWindowGammaRamp(void *window, const unsigned short *r, - const unsigned short *g, const unsigned short *b) { - if (!real_set_gamma_ramp) - real_set_gamma_ramp = (int (*)(void *, const unsigned short *, - const unsigned short *, - const unsigned short *))dlsym( - RTLD_NEXT, "SDL_SetWindowGammaRamp"); - return real_set_gamma_ramp ? real_set_gamma_ramp(window, r, g, b) : -1; -} - static unsigned int (*real_get_rel_mouse)(int *, int *) = nullptr; static int (*real_poll_event)(void *) = nullptr; -- cgit v1.2.3