Exemplo n.º 1
0
        public VoxelType[] m_voxels; //保存非压缩格式的voxels

        public void LoadChunkData(BinaryReader _brMS, int _chunkSize)
        {
            if (_chunkSize == 2)
            {
                m_zipVoxel        = new VoxelType();
                m_zipVoxel.m_vol  = _brMS.ReadByte();
                m_zipVoxel.m_type = _brMS.ReadByte();
            }
            else
            {
                m_voxels = new VoxelType[VoxelTerrainConstants.VOXEL_ARRAY_LENGTH];

                for (int _i = 0; _i != VoxelTerrainConstants.VOXEL_ARRAY_LENGTH; ++_i)
                {
                    VoxelType _vt = new VoxelType();
                    _vt.m_vol    = _brMS.ReadByte();
                    _vt.m_type   = _brMS.ReadByte();
                    m_voxels[_i] = _vt;
                }
            }
        }
Exemplo n.º 2
0
 public void Clear()
 {
     m_iOffset  = 0;
     m_zipVoxel = null;
     m_voxels   = null;
 }