This commit is contained in:
2024-09-16 22:21:57 +02:00
parent 80425a5ed0
commit 159a75a60e
12 changed files with 384 additions and 307 deletions

View File

@@ -7,7 +7,6 @@
#include "jshader.h"
#endif
#include "dbgtxt.h"
#include "../service.h"
// Constructor
Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, Input *input, options_t *options)
@@ -320,47 +319,63 @@ void Screen::update()
void Screen::checkInput()
{
#ifndef ARCADE
if (input->checkInput(input_window_fullscreen, INPUT_DO_NOT_ALLOW_REPEAT))
// Comprueba el teclado para cambiar entre pantalla completa y ventana
if (input->checkInput(input_window_fullscreen, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
{
switchVideoMode();
const std::string mode = options->video.mode == SCREEN_VIDEO_MODE_WINDOW ? "Window" : "Fullscreen";
showNotification(mode + " mode");
return;
}
else if (input->checkInput(input_window_dec_size, INPUT_DO_NOT_ALLOW_REPEAT))
// Comprueba el teclado para decrementar el tamaño de la ventana
if (input->checkInput(input_window_dec_size, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
{
decWindowSize();
const std::string size = std::to_string(options->video.window.size);
showNotification("Window size x" + size);
return;
}
else if (input->checkInput(input_window_inc_size, INPUT_DO_NOT_ALLOW_REPEAT))
// Comprueba el teclado para incrementar el tamaño de la ventana
if (input->checkInput(input_window_inc_size, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
{
incWindowSize();
const std::string size = std::to_string(options->video.window.size);
showNotification("Window size x" + size);
return;
}
#endif
if (input->checkInput(input_video_shaders, INPUT_DO_NOT_ALLOW_REPEAT))
// Comprueba el teclado para activar o desactivar los shaders
if (input->checkInput(input_video_shaders, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
{
switchShaders();
return;
}
else if (input->checkInput(input_showinfo, INPUT_DO_NOT_ALLOW_REPEAT))
// Comprueba el teclado para mostrar la información de debug
if (input->checkInput(input_showinfo, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
{
showInfo = !showInfo;
return;
}
// Comprueba el botón de SERVICE
switch (checkServiceButton(input))
for (int i = 0; i < input->getNumControllers(); ++i)
{
case SERVICE_SHADERS:
switchShaders();
break;
// Comprueba los mandos para activar o desactivar los shaders
if (input->checkModInput(input_service, input_video_shaders, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
{
switchShaders();
return;
}
default:
break;
// Comprueba los mandos para mostrar la información de debug
if (input->checkModInput(input_service, input_showinfo, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
{
showInfo = !showInfo;
return;
}
}
}