aboutsummaryrefslogtreecommitdiff
path: root/src/engine/camera.c
diff options
context:
space:
mode:
authorFlenk008 <frenk_0_0@hotmail.com>2023-03-13 18:02:59 +0100
committerFlenk008 <frenk_0_0@hotmail.com>2023-03-13 18:02:59 +0100
commita9ad8e0a8ac5346108f1e2c1a0bf9360fadc20da (patch)
treeb3b772e0fc396aa7d09d8581c61d68b963394ac4 /src/engine/camera.c
parent4f489426e05fb3b296998b17859d8702cc4f37e1 (diff)
Revert "Merge branch 'dev' of https://github.com/Flenk008/avans-arcade into dev"
This reverts commit 4f489426e05fb3b296998b17859d8702cc4f37e1, reversing changes made to e47f7fa198229b8598b8ab03ef8b2483f7c685bc.
Diffstat (limited to 'src/engine/camera.c')
-rw-r--r--src/engine/camera.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/engine/camera.c b/src/engine/camera.c
deleted file mode 100644
index e756bd4..0000000
--- a/src/engine/camera.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "engine/camera.h"
-
-#include "ppu/consts.h"
-
-
-vec_cor hh_update_camera(vec_cen new, vec2 min, vec2 max){
-
- //TODO: change floating point math to fix point math
- //TODO: fix buggy y-axis ??
-
- // new = vec_cen2cor(new,(vec2){.x=max.x/2,.y=max.y/2});
- new = vec_cen2cor((vec2){.x=new.x+(HH_PPU_SPRITE_WIDTH/2),.y=(new.y+(HH_PPU_SPRITE_HEIGHT/2))*2},(vec2){.x=max.x/2,.y=max.y/2});
- // new.x = new.x << HH_MATH_FIXED_POINT;
- // new.y = new.y << HH_MATH_FIXED_POINT;
- static vec_cor old;
- // old.x = old.x << HH_MATH_FIXED_POINT;
- // old.y = old.y << HH_MATH_FIXED_POINT;
-
- // int16_t some = 0;
- // some = some <<= HH_MATH_FIXED_POINT-1;
-
- new.x = (int)((float)new.x*0.1f + (float)old.x*0.9f);
- new.y = (int)((float)new.y*0.1f + (float)old.y*0.9f);
-
- // old.x = old.x >> HH_MATH_FIXED_POINT;
- // old.y = old.y >> HH_MATH_FIXED_POINT;
-
-
- old.x = CLAMP(new.x,min.x,max.x);
- old.y = CLAMP(new.y,min.y,max.y);
-
- return old;
-}
-