summaryrefslogtreecommitdiff
path: root/src/terraform_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-04-18 14:56:05 +0000
committerfrosch <frosch@openttd.org>2010-04-18 14:56:05 +0000
commit2e90f7f8b975d380c3d544995ef6db9d6c8a86d8 (patch)
tree90fb0852bd31229b016ca998a8e6c0ce44d699dd /src/terraform_gui.cpp
parent2330851d1dc0650335bc73ec4cfd010f08c55742 (diff)
downloadopenttd-2e90f7f8b975d380c3d544995ef6db9d6c8a86d8.tar.xz
(svn r19670) -Codechange: Add CeilDiv() and RoundDiv() to simplify integer divisions with rounding.
Diffstat (limited to 'src/terraform_gui.cpp')
-rw-r--r--src/terraform_gui.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 60e505045..019dd5616 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -649,8 +649,8 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
{
if (widget != ETTW_DOTS) return;
- int center_x = (r.left + r.right + 1) / 2;
- int center_y = (r.top + r.bottom + 1) / 2;
+ int center_x = RoundDiv(r.left + r.right, 2);
+ int center_y = RoundDiv(r.top + r.bottom, 2);
int n = _terraform_size * _terraform_size;
const int8 *coords = &_multi_terraform_coords[0][0];