neteja tidy a source/core i encamina Texture::loadFromFile pel ResourceHelper
This commit is contained in:
@@ -27,8 +27,8 @@ void SmartSprite::init() {
|
||||
// Actualiza la posición y comprueba si ha llegado a su destino
|
||||
void SmartSprite::update() {
|
||||
if (enabled) {
|
||||
// Actualiza las variables internas del objeto
|
||||
MovingSprite::update();
|
||||
// Actualiza animació + posició (delegant en AnimatedSprite::update)
|
||||
AnimatedSprite::update();
|
||||
|
||||
// Comprueba el movimiento
|
||||
checkMove();
|
||||
@@ -47,7 +47,7 @@ void SmartSprite::render() {
|
||||
}
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
int SmartSprite::getEnabledCounter() {
|
||||
auto SmartSprite::getEnabledCounter() const -> int {
|
||||
return enabledCounter;
|
||||
}
|
||||
|
||||
@@ -67,12 +67,12 @@ void SmartSprite::setDestY(int y) {
|
||||
}
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
int SmartSprite::getDestX() {
|
||||
auto SmartSprite::getDestX() const -> int {
|
||||
return destX;
|
||||
}
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
int SmartSprite::getDestY() {
|
||||
auto SmartSprite::getDestY() const -> int {
|
||||
return destY;
|
||||
}
|
||||
|
||||
@@ -86,8 +86,8 @@ void SmartSprite::checkMove() {
|
||||
setPosX(destX);
|
||||
|
||||
// Lo detiene
|
||||
setVelX(0.0f);
|
||||
setAccelX(0.0f);
|
||||
setVelX(0.0F);
|
||||
setAccelX(0.0F);
|
||||
}
|
||||
}
|
||||
// Comprueba si se desplaza en el eje X hacia la izquierda
|
||||
@@ -98,8 +98,8 @@ void SmartSprite::checkMove() {
|
||||
setPosX(destX);
|
||||
|
||||
// Lo detiene
|
||||
setVelX(0.0f);
|
||||
setAccelX(0.0f);
|
||||
setVelX(0.0F);
|
||||
setAccelX(0.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,8 +111,8 @@ void SmartSprite::checkMove() {
|
||||
setPosY(destY);
|
||||
|
||||
// Lo detiene
|
||||
setVelY(0.0f);
|
||||
setAccelY(0.0f);
|
||||
setVelY(0.0F);
|
||||
setAccelY(0.0F);
|
||||
}
|
||||
}
|
||||
// Comprueba si se desplaza en el eje Y hacia arriba
|
||||
@@ -123,8 +123,8 @@ void SmartSprite::checkMove() {
|
||||
setPosY(destY);
|
||||
|
||||
// Lo detiene
|
||||
setVelY(0.0f);
|
||||
setAccelY(0.0f);
|
||||
setVelY(0.0F);
|
||||
setAccelY(0.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ void SmartSprite::checkMove() {
|
||||
// Comprueba si ha terminado
|
||||
void SmartSprite::checkFinished() {
|
||||
// Comprueba si ha llegado a su destino
|
||||
onDestination = (getPosX() == destX && getPosY() == destY) ? true : false;
|
||||
onDestination = getPosX() == destX && getPosY() == destY;
|
||||
|
||||
if (onDestination) { // Si esta en el destino comprueba su contador
|
||||
if (enabledCounter == 0) { // Si ha llegado a cero, deshabilita el objeto y lo marca como finalizado
|
||||
@@ -144,11 +144,11 @@ void SmartSprite::checkFinished() {
|
||||
}
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
bool SmartSprite::isOnDestination() {
|
||||
auto SmartSprite::isOnDestination() const -> bool {
|
||||
return onDestination;
|
||||
}
|
||||
|
||||
// Obtiene el valor de la variable
|
||||
bool SmartSprite::hasFinished() {
|
||||
auto SmartSprite::hasFinished() const -> bool {
|
||||
return finished;
|
||||
}
|
||||
Reference in New Issue
Block a user