Changed order of includes, uint32_t as index for Geometry::GetIndex(), minor changes

This commit is contained in:
Vladyslav Baranovskyi
2024-11-22 16:36:41 +02:00
parent ac843c0fe3
commit 2a331011d5
8 changed files with 19 additions and 31 deletions

View File

@@ -154,11 +154,11 @@ namespace OpenVulkano::Scene
indices = nullptr;
}
uint32_t Geometry::GetIndex(int index) const
uint32_t Geometry::GetIndex(uint32_t index) const
{
uint32_t result = 0;
if (index >= indexCount)
if (index >= indexCount) [[unlikely]]
throw std::out_of_range("Index is out of range");
if (indexType == OpenVulkano::Scene::VertexIndexType::UINT16)
@@ -171,10 +171,6 @@ namespace OpenVulkano::Scene
uint32_t* indices = GetIndices32();
result = indices[index];
}
else
{
throw std::runtime_error("Invalid geometry index type");
}
return result;
}