Switch index/vertex count to UInt32
This commit is contained in:
@@ -94,8 +94,8 @@ namespace Nz
|
||||
{
|
||||
const MD5MeshParser::Mesh& md5Mesh = meshes[i];
|
||||
|
||||
UInt64 indexCount = md5Mesh.triangles.size() * 3;
|
||||
UInt64 vertexCount = md5Mesh.vertices.size();
|
||||
UInt32 indexCount = SafeCast<UInt32>(md5Mesh.triangles.size() * 3);
|
||||
UInt32 vertexCount = SafeCast<UInt32>(md5Mesh.vertices.size());
|
||||
|
||||
bool largeIndices = (vertexCount > std::numeric_limits<UInt16>::max());
|
||||
|
||||
@@ -257,8 +257,8 @@ namespace Nz
|
||||
for (UInt32 i = 0; i < meshCount; ++i)
|
||||
{
|
||||
const MD5MeshParser::Mesh& md5Mesh = meshes[i];
|
||||
UInt64 indexCount = md5Mesh.triangles.size() * 3;
|
||||
UInt64 vertexCount = md5Mesh.vertices.size();
|
||||
UInt32 indexCount = SafeCast<UInt32>(md5Mesh.triangles.size() * 3);
|
||||
UInt32 vertexCount = SafeCast<UInt32>(md5Mesh.vertices.size());
|
||||
|
||||
// Index buffer
|
||||
bool largeIndices = (vertexCount > std::numeric_limits<UInt16>::max());
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace Nz
|
||||
// Création des buffers
|
||||
bool largeIndices = (vertexCount > std::numeric_limits<UInt16>::max());
|
||||
|
||||
std::shared_ptr<IndexBuffer> indexBuffer = std::make_shared<IndexBuffer>((largeIndices) ? IndexType::U32 : IndexType::U16, indices.size(), parameters.indexBufferFlags, parameters.bufferFactory);
|
||||
std::shared_ptr<IndexBuffer> indexBuffer = std::make_shared<IndexBuffer>((largeIndices) ? IndexType::U32 : IndexType::U16, SafeCast<UInt32>(indices.size()), parameters.indexBufferFlags, parameters.bufferFactory);
|
||||
std::shared_ptr<VertexBuffer> vertexBuffer = std::make_shared<VertexBuffer>(parameters.vertexDeclaration, vertexCount, parameters.vertexBufferFlags, parameters.bufferFactory);
|
||||
|
||||
// Remplissage des indices
|
||||
|
||||
Reference in New Issue
Block a user