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
This commit is contained in:
helixhorned 2012-05-05 22:23:17 +00:00
parent fd6e36af5a
commit 7cdd9a04da
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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);
}