From 8527f0a34bcf8588bf6d607e0a147370e836eaa6 Mon Sep 17 00:00:00 2001 From: jeefo Date: Fri, 16 Sep 2016 22:55:31 +0300 Subject: [PATCH] fixed android compiling --- include/corelib.h | 6 +----- source/manager.cpp | 2 +- source/navigate.cpp | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/corelib.h b/include/corelib.h index ec06ab5..57dfddf 100644 --- a/include/corelib.h +++ b/include/corelib.h @@ -47,6 +47,7 @@ typedef unsigned long uint32; // Own min/max implementation template inline T A_min (T a, T b) { return a < b ? a : b; } template inline T A_max (T a, T b) { return a > b ? a : b; } +template inline T A_clamp (T x, T a, T b) { return A_min (A_max (x, a), b); } // Fast stricmp got somewhere from chromium static inline int A_stricmp (const char *str1, const char *str2, int length = -1) @@ -386,11 +387,6 @@ namespace Math { return AngleNormalize (destAngle - srcAngle); } - - template Type Clamp (Type x, Type a, Type b) - { - return (x < a) ? a : ((x > b) ? b : x); - } } // diff --git a/source/manager.cpp b/source/manager.cpp index c75e0de..95013fb 100644 --- a/source/manager.cpp +++ b/source/manager.cpp @@ -1271,7 +1271,7 @@ void Bot::Kick (bool keepQuota) // keep quota number up to date if (!keepQuota) - yb_quota.SetInt (Clamp (yb_quota.GetInt () - 1, 0, yb_quota.GetInt ())); + yb_quota.SetInt (A_clamp (yb_quota.GetInt () - 1, 0, yb_quota.GetInt ())); } void Bot::StartGame (void) diff --git a/source/navigate.cpp b/source/navigate.cpp index a497221..64688da 100644 --- a/source/navigate.cpp +++ b/source/navigate.cpp @@ -3162,7 +3162,7 @@ void Bot::UpdateBodyAngles (void) void Bot::UpdateLookAngles (void) { - const float delta = Clamp (engine.Time () - m_lookUpdateTime, MATH_EQEPSILON, 0.05f); + const float delta = A_clamp (engine.Time () - m_lookUpdateTime, MATH_EQEPSILON, 0.05f); m_lookUpdateTime = engine.Time (); // adjust all body and view angles to face an absolute vector