diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-06-04 21:14:45 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-06-04 21:14:45 +0100 |
commit | 6e94848aec5d42eed5f9e1f5548ade26915ce90b (patch) | |
tree | b6cf5bc39f7da4c8853491da4008c29406b135f3 /assetFactory | |
parent | Tidy of glRef (diff) | |
download | ilt-6e94848aec5d42eed5f9e1f5548ade26915ce90b.tar.bz2 ilt-6e94848aec5d42eed5f9e1f5548ade26915ce90b.tar.xz ilt-6e94848aec5d42eed5f9e1f5548ade26915ce90b.zip |
Tidy many stringy messes with std::format
Diffstat (limited to 'assetFactory')
-rw-r--r-- | assetFactory/assimp.cpp | 7 | ||||
-rw-r--r-- | assetFactory/object.cpp | 3 |
2 files changed, 5 insertions, 5 deletions
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 <assimp/cimport.h> #include <assimp/postprocess.h> #include <assimp/scene.h> -#include <future> +#include <format> #include <stb/stb_image.h> template<typename T> @@ -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>("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 <algorithm> +#include <format> 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; |