Commit 218a3932 authored by Fabian Greffrath's avatar Fabian Greffrath

Fix missing fog on level Foggy Mountain (Closes: #775530).

Light level is calculated based on scaled texture and sprite height
and is thus resolution-dependent, fix special-casing for fog.
Thanks Alexandre Detiste for the bug report!

Fix scaling of the weapon sprite.

Fix scaling of the sky texture.
parent 7d75ed05
......@@ -5,6 +5,12 @@ rott (1.1.2-3) UNRELEASED; urgency=medium
This saves us from building the SUPERROTT and SITELICENSE variants
which had their multiplayer map file names hard-coded.
Adjust documentation and packaging accordingly.
* Fix missing fog on level Foggy Mountain (Closes: #775530).
Light level is calculated based on scaled texture and sprite height
and is thus resolution-dependent, fix special-casing for fog.
Thanks Alexandre Detiste for the bug report!
* Fix scaling of the weapon sprite.
* Fix scaling of the sky texture.
-- Fabian Greffrath <fabian+debian@greffrath.com> Thu, 15 Jan 2015 14:17:28 +0100
......
Description: Fix scaling of the sky texture
Author: Fabian Greffrath <fabian+debian@greffrath.com>
--- a/rott/rt_draw.c
+++ b/rott/rt_draw.c
@@ -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
--- 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
Description: Fix missing fog on level Foggy Mountain
Light level is calsulated based on scaled texture and sprite height
and is thus resolution dependent. Fix special-casing for fog.
Author: Fabian Greffrath <fabian+debian@greffrath.com>
Bug-Debian: https://bugs.debian.org/775530
--- 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);
}
--- 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*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);
}
......@@ -3,3 +3,6 @@ rott-r275.diff
rott-r276.diff
conflicting_types.patch
rott-merge-commercial.patch
fogshade.patch
weaponscale.patch
drawsky.patch
Description: Fix scaling of the weapon sprite
Author: Fabian Greffrath <fabian+debian@greffrath.com>
--- a/rott/rt_scale.c
+++ b/rott/rt_scale.c
@@ -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_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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment