Ya funcionan los nuevos inputs de teclado y mando en el titulo
This commit is contained in:
@@ -205,6 +205,9 @@ void Title::update()
|
|||||||
// Comprueba los eventos
|
// Comprueba los eventos
|
||||||
checkEventHandler();
|
checkEventHandler();
|
||||||
|
|
||||||
|
// Comprueba las entradas
|
||||||
|
checkInput();
|
||||||
|
|
||||||
// Calcula la lógica de los objetos
|
// Calcula la lógica de los objetos
|
||||||
if (SDL_GetTicks() - ticks > ticksSpeed)
|
if (SDL_GetTicks() - ticks > ticksSpeed)
|
||||||
{
|
{
|
||||||
@@ -671,44 +674,6 @@ void Title::checkEventHandler()
|
|||||||
reLoadTextures();
|
reLoadTextures();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0)
|
|
||||||
{
|
|
||||||
switch (eventHandler->key.keysym.scancode)
|
|
||||||
{
|
|
||||||
case SDL_SCANCODE_ESCAPE:
|
|
||||||
section.name = PROG_SECTION_QUIT;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_SCANCODE_F:
|
|
||||||
screen->switchVideoMode();
|
|
||||||
reLoadTextures();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_SCANCODE_F1:
|
|
||||||
screen->setWindowSize(1);
|
|
||||||
reLoadTextures();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_SCANCODE_F2:
|
|
||||||
screen->setWindowSize(2);
|
|
||||||
reLoadTextures();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_SCANCODE_F3:
|
|
||||||
screen->setWindowSize(3);
|
|
||||||
reLoadTextures();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_SCANCODE_F4:
|
|
||||||
screen->setWindowSize(4);
|
|
||||||
reLoadTextures();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (section.subsection == TITLE_SECTION_3)
|
if (section.subsection == TITLE_SECTION_3)
|
||||||
{ // Si se pulsa alguna tecla durante la tercera sección del titulo
|
{ // Si se pulsa alguna tecla durante la tercera sección del titulo
|
||||||
if ((eventHandler->type == SDL_KEYUP) || (eventHandler->type == SDL_JOYBUTTONUP))
|
if ((eventHandler->type == SDL_KEYUP) || (eventHandler->type == SDL_JOYBUTTONUP))
|
||||||
@@ -723,6 +688,36 @@ void Title::checkEventHandler()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Comprueba las entradas
|
||||||
|
void Title::checkInput()
|
||||||
|
{
|
||||||
|
if (input->checkInput(input_exit, REPEAT_FALSE))
|
||||||
|
{
|
||||||
|
section.name = PROG_SECTION_QUIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (input->checkInput(input_window_fullscreen, REPEAT_FALSE))
|
||||||
|
{
|
||||||
|
screen->switchVideoMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
|
||||||
|
{
|
||||||
|
screen->decWindowSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
|
||||||
|
{
|
||||||
|
screen->incWindowSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (input->checkInput(input_pause, REPEAT_FALSE) || input->checkInput(input_accept, REPEAT_FALSE) || input->checkInput(input_fire_left, REPEAT_FALSE) || input->checkInput(input_fire_center, REPEAT_FALSE) || input->checkInput(input_fire_right, REPEAT_FALSE))
|
||||||
|
{
|
||||||
|
section.name = PROG_SECTION_TITLE;
|
||||||
|
section.subsection = TITLE_SECTION_1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Actualiza el tileado de fondo
|
// Actualiza el tileado de fondo
|
||||||
void Title::updateBG()
|
void Title::updateBG()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ private:
|
|||||||
Fade *fade; // Objeto para realizar fundidos en pantalla
|
Fade *fade; // Objeto para realizar fundidos en pantalla
|
||||||
|
|
||||||
// Variable
|
// Variable
|
||||||
JA_Music_t* titleMusic; // Musica para el titulo
|
JA_Music_t *titleMusic; // Musica para el titulo
|
||||||
JA_Sound_t* crashSound; // Sonido con el impacto del título
|
JA_Sound_t *crashSound; // Sonido con el impacto del título
|
||||||
int backgroundCounter; // Temporizador para el fondo de tiles de la pantalla de titulo
|
int backgroundCounter; // Temporizador para el fondo de tiles de la pantalla de titulo
|
||||||
int counter; // Temporizador para la pantalla de titulo
|
int counter; // Temporizador para la pantalla de titulo
|
||||||
Uint32 ticks; // Contador de ticks para ajustar la velocidad del programa
|
Uint32 ticks; // Contador de ticks para ajustar la velocidad del programa
|
||||||
@@ -105,6 +105,9 @@ private:
|
|||||||
// Comprueba los eventos
|
// Comprueba los eventos
|
||||||
void checkEventHandler();
|
void checkEventHandler();
|
||||||
|
|
||||||
|
// Comprueba las entradas
|
||||||
|
void checkInput();
|
||||||
|
|
||||||
// Actualiza el tileado de fondo
|
// Actualiza el tileado de fondo
|
||||||
void updateBG();
|
void updateBG();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user