2007-12-23 00:30:28 +01:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
/** @file geometry_type.hpp All geometry types in OpenTTD. */
|
|
|
|
|
|
|
|
#ifndef GEOMETRY_TYPE_HPP
|
|
|
|
#define GEOMETRY_TYPE_HPP
|
|
|
|
|
2007-12-23 15:06:03 +01:00
|
|
|
#if defined(__AMIGA__)
|
|
|
|
/* AmigaOS already has a Point declared */
|
|
|
|
#define Point OTTD_Point
|
|
|
|
#endif /* __AMIGA__ */
|
|
|
|
|
2007-12-23 19:08:39 +01:00
|
|
|
#if defined(__APPLE__)
|
|
|
|
/* Mac OS X already has both Rect and Point declared */
|
|
|
|
#define Rect OTTD_Rect
|
|
|
|
#define Point OTTD_Point
|
|
|
|
#endif /* __APPLE__ */
|
|
|
|
|
|
|
|
|
2008-05-04 10:38:21 +02:00
|
|
|
/** Coordinates of a point in 2D */
|
2007-12-23 00:30:28 +01:00
|
|
|
struct Point {
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
};
|
|
|
|
|
2008-05-04 10:38:21 +02:00
|
|
|
/** Dimensions (a width and height) of a rectangle in 2D */
|
2007-12-23 00:30:28 +01:00
|
|
|
struct Dimension {
|
2009-06-27 22:53:45 +02:00
|
|
|
uint width;
|
|
|
|
uint height;
|
2007-12-23 00:30:28 +01:00
|
|
|
};
|
|
|
|
|
2008-05-04 10:38:21 +02:00
|
|
|
/** Specification of a rectangle with absolute coordinates of all edges */
|
2007-12-23 00:30:28 +01:00
|
|
|
struct Rect {
|
|
|
|
int left;
|
|
|
|
int top;
|
|
|
|
int right;
|
|
|
|
int bottom;
|
|
|
|
};
|
|
|
|
|
2008-05-04 10:38:21 +02:00
|
|
|
/**
|
|
|
|
* Specification of a rectangle with an absolute top-left coordinate and a
|
|
|
|
* (relative) width/height
|
|
|
|
*/
|
2007-12-23 00:30:28 +01:00
|
|
|
struct PointDimension {
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
};
|
|
|
|
|
2008-05-04 10:38:21 +02:00
|
|
|
/** A pair of two integers */
|
2007-12-23 00:30:28 +01:00
|
|
|
struct Pair {
|
|
|
|
int a;
|
|
|
|
int b;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GEOMETRY_TYPE_HPP */
|