Remove fmt::format and replace with std::format

This commit is contained in:
Alexander Bock
2024-03-24 20:19:14 +01:00
parent 9878bfc8f7
commit 3ba346a227
246 changed files with 1343 additions and 1300 deletions
@@ -181,7 +181,7 @@ RenderableInterpolatedPoints::Interpolation::Interpolation()
addProperty(value);
auto triggerInterpolation = [](std::string_view identifier, float v, float d) {
std::string script = fmt::format(
std::string script = std::format(
"openspace.setPropertyValueSingle(\"{}\", {}, {})",
identifier, v, d
);
@@ -275,7 +275,7 @@ RenderableInterpolatedPoints::RenderableInterpolatedPoints(
// corresponded to
if (_nDataPoints % nObjects != 0) {
LERROR(fmt::format(
LERROR(std::format(
"Mismatch between provided number of data entries and the specified number "
"of points. Expected the number of entries in the data file '{}' to be "
"evenly divisible by the number of points", _dataFile
@@ -445,11 +445,11 @@ void RenderableInterpolatedPoints::addColorAndSizeDataForPoint(unsigned int inde
void RenderableInterpolatedPoints::initializeBufferData() {
if (_vao == 0) {
glGenVertexArrays(1, &_vao);
LDEBUG(fmt::format("Generating Vertex Array id '{}'", _vao));
LDEBUG(std::format("Generating Vertex Array id '{}'", _vao));
}
if (_vbo == 0) {
glGenBuffers(1, &_vbo);
LDEBUG(fmt::format("Generating Vertex Buffer Object id '{}'", _vbo));
LDEBUG(std::format("Generating Vertex Buffer Object id '{}'", _vbo));
}
const int attibutesPerPoint = nAttributesPerPoint();
@@ -635,7 +635,7 @@ RenderablePointCloud::RenderablePointCloud(const ghoul::Dictionary& dictionary)
_texturesDirectory = absPath(*t.folder).string();
if (t.file.has_value()) {
LWARNING(fmt::format(
LWARNING(std::format(
"Both a single texture File and multi-texture Folder was provided. "
"The folder '{}' has priority and the single texture with the "
"following path will be ignored: '{}'", *t.folder, *t.file
@@ -842,7 +842,7 @@ void RenderablePointCloud::initializeSingleTexture() {
std::filesystem::path p = absPath(_texture.spriteTexturePath);
if (!std::filesystem::is_regular_file(p)) {
throw ghoul::RuntimeError(fmt::format(
throw ghoul::RuntimeError(std::format(
"Could not find image file '{}'", p
));
}
@@ -856,7 +856,7 @@ void RenderablePointCloud::initializeMultiTextures() {
std::filesystem::path path = _texturesDirectory / tex.file;
if (!std::filesystem::is_regular_file(path)) {
throw ghoul::RuntimeError(fmt::format(
throw ghoul::RuntimeError(std::format(
"Could not find image file '{}'", path
));
}
@@ -899,14 +899,14 @@ void RenderablePointCloud::loadTexture(const std::filesystem::path& path, int in
bool useAlpha = (t->numberOfChannels() > 3) && _texture.useAlphaChannel;
if (t) {
LINFOC("RenderablePlanesCloud", fmt::format("Loaded texture {}", path));
LINFOC("RenderablePlanesCloud", std::format("Loaded texture {}", path));
// Do not upload the loaded texture to the GPU, we just want it to hold the data.
// However, convert textures make sure they all use the same format
ghoul::opengl::Texture::Format targetFormat = glFormat(useAlpha);
convertTextureFormat(*t, targetFormat);
}
else {
throw ghoul::RuntimeError(fmt::format(
throw ghoul::RuntimeError(std::format(
"Could not find image file {}", path
));
}
@@ -1024,7 +1024,7 @@ void RenderablePointCloud::generateArrayTextures() {
int nMaxTextureLayers = 0;
glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &nMaxTextureLayers);
if (static_cast<int>(layer) > nMaxTextureLayers) {
LERROR(fmt::format(
LERROR(std::format(
"Too many layers bound in the same texture array. Found {} textures with "
"resolution {}x{} pixels. Max supported is {}.",
layer, res.x, res.y, nMaxTextureLayers
@@ -1333,11 +1333,11 @@ void RenderablePointCloud::updateBufferData() {
if (_vao == 0) {
glGenVertexArrays(1, &_vao);
LDEBUG(fmt::format("Generating Vertex Array id '{}'", _vao));
LDEBUG(std::format("Generating Vertex Array id '{}'", _vao));
}
if (_vbo == 0) {
glGenBuffers(1, &_vbo);
LDEBUG(fmt::format("Generating Vertex Buffer Object id '{}'", _vbo));
LDEBUG(std::format("Generating Vertex Buffer Object id '{}'", _vbo));
}
glBindVertexArray(_vao);
@@ -119,7 +119,7 @@ SizeMappingComponent::SizeMappingComponent(const ghoul::Dictionary& dictionary)
parameterOption = indexOfProvidedOption;
}
else if (p.parameter.has_value()) {
LERROR(fmt::format(
LERROR(std::format(
"Error when reading Parameter. Could not find provided parameter '{}' in "
"list of parameter options. Using default.", *p.parameter
));