Skip to content

Commit

Permalink
Fix calls to deprecated functions (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxbilger authored Dec 19, 2023
1 parent 1371598 commit e3c0b62
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions exe/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,16 @@ int main(int argc, char** argv)
sofa::helper::system::PluginManager::getInstance().loadPlugin(plugin);
}

sofa::simulation::setSimulation(new sofa::simulation::graph::DAGSimulation());


std::string fileName = result["file"].as<std::string>();
bool startAnim = result["start"].as<bool>();

fileName = sofa::helper::system::DataRepository.getFile(fileName);

auto groot = sofa::simulation::getSimulation()->load(fileName.c_str());
auto groot = sofa::simulation::node::load(fileName.c_str());
if( !groot )
{
groot = sofa::simulation::getSimulation()->createNewGraph("");
}

glfwGUI.setSimulation(groot, fileName);

Expand All @@ -119,7 +118,7 @@ int main(int argc, char** argv)
// create a SofaGLFW window
glfwGUI.createWindow(resolution[0], resolution[1], "SofaGLFW", isFullScreen);

sofa::simulation::getSimulation()->init(groot.get());
sofa::simulation::node::init(groot.get());

auto targetNbIterations = result["nb_iterations"].as<std::size_t>();
if (targetNbIterations > 0)
Expand Down Expand Up @@ -157,7 +156,9 @@ int main(int argc, char** argv)
}

if (groot != nullptr)
sofa::simulation::getSimulation()->unload(groot);
{
sofa::simulation::node::unload(groot);
}

sofa::simulation::graph::cleanup();

Expand Down

0 comments on commit e3c0b62

Please sign in to comment.