diff --git a/data/assets/examples/urlsynchronization.asset b/data/assets/examples/urlsynchronization.asset index cc7e4b1a7c..44f0f68990 100644 --- a/data/assets/examples/urlsynchronization.asset +++ b/data/assets/examples/urlsynchronization.asset @@ -23,7 +23,8 @@ asset.syncedResource({ Type = "UrlSynchronization", Name = "Example Large", Identifier = "example_large", - Url = "http://ipv4.download.thinkbroadband.com/100MB.zip" + Url = "http://ipv4.download.thinkbroadband.com/100MB.zip", + Override = true }) asset.syncedResource({ diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index d7e8c4f6e3..b8cefd4c13 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -16,6 +16,7 @@ local Earth = { Type = "RenderableGlobe", Radii = earthEllipsoid, SegmentsPerPatch = 64, + PerformShading = false, Layers = { ColorLayers = { { diff --git a/ext/ghoul b/ext/ghoul index 00a90d00d9..cae1e1ffbf 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 00a90d00d98f0ab3f76c6249642584c5226b6fa2 +Subproject commit cae1e1ffbf07003f07a313b2213cec1c1c8de9ae diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index de951c7da5..c5c12717e0 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -220,6 +220,10 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) dictionary.getValue(keySegmentsPerPatch, patchSegmentsd); int patchSegments = static_cast(patchSegmentsd); + if (dictionary.hasValue("PerformShading")) { + _generalProperties.performShading = dictionary.value("PerformShading"); + } + // Init layer manager ghoul::Dictionary layersDictionary; if (!dictionary.getValue(keyLayers, layersDictionary)) { diff --git a/modules/sync/syncs/urlsynchronization.cpp b/modules/sync/syncs/urlsynchronization.cpp index d261ae1119..0bb99d140d 100644 --- a/modules/sync/syncs/urlsynchronization.cpp +++ b/modules/sync/syncs/urlsynchronization.cpp @@ -39,6 +39,7 @@ namespace { constexpr const char* KeyUrl = "Url"; constexpr const char* KeyIdentifier = "Identifier"; + constexpr const char* KeyOverride = "Override"; } // namespace namespace openspace { @@ -63,6 +64,16 @@ documentation::Documentation UrlSynchronization::Documentation() { "This optional identifier will be part of the used folder structure and, " "if provided, can be used to manually find the downloaded folder in the " "synchronization folder." + }, + { + KeyOverride, + new BoolVerifier, + Optional::Yes, + "If this value is set to 'true' and it is not overwritten by the global " + "settings, the file(s) pointed to by this URLSynchronization will always " + "be downloaded, thus overwriting the local files. This is useful for " + "files that are updated regularly remotely and should be fetch at every " + "startup." } } }; @@ -101,6 +112,10 @@ UrlSynchronization::UrlSynchronization(const ghoul::Dictionary& dict, else { _identifier = std::to_string(hash); } + + if (dict.hasValue(KeyOverride)) { + _forceOverride = dict.value(KeyOverride); + } } UrlSynchronization::~UrlSynchronization() { @@ -116,7 +131,7 @@ void UrlSynchronization::start() { } begin(); - if (hasSyncFile()) { + if (hasSyncFile() && !_forceOverride) { resolve(); return; } diff --git a/modules/sync/syncs/urlsynchronization.h b/modules/sync/syncs/urlsynchronization.h index 639fa1b1d3..5e7c458ea3 100644 --- a/modules/sync/syncs/urlsynchronization.h +++ b/modules/sync/syncs/urlsynchronization.h @@ -55,6 +55,7 @@ private: std::string directory() override; std::vector _urls; + bool _forceOverride = false; std::string _synchronizationRoot; std::string _identifier; diff --git a/tests/regression/517.inl b/tests/regression/517.inl index 774f842459..cf28d26f79 100644 --- a/tests/regression/517.inl +++ b/tests/regression/517.inl @@ -31,8 +31,8 @@ TEST_F(Issue527, Regression) { openspace::properties::OptionProperty p({ "id", "gui", "desc"}); p.addOptions({ - {-1, "a" }, - {-2, "b" } + { -1, "a" }, + { -2, "b" } });