mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-24 04:11:50 -04:00
Replace StringUtils::format in components/detournavigator
This commit is contained in:
parent
2b7f775ffe
commit
a0d081adb9
@ -10,7 +10,6 @@
|
|||||||
#include <components/debug/debuglog.hpp>
|
#include <components/debug/debuglog.hpp>
|
||||||
#include <components/loadinglistener/loadinglistener.hpp>
|
#include <components/loadinglistener/loadinglistener.hpp>
|
||||||
#include <components/misc/strings/conversion.hpp>
|
#include <components/misc/strings/conversion.hpp>
|
||||||
#include <components/misc/strings/format.hpp>
|
|
||||||
#include <components/misc/thread.hpp>
|
#include <components/misc/thread.hpp>
|
||||||
|
|
||||||
#include <DetourNavMesh.h>
|
#include <DetourNavMesh.h>
|
||||||
@ -20,6 +19,7 @@
|
|||||||
#include <boost/geometry.hpp>
|
#include <boost/geometry.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <format>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
@ -78,7 +78,7 @@ namespace DetourNavigator
|
|||||||
|
|
||||||
std::string makeRevision(const Version& version)
|
std::string makeRevision(const Version& version)
|
||||||
{
|
{
|
||||||
return Misc::StringUtils::format(".%zu.%zu", version.mGeneration, version.mRevision);
|
return std::format(".{}.{}", version.mGeneration, version.mRevision);
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeDebugRecastMesh(
|
void writeDebugRecastMesh(
|
||||||
@ -90,9 +90,8 @@ namespace DetourNavigator
|
|||||||
if (settings.mEnableRecastMeshFileNameRevision)
|
if (settings.mEnableRecastMeshFileNameRevision)
|
||||||
revision = makeRevision(recastMesh.getVersion());
|
revision = makeRevision(recastMesh.getVersion());
|
||||||
writeToFile(recastMesh,
|
writeToFile(recastMesh,
|
||||||
Misc::StringUtils::format(
|
std::format("{}{}.{}.", settings.mRecastMeshPathPrefix, tilePosition.x(), tilePosition.y()), revision,
|
||||||
"%s%d.%d.", settings.mRecastMeshPathPrefix, tilePosition.x(), tilePosition.y()),
|
settings.mRecast);
|
||||||
revision, settings.mRecast);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeDebugNavMesh(
|
void writeDebugNavMesh(
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <components/debug/debuglog.hpp>
|
#include <components/debug/debuglog.hpp>
|
||||||
#include <components/misc/compression.hpp>
|
#include <components/misc/compression.hpp>
|
||||||
#include <components/misc/strings/format.hpp>
|
|
||||||
#include <components/sqlite3/db.hpp>
|
#include <components/sqlite3/db.hpp>
|
||||||
#include <components/sqlite3/request.hpp>
|
#include <components/sqlite3/request.hpp>
|
||||||
|
|
||||||
@ -11,6 +10,7 @@
|
|||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <format>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ namespace DetourNavigator
|
|||||||
|
|
||||||
void setMaxPageCount(sqlite3& db, std::uint64_t value)
|
void setMaxPageCount(sqlite3& db, std::uint64_t value)
|
||||||
{
|
{
|
||||||
const auto query = Misc::StringUtils::format("pragma max_page_count = %lu;", value);
|
const auto query = std::format("pragma max_page_count = {};", value);
|
||||||
if (const int ec = sqlite3_exec(&db, query.c_str(), nullptr, nullptr, nullptr); ec != SQLITE_OK)
|
if (const int ec = sqlite3_exec(&db, query.c_str(), nullptr, nullptr, nullptr); ec != SQLITE_OK)
|
||||||
throw std::runtime_error("Failed set max page count: " + std::string(sqlite3_errmsg(&db)));
|
throw std::runtime_error("Failed set max page count: " + std::string(sqlite3_errmsg(&db)));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user