mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +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
|
|
@ -270,6 +270,7 @@ void Hud::updateHotbarControl() {
|
|||
void Hud::updateWorldGenDebug() {
|
||||
auto& level = frontend.getLevel();
|
||||
const auto& chunks = *player.chunks;
|
||||
uint padding = engine.getSettings().chunks.padding.get();
|
||||
auto generator =
|
||||
frontend.getController()->getChunksController()->getGenerator();
|
||||
auto debugInfo = generator->createDebugInfo();
|
||||
|
|
@ -291,8 +292,15 @@ void Hud::updateWorldGenDebug() {
|
|||
int ax = x - (width - areaWidth) / 2;
|
||||
int az = z - (height - areaHeight) / 2;
|
||||
|
||||
data[(flippedZ * width + x) * 4 + 1] =
|
||||
chunks.getChunk(ax + ox, az + oz) ? 255 : 0;
|
||||
bool isInLoadingZone =
|
||||
frontend.getController()
|
||||
->getChunksController()
|
||||
->isInLoadingZone(player, padding, ax + ox, az + oz);
|
||||
|
||||
data[(flippedZ * width + x) * 4 + 1] =
|
||||
chunks.getChunk(ax + ox, az + oz)
|
||||
? (isInLoadingZone ? 255 : 128)
|
||||
: 0;
|
||||
data[(flippedZ * width + x) * 4 + 0] =
|
||||
level.chunks->fetch(ax + ox, az + oz) ? 255 : 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue