From 16b1619ddaf0bd9270f39bb55fd34e3602b0bea0 Mon Sep 17 00:00:00 2001 From: Javidx9 Date: Mon, 3 Sep 2018 23:43:14 +0100 Subject: [PATCH] Added NOMINMAX before windows.h --- OneLoneCoder_PGE_Balls2.cpp | 3 ++- olcPixelGameEngine.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OneLoneCoder_PGE_Balls2.cpp b/OneLoneCoder_PGE_Balls2.cpp index 8d6bf4a..4c9d3d2 100644 --- a/OneLoneCoder_PGE_Balls2.cpp +++ b/OneLoneCoder_PGE_Balls2.cpp @@ -35,6 +35,7 @@ Last Updated: 18/02/2017 #include #include +#include using namespace std; #include "olcPixelGameEngine.h" @@ -287,7 +288,7 @@ public: // how much of the segment is in the "shadow" of the object vector. The min and max clamp // this to lie between 0 and the line segment length, which is then normalised. We can // use this to calculate the closest point on the line segment - float t = max(0, min(fEdgeLength, (fLineX1 * fLineX2 + fLineY1 * fLineY2))) / fEdgeLength; + float t = std::max(0.0f, std::min(fEdgeLength, (fLineX1 * fLineX2 + fLineY1 * fLineY2))) / fEdgeLength; // Which we do here float fClosestPointX = edge.sx + t * fLineX1; diff --git a/olcPixelGameEngine.h b/olcPixelGameEngine.h index 454fa51..4464907 100644 --- a/olcPixelGameEngine.h +++ b/olcPixelGameEngine.h @@ -2,7 +2,7 @@ olcPixelGameEngine.h +-------------------------------------------------------------+ - | OneLoneCoder Pixel Game Engine v0.3 | + | OneLoneCoder Pixel Game Engine v0.4 | | "Like the command prompt console one, but not..." - javidx9 | +-------------------------------------------------------------+ @@ -143,6 +143,7 @@ // Include WinAPI + #define NOMINMAX #include #include @@ -413,7 +414,7 @@ namespace olc // All OneLoneCoder stuff will now exist in the "olc" namespace - +