From 6e94848aec5d42eed5f9e1f5548ade26915ce90b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 4 Jun 2024 21:14:45 +0100 Subject: Tidy many stringy messes with std::format --- assetFactory/assimp.cpp | 7 +++---- assetFactory/object.cpp | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'assetFactory') diff --git a/assetFactory/assimp.cpp b/assetFactory/assimp.cpp index f72e50a..1e11eda 100644 --- a/assetFactory/assimp.cpp +++ b/assetFactory/assimp.cpp @@ -1,12 +1,11 @@ #include "assimp.h" #include "assetFactory.h" #include "collections.h" -#include "ptr.h" #include "resource.h" #include #include #include -#include +#include #include template @@ -39,7 +38,7 @@ public: const aiNode * node; CreatedFaces - createMesh(ModelFactoryMesh & mesh, Scale3D) const + createMesh(ModelFactoryMesh & mesh, Scale3D) const override { CreatedFaces faces; addMesh(faces, mesh, node); @@ -103,7 +102,7 @@ AssImp::postLoad() SceneCPtr scene { aiImportFile(Resource::mapPath(path).c_str(), aiProcess_RemoveRedundantMaterials), &aiReleaseImport}; if (!scene) { - throw std::runtime_error("Failed to load asset library: " + path); + throw std::runtime_error(std::format("Failed to load asset library: {}", path)); } if (auto mf = Persistence::ParseBase::getShared("assetFactory")) { const auto root = AIRANGE(scene->mRootNode, Children); diff --git a/assetFactory/object.cpp b/assetFactory/object.cpp index f48dcf6..f87a487 100644 --- a/assetFactory/object.cpp +++ b/assetFactory/object.cpp @@ -1,5 +1,6 @@ #include "object.h" #include +#include Object::Object(std::string i) : id {std::move(i)} { } @@ -10,7 +11,7 @@ Object::createMesh(ModelFactoryMesh & mesh, Scale3D levelOfDetailFactor) const for (const auto & use : uses) { auto useFaces = use->createMesh(mesh, levelOfDetailFactor); std::transform(useFaces.begin(), useFaces.end(), std::inserter(faces, faces.end()), [this](auto && face) { - return std::make_pair(id + ":" + face.first, std::move(face.second)); + return std::make_pair(std::format("{}:{}", id, face.first), std::move(face.second)); }); } return faces; -- cgit v1.2.3