From 19a65b5bec6ed73d647017ee6a96a177a141132e Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 1 Jan 2024 21:27:31 +0100 Subject: [PATCH] pointlights: use std::min/max instead of their macro counterpart. --- lib/ivis_opengl/pielighting.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ivis_opengl/pielighting.cpp b/lib/ivis_opengl/pielighting.cpp index d5be43b753b..39247857eb4 100644 --- a/lib/ivis_opengl/pielighting.cpp +++ b/lib/ivis_opengl/pielighting.cpp @@ -34,12 +34,12 @@ PIELIGHT& LightMap::operator()(int32_t x, int32_t y) // Give one tile worth of leeway before asserting, for units/transporters coming in from off-map. ASSERT(x >= -1, "mapTile: x value is too small (%d,%d) in %dx%d", x, y, mapWidth, mapHeight); ASSERT(y >= -1, "mapTile: y value is too small (%d,%d) in %dx%d", x, y, mapWidth, mapHeight); - x = MAX(x, 0); - y = MAX(y, 0); + x = std::max(x, 0); + y = std::max(y, 0); ASSERT(x < mapWidth + 1, "mapTile: x value is too big (%d,%d) in %dx%d", x, y, mapWidth, mapHeight); ASSERT(y < mapHeight + 1, "mapTile: y value is too big (%d,%d) in %dx%d", x, y, mapWidth, mapHeight); - x = MIN(x, mapWidth - 1); - y = MIN(y, mapHeight - 1); + x = std::min(x, mapWidth - 1); + y = std::min(y, mapHeight - 1); return data[x + (y * mapWidth)]; } @@ -50,12 +50,12 @@ const PIELIGHT& LightMap::operator()(int32_t x, int32_t y) const // Give one tile worth of leeway before asserting, for units/transporters coming in from off-map. ASSERT(x >= -1, "mapTile: x value is too small (%d,%d) in %dx%d", x, y, mapWidth, mapHeight); ASSERT(y >= -1, "mapTile: y value is too small (%d,%d) in %dx%d", x, y, mapWidth, mapHeight); - x = MAX(x, 0); - y = MAX(y, 0); + x = std::max(x, 0); + y = std::max(y, 0); ASSERT(x < mapWidth + 1, "mapTile: x value is too big (%d,%d) in %dx%d", x, y, mapWidth, mapHeight); ASSERT(y < mapHeight + 1, "mapTile: y value is too big (%d,%d) in %dx%d", x, y, mapWidth, mapHeight); - x = MIN(x, mapWidth - 1); - y = MIN(y, mapHeight - 1); + x = std::min(x, mapWidth - 1); + y = std::min(y, mapHeight - 1); return data[x + (y * mapWidth)]; }