private void ProcessUpdateRequests() { Blocks = 0; // Process removal requests for (int i = 0; i < m_updateRequests.Count;) { Chunk chunk = m_updateRequests[i]; OnProcessChunk(chunk); // Process chunk events chunk.UpdateChunk(); Blocks += chunk.NonEmptyBlocks; // Automatically collect chunks which are ready to be removed form the world if (chunk.IsFinished()) { // Remove the chunk from our provider and unregister it from chunk storage ChunkProvider.ReleaseChunk(chunk); m_chunks.Remove(chunk.Pos.X, chunk.Pos.Y, chunk.Pos.Z); // Unregister from updates m_updateRequests.RemoveAt(i); continue; } ++i; } // Commit collected work items WorkPoolManager.Commit(); IOPoolManager.Commit(); }
private void UpdateCache() { #if DEBUG // Make it possible to see results in real-time m_clipmap.Init(ForceLOD, LODCoef); #endif // Register new chunks in chunk manager foreach (var chunkPos in m_chunksToLoadByPos) { int xx = ViewerChunkPos.X + chunkPos.X; int yy = ViewerChunkPos.Y + chunkPos.Y; int zz = ViewerChunkPos.Z + chunkPos.Z; RegisterChunk(xx, yy, zz); } // Commit collected work items WorkPoolManager.Commit(); IOPoolManager.Commit(); }
void Update() { IOPoolManager.Commit(); WorkPoolManager.Commit(); }