From c9b1da36539770fb9f5fdcf623b533a26f99db9b Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 12 Aug 2008 22:38:50 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@973 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/build.c | 8 ++++++++ polymer/build/src/config.c | 6 +++++- polymer/eduke32/source/astub.c | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/polymer/build/src/build.c b/polymer/build/src/build.c index 22fe4cddb..266b28038 100644 --- a/polymer/build/src/build.c +++ b/polymer/build/src/build.c @@ -425,9 +425,13 @@ int app_main(int argc, const char **argv) if (cursectnum == -1) { + double gamma = vid_gamma; + vid_gamma = 1.0; setbrightness(0,palette,0); overheadeditor(); keystatus[buildkeys[BK_MODE2D_3D]] = 0; + vid_gamma = gamma; + setbrightness(brightness,palette,0); } CANCEL: quitflag = 0; @@ -2580,9 +2584,13 @@ void editinput(void) } if (keystatus[buildkeys[BK_MODE2D_3D]]) // Enter { + double gamma = vid_gamma; + vid_gamma = 1.0; setbrightness(0,palette,0); overheadeditor(); keystatus[buildkeys[BK_MODE2D_3D]] = 0; + vid_gamma = gamma; + setbrightness(brightness,palette,0); } } diff --git a/polymer/build/src/config.c b/polymer/build/src/config.c index b06a448d1..ea8e61e6a 100644 --- a/polymer/build/src/config.c +++ b/polymer/build/src/config.c @@ -133,7 +133,11 @@ int loadsetup(const char *fn) if (readconfig(fp, "bpp", val, VL) > 0) bppgame = Batoi(val); if (readconfig(fp, "editorgridextent", val, VL) > 0) editorgridextent = max(min(524288,Batoi(val)),65536); if (readconfig(fp, "renderer", val, VL) > 0) { i = Batoi(val); setrendermode(i); } - if (readconfig(fp, "brightness", val, VL) > 0) brightness = min(max(Batoi(val),0),15); + if (readconfig(fp, "brightness", val, VL) > 0) + { + brightness = min(max(Batoi(val),0),15); + vid_gamma = 1.0 + ((float)brightness / 10.0); + } #ifdef RENDERTYPEWIN if (readconfig(fp, "maxrefreshfreq", val, VL) > 0) maxrefreshfreq = Batoi(val); diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 42485bea5..f0bc961e9 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -5396,8 +5396,9 @@ static void Keys3d(void) keystatus[KEYSC_F11] = 0; brightness++; if (brightness >= 16) brightness = 0; + vid_gamma = 1.0 + ((float)brightness / 10.0); setbrightness(brightness,palette,0); - message("Brightness: %d/16",brightness); + message("Brightness: %d/16",brightness+1); } if (keystatus[KEYSC_TAB]) //TAB