(svn r19670) -Codechange: Add CeilDiv() and RoundDiv() to simplify integer divisions with rounding.
This commit is contained in:
@@ -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];
|
||||
|
Reference in New Issue
Block a user