forked from jaildesigner-jailgames/jaildoctors_dilemma
Movida la carga de recursos al objeto director
This commit is contained in:
@@ -26,8 +26,7 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
|
||||
// ****
|
||||
|
||||
// Crea los objetos
|
||||
loadResources();
|
||||
scoreboard = new ScoreBoard(renderer, asset, options, &board);
|
||||
scoreboard = new ScoreBoard(renderer, resource, asset, options, &board);
|
||||
itemTracker = new ItemTracker();
|
||||
roomTracker = new RoomTracker();
|
||||
room = new Room(asset->get(currentRoom), renderer, screen, resource, asset, options, itemTracker, &board.items, debug);
|
||||
@@ -61,9 +60,6 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
|
||||
Game::~Game()
|
||||
{
|
||||
// Libera la memoria de los objetos
|
||||
resource->freeTextures();
|
||||
//delete resource;
|
||||
|
||||
delete scoreboard;
|
||||
delete itemTracker;
|
||||
delete roomTracker;
|
||||
@@ -458,68 +454,4 @@ void Game::renderBlackScreen()
|
||||
screen->clean();
|
||||
screen->setBorderColor(stringToColor(options->palette, "black"));
|
||||
}
|
||||
}
|
||||
|
||||
// Carga los recursos
|
||||
void Game::loadResources()
|
||||
{
|
||||
std::vector<std::string> textureList;
|
||||
|
||||
// Jugador
|
||||
textureList.push_back("player.png");
|
||||
|
||||
// Tilesets
|
||||
textureList.push_back("standard.png");
|
||||
textureList.push_back("standard_zxarne.png");
|
||||
|
||||
// Enemigos
|
||||
textureList.push_back("paco.png");
|
||||
textureList.push_back("chip.png");
|
||||
textureList.push_back("wave.png");
|
||||
textureList.push_back("wave_v.png");
|
||||
textureList.push_back("sigmasua.png");
|
||||
textureList.push_back("diskette.png");
|
||||
textureList.push_back("bird.png");
|
||||
textureList.push_back("bin.png");
|
||||
textureList.push_back("qvoid.png");
|
||||
textureList.push_back("batman.png");
|
||||
textureList.push_back("tuno.png");
|
||||
textureList.push_back("matatunos.png");
|
||||
textureList.push_back("abad.png");
|
||||
textureList.push_back("jailbattle_human.png");
|
||||
textureList.push_back("jailbattle_alien.png");
|
||||
textureList.push_back("jailer.png");
|
||||
textureList.push_back("jailer2.png");
|
||||
textureList.push_back("jailer3.png");
|
||||
textureList.push_back("printer.png");
|
||||
textureList.push_back("code.png");
|
||||
textureList.push_back("demon.png");
|
||||
textureList.push_back("dimallas.png");
|
||||
textureList.push_back("dimallas_v.png");
|
||||
textureList.push_back("heavy.png");
|
||||
textureList.push_back("spider.png");
|
||||
textureList.push_back("macaronni_ted.png");
|
||||
textureList.push_back("mummy.png");
|
||||
textureList.push_back("sam.png");
|
||||
textureList.push_back("amstrad_character_set.png");
|
||||
textureList.push_back("breakout.png");
|
||||
textureList.push_back("lamp.png");
|
||||
textureList.push_back("bry.png");
|
||||
textureList.push_back("tv.png");
|
||||
textureList.push_back("tv_panel.png");
|
||||
textureList.push_back("arounders_door.png");
|
||||
textureList.push_back("arounders_machine.png");
|
||||
textureList.push_back("arounder_walk.png");
|
||||
textureList.push_back("arounder_stop.png");
|
||||
textureList.push_back("arounder_fly.png");
|
||||
textureList.push_back("bat.png");
|
||||
|
||||
// Items
|
||||
textureList.push_back("items.png");
|
||||
|
||||
// Texto
|
||||
textureList.push_back("smb2.png");
|
||||
textureList.push_back("debug.png");
|
||||
|
||||
resource->loadTextures(textureList);
|
||||
}
|
||||
Reference in New Issue
Block a user