summaryrefslogtreecommitdiff
path: root/source/camera.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/camera.c')
-rw-r--r--source/camera.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/camera.c b/source/camera.c
new file mode 100644
index 0000000..c905d74
--- /dev/null
+++ b/source/camera.c
@@ -0,0 +1,15 @@
+#include "../include/camera.h"
+
+CAMERA createCamera (int x, int y) {
+ // Create camera from a point
+ CAMERA temp;
+ temp.x = x;
+ temp.y = y;
+ return temp;
+}
+
+void applyCameraShift (CAMERA *camera, int *x, int *y) {
+ // Apply camera shift to a coordinate
+ *x = *x - camera->x;
+ *y = *y - camera->y;
+}