Removed the variable limit setting since it's never used and instead just have WALL_PATH_LIMIT.

This commit is contained in:
Zed A. Shaw 2024-12-05 08:41:10 -05:00
parent 9abb39a3bf
commit eb0ca38e30
19 changed files with 50 additions and 58 deletions

View file

@ -1,13 +1,11 @@
#include "lights.hpp"
#include "constants.hpp"
#include <vector>
const int WALL_LIGHT_LEVEL = 3;
using std::vector;
namespace lighting {
void LightRender::render_light(LightSource source, Point at) {
const int UNPATH = $limit;
Point min, max;
light_box(source, at, min, max);
clear_light_target(at);
@ -18,7 +16,7 @@ namespace lighting {
auto &path_row = $paths.$paths[y];
for(size_t x = min.x; x <= max.x; ++x) {
if(path_row[x] != UNPATH) {
if(path_row[x] != WALL_PATH_LIMIT) {
light_row[x] = light_level(source.strength, x, y);
has_light.push_back({x,y});
}
@ -32,7 +30,7 @@ namespace lighting {
auto &light_row = $lightmap[point.y+j];
for(int i = -1; point.x+i >= 0 && i <= 1 && point.x+i < $width; i++) {
if(path_row[point.x+i] == UNPATH) {
if(path_row[point.x+i] == WALL_PATH_LIMIT) {
light_row[point.x+i] = light_level(wall_light, point.x, point.y);
}
}