Example #1
0
        public override Sprite GetDebugOverlay(ObjectEntry obj)
        {
            var height = obj.XFlip ? 0x142 : 0x165;
            var bitmap = new BitmapBits(161, height + 1);

            bitmap.DrawEllipse(LevelData.ColorWhite, -160, 0, 160, height);

            var overlay = new Sprite(bitmap);

            overlay.Flip(obj.XFlip, false);
            return(overlay);
        }
Example #2
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);
        }