Am Dienstag, den 03.02.2015, 21:35 +0100 schrieb Alexandre Detiste: 
> I only noticed the difference with the sky when running side by side with 
> dosbox;
> but the tiny hand is silly; I don't know if it's hard to strech it too.

Could you please confirm that the attached patch fixes all the oddities
we have discussed so far, i.e. the missing fog rendering, the tiny hand
and the squashed sky? (This will be split out into three separate
patches, of course.)

Thank you!

- 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*200/iGLOBAL_SCREENHEIGHT)>>normalshade)+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*200/iGLOBAL_SCREENHEIGHT)>>normalshade)+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*200/iGLOBAL_SCREENHEIGHT)>>normalshade)+minshade-lv+la;
       if (i>maxshade+la) i=maxshade+la;
       shadingtable=colormap+(i<<8);
       }
@@ -6009,6 +6009,7 @@ void DrawMaskedRotRow(int count, byte *
 
 void DrawSkyPost (byte * buf, byte * src, int height)
 {
+#if 0
 // bna fix for missing sky by high res eg 800x600
 // when sky is >400 (max skyheight) then reverse mouintain to missing spot
 // there should be 200 line of mouintain (400+200) = 600 height lines
@@ -6033,13 +6034,17 @@ void DrawSkyPost (byte * buf, byte * src
 		}
 	// bna section end
 	}
-	else {
+	else
+#endif
+	{
+	int i = 0;
+	const byte *orig_src = src;
 	// org code
 		while (height--) {
 			*buf = shadingtable[*src];
 			
 			buf += linewidth;
-			src++;
+			src = orig_src + (++i*200/iGLOBAL_SCREENHEIGHT);
 		}
 	//	
 	}
--- a/rott/rt_floor.c
+++ b/rott/rt_floor.c
@@ -105,14 +105,15 @@ void DrawSky( void )
    else
       shadingtable=colormap+(1<<12);
 
-   ofs=(((maxheight)-(player->z))>>3)+(centery-(viewheight>>1));
+   ofs=(((maxheight)-(player->z))>>3)+(centery*200/iGLOBAL_SCREENHEIGHT-((viewheight*200/iGLOBAL_SCREENHEIGHT)>>1));
+
    if (ofs>centerskypost)
       {
       ofs=centerskypost;
       }
-   else if (((centerskypost-ofs)+viewheight)>1799)
+   else if (((centerskypost-ofs)+viewheight*200/iGLOBAL_SCREENHEIGHT)>1799)
       {
-      ofs=-(1799-(centerskypost+viewheight));
+      ofs=-(1799-(centerskypost+viewheight*200/iGLOBAL_SCREENHEIGHT));
       }
 //ofs=centerskypost;
 #ifdef DOS
@@ -527,7 +528,7 @@ void SetFCLightLevel (int height)
       }
    if (fog)
       {
-      i=(height>>normalshade)+minshade;
+      i=((height*200/iGLOBAL_SCREENHEIGHT)>>normalshade)+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*200/iGLOBAL_SCREENHEIGHT)>>normalshade)+minshade;
       if (i>maxshade) i=maxshade;
       shadingtable=colormap+(i<<8);
       }
@@ -861,7 +861,7 @@ void ScaleWeapon (int xoff, int y, int s
                 return;         // off the left side
 
    dc_iscale=0xffffffffu/(unsigned)dc_invscale;
-   dc_texturemid=(((p->origsize>>1)+p->topoffset)<<SFRACBITS)+(SFRACUNIT>>1);
+   dc_texturemid=(((p->origsize>>1)+p->topoffset)<<SFRACBITS)+(SFRACUNIT>>2);
    sprtopoffset=(centeryclipped<<16) - FixedMul(dc_texturemid,dc_invscale);
 
 //
--- a/rott/_rt_floo.h
+++ b/rott/_rt_floo.h
@@ -23,6 +23,6 @@ Foundation, Inc., 59 Temple Place - Suit
 //#define	MAXVIEWHEIGHT MAXSCREENHEIGHT	
 #define MAXSKYSEGS    2048
 #define MAXSKYDATA    8
-#define MINSKYHEIGHT  0//148 //bna++ sky change here
+#define MINSKYHEIGHT  148
 
 #endif
--- a/rott/rt_view.c
+++ b/rott/rt_view.c
@@ -386,19 +386,12 @@ void SetViewSize
    //   SetTextMode (  );
    //   viewheight=viewheight;
    height = viewheight;
-   if ( height > 168 )
+   if ( height > 168*iGLOBAL_SCREENHEIGHT/200 )
    {
         // Prevent weapon from being scaled too big
-	    height = 168;
-	  	if ( iGLOBAL_SCREENWIDTH == 640) {
-			height = 260;
-		}else if ( iGLOBAL_SCREENWIDTH == 800) {
-			height = 360;
-		}
+	    height = 168*iGLOBAL_SCREENHEIGHT/200;
    }
 
-   if ((G_weaponscale > 150)&&(G_weaponscale <600)){height = G_weaponscale;}
-   if ( iGLOBAL_SCREENWIDTH == 320) {G_weaponscale=G_weaponscale/2;}
    weaponscale = ( height << 16 ) / 168;//( height << 16 ) = 170 * 65536
 
   

Reply via email to