diff --git a/data/config/param.txt b/data/config/param.txt index ce1f177..9753314 100644 --- a/data/config/param.txt +++ b/data/config/param.txt @@ -2,7 +2,6 @@ gameWidth 320 gameHeight 240 itemSize 20 -autofire true ## FADE numSquaresWidth 160 diff --git a/source/common/utils.h b/source/common/utils.h index 711679e..7156eff 100644 --- a/source/common/utils.h +++ b/source/common/utils.h @@ -135,7 +135,7 @@ struct op_game_t { Uint8 difficulty; // Dificultad del juego Uint8 language; // Idioma usado en el juego - bool autofire; // Indica si se va a usar el disparo automático para el disparo normal + bool autofire; // Indica si el jugador ha de pulsar repetidamente para disparar o basta con mantener pulsado std::vector hiScoreTable; // Tabla con las mejores puntuaciones }; @@ -183,7 +183,6 @@ struct param_t int gameWidth; // Ancho de la resolucion nativa del juego int gameHeight; // Alto de la resolucion nativa del juego int itemSize; // Tamaño de los items del juego - int autofire; // Indica si se va a usar el disparo automático para el disparo normal // FADE int numSquaresWidth; // Cantidad total de cuadraditos en horizontal para el FADE_RANDOM_SQUARE diff --git a/source/director.cpp b/source/director.cpp index dfcdc82..6f43459 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -152,7 +152,7 @@ void Director::initInput() // Mando - Otros input->bindGameControllerButton(i, input_accept, SDL_CONTROLLER_BUTTON_START); input->bindGameControllerButton(i, input_cancel, SDL_CONTROLLER_BUTTON_A); - //input->bindGameControllerButton(i, input_pause, SDL_CONTROLLER_BUTTON_B); + // input->bindGameControllerButton(i, input_pause, SDL_CONTROLLER_BUTTON_B); input->bindGameControllerButton(i, input_exit, SDL_CONTROLLER_BUTTON_BACK); } @@ -427,7 +427,6 @@ void Director::loadParams() loadParam(param, asset->get("param.txt")); // Modifica las opciones desde el fichero de parametros - options->game.autofire = param->autofire; options->video.window.width = options->video.window.size * param->gameWidth; options->video.window.height = options->video.window.size * param->gameHeight; options->video.gameWidth = param->gameWidth; @@ -473,6 +472,7 @@ void Director::initOptions() // Opciones de juego options->game.difficulty = DIFFICULTY_NORMAL; options->game.language = ba_BA; + options->game.autofire = true; // Opciones de control options->controller.clear(); @@ -736,6 +736,7 @@ bool Director::saveConfigFile() file << "game.language=" + std::to_string(options->game.language) + "\n"; file << "game.difficulty=" + std::to_string(options->game.difficulty) + "\n"; + file << "game.autofire=" + boolToString(options->game.autofire) + "\n"; // Opciones de mandos file << "\n\n## CONTROLLERS\n"; @@ -1021,6 +1022,11 @@ bool Director::setOptions(options_t *options, std::string var, std::string value options->game.difficulty = std::stoi(value); } + else if (var == "game.autofire") + { + options->game.autofire = stringToBool(value); + } + // Opciones de mandos else if (var == "controller1.name") { diff --git a/source/load_param.cpp b/source/load_param.cpp index 42a2a7d..5fdeef6 100644 --- a/source/load_param.cpp +++ b/source/load_param.cpp @@ -12,7 +12,6 @@ void initParam(param_t *param) param->gameWidth = 320; param->gameHeight = 240; param->itemSize = 20; - param->autofire = true; // SCOREBOARD param->scoreboard = {0, 200, 320, 40}; @@ -155,11 +154,6 @@ bool setOptions(param_t *param, std::string var, std::string value) param->itemSize = std::stoi(value); } - else if (var == "autofire") - { - param->autofire = stringToBool(value); - } - // FADE else if (var == "numSquaresWidth") {