From a73d1b792c9e968cff9d5865e2fb4a837996ec9d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 23 Jun 2013 10:17:58 +0200 Subject: [PATCH] - fixed: Assignment of GetLightLevel to GLWall::lightlevel must be clamped. This was done incorrectly in the last SVN version which clamped the result of GetLightLevel, causing problems elsewhere. --- src/gl/scene/gl_wall.h | 2 +- src/gl/scene/gl_walls.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gl/scene/gl_wall.h b/src/gl/scene/gl_wall.h index e44155aa6..00459644c 100644 --- a/src/gl/scene/gl_wall.h +++ b/src/gl/scene/gl_wall.h @@ -118,7 +118,7 @@ public: fixed_t viewdistance; - BYTE lightlevel; + int lightlevel; BYTE type; BYTE flags; short rellight; diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index 40c18baa9..e7265c1a1 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -1098,7 +1098,7 @@ void GLWall::BuildFFBlock(seg_t * seg, F3DFloor * rover, float to; lightlist_t * light; bool translucent; - byte savelight=lightlevel; + int savelight=lightlevel; FColormap savecolor=Colormap; float ul; float texlength; @@ -1108,12 +1108,12 @@ void GLWall::BuildFFBlock(seg_t * seg, F3DFloor * rover, { if (!gl_fixedcolormap) { - // this may not yet be done! + // this may not yet be done light=P_GetPlaneLight(rover->target, rover->top.plane,true); Colormap.Clear(); Colormap.LightColor=(light->extra_colormap)->Fade; - // the fog plane defines the light level, not the front sector! - lightlevel=*light->p_lightlevel; + // the fog plane defines the light level, not the front sector + lightlevel = gl_ClampLight(*light->p_lightlevel); gltexture=NULL; type=RENDERWALL_FFBLOCK; } @@ -1520,7 +1520,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector) int rel = 0; int orglightlevel = gl_ClampLight(frontsector->lightlevel); - lightlevel = seg->sidedef->GetLightLevel(!!(flags&GLWF_FOGGY), orglightlevel, false, &rel); + lightlevel = gl_ClampLight(seg->sidedef->GetLightLevel(!!(flags&GLWF_FOGGY), orglightlevel, false, &rel)); if (orglightlevel >= 253) // with the software renderer fake contrast won't be visible above this. { rellight = 0;