@ -10,8 +10,6 @@
# include "dbc.hpp"
# include "lights.hpp"
const bool DEBUG_MAP = false ;
using std : : string ;
using namespace fmt ;
using namespace components ;
@ -177,6 +175,7 @@ void System::draw_entities(DinkyECS::World &world, Map &game_map, const Matrix &
}
void System : : draw_map ( DinkyECS : : World & world , Map & game_map , const Matrix & lighting , ftxui : : Canvas & canvas , size_t view_x , size_t view_y ) {
const auto & debug = world . get_the < Debug > ( ) ;
const auto & config = world . get_the < MapConfig > ( ) ;
const auto & player = world . get_the < Player > ( ) ;
const auto & player_position = world . get < Position > ( player . entity ) ;
@ -190,14 +189,14 @@ void System::draw_map(DinkyECS::World &world, Map &game_map, const Matrix &light
for ( size_t y = 0 ; y < end_y ; + + y ) {
for ( size_t x = 0 ; x < end_x ; + + x ) {
string tile = walls [ start . y + y ] [ start . x + x ] = = 1 ? config . WALL_TILE : config . FLOOR_TILE ;
int light_value = lighting [ start . y + y ] [ start . x + x ] ;
int light_value = debug . LIGHT ? 160 : lighting [ start . y + y ] [ start . x + x ] ;
if ( tile = = config . WALL_TILE ) {
canvas . DrawText ( x * 2 , y * 4 , config . WALL_TILE , [ light_value ] ( auto & pixel ) {
pixel . foreground_color = Color : : HSV ( 230 , 20 , 10 ) ;
pixel . background_color = Color : : HSV ( 230 , 20 , light_value / 2 ) ;
} ) ;
} else if ( DEBUG_MAP ) {
} else if ( debug . PATHS ) {
int dnum = paths [ start . y + y ] [ start . x + x ] ;
string num = format ( " {:x} " , dnum ) ;
num = num . size ( ) > 2 ? " * " : num ;