diff --git a/ext/ghoul b/ext/ghoul index 6560b217b3..6c00ac67b2 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 6560b217b358e1d299c04f35c533b8737f907786 +Subproject commit 6c00ac67b2deec56c37ac990fe6a8ce942250a0b diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index c8035d3e4a..0560cff36a 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -285,8 +285,8 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) file = absPath(dictionary.value(KeyGeomModelFile)); _geometry = ghoul::io::ModelReader::ref().loadModel( file, - _forceRenderInvisible, - _notifyInvisibleDropped + ghoul::io::ModelReader::ForceRenderInvisible(_forceRenderInvisible), + ghoul::io::ModelReader::NotifyInvisibleDropped(_notifyInvisibleDropped) ); } else if (dictionary.hasValue(KeyGeomModelFile)) { @@ -300,32 +300,32 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) file = absPath(fileDictionary.value(k)); geometries.push_back(ghoul::io::ModelReader::ref().loadModel( file, - _forceRenderInvisible, - _notifyInvisibleDropped + ghoul::io::ModelReader::ForceRenderInvisible(_forceRenderInvisible), + ghoul::io::ModelReader::NotifyInvisibleDropped(_notifyInvisibleDropped) )); } if (!geometries.empty()) { - ghoul::modelgeometry::ModelGeometry combinedGeometry = - std::move(*geometries[0].release()); + std::unique_ptr combinedGeometry = + std::move(geometries[0]); // Combine all models into one ModelGeometry for (unsigned int i = 1; i < geometries.size(); ++i) { - for (unsigned int m = 0; m < geometries[i]->meshes().size(); ++m) { - combinedGeometry.meshes().push_back( - std::move(geometries[i]->meshes()[m]) + for (ghoul::io::ModelMesh& mesh : geometries[i]->meshes()) { + combinedGeometry->meshes().push_back( + std::move(mesh) ); } - for (unsigned int t = 0; t < geometries[i]->textureStorage().size(); ++t) { - combinedGeometry.textureStorage().push_back( - std::move(geometries[i]->textureStorage()[t]) + for (ghoul::modelgeometry::ModelGeometry::TextureEntry& texture : + geometries[i]->textureStorage()) + { + combinedGeometry->textureStorage().push_back( + std::move(texture) ); } } - _geometry = std::make_unique( - std::move(combinedGeometry) - ); + _geometry = std::move(combinedGeometry); _geometry->calculateBoundingRadius(); } } diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp index e762310cde..5c0e3bdc15 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp @@ -136,7 +136,11 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di if (dictionary.hasValue(KeyGeomModelFile)) { // Handle single file file = absPath(dictionary.value(KeyGeomModelFile)); - _geometry = ghoul::io::ModelReader::ref().loadModel(file, false, true); + _geometry = ghoul::io::ModelReader::ref().loadModel( + file, + ghoul::io::ModelReader::ForceRenderInvisible::No, + ghoul::io::ModelReader::NotifyInvisibleDropped::Yes + ); } else if (dictionary.hasValue(KeyGeomModelFile)) { ghoul::Dictionary fileDictionary = dictionary.value( @@ -149,33 +153,32 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di file = absPath(fileDictionary.value(k)); geometries.push_back(ghoul::io::ModelReader::ref().loadModel( file, - false, - true + ghoul::io::ModelReader::ForceRenderInvisible::No, + ghoul::io::ModelReader::NotifyInvisibleDropped::Yes )); } if (!geometries.empty()) { - ghoul::modelgeometry::ModelGeometry combinedGeometry = - std::move(*geometries[0].release()); + std::unique_ptr combinedGeometry = + std::move(geometries[0]); // Combine all models into one ModelGeometry for (unsigned int i = 1; i < geometries.size(); ++i) { - for (unsigned int m = 0; m < geometries[i]->meshes().size(); ++m) { - combinedGeometry.meshes().push_back( - std::move(geometries[i]->meshes()[m]) + for (ghoul::io::ModelMesh& mesh : geometries[i]->meshes()) { + combinedGeometry->meshes().push_back( + std::move(mesh) ); } - for (unsigned int t = 0; t < geometries[i]->textureStorage().size(); ++t) + for (ghoul::modelgeometry::ModelGeometry::TextureEntry& texture : + geometries[i]->textureStorage()) { - combinedGeometry.textureStorage().push_back( - std::move(geometries[i]->textureStorage()[t]) + combinedGeometry->textureStorage().push_back( + std::move(texture) ); } } - _geometry = std::make_unique( - std::move(combinedGeometry) - ); + _geometry = std::move(combinedGeometry); _geometry->calculateBoundingRadius(); } }