Retocando la abadía

This commit is contained in:
2022-11-01 22:36:12 +01:00
parent cb62cb8eb0
commit 4901635bb7
20 changed files with 363 additions and 429 deletions

View File

@@ -100,6 +100,27 @@ void Resource::reLoadTextures()
}
}
// Recarga las habitaciones
void Resource::reLoadRooms()
{
for (auto r : rooms)
{
delete r.room;
r.room = new room_t(loadRoomFile(asset->get(r.name)));
r.room->tileMap = getTileMap(r.room->tileMapFile);
for (auto &e : r.room->enemies)
{
e.animation = getAnimation(e.animationString);
}
for (auto &i : r.room->items)
{
i.texture = getTexture(i.tileSetFile);
}
r.room->textureA = getTexture("standard.png");
r.room->textureB = getTexture("standard_zxarne.png");
}
}
// Libera las texturas
void Resource::freeTextures()
{

View File

@@ -39,8 +39,8 @@ struct res_tileMap_t
struct res_room_t
{
std::string name; // Nombre de la habitación
room_t *room; // Vecor con las habitaciones
std::string name; // Nombre de la habitación
room_t *room; // Vecor con las habitaciones
};
// Clase Resource. Almacena recursos de disco en memoria
@@ -81,6 +81,9 @@ public:
// Recarga las texturas
void reLoadTextures();
// Recarga las habitaciones
void reLoadRooms();
// Libera las texturas
void freeTextures();