/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { this.terrain = new TerrainEngine.Terrain(2048, 2048); this.terrain.SetupTestTerrain(); this.terrain.LoadTiles(); graphics.PreferredBackBufferWidth = 1600; graphics.PreferredBackBufferHeight = 1000; graphics.IsFullScreen = false; //graphics.PreferredBackBufferFormat = SurfaceFormat. graphics.ApplyChanges(); Window.Title = "Terrain Test 1"; fc.Start(); base.Initialize(); }
public void SetDataFromCells(Terrain.Cell[] cells, int xofs, int yofs, int stride) { int si=0, di=0; for (int y = 0; y < this.Height; y++) { si = (yofs + y) * stride + xofs; for (int x = 0; x < this.Width; x++) { this.Data[di++] = cells[si++].h; } } }