Now have color and display char coming from assets/tiles.json but lighting still needs work.

This commit is contained in:
Zed A. Shaw 2024-12-24 02:56:17 -05:00
parent 7fe6ad174d
commit 89e31279be
4 changed files with 70 additions and 36 deletions

View file

@ -7,9 +7,20 @@
#include "point.hpp"
#include "matrix.hpp"
#include "config.hpp"
#include <ftxui/screen/color.hpp>
typedef std::vector<std::string> TileRow;
typedef std::vector<TileRow> TileDisplay;
struct TileCell {
std::string display;
uint8_t fg_h;
uint8_t fg_s;
uint8_t fg_v;
uint8_t bg_h;
uint8_t bg_s;
uint8_t bg_v;
};
typedef std::vector<TileCell> TileRow;
typedef std::vector<TileRow> TileGrid;
class TileMap {
public:
@ -17,7 +28,7 @@ public:
size_t $width;
size_t $height;
matrix::Matrix $tile_ids;
TileDisplay $display;
TileGrid $display;
TileMap(size_t width, size_t height);
@ -27,7 +38,7 @@ public:
size_t width() { return $width; }
size_t height() { return $height; }
void load(matrix::Matrix &walls);
const std::string &at(size_t x, size_t y);
const TileCell &at(size_t x, size_t y);
void dump(int show_x=-1, int show_y=-1);
bool INVARIANT();