コード例 #1
0
    void UpdateBlocks()
    {
        loadWatch.Reset();
        loadWatch.Start();
        while (true)
        {
            RemoteFortressReader.MapBlock block = DFConnection.Instance.PopMapBlockUpdate();
            if (block == null)
            {
                break;
            }
            MapDataStore.Main.StoreTiles(block);
            if (block.tiles.Count > 0)
            {
                SetDirtyBlock(block.map_x, block.map_y, block.map_z);
            }
            if (block.water.Count > 0 || block.magma.Count > 0)
            {
                SetDirtyLiquidBlock(block.map_x, block.map_y, block.map_z);
            }
        }
        loadWatch.Stop();
        genWatch.Reset();
        genWatch.Start();
        EnqueueMeshUpdates();
        genWatch.Stop();

        mesher.Poll();

        FetchNewMeshes();
    }