From 03bdf9c0fe25d3d9e765c13a2d18048088c3a3a0 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 2 Oct 2021 21:18:30 +0200 Subject: Replaced remaining minmax macros with std equivelants --- Stars45/NetPlayer.cpp | 8 +++++++- Stars45/Projector.cpp | 8 +++++++- Stars45/StarshipTacticalAI.cpp | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'Stars45') 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 + #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 + #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 + #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()) { -- cgit v1.1