mirror of https://github.com/axmolengine/axmol.git
remove commented codes
This commit is contained in:
parent
c1a71453d5
commit
1145859d38
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue