mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-21 18:38:20 -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:
@@ -27,8 +27,8 @@ namespace openspace::luascriptfunctions {
|
||||
int connect(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::connect");
|
||||
|
||||
if (global::windowDelegate.isMaster()) {
|
||||
global::parallelPeer.connect();
|
||||
if (global::windowDelegate->isMaster()) {
|
||||
global::parallelPeer->connect();
|
||||
}
|
||||
|
||||
ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack");
|
||||
@@ -38,8 +38,8 @@ int connect(lua_State* L) {
|
||||
int disconnect(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::disconnect");
|
||||
|
||||
if (global::windowDelegate.isMaster()) {
|
||||
global::parallelPeer.connect();
|
||||
if (global::windowDelegate->isMaster()) {
|
||||
global::parallelPeer->connect();
|
||||
}
|
||||
|
||||
ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack");
|
||||
@@ -49,8 +49,8 @@ int disconnect(lua_State* L) {
|
||||
int requestHostship(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::requestHostship");
|
||||
|
||||
if (global::windowDelegate.isMaster()) {
|
||||
global::parallelPeer.requestHostship();
|
||||
if (global::windowDelegate->isMaster()) {
|
||||
global::parallelPeer->requestHostship();
|
||||
}
|
||||
|
||||
ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack");
|
||||
@@ -60,8 +60,8 @@ int requestHostship(lua_State* L) {
|
||||
int resignHostship(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::resignHostship");
|
||||
|
||||
if (global::windowDelegate.isMaster()) {
|
||||
global::parallelPeer.resignHostship();
|
||||
if (global::windowDelegate->isMaster()) {
|
||||
global::parallelPeer->resignHostship();
|
||||
}
|
||||
|
||||
ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack");
|
||||
|
||||
Reference in New Issue
Block a user