public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var count = obj.SubType & 0x0F;

            if (count > 8)
            {
                return(null);
            }

            var radius   = (count + 1) * 16;
            var vertical = (obj.SubType & 0xF0) != 0;

            if (vertical)
            {
                var bitmap = new BitmapBits(radius + 1, radius * 2 + 1);
                bitmap.DrawCircle(LevelData.ColorWhite, obj.XFlip ? 0 : radius, radius, radius);
                return(new Sprite(bitmap, obj.XFlip ? 24 : -radius - 24, -radius));
            }
            else
            {
                var bitmap = new BitmapBits(radius * 2 + 1, radius + 1);
                bitmap.DrawCircle(LevelData.ColorWhite, radius, obj.YFlip ? 0 : radius, radius);
                return(new Sprite(bitmap, -radius, obj.YFlip ? 0 : -radius));
            }
        }
Beispiel #2
0
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var bitmap = new BitmapBits(161, 161);

            bitmap.DrawCircle(LevelData.ColorWhite, 80, 80, 80);
            return(new Sprite(bitmap, -80, -80));
        }
Beispiel #3
0
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var bitmap = new BitmapBits(113, 113);

            bitmap.DrawCircle(LevelData.ColorWhite, 56, 56, 56);
            return(new Sprite(bitmap, -56, -56));
        }
Beispiel #4
0
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var x = (obj.SubType & 0x7F) << 4;
            var y = x >> 2;

            var overlay = new BitmapBits(x, y);

            overlay.DrawLine(LevelData.ColorWhite, 0, 0, x, y);
            var sprite = new Sprite(overlay, 0, 0x41);

            overlay = new BitmapBits(1, 0x41);
            overlay.DrawLine(LevelData.ColorWhite, 0, 0x00, 0, 0x07);
            overlay.DrawLine(LevelData.ColorWhite, 0, 0x10, 0, 0x17);
            overlay.DrawLine(LevelData.ColorWhite, 0, 0x20, 0, 0x27);
            overlay.DrawLine(LevelData.ColorWhite, 0, 0x30, 0, 0x37);
            sprite = new Sprite(sprite, new Sprite(overlay, x, y));

            if ((obj.SubType & 0x80) == 0)
            {
                overlay = new BitmapBits(0x81, 0x81);
                overlay.DrawCircle(LevelData.ColorWhite, 0x40, 0x40, 0x40);
                sprite = new Sprite(sprite, new Sprite(overlay, x - 0x40, y - 0x40));
            }

            return(sprite);
        }
Beispiel #5
0
		public override void Init(ObjectData data)
		{
			var indexer = new MultiFileIndexer<byte>();
			indexer.AddFile(new List<byte>(LevelData.ReadFile(
				"../Levels/CNZ/Nemesis Art/Misc Art.bin", CompressionType.Nemesis)), -608);

			properties = new PropertySpec[2];
			subtypes = new ReadOnlyCollection<byte>(new byte[0]);
			sprite = ObjectHelper.MapASMToBmp(indexer.ToArray(),
				"../General/Sprites/Level Misc/Map - Bumper.asm", 0, 2);

			var bitmap = new BitmapBits(129, 129);
			bitmap.DrawCircle(LevelData.ColorWhite, 64, 64, 64);
			overlay = new Sprite(bitmap, -64, -64);

			properties[0] = new PropertySpec("Offset", typeof(int), "Extended",
				"The starting point of the object's movement cycle.", null,
				(obj) => obj.XFlip ? 256 - obj.SubType : obj.SubType,
				(obj, value) => obj.SubType = (byte)(obj.XFlip ? 256 - (int)value : (int)value));

			properties[1] = new PropertySpec("Reverse", typeof(bool), "Extended",
				"If set, the object will move counterclockwise.", null,
				(obj) => obj.XFlip,
				(obj, value) =>
				{
					obj.XFlip = (bool)value;
					obj.SubType = (byte)(256 - obj.SubType);
				});
		}
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var routine = obj.SubType & 0x70;

            if (routine == 0x00 || routine > 0x40)
            {
                return(null);
            }

            if (routine == 0x30)
            {
                var overlay = new BitmapBits(129, 129);
                overlay.DrawCircle(LevelData.ColorWhite, 64, 64, 64);
                return(new Sprite(overlay, -64, -64));
            }
            else
            {
                var length = routine == 0x20 ? 128 : 64;
                var offset = -length / 2;

                if (routine == 0x40)
                {
                    length = lengths[obj.SubType & 0x0F];
                    offset = obj.XFlip ? -length : 0;
                }

                var overlay = new BitmapBits(1, length);
                overlay.DrawLine(LevelData.ColorWhite, 0, 0, 0, length);
                return(new Sprite(overlay, 0, offset));
            }
        }
