From 6202717443ce13e5c2e8552f338379f29585e761 Mon Sep 17 00:00:00 2001 From: Pedro Gimeno Date: Mon, 27 Jul 2020 20:43:15 +0200 Subject: [PATCH] Use gk::abs instead of defining an ABS macro --- external/gamekit | 2 +- source/common/core/EngineConfig.hpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/external/gamekit b/external/gamekit index 59900e70..63755c6b 160000 --- a/external/gamekit +++ b/external/gamekit @@ -1 +1 @@ -Subproject commit 59900e7001e54a3c33049a7cd0168dffb2214bec +Subproject commit 63755c6be5d724657881f06fd6a322694e9672d1 diff --git a/source/common/core/EngineConfig.hpp b/source/common/core/EngineConfig.hpp index b4517a95..62d1b28e 100644 --- a/source/common/core/EngineConfig.hpp +++ b/source/common/core/EngineConfig.hpp @@ -27,7 +27,7 @@ #ifndef ENGINECONFIG_HPP_ #define ENGINECONFIG_HPP_ -#define ABS(x) ((x) < 0? -(x) : (x)) +#include namespace { // Only used in Client @@ -41,9 +41,9 @@ namespace { constexpr float DIST_FAR = 1000.0f; constexpr float SKYBOX_OFFSET_Z = -50.f; - constexpr float DIST_SUN = DIST_FAR - ABS(SKYBOX_OFFSET_Z) - 50.f; - constexpr float DIST_MOON = DIST_FAR - ABS(SKYBOX_OFFSET_Z) - 50.f; - constexpr float DIST_STARS = DIST_FAR - ABS(SKYBOX_OFFSET_Z) - 25.f; + constexpr float DIST_SUN = DIST_FAR - gk::abs(SKYBOX_OFFSET_Z) - 50.f; + constexpr float DIST_MOON = DIST_FAR - gk::abs(SKYBOX_OFFSET_Z) - 50.f; + constexpr float DIST_STARS = DIST_FAR - gk::abs(SKYBOX_OFFSET_Z) - 25.f; constexpr float DIST_2D_NEAR = -512.0f; constexpr float DIST_2D_FAR = 512.0f;