Exemplo n.º 1
0
        public override void DrawTiles(bool addIncrementForSelectedTiles, bool addIncrementForUserSelectedTiles)
        {
            int x = FPGA.FPGA.Instance.MaxX;
            int y = FPGA.FPGA.Instance.MaxY;

            // add 1 due to zero based indeces
            TileBitmap = new Bitmap((x + 1) * m_view.TileSize, (y + 1) * m_view.TileSize, m_pixelFormat);

            Graphics graphicsObj = Graphics.FromImage(TileBitmap);

            graphicsObj.Clear(Color.Gray);

            foreach (Tile tile in GetAllTiles())
            {
                DrawTile(tile, graphicsObj, addIncrementForSelectedTiles, addIncrementForUserSelectedTiles);
            }

            // get ram block data
            if (!m_ramDataValid)
            {
                m_ramDataValid = FPGATypes.GetRamBlockSize(m_view.TileRegex, out m_ramBlockWidth, out m_ramBlockHeight, out m_ramTiles);
            }

            foreach (Tile ramTile in m_ramTiles)
            {
                if (!m_view.TileRegex.IsMatch(ramTile.Location))
                {
                    continue;
                }

                DrawRAMTile(ramTile, graphicsObj, addIncrementForSelectedTiles, addIncrementForUserSelectedTiles);
            }

            graphicsObj.Dispose();
        }