Varios arreglos

This commit is contained in:
2024-11-03 20:28:01 +01:00
parent f29eb2f411
commit 371c477d0d
18 changed files with 168 additions and 202 deletions

View File

@@ -1,18 +1,16 @@
#pragma once
#include <SDL2/SDL_gamecontroller.h> // Para SDL_GameControllerButton
#include <SDL2/SDL_stdinc.h> // Para Uint8
#include "manage_hiscore_table.h"
#include <vector> // Para vector
#include "input.h"
#include <string>
enum class InputType : int;
enum class ScreenFilter : int;
enum class ScreenVideoMode : int;
#include <SDL2/SDL_gamecontroller.h> // Para SDL_CONTROLLER_BUTTON_B, SDL_CO...
#include <string> // Para string
#include <vector> // Para vector
#include "input.h" // Para InputType, InputDeviceToUse
#include "manage_hiscore_table.h" // Para HiScoreEntry
enum class ScreenFilter : int; // lines 10-10
enum class ScreenVideoMode : int; // lines 11-11
namespace lang
{
enum class Code : int;
}
} // lines 14-14
// Dificultad del juego
enum class GameDifficulty
@@ -76,7 +74,7 @@ struct OptionsController
{
int index; // Indice en el vector de mandos
int player_id; // Jugador asociado al mando
InputDeviceToUse type; // Indica si se utilizará teclado o mando o ambos
InputDeviceToUse type; // Indica si se utilizará teclado o mando o ambos
std::string name; // Nombre del dispositivo
bool plugged; // Indica si el mando se encuentra conectado
std::vector<InputType> inputs; // Listado de inputs
@@ -84,11 +82,9 @@ struct OptionsController
// Constructor por defecto
OptionsController()
: index(-1), player_id(-1), type(InputDeviceToUse::CONTROLLER), name(""), plugged(false)
{
inputs = {InputType::FIRE_LEFT, InputType::FIRE_CENTER, InputType::FIRE_RIGHT, InputType::START, InputType::SERVICE};
buttons = {SDL_CONTROLLER_BUTTON_X, SDL_CONTROLLER_BUTTON_Y, SDL_CONTROLLER_BUTTON_B, SDL_CONTROLLER_BUTTON_START, SDL_CONTROLLER_BUTTON_BACK};
}
: index(-1), player_id(-1), type(InputDeviceToUse::CONTROLLER), name(""), plugged(false),
inputs{InputType::FIRE_LEFT, InputType::FIRE_CENTER, InputType::FIRE_RIGHT, InputType::START, InputType::SERVICE},
buttons{SDL_CONTROLLER_BUTTON_X, SDL_CONTROLLER_BUTTON_Y, SDL_CONTROLLER_BUTTON_B, SDL_CONTROLLER_BUTTON_START, SDL_CONTROLLER_BUTTON_BACK} {}
};
// Estructura con todas las opciones de configuración del programa