nothing, really

This commit is contained in:
Eduardo Bart
2011-08-27 19:32:16 -03:00
parent 2a2fbc4c3a
commit 62871d8060
5 changed files with 13 additions and 9 deletions

View File

@@ -28,7 +28,6 @@ AnimatedTexture::AnimatedTexture(int width, int height, int channels, int numFra
AnimatedTexture::~AnimatedTexture()
{
assert(!g_graphics.isDrawing());
glDeleteTextures(m_numFrames, &m_framesTextureId[0]);
m_textureId = 0;
}
@@ -48,7 +47,10 @@ void AnimatedTexture::processAnimation()
if(m_currentFrame >= m_numFrames)
m_currentFrame = 0;
m_textureId = m_framesTextureId[m_currentFrame];
AnimatedTexturePtr me = std::static_pointer_cast<AnimatedTexture>(shared_from_this());
if(me.use_count() > 1)
g_dispatcher.scheduleEvent(std::bind(&AnimatedTexture::processAnimation, me), m_framesDelay[m_currentFrame]);
AnimatedTexturePtr self = asAnimatedTexture();
// continue to animate only if something still referencing this texture
if(self.use_count() > 1)
g_dispatcher.scheduleEvent(std::bind(&AnimatedTexture::processAnimation, self), m_framesDelay[m_currentFrame]);
}