From 02b20462e183e55e4e2ee7d183a347358ec10b72 Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Tue, 17 Nov 2020 19:06:24 +0100 Subject: [PATCH] DDS-TC add option to exclude all Canvas orignated images. --- simgear/scene/model/ModelRegistry.cxx | 4 ++++ simgear/scene/util/SGReaderWriterOptions.hxx | 1 + 2 files changed, 5 insertions(+) diff --git a/simgear/scene/model/ModelRegistry.cxx b/simgear/scene/model/ModelRegistry.cxx index ad3db305..b9008a5b 100644 --- a/simgear/scene/model/ModelRegistry.cxx +++ b/simgear/scene/model/ModelRegistry.cxx @@ -397,6 +397,10 @@ ModelRegistry::readImage(const string& fileName, isEffect = true; // can_compress = false; } + else if (sgoptC && !transparent && sgoptC->getLoadOriginHint() == SGReaderWriterOptions::LoadOriginHint::ORIGIN_CANVAS) { + SG_LOG(SG_IO, SG_INFO, "From Canvas " + absFileName + " will generate mipmap only"); + can_compress = false; + } if (can_compress) { std::string pot_message; diff --git a/simgear/scene/util/SGReaderWriterOptions.hxx b/simgear/scene/util/SGReaderWriterOptions.hxx index fa0ffc98..dfbe86b7 100644 --- a/simgear/scene/util/SGReaderWriterOptions.hxx +++ b/simgear/scene/util/SGReaderWriterOptions.hxx @@ -46,6 +46,7 @@ public: ORIGIN_EFFECTS, ORIGIN_EFFECTS_NORMALIZED, ORIGIN_SPLASH_SCREEN, + ORIGIN_CANVAS, }; //SGReaderWriterOptions* cloneOptions(const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY) const { return static_cast(clone(copyop)); }