Exemplo n.º 1
0
        public void DrawAnimation(DevicePanel d)
        {
            d.Cache();

            //long a = System.DateTime.Now.Millisecond;
            //Console.Out.WriteLine(System.DateTime.Now.Millisecond - a);

            foreach (MapBack b in backs)
            {
                if (b.Object.GetInt("front") == 0)
                {
                    b.DrawAnimation(d);
                }
            }

            foreach (MapLayer l in layers)
            {
                l.DrawAnimation(d);
            }

            foreach (MapBack b in backs)
            {
                if (b.Object.GetInt("front") == 1)
                {
                    b.DrawAnimation(d);
                }
            }
        }
Exemplo n.º 2
0
        public void Draw(DevicePanel d)
        {
            d.Cache();

            if (MapEditor.Instance.ShowBack.Checked || MapEditor.Instance.EditBack.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditBack.Checked) ? 0x32 : 0xFF;
                foreach (MapBack b in backs)
                {
                    if (b.Object.GetInt("front") == 0)
                    {
                        b.Transparency = transparency;
                        b.Draw(d);
                    }
                }
            }
            //long a = System.DateTime.Now.Millisecond;
            foreach (MapLayer l in layers)
            {
                l.Draw(d);
            }
            //Console.Out.WriteLine(System.DateTime.Now.Millisecond - a);
            if (MapEditor.Instance.ShowLife.Checked || MapEditor.Instance.EditLife.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditLife.Checked) ? 0x32 : 0xFF;
                foreach (MapLife l in lifes)
                {
                    if (!footholds.Contains(l.Object.GetInt("fh")))
                    {
                        l.Transparency = transparency;
                        l.Draw(d);
                    }
                }
            }
            if (MapEditor.Instance.ShowReactor.Checked || MapEditor.Instance.EditReactor.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditReactor.Checked) ? 0x32 : 0xFF;
                foreach (MapReactor r in reactors)
                {
                    r.Transparency = transparency;
                    r.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowClock.Checked || MapEditor.Instance.EditClock.Checked)
            {
                if (clock != null)
                {
                    int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditClock.Checked) ? 0x32 : 0xFF;
                    clock.Transparency = transparency;
                    clock.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowSeat.Checked || MapEditor.Instance.EditSeat.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditSeat.Checked) ? 0x32 : 0xFF;
                foreach (MapSeat s in seats)
                {
                    s.Transparency = transparency;
                    s.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowPortal.Checked || MapEditor.Instance.EditPortal.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditPortal.Checked) ? 0x32 : 0xFF;
                foreach (MapPortal p in portals)
                {
                    p.Transparency = transparency;
                    p.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowBack.Checked || MapEditor.Instance.EditBack.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditBack.Checked) ? 0x32 : 0xFF;
                foreach (MapBack b in backs)
                {
                    if (b.Object.GetInt("front") == 1)
                    {
                        b.Transparency = transparency;
                        b.Draw(d);
                    }
                }
            }
            if (MapEditor.Instance.ShowToolTip.Checked || MapEditor.Instance.EditToolTip.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditToolTip.Checked) ? 0x32 : 0xFF;
                foreach (MapToolTip t in tooltips)
                {
                    t.Transparency = transparency;
                    t.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowLimits.Checked && VRTop != 0)
            {
                int x1 = CenterX + VRLeft, y1 = CenterY + VRTop, x2 = CenterX + VRRight, y2 = CenterY + VRBottom;

                /*
                 * (X1, Y1)         (X2, Y1)
                 *
                 *
                 * (X1, Y2)         (X2, Y2)
                 */

                d.DrawLine(x1, y1, x2, y1, Color.DarkBlue);
                d.DrawLine(x1, y1, x1, y2, Color.DarkBlue);
                d.DrawLine(x2, y2, x2, y1, Color.DarkBlue);
                d.DrawLine(x2, y2, x1, y2, Color.DarkBlue);
            }
            if (MapEditor.Instance.draggingSelection)
            {
                int x1 = (int)(MapEditor.Instance.selectingX / MapEditor.Instance.Zoom), x2 = (int)(MapEditor.Instance.lastX / MapEditor.Instance.Zoom);
                int y1 = (int)(MapEditor.Instance.selectingY / MapEditor.Instance.Zoom), y2 = (int)(MapEditor.Instance.lastY / MapEditor.Instance.Zoom);
                if (x1 != x2 && y1 != y2)
                {
                    if (x1 > x2)
                    {
                        x1 = (int)(MapEditor.Instance.lastX / MapEditor.Instance.Zoom);
                        x2 = (int)(MapEditor.Instance.selectingX / MapEditor.Instance.Zoom);
                    }
                    if (y1 > y2)
                    {
                        y1 = (int)(MapEditor.Instance.lastY / MapEditor.Instance.Zoom);
                        y2 = (int)(MapEditor.Instance.selectingY / MapEditor.Instance.Zoom);
                    }

                    d.DrawRectangle(x1, y1, x2, y2, Color.FromArgb(50, Color.Purple));

                    d.DrawLine(x1, y1, x2, y1, Color.Purple);
                    d.DrawLine(x1, y1, x1, y2, Color.Purple);
                    d.DrawLine(x2, y2, x2, y1, Color.Purple);
                    d.DrawLine(x2, y2, x1, y2, Color.Purple);
                }
            }
            if (MapEditor.Instance.DrawMode.Checked)
            {
                foreach (MapCurve curve in MapEditor.Instance.curves)
                {
                    curve.Draw(d);
                }
            }
        }
