Index: dataobj/settings.cc =================================================================== --- dataobj/settings.cc (revision 9159) +++ dataobj/settings.cc (working copy) @@ -86,7 +86,7 @@ no_tree_climates = 0; // bit set, if this climate is to be void of random trees no_trees = false; // if set, no trees at all, may be useful for low end engines - lake = true; // if set lakes will be added to map + lake = 8; // lakes will be generated below this height above groundwater // some settings more allow_player_change = true; @@ -829,8 +829,15 @@ else if( file->is_loading() ) { default_ai_construction_speed = env_t::default_ai_construction_speed; } + /*if( file->is_version_atleast(INSERT LAKE_HEIGHT_VERSION) ) { + file->rdwr_byte(lake); + } + else */ if( file->is_version_atleast(120, 2) ) { + bool this_lake = lake > 0; + file->rdwr_bool(this_lake); + lake = this_lake ? 8 : 0; + } if( file->is_version_atleast(120, 2) ) { - file->rdwr_bool(lake); file->rdwr_bool(no_trees); file->rdwr_long( max_choose_route_steps ); } @@ -1333,7 +1340,7 @@ tree_climates = contents.get_int("tree_climates", tree_climates ); no_tree_climates = contents.get_int("no_tree_climates", no_tree_climates ); no_trees = contents.get_int("no_trees", no_trees ); - lake = !contents.get_int("no_lakes", !lake ); + lake = (contents.get_int("no_lakes", (lake == 0) )) ? 0 : 8; // these are pak specific; the diagonal length affect travelling time (is game critical) pak_diagonal_multiplier = contents.get_int("diagonal_multiplier", pak_diagonal_multiplier ); Index: dataobj/settings.h =================================================================== --- dataobj/settings.h (revision 9159) +++ dataobj/settings.h (working copy) @@ -139,7 +139,7 @@ uint16 no_tree_climates; bool no_trees; - bool lake; + sint8 lake; // game mechanics uint8 allow_player_change; @@ -558,8 +558,8 @@ bool get_no_trees() const { return no_trees; } void set_no_trees(bool b) { no_trees = b; } - bool get_lake() const { return lake; } - void set_lake(bool b) { lake = b; } + sint8 get_lake() const { return lake; } + void set_lake(sint8 h) { lake = h; } uint32 get_industry_increase_every() const { return industry_increase; } void set_industry_increase_every( uint32 n ) { industry_increase = n; } Index: gui/climates.cc =================================================================== --- gui/climates.cc (revision 9159) +++ gui/climates.cc (working copy) @@ -86,13 +86,13 @@ no_tree.add_listener( this ); add_component( &no_tree ); - lake.init( button_t::square_state, "lake" ); - lake.pressed = sets->get_lake(); - lake.add_listener( this ); - add_component( &lake ); - add_table(2,0); { + new_component("Lake height"); + lake.init( sets->lake, sets->get_groundwater(), 127, gui_numberinput_t::AUTOLINEAR, false ); + lake.add_listener( this ); + add_component( &lake ); + new_component("Number of rivers"); river_n.init( sets->get_river_number(), 0, 1024, gui_numberinput_t::POWER2, false ); river_n.add_listener(this); @@ -126,8 +126,7 @@ sets->set_no_trees(no_tree.pressed); } else if(comp==&lake) { - lake.pressed ^= 1; - sets->set_lake(lake.pressed); + sets->lake = (sint16)v.i; } else if(comp==&water_level) { sets->groundwater = (sint16)v.i; Index: gui/climates.h =================================================================== --- gui/climates.h (revision 9159) +++ gui/climates.h (working copy) @@ -38,8 +38,8 @@ button_t no_tree; // without tree - button_t - lake; // lake + gui_numberinput_t + lake; // lake height gui_numberinput_t river_n, Index: simworld.cc =================================================================== --- simworld.cc (revision 9159) +++ simworld.cc (working copy) @@ -1447,7 +1447,7 @@ } } -void karte_t::create_lakes( int xoff, int yoff ) +void karte_t::create_lakes( int xoff, int yoff, sint8 max_lake_height ) { if( xoff > 0 || yoff > 0 ) { // too complicated to add lakes to an already existing world... @@ -1454,7 +1454,6 @@ return; } - const sint8 max_lake_height = groundwater + 8; const uint16 size_x = get_size().x; const uint16 size_y = get_size().y; @@ -1908,8 +1907,8 @@ ls.set_progress(12); } - if( sets->get_lake() ) { - create_lakes( old_x, old_y ); + if( sets->get_lake()>0 ) { + create_lakes( old_x, old_y, sets->get_lake() ); } if ( old_x == 0 && old_y == 0 ) { Index: simworld.h =================================================================== --- simworld.h (revision 9159) +++ simworld.h (working copy) @@ -664,7 +664,7 @@ /** * Will create lakes. */ - void create_lakes( int xoff, int yoff ); + void create_lakes( int xoff, int yoff, sint8 max_lake_height ); /** * Will create beaches.