Añadido el objeto resource a todas las secciones
This commit is contained in:
@@ -180,7 +180,44 @@ bool Director::saveConfig()
|
||||
// Carga los recursos
|
||||
void Director::loadResources(section_t section)
|
||||
{
|
||||
if (section.name == SECTION_PROG_GAME || section.name == SECTION_PROG_DEMO)
|
||||
if (section.name == SECTION_PROG_LOGO)
|
||||
{
|
||||
std::vector<std::string> textureList;
|
||||
textureList.push_back("jailgames.png");
|
||||
textureList.push_back("since_1998.png");
|
||||
|
||||
resource->loadTextures(textureList);
|
||||
}
|
||||
|
||||
else if (section.name == SECTION_PROG_INTRO)
|
||||
{
|
||||
std::vector<std::string> textureList;
|
||||
textureList.push_back("loading_screen_bn.png");
|
||||
textureList.push_back("loading_screen_color.png");
|
||||
textureList.push_back("loading_screen_bn_zxarne.png");
|
||||
textureList.push_back("loading_screen_color_zxarne.png");
|
||||
|
||||
resource->loadTextures(textureList);
|
||||
}
|
||||
|
||||
else if (section.name == SECTION_PROG_TITLE)
|
||||
{
|
||||
std::vector<std::string> textureList;
|
||||
textureList.push_back("loading_screen_color.png");
|
||||
textureList.push_back("loading_screen_color_zxarne.png");
|
||||
|
||||
resource->loadTextures(textureList);
|
||||
}
|
||||
|
||||
else if (section.name == SECTION_PROG_CREDITS)
|
||||
{
|
||||
std::vector<std::string> textureList;
|
||||
textureList.push_back("shine.png");
|
||||
|
||||
resource->loadTextures(textureList);
|
||||
}
|
||||
|
||||
else if (section.name == SECTION_PROG_GAME || section.name == SECTION_PROG_DEMO)
|
||||
{
|
||||
std::vector<std::string> textureList;
|
||||
|
||||
@@ -703,7 +740,6 @@ bool Director::setFileList()
|
||||
// Logo
|
||||
asset->add("/data/logo/jailgames.png", t_bitmap);
|
||||
asset->add("/data/logo/since_1998.png", t_bitmap);
|
||||
asset->add("/data/logo/seagull.png", t_bitmap);
|
||||
|
||||
// Intro
|
||||
asset->add("/data/title/loading_screen_bn.png", t_bitmap);
|
||||
@@ -739,17 +775,21 @@ void Director::setSection(section_t section)
|
||||
// Ejecuta la seccion de juego con el logo
|
||||
void Director::runLogo()
|
||||
{
|
||||
logo = new Logo(renderer, screen, asset, options, section.subsection);
|
||||
loadResources(section);
|
||||
logo = new Logo(renderer, screen, resource, asset, options, section.subsection);
|
||||
setSection(logo->run());
|
||||
delete logo;
|
||||
resource->freeTextures();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion de juego de la introducción
|
||||
void Director::runIntro()
|
||||
{
|
||||
intro = new Intro(renderer, screen, asset, options);
|
||||
loadResources(section);
|
||||
intro = new Intro(renderer, screen, resource, asset, options);
|
||||
setSection(intro->run());
|
||||
delete intro;
|
||||
resource->freeTextures();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion de juego con el titulo y los menus
|
||||
@@ -759,17 +799,21 @@ void Director::runTitle()
|
||||
{
|
||||
JA_PlayMusic(music);
|
||||
}
|
||||
title = new Title(renderer, screen, asset, options);
|
||||
loadResources(section);
|
||||
title = new Title(renderer, screen, resource, asset, options);
|
||||
setSection(title->run());
|
||||
delete title;
|
||||
resource->freeTextures();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion de los creditos del juego
|
||||
void Director::runCredits()
|
||||
{
|
||||
credits = new Credits(renderer, screen, asset, options);
|
||||
loadResources(section);
|
||||
credits = new Credits(renderer, screen, resource, asset, options);
|
||||
setSection(credits->run());
|
||||
delete credits;
|
||||
resource->freeTextures();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion de la demo, donde se ven pantallas del juego
|
||||
|
||||
Reference in New Issue
Block a user