[rott-commits] r280 - trunk/rott

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Feb 11 04:17:36 EST 2015


Author: fabian
Date: 2015-02-11 04:17:36 -0500 (Wed, 11 Feb 2015)
New Revision: 280

Modified:
   trunk/rott/rt_draw.c
   trunk/rott/rt_floor.c
   trunk/rott/rt_scale.c
Log:
Fix missing fog on level Foggy Mountain

Light level is calculated based on scaled texture and sprite height
and is thus resolution dependent. Fix special-casing for fog.



Modified: trunk/rott/rt_draw.c
===================================================================
--- trunk/rott/rt_draw.c	2015-02-11 09:16:55 UTC (rev 279)
+++ trunk/rott/rt_draw.c	2015-02-11 09:17:36 UTC (rev 280)
@@ -1636,7 +1636,7 @@
 
    if (fog)
       {
-      i=(sprite->viewheight>>normalshade)+minshade;
+      i=((sprite->viewheight*200/iGLOBAL_SCREENHEIGHT)>>normalshade)+minshade;
       if (i>maxshade) i=maxshade;
       sprite->colormap=colormap+(i<<8);
       }
@@ -1697,7 +1697,7 @@
 
    if (fog)
       {
-      i=(height>>normalshade)+minshade;
+      i=((height*200/iGLOBAL_SCREENHEIGHT)>>normalshade)+minshade;
       if (i>maxshade) i=maxshade;
       sprite->colormap=map+(i<<8);
       }
@@ -1792,7 +1792,7 @@
       }
    if (fog)
       {
-      i =(post->wallheight>>normalshade)+minshade-lv+la;
+      i =((post->wallheight*200/iGLOBAL_SCREENHEIGHT)>>normalshade)+minshade-lv+la;
       if (i>maxshade+la) i=maxshade+la;
       shadingtable=colormap+(i<<8);
       }

Modified: trunk/rott/rt_floor.c
===================================================================
--- trunk/rott/rt_floor.c	2015-02-11 09:16:55 UTC (rev 279)
+++ trunk/rott/rt_floor.c	2015-02-11 09:17:36 UTC (rev 280)
@@ -527,7 +527,7 @@
       }
    if (fog)
       {
-      i=(height>>normalshade)+minshade;
+      i=((height*200/iGLOBAL_SCREENHEIGHT)>>normalshade)+minshade;
       if (i>maxshade) i=maxshade;
       shadingtable=colormap+(i<<8);
       }

Modified: trunk/rott/rt_scale.c
===================================================================
--- trunk/rott/rt_scale.c	2015-02-11 09:16:55 UTC (rev 279)
+++ trunk/rott/rt_scale.c	2015-02-11 09:17:36 UTC (rev 280)
@@ -149,7 +149,7 @@
       }
    if (fog)
       {
-      i=(height>>normalshade)+minshade;
+      i=((height*200/iGLOBAL_SCREENHEIGHT)>>normalshade)+minshade;
       if (i>maxshade) i=maxshade;
       shadingtable=colormap+(i<<8);
       }



More information about the rott-commits mailing list