Procházet zdrojové kódy

delete useless include and open joystick in InputSourceGameController constructor.

kdmcser před 1 rokem
rodič
revize
876bae0b73

+ 1 - 0
client/eventsSDL/GameControllerShortcuts.cpp

@@ -7,6 +7,7 @@
 * Full text of license available in license.txt file, in main folder
 *
 */
+#include <SDL.h>
 
 #include "StdInc.h"
 #include "GameControllerShortcuts.h"

+ 0 - 2
client/eventsSDL/GameControllerShortcuts.h

@@ -10,8 +10,6 @@
 
 #pragma once
 
-#include <map>
-#include <SDL.h>
 #include "../gui/Shortcut.h"
 
 using ButtonShortcutsMap = std::map<int, std::vector<EShortcut> >;

+ 0 - 5
client/eventsSDL/InputHandler.cpp

@@ -349,8 +349,3 @@ const Point & InputHandler::getCursorPosition() const
 {
 	return cursorPosition;
 }
-
-void InputHandler::tryOpenGameController()
-{
-    gameControllerHandler->tryOpenAllGameControllers();
-}

+ 0 - 2
client/eventsSDL/InputHandler.h

@@ -87,6 +87,4 @@ public:
 	bool isKeyboardCtrlDown() const;
 	bool isKeyboardShiftDown() const;
 
-    /// If any game controller available, use it.
-    void tryOpenGameController();
 };

+ 1 - 1
client/eventsSDL/InputSourceGameController.cpp

@@ -34,7 +34,7 @@ InputSourceGameController::InputSourceGameController():
     planDisX(0.0),
     planDisY(0.0)
 {
-    // SDL_init has not been called. so it is unnecessary to open joystick.
+    tryOpenAllGameControllers();
 }
 
 void InputSourceGameController::tryOpenAllGameControllers()

+ 0 - 2
client/eventsSDL/InputSourceGameController.h

@@ -10,10 +10,8 @@
 
 #pragma once
 
-#include <memory>
 #include <SDL.h>
 
-#include "../../lib/Point.h"
 #include "../gui/Shortcut.h"
 
 

+ 0 - 3
client/gui/CGuiHandler.cpp

@@ -79,9 +79,6 @@ void CGuiHandler::init()
 	inputHandlerInstance = std::make_unique<InputHandler>(); // Must be after windowHandlerInstance
 	shortcutsHandlerInstance = std::make_unique<ShortcutHandler>();
 	framerateManagerInstance = std::make_unique<FramerateManager>(settings["video"]["targetfps"].Integer());
-
-    // This must be called after SDL_init(), so put after screenHandlerInstance init.
-    inputHandlerInstance->tryOpenGameController();
 }
 
 void CGuiHandler::handleEvents()