From 50c280fb9d79b4bb6800b607b62be9551344b983 Mon Sep 17 00:00:00 2001 From: James Chen Date: Sun, 21 Jul 2013 19:10:22 +0800 Subject: [PATCH] Fixing complication errors in CCTextureAtlas.cpp and jsb_cocos2dx_auto.cpp. --- cocos2dx/textures/CCTextureAtlas.cpp | 6 +++--- scripting/javascript/bindings/ScriptingCore.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cocos2dx/textures/CCTextureAtlas.cpp b/cocos2dx/textures/CCTextureAtlas.cpp index 65976c5a5d..222609e8e5 100644 --- a/cocos2dx/textures/CCTextureAtlas.cpp +++ b/cocos2dx/textures/CCTextureAtlas.cpp @@ -660,7 +660,7 @@ void TextureAtlas::drawNumberOfQuads(int numberOfQuads, int start) // XXX: update is done in draw... perhaps it should be done in a timer if (_dirty) { - glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * n , &_quads[start] ); + glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * numberOfQuads , &_quads[start] ); _dirty = false; } @@ -678,9 +678,9 @@ void TextureAtlas::drawNumberOfQuads(int numberOfQuads, int start) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); #if CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP - glDrawElements(GL_TRIANGLE_STRIP, (GLsizei)n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0]))); + glDrawElements(GL_TRIANGLE_STRIP, (GLsizei)numberOfQuads*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0]))); #else - glDrawElements(GL_TRIANGLES, (GLsizei)n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0]))); + glDrawElements(GL_TRIANGLES, (GLsizei)numberOfQuads*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0]))); #endif // CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP glBindBuffer(GL_ARRAY_BUFFER, 0); diff --git a/scripting/javascript/bindings/ScriptingCore.h b/scripting/javascript/bindings/ScriptingCore.h index 115dfb72d7..14ca594e61 100644 --- a/scripting/javascript/bindings/ScriptingCore.h +++ b/scripting/javascript/bindings/ScriptingCore.h @@ -10,6 +10,7 @@ #define __SCRIPTING_CORE_H__ #include +#include #include "cocos2d.h" #include "js_bindings_config.h" #include "js_bindings_core.h"