forked from jaildesigner-jailgames/jaildoctors_dilemma
- Cambiadas las teclas de cambiar el tamaño de ventana para adecuarse al estandar de jailgames
This commit is contained in:
@@ -7,24 +7,6 @@
|
||||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
|
||||
#define INPUT_NULL 0
|
||||
#define INPUT_UP 1
|
||||
#define INPUT_DOWN 2
|
||||
#define INPUT_LEFT 3
|
||||
#define INPUT_RIGHT 4
|
||||
#define INPUT_ACCEPT 5
|
||||
#define INPUT_CANCEL 6
|
||||
#define INPUT_BUTTON_1 7
|
||||
#define INPUT_BUTTON_2 8
|
||||
#define INPUT_BUTTON_3 9
|
||||
#define INPUT_BUTTON_4 10
|
||||
#define INPUT_BUTTON_5 11
|
||||
#define INPUT_BUTTON_6 12
|
||||
#define INPUT_BUTTON_7 13
|
||||
#define INPUT_BUTTON_8 14
|
||||
#define INPUT_BUTTON_PAUSE 15
|
||||
#define INPUT_BUTTON_ESCAPE 16
|
||||
|
||||
enum inputs_e
|
||||
{
|
||||
// Inputs obligatorios
|
||||
@@ -40,15 +22,12 @@ enum inputs_e
|
||||
|
||||
// Inputs personalizados
|
||||
input_jump,
|
||||
input_switch_music,
|
||||
input_video_mode,
|
||||
input_swap_palette,
|
||||
input_window_size_1,
|
||||
input_window_size_2,
|
||||
input_window_size_3,
|
||||
input_window_size_4,
|
||||
input_change_windows_size,
|
||||
input_window_fullscreen,
|
||||
input_window_inc_size,
|
||||
input_window_dec_size,
|
||||
input_toggle_border,
|
||||
input_switch_music,
|
||||
input_swap_palette,
|
||||
|
||||
// Input obligatorio
|
||||
input_number_of_inputs
|
||||
|
||||
@@ -850,7 +850,7 @@ void Menu::setDefaultActionWhenCancel(int item)
|
||||
// Gestiona la entrada de teclado y mando durante el menu
|
||||
void Menu::checkInput()
|
||||
{
|
||||
if (input->checkInput(INPUT_UP, REPEAT_FALSE))
|
||||
if (input->checkInput(input_up, REPEAT_FALSE))
|
||||
{
|
||||
if (decreaseSelectorIndex())
|
||||
{
|
||||
@@ -861,7 +861,7 @@ void Menu::checkInput()
|
||||
}
|
||||
}
|
||||
|
||||
if (input->checkInput(INPUT_DOWN, REPEAT_FALSE))
|
||||
if (input->checkInput(input_down, REPEAT_FALSE))
|
||||
{
|
||||
if (increaseSelectorIndex())
|
||||
{
|
||||
@@ -872,7 +872,7 @@ void Menu::checkInput()
|
||||
}
|
||||
}
|
||||
|
||||
if (input->checkInput(INPUT_ACCEPT, REPEAT_FALSE))
|
||||
if (input->checkInput(input_accept, REPEAT_FALSE))
|
||||
{
|
||||
itemSelected = selector.index;
|
||||
if (soundAccept)
|
||||
@@ -881,7 +881,7 @@ void Menu::checkInput()
|
||||
}
|
||||
}
|
||||
|
||||
if (input->checkInput(INPUT_CANCEL, REPEAT_FALSE))
|
||||
if (input->checkInput(input_cancel, REPEAT_FALSE))
|
||||
{
|
||||
itemSelected = defaultActionWhenCancel;
|
||||
if (soundCancel)
|
||||
|
||||
@@ -164,7 +164,7 @@ void Screen::setVideoMode(int videoMode)
|
||||
dest.x = dest.y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Modifica el tamaño del renderizador
|
||||
SDL_RenderSetLogicalSize(renderer, windowWidth, windowHeight);
|
||||
|
||||
@@ -191,6 +191,22 @@ void Screen::setWindowSize(int size)
|
||||
setVideoMode(0);
|
||||
}
|
||||
|
||||
// Reduce el tamaño de la ventana
|
||||
void Screen::decWindowSize()
|
||||
{
|
||||
--options->windowSize;
|
||||
options->windowSize = std::max(options->windowSize, 1);
|
||||
setVideoMode(0);
|
||||
}
|
||||
|
||||
// Aumenta el tamaño de la ventana
|
||||
void Screen::incWindowSize()
|
||||
{
|
||||
++options->windowSize;
|
||||
options->windowSize = std::min(options->windowSize, 4);
|
||||
setVideoMode(0);
|
||||
}
|
||||
|
||||
// Cambia el color del borde
|
||||
void Screen::setBorderColor(color_t color)
|
||||
{
|
||||
|
||||
@@ -95,6 +95,12 @@ public:
|
||||
// Cambia el tamaño de la ventana
|
||||
void setWindowSize(int size);
|
||||
|
||||
// Reduce el tamaño de la ventana
|
||||
void decWindowSize();
|
||||
|
||||
// Aumenta el tamaño de la ventana
|
||||
void incWindowSize();
|
||||
|
||||
// Cambia el color del borde
|
||||
void setBorderColor(color_t color);
|
||||
|
||||
|
||||
@@ -96,29 +96,19 @@ void Credits::checkInput()
|
||||
screen->switchBorder();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_video_mode, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
|
||||
{
|
||||
screen->switchVideoMode();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_1, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(1);
|
||||
screen->decWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_2, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(2);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_3, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(3);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_4, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(4);
|
||||
screen->incWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_swap_palette, REPEAT_FALSE))
|
||||
|
||||
@@ -91,33 +91,21 @@ void Demo::checkInput()
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_video_mode, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
|
||||
{
|
||||
screen->switchVideoMode();
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_1, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(1);
|
||||
screen->decWindowSize();
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_2, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(2);
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_3, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(3);
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_4, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(4);
|
||||
screen->incWindowSize();
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
|
||||
@@ -1234,13 +1234,11 @@ void Director::initInput()
|
||||
input->bindKey(input_cancel, SDL_SCANCODE_ESCAPE);
|
||||
input->bindKey(input_pause, SDL_SCANCODE_H);
|
||||
input->bindKey(input_exit, SDL_SCANCODE_ESCAPE);
|
||||
input->bindKey(input_window_size_1, SDL_SCANCODE_F1);
|
||||
input->bindKey(input_window_size_2, SDL_SCANCODE_F2);
|
||||
input->bindKey(input_window_size_3, SDL_SCANCODE_F3);
|
||||
input->bindKey(input_window_size_4, SDL_SCANCODE_F4);
|
||||
input->bindKey(input_window_dec_size, SDL_SCANCODE_F1);
|
||||
input->bindKey(input_window_inc_size, SDL_SCANCODE_F2);
|
||||
input->bindKey(input_window_fullscreen, SDL_SCANCODE_F3);
|
||||
input->bindKey(input_swap_palette, SDL_SCANCODE_F5);
|
||||
input->bindKey(input_switch_music, SDL_SCANCODE_M);
|
||||
input->bindKey(input_video_mode, SDL_SCANCODE_F);
|
||||
input->bindKey(input_toggle_border, SDL_SCANCODE_B);
|
||||
|
||||
// Mando - Movimiento
|
||||
|
||||
@@ -176,29 +176,19 @@ void Ending::checkInput()
|
||||
screen->switchBorder();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_video_mode, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
|
||||
{
|
||||
screen->switchVideoMode();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_1, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(1);
|
||||
screen->decWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_2, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(2);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_3, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(3);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_4, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(4);
|
||||
screen->incWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_swap_palette, REPEAT_FALSE))
|
||||
|
||||
@@ -210,29 +210,19 @@ void Ending2::checkInput()
|
||||
screen->switchBorder();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_video_mode, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
|
||||
{
|
||||
screen->switchVideoMode();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_1, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(1);
|
||||
screen->decWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_2, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(2);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_3, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(3);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_4, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(4);
|
||||
screen->incWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_swap_palette, REPEAT_FALSE))
|
||||
|
||||
@@ -208,33 +208,21 @@ void Game::checkInput()
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_video_mode, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
|
||||
{
|
||||
screen->switchVideoMode();
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_1, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(1);
|
||||
screen->decWindowSize();
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_2, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(2);
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_3, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(3);
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_4, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(4);
|
||||
screen->incWindowSize();
|
||||
reLoadTextures();
|
||||
}
|
||||
|
||||
|
||||
@@ -147,29 +147,19 @@ void GameOver::checkInput()
|
||||
screen->switchBorder();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_video_mode, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
|
||||
{
|
||||
screen->switchVideoMode();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_1, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(1);
|
||||
screen->decWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_2, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(2);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_3, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(3);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_4, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(4);
|
||||
screen->incWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_swap_palette, REPEAT_FALSE))
|
||||
|
||||
@@ -104,29 +104,19 @@ void Intro::checkInput()
|
||||
screen->switchBorder();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_video_mode, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
|
||||
{
|
||||
screen->switchVideoMode();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_1, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(1);
|
||||
screen->decWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_2, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(2);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_3, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(3);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_4, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(4);
|
||||
screen->incWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_swap_palette, REPEAT_FALSE))
|
||||
|
||||
@@ -98,29 +98,19 @@ void Logo::checkInput()
|
||||
screen->switchBorder();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_video_mode, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
|
||||
{
|
||||
screen->switchVideoMode();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_1, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(1);
|
||||
screen->decWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_2, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(2);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_3, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(3);
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_4, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(4);
|
||||
screen->incWindowSize();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_swap_palette, REPEAT_FALSE))
|
||||
|
||||
@@ -106,33 +106,21 @@ void Title::checkInput()
|
||||
resource->reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_video_mode, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
|
||||
{
|
||||
screen->switchVideoMode();
|
||||
resource->reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_1, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(1);
|
||||
screen->decWindowSize();
|
||||
resource->reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_2, REPEAT_FALSE))
|
||||
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(2);
|
||||
resource->reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_3, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(3);
|
||||
resource->reLoadTextures();
|
||||
}
|
||||
|
||||
else if (input->checkInput(input_window_size_4, REPEAT_FALSE))
|
||||
{
|
||||
screen->setWindowSize(4);
|
||||
screen->incWindowSize();
|
||||
resource->reLoadTextures();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user