use of io.xol.chunkstories.api.world.chunk.ChunksIterator in project chunkstories by Hugobros3.
the class WorldImplementation method redrawEverything.
@Override
public synchronized // TODO move to client
void redrawEverything() {
ChunksIterator i = this.getAllLoadedChunks();
Chunk c;
while (i.hasNext()) {
c = i.next();
if (c instanceof ChunkRenderable) {
ChunkRenderable c2 = (ChunkRenderable) c;
c2.lightBaker().requestLightningUpdate();
c2.meshUpdater().requestMeshUpdate();
}
}
}
use of io.xol.chunkstories.api.world.chunk.ChunksIterator in project chunkstories by Hugobros3.
the class DebugInfoRenderer method getLoadedChunksVramFootprint.
@SuppressWarnings("unused")
private String getLoadedChunksVramFootprint() {
int nbChunks = 0;
long octelsTotal = 0;
ChunksIterator i = world.getAllLoadedChunks();
Chunk c;
while (i.hasNext()) {
c = i.next();
if (c == null)
continue;
if (c instanceof ChunkRenderable) {
ChunkRenderDataHolder chunkRenderData = ((ClientChunk) c).getChunkRenderData();
if (chunkRenderData != null) {
nbChunks++;
// octelsTotal += chunkRenderData.getVramUsage();
}
}
}
// , storing " + octelsTotal / 1024 / 1024 + "Mb of vertex data.";
return nbChunks + " chunks";
}
Aggregations