Beispiel #7
0
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var index  = obj.SubType & 0x0F;
            var count  = index == 0x0F ? 0 : index < 9 ? 3 - index / 3 : 7 - (index - 1) / 2;
            var radius = count * 24 + 20;

            var bitmap = new BitmapBits(radius * 2 + 1, radius * 2 + 1);

            bitmap.DrawCircle(LevelData.ColorWhite, radius, radius, radius);
            return(new Sprite(bitmap, -radius, -radius));
        }
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var bitmap = new BitmapBits(129, obj.SubType == 0 ? 240 : 148);

            bitmap.DrawCircle(LevelData.ColorWhite, 0, 128, 128);

            var overlay = new Sprite(bitmap);

            overlay.Flip(obj.XFlip, true);
            return(overlay);
        }
Beispiel #9
0
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var width  = ((obj.SubType & 3) + 6) * 32;
            var radius = width / 2;
            var height = obj.SubType < 0x80 ? radius : width;

            var bitmap = new BitmapBits(width + 1, height + 1);

            bitmap.DrawCircle(LevelData.ColorWhite, radius, height - radius, radius);
            return(new Sprite(bitmap, -radius, radius - height));
        }
Beispiel #10
0
        public override void Init(ObjectData data)
        {
            subtypes = new ReadOnlyCollection <byte>(new byte[0]);
            sprite   = BuildFlippedSprites(ObjectHelper.UnknownObject);

            var bitmap = new BitmapBits(40, 40);

            bitmap.DrawCircle(LevelData.ColorWhite, 0, 0, 39);
            overlay = new Sprite(bitmap);

            overlay = new Sprite(overlay,
                                 new Sprite(overlay, false, true),
                                 new Sprite(overlay, true, false),
                                 new Sprite(overlay, true, true));
        }
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var count = obj.SubType & 0x0F;

            if (count > 8)
            {
                return(null);
            }

            var radius = (count + 1) * 16;
            var bitmap = new BitmapBits(radius * 2 + 1, radius * 2 + 1);

            bitmap.DrawCircle(LevelData.ColorWhite, radius, radius, radius);
            return(new Sprite(bitmap, -radius, -radius));
        }
Beispiel #12
0
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var count = obj.SubType & 0x0F;

            if (count > 8)
            {
                return(null);
            }

            var radius = (count + 1) * 16;
            var bitmap = new BitmapBits(radius + 1, radius + 1);

            bitmap.DrawCircle(LevelData.ColorWhite, 0, 0, radius);
            var overlay = new Sprite(bitmap, 32, 0);

            overlay.Flip(!obj.XFlip, (obj.SubType & 0x10) == 0);
            return(overlay);
        }
Beispiel #13
0
        public override void Init(ObjectData data)
        {
            var map = LevelData.ASMToBin(
                "../Levels/FBZ/Misc Object Data/Map - Snake Platform.asm", LevelData.Game.MappingsVersion);

            var indexer = new MultiFileIndexer <byte>();

            indexer.AddFile(new List <byte>(LevelData.ReadFile(
                                                "../Levels/FBZ/Nemesis Art/Misc Art 1.bin", CompressionType.Nemesis)), -7744);

            sprite     = ObjectHelper.MapToBmp(indexer.ToArray(), map, 0, 1);
            subtypes   = new ReadOnlyCollection <byte>(new byte[0]);
            properties = new PropertySpec[1];

            var bitmap = new BitmapBits(13, 13);

            bitmap.DrawCircle(LevelData.ColorWhite, 0, 0, 12);
            overlay = new Sprite(bitmap);

            overlay = new Sprite(overlay,
                                 new Sprite(overlay, false, true),
                                 new Sprite(overlay, true, false),
                                 new Sprite(overlay, true, true));

            paths  = new Sprite[8];
            coords = new Point[8][];

            BuildPathsCoords(0, 0x118C, 0x770, false, 0x10F1, 0x770);
            BuildPathsCoords(1, 0x1174, 0x7F0, false, 0x120F, 0x7F0);
            BuildPathsCoords(2, 0xD64, 0x420, false, 0xC56, 0x510, 0xD64);
            BuildPathsCoords(3, 0xC1A, 0x317, false, 0xCE3, 0x3C8, 0xB64, 0x317);
            BuildPathsCoords(4, 0xC1B, 0x3C8, false, 0xB65, 0x317, 0xCE3, 0x3C8);
            BuildPathsCoords(5, 0xC56, 0x510, false, 0xD64, 0x420, 0xC56);
            BuildPathsCoords(6, 0x1EEB, 0x213, true, 0x400, 0x1D79, 0x319, 0x1E82, 0x369, 0x1E1E, 0x213);
            BuildPathsCoords(7, 0x1E82, 0x319, true, 0x369, 0x1E1E, 0x213, 0x1EEB, 0x400, 0x1D79, 0x319);

            properties[0] = new PropertySpec("Path ID", typeof(int), "Extended",
                                             "The path information associated with this object.", null,
                                             (obj) => obj.SubType & 0x0F,
                                             (obj, value) => obj.SubType = (byte)((obj.SubType & 0xF0) | ((int)value & 0x0F)));
        }
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            if (obj.SubType < 0x80)
            {
                var bitmap = new BitmapBits(225, 113);
                bitmap.DrawCircle(LevelData.ColorWhite, 112, 112, 112);
                return(new Sprite(bitmap, -112, -112));
            }
            else
            {
                var bitmap = new BitmapBits(113, 225);
                bitmap.DrawCircle(LevelData.ColorWhite, 0, 112, 112);
                var overlay = new Sprite(bitmap, 0, -112);

                if (obj.XFlip)
                {
                    overlay.Flip(true, false);
                }
                return(overlay);
            }
        }
