[wolf4sdl] 01/04: Turn shading support into a command line option "--shading".

Fabian Greffrath fabian-guest at moszumanska.debian.org
Mon Jan 12 06:21:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

fabian-guest pushed a commit to branch master
in repository wolf4sdl.

commit c621d1cb03112b367620cfa49838f919f7fa9164
Author: Fabian Greffrath <fabian+debian at greffrath.com>
Date:   Mon Jan 12 06:22:03 2015 +0100

    Turn shading support into a command line option "--shading".
    
    As per user request. The effect was more intrusive than intended.
    
    Thanks Alexandre Detiste.
---
 debian/patches/02-enable-shading.patch    | 153 +++++++++++++++++++++++++++++-
 debian/patches/21-compiler-warnings.patch |  34 +++----
 debian/patches/40-novert.patch            |  24 ++---
 debian/patches/41-crosshair.patch         |  22 ++---
 4 files changed, 192 insertions(+), 41 deletions(-)

diff --git a/debian/patches/02-enable-shading.patch b/debian/patches/02-enable-shading.patch
index 2436472..2f628e1 100644
--- a/debian/patches/02-enable-shading.patch
+++ b/debian/patches/02-enable-shading.patch
@@ -1,4 +1,4 @@
-Subject: Enable shading support (just because I like it).
+Subject: Enable shading support as a command line option "--shading".
 Author: Fabian Greffrath <fabian+debian at greffrath.com>
 
 --- a/Makefile
@@ -22,3 +22,154 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
  //#define USE_DIR3DSPR        // Enables directional 3d sprites (see wl_dir3dspr.cpp)
  //#define USE_FLOORCEILINGTEX // Enables floor and ceiling textures stored in the third mapplane (see wl_floorceiling.cpp)
  //#define USE_HIRES           // Enables high resolution textures/sprites (128x128)
