Update to C++20

This commit is contained in:
Alexander Bock
2022-07-19 15:42:31 +02:00
parent 7f7d724f91
commit 1a052f3c8c
14 changed files with 31 additions and 21 deletions
+6 -2
View File
@@ -91,7 +91,11 @@ void DashboardItemDate::render(glm::vec2& penPosition) {
);
try {
RenderFont(*_font, penPosition, fmt::format(_formatString.value().c_str(), time));
RenderFont(
*_font,
penPosition,
fmt::format(fmt::runtime(_formatString.value()), time)
);
}
catch (const fmt::format_error&) {
LERRORC("DashboardItemDate", "Illegal format string");
@@ -103,7 +107,7 @@ glm::vec2 DashboardItemDate::size() const {
ZoneScoped
std::string_view time = global::timeManager->time().UTC();
return _font->boundingBox(fmt::format(_formatString.value().c_str(), time));
return _font->boundingBox(fmt::format(fmt::runtime(_formatString.value()), time));
}
} // namespace openspace
@@ -358,7 +358,7 @@ void DashboardItemDistance::render(glm::vec2& penPosition) {
try {
char* end = fmt::format_to(
_buffer.data(),
_formatString.value().c_str(),
fmt::runtime(_formatString.value()),
sourceInfo.second, destinationInfo.second, dist.first, dist.second
);
@@ -96,7 +96,11 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) {
std::string value;
_property->getStringValue(value);
RenderFont(*_font, penPosition, fmt::format(_displayString.value(), value));
RenderFont(
*_font,
penPosition,
fmt::format(fmt::runtime(_displayString.value()), value)
);
penPosition.y -= _font->height();
}
}
@@ -182,7 +182,7 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
*_font,
penPosition,
fmt::format(
_transitionFormat.value().c_str(),
fmt::runtime(_transitionFormat.value()),
targetDeltaTime.first, targetDeltaTime.second,
pauseText,
currentDeltaTime.first, currentDeltaTime.second
@@ -194,7 +194,7 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) {
*_font,
penPosition,
fmt::format(
_regularFormat.value().c_str(),
fmt::runtime(_regularFormat.value()),
targetDeltaTime.first, targetDeltaTime.second, pauseText
)
);