A bit of optimization to keep from generating the sorted sprite list over and over. Also tried to solve the problem of tombstone covering everything but no luck.
This commit is contained in:
parent
077f0e84ea
commit
9bf6926dc3
9 changed files with 36 additions and 32 deletions
|
@ -201,7 +201,8 @@ TEST_CASE("SpatialMap::distance_sorted", "[spatialmap]") {
|
|||
map.insert({4,4}, enemy1, true);
|
||||
map.insert({3, 3}, item, false);
|
||||
|
||||
auto result = map.distance_sorted({1, 1}, 100);
|
||||
SortedEntities result;
|
||||
map.distance_sorted(result, {1, 1}, 100);
|
||||
REQUIRE(result.size() == 3);
|
||||
REQUIRE(result[0].entity == enemy1);
|
||||
REQUIRE(result[1].entity == item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue