Lighting system now works and does illumination for the whole map plus entities, but not walls or multiple lights yet.

This commit is contained in:
Zed A. Shaw 2024-11-26 02:22:15 -05:00
parent 62f986719d
commit 4ceacecfda
5 changed files with 49 additions and 25 deletions

18
map.cpp
View file

@ -43,9 +43,21 @@ inline void add_neighbors(PointList &neighbors, Matrix &closed, size_t y, size_t
* can run make_rooms and generate on. It will
* NOT be valid until you actually run generate.
*/
Map::Map(size_t width, size_t height) : $limit(1000) {
$walls = Matrix(height, MatrixRow(width, INV_WALL));
$input_map = Matrix(height, MatrixRow(width, 1));
Map::Map(size_t width, size_t height) :
$limit(1000),
$input_map(height, MatrixRow(width, 1)),
$walls(height, MatrixRow(width, INV_WALL)),
$paths(height, MatrixRow(width, 1)),
$lighting(height, MatrixRow(width, 0))
{
}
// make explicit
Map::Map(Matrix input_map, Matrix walls_map, int limit) :
$limit(limit),
$input_map(input_map),
$walls(walls_map)
{
}
void Map::make_paths() {