diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 14:15:49 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 14:15:49 +0100 |
| commit | 35bbdf5ee97961ecca7cda2c3ad98aed558ace60 (patch) | |
| tree | 3d79113dcf19e5f2b8c353aebe72e03920df1d32 /src/gui.cpp | |
| parent | Add HDR tonemap brightness slider (diff) | |
| download | hl2h-35bbdf5ee97961ecca7cda2c3ad98aed558ace60.tar.gz hl2h-35bbdf5ee97961ecca7cda2c3ad98aed558ace60.zip | |
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.
Diffstat (limited to 'src/gui.cpp')
| -rw-r--r-- | src/gui.cpp | 25 |
1 files changed, 3 insertions, 22 deletions
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() { | |||
| 411 | g_ctrls[g_nctrl - 1].zero_unlimited = true; | 411 | g_ctrls[g_nctrl - 1].zero_unlimited = true; |
| 412 | 412 | ||
| 413 | int view = add_card(2, nullptr, "Camera / display", | 413 | int view = add_card(2, nullptr, "Camera / display", |
| 414 | "Camera FOV, viewmodel FOV and monitor gamma.", true); | 414 | "Camera FOV, viewmodel FOV and HDR brightness.", true); |
| 415 | add_slider(view, "Camera FOV", | 415 | add_slider(view, "Camera FOV", |
| 416 | "World camera field of view (40-140; stock 75).", 40, 140, | 416 | "World camera field of view (40-140; stock 75).", 40, 140, |
| 417 | &g_fov_camera); | 417 | &g_fov_camera); |
| 418 | add_slider(view, "Viewmodel FOV", | 418 | add_slider(view, "Viewmodel FOV", |
| 419 | "Weapon model field of view (20-120; stock 54).", 20, 120, | 419 | "Weapon model field of view (20-120; stock 54).", 20, 120, |
| 420 | &g_fov_viewmodel); | 420 | &g_fov_viewmodel); |
| 421 | add_slider(view, "Gamma x10", | ||
| 422 | "mat_monitorgamma x10: 16 = 1.6, 26 = 2.6 (engine max), stock " | ||
| 423 | "is 22. Uses the OS gamma ramp; some compositors ignore it.", | ||
| 424 | 16, 26, &g_gamma); | ||
| 425 | add_slider(view, "HDR brightness", | 421 | add_slider(view, "HDR brightness", |
| 426 | "mat_force_tonemap_scale x10 (0 = automatic). In-engine " | 422 | "mat_force_tonemap_scale x10 (0 = automatic). In-engine " |
| 427 | "brightness for HDR maps; 10 = 1.0.", | 423 | "brightness for HDR maps; 10 = 1.0. No effect while Fullbright " |
| 424 | "is on.", | ||
| 428 | 0, 30, &g_tonemap); | 425 | 0, 30, &g_tonemap); |
| 429 | 426 | ||
| 430 | add_card(2, &g_fullbright, "Fullbright", | 427 | add_card(2, &g_fullbright, "Fullbright", |
| @@ -2245,22 +2242,6 @@ SDL_WarpMouseGlobal(int x, int y) { | |||
| 2245 | real_warp_global(x, y); | 2242 | real_warp_global(x, y); |
| 2246 | } | 2243 | } |
| 2247 | 2244 | ||
| 2248 | // Diagnostic: tell whether mat_monitorgamma reaches the SDL gamma ramp at all. | ||
| 2249 | static int (*real_set_gamma_ramp)(void *, const unsigned short *, | ||
| 2250 | const unsigned short *, | ||
| 2251 | const unsigned short *) = nullptr; | ||
| 2252 | |||
| 2253 | extern "C" __attribute__((visibility("default"))) int | ||
| 2254 | SDL_SetWindowGammaRamp(void *window, const unsigned short *r, | ||
| 2255 | const unsigned short *g, const unsigned short *b) { | ||
| 2256 | if (!real_set_gamma_ramp) | ||
| 2257 | real_set_gamma_ramp = (int (*)(void *, const unsigned short *, | ||
| 2258 | const unsigned short *, | ||
| 2259 | const unsigned short *))dlsym( | ||
| 2260 | RTLD_NEXT, "SDL_SetWindowGammaRamp"); | ||
| 2261 | return real_set_gamma_ramp ? real_set_gamma_ramp(window, r, g, b) : -1; | ||
| 2262 | } | ||
| 2263 | |||
| 2264 | static unsigned int (*real_get_rel_mouse)(int *, int *) = nullptr; | 2245 | static unsigned int (*real_get_rel_mouse)(int *, int *) = nullptr; |
| 2265 | static int (*real_poll_event)(void *) = nullptr; | 2246 | static int (*real_poll_event)(void *) = nullptr; |
| 2266 | 2247 | ||
