1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Remove the last usage of Math.hpp

This commit is contained in:
Linus Unnebäck
2018-08-12 13:04:00 +01:00
parent fd07be587a
commit 2b3370228b
2 changed files with 4 additions and 29 deletions

View File

@@ -1,27 +0,0 @@
/*****************************************************************************
* Copyright (c) 2014-2018 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include <algorithm>
/**
* Common mathematical functions.
*/
namespace Math
{
template<typename T> static T Sign(T x)
{
if (x < 0)
return -1;
if (x > 0)
return 1;
return 0;
}
} // namespace Math

View File

@@ -18,7 +18,6 @@
#include "../core/File.h"
#include "../core/FileIndex.hpp"
#include "../core/FileStream.hpp"
#include "../core/Math.hpp"
#include "../core/Path.hpp"
#include "../core/String.hpp"
#include "../core/Util.hpp"
@@ -48,7 +47,10 @@ static int32_t ScenarioCategoryCompare(int32_t categoryA, int32_t categoryB)
return -1;
if (categoryB == SCENARIO_CATEGORY_BUILD_YOUR_OWN)
return 1;
return Math::Sign(categoryA - categoryB);
if (categoryA < categoryB)
return -1;
else
return 1;
}
static int32_t scenario_index_entry_CompareByCategory(const scenario_index_entry& entryA, const scenario_index_entry& entryB)