summaryrefslogtreecommitdiffhomepage
path: root/Stars45
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45')
-rw-r--r--Stars45/NetPlayer.cpp8
-rw-r--r--Stars45/Projector.cpp8
-rw-r--r--Stars45/StarshipTacticalAI.cpp8
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()) {