forked from jaildesigner-jailgames/jaildoctors_dilemma
Trabajando en la carga de recursos por nombre
This commit is contained in:
@@ -26,9 +26,13 @@ void Resource::loadAnimations(std::vector<std::string> list)
|
||||
{
|
||||
for (auto l : list)
|
||||
{
|
||||
// Extrae el nombre del fichero sin la extension para crear el nombre del fichero de la textura
|
||||
const size_t lastIndex = l.find_last_of(".");
|
||||
const std:: string pngFile = l.substr(0, lastIndex)+".png";
|
||||
|
||||
res_animation_t as;
|
||||
as.name = l + ".ani";
|
||||
as.animation = new animatedSprite_t(loadAnimationFromFile(getTexture(l + ".png"), asset->get(l + ".ani")));
|
||||
as.name = l;
|
||||
as.animation = new animatedSprite_t(loadAnimationFromFile(getTexture(pngFile), asset->get(l)));
|
||||
animations.push_back(as);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user