-
Notifications
You must be signed in to change notification settings - Fork 1
/
rect.h
64 lines (54 loc) · 1.5 KB
/
rect.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// rect.h
// XBolo Map Editor
//
// Created by Robert Chrzanowski on 11/11/04.
// Copyright 2004 Robert Chrzanowski. All rights reserved.
//
#ifndef __RECT__
#define __RECT__
typedef struct GSPoint {
int x;
int y;
} GSPoint;
typedef struct GSRange {
int origin;
int size;
} GSRange;
typedef struct GSSize {
int width;
int height;
} GSSize;
typedef struct GSRect {
GSPoint origin;
GSSize size;
} GSRect;
GSPoint GSMakePoint(int x, int y);
int GSEqualPoints(GSPoint p1, GSPoint p2);
GSRange GSMakeRange(int origin, unsigned size);
int GSIntersectsRange(GSRange r1, GSRange r2);
int GSContainsRange(GSRange r1, GSRange r2);
int GSLocationInRange(GSRange r, int x);
GSSize GSMakeSize(unsigned width, unsigned height);
int GSEqualSizes(GSSize s1, GSSize s2);
GSRect GSMakeRect(int x, int y, unsigned w, unsigned h);
int GSHeight(GSRect r);
int GSWidth(GSRect r);
int GSMaxX(GSRect r);
int GSMaxY(GSRect r);
int GSMidX(GSRect r);
int GSMidY(GSRect r);
int GSMinX(GSRect r);
int GSMinY(GSRect r);
GSRect GSOffsetRect(GSRect r, int dx, int dy);
int GSPointInRect(GSRect r, GSPoint p);
GSRect GSUnionRect(GSRect r1, GSRect r2);
int GSContainsRect(GSRect r1, GSRect r2);
int GSEqualRects(GSRect r1, GSRect r2);
int GSIsEmptyRect(GSRect r);
GSRect GSInsetRect(GSRect r, int dx, int dy);
GSRect GSIntersectionRect(GSRect r1, GSRect r2);
int GSIntersectsRect(GSRect r1, GSRect r2);
void GSSplitRect(GSRect r, int x, int y, GSRect *rects);
void GSSubtractRect(GSRect r1, GSRect r2, GSRect *rects);
#endif // __RECT__