Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        // Cleans up memory used by this level
        public void Dispose()
        {
            if (_smallMap != null)
            {
                _smallMap.Dispose();
                _smallMap = null;
            }

            if (_fullMap != null)
            {
                _fullMap.Dispose();
                _fullMap = null;
            }
        }
Esempio n. 3
0
        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;
            }
        }