Beispiel #15
0
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var index = (obj.SubType & 0x0F) * 2;

            if (obj.XFlip)
            {
                var length = obj.X - conveyorData[index];
                if (length > 0)
                {
                    var overlay = new BitmapBits(length, 1);
                    overlay.DrawLine(LevelData.ColorWhite, 0, 0, length, 0);
                    return(new Sprite(overlay, -length, 0));
                }
                else
                {
                    var overlay = new BitmapBits(22, 43);
                    overlay.DrawCircle(LevelData.ColorWhite, 21, 21, 21);
                    return(new Sprite(overlay, -21, -42));
                }
            }
            else
            {
                var length = conveyorData[index + 1] - obj.X;
                if (length > 0)
                {
                    var overlay = new BitmapBits(length, 1);
                    overlay.DrawLine(LevelData.ColorWhite, 0, 0, length, 0);
                    return(new Sprite(overlay, 0, 0));
                }
                else
                {
                    var overlay = new BitmapBits(22, 43);
                    overlay.DrawCircle(LevelData.ColorWhite, 0, 21, 21);
                    return(new Sprite(overlay, 0, 0));
                }
            }
        }
Beispiel #16
0
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var jumps = obj.SubType & 0x0F;

            if (jumps == 0 || (obj.SubType & 0x30) != 0)
            {
                return(null);
            }

            var bitmap = new BitmapBits(64, 65);

            bitmap.DrawCircle(LevelData.ColorWhite, 65, 1, 63);
            bitmap.DrawLine(LevelData.ColorWhite, 63, 0x00, 63, 0x07);
            bitmap.DrawLine(LevelData.ColorWhite, 63, 0x10, 63, 0x17);
            bitmap.DrawLine(LevelData.ColorWhite, 63, 0x20, 63, 0x27);
            bitmap.DrawLine(LevelData.ColorWhite, 63, 0x30, 63, 0x37);

            var y      = 142;
            var swings = obj.SubType >> 6;
            var width  = swings == 0 ? 128 : swings * 512;
            var height = (swings == 0 ? 1 : swings) * jumps * 128 + y;

            var overlay = new Sprite(bitmap, -64, height - 64);

            bitmap = new BitmapBits(width, height + 1);
            bitmap.DrawLine(LevelData.ColorWhite, 12, 0, 12, y);

            if (swings == 0)
            {
                while (y != height)
                {
                    bitmap.DrawEllipse(LevelData.ColorWhite, -128, y, 127, y += 128);
                }
            }
            else
            {
                var path = new BitmapBits(272, 65);
                path.DrawEllipse(LevelData.ColorWhite, -272, 0, 271, 96);
                var right = new Sprite(path);
                right = new Sprite(new Sprite(right, 512, 129, true, true), right);
                var left = new Sprite(right, true, false);

                var curLeft = false;
                for (var x = 0; y != height; y += 128)
                {
                    bitmap.DrawSprite(curLeft ? left : right, x, y);
                    curLeft = curLeft ? (x -= 512) != 0 : (x += 512) == width;
                }

                if (curLeft)
                {
                    overlay.Flip(true, false);
                    overlay.Offset(width, 0);
                }
            }

            overlay = new Sprite(new Sprite(bitmap), overlay);
            overlay.Offset(-12, 50);
            overlay.Flip(!obj.XFlip, false);
            return(overlay);
        }