private void LoadImage(byte[] bytes, int pos) { // This starts reading the data at offset "pos" within the byte array Bytes stream = new Bytes(bytes, pos); if (stream.LoadByteAsInt() != 1) { throw new Exception("Invalid level map format"); } _fullMap = LevelImage.Create(stream); }
// Cleans up memory used by this level public void Dispose() { if (_smallMap != null) { _smallMap.Dispose(); _smallMap = null; } if (_fullMap != null) { _fullMap.Dispose(); _fullMap = null; } }
private void CopyFrom(LevelImage image) { _width = 0; _height = 0; _pixels = null; _bitmap = null; if (image != null) { _width = image._width; _height = image._height; _pixels = image._pixels; _bitmap = image._bitmap; } }