FoW is now moved into lighting so light determines what's seen not player's last position. Not sure if I like that though.
This commit is contained in:
parent
d264760405
commit
2997dc363b
7 changed files with 19 additions and 30 deletions
|
@ -12,7 +12,8 @@ namespace lighting {
|
|||
$height(matrix::height(tiles)),
|
||||
$lightmap(matrix::make($width, $height)),
|
||||
$ambient(matrix::make($width, $height)),
|
||||
$paths($width, $height)
|
||||
$paths($width, $height),
|
||||
$fow(matrix::make($width, $height))
|
||||
{
|
||||
auto& tile_ambient = textures::get_ambient_light();
|
||||
|
||||
|
@ -47,8 +48,9 @@ namespace lighting {
|
|||
for(auto point : has_light) {
|
||||
for(matrix::compass it{$lightmap, point.x, point.y}; it.next();) {
|
||||
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);
|
||||
$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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue