Arreglos en la estructura i format del codi
This commit is contained in:
@@ -15,31 +15,31 @@ constexpr int INPUT_USE_KEYBOARD = 0;
|
||||
constexpr int INPUT_USE_GAMECONTROLLER = 1;
|
||||
constexpr int INPUT_USE_ANY = 2;
|
||||
|
||||
enum inputs_e
|
||||
enum class InputAction
|
||||
{
|
||||
// Inputs obligatorios
|
||||
input_null,
|
||||
input_up,
|
||||
input_down,
|
||||
input_left,
|
||||
input_right,
|
||||
input_pause,
|
||||
input_exit,
|
||||
input_accept,
|
||||
input_cancel,
|
||||
NONE,
|
||||
UP,
|
||||
DOWN,
|
||||
LEFT,
|
||||
RIGHT,
|
||||
PAUSE,
|
||||
EXIT,
|
||||
ACCEPT,
|
||||
CANCEL,
|
||||
|
||||
// Inputs personalizados
|
||||
input_jump,
|
||||
input_window_inc_size,
|
||||
input_window_dec_size,
|
||||
input_toggle_videomode,
|
||||
input_toggle_border,
|
||||
input_toggle_music,
|
||||
input_toggle_palette,
|
||||
input_toggle_shaders,
|
||||
JUMP,
|
||||
WINDOW_INC_ZOOM,
|
||||
WINDOW_DEC_ZOOM,
|
||||
TOGGLE_VIDEOMODE,
|
||||
TOGGLE_BORDER,
|
||||
TOGGLE_MUSIC,
|
||||
TOGGLE_PALETTE,
|
||||
TOGGLE_SHADERS,
|
||||
|
||||
// Input obligatorio
|
||||
input_number_of_inputs
|
||||
SIZE
|
||||
};
|
||||
|
||||
enum i_disable_e
|
||||
@@ -100,13 +100,13 @@ public:
|
||||
void update();
|
||||
|
||||
// Asigna inputs a teclas
|
||||
void bindKey(Uint8 input, SDL_Scancode code);
|
||||
void bindKey(InputAction input, SDL_Scancode code);
|
||||
|
||||
// Asigna inputs a botones del mando
|
||||
void bindGameControllerButton(Uint8 input, SDL_GameControllerButton button);
|
||||
void bindGameControllerButton(InputAction input, SDL_GameControllerButton button);
|
||||
|
||||
// Comprueba si un input esta activo
|
||||
bool checkInput(Uint8 input, bool repeat = true, int device = INPUT_USE_ANY, int index = 0);
|
||||
bool checkInput(InputAction input, bool repeat = true, int device = INPUT_USE_ANY, int index = 0);
|
||||
|
||||
// Comprueba si hay almenos un input activo
|
||||
bool checkAnyInput(int device = INPUT_USE_ANY, int index = 0);
|
||||
|
||||
Reference in New Issue
Block a user