draw sub mesh bug

This commit is contained in:
lvlong 2014-08-16 20:38:00 +08:00
parent b1c9fb99e3
commit da63032a46
1 changed files with 2 additions and 2 deletions

View File

@ -313,12 +313,12 @@ void Sprite3D::genGLProgramState()
} }
setGLProgramState(programstate); setGLProgramState(programstate);
auto count = mesh->getSubMeshCount(); auto count = _subMeshStates.size();
_meshCommands.resize(count); _meshCommands.resize(count);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
auto tex = _subMeshStates.at(i)->getTexture(); auto tex = _subMeshStates.at(i)->getTexture();
GLuint texID = tex ? tex->getName() : 0; GLuint texID = tex ? tex->getName() : 0;
_meshCommands[i].genMaterialID(texID, programstate, mesh->getSubMesh(i)/*_meshes.at(i)*/, _blend); _meshCommands[i].genMaterialID(texID, programstate, _subMeshStates.at(i)->getSubMesh()->getMesh(), _blend);
} }
} }