Eliminat el punter a "section"
This commit is contained in:
@@ -3,13 +3,12 @@
|
||||
#include "options.h"
|
||||
|
||||
// Constructor
|
||||
Intro::Intro(Screen *screen, Asset *asset, Input *input, section_t *section, JA_Music_t *music)
|
||||
Intro::Intro(Screen *screen, Asset *asset, Input *input, JA_Music_t *music)
|
||||
{
|
||||
// Copia los punteros
|
||||
this->screen = screen;
|
||||
this->asset = asset;
|
||||
this->input = input;
|
||||
this->section = section;
|
||||
this->music = music;
|
||||
SDL_Renderer *renderer = screen->getRenderer();
|
||||
|
||||
@@ -19,8 +18,8 @@ Intro::Intro(Screen *screen, Asset *asset, Input *input, section_t *section, JA_
|
||||
text = new Text(asset->get("nokia.png"), asset->get("nokia.txt"), renderer);
|
||||
|
||||
// Inicializa variables
|
||||
section->name = SECTION_PROG_INTRO;
|
||||
section->options = 0;
|
||||
section::name = section::NAME_INTRO;
|
||||
section::options = section::OPTIONS_NULL;
|
||||
ticks = 0;
|
||||
ticksSpeed = 15;
|
||||
scene = 1;
|
||||
@@ -175,7 +174,7 @@ void Intro::checkEvents()
|
||||
// Evento de salida de la aplicación
|
||||
if (eventHandler->type == SDL_QUIT)
|
||||
{
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
section::name = section::NAME_QUIT;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -196,7 +195,7 @@ void Intro::checkInput()
|
||||
// Comprueba si se sale con el teclado
|
||||
if (input->checkInput(input_exit, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
|
||||
{
|
||||
quit(SECTION_OPTIONS_QUIT_NORMAL);
|
||||
quit(section::OPTIONS_QUIT_NORMAL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -204,8 +203,8 @@ void Intro::checkInput()
|
||||
if (input->checkAnyButtonPressed())
|
||||
{
|
||||
JA_StopMusic();
|
||||
section->name = SECTION_PROG_TITLE;
|
||||
section->options = SECTION_OPTIONS_TITLE_1;
|
||||
section::name = section::NAME_TITLE;
|
||||
section::options = section::OPTIONS_TITLE_1;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -214,14 +213,14 @@ void Intro::checkInput()
|
||||
// Comprueba si se sale con el mando
|
||||
if (input->checkModInput(input_service, input_exit, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
|
||||
{
|
||||
quit(SECTION_OPTIONS_QUIT_SHUTDOWN);
|
||||
quit(section::OPTIONS_QUIT_SHUTDOWN);
|
||||
return;
|
||||
}
|
||||
|
||||
// Comprueba si se va a resetear el juego
|
||||
if (input->checkModInput(input_service, input_reset, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i))
|
||||
{
|
||||
section->name = SECTION_PROG_INIT;
|
||||
section::name = section::NAME_INIT;
|
||||
screen->showNotification("Reset");
|
||||
return;
|
||||
}
|
||||
@@ -386,8 +385,8 @@ void Intro::updateScenes()
|
||||
bitmaps[5]->setEnabled(false);
|
||||
texts[8]->setEnabled(false);
|
||||
JA_StopMusic();
|
||||
section->name = SECTION_PROG_TITLE;
|
||||
section->options = SECTION_OPTIONS_TITLE_1;
|
||||
section::name = section::NAME_TITLE;
|
||||
section::options = section::OPTIONS_TITLE_1;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -453,7 +452,7 @@ void Intro::run()
|
||||
{
|
||||
JA_PlayMusic(music, 0);
|
||||
|
||||
while (section->name == SECTION_PROG_INTRO)
|
||||
while (section::name == section::NAME_INTRO)
|
||||
{
|
||||
checkInput();
|
||||
update();
|
||||
@@ -463,12 +462,12 @@ void Intro::run()
|
||||
}
|
||||
|
||||
// Termina
|
||||
void Intro::quit(int code)
|
||||
void Intro::quit(section::options_e code)
|
||||
{
|
||||
if (screen->notificationsAreActive())
|
||||
{
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
section->options = code;
|
||||
section::name = section::NAME_QUIT;
|
||||
section::options = code;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user