/// <summary> /// Constructor /// </summary> /// <param name="routePath">Path to the route directory</param> /// <param name="messageDelegate">The delegate that will present with the message we want to send to the user during long loading times</param> /// <param name="drawWorldTiles">The object that knows which tiles are available</param> public DrawTerrain(string routePath, MessageDelegate messageDelegate, DrawWorldTiles drawWorldTiles) { this.messageDelegate = messageDelegate; this.tilesPath = routePath + @"\TILES\"; this.lotilesPath = routePath + @"\LO_TILES\"; this.terrtexPath = routePath + @"\TERRTEX\"; locationTranslator = new Translate3Dto2D(drawWorldTiles); terrainTiles = new Dictionary <uint, TerrainTile2D>(); loadedTerrainTiles = new HashSet <uint>(); }
/// <summary> /// Constructor. This will pre-calculate all needed vertices /// </summary> /// <param name="tile">The tile (parsed .t-file)</param> /// <param name="textureManager">The manager for the textures</param> /// <param name="locationTranslator">The translator for mapping 3D tile-based coordinates to quasi-2D locations</param> public TerrainTile2D(Tile tile, TerrainTextureManager textureManager, Translate3Dto2D locationTranslator) { this.textureManager = textureManager; this.locationTranslator = locationTranslator; this.TileSize = tile.Size; this.snappedTileX = tile.TileX; this.snappedTileZ = tile.TileZ; TileName.Snap(ref snappedTileX, ref snappedTileZ, zoomFromInt[this.TileSize]); verticesFull = CreateVerticesFromTile(tile); }