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:
Alexander Bock
2020-10-21 22:30:05 +02:00
committed by GitHub
parent 1525a0490d
commit efffc25ce0
164 changed files with 1484 additions and 1390 deletions

View File

@@ -511,7 +511,7 @@ void GlobeBrowsingModule::goToChunk(const globebrowsing::RenderableGlobe& globe,
};
// Compute altitude
const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3();
const glm::dvec3 cameraPosition = global::navigationHandler->camera()->positionVec3();
SceneGraphNode* globeSceneGraphNode = dynamic_cast<SceneGraphNode*>(globe.owner());
if (!globeSceneGraphNode) {
LERROR(
@@ -545,7 +545,7 @@ void GlobeBrowsingModule::goToGeodetic2(const globebrowsing::RenderableGlobe& gl
{
using namespace globebrowsing;
const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3();
const glm::dvec3 cameraPosition = global::navigationHandler->camera()->positionVec3();
SceneGraphNode* globeSceneGraphNode = dynamic_cast<SceneGraphNode*>(globe.owner());
if (!globeSceneGraphNode) {
LERROR("Error when going to Geodetic2");
@@ -585,7 +585,7 @@ void GlobeBrowsingModule::goToGeodetic3(const globebrowsing::RenderableGlobe& gl
state.position = positionModelSpace;
state.up = slightlyNorth;
global::navigationHandler.setNavigationStateNextFrame(state);
global::navigationHandler->setNavigationStateNextFrame(state);
}
glm::dquat GlobeBrowsingModule::lookDownCameraRotation(
@@ -624,7 +624,7 @@ GlobeBrowsingModule::castFocusNodeRenderableToGlobe()
using namespace globebrowsing;
const Renderable* renderable =
global::navigationHandler.orbitalNavigator().anchorNode()->renderable();
global::navigationHandler->orbitalNavigator().anchorNode()->renderable();
if (!renderable) {
return nullptr;