From 7cdd9a04da1fb0fcabc0289fc34efdcbac1ce417 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 5 May 2012 22:23:17 +0000 Subject: [PATCH] Make the GAMMA_CALC macro use double instead of float and use it in menus.c. git-svn-id: https://svn.eduke32.com/eduke32@2638 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/baselayer.h | 2 +- polymer/eduke32/source/menus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/include/baselayer.h b/polymer/eduke32/build/include/baselayer.h index f7f60a660..358c406bc 100644 --- a/polymer/eduke32/build/include/baselayer.h +++ b/polymer/eduke32/build/include/baselayer.h @@ -163,7 +163,7 @@ extern double vid_gamma, vid_contrast, vid_brightness; #define DEFAULT_CONTRAST 1.0 #define DEFAULT_BRIGHTNESS 0.0 -#define GAMMA_CALC (int32_t)(min(max((float)((vid_gamma-1.0)*10.0),0),15)) +#define GAMMA_CALC ((int32_t)(min(max((double)((vid_gamma-1.0)*10.0),0),15))) int32_t switchrendermethod(int32_t,int32_t); // 0 = software, 1 = opengl | bool = reinit diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index b81f27e30..014695282 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -2740,7 +2740,7 @@ cheat_for_port_credits: if (b != (double)(vid_gamma*40960.f)) { vid_gamma = (double)b/40960.f; - ud.brightness = (int32_t)(min(max((double)((vid_gamma-1.0)*10.0),0),15)); + ud.brightness = GAMMA_CALC; ud.brightness <<= 2; setbrightness(ud.brightness>>2,g_player[myconnectindex].ps->palette,0); }