diff --git a/changelog.txt b/changelog.txt index d1d8b1b..2a21e50 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,10 +1,12 @@ DD Mmm 17 - 1.49 -chg: r_brightness <0.25..32> (default: 2) replaces r_overBrightBits - r_mapBrightness <0.25..32> (default: 4) replaces r_mapOverBrightBits +chg: r_brightness <0.25..32.0> (default: 2) replaces r_overBrightBits + r_mapBrightness <0.25..32.0> (default: 2) replaces r_mapOverBrightBits the new cvars use floating-point values (more control) and a linear scale (more intuitive) - new_cvar_value = pow(2, old_cvar_value), i.e. 0->1, 1->2, 2->4, 3->8, 4->16 + to convert the old engine values to the new values: + r_brightness = pow(2, r_overBrightBits) + r_mapBrightness = pow(2, clamp(r_mapOverBrightBits - r_overBrightBits, 0, 2)) chg: r_mode selects the video mode r_mode 0 (default) = no screen mode change, desktop resolution diff --git a/code/renderer/tr_bsp.cpp b/code/renderer/tr_bsp.cpp index e9ab738..751fd7e 100644 --- a/code/renderer/tr_bsp.cpp +++ b/code/renderer/tr_bsp.cpp @@ -33,8 +33,7 @@ static byte* fileBase; static void R_ColorShiftLightingBytes( const byte in[4], byte out[4] ) { - const float brightness = Com_Clamp( 0.25f, 32.0f, r_mapBrightness->value - r_brightness->value ); - const int scale16 = (int)( brightness * 65536.0f ); + const int scale16 = (int)( r_mapBrightness->value * 65536.0f ); // scale based on brightness int r = ( (int)in[0] * scale16 ) >> 16; diff --git a/code/renderer/tr_help.h b/code/renderer/tr_help.h index bc4d948..1a5c642 100644 --- a/code/renderer/tr_help.h +++ b/code/renderer/tr_help.h @@ -14,10 +14,6 @@ "allows image downscaling before texture upload\n" \ "The maximum scale ratio is 2 on both the horizontal and vertical axis." -#define help_r_mapBrightness \ -"brightness of lightmap textures\n" \ -"The lightmaps' brightness will be: r_mapBrightness - r_brightness." - #define help_r_mode \ "video mode to use when r_fullscreen is 1\n" \ " 0 = no video mode change, desktop resolution\n" \ diff --git a/code/renderer/tr_init.cpp b/code/renderer/tr_init.cpp index c2d6dfe..aced339 100644 --- a/code/renderer/tr_init.cpp +++ b/code/renderer/tr_init.cpp @@ -538,9 +538,9 @@ static const cvarTableItem_t r_cvars[] = { &r_blitMode, "r_blitMode", "0", CVAR_ARCHIVE, CVART_INTEGER, "0", XSTRING(BLITMODE_MAX), help_r_blitMode }, { &r_brightness, "r_brightness", "2", CVAR_ARCHIVE | CVAR_LATCH, CVART_FLOAT, "0.25", "32", "overall brightness" }, // should be called r_lightmapBrightness - { &r_mapBrightness, "r_mapBrightness", "4", CVAR_ARCHIVE | CVAR_LATCH, CVART_FLOAT, "0.25", "32", help_r_mapBrightness }, + { &r_mapBrightness, "r_mapBrightness", "2", CVAR_ARCHIVE | CVAR_LATCH, CVART_FLOAT, "0.25", "32", "brightness of lightmap textures" }, // should be called r_textureBrightness - { &r_intensity, "r_intensity", "1", CVAR_ARCHIVE | CVAR_LATCH, CVART_FLOAT, "1", NULL, "brightness of non-lightmap textures" }, + { &r_intensity, "r_intensity", "1", CVAR_ARCHIVE | CVAR_LATCH, CVART_FLOAT, "1", NULL, "brightness of non-lightmap map textures" }, { &r_fullscreen, "r_fullscreen", "1", CVAR_ARCHIVE | CVAR_LATCH, CVART_BOOL, NULL, NULL, "full-screen mode" }, { &r_width, "r_width", "1280", CVAR_ARCHIVE | CVAR_LATCH, CVART_INTEGER, "320", "65535", "custom window/render width" help_r_mode01 }, { &r_height, "r_height", "720", CVAR_ARCHIVE | CVAR_LATCH, CVART_INTEGER, "240", "65535", "custom window/render height" help_r_mode01 },