Skip to content

Commit

Permalink
Fixed tilemap when using multiple submeshes
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardodoria committed Jun 26, 2023
1 parent 2f494bf commit 03c8077
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engine/core/subsystem/MeshSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ void MeshSystem::createTilemap(TilemapComponent& tilemap, MeshComponent& mesh){
}

for (int i = 0; i < mesh.numSubmeshes; i++){
addSubmeshAttribute(mesh.submeshes[i], "indices", AttributeType::INDEX, 1, AttributeDataType::UNSIGNED_SHORT, indexMap[i].size(), mesh.indices.getCount() * sizeof(uint16_t), false);

mesh.indices.setValues(
mesh.indices.getCount(), mesh.indices.getAttribute(AttributeType::INDEX),
indexMap[i].size(), (char*)&indexMap[i].front(), sizeof(uint16_t));
mesh.indices.setValues(mesh.indices.getCount(), mesh.indices.getAttribute(AttributeType::INDEX), indexMap[i].size(), (char*)&indexMap[i].front(), sizeof(uint16_t));
mesh.indices.setRenderAttributes(false);

//TODO: necessary?
//if (indexMap[i].size() == 0) {
Expand Down

0 comments on commit 03c8077

Please sign in to comment.