]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/hub.cpp
Fix building pak.exe.
[quix0rs-blobwars.git] / src / hub.cpp
index 859c23cc83d331da814f83391b0e56b6f2ca420a..165c91897beed4a6728a1876a503aee804c064cb 100644 (file)
@@ -1,5 +1,6 @@
 /*
 Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -598,9 +599,6 @@ int doHub()
        Uint32 frameLimit = SDL_GetTicks() + 16;
        Uint32 now = SDL_GetTicks();
        
-       int mouseXDelta = 0;
-       int mouseYDelta = 0;
-
        while (rtn == -1)
        {
                graphics.updateScreen();
@@ -626,31 +624,32 @@ int doHub()
                engine.getInput();
                config.populate();
                
+               int mouseXDelta = 0;
+               int mouseYDelta = 0;
+
                if (config.isControl(CONTROL::RIGHT))
                {
-                       mouseXDelta = 5;
+                       mouseXDelta += 5;
                }
                
                if (config.isControl(CONTROL::LEFT))
                {
-                       mouseXDelta = -5;
+                       mouseXDelta -= 5;
                }
                
                if (config.isControl(CONTROL::DOWN))
                {
-                       mouseYDelta = 5;
+                       mouseYDelta += 5;
                }
                
                if (config.isControl(CONTROL::UP) || config.isControl(CONTROL::JUMP))
                {
-                       mouseYDelta = -5;
+                       mouseYDelta -= 5;
                }
 
                if ((mouseXDelta != 0) || (mouseYDelta != 0))
                {
-                       engine.setMouse(engine.getMouseX() + (int)mouseXDelta, engine.getMouseY() + (int)mouseYDelta);
-                       mouseXDelta = 0;
-                       mouseYDelta = 0;
+                       engine.moveMouse(mouseXDelta, mouseYDelta);
                }
 
                hubPoint = (HubLevel*)hubList.getHead();