mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-03 01:09:34 -05:00
Feature/globals handling (#1352)
* Cleaner handling of global state * Prevent Lua memory corruption (closes #982) * Initialize glfw first thing to prevent weird joystick loading bug during startup
This commit is contained in:
+4
-4
@@ -53,9 +53,9 @@ int main(int argc, char** argv) {
|
||||
);
|
||||
|
||||
std::string configFile = configuration::findConfiguration();
|
||||
global::configuration = configuration::loadConfigurationFromFile(configFile);
|
||||
global::openSpaceEngine.registerPathTokens();
|
||||
global::openSpaceEngine.initialize();
|
||||
*global::configuration = configuration::loadConfigurationFromFile(configFile);
|
||||
global::openSpaceEngine->registerPathTokens();
|
||||
global::openSpaceEngine->initialize();
|
||||
|
||||
FileSys.registerPathToken("${TESTDIR}", "${BASE}/tests");
|
||||
|
||||
@@ -66,6 +66,6 @@ int main(int argc, char** argv) {
|
||||
|
||||
// And the deinitialization needs the SpiceManager to be initialized
|
||||
openspace::SpiceManager::initialize();
|
||||
global::openSpaceEngine.deinitialize();
|
||||
global::openSpaceEngine->deinitialize();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace {
|
||||
|
||||
TEST_CASE("AssetLoader: Assertion", "[assetloader]") {
|
||||
openspace::Scene scene(std::make_unique<openspace::SingleThreadedSceneInitializer>());
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine.luaState();
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState();
|
||||
openspace::SynchronizationWatcher syncWatcher;
|
||||
openspace::AssetLoader assetLoader(
|
||||
state,
|
||||
@@ -66,7 +66,7 @@ TEST_CASE("AssetLoader: Assertion", "[assetloader]") {
|
||||
|
||||
TEST_CASE("AssetLoader: Basic Export Import", "[assetloader]") {
|
||||
openspace::Scene scene(std::make_unique<openspace::SingleThreadedSceneInitializer>());
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine.luaState();
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState();
|
||||
openspace::SynchronizationWatcher syncWatcher;
|
||||
openspace::AssetLoader assetLoader(
|
||||
state,
|
||||
@@ -79,7 +79,7 @@ TEST_CASE("AssetLoader: Basic Export Import", "[assetloader]") {
|
||||
|
||||
TEST_CASE("AssetLoader: Asset Functions", "[assetloader]") {
|
||||
openspace::Scene scene(std::make_unique<openspace::SingleThreadedSceneInitializer>());
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine.luaState();
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState();
|
||||
openspace::SynchronizationWatcher syncWatcher;
|
||||
openspace::AssetLoader assetLoader(
|
||||
state,
|
||||
@@ -92,7 +92,7 @@ TEST_CASE("AssetLoader: Asset Functions", "[assetloader]") {
|
||||
|
||||
TEST_CASE("AssetLoader: Asset Initialization", "[assetloader]") {
|
||||
openspace::Scene scene(std::make_unique<openspace::SingleThreadedSceneInitializer>());
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine.luaState();
|
||||
ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState();
|
||||
openspace::SynchronizationWatcher syncWatcher;
|
||||
openspace::AssetLoader assetLoader(
|
||||
state,
|
||||
|
||||
Reference in New Issue
Block a user