From 723f879f85f25c2d466146e08261e0ae993c72b6 Mon Sep 17 00:00:00 2001 From: Simponic Date: Tue, 11 Aug 2020 22:13:56 -0600 Subject: Added basic camera controls --- include/camera.h | 14 ++++++++++++++ include/map.h | 2 +- include/playerObject.h | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 include/camera.h (limited to 'include') diff --git a/include/camera.h b/include/camera.h new file mode 100644 index 0000000..7984763 --- /dev/null +++ b/include/camera.h @@ -0,0 +1,14 @@ +#include "types.h" + +#ifndef CAMERA_H +#define CAMERA_H + +typedef struct CAMERA { + int x; + int y; +} ALIGN(4) CAMERA; + +CAMERA createCamera(); +void applyCameraShift(); + +#endif // CAMERA_H diff --git a/include/map.h b/include/map.h index 9a8a264..1bef313 100644 --- a/include/map.h +++ b/include/map.h @@ -3,6 +3,6 @@ #ifndef MAP_H #define MAP_H -extern const int map1[7][20]; +extern const int map1[9][20]; #endif // MAP_H diff --git a/include/playerObject.h b/include/playerObject.h index 7feb894..acfadbc 100644 --- a/include/playerObject.h +++ b/include/playerObject.h @@ -4,6 +4,7 @@ #include "toolbox.h" #include "fixed.h" #include "sinlut.h" +#include "camera.h" #ifndef PLAYEROBJECT_H #define PLAYEROBJECT_H @@ -11,6 +12,7 @@ #define GRAVITY 0.75 typedef struct playerObject { + CAMERA camera; VELOCITY vel; POINT pt; u32 rotation; // Rotation amount -- cgit v1.2.3-70-g09d2