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:
@@ -191,7 +191,7 @@ bool initTexturesFromLoadedData(DefaultTileProvider& t) {
|
||||
void initialize(TextTileProvider& t) {
|
||||
ZoneScoped
|
||||
|
||||
t.font = global::fontManager.font("Mono", static_cast<float>(t.fontSize));
|
||||
t.font = global::fontManager->font("Mono", static_cast<float>(t.fontSize));
|
||||
t.fontRenderer = ghoul::fontrendering::FontRenderer::createDefault();
|
||||
t.fontRenderer->setFramebufferSize(glm::vec2(t.initData.dimensions));
|
||||
glGenFramebuffers(1, &t.fbo);
|
||||
@@ -235,7 +235,7 @@ Tile tile(TextTileProvider& t, const TileIndex& tileIndex) {
|
||||
t.fontRenderer->render(*t.font, t.textPosition, t.text, t.textColor);
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO);
|
||||
global::renderEngine.openglStateCache().resetViewportState();
|
||||
global::renderEngine->openglStateCache().resetViewportState();
|
||||
//glViewport(viewport[0], viewport[1], viewport[2], viewport[3]);
|
||||
|
||||
tile = Tile{ texture, std::nullopt, Tile::Status::OK };
|
||||
@@ -556,7 +556,7 @@ DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary)
|
||||
|
||||
type = Type::DefaultTileProvider;
|
||||
|
||||
tileCache = global::moduleEngine.module<GlobeBrowsingModule>()->tileCache();
|
||||
tileCache = global::moduleEngine->module<GlobeBrowsingModule>()->tileCache();
|
||||
name = "Name unspecified";
|
||||
if (dictionary.hasKeyAndValue<std::string>("Name")) {
|
||||
name = dictionary.value<std::string>("Name");
|
||||
@@ -635,7 +635,7 @@ TextTileProvider::TextTileProvider(TileTextureInitData initData, size_t fontSize
|
||||
{
|
||||
ZoneScoped
|
||||
|
||||
tileCache = global::moduleEngine.module<GlobeBrowsingModule>()->tileCache();
|
||||
tileCache = global::moduleEngine->module<GlobeBrowsingModule>()->tileCache();
|
||||
}
|
||||
|
||||
|
||||
@@ -649,7 +649,7 @@ SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& di
|
||||
|
||||
type = Type::SizeReferenceTileProvider;
|
||||
|
||||
font = global::fontManager.font("Mono", static_cast<float>(fontSize));
|
||||
font = global::fontManager->font("Mono", static_cast<float>(fontSize));
|
||||
|
||||
if (dictionary.hasKeyAndValue<glm::dvec3>(sizereferenceprovider::KeyRadii)) {
|
||||
ellipsoid = dictionary.value<glm::dvec3>(sizereferenceprovider::KeyRadii);
|
||||
@@ -1220,9 +1220,9 @@ int update(TileProvider& tp) {
|
||||
case Type::TemporalTileProvider: {
|
||||
TemporalTileProvider& t = static_cast<TemporalTileProvider&>(tp);
|
||||
if (t.successfulInitialization) {
|
||||
TileProvider* newCurrent = getTileProvider(t, global::timeManager.time());
|
||||
if (newCurrent) {
|
||||
t.currentTileProvider = newCurrent;
|
||||
TileProvider* newCurr = getTileProvider(t, global::timeManager->time());
|
||||
if (newCurr) {
|
||||
t.currentTileProvider = newCurr;
|
||||
}
|
||||
if (t.currentTileProvider) {
|
||||
update(*t.currentTileProvider);
|
||||
|
||||
Reference in New Issue
Block a user