Example #1
0
    public static RenderThreadTask BuildChunk(int chunkX, int chunkZ, PositionInfo info)
    {
        //Initialize the thread data
        RenderThreadTask task = new RenderThreadTask();

        task.chunkX     = chunkX;
        task.chunkZ     = chunkZ;
        task.LODLevel   = info.LODLevel;
        task.regions    = regions;
        task.regionSize = regionSize;
        task.chunkSize  = info.chunkSize;

        //Check if its already a file
        Chunk chunk = null;

        if (Serialize.ChunkIsOnDisk(chunkX, chunkZ))
        {
            chunk = Serialize.LoadChunk(chunkX, chunkZ);
        }
        task.chunk = chunk;

        //Start thread
        ThreadPool.QueueUserWorkItem(task.CreateMeshData);
        return(task);
    }