Exemplo n.º 1
0
        void DrawClsnBoxes(Vector2 location, Animations.AnimationElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            Video.DrawState drawstate = SpriteManager.DrawState;
            drawstate.Reset();

            drawstate.Mode = DrawMode.OutlinedRectangle;

            foreach (Animations.Clsn clsn in element)
            {
                Rectangle rect = clsn.MakeRect(location, CurrentScale, CurrentFacing);

                switch (clsn.ClsnType)
                {
                case ClsnType.Type1Attack:
                    drawstate.AddData(new Vector2(rect.X, rect.Y), new Rectangle(0, 0, rect.Width, rect.Height), Color.Red);
                    break;

                case ClsnType.Type2Normal:
                    drawstate.AddData(new Vector2(rect.X, rect.Y), new Rectangle(0, 0, rect.Width, rect.Height), Color.Blue);
                    break;
                }
            }

            drawstate.Use();
        }
Exemplo n.º 2
0
        void DrawOriginCross(Vector2 location, Int32 segmentlength)
        {
            Video.DrawState drawstate = SpriteManager.DrawState;
            drawstate.Reset();

            drawstate.Mode = DrawMode.Lines;
            drawstate.AddData(location - new Vector2(segmentlength, 0), null, Color.Black);
            drawstate.AddData(location + new Vector2(segmentlength, 0), null, Color.Black);
            drawstate.AddData(location - new Vector2(0, segmentlength), null, Color.Black);
            drawstate.AddData(location + new Vector2(0, segmentlength), null, Color.Black);
            drawstate.Use();
        }
Exemplo n.º 3
0
        public override void Draw(Combat.PaletteFx palettefx)
        {
            Drawing.Sprite sprite = SpriteManager.GetSprite(AnimationManager.CurrentElement.SpriteId);
            if (sprite == null)
            {
                return;
            }

            Point tilestart;
            Point tileend;

            GetTileLength(sprite.Size, out tilestart, out tileend);

            Video.DrawState drawstate = SpriteManager.DrawState;
            drawstate.Reset();
            drawstate.Blending = Transparency;
            drawstate.Set(sprite);
            drawstate.AddData(CurrentLocation, null);

            if (palettefx != null)
            {
                palettefx.SetShader(drawstate.ShaderParameters);
            }

            drawstate.Use();
        }
Exemplo n.º 4
0
        public override void Draw(Combat.PaletteFx palettefx)
        {
            Point tilestart;
            Point tileend;

            GetTileLength(Sprite.Size, out tilestart, out tileend);

            Video.DrawState drawstate = SpriteManager.DrawState;
            drawstate.Reset();
            drawstate.Blending         = Transparency;
            drawstate.ScissorRectangle = DrawRect;
            drawstate.Set(Sprite);

            for (Int32 y = tilestart.Y; y != tileend.Y; ++y)
            {
                for (Int32 x = tilestart.X; x != tileend.X; ++x)
                {
                    Vector2 adjustment = (Vector2)(Sprite.Size + TilingSpacing) * new Vector2(x, y);
                    Vector2 location   = CurrentLocation + adjustment;

                    drawstate.AddData(location, null);
                }
            }

            if (palettefx != null)
            {
                palettefx.SetShader(drawstate.ShaderParameters);
            }

            drawstate.Use();
        }
Exemplo n.º 5
0
        public override void DebugDraw()
        {
            base.DebugDraw();

            Video.DrawState drawstate = SpriteManager.DrawState;

            Vector2 offset = new Vector2(Mugen.ScreenSize.X / 2.0f, Engine.Stage.ZOffset);

            drawstate.Reset();
            drawstate.Mode = DrawMode.Lines;

            drawstate.AddData(new Vector2(GetBackLocation(), CurrentLocation.Y) + offset, null, new Color(255, 0, 255, 255));
            drawstate.AddData(CurrentLocation + offset, null, new Color(255, 0, 255, 255));

            drawstate.AddData(new Vector2(GetFrontLocation(), CurrentLocation.Y) + offset, null, new Color(255, 255, 0, 255));
            drawstate.AddData(CurrentLocation + offset, null, new Color(255, 255, 0, 255));

            drawstate.Use();
        }
