diff options
Diffstat (limited to 'include/point.h')
-rw-r--r-- | include/point.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/point.h b/include/point.h new file mode 100644 index 0000000..5c69422 --- /dev/null +++ b/include/point.h @@ -0,0 +1,28 @@ +#include "types.h" +#include "fixed.h" + +#ifndef POINT_H +#define POINT_H + +typedef struct POINT { + FIXED x; + FIXED y; +} ALIGN(4) POINT; + +static inline POINT createPoint (FIXED x, FIXED y) { + // Create a point from data + POINT temp; + temp.x = x; + temp.y = y; + return temp; +} + +static inline POINT addPoint (POINT *a, POINT *b) { + // Add two points + POINT temp; + temp.x = a->x + b->x; + temp.y = a->y + b->y; + return temp; +} + +#endif // POINT_H |