[colobot] 302/377: Allow both right and middle mouse button for camera movement

Didier Raboud odyx at moszumanska.debian.org
Wed Mar 30 13:34:29 UTC 2016


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

odyx pushed a commit to branch debian/master
in repository colobot.

commit 3de6794835d688053bdcd3490e29e334100df361
Author: krzys-h <krzys_h at interia.pl>
Date:   Fri Feb 19 17:27:55 2016 +0100

    Allow both right and middle mouse button for camera movement
---
 src/graphics/engine/camera.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp
index 43a6820..a8558ce 100644
--- a/src/graphics/engine/camera.cpp
+++ b/src/graphics/engine/camera.cpp
@@ -1089,7 +1089,7 @@ bool CCamera::EventMouseMove(const Event &event)
         m_engine->SetMouseType(ENG_MOUSE_NORM);
     }
 
-    if ((event.mouseButtonsState & MOUSE_BUTTON_RIGHT) != 0)
+    if ((event.mouseButtonsState & MOUSE_BUTTON_RIGHT) != 0 || (event.mouseButtonsState & MOUSE_BUTTON_MIDDLE) != 0)
     {
         Math::Point newDelta = event.mousePos - m_mousePos;
         if (m_cameraInvertX)
@@ -1177,9 +1177,9 @@ void CCamera::EventMouseWheel(const Event &event)
 
 void CCamera::EventMouseButton(const Event &event)
 {
-    if (event.GetData<MouseButtonEventData>()->button == MOUSE_BUTTON_RIGHT)
+    if (event.GetData<MouseButtonEventData>()->button == MOUSE_BUTTON_RIGHT || event.GetData<MouseButtonEventData>()->button == MOUSE_BUTTON_MIDDLE)
     {
-        if (event.type == EVENT_MOUSE_BUTTON_DOWN)
+        if ((event.mouseButtonsState & MOUSE_BUTTON_RIGHT) != 0 || (event.mouseButtonsState & MOUSE_BUTTON_MIDDLE) != 0)
         {
             m_engine->SetMouseType(ENG_MOUSE_MOVE);
         }

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



More information about the Pkg-games-commits mailing list