Skip to content

Commit

Permalink
MeshTools: make compile() actually working with indexed meshes.
Browse files Browse the repository at this point in the history
I was drunk out of my mind. Apparently didn't test once.
  • Loading branch information
mosra committed Jun 29, 2014
1 parent 50897e0 commit a35ce64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Magnum/MeshTools/Compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ std::tuple<Mesh, std::unique_ptr<Buffer>, std::unique_ptr<Buffer>> compile(const
std::tie(indexData, indexType, indexStart, indexEnd) = MeshTools::compressIndices(meshData.indices());

indexBuffer.reset(new Buffer{Buffer::Target::ElementArray});
indexBuffer->setData(data, usage);
indexBuffer->setData(indexData, usage);
mesh.setCount(meshData.indices().size())
.setIndexBuffer(*indexBuffer, 0, indexType, indexStart, indexEnd);

Expand Down Expand Up @@ -155,12 +155,12 @@ std::tuple<Mesh, std::unique_ptr<Buffer>, std::unique_ptr<Buffer>> compile(const
std::tie(indexData, indexType, indexStart, indexEnd) = MeshTools::compressIndices(meshData.indices());

indexBuffer.reset(new Buffer{Buffer::Target::ElementArray});
indexBuffer->setData(data, usage);
indexBuffer->setData(indexData, usage);
mesh.setCount(meshData.indices().size())
.setIndexBuffer(*indexBuffer, 0, indexType, indexStart, indexEnd);

/* Else set vertex count */
} mesh.setCount(meshData.positions(0).size());
} else mesh.setCount(meshData.positions(0).size());

return std::make_tuple(std::move(mesh), std::move(vertexBuffer), std::move(indexBuffer));
}
Expand Down

0 comments on commit a35ce64

Please sign in to comment.