Wraps a texture atlas to perform fast hardware-accelerated updates on the source image.
示例#1
0
 public TileAnimHandler(FastTextureAtlas atlas)
 {
     _atlas = atlas;
     _sources = new List<IntRect>();
     _tiles = new List<int[]>();
 }
示例#2
0
        /// <summary>
        /// Turns the tileset into a tile atlas and then put it into
        /// a wrapper for fast tetxure manipulation.
        /// </summary>
        private static void ConstructFastAtlas()
        {
            _tileatlas.Update(_map.Tileset.GetImageArray());
            _fastatlas = new FastTextureAtlas(_tileatlas);

            #if(DEBUG)
            ColorInstance color = new ColorInstance(Program._engine, Color.Magenta);
            for (int i = 0; i < _map.Tileset.Tiles.Count; ++i) {
                Tile t = _map.Tileset.Tiles[i];
                foreach (Line l in t.Obstructions)
                    _fastatlas.Line((uint)i, l);
            }
            #endif
        }