canvi de pc

This commit is contained in:
2025-07-30 14:03:44 +02:00
parent 12ec55308e
commit dbecd9a22b
10 changed files with 189 additions and 276 deletions

View File

@@ -3,6 +3,7 @@
#include <SDL3/SDL.h> // Para SDL_GamepadButton, SDL_ScaleMode
#include <algorithm> // Para copy
#include <array> // Para array
#include <string> // Para allocator, string
#include <vector> // Para vector
@@ -83,14 +84,14 @@ struct SettingsOptions {
// Reinicia las últimas entradas de puntuación
void clearLastHiScoreEntries() {
last_hi_score_entry[0] = INVALID_INDEX;
last_hi_score_entry[1] = INVALID_INDEX;
last_hi_score_entry.at(0) = INVALID_INDEX;
last_hi_score_entry.at(1) = INVALID_INDEX;
}
};
// --- Opciones de mando ---
struct GamepadOptions {
int index; // Índice en el vector de mandos
Input::Gamepad gamepad; // Mando
int player_id; // Jugador asociado al mando
Input::Device type{Input::Device::CONTROLLER}; // Indica si se usará teclado, mando o ambos
std::string name; // Nombre del dispositivo
@@ -100,7 +101,7 @@ struct GamepadOptions {
// Constructor por defecto
GamepadOptions()
: index(INVALID_INDEX),
: gamepad(nullptr),
player_id(INVALID_INDEX),
inputs{
Input::Action::FIRE_LEFT,
@@ -114,6 +115,23 @@ struct GamepadOptions {
SDL_GAMEPAD_BUTTON_EAST,
SDL_GAMEPAD_BUTTON_START,
SDL_GAMEPAD_BUTTON_BACK} {}
// Constructor con player_id
GamepadOptions(int custom_player_id)
: gamepad(nullptr),
player_id(custom_player_id),
inputs{
Input::Action::FIRE_LEFT,
Input::Action::FIRE_CENTER,
Input::Action::FIRE_RIGHT,
Input::Action::START,
Input::Action::SERVICE},
buttons{
SDL_GAMEPAD_BUTTON_WEST,
SDL_GAMEPAD_BUTTON_NORTH,
SDL_GAMEPAD_BUTTON_EAST,
SDL_GAMEPAD_BUTTON_START,
SDL_GAMEPAD_BUTTON_BACK} {}
};
// --- Opciones pendientes de aplicar ---