OpenTTD
geometry_func.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #include "../stdafx.h"
11 #include "geometry_func.hpp"
12 #include "math_func.hpp"
13 
14 #include "../safeguards.h"
15 
22 Dimension maxdim(const Dimension &d1, const Dimension &d2)
23 {
24  Dimension d;
25  d.width = max(d1.width, d2.width);
26  d.height = max(d1.height, d2.height);
27  return d;
28 }
static T max(const T a, const T b)
Returns the maximum of two values.
Definition: math_func.hpp:24
Geometry functions.
Integer math functions.
Dimension maxdim(const Dimension &d1, const Dimension &d2)
Compute bounding box of both dimensions.
Dimensions (a width and height) of a rectangle in 2D.