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.
This commit is contained in:
Richard Harrison 2020-03-13 18:21:39 +01:00
parent b258bc598e
commit 9cc7508b07
2 changed files with 4 additions and 2 deletions

View File

@ -292,10 +292,11 @@ ModelRegistry::readImage(const string& fileName,
Registry* registry = Registry::instance();
ReaderWriter::ReadResult res;
if (cache_active) {
if (fileExtension != "dds" && fileExtension != "gz") {
const SGReaderWriterOptions* sgoptC = dynamic_cast<const SGReaderWriterOptions*>(opt);
if (cache_active && (!sgoptC || sgoptC->getLoadOriginHint() != SGReaderWriterOptions::LoadOriginHint::ORIGIN_SPLASH_SCREEN)) {
if (fileExtension != "dds" && fileExtension != "gz") {
std::string root = getPathRoot(absFileName);
std::string prr = getPathRelative(root, absFileName);
std::string cache_root = SGSceneFeatures::instance()->getTextureCompressionPath().c_str();

View File

@ -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<SGReaderWriterOptions*>(clone(copyop)); }