Beispiel #1
0
        private Bitmap overlayEntities(Bitmap img)
        {
            const float opacity = 0.66f;

            // Overlay every... overworld entity
            foreach (var e in OWSE.CurrentZone.Entities.Furniture)
            {
                int x = e.X;
                int y = e.Y;
                for (int sx = 0; sx < e.WX; sx++)     // Stretch X
                {
                    for (int sy = 0; sy < e.WY; sy++) // Stretch Y
                    {
                        try { WinFormsUtil.LayerImage(img, Properties.Resources.F, (x + sx) * mapScale, (y + sy) * mapScale, opacity); }
                        catch { }
                    }
                }
            }
            foreach (var e in OWSE.CurrentZone.Entities.NPCs)
            {
                int x = e.X;
                int y = e.Y;
                try { WinFormsUtil.LayerImage(img, Properties.Resources.N, x * mapScale, y * mapScale, opacity); }
                catch { }
            }
            foreach (var e in OWSE.CurrentZone.Entities.Warps)
            {
                int x = (int)e.pX;                        // shifted warps look weird
                int y = (int)e.pY;                        // shifted warps look weird
                for (int sx = 0; sx < e.Width; sx++)      // Stretch X
                {
                    for (int sy = 0; sy < e.Height; sy++) // Stretch Y
                    {
                        try { WinFormsUtil.LayerImage(img, Properties.Resources.W, (x + sx) * mapScale, (y + sy) * mapScale, opacity); }
                        catch { }
                    }
                }
            }
            foreach (var e in OWSE.CurrentZone.Entities.Triggers1)
            {
                int x = e.X;
                int y = e.Y;
                for (int sx = 0; sx < e.Width; sx++)      // Stretch X
                {
                    for (int sy = 0; sy < e.Height; sy++) // Stretch Y
                    {
                        try { WinFormsUtil.LayerImage(img, Properties.Resources.T1, (x + sx) * mapScale, (y + sy) * mapScale, opacity); }
                        catch { }
                    }
                }
            }
            foreach (var e in OWSE.CurrentZone.Entities.Triggers2)
            {
                int x = e.X;
                int y = e.Y;
                for (int sx = 0; sx < e.Width; sx++)      // Stretch X
                {
                    for (int sy = 0; sy < e.Height; sy++) // Stretch Y
                    {
                        try { WinFormsUtil.LayerImage(img, Properties.Resources.T2, (x + sx) * mapScale, (y + sy) * mapScale, opacity); }
                        catch { }
                    }
                }
            }

            // Overlay Map Data
            // Flyto
            {
                int x = (int)OWSE.CurrentZone.ZD.pX2;
                int y = (int)OWSE.CurrentZone.ZD.pY2;
                for (int sx = 0; sx < 1; sx++)     // Stretch X
                {
                    for (int sy = 0; sy < 1; sy++) // Stretch Y
                    {
                        try { WinFormsUtil.LayerImage(img, Properties.Resources.FLY, (x + sx) * mapScale, (y + sy) * mapScale, opacity / 2); }
                        catch { }
                    }
                }
            }
            // Unknown
            //{
            //    using(var g = Graphics.FromImage(img))
            //        foreach (var l in OWSE.mm.LoadLines)
            //            try { g.DrawLine(new Pen(Color.Red, 4), l.p2 * mapScale, l.p1 * mapScale, l.p4 * mapScale, l.p3 * mapScale); }
            //            catch {}
            //}

            return(img);
        }