diff options
author | Aki <please@ignore.pl> | 2021-10-02 21:18:30 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-10-02 21:18:30 +0200 |
commit | 03bdf9c0fe25d3d9e765c13a2d18048088c3a3a0 (patch) | |
tree | 4041b56ea0b28fa4faba35b598c34f3c0af9f77d | |
parent | dee511588386db44ee134adf86b59ffa9a0a02fd (diff) | |
download | starshatter-03bdf9c0fe25d3d9e765c13a2d18048088c3a3a0.zip starshatter-03bdf9c0fe25d3d9e765c13a2d18048088c3a3a0.tar.gz starshatter-03bdf9c0fe25d3d9e765c13a2d18048088c3a3a0.tar.bz2 |
Replaced remaining minmax macros with std equivelants
-rw-r--r-- | Stars45/NetPlayer.cpp | 8 | ||||
-rw-r--r-- | Stars45/Projector.cpp | 8 | ||||
-rw-r--r-- | Stars45/StarshipTacticalAI.cpp | 8 |
3 files changed, 21 insertions, 3 deletions
diff --git a/Stars45/NetPlayer.cpp b/Stars45/NetPlayer.cpp index 1a15527..5bcfccc 100644 --- a/Stars45/NetPlayer.cpp +++ b/Stars45/NetPlayer.cpp @@ -36,6 +36,12 @@ Network Player (Director) class */ +#ifndef NOMINMAX +#define NOMINMAX +#endif + +#include <algorithm> + #include "MemDebug.h" #include "NetPlayer.h" #include "NetGame.h" @@ -446,7 +452,7 @@ NetPlayer::ExecFrame(double seconds) if (ship) { // bleed off the location error: if (loc_error.length() > 0 && bleed_time > 0) { - double fragment = min(seconds / BLEED, bleed_time); + double fragment = std::min(seconds / BLEED, bleed_time); ship->MoveTo(ship->Location() + loc_error * fragment); bleed_time -= fragment; } diff --git a/Stars45/Projector.cpp b/Stars45/Projector.cpp index 6881682..1c2e635 100644 --- a/Stars45/Projector.cpp +++ b/Stars45/Projector.cpp @@ -36,6 +36,12 @@ 3D Projection Camera class */ +#ifndef NOMINMAX +#define NOMINMAX +#endif + +#include <algorithm> + #include "MemDebug.h" #include "Projector.h" @@ -101,7 +107,7 @@ Projector::SetFieldOfView(double fov) xscreenscale = width / fov; yscreenscale = height / fov; - maxscale = max(xscreenscale, yscreenscale); + maxscale = std::max(xscreenscale, yscreenscale); xangle = atan(2.0/fov * maxscale/xscreenscale); yangle = atan(2.0/fov * maxscale/yscreenscale); diff --git a/Stars45/StarshipTacticalAI.cpp b/Stars45/StarshipTacticalAI.cpp index 977b86b..e00e8d2 100644 --- a/Stars45/StarshipTacticalAI.cpp +++ b/Stars45/StarshipTacticalAI.cpp @@ -36,6 +36,12 @@ Starship-specific mid-level (tactical) AI */ +#ifndef NOMINMAX +#define NOMINMAX +#endif + +#include <algorithm> + #include "MemDebug.h" #include "StarshipTacticalAI.h" #include "ShipAI.h" @@ -128,7 +134,7 @@ StarshipTacticalAI::FindThreat() continue; if (c_ship && c_ship != ship) { - double basis = max(contact->Range(ship), CELL_SIZE); + double basis = std::max(contact->Range(ship), CELL_SIZE); double ai_value = c_ship->AIValue() / basis; if (c_ship->GetIFF() == ship->GetIFF()) { |