forked from jaildesigner-jailgames/jaildoctors_dilemma
Trabajando en la recarga de texturas
This commit is contained in:
@@ -21,13 +21,20 @@ void Resource::loadTextures(std::vector<std::string> list)
|
||||
}
|
||||
}
|
||||
|
||||
// Libera los recursos
|
||||
void Resource::freeTextures()
|
||||
// Recarga las texturas
|
||||
void Resource::reLoadTextures()
|
||||
{
|
||||
for (auto texture : textures)
|
||||
{
|
||||
texture.texture->reLoad();
|
||||
}
|
||||
}
|
||||
|
||||
// Libera las texturas
|
||||
void Resource::freeTextures()
|
||||
{
|
||||
// Libera las texturas
|
||||
for (auto texture : textures)
|
||||
{
|
||||
texture.texture->unload();
|
||||
delete texture.texture;
|
||||
}
|
||||
textures.clear();
|
||||
@@ -36,18 +43,15 @@ void Resource::freeTextures()
|
||||
// Obtiene una textura
|
||||
Texture *Resource::getTexture(std::string name)
|
||||
{
|
||||
//std::cout << "BUSCANDO TEXTURA" << std::endl;
|
||||
for (auto texture : textures)
|
||||
{
|
||||
//std::cout << "COMPROBANDO: " << texture.name << " - " << name << std::endl;
|
||||
|
||||
if (texture.name.find(name) != std::string::npos)
|
||||
{
|
||||
std::cout << "CACHE: " << name << std::endl;
|
||||
return texture.texture;
|
||||
}
|
||||
}
|
||||
std::cout << "NO ENCONTRADA: " << name << std::endl;
|
||||
|
||||
std::cout << "NO ENCONTRADA: " << name << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
Reference in New Issue
Block a user