Use correct grammar

Number of frames is countable (also in line with sprite_builder now)
This commit is contained in:
Jorim Tielemans 2019-07-31 17:46:24 +02:00
parent 66892f846a
commit 619916b025
2 changed files with 7 additions and 7 deletions

View File

@ -58,7 +58,7 @@ protected:
bool stayWithinBounds; bool stayWithinBounds;
u32 imageSize, tileIndex; u32 imageSize, tileIndex;
SpriteSize spriteSize; SpriteSize spriteSize;
u32 animationDelay, amountOfFrames, beginFrame, currentFrame, animationCounter; u32 animationDelay, numberOfFrames, beginFrame, currentFrame, animationCounter;
bool animating; bool animating;
std::unique_ptr<OBJ_ATTR> oam; std::unique_ptr<OBJ_ATTR> oam;
@ -73,13 +73,13 @@ public:
explicit Sprite(const void *imageData, int imageSize, int x, int y, SpriteSize size); explicit Sprite(const void *imageData, int imageSize, int x, int y, SpriteSize size);
virtual ~Sprite() {} virtual ~Sprite() {}
void makeAnimated(int amountOfFrames, int animationDelay) { void makeAnimated(int numberOfFrames, int animationDelay) {
this->amountOfFrames = amountOfFrames; this->numberOfFrames = numberOfFrames;
this->animationDelay = animationDelay; this->animationDelay = animationDelay;
animate(); animate();
} }
void makeAnimated(int beginFrame, int amountOfFrames, int animationDelay) { void makeAnimated(int beginFrame, int numberOfFrames, int animationDelay) {
this->amountOfFrames = amountOfFrames; this->numberOfFrames = numberOfFrames;
this->animationDelay = animationDelay; this->animationDelay = animationDelay;
this->beginFrame = beginFrame; this->beginFrame = beginFrame;
this->currentFrame = beginFrame; this->currentFrame = beginFrame;

View File

@ -14,7 +14,7 @@ Sprite::Sprite(const Sprite &other) : Sprite(nullptr, 0, other.x, other.y, other
Sprite::Sprite(const void *imageData, int imageSize, int x, int y, SpriteSize size) Sprite::Sprite(const void *imageData, int imageSize, int x, int y, SpriteSize size)
: x(x), y(y), data(imageData), imageSize(imageSize), spriteSize(size), : x(x), y(y), data(imageData), imageSize(imageSize), spriteSize(size),
animationDelay(0), amountOfFrames(0), beginFrame(0), currentFrame(0), animationCounter(0) { animationDelay(0), numberOfFrames(0), beginFrame(0), currentFrame(0), animationCounter(0) {
setAttributesBasedOnSize(size); setAttributesBasedOnSize(size);
} }
@ -86,7 +86,7 @@ void Sprite::updateAnimation() {
animationCounter++; animationCounter++;
if(animationCounter > animationDelay) { if(animationCounter > animationDelay) {
currentFrame++; currentFrame++;
if(currentFrame > (amountOfFrames - 1) + beginFrame) { if(currentFrame > (numberOfFrames - 1) + beginFrame) {
currentFrame = beginFrame; currentFrame = beginFrame;
} }
if(currentFrame < beginFrame) { if(currentFrame < beginFrame) {