예제 #1
0
        // called for each visible tile
        protected override void UpdateTile(Visual _tile, IntPoint ml)
        {
            MapControlTile2 tile = (MapControlTile2)_tile;
            BitmapSource    bmp;

            if (m_map.Bounds.Contains(ml))
            {
                byte b = m_map.MapArray[ml.Y, ml.X];

                if (b < 100)
                {
                    bmp = m_symbolBitmapCache.GetBitmap(SymbolID.Wall, Colors.Black, false);
                }
                else
                {
                    bmp = m_symbolBitmapCache.GetBitmap(SymbolID.Floor, Colors.Black, false);
                }
            }
            else
            {
                bmp = null;
            }

            if (bmp != tile.Bitmap)
            {
                tile.Bitmap = bmp;
                tile.Update();
            }
        }
예제 #2
0
        // called for each visible tile
        protected void UpdateTile(Visual _tile, IntPoint ml)
        {
            MapControlTile2 tile = (MapControlTile2)_tile;

            Color c;

            if (m_map.Bounds.Contains(ml))
            {
                byte b = m_map[ml.X, ml.Y];
                c = Color.FromRgb(b, b, b);
            }
            else
            {
                c = Color.FromRgb(0, 0, 0);
            }

            if (c != tile.Color)
            {
                tile.Color = c;
                tile.Update();
            }
        }