commit mañanero de canvi de pc
This commit is contained in:
@@ -73,22 +73,22 @@ class Input {
|
||||
};
|
||||
|
||||
// --- Estructuras ---
|
||||
struct KeyBindings {
|
||||
struct KeyState {
|
||||
Uint8 scancode; // Scancode asociado
|
||||
bool is_held; // Está pulsada ahora mismo
|
||||
bool just_pressed; // Se acaba de pulsar en este fotograma
|
||||
|
||||
KeyBindings(Uint8 scancode = 0, bool is_held = false, bool just_pressed = false)
|
||||
KeyState(Uint8 scancode = 0, bool is_held = false, bool just_pressed = false)
|
||||
: scancode(scancode), is_held(is_held), just_pressed(just_pressed) {}
|
||||
};
|
||||
|
||||
struct ControllerBindings {
|
||||
struct ButtonState {
|
||||
SDL_GamepadButton button; // GameControllerButton asociado
|
||||
bool is_held; // Está pulsada ahora mismo
|
||||
bool just_pressed; // Se acaba de pulsar en este fotograma
|
||||
bool axis_active; // Estado del eje
|
||||
|
||||
ControllerBindings(SDL_GamepadButton btn = SDL_GAMEPAD_BUTTON_INVALID, bool is_held = false, bool just_pressed = false, bool axis_act = false)
|
||||
ButtonState(SDL_GamepadButton btn = SDL_GAMEPAD_BUTTON_INVALID, bool is_held = false, bool just_pressed = false, bool axis_act = false)
|
||||
: button(btn), is_held(is_held), just_pressed(just_pressed), axis_active(axis_act) {}
|
||||
};
|
||||
|
||||
@@ -96,7 +96,7 @@ class Input {
|
||||
SDL_Gamepad *pad;
|
||||
SDL_JoystickID instance_id;
|
||||
std::string name;
|
||||
std::vector<ControllerBindings> bindings;
|
||||
std::vector<ButtonState> button_states;
|
||||
|
||||
Gamepad(SDL_Gamepad *gamepad)
|
||||
: pad(gamepad),
|
||||
@@ -154,7 +154,7 @@ class Input {
|
||||
|
||||
// --- Variables internas ---
|
||||
std::vector<std::shared_ptr<Gamepad>> gamepads_; // Mandos conectados
|
||||
std::vector<KeyBindings> key_bindings_; // Vector con las teclas asociadas a los inputs predefinidos
|
||||
std::vector<KeyState> key_bindings_; // Vector con las teclas asociadas a los inputs predefinidos
|
||||
std::vector<Action> button_inputs_; // Inputs asignados al jugador y a botones, excluyendo direcciones
|
||||
std::string game_controller_db_path_; // Ruta al archivo gamecontrollerdb.txt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user