From e6aaabc902eb19683528a9e2e431e3a590bbf0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Mon, 17 Aug 2015 23:08:29 +0300 Subject: [PATCH] Fixed|libgui|ModelDrawable: Initialize UV bounds of maps not included in material Previously if, say, a diffuse map was not defined in a material, the diffuse UV bounds would be uninitialized and would fall back to using the entire atlas. --- doomsday/sdk/libgui/src/graphics/modeldrawable.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doomsday/sdk/libgui/src/graphics/modeldrawable.cpp b/doomsday/sdk/libgui/src/graphics/modeldrawable.cpp index 812ac21604..bc067ed595 100644 --- a/doomsday/sdk/libgui/src/graphics/modeldrawable.cpp +++ b/doomsday/sdk/libgui/src/graphics/modeldrawable.cpp @@ -872,6 +872,15 @@ DENG2_PIMPL(ModelDrawable) { *texBounds[t] = atlas->imageRectf(material.texIds[map]).xywh(); } + else if(defaultTexIds[map]) + { + *texBounds[t] = atlas->imageRectf(defaultTexIds[map]).xywh(); + } + else + { + // Not included in material. + *texBounds[t] = Vector4f(); + } } }