Added NOMINMAX before windows.h

This commit is contained in:
Javidx9
2018-09-03 23:43:14 +01:00
committed by GitHub
parent fb45b9bcdc
commit 16b1619dda
2 changed files with 5 additions and 3 deletions

View File

@@ -35,6 +35,7 @@ Last Updated: 18/02/2017
#include <iostream>
#include <string>
#include <algorithm>
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;