mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-27 07:18:57 -06:00
Fix error in Dictionary construction for ScreenSpaceRenderable
Do not access the std::future for cases where a download is not necessary
This commit is contained in:
@@ -104,8 +104,8 @@ void ScreenSpaceImage::render() {
|
||||
}
|
||||
|
||||
void ScreenSpaceImage::update() {
|
||||
bool futureReady = DownloadManager::futureReady(_futureImage);
|
||||
if (_downloadImage && _futureImage.valid() && futureReady) {
|
||||
bool download = _downloadImage ? (_futureImage.valid() && DownloadManager::futureReady(_futureImage)) : true;
|
||||
if (download) {
|
||||
loadTexture();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ void addScreenSpaceRenderable(std::string texturePath) {
|
||||
return;
|
||||
}
|
||||
std::string luaTable =
|
||||
"{Type = 'ScreenSpaceImage', TexturePath = '+" + absPath(texturePath) + " ' }";
|
||||
"{Type = 'ScreenSpaceImage', TexturePath = '" + absPath(texturePath) + "' }";
|
||||
std::string script = "openspace.registerScreenSpaceRenderable(" + luaTable + ");";
|
||||
OsEng.scriptEngine().queueScript(script);
|
||||
}
|
||||
|
||||
@@ -1122,7 +1122,8 @@ void RenderEngine::setDisableRenderingOnMaster(bool enabled) {
|
||||
_disableMasterRendering = enabled;
|
||||
}
|
||||
|
||||
void RenderEngine::registerScreenSpaceRenderable(std::shared_ptr<ScreenSpaceRenderable> s){
|
||||
void RenderEngine::registerScreenSpaceRenderable(std::shared_ptr<ScreenSpaceRenderable> s)
|
||||
{
|
||||
s->initialize();
|
||||
_screenSpaceRenderables.push_back(s);
|
||||
}
|
||||
|
||||
@@ -644,8 +644,7 @@ void ScriptEngine::deserialize(SyncBuffer* syncBuffer){
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEngine::postSynchronizationPreDraw(){
|
||||
|
||||
void ScriptEngine::postSynchronizationPreDraw() {
|
||||
std::vector<std::string> scripts;
|
||||
|
||||
_mutex.lock();
|
||||
@@ -653,14 +652,20 @@ void ScriptEngine::postSynchronizationPreDraw(){
|
||||
_receivedScripts.clear();
|
||||
_mutex.unlock();
|
||||
|
||||
while (!scripts.empty()){
|
||||
runScript(scripts.back());
|
||||
scripts.pop_back();
|
||||
while (!scripts.empty()) {
|
||||
try {
|
||||
const std::string& script = scripts.back();
|
||||
scripts.pop_back();
|
||||
runScript(script);
|
||||
}
|
||||
catch (const ghoul::RuntimeError& e) {
|
||||
LERRORC(e.component, e.message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ScriptEngine::preSynchronization(){
|
||||
void ScriptEngine::preSynchronization() {
|
||||
|
||||
_mutex.lock();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user