+--- a/wl_def.h
++++ b/wl_def.h
+@@ -933,6 +933,7 @@ extern  int      param_audiobuffer;
+ extern  int      param_mission;
+ extern  boolean  param_goodtimes;
+ extern  boolean  param_ignorenumchunks;
++extern  boolean  param_shading;
+ 
+ 
+ void            NewGame (int difficulty,int episode);
+--- a/wl_dir3dspr.cpp
++++ b/wl_dir3dspr.cpp
+@@ -101,10 +101,11 @@ void Scale3DShaper(int x1, int x2, int s
+                         if(scrstarty!=screndy && screndy>0)
+                         {
+ #ifdef USE_SHADING
++                            if (param_shading)
+                             col=curshades[((byte *)shape)[newstart+j]];
+-#else
+-                            col=((byte *)shape)[newstart+j];
++                            else
+ #endif
++                            col=((byte *)shape)[newstart+j];
+                             if(scrstarty<0) scrstarty=0;
+                             if(screndy>viewheight) screndy=viewheight,j=endy;
+ 
+--- a/wl_draw.cpp
++++ b/wl_draw.cpp
+@@ -307,10 +307,11 @@ void ScalePost()
+     if(yw < 0) return;
+ 
+ #ifdef USE_SHADING
++    if (param_shading)
+     col = curshades[postsource[yw]];
+-#else
+-    col = postsource[yw];
++    else
+ #endif
++    col = postsource[yw];
+     yendoffs = yendoffs * vbufPitch + postx;
+     while(yoffs <= yendoffs)
+     {
+@@ -326,10 +327,11 @@ void ScalePost()
+             while(ywcount <= 0);
+             if(yw < 0) break;
+ #ifdef USE_SHADING
++            if (param_shading)
+             col = curshades[postsource[yw]];
+-#else
+-            col = postsource[yw];
++            else
+ #endif
++            col = postsource[yw];
+         }
+         yendoffs -= vbufPitch;
+     }
+@@ -640,16 +642,21 @@ void VGAClearScreen (void)
+     int y;
+     byte *ptr = vbuf;
+ #ifdef USE_SHADING
++    if (param_shading)
++    {
+     for(y = 0; y < viewheight / 2; y++, ptr += vbufPitch)
+         memset(ptr, shadetable[GetShade((viewheight / 2 - y) << 3)][ceiling], viewwidth);
+     for(; y < viewheight; y++, ptr += vbufPitch)
+         memset(ptr, shadetable[GetShade((y - viewheight / 2) << 3)][0x19], viewwidth);
+-#else
++    }
++    else
++#endif
++    {
+     for(y = 0; y < viewheight / 2; y++, ptr += vbufPitch)
+         memset(ptr, ceiling, viewwidth);
+     for(; y < viewheight; y++, ptr += vbufPitch)
+         memset(ptr, 0x19, viewwidth);
+-#endif
++    }
+ }
+ 
+ //==========================================================================
+@@ -756,10 +763,11 @@ void ScaleShape (int xcenter, int shapen
+                             if(scrstarty!=screndy && screndy>0)
+                             {
+ #ifdef USE_SHADING
++                                if (param_shading)
+                                 col=curshades[((byte *)shape)[newstart+j]];
+-#else
+-                                col=((byte *)shape)[newstart+j];
++                                else
+ #endif
++                                col=((byte *)shape)[newstart+j];
+                                 if(scrstarty<0) scrstarty=0;
+                                 if(screndy>viewheight) screndy=viewheight,j=endy;
+ 
+--- a/wl_floorceiling.cpp
++++ b/wl_floorceiling.cpp
+@@ -66,16 +66,21 @@ void DrawFloorAndCeiling(byte *vbuf, uns
+                     v = (gv >> (TILESHIFT - TEXTURESHIFT)) & (TEXTURESIZE - 1);
+                     unsigned texoffs = (u << TEXTURESHIFT) + (TEXTURESIZE - 1) - v;
+ #ifdef USE_SHADING
++                    if (param_shading)
++                    {
+                     if(curtoptex)
+                         vbuf[top_add] = curshades[toptex[texoffs]];
+                     if(curbottex)
+                         vbuf[bot_add] = curshades[bottex[texoffs]];
+-#else
++                    }
++                    else
++#endif
++                    {
+                     if(curtoptex)
+                         vbuf[top_add] = toptex[texoffs];
+                     if(curbottex)
+                         vbuf[bot_add] = bottex[texoffs];
+-#endif
++                    }
+                 }
+             }
+             gu += du;
+--- a/wl_main.cpp
++++ b/wl_main.cpp
+@@ -102,6 +102,7 @@ int     param_audiobuffer = 2048 / (4410
+ int     param_mission = 0;
+ boolean param_goodtimes = false;
+ boolean param_ignorenumchunks = false;
++boolean param_shading = false;
+ 
+ /*
+ =============================================================================
+@@ -1717,6 +1718,10 @@ void CheckParameters(int argc, char *arg
+             fullscreen = false;
+             forcegrabmouse = true;
+         }
++#ifdef USE_SHADING
++        else IFARG("--shading")
++            param_shading = true;
++#endif
+         else IFARG("--res")
+         {
+             if(i + 2 >= argc)
+@@ -1897,6 +1902,9 @@ void CheckParameters(int argc, char *arg
+             " --hard                 Sets the difficulty to hard for tedlevel\n"
+             " --nowait               Skips intro screens\n"
+             " --windowed[-mouse]     Starts the game in a window [and grabs mouse]\n"
++#ifdef USE_SHADING
++            " --shading              Enables shading support\n"
++#endif
+             " --res <width> <height> Sets the screen resolution\n"
+             "                        (must be multiple of 320x200 or 320x240)\n"
+             " --resf <w> <h>         Sets any screen resolution >= 320x200\n"
diff --git a/debian/patches/21-compiler-warnings.patch b/debian/patches/21-compiler-warnings.patch
index 4c20663..206e788 100644
--- a/debian/patches/21-compiler-warnings.patch
+++ b/debian/patches/21-compiler-warnings.patch
@@ -299,7 +299,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
  
  #include "wl_cloudsky.h"
  #include "wl_atmos.h"
-@@ -484,7 +483,7 @@ void HitHorizWall (void)
+@@ -486,7 +485,7 @@ void HitHorizWall (void)
  
  void HitHorizDoor (void)
  {
@@ -308,7 +308,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
      int doornum;
      int texture;
  
-@@ -549,7 +548,7 @@ void HitHorizDoor (void)
+@@ -551,7 +550,7 @@ void HitHorizDoor (void)
  
  void HitVertDoor (void)
  {
@@ -317,7 +317,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
      int doornum;
      int texture;
  
-@@ -1093,8 +1092,8 @@ void CalcTics (void)
+@@ -1101,8 +1100,8 @@ void CalcTics (void)
  
  void AsmRefresh()
  {
@@ -328,7 +328,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
      boolean playerInPushwallBackTile = tilemap[focaltx][focalty] == 64;
  
      for(pixx=0;pixx<viewwidth;pixx++)
-@@ -1149,8 +1148,8 @@ void AsmRefresh()
+@@ -1157,8 +1156,8 @@ void AsmRefresh()
          // Special treatment when player is in back tile of pushwall
          if(playerInPushwallBackTile)
          {
@@ -339,7 +339,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
              {
                  int32_t yintbuf = yintercept - ((ystep * (64 - pwallpos)) >> 6);
                  if((yintbuf >> 16) == focalty)   // ray hits pushwall back?
-@@ -1166,8 +1165,8 @@ void AsmRefresh()
+@@ -1174,8 +1173,8 @@ void AsmRefresh()
                      continue;
                  }
              }
@@ -350,7 +350,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
              {
                  int32_t xintbuf = xintercept - ((xstep * (64 - pwallpos)) >> 6);
                  if((xintbuf >> 16) == focaltx)   // ray hits pushwall back?
-@@ -1237,8 +1236,8 @@ vertentry:
+@@ -1245,8 +1244,8 @@ vertentry:
                                  pwallposnorm = pwallpos;
                                  pwallposinv = 64-pwallpos;
                              }
@@ -361,7 +361,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
                              {
                                  yintbuf=yintercept+((ystep*pwallposnorm)>>6);
                                  if((yintbuf>>16)!=(yintercept>>16))
-@@ -1267,13 +1266,13 @@ vertentry:
+@@ -1275,13 +1274,13 @@ vertentry:
                          {
                              int pwallposi = pwallpos;
                              if(pwalldir==di_north) pwallposi = 64-pwallpos;
@@ -379,7 +379,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
                                          goto passvert;
  
                                      if(pwalldir==di_south)
-@@ -1306,8 +1305,8 @@ vertentry:
+@@ -1314,8 +1313,8 @@ vertentry:
                                  }
                                  else
                                  {
@@ -390,7 +390,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
                                          goto passvert;
  
                                      if(pwalldir==di_south)
-@@ -1392,8 +1391,8 @@ horizentry:
+@@ -1400,8 +1399,8 @@ horizentry:
                                  pwallposnorm = pwallpos;
                                  pwallposinv = 64-pwallpos;
                              }
@@ -401,7 +401,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
                              {
                                  xintbuf=xintercept+((xstep*pwallposnorm)>>6);
                                  if((xintbuf>>16)!=(xintercept>>16))
-@@ -1422,13 +1421,13 @@ horizentry:
+@@ -1430,13 +1429,13 @@ horizentry:
                          {
                              int pwallposi = pwallpos;
                              if(pwalldir==di_west) pwallposi = 64-pwallpos;
@@ -419,7 +419,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
                                          goto passhoriz;
  
                                      if(pwalldir==di_east)
-@@ -1461,8 +1460,8 @@ horizentry:
+@@ -1469,8 +1468,8 @@ horizentry:
                                  }
                                  else
                                  {
@@ -479,7 +479,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
  #include "wl_atmos.h"
  #include <SDL_syswm.h>
  
-@@ -1444,7 +1443,7 @@ void Quit (const char *errorStr, ...)
+@@ -1445,7 +1444,7 @@ void Quit (const char *errorStr, ...)
      if (!pictable)  // don't try to display the red box before it's loaded
      {
          ShutdownId();
@@ -488,7 +488,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
          {
  #ifdef NOTYET
              SetTextCursor(0,0);
-@@ -1458,7 +1457,7 @@ void Quit (const char *errorStr, ...)
+@@ -1459,7 +1458,7 @@ void Quit (const char *errorStr, ...)
          exit(1);
      }
  
@@ -497,7 +497,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
      {
  #ifdef NOTYET
          #ifndef JAPAN
-@@ -1478,7 +1477,7 @@ void Quit (const char *errorStr, ...)
+@@ -1479,7 +1478,7 @@ void Quit (const char *errorStr, ...)
  
      ShutdownId ();
  
@@ -506,7 +506,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
      {
  #ifdef NOTYET
          memcpy((byte *)0xb8000,screen+7,7*160);
-@@ -1492,7 +1491,7 @@ void Quit (const char *errorStr, ...)
+@@ -1493,7 +1492,7 @@ void Quit (const char *errorStr, ...)
          exit(1);
      }
      else
@@ -515,7 +515,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
      {
  #ifdef NOTYET
          #ifndef JAPAN
-@@ -1520,7 +1519,9 @@ void Quit (const char *errorStr, ...)
+@@ -1521,7 +1520,9 @@ void Quit (const char *errorStr, ...)
  
  static void DemoLoop()
  {
@@ -525,7 +525,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
  
  //
  // check for launch from ted
-@@ -1729,7 +1730,7 @@ void CheckParameters(int argc, char *arg
+@@ -1734,7 +1735,7 @@ void CheckParameters(int argc, char *arg
                  screenWidth = atoi(argv[++i]);
                  screenHeight = atoi(argv[++i]);
                  unsigned factor = screenWidth / 320;
diff --git a/debian/patches/40-novert.patch b/debian/patches/40-novert.patch
index 51f99d9..b1d42b6 100644
--- a/debian/patches/40-novert.patch
+++ b/debian/patches/40-novert.patch
@@ -3,37 +3,37 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
 
 --- a/wl_def.h
 +++ b/wl_def.h
-@@ -933,6 +933,7 @@ extern  int      param_audiobuffer;
- extern  int      param_mission;
+@@ -934,6 +934,7 @@ extern  int      param_mission;
  extern  boolean  param_goodtimes;
  extern  boolean  param_ignorenumchunks;
+ extern  boolean  param_shading;
 +extern  boolean  param_novert;
  
  
  void            NewGame (int difficulty,int episode);
 --- a/wl_main.cpp
 +++ b/wl_main.cpp
-@@ -101,6 +101,7 @@ int     param_audiobuffer = 2048 / (4410
- int     param_mission = 0;
+@@ -102,6 +102,7 @@ int     param_mission = 0;
  boolean param_goodtimes = false;
  boolean param_ignorenumchunks = false;
+ boolean param_shading = false;
 +boolean param_novert = false;
  
  /*
  =============================================================================
-@@ -1718,6 +1719,8 @@ void CheckParameters(int argc, char *arg
-             fullscreen = false;
-             forcegrabmouse = true;
-         }
+@@ -1723,6 +1724,8 @@ void CheckParameters(int argc, char *arg
+         else IFARG("--shading")
+             param_shading = true;
+ #endif
 +        else IFARG("--novert")
 +            param_novert = true;
          else IFARG("--res")
          {
              if(i + 2 >= argc)
-@@ -1898,6 +1901,7 @@ void CheckParameters(int argc, char *arg
-             " --hard                 Sets the difficulty to hard for tedlevel\n"
-             " --nowait               Skips intro screens\n"
-             " --windowed[-mouse]     Starts the game in a window [and grabs mouse]\n"
+@@ -1906,6 +1909,7 @@ void CheckParameters(int argc, char *arg
+ #ifdef USE_SHADING
+             " --shading              Enables shading support\n"
+ #endif
 +            " --novert               Suppresses vertical mouse movement\n"
              " --res <width> <height> Sets the screen resolution\n"
              "                        (must be multiple of 320x200 or 320x240)\n"
diff --git a/debian/patches/41-crosshair.patch b/debian/patches/41-crosshair.patch
index d41aeb9..1eed4d0 100644
--- a/debian/patches/41-crosshair.patch
+++ b/debian/patches/41-crosshair.patch
@@ -3,9 +3,9 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
 
 --- a/wl_def.h
 +++ b/wl_def.h
-@@ -934,6 +934,7 @@ extern  int      param_mission;
- extern  boolean  param_goodtimes;
+@@ -935,6 +935,7 @@ extern  boolean  param_goodtimes;
  extern  boolean  param_ignorenumchunks;
+ extern  boolean  param_shading;
  extern  boolean  param_novert;
 +extern  boolean  param_crosshair;
  
@@ -13,7 +13,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
  void            NewGame (int difficulty,int episode);
 --- a/wl_draw.cpp
 +++ b/wl_draw.cpp
-@@ -1052,6 +1052,17 @@ void DrawPlayerWeapon (void)
+@@ -1060,6 +1060,17 @@ void DrawPlayerWeapon (void)
          SimpleScaleShape(viewwidth/2,SPR_DEMO,viewheight+1);
  }
  
@@ -31,7 +31,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
  
  //==========================================================================
  
-@@ -1596,6 +1607,8 @@ void    ThreeDRefresh (void)
+@@ -1604,6 +1615,8 @@ void    ThreeDRefresh (void)
  #endif
  
      DrawPlayerWeapon ();    // draw player's hands
@@ -42,16 +42,16 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
          ShowActStatus();
 --- a/wl_main.cpp
 +++ b/wl_main.cpp
-@@ -102,6 +102,7 @@ int     param_mission = 0;
- boolean param_goodtimes = false;
+@@ -103,6 +103,7 @@ boolean param_goodtimes = false;
  boolean param_ignorenumchunks = false;
+ boolean param_shading = false;
  boolean param_novert = false;
 +boolean param_crosshair = false;
  
  /*
  =============================================================================
-@@ -1721,6 +1722,8 @@ void CheckParameters(int argc, char *arg
-         }
+@@ -1726,6 +1727,8 @@ void CheckParameters(int argc, char *arg
+ #endif
          else IFARG("--novert")
              param_novert = true;
 +        else IFARG("--crosshair")
@@ -59,9 +59,9 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
          else IFARG("--res")
          {
              if(i + 2 >= argc)
-@@ -1902,6 +1905,7 @@ void CheckParameters(int argc, char *arg
-             " --nowait               Skips intro screens\n"
-             " --windowed[-mouse]     Starts the game in a window [and grabs mouse]\n"
+@@ -1910,6 +1913,7 @@ void CheckParameters(int argc, char *arg
+             " --shading              Enables shading support\n"
+ #endif
              " --novert               Suppresses vertical mouse movement\n"
 +            " --crosshair            Shows a crosshair\n"
              " --res <width> <height> Sets the screen resolution\n"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/wolf4sdl.git



More information about the Pkg-games-commits mailing list