Se me ha ocurrido y lo he hecho antes que nadie: poner prefijo a los .cpp i .h que definen cada uno de los estados del juego

This commit is contained in:
2023-10-10 17:46:02 +02:00
parent f602b5ff7a
commit 6de3050255
23 changed files with 148 additions and 147 deletions

View File

@@ -15,11 +15,11 @@
Director::Director(int argc, char *argv[])
{
section = new section_t();
section->name = SECTION_PROG_LOGO;
section->name = SECTION_LOGO;
section->subsection = SUBSECTION_LOGO_TO_INTRO;
#ifdef DEBUG
section->name = SECTION_PROG_TITLE;
section->name = SECTION_TITLE;
#endif
// Crea e inicializa las opciones del programa
@@ -477,7 +477,7 @@ void Director::loadResources(section_t *section)
std::cout << "** LOAD RESOURCES" << std::endl;
}
if (section->name == SECTION_PROG_LOGO)
if (section->name == SECTION_LOGO)
{
std::vector<std::string> textureList;
textureList.push_back("jailgames.png");
@@ -486,7 +486,7 @@ void Director::loadResources(section_t *section)
resource->loadTextures(textureList);
}
else if (section->name == SECTION_PROG_INTRO)
else if (section->name == SECTION_LOADING_SCREEN)
{
std::vector<std::string> textureList;
textureList.push_back("loading_screen_bn.png");
@@ -497,7 +497,7 @@ void Director::loadResources(section_t *section)
resource->loadTextures(textureList);
}
else if (section->name == SECTION_PROG_TITLE)
else if (section->name == SECTION_TITLE)
{
std::vector<std::string> textureList;
textureList.push_back("loading_screen_color.png");
@@ -516,7 +516,7 @@ void Director::loadResources(section_t *section)
resource->loadOffsets(offsetsList);
}
else if (section->name == SECTION_PROG_CREDITS)
else if (section->name == SECTION_CREDITS)
{
// Texturas
std::vector<std::string> textureList;
@@ -538,7 +538,7 @@ void Director::loadResources(section_t *section)
resource->loadOffsets(offsetsList);
}
else if (section->name == SECTION_PROG_ENDING)
else if (section->name == SECTION_ENDING)
{
// Texturas
std::vector<std::string> textureList;
@@ -563,7 +563,7 @@ void Director::loadResources(section_t *section)
resource->loadOffsets(offsetsList);
}
else if (section->name == SECTION_PROG_ENDING2)
else if (section->name == SECTION_ENDING2)
{
// Texturas
std::vector<std::string> textureList;
@@ -701,7 +701,7 @@ void Director::loadResources(section_t *section)
resource->loadOffsets(offsetsList);
}
else if (section->name == SECTION_PROG_GAME_OVER)
else if (section->name == SECTION_GAME_OVER)
{
// Texturas
std::vector<std::string> textureList;
@@ -725,7 +725,7 @@ void Director::loadResources(section_t *section)
resource->loadOffsets(offsetsList);
}
else if (section->name == SECTION_PROG_GAME || section->name == SECTION_PROG_DEMO)
else if (section->name == SECTION_GAME || section->name == SECTION_DEMO)
{
// Texturas
std::vector<std::string> textureList;
@@ -1737,17 +1737,17 @@ void Director::runLogo()
resource->free();
}
// Ejecuta la seccion de juego de la introducción
void Director::runIntro()
// Ejecuta la seccion de juego de la pantalla de carga
void Director::runLoadingScreen()
{
if (options->console)
{
std::cout << "\n* SECTION: INTRO" << std::endl;
}
loadResources(section);
intro = new Intro(renderer, screen, resource, asset, input, options, section);
intro->run();
delete intro;
loadingScreen = new LoadingScreen(renderer, screen, resource, asset, input, options, section);
loadingScreen->run();
delete loadingScreen;
resource->free();
}
@@ -1857,43 +1857,43 @@ void Director::runGame()
void Director::run()
{
// Bucle principal
while (section->name != SECTION_PROG_QUIT)
while (section->name != SECTION_QUIT)
{
switch (section->name)
{
case SECTION_PROG_LOGO:
case SECTION_LOGO:
runLogo();
break;
case SECTION_PROG_INTRO:
runIntro();
case SECTION_LOADING_SCREEN:
runLoadingScreen();
break;
case SECTION_PROG_TITLE:
case SECTION_TITLE:
runTitle();
break;
case SECTION_PROG_CREDITS:
case SECTION_CREDITS:
runCredits();
break;
case SECTION_PROG_DEMO:
case SECTION_DEMO:
runDemo();
break;
case SECTION_PROG_GAME:
case SECTION_GAME:
runGame();
break;
case SECTION_PROG_GAME_OVER:
case SECTION_GAME_OVER:
runGameOver();
break;
case SECTION_PROG_ENDING:
case SECTION_ENDING:
runEnding();
break;
case SECTION_PROG_ENDING2:
case SECTION_ENDING2:
runEnding2();
break;
}