Fix up the colors and rendering so that tilemap just uses components::Tile all the time. Need to load all of the config data from json one time on system start instead of constantly, although constantly does make debugging live easier.

This commit is contained in:
Zed A. Shaw 2025-02-09 15:54:17 -05:00
parent a4c13f7fc9
commit 0cbe20af35
10 changed files with 36 additions and 44 deletions

View file

@ -7,18 +7,9 @@
#include "point.hpp"
#include "matrix.hpp"
#include "config.hpp"
#include "components.hpp"
struct TileCell {
std::string display;
uint8_t fg_h = 0;
uint8_t fg_s = 0;
uint8_t fg_v = 0;
uint8_t bg_h = 0;
uint8_t bg_s = 0;
uint8_t bg_v = 0;
};
typedef std::vector<TileCell> TileRow;
typedef std::vector<components::Tile> TileRow;
typedef std::vector<TileRow> TileGrid;
class TileMap {
@ -37,7 +28,7 @@ public:
size_t width() { return $width; }
size_t height() { return $height; }
void load(matrix::Matrix &walls);
const TileCell &at(size_t x, size_t y);
const components::Tile &at(size_t x, size_t y);
void set_tile(size_t x, size_t y, std::string tile_name);
std::vector<std::string> tile_names(bool collision);