From 8cb15ebb5da1fc825a211548d51a7e77bb981647 Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 30 Nov 2020 21:40:10 -0800 Subject: GLTF Loader: added GetFirstIndexLocation and GetBaseVertex methods --- AssetLoader/interface/GLTFResourceManager.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'AssetLoader/interface/GLTFResourceManager.hpp') diff --git a/AssetLoader/interface/GLTFResourceManager.hpp b/AssetLoader/interface/GLTFResourceManager.hpp index 9a8fbbe..d8c9074 100644 --- a/AssetLoader/interface/GLTFResourceManager.hpp +++ b/AssetLoader/interface/GLTFResourceManager.hpp @@ -55,17 +55,20 @@ public: bool IsValid() const { - return Region.IsValid(); + VERIFY_EXPR(BufferIndex >= 0 && Region.IsValid() || BufferIndex < 0 && !Region.IsValid()); + return BufferIndex >= 0; } }; struct TextureAllocation { - Int32 TextureIndex = -1; + Int32 TextureIndex = -1; + DynamicAtlasManager::Region Region; bool IsValid() const { - return !Region.IsEmpty(); + VERIFY_EXPR(TextureIndex >= 0 && !Region.IsEmpty() || TextureIndex < 0 && Region.IsEmpty()); + return TextureIndex >= 0; } }; @@ -94,6 +97,7 @@ public: IBuffer* GetBuffer(const BufferAllocation& Allocation) { + VERIFY_EXPR(Allocation.IsValid()); return m_Buffers[Allocation.BufferIndex].pBuffer; } @@ -103,6 +107,7 @@ public: ITexture* GetTexture(const TextureAllocation& Allocation) { + VERIFY_EXPR(Allocation.IsValid()); return m_Textures[Allocation.TextureIndex].pTexture; } -- cgit v1.2.3