added gamecontrollerdb.txt
This commit is contained in:
@@ -40,7 +40,7 @@ Director::Director(std::string path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Crea los objetos
|
// Crea los objetos
|
||||||
mInput = new Input();
|
mInput = new Input(mFileList[52]);
|
||||||
//mInput2 = new Input(mOptions->input[1]);
|
//mInput2 = new Input(mOptions->input[1]);
|
||||||
//mInput[0] = new Input(INPUT_USE_KEYBOARD);
|
//mInput[0] = new Input(INPUT_USE_KEYBOARD);
|
||||||
//mInput[1] = new Input(INPUT_USE_GAMECONTROLLER);
|
//mInput[1] = new Input(INPUT_USE_GAMECONTROLLER);
|
||||||
@@ -269,6 +269,9 @@ void Director::setFileList()
|
|||||||
mFileList[49] = mExecutablePath + "/" + "../media/lang/es_ES.txt";
|
mFileList[49] = mExecutablePath + "/" + "../media/lang/es_ES.txt";
|
||||||
mFileList[50] = mExecutablePath + "/" + "../media/lang/en_UK.txt";
|
mFileList[50] = mExecutablePath + "/" + "../media/lang/en_UK.txt";
|
||||||
mFileList[51] = mExecutablePath + "/" + "../media/lang/ba_BA.txt";
|
mFileList[51] = mExecutablePath + "/" + "../media/lang/ba_BA.txt";
|
||||||
|
|
||||||
|
// DATA
|
||||||
|
mFileList[52] = mExecutablePath + "/" + "../media/data/gamecontrollerdb.txt";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comprueba los ficheros del vector de ficheros que coinciden con una ruta dada
|
// Comprueba los ficheros del vector de ficheros que coinciden con una ruta dada
|
||||||
|
|||||||
@@ -3,8 +3,11 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Input::Input()
|
Input::Input(std::string file)
|
||||||
{
|
{
|
||||||
|
// Fichero gamecontrollerdb.txt
|
||||||
|
mDBpath = file;
|
||||||
|
|
||||||
// Inicializa las variables
|
// Inicializa las variables
|
||||||
for (int i = 0; i < 17; i++)
|
for (int i = 0; i < 17; i++)
|
||||||
{
|
{
|
||||||
@@ -167,6 +170,7 @@ bool Input::discoverGameController()
|
|||||||
|
|
||||||
mGameController = mConnectedControllers[0];
|
mGameController = mConnectedControllers[0];
|
||||||
SDL_GameControllerEventState(SDL_ENABLE);
|
SDL_GameControllerEventState(SDL_ENABLE);
|
||||||
|
SDL_GameControllerAddMappingsFromFile(mDBpath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
|
|||||||
@@ -53,13 +53,14 @@ private:
|
|||||||
std::vector<SDL_GameController*> mConnectedControllers;
|
std::vector<SDL_GameController*> mConnectedControllers;
|
||||||
std::vector<std::string> mControllerNames;
|
std::vector<std::string> mControllerNames;
|
||||||
int mNumGamepads;
|
int mNumGamepads;
|
||||||
|
std::string mDBpath; // Ruta al archivo gamecontrollerdb.txt
|
||||||
|
|
||||||
// Comprueba si hay un mando conectado
|
// Comprueba si hay un mando conectado
|
||||||
bool discoverGameController();
|
bool discoverGameController();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
Input();
|
Input(std::string file);
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~Input();
|
~Input();
|
||||||
|
|||||||
@@ -532,7 +532,7 @@ Uint16 Menu::findHeight()
|
|||||||
for (int i = 0; i < mTotalItems; i++)
|
for (int i = 0; i < mTotalItems; i++)
|
||||||
height += mItem[i].rect.h + mItem[i].hPaddingDown;
|
height += mItem[i].rect.h + mItem[i].hPaddingDown;
|
||||||
|
|
||||||
return height;
|
return height - mItem[mTotalItems - 1].hPaddingDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recoloca los elementos del menu en el eje Y
|
// Recoloca los elementos del menu en el eje Y
|
||||||
|
|||||||
Reference in New Issue
Block a user