mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
limit chunks non-unloading zone to a circle
This commit is contained in:
parent
b02b454573
commit
15a778299c
6 changed files with 68 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue