private void UpdateMapDisplay() { //Updates the map display in the map tab selectedNode = nodePanel.Selected; if (selectedNode != null) { if (DisplayOptionBox.SelectedIndex == 0) { mapDisplay.Image = selectedNode.getOutputGrid().gridToBitmapOcean(ColorGrad.LandGradient, ColorGrad.OceanGradient, currentProject.SeaLevel); } else if (DisplayOptionBox.SelectedIndex == 1) { if (SeasonSwitcher.SelectedIndex == 1) { mapDisplay.Image = Biomes.Temperature(selectedNode.getOutputGrid(), 0.4f).gridToBitmap(ColorGrad.tempGradient); } else if (SeasonSwitcher.SelectedIndex == 2) { mapDisplay.Image = Biomes.Temperature(selectedNode.getOutputGrid(), 0.6f).gridToBitmap(ColorGrad.tempGradient); } else { mapDisplay.Image = Biomes.Temperature(selectedNode.getOutputGrid()).gridToBitmap(ColorGrad.tempGradient); } } else if (DisplayOptionBox.SelectedIndex == 2) { RectGrid moisture = Biomes.moisture(selectedNode.getOutputGrid(), currentProject, 3 * currentProject.Frequency); mapDisplay.Image = moisture.gridToBitmap(ColorGrad.MoistureGradient); } else if (DisplayOptionBox.SelectedIndex == 3) { replacements[0] = tundraBox.SelectedIndex; replacements[1] = grassBox.SelectedIndex; replacements[2] = woodBox.SelectedIndex; replacements[3] = borBox.SelectedIndex; replacements[4] = seasonBox.SelectedIndex; replacements[5] = temperBox.SelectedIndex; replacements[6] = tropBox.SelectedIndex; replacements[7] = savBox.SelectedIndex; replacements[8] = desertBox.SelectedIndex; if (SeasonSwitcher.SelectedIndex == 1) { RectGrid biome = Biomes.BiomeMap(selectedNode.getOutputGrid(), currentProject, 3 * currentProject.Frequency, .4f, replacements); mapDisplay.Image = Biomes.renderBiomes(biome); } else if (SeasonSwitcher.SelectedIndex == 2) { RectGrid biome = Biomes.BiomeMap(selectedNode.getOutputGrid(), currentProject, 3 * currentProject.Frequency, .6f, replacements); mapDisplay.Image = Biomes.renderBiomes(biome); } else { RectGrid biome = Biomes.BiomeMap(selectedNode.getOutputGrid(), currentProject, 3 * currentProject.Frequency, .5f, replacements); mapDisplay.Image = Biomes.renderBiomes(biome); } } } }
//Misc functions private void UpdateDisplay() { //TODO: Do this more efficiently. tempPicBox.Image = image.gridToBitmap(); }
private void button1_Click(object sender, EventArgs e) { //Reset the image image = new ProjectCeres.RectGrid(image.Width, image.Height); tempPicBox.Image = image.gridToBitmap(); }