From 47b28d06beb76081d36a03bbb03fe7b78a152230 Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Sat, 17 Mar 2018 12:21:38 -0700 Subject: [PATCH] Use texmap fallback if we fail to load the png file. Fixes #213. --- common/lc_library.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/common/lc_library.cpp b/common/lc_library.cpp index 2742ba1b..f9778400 100644 --- a/common/lc_library.cpp +++ b/common/lc_library.cpp @@ -2134,8 +2134,18 @@ bool lcPiecesLibrary::ReadMeshData(lcFile& File, const lcMatrix44& CurrentTransf { TextureMap = &TextureStack[TextureStack.GetSize() - 1]; - if (TextureMap->Fallback) - continue; + if (TextureMap->Texture) + { + if (TextureMap->Fallback) + continue; + } + else + { + if (!TextureMap->Fallback) + continue; + + TextureMap = nullptr; + } } int Dummy;