[chocolate-doom] 08/31: Map mouse buttons correctly.

Jonathan Dowland jmtd at moszumanska.debian.org
Mon Jan 30 15:07:00 UTC 2017


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

jmtd pushed a commit to annotated tag chocolate-doom-0.1.1
in repository chocolate-doom.

commit 02a491c087794f1e170adc3eadcc9375c8d7be29
Author: Simon Howard <fraggle at gmail.com>
Date:   Sat Oct 15 15:59:14 2005 +0000

    Map mouse buttons correctly.
    
    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 195
---
 NEWS          |  1 +
 src/i_video.c | 15 +++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index f6acd64..d7e1d76 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@
      * Doom 1 skies always using Episode 1 sky
      * Crash when switching applications while running fullscreen
      * Lost soul bounce logic (do not bounce in Registered/Shareware)
+     * Mouse buttons mapped incorrectly (button 1 is right, 2 is middle)
 
 0.1.0 (2005-10-09):
     Dehacked support
diff --git a/src/i_video.c b/src/i_video.c
index 62e9c4f..d6acc87 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: i_video.c 193 2005-10-15 15:45:03Z fraggle $
+// $Id: i_video.c 195 2005-10-15 15:59:14Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.37  2005/10/15 15:59:14  fraggle
+// Map mouse buttons correctly.
+//
 // Revision 1.36  2005/10/15 15:45:03  fraggle
 // Check the return code from SDL_LockSurface to ensure a surface has been
 // properly locked.  Fixes crash when switching applications while running
@@ -152,7 +155,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: i_video.c 193 2005-10-15 15:45:03Z fraggle $";
+rcsid[] = "$Id: i_video.c 195 2005-10-15 15:59:14Z fraggle $";
 
 #include <SDL.h>
 #include <ctype.h>
@@ -406,11 +409,15 @@ static int MouseButtonState(void)
     Uint8 state = SDL_GetMouseState(NULL, NULL);
     int result = 0;
 
+    // Note: button "0" is left, button "1" is right,
+    // button "2" is middle for Doom.  This is different
+    // to how SDL sees things.
+
     if (state & SDL_BUTTON(1))
         result |= 1;
-    if (state & SDL_BUTTON(2))
-        result |= 2;
     if (state & SDL_BUTTON(3))
+        result |= 2;
+    if (state & SDL_BUTTON(2))
         result |= 4;
 
     return result;

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



More information about the Pkg-games-commits mailing list