Changed min,max to MIN,MAX and define them little better

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@310 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2002-12-04 02:44:52 +00:00
parent 518e9b9f1f
commit 9b371f3282
+8 -6
View File
@@ -18,8 +18,10 @@
#include "gfxintrn.h" #include "gfxintrn.h"
#define min(a, b) ((a <= b) ? a : b) #undef MIN
#define max(a, b) ((a >= b) ? a : b) #define MIN(a, b) (((a) <= (b)) ? (a) : (b))
#undef MAX
#define MAX(a, b) (((a) >= (b)) ? (a) : (b))
INTERSECT_CODE INTERSECT_CODE
BoxIntersect (PRECT pr1, PRECT pr2, PRECT pinter) BoxIntersect (PRECT pr1, PRECT pr2, PRECT pinter)
@@ -105,12 +107,12 @@ BoxUnion (PRECT pr1, PRECT pr2, PRECT punion)
COORD x2, y2, w2, h2; COORD x2, y2, w2, h2;
// Union is A AND B, put together, correct? Returns a bigger box that // Union is A AND B, put together, correct? Returns a bigger box that
// encompasses the two. // encompasses the two.
punion->corner.x = min(pr1->corner.x, pr2->corner.x); punion->corner.x = MIN(pr1->corner.x, pr2->corner.x);
punion->corner.y = min(pr1->corner.y, pr2->corner.y); punion->corner.y = MIN(pr1->corner.y, pr2->corner.y);
punion->extent.width = max(pr1->corner.x + pr1->extent.width, punion->extent.width = MAX(pr1->corner.x + pr1->extent.width,
pr2->corner.x + pr2->extent.width) - punion->corner.x; pr2->corner.x + pr2->extent.width) - punion->corner.x;
punion->extent.height = max(pr1->corner.y + pr1->extent.height, punion->extent.height = MAX(pr1->corner.y + pr1->extent.height,
pr2->corner.y + pr2->extent.height) - punion->corner.y; pr2->corner.y + pr2->extent.height) - punion->corner.y;