From 1145859d38ce1c523ebd576c9287568c7f621c51 Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 12 Aug 2014 11:44:06 +0800 Subject: [PATCH] remove commented codes --- cocos/2d/CCFastTMXLayer.cpp | 10 ------ cocos/renderer/CCVertexIndexBuffer.cpp | 48 -------------------------- cocos/renderer/CCVertexIndexBuffer.h | 2 -- 3 files changed, 60 deletions(-) diff --git a/cocos/2d/CCFastTMXLayer.cpp b/cocos/2d/CCFastTMXLayer.cpp index 600c1f9e53..e2646aa42a 100644 --- a/cocos/2d/CCFastTMXLayer.cpp +++ b/cocos/2d/CCFastTMXLayer.cpp @@ -163,21 +163,11 @@ void TMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags) } int index = 0; -// for(const auto& iter : _indicesVertexZNumber) -// { -// auto& cmd = _renderCommands[index++]; -// -// cmd.init(iter.first); -// cmd.func = CC_CALLBACK_0(TMXLayer::onDraw, this, _indicesVertexZOffsets[iter.first], iter.second); -// renderer->addCommand(&cmd); -// } for(const auto& iter : _primitives) { if(iter.second->getCount() > 0) { auto& cmd = _renderCommands[index++]; - //cmd.init(iter.first); - //cmd.func = CC_CALLBACK_0(TMXLayer::onDraw, this, iter.second); cmd.init(iter.first, _texture->getName(), getGLProgramState(), BlendFunc::ALPHA_NON_PREMULTIPLIED, iter.second, _modelViewTransform); renderer->addCommand(&cmd); } diff --git a/cocos/renderer/CCVertexIndexBuffer.cpp b/cocos/renderer/CCVertexIndexBuffer.cpp index 23e9ec13c8..5fdd9f31b6 100644 --- a/cocos/renderer/CCVertexIndexBuffer.cpp +++ b/cocos/renderer/CCVertexIndexBuffer.cpp @@ -168,30 +168,6 @@ void VertexBuffer::recreateVBO() const } } -//bool VertexBuffer::getVertices(void* verts, int count, int begin) const -//{ -// if(count <= 0 || nullptr == verts) return false; -// -// if(begin < 0) -// { -// CCLOGERROR("get vertices with begin = %d, will set begin to 0", begin); -// begin = 0; -// } -// -// if(count + begin > _vertexNumber) -// { -// CCLOGERROR("get vertices exceed the max size of vertex buffer, will set count to _vertexNumber-begin"); -// count = _vertexNumber - begin; -// } -// -// glBindBuffer(GL_ARRAY_BUFFER, _vbo); -// GLvoid* data = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); -// memcpy(verts, ((char*)data) + begin * _sizePerVertex, count * _sizePerVertex); -// glUnmapBuffer(GL_ARRAY_BUFFER); -// glBindBuffer(GL_ARRAY_BUFFER, 0); -// return true; -//} - int VertexBuffer::getSize() const { return _sizePerVertex * _vertexNumber; @@ -292,30 +268,6 @@ bool IndexBuffer::updateIndices(const void* indices, int count, int begin) return true; } -//bool IndexBuffer::getIndices(void* indices, int count, int begin) -//{ -// if(count <= 0 || nullptr == indices) return false; -// -// if(begin < 0) -// { -// CCLOGERROR("get indices with begin = %d, will set begin to 0", begin); -// begin = 0; -// } -// -// if(count + begin > _indexNumber) -// { -// CCLOGERROR("get indices exceed the max size of vertex buffer, will set count to _indexNumber-begin"); -// count = _indexNumber - begin; -// } -// -// glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _vbo); -// GLvoid* data = glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY); -// memcpy(indices, ((char*)data) + begin * getSizePerIndex(), count * getSizePerIndex()); -// glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER); -// glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); -// return true; -//} - int IndexBuffer::getSize() const { return getSizePerIndex() * _indexNumber; diff --git a/cocos/renderer/CCVertexIndexBuffer.h b/cocos/renderer/CCVertexIndexBuffer.h index 8adcc3ba72..d7b1db3c9c 100644 --- a/cocos/renderer/CCVertexIndexBuffer.h +++ b/cocos/renderer/CCVertexIndexBuffer.h @@ -38,7 +38,6 @@ public: int getSizePerVertex() const; int getVertexNumber() const; bool updateVertices(const void* verts, int count, int begin); - //bool getVertices(void* verts, int count, int begin) const; int getSize() const; @@ -82,7 +81,6 @@ public: int getSizePerIndex() const; int getIndexNumber() const; bool updateIndices(const void* indices, int count, int begin); - //bool getIndices(void* indices, int count, int begin); int getSize() const;