diff options
author | UnavailableDev <ggwildplay@gmail.com> | 2023-04-03 10:09:40 +0200 |
---|---|---|
committer | UnavailableDev <ggwildplay@gmail.com> | 2023-04-03 10:09:40 +0200 |
commit | 05504df10934cac60b774fb10e86593ec3897510 (patch) | |
tree | 89a418bb7477904f394e460d5e661c3047117030 /src/engine/sprite_controller.c | |
parent | 54c3e1139e3e0e328f7ce3e8a2a61b0bf530a772 (diff) | |
parent | 0a014f39c375c0cf28de70ebaab6cb0a5266f3c2 (diff) |
Merge branch 'dev' of https://github.com/UnavailableDev/avans-arcade into dev
Diffstat (limited to 'src/engine/sprite_controller.c')
-rw-r--r-- | src/engine/sprite_controller.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/engine/sprite_controller.c b/src/engine/sprite_controller.c new file mode 100644 index 0000000..b38b647 --- /dev/null +++ b/src/engine/sprite_controller.c @@ -0,0 +1,24 @@ +#include <stdint.h> + +#include "engine/sprite_controller.h" +#include "ppu/types.h" +#include "ppu/consts.h" +#include "ppu/ppu.h" + +uint8_t hh_get_palette(uint8_t tile_idx) { + return hh_g_sprite_palette[tile_idx]; +} + +void hh_setup_palettes(){ + //TODO: use simpler function + for (int idx = 0; idx < HH_PPU_PALETTE_COUNT; idx++) { + for (int col = 0; col < HH_PPU_PALETTE_COLOR_COUNT; col++) { + hh_ppu_update_color(idx,col,hh_g_palette[idx][col]); + } + } + // hh_ppu_update_palette_table(hh_g_palette); +} + +bool hh_colidable(uint8_t tile_idx){ + return (hh_get_palette(tile_idx) != 0); +} |