mirror of
https://github.com/glest/glest-source.git
synced 2025-08-09 01:46:28 +02:00
Merge pull request #151 from andy5995/divider_grammar
fix spelling of "Divider" that shows in map editor
This commit is contained in:
@@ -108,7 +108,7 @@ MainWindow::MainWindow(string appPath)
|
|||||||
randomWithReset=true;
|
randomWithReset=true;
|
||||||
randomMinimumHeight=-300;
|
randomMinimumHeight=-300;
|
||||||
randomMaximumHeight=400;
|
randomMaximumHeight=400;
|
||||||
randomChanceDevider=30;
|
randomChanceDivider=30;
|
||||||
randomRecursions=3;
|
randomRecursions=3;
|
||||||
|
|
||||||
this->appPath = appPath;
|
this->appPath = appPath;
|
||||||
@@ -1031,7 +1031,7 @@ void MainWindow::onMenuEditRandomizeHeights(wxCommandEvent &event) {
|
|||||||
simpleDialog.addValue("Initial Reset", boolToStr(randomWithReset),"(1 = true, 0 = false) If set to '0' no height reset is done before calculating");
|
simpleDialog.addValue("Initial Reset", boolToStr(randomWithReset),"(1 = true, 0 = false) If set to '0' no height reset is done before calculating");
|
||||||
simpleDialog.addValue("Min Height", intToStr(randomMinimumHeight),"Lowest random height. example: -300 or below if you want water , 0 if you don't want water.");
|
simpleDialog.addValue("Min Height", intToStr(randomMinimumHeight),"Lowest random height. example: -300 or below if you want water , 0 if you don't want water.");
|
||||||
simpleDialog.addValue("Max Height", intToStr(randomMaximumHeight),"Max random height. A good value is 400");
|
simpleDialog.addValue("Max Height", intToStr(randomMaximumHeight),"Max random height. A good value is 400");
|
||||||
simpleDialog.addValue("Chance Devider", intToStr(randomChanceDevider),"Defines how often you get a hill or hole default is 30. Bigger number, less hills/holes.");
|
simpleDialog.addValue("Chance Divider", intToStr(randomChanceDivider),"Defines how often you get a hill or hole default is 30. Bigger number, less hills/holes.");
|
||||||
simpleDialog.addValue("Smooth Recursions", intToStr(randomRecursions),"Number of recursions cycles to smooth the hills and holes. 0<x<50 default is 3.");
|
simpleDialog.addValue("Smooth Recursions", intToStr(randomRecursions),"Number of recursions cycles to smooth the hills and holes. 0<x<50 default is 3.");
|
||||||
if (!simpleDialog.show("Randomize Height")) return;
|
if (!simpleDialog.show("Randomize Height")) return;
|
||||||
|
|
||||||
@@ -1045,19 +1045,19 @@ void MainWindow::onMenuEditRandomizeHeights(wxCommandEvent &event) {
|
|||||||
}
|
}
|
||||||
randomMinimumHeight=strToInt(simpleDialog.getValue("Min Height"));
|
randomMinimumHeight=strToInt(simpleDialog.getValue("Min Height"));
|
||||||
randomMaximumHeight=strToInt(simpleDialog.getValue("Max Height"));
|
randomMaximumHeight=strToInt(simpleDialog.getValue("Max Height"));
|
||||||
randomChanceDevider=strToInt(simpleDialog.getValue("Chance Devider"));
|
randomChanceDivider=strToInt(simpleDialog.getValue("Chance Divider"));
|
||||||
randomRecursions=strToInt(simpleDialog.getValue("Smooth Recursions"));
|
randomRecursions=strToInt(simpleDialog.getValue("Smooth Recursions"));
|
||||||
|
|
||||||
// set insane inputs to something that does not crash
|
// set insane inputs to something that does not crash
|
||||||
if(randomMinimumHeight>=randomMaximumHeight) randomMinimumHeight=randomMaximumHeight-1;
|
if(randomMinimumHeight>=randomMaximumHeight) randomMinimumHeight=randomMaximumHeight-1;
|
||||||
if(randomChanceDevider<1) randomChanceDevider=1;
|
if(randomChanceDivider<1) randomChanceDivider=1;
|
||||||
|
|
||||||
// set randomRecursions to something useful
|
// set randomRecursions to something useful
|
||||||
if(randomRecursions<0) randomRecursions=0;
|
if(randomRecursions<0) randomRecursions=0;
|
||||||
if(randomRecursions>50) randomRecursions=50;
|
if(randomRecursions>50) randomRecursions=50;
|
||||||
|
|
||||||
program->randomizeMapHeights(randomWithReset, randomMinimumHeight, randomMaximumHeight,
|
program->randomizeMapHeights(randomWithReset, randomMinimumHeight, randomMaximumHeight,
|
||||||
randomChanceDevider, randomRecursions);
|
randomChanceDivider, randomRecursions);
|
||||||
}
|
}
|
||||||
catch (const exception &e) {
|
catch (const exception &e) {
|
||||||
MsgDialog(this, ToUnicode(e.what()), wxT("Exception"), wxOK | wxICON_ERROR).ShowModal();
|
MsgDialog(this, ToUnicode(e.what()), wxT("Exception"), wxOK | wxICON_ERROR).ShowModal();
|
||||||
|
@@ -200,7 +200,7 @@ private:
|
|||||||
bool randomWithReset;
|
bool randomWithReset;
|
||||||
int randomMinimumHeight;
|
int randomMinimumHeight;
|
||||||
int randomMaximumHeight;
|
int randomMaximumHeight;
|
||||||
int randomChanceDevider;
|
int randomChanceDivider;
|
||||||
int randomRecursions;
|
int randomRecursions;
|
||||||
|
|
||||||
ChangeType enabledGroup;
|
ChangeType enabledGroup;
|
||||||
|
@@ -561,8 +561,8 @@ void Program::shiftDown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Program::randomizeMapHeights(bool withReset,int minimumHeight, int maximumHeight, int chanceDevider, int smoothRecursions) {
|
void Program::randomizeMapHeights(bool withReset,int minimumHeight, int maximumHeight, int chanceDivider, int smoothRecursions) {
|
||||||
if(map) map->randomizeHeights(withReset, minimumHeight, maximumHeight, chanceDevider, smoothRecursions);
|
if(map) map->randomizeHeights(withReset, minimumHeight, maximumHeight, chanceDivider, smoothRecursions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Program::randomizeFactions() {
|
void Program::randomizeFactions() {
|
||||||
|
@@ -151,7 +151,7 @@ public:
|
|||||||
void shiftUp();
|
void shiftUp();
|
||||||
void shiftDown();
|
void shiftDown();
|
||||||
|
|
||||||
void randomizeMapHeights(bool withReset, int minimumHeight, int maximumHeight, int chanceDevider, int smoothRecursions);;
|
void randomizeMapHeights(bool withReset, int minimumHeight, int maximumHeight, int chanceDivider, int smoothRecursions);;
|
||||||
void randomizeFactions();
|
void randomizeFactions();
|
||||||
void switchMapSurfaces(int surf1, int surf2);
|
void switchMapSurfaces(int surf1, int surf2);
|
||||||
void loadMap(const string &path);
|
void loadMap(const string &path);
|
||||||
|
@@ -704,9 +704,9 @@ void MapPreview::setAdvanced(int heightFactor, int waterLevel, int cliffLevel, i
|
|||||||
hasChanged = true;
|
hasChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapPreview::randomizeHeights(bool withReset,int minimumHeight, int maximumHeight, int chanceDevider, int smoothRecursions) {
|
void MapPreview::randomizeHeights(bool withReset,int minimumHeight, int maximumHeight, int chanceDivider, int smoothRecursions) {
|
||||||
if(withReset) resetHeights(random.randRange(8, 10));
|
if(withReset) resetHeights(random.randRange(8, 10));
|
||||||
realRandomize(minimumHeight,maximumHeight,chanceDevider,smoothRecursions);
|
realRandomize(minimumHeight,maximumHeight,chanceDivider,smoothRecursions);
|
||||||
hasChanged = true;
|
hasChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1015,15 +1015,15 @@ void MapPreview::resetHeights(int height) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapPreview::realRandomize(int minimumHeight, int maximumHeight, int _chanceDevider, int _smoothRecursions) {
|
void MapPreview::realRandomize(int minimumHeight, int maximumHeight, int _chanceDivider, int _smoothRecursions) {
|
||||||
int moduloParam=abs(maximumHeight-minimumHeight);
|
int moduloParam=abs(maximumHeight-minimumHeight);
|
||||||
int chanceDevider=_chanceDevider;
|
int chanceDivider=_chanceDivider;
|
||||||
int smoothRecursions=_smoothRecursions;
|
int smoothRecursions=_smoothRecursions;
|
||||||
if(moduloParam<2) moduloParam=2;
|
if(moduloParam<2) moduloParam=2;
|
||||||
//printf("moduloParam=%d minimumHeight=%d maximumHeight=%d\n",moduloParam,minimumHeight,maximumHeight);
|
//printf("moduloParam=%d minimumHeight=%d maximumHeight=%d\n",moduloParam,minimumHeight,maximumHeight);
|
||||||
|
|
||||||
// set chanceDevider to something possible
|
// set chanceDivider to something possible
|
||||||
if(chanceDevider<2) chanceDevider=2;
|
if(chanceDivider<2) chanceDivider=2;
|
||||||
|
|
||||||
// set smoothRecursions to something useful
|
// set smoothRecursions to something useful
|
||||||
if(smoothRecursions<0) smoothRecursions=0;
|
if(smoothRecursions<0) smoothRecursions=0;
|
||||||
@@ -1031,7 +1031,7 @@ void MapPreview::realRandomize(int minimumHeight, int maximumHeight, int _chance
|
|||||||
|
|
||||||
for (int i = 1; i < w-1; ++i) {
|
for (int i = 1; i < w-1; ++i) {
|
||||||
for (int j = 1; j < h-1; ++j) {
|
for (int j = 1; j < h-1; ++j) {
|
||||||
if(rand()%chanceDevider==1){
|
if(rand()%chanceDivider==1){
|
||||||
cells[i][j].height=(rand() % moduloParam)+minimumHeight;
|
cells[i][j].height=(rand() % moduloParam)+minimumHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user