|
|
@ -8,9 +8,6 @@ namespace lighting { |
|
|
|
void LightRender::render_square_light(LightSource source, Point at, PointList &has_light) { |
|
|
|
void LightRender::render_square_light(LightSource source, Point at, PointList &has_light) { |
|
|
|
for(matrix::in_box it{$lightmap, at.x, at.y, (size_t)floor(source.radius)}; it.next();) { |
|
|
|
for(matrix::in_box it{$lightmap, at.x, at.y, (size_t)floor(source.radius)}; it.next();) { |
|
|
|
if($paths.$paths[it.y][it.x] != WALL_PATH_LIMIT) { |
|
|
|
if($paths.$paths[it.y][it.x] != WALL_PATH_LIMIT) { |
|
|
|
if(it.x == at.x && it.y == at.y) { |
|
|
|
|
|
|
|
println("distance at center: {}", it.distance()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$lightmap[it.y][it.x] = light_level(source.strength, it.distance(), it.x, it.y); |
|
|
|
$lightmap[it.y][it.x] = light_level(source.strength, it.distance(), it.x, it.y); |
|
|
|
has_light.push_back({it.x, it.y}); |
|
|
|
has_light.push_back({it.x, it.y}); |
|
|
|
} |
|
|
|
} |
|
|
|