Working on support for various controllers
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
#include "input.h"
|
||||
//#include <stdio.h>
|
||||
#include <iostream>
|
||||
|
||||
// Contestar cuantos joystics ha detectado
|
||||
// Preguntarlepor los joystics que ha encontrado para ir poniendolos en la variable de opciones
|
||||
|
||||
|
||||
|
||||
// Constructor
|
||||
Input::Input(std::string file)
|
||||
{
|
||||
@@ -24,9 +28,6 @@ Input::Input(std::string file)
|
||||
// Destructor
|
||||
Input::~Input()
|
||||
{
|
||||
//SDL_GameControllerClose(mGameController);
|
||||
//if (mGameController)
|
||||
//mGameController = nullptr;
|
||||
for (int i = 0; i < mNumGamepads; i++)
|
||||
mConnectedControllers[i] = nullptr;
|
||||
}
|
||||
@@ -49,6 +50,9 @@ bool Input::checkInput(Uint8 input, bool repeat, int device, int index)
|
||||
bool successKeyboard = false;
|
||||
bool successGameController = false;
|
||||
|
||||
if (device == INPUT_USE_ANY)
|
||||
index = 0;
|
||||
|
||||
if ((device == INPUT_USE_KEYBOARD) || (device == INPUT_USE_ANY))
|
||||
{
|
||||
const Uint8 *mKeystates = SDL_GetKeyboardState(NULL);
|
||||
|
||||
Reference in New Issue
Block a user