From c9ef075fbbb57f9968fbce39b12fbd82a89e7ef6 Mon Sep 17 00:00:00 2001 From: NielsCoding <101340368+NielsCoding@users.noreply.github.com> Date: Sat, 11 Mar 2023 09:32:11 +0100 Subject: moved files --- src/engine/TODO/draw_screen.h | 1 - src/engine/TODO/level.h | 4 ---- src/engine/TODO/maths.h | 17 ----------------- src/engine/draw_screen.h | 1 + src/engine/level.h | 4 ++++ src/engine/maths.h | 17 +++++++++++++++++ 6 files changed, 22 insertions(+), 22 deletions(-) delete mode 100644 src/engine/TODO/draw_screen.h delete mode 100644 src/engine/TODO/level.h delete mode 100644 src/engine/TODO/maths.h create mode 100644 src/engine/draw_screen.h create mode 100644 src/engine/level.h create mode 100644 src/engine/maths.h (limited to 'src') diff --git a/src/engine/TODO/draw_screen.h b/src/engine/TODO/draw_screen.h deleted file mode 100644 index f5d7507..0000000 --- a/src/engine/TODO/draw_screen.h +++ /dev/null @@ -1 +0,0 @@ -// every function call for drawing the screen goes here. diff --git a/src/engine/TODO/level.h b/src/engine/TODO/level.h deleted file mode 100644 index 09f77e7..0000000 --- a/src/engine/TODO/level.h +++ /dev/null @@ -1,4 +0,0 @@ -//deal with loading/saving the correct level - -/** @brief */ -void hh_map_load(); diff --git a/src/engine/TODO/maths.h b/src/engine/TODO/maths.h deleted file mode 100644 index c7f1b44..0000000 --- a/src/engine/TODO/maths.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include -// #include - -typedef struct { - uint32_t x,y; -} vec2; - -typedef vec2 vec_cen;//centered -typedef vec2 vec_cor;//left upper corner - -//fixed point at decimal 7lsb (world positions in pixels (with fixed decimal point)) -#define HH_MATH_FIXED_POINT 7 - -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define MAX(a,b) (((a)>(b))?(a):(b)) -#define CLAMP(N,LOWER,UPPER) (MIN(MAX(LOWER, N), UPPER)) diff --git a/src/engine/draw_screen.h b/src/engine/draw_screen.h new file mode 100644 index 0000000..f5d7507 --- /dev/null +++ b/src/engine/draw_screen.h @@ -0,0 +1 @@ +// every function call for drawing the screen goes here. diff --git a/src/engine/level.h b/src/engine/level.h new file mode 100644 index 0000000..09f77e7 --- /dev/null +++ b/src/engine/level.h @@ -0,0 +1,4 @@ +//deal with loading/saving the correct level + +/** @brief */ +void hh_map_load(); diff --git a/src/engine/maths.h b/src/engine/maths.h new file mode 100644 index 0000000..c7f1b44 --- /dev/null +++ b/src/engine/maths.h @@ -0,0 +1,17 @@ +#pragma once +#include +// #include + +typedef struct { + uint32_t x,y; +} vec2; + +typedef vec2 vec_cen;//centered +typedef vec2 vec_cor;//left upper corner + +//fixed point at decimal 7lsb (world positions in pixels (with fixed decimal point)) +#define HH_MATH_FIXED_POINT 7 + +#define MIN(a,b) (((a)<(b))?(a):(b)) +#define MAX(a,b) (((a)>(b))?(a):(b)) +#define CLAMP(N,LOWER,UPPER) (MIN(MAX(LOWER, N), UPPER)) -- cgit v1.2.3 From f4e4b53fe3ef96a7bd2d4052c5a181f05945a0aa Mon Sep 17 00:00:00 2001 From: NielsCoding <101340368+NielsCoding@users.noreply.github.com> Date: Sat, 11 Mar 2023 11:16:50 +0100 Subject: makefile engine --- src/engine/draw_screen.h | 8 ++++++++ src/engine/engine.c | 3 +++ src/engine/level.h | 1 + src/makefile | 3 ++- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/engine/engine.c (limited to 'src') diff --git a/src/engine/draw_screen.h b/src/engine/draw_screen.h index f5d7507..4af5865 100644 --- a/src/engine/draw_screen.h +++ b/src/engine/draw_screen.h @@ -1 +1,9 @@ +#pragma once + + // every function call for drawing the screen goes here. +#include "engine/maths.h" + +#include +uint16_t hh_world_to_tile(vec2 pos); +void hh_draw_screen(vec2 viewport); \ No newline at end of file diff --git a/src/engine/engine.c b/src/engine/engine.c new file mode 100644 index 0000000..f3410a4 --- /dev/null +++ b/src/engine/engine.c @@ -0,0 +1,3 @@ +#include "engine/draw_screen.h" +#include "engine/level.h" +#include "engine/maths.h" diff --git a/src/engine/level.h b/src/engine/level.h index 09f77e7..8d610dd 100644 --- a/src/engine/level.h +++ b/src/engine/level.h @@ -1,3 +1,4 @@ +#pragma once //deal with loading/saving the correct level /** @brief */ diff --git a/src/makefile b/src/makefile index c69bfb5..96751fb 100644 --- a/src/makefile +++ b/src/makefile @@ -30,7 +30,8 @@ CFLAGS += $(if $(DESKTOP), -DHH_TARGET_DESKTOP, ) LOCAL_SRCS += main.c \ ppu/internals.c \ ppu/ppu.c \ - demo.c + demo.c \ + engine/engine.c CFLAGS += $(SHARED_FLAGS) LFLAGS += $(SHARED_FLAGS) -- cgit v1.2.3