Fix asset selection of constellations

This commit is contained in:
Malin E
2022-08-09 17:01:41 +02:00
parent ceaf85f606
commit 87a45e7376
9 changed files with 55 additions and 41 deletions
@@ -93,6 +93,26 @@ void RenderableConstellationBounds::initialize() {
RenderableConstellation::initialize();
loadVertexFile();
if (!_assetSelectedConstellations.empty()) {
const std::vector<std::string> options = _constellationSelection.options();
std::set<std::string> selectedConstellations;
for (const std::string& s : _assetSelectedConstellations) {
const auto it = std::find(options.begin(), options.end(), s);
if (it == options.end()) {
// The user has specified a mesh name that doesn't exist
LWARNINGC(
"RenderableConstellation",
fmt::format("Option '{}' not found in list of meshes", s)
);
}
else {
selectedConstellations.insert(s);
}
}
_constellationSelection = selectedConstellations;
}
}
void RenderableConstellationBounds::initializeGL() {
@@ -121,9 +141,6 @@ void RenderableConstellationBounds::initializeGL() {
glBindVertexArray(0);
}
void RenderableConstellationBounds::deinitialize() {
}
void RenderableConstellationBounds::deinitializeGL() {
glDeleteBuffers(1, &_vbo);
_vbo = 0;