Exemplo n.º 3
0
        public void Draw(DevicePanel d)
        {
            d.Cache();

            if (MapEditor.Instance.ShowBack.Checked || MapEditor.Instance.EditBack.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditBack.Checked) ? 0x32 : 0xFF;
                foreach (MapBack b in backs)
                {
                    if (b.Object.GetInt("front") == 0)
                    {
                        b.Transparency = transparency;
                        b.Draw(d);
                    }
                }
            }
            //long a = System.DateTime.Now.Millisecond;
            foreach (MapLayer l in layers)
            {
                l.Draw(d);
            }
            //Console.Out.WriteLine(System.DateTime.Now.Millisecond - a);
            if (MapEditor.Instance.ShowLife.Checked || MapEditor.Instance.EditLife.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditLife.Checked) ? 0x32 : 0xFF;
                foreach (MapLife l in lifes)
                {
                    if (!footholds.Contains(l.Object.GetInt("fh")))
                    {
                        l.Transparency = transparency;
                        l.Draw(d);
                    }
                }
            }
            if (MapEditor.Instance.ShowReactor.Checked || MapEditor.Instance.EditReactor.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditReactor.Checked) ? 0x32 : 0xFF;
                foreach (MapReactor r in reactors)
                {
                    r.Transparency = transparency;
                    r.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowClock.Checked || MapEditor.Instance.EditClock.Checked)
            {
                if (clock != null)
                {
                    int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditClock.Checked) ? 0x32 : 0xFF;
                    clock.Transparency = transparency;
                    clock.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowSeat.Checked || MapEditor.Instance.EditSeat.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditSeat.Checked) ? 0x32 : 0xFF;
                foreach (MapSeat s in seats)
                {
                    s.Transparency = transparency;
                    s.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowPortal.Checked || MapEditor.Instance.EditPortal.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditPortal.Checked) ? 0x32 : 0xFF;
                foreach (MapPortal p in portals)
                {
                    p.Transparency = transparency;
                    p.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowBack.Checked || MapEditor.Instance.EditBack.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditBack.Checked) ? 0x32 : 0xFF;
                foreach (MapBack b in backs)
                {
                    if (b.Object.GetInt("front") == 1)
                    {
                        b.Transparency = transparency;
                        b.Draw(d);
                    }
                }
            }
            if (MapEditor.Instance.ShowToolTip.Checked || MapEditor.Instance.EditToolTip.Checked)
            {
                int transparency = (MapEditor.Instance.EditMode.Checked && !MapEditor.Instance.EditToolTip.Checked) ? 0x32 : 0xFF;
                foreach (MapToolTip t in tooltips)
                {
                    t.Transparency = transparency;
                    t.Draw(d);
                }
            }
            if (MapEditor.Instance.ShowLimits.Checked && VRTop != 0)
            {
                int x1 = CenterX + VRLeft, y1 = CenterY + VRTop, x2 = CenterX + VRRight, y2 = CenterY + VRBottom;
                /*
                 * (X1, Y1)         (X2, Y1)
                 * 
                 * 
                 * (X1, Y2)         (X2, Y2)
                 */

                d.DrawLine(x1, y1, x2, y1, Color.DarkBlue);
                d.DrawLine(x1, y1, x1, y2, Color.DarkBlue);
                d.DrawLine(x2, y2, x2, y1, Color.DarkBlue);
                d.DrawLine(x2, y2, x1, y2, Color.DarkBlue);
            }
            if (MapEditor.Instance.draggingSelection)
            {
                int x1 = (int)(MapEditor.Instance.selectingX / MapEditor.Instance.Zoom), x2 = (int)(MapEditor.Instance.lastX / MapEditor.Instance.Zoom);
                int y1 = (int)(MapEditor.Instance.selectingY / MapEditor.Instance.Zoom), y2 = (int)(MapEditor.Instance.lastY / MapEditor.Instance.Zoom);
                if (x1 != x2 && y1 != y2)
                {
                    if (x1 > x2)
                    {
                        x1 = (int)(MapEditor.Instance.lastX / MapEditor.Instance.Zoom);
                        x2 = (int)(MapEditor.Instance.selectingX / MapEditor.Instance.Zoom);
                    }
                    if (y1 > y2)
                    {
                        y1 = (int)(MapEditor.Instance.lastY / MapEditor.Instance.Zoom);
                        y2 = (int)(MapEditor.Instance.selectingY / MapEditor.Instance.Zoom);
                    }

                    d.DrawRectangle(x1, y1, x2, y2, Color.FromArgb(50, Color.Purple));

                    d.DrawLine(x1, y1, x2, y1, Color.Purple);
                    d.DrawLine(x1, y1, x1, y2, Color.Purple);
                    d.DrawLine(x2, y2, x2, y1, Color.Purple);
                    d.DrawLine(x2, y2, x1, y2, Color.Purple);
                }
            }
            if (MapEditor.Instance.DrawMode.Checked)
            {
                foreach (MapCurve curve in MapEditor.Instance.curves)
                {
                    curve.Draw(d);
                }
            }
        }
Exemplo n.º 4
0
        public void DrawAnimation(DevicePanel d)
        {
            d.Cache();

            //long a = System.DateTime.Now.Millisecond;
            //Console.Out.WriteLine(System.DateTime.Now.Millisecond - a);

            foreach (MapBack b in backs)
            {
                if (b.Object.GetInt("front") == 0)
                {
                    b.DrawAnimation(d);
                }
            }

            foreach (MapLayer l in layers)
            {
                l.DrawAnimation(d);
            }

            foreach (MapBack b in backs)
            {
                if (b.Object.GetInt("front") == 1)
                {
                    b.DrawAnimation(d);
                }
            }
        }