|
|
|
@ -180,7 +180,7 @@ void System::draw_map(DinkyECS::World &world, Map &game_map, const Matrix &light |
|
|
|
|
const auto& player = world.get_the<Player>(); |
|
|
|
|
const auto& player_position = world.get<Position>(player.entity); |
|
|
|
|
Point start = game_map.center_camera(player_position.location, view_x, view_y); |
|
|
|
|
auto &walls = game_map.walls(); |
|
|
|
|
auto &tiles = game_map.tiles(); |
|
|
|
|
auto &paths = game_map.paths(); |
|
|
|
|
|
|
|
|
|
size_t end_x = std::min(view_x, game_map.width() - start.x); |
|
|
|
@ -188,7 +188,7 @@ 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; |
|
|
|
|
string tile = tiles[start.y+y][start.x+x] == L'#' ? config.WALL_TILE : config.FLOOR_TILE; |
|
|
|
|
int light_value = debug.LIGHT ? 160 : lighting[start.y+y][start.x+x]; |
|
|
|
|
|
|
|
|
|
if(tile == config.WALL_TILE) { |
|
|
|
|