mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Add Override parameter for URLSynchronization
Add PerformShading asset parameter for RenderablePlanet Disable shading on default for Earth
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -16,6 +16,7 @@ local Earth = {
|
||||
Type = "RenderableGlobe",
|
||||
Radii = earthEllipsoid,
|
||||
SegmentsPerPatch = 64,
|
||||
PerformShading = false,
|
||||
Layers = {
|
||||
ColorLayers = {
|
||||
{
|
||||
|
||||
Submodule ext/ghoul updated: 00a90d00d9...cae1e1ffbf
@@ -220,6 +220,10 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
|
||||
dictionary.getValue(keySegmentsPerPatch, patchSegmentsd);
|
||||
int patchSegments = static_cast<int>(patchSegmentsd);
|
||||
|
||||
if (dictionary.hasValue<bool>("PerformShading")) {
|
||||
_generalProperties.performShading = dictionary.value<bool>("PerformShading");
|
||||
}
|
||||
|
||||
// Init layer manager
|
||||
ghoul::Dictionary layersDictionary;
|
||||
if (!dictionary.getValue(keyLayers, layersDictionary)) {
|
||||
|
||||
@@ -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<bool>(KeyOverride)) {
|
||||
_forceOverride = dict.value<bool>(KeyOverride);
|
||||
}
|
||||
}
|
||||
|
||||
UrlSynchronization::~UrlSynchronization() {
|
||||
@@ -116,7 +131,7 @@ void UrlSynchronization::start() {
|
||||
}
|
||||
begin();
|
||||
|
||||
if (hasSyncFile()) {
|
||||
if (hasSyncFile() && !_forceOverride) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ private:
|
||||
std::string directory() override;
|
||||
|
||||
std::vector<std::string> _urls;
|
||||
bool _forceOverride = false;
|
||||
std::string _synchronizationRoot;
|
||||
std::string _identifier;
|
||||
|
||||
|
||||
@@ -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" }
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user