public Sparse2DBlockDeflateArray(int width, int height, T emptyValue, bool eraseEmptyBlocksDynamically, bool deflateBlocksDynamically) : base(width, height, emptyValue, eraseEmptyBlocksDynamically) { mIsBlockConstant = new BitArray64(mNumXBlocks * mNumYBlocks); mIsBlockConstant.setAll(false); mBlockConstantValue = new T[mNumXBlocks * mNumYBlocks]; mDeflateBlocksDynamically = deflateBlocksDynamically; }
//-------------------------------- public void copyTo(BitArray64 arr) { if (arr.mNumElements != mNumElements || mNumBlocks != arr.mNumBlocks) { throw new Exception("Error, cannot copy BitArray64 to target: Target does not have the same number of elements"); } for (int i = 0; i < mNumBlocks; i++) { arr.mBitArrayBlocks[i] = mBitArrayBlocks[i]; } }
public override void destroy() { mIsBlockConstant = null; mBlockConstantValue = null; base.destroy(); }