corregides cridades a SDL3 i migrat casi tot de int a float. Falta jail_shader

This commit is contained in:
2025-10-15 12:16:50 +02:00
parent 7c102e42cc
commit e4a08d2ec7
52 changed files with 879 additions and 823 deletions

View File

@@ -61,19 +61,19 @@ class Input {
};
struct ControllerBindings {
SDL_GameControllerButton button; // GameControllerButton asociado
SDL_GamepadButton button; // GameControllerButton asociado
bool active; // Indica si está activo
bool axis_active; // Estado del eje
// Constructor
explicit ControllerBindings(SDL_GameControllerButton btn = SDL_CONTROLLER_BUTTON_INVALID, bool act = false, bool axis_act = false)
explicit ControllerBindings(SDL_GamepadButton btn = SDL_GAMEPAD_BUTTON_INVALID, bool act = false, bool axis_act = false)
: button(btn),
active(act),
axis_active(axis_act) {}
};
// Variables
std::vector<SDL_GameController*> connected_controllers_; // Vector con todos los mandos conectados
std::vector<SDL_Gamepad*> connected_controllers_; // Vector con todos los mandos conectados
std::vector<SDL_Joystick*> joysticks_; // Vector con todos los joysticks conectados
std::vector<KeyBindings> key_bindings_; // Vector con las teclas asociadas a los inputs predefinidos
std::vector<std::vector<ControllerBindings>> controller_bindings_; // Vector con los botones asociadas a los inputs predefinidos para cada mando
@@ -106,7 +106,7 @@ class Input {
void bindKey(InputAction input, SDL_Scancode code);
// Asigna inputs a botones del mando
void bindGameControllerButton(int controller_index, InputAction input, SDL_GameControllerButton button);
void bindGameControllerButton(int controller_index, InputAction input, SDL_GamepadButton button);
void bindGameControllerButton(int controller_index, InputAction inputTarget, InputAction inputSource);
// Comprueba si un input esta activo
@@ -130,8 +130,8 @@ class Input {
// Obtiene el indice del controlador a partir de un event.id
int getJoyIndex(int id) const;
// Obtiene el SDL_GameControllerButton asignado a un input
SDL_GameControllerButton getControllerBinding(int controller_index, InputAction input) const;
// Obtiene el SDL_GamepadButton asignado a un input
SDL_GamepadButton getControllerBinding(int controller_index, InputAction input) const;
// Obtiene el indice a partir del nombre del mando
int getIndexByName(const std::string& name) const;