- fixed compile errors.

This commit is contained in:
Christoph Oelckers 2016-01-09 11:44:05 +01:00
parent a5054b0882
commit 4b3adf548a
2 changed files with 7 additions and 6 deletions

View file

@ -7,7 +7,7 @@
*/
#include <cassert>
#include "templates.h"
#include "GuillotineBinPack.h"
using namespace std;
@ -395,7 +395,7 @@ int GuillotineBinPack::ScoreBestShortSideFit(int width, int height, const Rect &
{
int leftoverHoriz = abs(freeRect.width - width);
int leftoverVert = abs(freeRect.height - height);
int leftover = min(leftoverHoriz, leftoverVert);
int leftover = MIN(leftoverHoriz, leftoverVert);
return leftover;
}
@ -403,7 +403,7 @@ int GuillotineBinPack::ScoreBestLongSideFit(int width, int height, const Rect &f
{
int leftoverHoriz = abs(freeRect.width - width);
int leftoverVert = abs(freeRect.height - height);
int leftover = max(leftoverHoriz, leftoverVert);
int leftover = MAX(leftoverHoriz, leftoverVert);
return leftover;
}

View file

@ -7,6 +7,7 @@
*/
#include <cassert>
#include "templates.h"
#include "SkylineBinPack.h"
@ -131,7 +132,7 @@ bool SkylineBinPack::RectangleFits(int skylineNodeIndex, int width, int height,
y = skyLine[skylineNodeIndex].y;
while(widthLeft > 0)
{
y = max(y, skyLine[i].y);
y = MAX(y, skyLine[i].y);
if (y + height > binHeight)
return false;
widthLeft -= skyLine[i].width;
@ -152,7 +153,7 @@ int SkylineBinPack::ComputeWastedArea(int skylineNodeIndex, int width, int heigh
break;
int leftSide = skyLine[skylineNodeIndex].x;
int rightSide = min(rectRight, leftSide + skyLine[skylineNodeIndex].width);
int rightSide = MIN(rectRight, leftSide + skyLine[skylineNodeIndex].width);
assert(y >= skyLine[skylineNodeIndex].y);
wastedArea += (rightSide - leftSide) * (y - skyLine[skylineNodeIndex].y);
}
@ -179,7 +180,7 @@ void SkylineBinPack::AddWasteMapArea(int skylineNodeIndex, int width, int height
break;
int leftSide = skyLine[skylineNodeIndex].x;
int rightSide = min(rectRight, leftSide + skyLine[skylineNodeIndex].width);
int rightSide = MIN(rectRight, leftSide + skyLine[skylineNodeIndex].width);
assert(y >= skyLine[skylineNodeIndex].y);
Rect waste;