forked from jaildesigner-jailgames/jaildoctors_dilemma
Arreglado un bug en el cambio de paleta durante el juego
This commit is contained in:
@@ -27,8 +27,8 @@ void Resource::loadAnimations(std::vector<std::string> list)
|
||||
for (auto l : list)
|
||||
{
|
||||
animation_t as;
|
||||
as.name = l+".ani";
|
||||
as.animation = new animatedSprite_t(loadAnimationFromFile(getTexture(l+".png"), asset->get(l+".ani")));
|
||||
as.name = l + ".ani";
|
||||
as.animation = new animatedSprite_t(loadAnimationFromFile(getTexture(l + ".png"), asset->get(l + ".ani")));
|
||||
animations.push_back(as);
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,23 @@ void Resource::freeTextures()
|
||||
textures.clear();
|
||||
}
|
||||
|
||||
// Libera las animaciones
|
||||
void Resource::freeAnimations()
|
||||
{
|
||||
for (auto a : animations)
|
||||
{
|
||||
delete a.animation;
|
||||
}
|
||||
animations.clear();
|
||||
}
|
||||
|
||||
// Libera todos los recursos
|
||||
void Resource::free()
|
||||
{
|
||||
freeTextures();
|
||||
freeAnimations();
|
||||
}
|
||||
|
||||
// Obtiene una textura
|
||||
Texture *Resource::getTexture(std::string name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user