From 27c3c7dccb1069d7a7e9d26645261cb5d9c0482d Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Mon, 10 Nov 2025 22:03:43 +0100 Subject: [PATCH] chore: use c++ numeric limits instead of c macros --- src/ObjLoading/Game/T6/BSP/BSP.h | 3 ++- src/ObjLoading/Game/T6/BSP/BSPCreator.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ObjLoading/Game/T6/BSP/BSP.h b/src/ObjLoading/Game/T6/BSP/BSP.h index 26387056..5e2cc38d 100644 --- a/src/ObjLoading/Game/T6/BSP/BSP.h +++ b/src/ObjLoading/Game/T6/BSP/BSP.h @@ -4,6 +4,7 @@ #include "Utils/Logging/Log.h" #include +#include #include #include @@ -59,7 +60,7 @@ namespace BSP // These values are hardcoded ingame and will break the map if they are changed namespace BSPGameConstants { - constexpr unsigned int MAX_COLLISION_VERTS = UINT16_MAX; + constexpr unsigned int MAX_COLLISION_VERTS = std::numeric_limits::max(); constexpr size_t MAX_AABB_TREE_CHILDREN = 128; diff --git a/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp b/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp index 32348cb6..eec104e9 100644 --- a/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp +++ b/src/ObjLoading/Game/T6/BSP/BSPCreator.cpp @@ -3,6 +3,7 @@ #include "BSPUtil.h" #include +#include #include using namespace BSP; @@ -33,9 +34,9 @@ namespace 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::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::max()); return; } }