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:
Zed A. Shaw 2025-08-03 23:58:59 -04:00
parent 077f0e84ea
commit 9bf6926dc3
9 changed files with 36 additions and 32 deletions

View file

@ -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);