Took the plunge and converted my 'shaperators' into templates so they'll work on any 'matrix-like' thing.
This commit is contained in:
parent
5adeb4e078
commit
4cb41a61db
5 changed files with 182 additions and 192 deletions
|
@ -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});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue