Mapeados los jugadores a los dos mandos

This commit is contained in:
2024-06-30 14:07:07 +02:00
parent 097320cff7
commit 1754cfb93a
8 changed files with 47 additions and 163 deletions

View File

@@ -87,6 +87,7 @@ void Director::initInput()
{
// Establece si ha de mostrar mensajes
input->setVerbose(options->console);
input->setVerbose(true);
// Busca si hay un mando conectado
input->discoverGameController();
@@ -117,18 +118,27 @@ void Director::initInput()
input->bindGameControllerButton(input_right, SDL_CONTROLLER_BUTTON_DPAD_RIGHT);
input->bindGameControllerButton(input_fire_left, SDL_CONTROLLER_BUTTON_X);
input->bindGameControllerButton(input_fire_center, SDL_CONTROLLER_BUTTON_Y);
input->bindGameControllerButton(input_fire_right, SDL_CONTROLLER_BUTTON_B);
input->bindGameControllerButton(input_fire_right, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER);
// Mando - Otros
input->bindGameControllerButton(input_accept, SDL_CONTROLLER_BUTTON_B);
input->bindGameControllerButton(input_cancel, SDL_CONTROLLER_BUTTON_A);
#ifdef GAME_CONSOLE
input->bindGameControllerButton(input_pause, SDL_CONTROLLER_BUTTON_BACK);
input->bindGameControllerButton(input_exit, SDL_CONTROLLER_BUTTON_START);
#else
input->bindGameControllerButton(input_pause, SDL_CONTROLLER_BUTTON_START);
input->bindGameControllerButton(input_exit, SDL_CONTROLLER_BUTTON_BACK);
#endif
// Pone valores por defecto a las opciones de control
options->game.input.clear();
input_t i;
i.id = 0;
i.name = "MANDO 1";
i.deviceType = INPUT_USE_ANY;
options->game.input.push_back(i);
i.id = 1;
i.name = "MANDO 2";
i.deviceType = INPUT_USE_GAMECONTROLLER;
options->game.input.push_back(i);
}
// Inicializa JailAudio
@@ -402,11 +412,11 @@ void Director::initOptions()
input_t inp;
inp.id = 0;
inp.name = "KEYBOARD";
inp.deviceType = INPUT_USE_KEYBOARD;
inp.name = "GAME CONTROLLER";
inp.deviceType = INPUT_USE_GAMECONTROLLER;
options->game.input.push_back(inp);
inp.id = 0;
inp.id = 1;
inp.name = "GAME CONTROLLER";
inp.deviceType = INPUT_USE_GAMECONTROLLER;
options->game.input.push_back(inp);
@@ -414,8 +424,6 @@ void Director::initOptions()
// Opciones de video
options->video.mode = 0;
options->video.window.size = 3;
// options->video.window.width = options->video.window.size * param->gameWidth;
// options->video.window.height = options->video.window.size * param->gameHeight;
options->video.filter = FILTER_NEAREST;
options->video.vSync = true;
options->video.integerScale = true;