mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 13:25:10 +00:00
fix memory errors realted to cache
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include <iostream>
|
||||
#include "Model/ModelAnimation.hpp"
|
||||
|
||||
RAY::ModelAnimation::ModelAnimation(::ModelAnimation *animation):
|
||||
RAY::ModelAnimation::ModelAnimation(::ModelAnimation animation):
|
||||
_animation(animation), _frameCounter(0)
|
||||
{
|
||||
}
|
||||
@@ -20,26 +20,23 @@ size_t RAY::ModelAnimation::getFrameCounter() const
|
||||
|
||||
size_t RAY::ModelAnimation::getFrameCount() const
|
||||
{
|
||||
return this->_animation->frameCount;
|
||||
return this->_animation.frameCount;
|
||||
}
|
||||
|
||||
RAY::ModelAnimation &RAY::ModelAnimation::setFrameCounter(size_t frameCounter)
|
||||
{
|
||||
std::cout << this << std::endl;
|
||||
std::cout << this->_animation << std::endl;
|
||||
std::cout << this->_animation->frameCount << std::endl;
|
||||
this->_frameCounter = frameCounter % this->_animation->frameCount;
|
||||
this->_frameCounter = frameCounter % this->_animation.frameCount;
|
||||
return *this;
|
||||
}
|
||||
|
||||
RAY::ModelAnimation &RAY::ModelAnimation::incrementFrameCounter()
|
||||
{
|
||||
this->_frameCounter = (this->_frameCounter + 1) % this->_animation->frameCount;
|
||||
this->_frameCounter = (this->_frameCounter + 1) % this->_animation.frameCount;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
RAY::ModelAnimation::operator ::ModelAnimation() const
|
||||
{
|
||||
return *this->_animation;
|
||||
return this->_animation;
|
||||
}
|
||||
Reference in New Issue
Block a user