SetDataFromCells() public method

public SetDataFromCells ( TerrainEngine.Terrain cells, int xofs, int yofs, int stride ) : void
cells TerrainEngine.Terrain
xofs int
yofs int
stride int
return void
Ejemplo n.º 1
0
        // TODO: turn terrain into tiles
        public void LoadTiles()
        {
            // discard old tiles
            // TODO: do we need to unload resources here?
            this.Tiles.Clear();

            for (int y = 0; y < NYTiles; y++)
            {
                for (int x = 0; x < NXTiles; x++)
                {
                    //var tile = new TerrainTile(TileSize, TileSize, new Vector3((float)(x * TileSize), 0.0f, (float)(y * TileSize)),(float)TileSize);
                    var tile = new TerrainTile(TileSize, TileSize, new Vector3((float)(x), 0.0f, (float)(y)), 1.0f);
                    tile.SetDataFromCells(this.Data, x * TileSize, y * TileSize, this.Width);
                    this.Tiles.Add(tile);
                }
            }
        }
Ejemplo n.º 2
0
        // TODO: turn terrain into tiles
        public void LoadTiles()
        {
            // discard old tiles
            // TODO: do we need to unload resources here?
            this.Tiles.Clear();

            for (int y = 0; y < NYTiles; y++)
            {
                for (int x = 0; x < NXTiles; x++)
                {
                    //var tile = new TerrainTile(TileSize, TileSize, new Vector3((float)(x * TileSize), 0.0f, (float)(y * TileSize)),(float)TileSize);
                    var tile = new TerrainTile(TileSize, TileSize, new Vector3((float)(x), 0.0f, (float)(y)), 1.0f);
                    tile.SetDataFromCells(this.Data, x * TileSize, y * TileSize, this.Width);
                    this.Tiles.Add(tile);
                }
            }
        }