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