Lighting is now in its own class using the new Pathing class. This should allow me to make it more consistent and possibly make Pathing more efficient.

This commit is contained in:
Zed A. Shaw 2024-12-01 17:54:43 -05:00
parent e05335b153
commit 3f7a9cc124
18 changed files with 209 additions and 257 deletions

View file

@ -1,4 +1,5 @@
#include "pathing.hpp"
#include "dbc.hpp"
#include <vector>
using std::vector;
@ -22,12 +23,9 @@ inline void add_neighbors(PointList &neighbors, Matrix &closed, size_t y, size_t
}
}
inline void matrix_assign(Matrix &out, int new_value) {
for(auto &row : out) {
row.assign(row.size(), new_value);
}
}
/*
* Used https://github.com/HenrYxZ/dijkstra-map as a reference.
*/
void Pathing::compute_paths(Matrix &walls) {
INVARIANT();
// Initialize the new array with every pixel at limit distance