Took the plunge and converted my 'shaperators' into templates so they'll work on any 'matrix-like' thing.

This commit is contained in:
Zed A. Shaw 2024-12-31 08:13:20 -05:00
parent 5adeb4e078
commit 4cb41a61db
5 changed files with 182 additions and 192 deletions

View file

@ -6,7 +6,7 @@ using std::vector;
namespace lighting {
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::box it{$lightmap, at.x, at.y, (size_t)floor(source.radius)}; it.next();) {
if($paths.$paths[it.y][it.x] != WALL_PATH_LIMIT) {
$lightmap[it.y][it.x] = light_level(source.strength, it.distance(), it.x, it.y);
has_light.push_back({it.x, it.y});