limit chunks non-unloading zone to a circle
This commit is contained in:
+10
-2
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user