afegit AnimatedSprite::getCurrentAnimationFrame()
fix: player2.gif faltava el outline noves veus i arreglo d'altres style: fitxer de config
This commit is contained in:
@@ -52,7 +52,7 @@ AnimatedSprite::AnimatedSprite(std::shared_ptr<Texture> texture, const Animation
|
||||
}
|
||||
|
||||
// Obtiene el índice de la animación a partir del nombre
|
||||
auto AnimatedSprite::getIndex(const std::string& name) -> int {
|
||||
auto AnimatedSprite::getAnimationIndex(const std::string& name) -> int {
|
||||
auto iterator = animation_indices_.find(name);
|
||||
if (iterator != animation_indices_.end()) {
|
||||
// Si se encuentra la animación en el mapa, devuelve su índice
|
||||
@@ -101,7 +101,7 @@ auto AnimatedSprite::animationIsCompleted() -> bool {
|
||||
|
||||
// Establece la animacion actual
|
||||
void AnimatedSprite::setCurrentAnimation(const std::string& name, bool reset) {
|
||||
const auto NEW_ANIMATION = getIndex(name);
|
||||
const auto NEW_ANIMATION = getAnimationIndex(name);
|
||||
if (current_animation_ != NEW_ANIMATION) {
|
||||
const auto OLD_ANIMATION = current_animation_;
|
||||
current_animation_ = NEW_ANIMATION;
|
||||
|
||||
Reference in New Issue
Block a user