limit chunks non-unloading zone to a circle

This commit is contained in:
MihailRis
2025-07-13 15:57:57 +03:00
parent b02b454573
commit 15a778299c
6 changed files with 68 additions and 6 deletions
+11
View File
@@ -114,6 +114,17 @@ namespace util {
return true;
}
void remove(TCoord x, TCoord y) {
auto lx = x - offsetX;
auto ly = y - offsetY;
if (lx < 0 || ly < 0 || lx >= sizeX || ly >= sizeY) {
return;
}
if (outCallback)
outCallback(x, y, firstBuffer[ly * sizeX + lx]);
firstBuffer[ly * sizeX + lx] = T{};
}
void setOutCallback(const OutCallback& callback) {
outCallback = callback;
}