2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-11-23 21:22:07 +00:00

chore: use c++ numeric limits instead of c macros

This commit is contained in:
Jan Laupetin
2025-11-10 22:03:43 +01:00
parent 664d307e38
commit 27c3c7dccb
2 changed files with 5 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
#include "Utils/Logging/Log.h" #include "Utils/Logging/Log.h"
#include <cstdint> #include <cstdint>
#include <limits>
#include <string> #include <string>
#include <vector> #include <vector>
@@ -59,7 +60,7 @@ namespace BSP
// These values are hardcoded ingame and will break the map if they are changed // These values are hardcoded ingame and will break the map if they are changed
namespace BSPGameConstants namespace BSPGameConstants
{ {
constexpr unsigned int MAX_COLLISION_VERTS = UINT16_MAX; constexpr unsigned int MAX_COLLISION_VERTS = std::numeric_limits<std::uint16_t>::max();
constexpr size_t MAX_AABB_TREE_CHILDREN = 128; constexpr size_t MAX_AABB_TREE_CHILDREN = 128;

View File

@@ -3,6 +3,7 @@
#include "BSPUtil.h" #include "BSPUtil.h"
#include <format> #include <format>
#include <limits>
#include <ufbx.h> #include <ufbx.h>
using namespace BSP; using namespace BSP;
@@ -33,9 +34,9 @@ namespace
for (size_t k = 0; k < mesh->num_indices; k++) for (size_t k = 0; k < mesh->num_indices; k++)
{ {
if (mesh->vertex_indices[k] > UINT16_MAX) if (mesh->vertex_indices[k] > std::numeric_limits<std::uint16_t>::max())
{ {
con::warn("ignoring mesh {}, it has more than {} indices.", node->name.data, UINT16_MAX); con::warn("ignoring mesh {}, it has more than {} indices.", node->name.data, std::numeric_limits<std::uint16_t>::max());
return; return;
} }
} }