Fog of War now works fairly normally, but I think I'll have to do something so people don't live in the map. Probably something like hearing distance is increased because you're louder with a map out, and you can't see enemies on the map.

This commit is contained in:
Zed A. Shaw 2025-07-21 23:21:24 -04:00
parent 2997dc363b
commit 6f91533950
6 changed files with 19 additions and 11 deletions

View file

@ -50,7 +50,6 @@ namespace lighting {
if($paths.$paths[it.y][it.x] == WALL_PATH_LIMIT) {
$lightmap[it.y][it.x] = light_level(source.strength, 1.5f, point.x, point.y);
}
$fow[it.y][it.x] = $lightmap[it.y][it.x];
}
}
}
@ -74,6 +73,14 @@ namespace lighting {
$paths.set_target(at, value);
}
void LightRender::update_fow(Point at, LightSource source) {
for(matrix::circle it{$lightmap, at, source.radius}; it.next();) {
for(auto x = it.left; x < it.right; x++) {
$fow[it.y][x] = $lightmap[it.y][x];
}
}
}
void LightRender::path_light(Matrix &walls) {
$paths.compute_paths(walls);
}