]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/hub.cpp
Fix building pak.exe.
[quix0rs-blobwars.git] / src / hub.cpp
index 4233fa98cdd2887322a621f8937f28b766f505fc..165c91897beed4a6728a1876a503aee804c064cb 100644 (file)
@@ -1,5 +1,6 @@
 /*
-Copyright (C) 2004 Parallel Realities
+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
@@ -443,7 +444,7 @@ int doHub()
        audio.loadMusic("music/hub");
        
        // we might want this now, for medals
-       audio.loadSound(SND_ITEM, "sound/item.wav");
+       audio.loadSound(SND_ITEM, "sound/item");
        
        graphics.quickSprite("cheatHeader", graphics.loadImage("gfx/main/cheats.png"));
        graphics.quickSprite("optionsHeader", graphics.loadImage("gfx/main/options.png"));
@@ -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();
@@ -742,7 +741,7 @@ int doHub()
                // Collisions for Panel Buttons
                if ((showMIAs) || (showStats))
                {
-                   // SDLK_LCTRL is the "fire" button.
+                   // SDL_SCANCODE_LCTRL is the "fire" button.
                        if (engine.mouseLeft || config.isControl(CONTROL::FIRE))
                        {
                                if (Collision::collision(engine.getMouseX(), engine.getMouseY(), 1, 1, 270, 310, 32, 32))