diff options
Diffstat (limited to '')
| -rw-r--r-- | src/gui.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/gui.cpp b/src/gui.cpp index 88e5521..e8bcac7 100644 --- a/src/gui.cpp +++ b/src/gui.cpp | |||
| @@ -419,8 +419,9 @@ static void build_cards() { | |||
| 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", | 421 | add_slider(view, "Gamma x10", |
| 422 | "mat_monitorgamma x10: 16 = 1.6, 30 = 3.0, stock is 22.", 16, 30, | 422 | "mat_monitorgamma x10: 16 = 1.6, 26 = 2.6 (engine max), stock " |
| 423 | &g_gamma); | 423 | "is 22.", |
| 424 | 16, 26, &g_gamma); | ||
| 424 | 425 | ||
| 425 | add_card(2, &g_fullbright, "Fullbright", | 426 | add_card(2, &g_fullbright, "Fullbright", |
| 426 | "Ignore world lighting so dark areas are visible.", true); | 427 | "Ignore world lighting so dark areas are visible.", true); |
| @@ -2240,6 +2241,28 @@ SDL_WarpMouseGlobal(int x, int y) { | |||
| 2240 | real_warp_global(x, y); | 2241 | real_warp_global(x, y); |
| 2241 | } | 2242 | } |
| 2242 | 2243 | ||
| 2244 | // Diagnostic: tell whether mat_monitorgamma reaches the SDL gamma ramp at all. | ||
| 2245 | static int (*real_set_gamma_ramp)(void *, const unsigned short *, | ||
| 2246 | const unsigned short *, | ||
| 2247 | const unsigned short *) = nullptr; | ||
| 2248 | |||
| 2249 | extern "C" __attribute__((visibility("default"))) int | ||
| 2250 | SDL_SetWindowGammaRamp(void *window, const unsigned short *r, | ||
| 2251 | const unsigned short *g, const unsigned short *b) { | ||
| 2252 | if (!real_set_gamma_ramp) | ||
| 2253 | real_set_gamma_ramp = (int (*)(void *, const unsigned short *, | ||
| 2254 | const unsigned short *, | ||
| 2255 | const unsigned short *))dlsym( | ||
| 2256 | RTLD_NEXT, "SDL_SetWindowGammaRamp"); | ||
| 2257 | static int logs = 0; | ||
| 2258 | if (logs < 12) { | ||
| 2259 | logs++; | ||
| 2260 | logf("gamma: SDL_SetWindowGammaRamp mid=%u/%u/%u", r ? r[128] : 0, | ||
| 2261 | g ? g[128] : 0, b ? b[128] : 0); | ||
| 2262 | } | ||
| 2263 | return real_set_gamma_ramp ? real_set_gamma_ramp(window, r, g, b) : -1; | ||
| 2264 | } | ||
| 2265 | |||
| 2243 | static unsigned int (*real_get_rel_mouse)(int *, int *) = nullptr; | 2266 | static unsigned int (*real_get_rel_mouse)(int *, int *) = nullptr; |
| 2244 | static int (*real_poll_event)(void *) = nullptr; | 2267 | static int (*real_poll_event)(void *) = nullptr; |
| 2245 | 2268 | ||
