[wolf4sdl] 02/04: Show messages whenever autorun or autostrafe is toggled.

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 84f667f0b7654f0442486aa149f4bceaf7a966e3
Author: Fabian Greffrath <fabian+debian at greffrath.com>
Date:   Mon Jan 12 07:07:09 2015 +0100

    Show messages whenever autorun or autostrafe is toggled.
    
    This is more intrusive, but helps keeping track of what's going on.
---
 debian/patches/43-autorun.patch    | 16 ++++++++++++++--
 debian/patches/44-autostrafe.patch | 28 +++++++++++++++++++++-------
 2 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/debian/patches/43-autorun.patch b/debian/patches/43-autorun.patch
index 9fc37f7..90978c9 100644
--- a/debian/patches/43-autorun.patch
+++ b/debian/patches/43-autorun.patch
@@ -11,19 +11,29 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
  
  static void processEvent(SDL_Event *event)
  {
-@@ -259,6 +260,9 @@ static void processEvent(SDL_Event *even
+@@ -259,6 +260,19 @@ static void processEvent(SDL_Event *even
  
              LastScan = event->key.keysym.sym;
              SDLMod mod = SDL_GetModState();
 +            if ((mod & KMOD_LSHIFT) && (mod & KMOD_RSHIFT))
++            {
 +                autorun = !autorun;
 +
++                if (autorun)
++                    Message ("Always Run: On");
++                else
++                    Message ("Always Run: Off");
++
++                IN_ClearKeysDown ();
++                IN_Ack ();
++            }
++
              if(Keyboard[sc_Alt])
              {
                  if(LastScan==SDLK_F4)
 --- a/wl_play.cpp
 +++ b/wl_play.cpp
-@@ -255,10 +255,17 @@ int songs[] = {
+@@ -255,10 +255,19 @@ int songs[] = {
  void PollKeyboardButtons (void)
  {
      int i;
@@ -34,10 +44,12 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
              buttonstate[i] = true;
 +
 +    if (autorun)
++    {
 +        if (Keyboard[buttonscan[bt_run]])
 +            buttonstate[bt_run] = false;
 +        else
 +            buttonstate[bt_run] = true;
++    }
  }
  
  
diff --git a/debian/patches/44-autostrafe.patch b/debian/patches/44-autostrafe.patch
index eaf0684..36feb71 100644
--- a/debian/patches/44-autostrafe.patch
+++ b/debian/patches/44-autostrafe.patch
@@ -12,17 +12,27 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
  
  static void processEvent(SDL_Event *event)
  {
-@@ -262,6 +263,9 @@ static void processEvent(SDL_Event *even
-             SDLMod mod = SDL_GetModState();
-             if ((mod & KMOD_LSHIFT) && (mod & KMOD_RSHIFT))
-                 autorun = !autorun;
+@@ -272,6 +273,19 @@ static void processEvent(SDL_Event *even
+                 IN_ClearKeysDown ();
+                 IN_Ack ();
+             }
 +            if (((mod & KMOD_LALT) && (mod & KMOD_RALT)) ||
 +                ((mod & KMOD_LALT) && (mod & KMOD_MODE)))
++            {
 +                autostrafe = !autostrafe;
++
++                if (autostrafe)
++                    Message ("Always Strafe: On");
++                else
++                    Message ("Always Strafe: Off");
++
++                IN_ClearKeysDown ();
++                IN_Ack ();
++            }
  
              if(Keyboard[sc_Alt])
              {
-@@ -272,6 +276,7 @@ static void processEvent(SDL_Event *even
+@@ -282,6 +296,7 @@ static void processEvent(SDL_Event *even
              if(LastScan == SDLK_KP_ENTER) LastScan = SDLK_RETURN;
              else if(LastScan == SDLK_RSHIFT) LastScan = SDLK_LSHIFT;
              else if(LastScan == SDLK_RALT) LastScan = SDLK_LALT;
@@ -30,7 +40,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
              else if(LastScan == SDLK_RCTRL) LastScan = SDLK_LCTRL;
              else
              {
-@@ -314,6 +319,7 @@ static void processEvent(SDL_Event *even
+@@ -324,6 +339,7 @@ static void processEvent(SDL_Event *even
              if(key == SDLK_KP_ENTER) key = SDLK_RETURN;
              else if(key == SDLK_RSHIFT) key = SDLK_LSHIFT;
              else if(key == SDLK_RALT) key = SDLK_LALT;
@@ -40,7 +50,7 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
              {
 --- a/wl_play.cpp
 +++ b/wl_play.cpp
-@@ -329,15 +329,22 @@ void PollJoystickButtons (void)
+@@ -331,15 +331,26 @@ void PollJoystickButtons (void)
  void PollKeyboardMove (void)
  {
      int delta = buttonstate[bt_run] ? RUNMOVE * tics : BASEMOVE * tics;
@@ -52,16 +62,20 @@ Author: Fabian Greffrath <fabian+debian at greffrath.com>
          controly += delta;
      if (Keyboard[dirscan[di_west]])
 -        controlx -= delta;
++    {
 +        if (autostrafe)
 +            buttonstate[bt_strafeleft] = true;
 +        else
 +            controlx -= delta;
++    }
      if (Keyboard[dirscan[di_east]])
 -        controlx += delta;
++    {
 +        if (autostrafe)
 +            buttonstate[bt_straferight] = true;
 +        else
 +            controlx += delta;
++    }
  }
  
  

-- 
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