forked from jaildesigner-jailgames/jaildoctors_dilemma
Merge branch 'master' of https://gitea.sustancia.synology.me/JailDesigner/jaildoctors_dilemma
This commit is contained in:
@@ -29,20 +29,26 @@ AnimatedSprite::~AnimatedSprite()
|
|||||||
int AnimatedSprite::getIndex(std::string name)
|
int AnimatedSprite::getIndex(std::string name)
|
||||||
{
|
{
|
||||||
int index = -1;
|
int index = -1;
|
||||||
for (int i = 0; i < animation.size(); i++)
|
/*for (int i = 0; i < (int)animation.size(); i++)
|
||||||
{
|
{
|
||||||
if (animation[i].name == name)
|
if (animation[i].name == name)
|
||||||
{
|
{
|
||||||
index = i;
|
index = i;
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
for (auto a : animation)
|
||||||
|
{
|
||||||
|
index++;
|
||||||
|
if (a.name == name)
|
||||||
|
{
|
||||||
|
return index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index == -1)
|
printf("** Warning: could not find \"%s\" animation\n", name.c_str());
|
||||||
{
|
index = 0;
|
||||||
printf("** Warning: could not find \"%s\" animation\n", name.c_str());
|
|
||||||
index = 0;
|
return -1;
|
||||||
}
|
|
||||||
return index;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calcula el frame correspondiente a la animación
|
// Calcula el frame correspondiente a la animación
|
||||||
|
|||||||
Reference in New Issue
Block a user