mirror of
https://github.com/thes3m/XNI
synced 2024-12-26 13:26:06 +01:00
25 lines
596 B
C
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);
|
|
}
|