Modificadas las llamadas para crear texturas

This commit is contained in:
2022-09-01 19:49:03 +02:00
parent 8f2e04b120
commit 4e219c47f6
7 changed files with 7 additions and 43 deletions

View File

@@ -13,9 +13,8 @@ Room::Room(std::string file_path, SDL_Renderer *renderer, Asset *asset, ItemTrac
this->itemsPicked = items;
// Crea los objetos
texture = new LTexture();
load(file_path);
texture->loadFromFile(asset->get(tileset), renderer);
texture = new LTexture(renderer,asset->get(tileset));
itemSound = JA_LoadSound(asset->get("item.wav").c_str());
// Crea la textura para el mapa de tiles de la habitación
@@ -31,26 +30,19 @@ Room::Room(std::string file_path, SDL_Renderer *renderer, Asset *asset, ItemTrac
Room::~Room()
{
// Reclama la memoria utilizada por los objetos
texture->unload();
delete texture;
texture = nullptr;
JA_DeleteSound(itemSound);
SDL_DestroyTexture(mapTexture);
mapTexture = nullptr;
for (auto enemy : enemies)
{
delete enemy;
}
enemies.clear();
for (auto item : items)
{
delete item;
}
items.clear();
}
// Carga las variables desde un fichero