map editor has much more powerful random height function

You can give parameters now, to influence the map height calculation.
This commit is contained in:
titiger
2015-02-10 02:06:02 +01:00
parent b4fabc2717
commit 4c5440f78c
6 changed files with 120 additions and 68 deletions

View File

@@ -153,6 +153,7 @@ Program::Program(int w, int h) {
hideWater=false;
ofsetX = 0;
ofsetY = 0;
map = new MapPreview();
resetFactions(8);
renderer.initMapSurface(w, h);
@@ -564,12 +565,12 @@ void Program::shiftDown() {
}
void Program::randomizeMapHeights() {
if(map) map->randomizeHeights();
void Program::randomizeMapHeights(bool withReset,int minimumHeight, int maximumHeight, int chanceDevider, int smoothRecursions) {
if(map) map->randomizeHeights(withReset, minimumHeight, maximumHeight, chanceDevider, smoothRecursions);
}
void Program::randomizeMap() {
if(map) map->randomize();
void Program::randomizeFactions() {
if(map) map->randomizeFactions();
}
void Program::switchMapSurfaces(int surf1, int surf2) {
@@ -588,8 +589,7 @@ void Program::resize(int w, int h, int alt, int surf) {
void Program::resetFactions(int maxFactions) {
if(map) map->resetFactions(maxFactions);
for (int i = 0; i < map->getMaxFactions(); ++i)
map->changeStartLocation(2*i,2*(i%4)+5,i);
randomizeFactions();
}
bool Program::setMapTitle(const string &title) {