canvi de pc

This commit is contained in:
2025-02-24 08:52:11 +01:00
parent 5bb5be9c33
commit 48971cd5d1
14 changed files with 420 additions and 392 deletions

View File

@@ -226,7 +226,7 @@ int AnimatedSprite::getIndex(std::string name)
// Calcula el frame correspondiente a la animación
void AnimatedSprite::animate()
{
if (!enabled || animation[currentAnimation].speed == 0)
if (!enabled_ || animation[currentAnimation].speed == 0)
{
return;
}
@@ -253,7 +253,7 @@ void AnimatedSprite::animate()
else
{
// Escoge el frame correspondiente de la animación
setSpriteClip(animation[currentAnimation].frames[animation[currentAnimation].currentFrame]);
setClip(animation[currentAnimation].frames[animation[currentAnimation].currentFrame]);
// Incrementa el contador de la animacion
animation[currentAnimation].counter++;
@@ -280,7 +280,7 @@ void AnimatedSprite::setCurrentFrame(int num)
animation[currentAnimation].counter = 0;
// Escoge el frame correspondiente de la animación
setSpriteClip(animation[currentAnimation].frames[animation[currentAnimation].currentFrame]);
setClip(animation[currentAnimation].frames[animation[currentAnimation].currentFrame]);
}
// Establece el valor del contador
@@ -459,13 +459,13 @@ bool AnimatedSprite::loadFromVector(std::vector<std::string> *source)
// Normaliza valores
if (framesPerRow == 0 && frameWidth > 0)
{
framesPerRow = texture->getWidth() / frameWidth;
framesPerRow = texture_->getWidth() / frameWidth;
}
if (maxTiles == 0 && frameWidth > 0 && frameHeight > 0)
{
const int w = texture->getWidth() / frameWidth;
const int h = texture->getHeight() / frameHeight;
const int w = texture_->getWidth() / frameWidth;
const int h = texture_->getHeight() / frameHeight;
maxTiles = w * h;
}
}