// ############################################################################################# /// Function:<summary> /// Add a tile to the new texture page /// </summary> /// /// In: <param name="_tile">Tile to add</param> /// <param name="_Texture">Texture page UINT32 array</param> /// <param name="_dest">base index into texture</param> /// // ############################################################################################# public static unsafe void AddTile(Tile _tile, UInt32[] _Texture, int _dest) { int DestBase = _dest; UInt32[] TileData = _tile.TileData; for (int y = 0; y < _tile.Height; y++) { for (int x = 0; x < _tile.Width; x++) { _Texture[_dest + x] = TileData[(_tile.Width*y)+ x]; } _dest += TWIDTH; } AddWrapping(_Texture, DestBase, BORDER_SIZE, BORDER_SIZE); }
// ############################################################################################# /// Function:<summary> /// /// </summary> /// /// In: <param name="_png"></param> /// Out: <returns> /// /// </returns> // ############################################################################################# public static Map GenerateMap(string _png) { Tile tile = new Tile(_png ); Map map =new Map(tile); map.Generate(); string out_file = Path.GetDirectoryName(_png)+"\\"+Path.GetFileNameWithoutExtension(_png)+".city"; map.Save(out_file); return map; }