[rott] 01/01: Fix missing fog on level Foggy Mountain (Closes: #775530).
Fabian Greffrath
fabian-guest at moszumanska.debian.org
Mon Feb 9 08:23:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
fabian-guest pushed a commit to branch master
in repository rott.
commit 218a3932e3acd22ec20f1046b04d3bc0c4e55d5a
Author: Fabian Greffrath <fabian+debian at greffrath.com>
Date: Mon Feb 9 09:22:37 2015 +0100
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.
---
debian/changelog | 6 ++++
debian/patches/drawsky.patch | 64 ++++++++++++++++++++++++++++++++++++++++
debian/patches/fogshade.patch | 57 +++++++++++++++++++++++++++++++++++
debian/patches/series | 3 ++
debian/patches/weaponscale.patch | 38 ++++++++++++++++++++++++
5 files changed, 168 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index bf69a7b..f76162a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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 at greffrath.com> Thu, 15 Jan 2015 14:17:28 +0100
diff --git a/debian/patches/drawsky.patch b/debian/patches/drawsky.patch
new file mode 100644
index 0000000..ae0401e
--- /dev/null
+++ b/debian/patches/drawsky.patch
@@ -0,0 +1,64 @@
+Description: Fix scaling of the sky texture
+Author: Fabian Greffrath <fabian+debian at 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
diff --git a/debian/patches/fogshade.patch b/debian/patches/fogshade.patch
new file mode 100644
index 0000000..b4e8eca
--- /dev/null
+++ b/debian/patches/fogshade.patch
@@ -0,0 +1,57 @@
+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 at 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);
+ }
diff --git a/debian/patches/series b/debian/patches/series
index f9bbfff..99622a3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,6 @@ rott-r275.diff
rott-r276.diff
conflicting_types.patch
rott-merge-commercial.patch
+fogshade.patch
+weaponscale.patch
+drawsky.patch
diff --git a/debian/patches/weaponscale.patch b/debian/patches/weaponscale.patch
new file mode 100644
index 0000000..015037a
--- /dev/null
+++ b/debian/patches/weaponscale.patch
@@ -0,0 +1,38 @@
+Description: Fix scaling of the weapon sprite
+Author: Fabian Greffrath <fabian+debian at 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
+
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/rott.git
More information about the Pkg-games-commits
mailing list