Exemple #1
0
        void redraw()
        {
            int z    = (zoom > 0) ? zoom : 1;
            int maph = (mp.map_count + 3) / 4;
            int rw   = 256 * 4 * z;
            int rh   = 192 * z;
            int w    = rw * 4;
            int h    = rh * maph;

            bmp = new Bitmap(w, h, PixelFormat.Format32bppArgb);
            MapEdit temp_map = new MapEdit(mp, 0);

            for (int r = 0; r < mp.map_count; ++r)
            {
                int        x = r & 3;
                int        y = r / 4;
                BitmapData d = bmp.LockBits(new Rectangle(x * rw, y * rh, rw, rh), ImageLockMode.WriteOnly, bmp.PixelFormat);
                temp_map.render_select(d, r, z, secret, items, collision);
                bmp.UnlockBits(d);
            }
            if (zoom < 0) // downscale
            {
                Bitmap sbmp = new Bitmap(w / (-zoom), h / (-zoom), bmp.PixelFormat);
                using (Graphics g = Graphics.FromImage(sbmp))
                {
                    g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bilinear;
                    g.DrawImage(bmp, 0, 0, sbmp.Width, sbmp.Height);
                }
                bmp = sbmp;
            }
            pictureBox.Image = bmp;
        }
Exemple #2
0
 public SpriteControl(MapEdit me_, int value)
 {
     me     = me_;
     result = value;
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     Width  = zoom * 16 * 8;
     Height = zoom * 16 * 8;
 }
 public CollectibleItemControl(MapEdit me_, bool shop_, int value)
 {
     me     = me_;
     shop   = shop_;
     result = value;
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     Width  = zoom * 16 * 8;
     Height = zoom * 16 * (shop ? 2 : 3);
 }
Exemple #4
0
        public void remove_map_edit(MapEdit m)
        {
            bool removed;

            do
            {
                removed = mapedits.Remove(m);
            } while (removed);
        }
Exemple #5
0
        public MapEditHex(MapEdit me_, Main parent)
        {
            mp = parent;
            me = me_;
            InitializeComponent();
            this.Icon = lotwtool.Properties.Resources.Icon;
            int x = me.room % 4;
            int y = me.room / 4;

            Text = string.Format("Info Hex {0},{1} ({2})", x, y, me.room);
            redraw();
        }
        public MapEditProperties(MapEdit parent, Main mp_)
        {
            me = parent;
            mp = mp_;
            InitializeComponent();
            this.Icon = lotwtool.Properties.Resources.Icon;
            int x = me.room % 4;
            int y = me.room / 4;

            Text = string.Format("Map Properties {0},{1} ({2})", x, y, me.room);
            int ro = 16 + (1024 * me.room);

            propertyGrid.SelectedObject = new MapProperties(mp, me, ro);
        }
Exemple #7
0
        public MapEditItem(MapEdit parent, Main mp_)
        {
            me = parent;
            mp = mp_;
            ro = 16 + (1024 * me.room);
            InitializeComponent();
            this.Icon = lotwtool.Properties.Resources.Icon;
            int x = me.room % 4;
            int y = me.room / 4;

            Text = string.Format("Map Items {0},{1} ({2})", x, y, me.room);
            set_item(0);
            redraw();
        }
Exemple #8
0
        public void add_map_edit(int room)
        {
            if (room >= map_count && room != 0x4E)
            {
                return;
            }
            foreach (MapEdit m in mapedits)
            {
                if (m.room == room)
                {
                    if (raise_child(m))
                    {
                        return;
                    }
                }
            }
            MapEdit me = new MapEdit(this, room);

            me.Show();
            mapedits.Add(me);
            add_refresh(me);
        }
Exemple #9
0
        public MapEditTile(MapEdit me_, Main parent, bool modal_ = false)
        {
            mp    = parent;
            me    = me_;
            modal = modal_;
            InitializeComponent();
            this.Icon = lotwtool.Properties.Resources.Icon;
            int x = me.room % 4;
            int y = me.room / 4;

            Text = string.Format("Tiles {0},{1} ({2})", x, y, (y * 4) + x);
            zoom = default_zoom;
            cache();
            updateZoom();
            //redraw(); // done by updateZoom
            toolStripTipLabel.Text = "RMB = Edit";
            updateTileStatus(get_tile());
            if (modal)
            {
                actionToolStripMenuItem.Enabled = false;
                undoToolStripMenuItem.Enabled   = false; // just in case action doesn't disable it too
                toolStripTipLabel.Text          = "";
            }
        }
 public MapProperties(Main mp_, MapEdit me_, int ro_)
 {
     ro = ro_;
     mp = mp_;
     me = me_;
 }
Exemple #11
0
 public MapItemProperties(Main mp_, MapEdit me_, int eo_)
 {
     mp = mp_;
     me = me_;
     eo = eo_;
 }