mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06: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:
@@ -137,7 +137,7 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement(
|
||||
_fontName = dictionary.value<std::string>(FontNameInfo.identifier);
|
||||
}
|
||||
_fontName.onChange([this](){
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
_font = global::fontManager->font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontName);
|
||||
|
||||
@@ -145,7 +145,7 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement(
|
||||
_fontSize = static_cast<float>(dictionary.value<double>(FontSizeInfo.identifier));
|
||||
}
|
||||
_fontSize.onChange([this](){
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
_font = global::fontManager->font(_fontName, _fontSize);
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
@@ -173,14 +173,14 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement(
|
||||
_requestedUnit.setVisibility(properties::Property::Visibility::Hidden);
|
||||
addProperty(_requestedUnit);
|
||||
|
||||
_font = global::fontManager.font(_fontName, _fontSize);
|
||||
_font = global::fontManager->font(_fontName, _fontSize);
|
||||
}
|
||||
|
||||
void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
|
||||
ZoneScoped
|
||||
|
||||
const double targetDt = global::timeManager.targetDeltaTime();
|
||||
const double currentDt = global::timeManager.deltaTime();
|
||||
const double targetDt = global::timeManager->targetDeltaTime();
|
||||
const double currentDt = global::timeManager->deltaTime();
|
||||
std::pair<double, std::string> targetDeltaTime;
|
||||
std::pair<double, std::string> currentDeltaTime;
|
||||
if (_doSimplification) {
|
||||
@@ -201,9 +201,9 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
|
||||
}
|
||||
}
|
||||
|
||||
std::string pauseText = global::timeManager.isPaused() ? " (Paused)" : "";
|
||||
std::string pauseText = global::timeManager->isPaused() ? " (Paused)" : "";
|
||||
|
||||
if (targetDt != currentDt && !global::timeManager.isPaused()) {
|
||||
if (targetDt != currentDt && !global::timeManager->isPaused()) {
|
||||
// We are in the middle of a transition
|
||||
RenderFont(
|
||||
*_font,
|
||||
@@ -232,7 +232,7 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
|
||||
glm::vec2 DashboardItemSimulationIncrement::size() const {
|
||||
ZoneScoped
|
||||
|
||||
double t = global::timeManager.targetDeltaTime();
|
||||
double t = global::timeManager->targetDeltaTime();
|
||||
std::pair<double, std::string> deltaTime;
|
||||
if (_doSimplification) {
|
||||
deltaTime = simplifyTime(t);
|
||||
|
||||
Reference in New Issue
Block a user