From 25ab8665574251dca0d98839c17816a5684057a3 Mon Sep 17 00:00:00 2001 From: dumganhar Date: Sun, 13 Nov 2011 00:57:05 +0800 Subject: [PATCH] when CCTextureAtlas::resizeCapacity, should glDeleteBuffers(2, m_pBuffersVBO); // initial binding glGenBuffers(2, &m_pBuffersVBO[0]); otherwise, CCSpriteBatchNode will have a bug the can't draw more than one sprite on bada 2.0 device. --- cocos2dx/textures/CCTextureAtlas.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cocos2dx/textures/CCTextureAtlas.cpp b/cocos2dx/textures/CCTextureAtlas.cpp index 7c0abbf4b1..b226e02cea 100644 --- a/cocos2dx/textures/CCTextureAtlas.cpp +++ b/cocos2dx/textures/CCTextureAtlas.cpp @@ -346,6 +346,13 @@ bool CCTextureAtlas::resizeCapacity(unsigned int newCapacity) m_pQuads = (ccV3F_C4B_T2F_Quad *)tmpQuads; m_pIndices = (GLushort *)tmpIndices; +#if CC_USES_VBO + glDeleteBuffers(2, m_pBuffersVBO); + // initial binding + glGenBuffers(2, &m_pBuffersVBO[0]); + m_bDirty = true; +#endif // CC_USES_VBO + this->initIndices(); #if CC_USES_VBO @@ -444,4 +451,4 @@ void CCTextureAtlas::drawNumberOfQuads(unsigned int n, unsigned int start) } -}//namespace cocos2d +}//namespace cocos2d \ No newline at end of file