From 7f856467a086ec9a3ebd1ccdf12e578dffb9c98b Mon Sep 17 00:00:00 2001 From: Simponic Date: Sat, 8 Aug 2020 18:16:34 -0600 Subject: Player added --- include/point.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/point.h (limited to 'include/point.h') 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 -- cgit v1.2.3-70-g09d2