#pragma once #include #include "ppu/types.h" #include "static/tilemap.h" // handles sprites // Bg sprites // Fg or entity sprites //TODO: pack data inside of sprite_palette LUT //HH_PPU_PALETTE_COUNT #define HH_PAL_IDX_SKY 0 #define HH_PAL_IDX_BRICK 1 #define HH_PAL_IDX_SLIME 2 #define HH_PAL_IDX_HUD 2 #define HH_PAL_IDX_UPGRADE 2 #define HH_PAL_IDX_BULLET 3 #define HH_PAL_IDX_GOZER 3 #define HH_PAL_IDX_TITLE_SCREEN_ICON 3 #define HH_PAL_IDX_CRATE 4 #define HH_PAL_IDX_SHOP 5 #define HH_PAL_IDX_FONT 6 #define HH_PAL_IDX_DEV 7 const static uint8_t hh_g_sprite_palette[HH_TM_GROUPS] = { HH_PAL_IDX_SKY, HH_PAL_IDX_BRICK, HH_PAL_IDX_CRATE, HH_PAL_IDX_SHOP, // HH_PAL_IDX_SHOP, HH_PAL_IDX_TITLE_SCREEN_ICON, HH_PAL_IDX_TITLE_SCREEN_ICON, HH_PAL_IDX_HUD, HH_PAL_IDX_UPGRADE, HH_PAL_IDX_BULLET, HH_PAL_IDX_GOZER, HH_PAL_IDX_SLIME, HH_PAL_IDX_SLIME, HH_PAL_IDX_DEV, HH_PAL_IDX_FONT }; const static hh_ppu_loc_palette_table_t hh_g_palette = { {//palette info here {0x1,0x2,0x3}, {0x0,0x0,0x0}, {0x0,0x0,0x0}, {0x0,0x0,0x0}, {0x0,0x0,0x0}, {0x0,0x0,0x0}, {0x0,0x0,0x0}, {0x0,0x0,0x0}}, {//Bricks {0x1,0x2,0x3},//01 {0x0,0x0,0x1},//25 {0x1,0x1,0x1},//26 {0x1,0x1,0x2},//27 {0x2,0x2,0x3},//28 {0x3,0x4,0x5},//29 {0x5,0x1,0x7}, {0xd,0x8,0xa}},//24 {//slime {0x1,0x2,0x3}, {0x1,0x3,0x2}, {0x4,0x8,0x3}, {0x7,0xa,0x4},//hp HUD {0xa,0xc,0x5}, {0xa,0x3,0x3}, {0x0,0x0,0x1}, {0xe,0xe,0xe}}, {//player //TODO: use one less color && update player indexed sprites {0x0,0x0,0x0}, {0x1,0x1,0x1}, {0x4,0x2,0x5}, {0x7,0x3,0x7}, {0xe,0xe,0xe}, {0x7,0x2,0x3}, //elemental {0xc,0x5,0x3}, {0xe,0xc,0x7}}, {//crates {0x5,0x7,0x7}, {0x3,0x1,0x2}, {0x6,0x2,0x2}, {0x7,0x4,0x4}, {0xa,0x7,0x5}, {0x0,0x0,0x0}, {0x0,0x0,0x0}, {0x0,0x0,0x0}}, {//shop // {0x1,0x2,0x3}, // {0x0,0x0,0x1}, // {0x0,0x0,0x0}, // {0x0,0x0,0x0}, // {0x0,0x0,0x0}, // {0x0,0x0,0x0}, // {0x0,0x0,0x0}, // {0x0,0x0,0x0}}, {0x1, 0x2, 0x3},//0 {0x0, 0x0, 0x1},//1 {0x6, 0x2, 0x2},//2 {0x7, 0x4, 0x4},//3 {0xc, 0x9, 0x7},//4 {0xd, 0xb, 0x9},//5 {0x3, 0x4, 0x5},//6 {0x8, 0x9, 0x9}}, {//white {0x1,0x2,0x3}, {0xf,0xf,0xf}, {0xf,0xf,0xf}, {0xf,0xf,0xf}, {0xf,0xf,0xf}, {0xf,0xf,0xf}, {0xf,0xf,0xf}, {0xf,0xf,0xf}}, {//Dev palette (7) {0x0,0xf,0xf}, {0xf,0xf,0xf}, {0xf,0x0,0xf}, {0xf,0xf,0x0}, {0xf,0x0,0x0}, {0x0,0xf,0x0}, {0x0,0x0,0xf}, {0x0,0x0,0x0}} }; void hh_setup_palettes(); //TODO: UPDATE THIS FUNCTION /** @brief return palette index that belongs to tilemap index */ uint8_t hh_get_palette(uint8_t tile_idx); //TODO: UPDATE THIS FUNCTION bool hh_colidable(uint8_t tile_idx);