#include "global_inputs.h" #include // for basic_string #include // for vector #include "input.h" // for Input, REPEAT_FALSE, inputs_e #include "notifier.h" // for Notifier #include "options.h" // for Section, Options, options, SectionState, Optio... #include "screen.h" // for Screen #include "utils.h" // for Palette namespace globalInputs { // Cambia la paleta void switchPalette() { options.video.palette = options.video.palette == Palette::ZXSPECTRUM ? Palette::ZXARNE : Palette::ZXSPECTRUM; } // Cambia de seccion void skip_section() { switch (options.section.section) { case Section::LOGO: case Section::LOADING_SCREEN: case Section::CREDITS: case Section::DEMO: case Section::GAME_OVER: case Section::ENDING: case Section::ENDING2: options.section.section = Section::TITLE; options.section.subsection = Subsection::NONE; break; default: break; } } // Comprueba los inputs que se pueden introducir en cualquier sección del juego void check() { if (Input::get()->checkInput(input_exit, REPEAT_FALSE)) { options.section.section = Section::QUIT; } else if (Input::get()->checkInput(input_accept, REPEAT_FALSE)) { skip_section(); } else if (Input::get()->checkInput(input_toggle_border, REPEAT_FALSE)) { Screen::get()->toggleBorder(); } else if (Input::get()->checkInput(input_toggle_videomode, REPEAT_FALSE)) { Screen::get()->toggleVideoMode(); } else if (Input::get()->checkInput(input_window_dec_size, REPEAT_FALSE)) { Screen::get()->decWindowZoom(); } else if (Input::get()->checkInput(input_window_inc_size, REPEAT_FALSE)) { Screen::get()->incWindowZoom(); } else if (Input::get()->checkInput(input_toggle_shaders, REPEAT_FALSE)) { Screen::get()->toggleShaders(); Notifier::get()->show({"HOLA"}); } else if (Input::get()->checkInput(input_toggle_palette, REPEAT_FALSE)) { switchPalette(); } } }