presets en yaml

This commit is contained in:
2026-04-17 19:56:43 +02:00
parent 7f703390f9
commit 5889df2a47
13 changed files with 519 additions and 161 deletions

View File

@@ -0,0 +1,42 @@
#include "core/input/global_inputs.hpp"
#include "core/input/input.h"
#include "core/rendering/screen.h"
namespace GlobalInputs {
auto handle(Screen *screen, Input *input) -> bool {
if (screen == nullptr || input == nullptr) { return false; }
if (input->checkInput(input_window_fullscreen, REPEAT_FALSE)) {
screen->toggleVideoMode();
return true;
}
if (input->checkInput(input_window_dec_size, REPEAT_FALSE)) {
screen->decWindowZoom();
return true;
}
if (input->checkInput(input_window_inc_size, REPEAT_FALSE)) {
screen->incWindowZoom();
return true;
}
if (input->checkInput(input_prev_preset, REPEAT_FALSE)) {
screen->prevPreset();
return true;
}
if (input->checkInput(input_next_preset, REPEAT_FALSE)) {
screen->nextPreset();
return true;
}
if (input->checkInput(input_toggle_shader, REPEAT_FALSE)) {
screen->toggleShaderEnabled();
return true;
}
if (input->checkInput(input_toggle_shader_type, REPEAT_FALSE)) {
screen->toggleActiveShader();
return true;
}
return false;
}
} // namespace GlobalInputs

View File

@@ -0,0 +1,13 @@
#pragma once
class Input;
class Screen;
namespace GlobalInputs {
// Gestiona els atalls globals disponibles en qualsevol escena: zoom de
// finestra (F1/F2), fullscreen (F3), presets de shader (F8/F9), toggle
// shader (F10) i tipus de shader POSTFX↔CRTPI (F11). Retorna true si ha
// consumit alguna tecla (per si la capa cridant vol suprimir-la del
// processament específic de l'escena).
auto handle(Screen *screen, Input *input) -> bool;
} // namespace GlobalInputs

View File

@@ -35,7 +35,8 @@ enum inputs_e {
input_window_dec_size,
// GPU / shaders (hotkeys provisionales hasta que haya menú de opciones)
input_toggle_gpu,
input_prev_preset,
input_next_preset,
input_toggle_shader,
input_toggle_shader_type,