forked from jaildesigner-jailgames/jaildoctors_dilemma
globalInputs implementat en totes les seccions excepte Title i Game
This commit is contained in:
79
source/global_inputs.cpp
Normal file
79
source/global_inputs.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
#include "global_inputs.h"
|
||||
#include "input.h" // Para Input, InputDeviceToUse, InputType, INPU...
|
||||
#include "notifier.h" // Para Notifier
|
||||
#include "options.h" // Para Options, options, OptionsGame, OptionsAudio
|
||||
#include "screen.h" // Para Screen, ScreenVideoMode
|
||||
|
||||
namespace globalInputs
|
||||
{
|
||||
// Cambia la paleta
|
||||
void switchPalette()
|
||||
{
|
||||
options.palette = options.palette == p_zxspectrum ? p_zxarne : p_zxspectrum;
|
||||
}
|
||||
|
||||
// Cambia de seccion
|
||||
void skip_section()
|
||||
{
|
||||
switch (options.section.name)
|
||||
{
|
||||
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.name = SECTION_TITLE;
|
||||
options.section.subsection = 0;
|
||||
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.name = 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()->decWindowSize();
|
||||
}
|
||||
|
||||
else if (Input::get()->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||
{
|
||||
Screen::get()->incWindowSize();
|
||||
}
|
||||
|
||||
else if (Input::get()->checkInput(input_toggle_shaders, REPEAT_FALSE))
|
||||
{
|
||||
Screen::get()->toggleShaders();
|
||||
}
|
||||
|
||||
else if (Input::get()->checkInput(input_toggle_palette, REPEAT_FALSE))
|
||||
{
|
||||
switchPalette();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user