summaryrefslogtreecommitdiff
path: root/src/genworld_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2011-06-26 16:16:04 +0000
committeralberth <alberth@openttd.org>2011-06-26 16:16:04 +0000
commita0cd04130a1897665106069954e230be630fe420 (patch)
tree69943e0f5b0f45a50d46e262cee5fd0425e8ffef /src/genworld_gui.cpp
parentc74fd63af391a3660240b52037e878cdd8d4ea53 (diff)
downloadopenttd-a0cd04130a1897665106069954e230be630fe420.tar.xz
(svn r22608) -Fix[FS#4663]: Use rotated heightmap sizes for reporting scaling problems.
Diffstat (limited to 'src/genworld_gui.cpp')
-rw-r--r--src/genworld_gui.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index f51d1fdfe..b6905ada7 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -602,12 +602,22 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
this->SetDirty();
break;
- case GLAND_GENERATE_BUTTON: // Generate
+ case GLAND_GENERATE_BUTTON: { // Generate
+ /* Get rotated map size. */
+ uint map_x;
+ uint map_y;
+ if (_settings_newgame.game_creation.heightmap_rotation == HM_CLOCKWISE) {
+ map_x = this->y;
+ map_y = this->x;
+ } else {
+ map_x = this->x;
+ map_y = this->y;
+ }
if (mode == GLWM_HEIGHTMAP &&
- (this->x * 2 < (1U << _settings_newgame.game_creation.map_x) ||
- this->x / 2 > (1U << _settings_newgame.game_creation.map_x) ||
- this->y * 2 < (1U << _settings_newgame.game_creation.map_y) ||
- this->y / 2 > (1U << _settings_newgame.game_creation.map_y))) {
+ (map_x * 2 < (1U << _settings_newgame.game_creation.map_x) ||
+ map_x / 2 > (1U << _settings_newgame.game_creation.map_x) ||
+ map_y * 2 < (1U << _settings_newgame.game_creation.map_y) ||
+ map_y / 2 > (1U << _settings_newgame.game_creation.map_y))) {
ShowQuery(
STR_WARNING_HEIGHTMAP_SCALE_CAPTION,
STR_WARNING_HEIGHTMAP_SCALE_MESSAGE,
@@ -617,6 +627,7 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow {
StartGeneratingLandscape(mode);
}
break;
+ }
case GLAND_START_DATE_DOWN:
case GLAND_START_DATE_UP: // Year buttons