Working on support for various controllers
This commit is contained in:
@@ -13,13 +13,13 @@ Game::Game(int numPlayers, SDL_Renderer *renderer, std::string *filelist, Lang *
|
||||
mLang = lang;
|
||||
mInput = input;
|
||||
mOptions = options;
|
||||
mOnePlayerControl = mOptions->input[0];
|
||||
mOnePlayerControl = mOptions->input[0].deviceType;
|
||||
|
||||
// Pasa variables
|
||||
mDemo.enabled = demo;
|
||||
mNumPlayers = numPlayers;
|
||||
if (mNumPlayers == 1)
|
||||
mOptions->input[0] = INPUT_USE_ANY;
|
||||
mOptions->input[0].deviceType = INPUT_USE_ANY;
|
||||
mDifficulty = mOptions->difficulty;
|
||||
|
||||
// Crea los objetos
|
||||
@@ -93,7 +93,7 @@ Game::~Game()
|
||||
saveScoreFile();
|
||||
saveDemoFile();
|
||||
|
||||
mOptions->input[0] = mOnePlayerControl;
|
||||
mOptions->input[0].deviceType = mOnePlayerControl;
|
||||
|
||||
mRenderer = nullptr;
|
||||
mFileList = nullptr;
|
||||
@@ -2861,7 +2861,7 @@ void Game::checkGameInput()
|
||||
if (mPlayer[i]->isAlive())
|
||||
{
|
||||
// Input a la izquierda
|
||||
if (mInput->checkInput(INPUT_LEFT, REPEAT_TRUE, mOptions->input[i]))
|
||||
if (mInput->checkInput(INPUT_LEFT, REPEAT_TRUE, mOptions->input[i].deviceType))
|
||||
{
|
||||
mPlayer[i]->setInput(INPUT_LEFT);
|
||||
mDemo.keys.left = 1;
|
||||
@@ -2869,7 +2869,7 @@ void Game::checkGameInput()
|
||||
else
|
||||
{
|
||||
// Input a la derecha
|
||||
if (mInput->checkInput(INPUT_RIGHT, REPEAT_TRUE, mOptions->input[i]))
|
||||
if (mInput->checkInput(INPUT_RIGHT, REPEAT_TRUE, mOptions->input[i].deviceType))
|
||||
{
|
||||
mPlayer[i]->setInput(INPUT_RIGHT);
|
||||
mDemo.keys.right = 1;
|
||||
@@ -2882,7 +2882,7 @@ void Game::checkGameInput()
|
||||
}
|
||||
}
|
||||
// Comprueba el input de disparar al centro
|
||||
if (mInput->checkInput(INPUT_BUTTON_2, REPEAT_TRUE, mOptions->input[i]))
|
||||
if (mInput->checkInput(INPUT_BUTTON_2, REPEAT_TRUE, mOptions->input[i].deviceType))
|
||||
{
|
||||
if (mPlayer[i]->canFire())
|
||||
{
|
||||
@@ -2898,7 +2898,7 @@ void Game::checkGameInput()
|
||||
}
|
||||
|
||||
// Comprueba el input de disparar a la izquierda
|
||||
if (mInput->checkInput(INPUT_BUTTON_1, REPEAT_TRUE, mOptions->input[i]))
|
||||
if (mInput->checkInput(INPUT_BUTTON_1, REPEAT_TRUE, mOptions->input[i].deviceType))
|
||||
{
|
||||
if (mPlayer[i]->canFire())
|
||||
{
|
||||
@@ -2914,7 +2914,7 @@ void Game::checkGameInput()
|
||||
}
|
||||
|
||||
// Comprueba el input de disparar a la derecha
|
||||
if (mInput->checkInput(INPUT_BUTTON_3, REPEAT_TRUE, mOptions->input[i]))
|
||||
if (mInput->checkInput(INPUT_BUTTON_3, REPEAT_TRUE, mOptions->input[i].deviceType))
|
||||
{
|
||||
if (mPlayer[i]->canFire())
|
||||
{
|
||||
@@ -2930,7 +2930,7 @@ void Game::checkGameInput()
|
||||
}
|
||||
|
||||
// Comprueba el input de pausa
|
||||
if (mInput->checkInput(INPUT_CANCEL, REPEAT_FALSE, mOptions->input[i]))
|
||||
if (mInput->checkInput(INPUT_CANCEL, REPEAT_FALSE, mOptions->input[i].deviceType))
|
||||
{
|
||||
mSection.subsection = GAME_SECTION_PAUSE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user