mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
delete useless include and open joystick in InputSourceGameController constructor.
This commit is contained in:
@ -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"
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <SDL.h>
|
||||
#include "../gui/Shortcut.h"
|
||||
|
||||
using ButtonShortcutsMap = std::map<int, std::vector<EShortcut> >;
|
||||
|
@ -349,8 +349,3 @@ const Point & InputHandler::getCursorPosition() const
|
||||
{
|
||||
return cursorPosition;
|
||||
}
|
||||
|
||||
void InputHandler::tryOpenGameController()
|
||||
{
|
||||
gameControllerHandler->tryOpenAllGameControllers();
|
||||
}
|
@ -87,6 +87,4 @@ public:
|
||||
bool isKeyboardCtrlDown() const;
|
||||
bool isKeyboardShiftDown() const;
|
||||
|
||||
/// If any game controller available, use it.
|
||||
void tryOpenGameController();
|
||||
};
|
||||
|
@ -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()
|
||||
|
@ -10,10 +10,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <SDL.h>
|
||||
|
||||
#include "../../lib/Point.h"
|
||||
#include "../gui/Shortcut.h"
|
||||
|
||||
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user