From 9cc7508b07e3a18988888b4b220840b44bb16496 Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Fri, 13 Mar 2020 18:21:39 +0100 Subject: [PATCH] fixes #2123 Relocation splash distorted. Allow splash screen as an origin and do not allow splash screens to be cached and thus the poweroftwo rules don't apply. --- simgear/scene/model/ModelRegistry.cxx | 5 +++-- simgear/scene/util/SGReaderWriterOptions.hxx | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/simgear/scene/model/ModelRegistry.cxx b/simgear/scene/model/ModelRegistry.cxx index a1e6d32b..37c746cb 100644 --- a/simgear/scene/model/ModelRegistry.cxx +++ b/simgear/scene/model/ModelRegistry.cxx @@ -292,9 +292,10 @@ ModelRegistry::readImage(const string& fileName, Registry* registry = Registry::instance(); ReaderWriter::ReadResult res; - if (cache_active) { + const SGReaderWriterOptions* sgoptC = dynamic_cast(opt); + + if (cache_active && (!sgoptC || sgoptC->getLoadOriginHint() != SGReaderWriterOptions::LoadOriginHint::ORIGIN_SPLASH_SCREEN)) { if (fileExtension != "dds" && fileExtension != "gz") { - const SGReaderWriterOptions* sgoptC = dynamic_cast(opt); std::string root = getPathRoot(absFileName); std::string prr = getPathRelative(root, absFileName); diff --git a/simgear/scene/util/SGReaderWriterOptions.hxx b/simgear/scene/util/SGReaderWriterOptions.hxx index 940dd761..e22648f0 100644 --- a/simgear/scene/util/SGReaderWriterOptions.hxx +++ b/simgear/scene/util/SGReaderWriterOptions.hxx @@ -45,6 +45,7 @@ public: ORIGIN_MODEL, ORIGIN_EFFECTS, ORIGIN_EFFECTS_NORMALIZED, + ORIGIN_SPLASH_SCREEN, }; //SGReaderWriterOptions* cloneOptions(const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) const { return static_cast(clone(copyop)); }