Am Montag, den 02.02.2015, 16:28 +0100 schrieb Fabian Greffrath: 
> Can you confirm that ROTT renders fog as intended with the attached
> patch, even at high resolutions?

Sorry, wrong patch! Please use the attached on instead.

- Fabian

--- a/rott/rt_draw.c
+++ b/rott/rt_draw.c
@@ -1636,7 +1636,7 @@ void SetSpriteLightLevel (int x, int y,
 
    if (fog)
       {
-      i=(sprite->viewheight>>normalshade)+minshade;
+      i=(sprite->viewheight>>normalshade)*200/iGLOBAL_SCREENHEIGHT+minshade;
       if (i>maxshade) i=maxshade;
       sprite->colormap=colormap+(i<<8);
       }
@@ -1697,7 +1697,7 @@ void SetColorLightLevel (int x, int y, v
 
    if (fog)
       {
-      i=(height>>normalshade)+minshade;
+      i=(height>>normalshade)*200/iGLOBAL_SCREENHEIGHT+minshade;
       if (i>maxshade) i=maxshade;
       sprite->colormap=map+(i<<8);
       }
@@ -1792,7 +1792,7 @@ void SetWallLightLevel (wallcast_t * pos
       }
    if (fog)
       {
-      i =(post->wallheight>>normalshade)+minshade-lv+la;
+      i =(post->wallheight>>normalshade)*200/iGLOBAL_SCREENHEIGHT+minshade-lv+la;
       if (i>maxshade+la) i=maxshade+la;
       shadingtable=colormap+(i<<8);
       }
--- a/rott/rt_floor.c
+++ b/rott/rt_floor.c
@@ -527,7 +527,7 @@ void SetFCLightLevel (int height)
       }
    if (fog)
       {
-      i=(height>>normalshade)+minshade;
+      i=(height>>normalshade)*200/iGLOBAL_SCREENHEIGHT+minshade;
       if (i>maxshade) i=maxshade;
       shadingtable=colormap+(i<<8);
       }
--- a/rott/rt_scale.c
+++ b/rott/rt_scale.c
@@ -149,7 +149,7 @@ void SetLightLevel (int height)
       }
    if (fog)
       {
-      i=(height>>normalshade)+minshade;
+      i=(height>>normalshade)*200/iGLOBAL_SCREENHEIGHT+minshade;
       if (i>maxshade) i=maxshade;
       shadingtable=colormap+(i<<8);
       }

Reply via email to