1
0
mirror of https://github.com/thes3m/XNI synced 2024-12-26 13:26:06 +01:00
Matej Jan d04d7bf8f3 All around update and fixes
git-svn-id: http://xni.googlecode.com/svn/XNI@104 ac433895-eea3-a490-d80a-17149a75e588
2012-05-14 08:40:49 +00:00

25 lines
596 B
C

typedef struct {
int x;
int y;
} PointStruct;
static inline PointStruct PointMake(int x, int y) {
PointStruct point;
point.x = x;
point.y = y;
return point;
}
static inline void PointSet(PointStruct *point, int x, int y) {
point->x = x;
point->y = y;
}
static inline void PointAdd(PointStruct *value1, PointStruct *value2, PointStruct *result) {
PointSet(result, value1->x + value2->x, value1->y + value2->y);
}
static inline void PointSubtract(PointStruct *value1, PointStruct *value2, PointStruct *result) {
PointSet(result, value1->x - value2->x, value1->y - value2->y);
}