From 320f81ab4f6058e31e952197cbe6472455210f9f Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Tue, 16 Mar 2021 21:43:14 +0100 Subject: [PATCH] Fixed a texture pop-in problem for some bundled graphic files. --- es-core/src/components/ImageComponent.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/es-core/src/components/ImageComponent.cpp b/es-core/src/components/ImageComponent.cpp index a2eb17efc..f31829f28 100644 --- a/es-core/src/components/ImageComponent.cpp +++ b/es-core/src/components/ImageComponent.cpp @@ -158,6 +158,12 @@ void ImageComponent::setDefaultImage(std::string path) void ImageComponent::setImage(std::string path, bool tile) { + // Always load bundled graphic resources statically, unless mForceLoad has been set. + // This eliminates annoying texture pop-in problems that would otherwise occur. + if (!mForceLoad && (path[0] == ':') && (path[1] == '/')) { + mDynamic = false; + } + if (path.empty() || !ResourceManager::getInstance()->fileExists(path)) { if (mDefaultPath.empty() || !ResourceManager::getInstance()->fileExists(mDefaultPath)) mTexture.reset();