Exemplo n.º 6
0
        void DrawSpriteBox(Vector2 location, Animations.AnimationElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            Drawing.Sprite sprite = SpriteManager.GetSprite(element.SpriteId);
            if (sprite == null)
            {
                return;
            }

            Vector2       drawoffset = Vector2.Zero;
            SpriteEffects flip       = GetDrawFlip();

            switch (CurrentFacing)
            {
            case Facing.Right:
                drawoffset = (Vector2)element.Offset;
                break;

            case Facing.Left:
                drawoffset = new Vector2(-element.Offset.X, element.Offset.Y);
                break;
            }

            if ((flip & SpriteEffects.FlipHorizontally) == SpriteEffects.FlipHorizontally)
            {
                drawoffset.X = -drawoffset.X;
            }
            if ((flip & SpriteEffects.FlipVertically) == SpriteEffects.FlipVertically)
            {
                drawoffset.Y = -drawoffset.Y;
            }

            Video.DrawState drawstate = SpriteManager.DrawState;

            Vector2 spritelocation = Video.Renderer.GetDrawLocation(sprite.Size, location, (Vector2)sprite.Axis - drawoffset, CurrentScale, flip);

            drawstate.Reset();
            drawstate.Mode = DrawMode.OutlinedRectangle;
            drawstate.AddData(spritelocation, new Rectangle(0, 0, (Int32)(sprite.Size.X * CurrentScale.X), (Int32)(sprite.Size.Y * CurrentScale.Y)), Color.Gray);
            drawstate.Use();
        }
Exemplo n.º 7
0
        void DrawGrid()
        {
            Elements.StaticImage cellbg = m_elements.GetElement("cell.bg") as Elements.StaticImage;
            if (cellbg != null)
            {
                Drawing.Sprite sprite = cellbg.SpriteManager.GetSprite(cellbg.DataMap.SpriteId);
                if (sprite != null)
                {
                    Video.DrawState drawstate = cellbg.SpriteManager.DrawState;
                    drawstate.Reset();
                    drawstate.Set(sprite);

                    for (Int32 y = 0; y != m_gridsize.Y; ++y)
                    {
                        for (Int32 x = 0; x != m_gridsize.X; ++x)
                        {
                            Point location = m_gridposition;
                            location.X += (m_cellsize.X + m_cellspacing) * x;
                            location.Y += (m_cellsize.Y + m_cellspacing) * y;

                            PlayerSelect selection = GetSelection(new Point(x, y), false);
                            if (selection == null && m_showemptyboxes == false)
                            {
                                continue;
                            }

                            drawstate.AddData((Vector2)location, null);
                        }
                    }

                    drawstate.Use();
                }
            }

            for (Int32 y = 0; y != m_gridsize.Y; ++y)
            {
                for (Int32 x = 0; x != m_gridsize.X; ++x)
                {
                    Point xy = new Point(x, y);

                    Vector2 location = (Vector2)m_gridposition;
                    location.X += (m_cellsize.X + m_cellspacing) * x;
                    location.Y += (m_cellsize.Y + m_cellspacing) * y;

                    PlayerSelect selection = GetSelection(xy, false);
                    if (selection != null && selection.SelectionType == PlayerSelectType.Profile)
                    {
                        selection.Profile.SpriteManager.Draw(SpriteId.SmallPortrait, location, Vector2.Zero, Vector2.One, SpriteEffects.None);
                    }

                    if (selection != null && selection.SelectionType == PlayerSelectType.Random)
                    {
                        Elements.StaticImage randomimage = m_elements.GetElement("cell.random") as Elements.StaticImage;
                        if (randomimage != null)
                        {
                            randomimage.Draw(location);
                        }
                    }

                    if (m_p1info.CurrentCell == xy && m_p2info.CurrentCell == xy)
                    {
                        if (m_blinkval > 0)
                        {
                            m_p1info.DrawCursorActive(location);
                        }
                        else
                        {
                            m_p2info.DrawCursorActive(location);
                        }
                    }
                    else if (m_p1info.CurrentCell == xy)
                    {
                        m_p1info.DrawCursorActive(location);
                    }
                    else if (m_p2info.CurrentCell == xy)
                    {
                        m_p2info.DrawCursorActive(location);
                    }
                }
            }
        }