summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderergl2/tr_image.c')
-rw-r--r--src/renderergl2/tr_image.c41
1 files changed, 5 insertions, 36 deletions
diff --git a/src/renderergl2/tr_image.c b/src/renderergl2/tr_image.c
index 7bc9773f..3438c939 100644
--- a/src/renderergl2/tr_image.c
+++ b/src/renderergl2/tr_image.c
@@ -3014,37 +3014,14 @@ void R_SetColorMappings( void ) {
int i, j;
float g;
int inf;
- int shift;
// setup the overbright lighting
tr.overbrightBits = r_overBrightBits->integer;
- if ( !glConfig.deviceSupportsGamma ) {
- tr.overbrightBits = 0; // need hardware gamma for overbright
- }
-
- // never overbright in windowed mode without soft overbright
- if ( !glConfig.isFullscreen && !r_softOverbright->integer )
- {
- tr.overbrightBits = 0;
- }
-
- // never overbright with tonemapping
- if ( r_toneMap->integer && r_hdr->integer )
- {
- tr.overbrightBits = 0;
- }
- // allow 2 overbright bits in 24 bit, but only 1 in 16 bit
- if ( glConfig.colorBits > 16 ) {
- if ( tr.overbrightBits > 2 ) {
- tr.overbrightBits = 2;
- }
- } else {
- if ( tr.overbrightBits > 1 ) {
- tr.overbrightBits = 1;
- }
- }
- if ( tr.overbrightBits < 0 ) {
+ // allow 2 overbright bits
+ if ( tr.overbrightBits > 2 ) {
+ tr.overbrightBits = 2;
+ } else if ( tr.overbrightBits < 0 ) {
tr.overbrightBits = 0;
}
@@ -3064,14 +3041,6 @@ void R_SetColorMappings( void ) {
g = r_gamma->value;
- shift = tr.overbrightBits;
-
- // no shift with soft overbright
- if (r_softOverbright->integer)
- {
- shift = 0;
- }
-
for ( i = 0; i < 256; i++ ) {
int i2;
@@ -3089,7 +3058,7 @@ void R_SetColorMappings( void ) {
} else {
inf = 255 * pow ( i2/255.0f, 1.0f / g ) + 0.5f;
}
- inf <<= shift;
+
if (inf < 0) {
inf = 0;
}