src/core/geometry_type.hpp
author rubidium
Sun, 25 May 2008 19:17:03 +0000
changeset 9354 845e07db4549
parent 9077 1ac587da1d58
permissions -rw-r--r--
(svn r13251) -Codechange: rename _patches to _settings as that is more logic.
-Codechange: move all Settings into substructs of _settings in a way that they are logically grouped.
8121
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
     1
/* $Id$ */
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
     2
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
     3
/** @file geometry_type.hpp All geometry types in OpenTTD. */
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
     4
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
     5
#ifndef GEOMETRY_TYPE_HPP
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
     6
#define GEOMETRY_TYPE_HPP
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
     7
8126
c96febd50363 (svn r11687) -Codechange: move some defines to a better place
skidd13
parents: 8121
diff changeset
     8
#if defined(__AMIGA__)
c96febd50363 (svn r11687) -Codechange: move some defines to a better place
skidd13
parents: 8121
diff changeset
     9
	/* AmigaOS already has a Point declared */
c96febd50363 (svn r11687) -Codechange: move some defines to a better place
skidd13
parents: 8121
diff changeset
    10
	#define Point OTTD_Point
c96febd50363 (svn r11687) -Codechange: move some defines to a better place
skidd13
parents: 8121
diff changeset
    11
#endif /* __AMIGA__ */
c96febd50363 (svn r11687) -Codechange: move some defines to a better place
skidd13
parents: 8121
diff changeset
    12
8127
a20f557b7081 (svn r11688) -Fix [FS#1581]: Compilation was broken on OS X again.
egladil
parents: 8126
diff changeset
    13
#if defined(__APPLE__)
a20f557b7081 (svn r11688) -Fix [FS#1581]: Compilation was broken on OS X again.
egladil
parents: 8126
diff changeset
    14
	/* Mac OS X already has both Rect and Point declared */
a20f557b7081 (svn r11688) -Fix [FS#1581]: Compilation was broken on OS X again.
egladil
parents: 8126
diff changeset
    15
	#define Rect OTTD_Rect
a20f557b7081 (svn r11688) -Fix [FS#1581]: Compilation was broken on OS X again.
egladil
parents: 8126
diff changeset
    16
	#define Point OTTD_Point
a20f557b7081 (svn r11688) -Fix [FS#1581]: Compilation was broken on OS X again.
egladil
parents: 8126
diff changeset
    17
#endif /* __APPLE__ */
a20f557b7081 (svn r11688) -Fix [FS#1581]: Compilation was broken on OS X again.
egladil
parents: 8126
diff changeset
    18
a20f557b7081 (svn r11688) -Fix [FS#1581]: Compilation was broken on OS X again.
egladil
parents: 8126
diff changeset
    19
9077
1ac587da1d58 (svn r12936) -Doc: a few structs in geometry_type.hpp. Patch by Alberth.
rubidium
parents: 8127
diff changeset
    20
/** Coordinates of a point in 2D */
8121
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    21
struct Point {
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    22
	int x;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    23
	int y;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    24
};
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    25
9077
1ac587da1d58 (svn r12936) -Doc: a few structs in geometry_type.hpp. Patch by Alberth.
rubidium
parents: 8127
diff changeset
    26
/** Dimensions (a width and height) of a rectangle in 2D */
8121
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    27
struct Dimension {
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    28
	int width;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    29
	int height;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    30
};
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    31
9077
1ac587da1d58 (svn r12936) -Doc: a few structs in geometry_type.hpp. Patch by Alberth.
rubidium
parents: 8127
diff changeset
    32
/** Specification of a rectangle with absolute coordinates of all edges */
8121
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    33
struct Rect {
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    34
	int left;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    35
	int top;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    36
	int right;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    37
	int bottom;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    38
};
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    39
9077
1ac587da1d58 (svn r12936) -Doc: a few structs in geometry_type.hpp. Patch by Alberth.
rubidium
parents: 8127
diff changeset
    40
/**
1ac587da1d58 (svn r12936) -Doc: a few structs in geometry_type.hpp. Patch by Alberth.
rubidium
parents: 8127
diff changeset
    41
 * Specification of a rectangle with an absolute top-left coordinate and a
1ac587da1d58 (svn r12936) -Doc: a few structs in geometry_type.hpp. Patch by Alberth.
rubidium
parents: 8127
diff changeset
    42
 * (relative) width/height
1ac587da1d58 (svn r12936) -Doc: a few structs in geometry_type.hpp. Patch by Alberth.
rubidium
parents: 8127
diff changeset
    43
 */
8121
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    44
struct PointDimension {
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    45
	int x;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    46
	int y;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    47
	int width;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    48
	int height;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    49
};
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    50
9077
1ac587da1d58 (svn r12936) -Doc: a few structs in geometry_type.hpp. Patch by Alberth.
rubidium
parents: 8127
diff changeset
    51
/** A pair of two integers */
8121
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    52
struct Pair {
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    53
	int a;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    54
	int b;
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    55
};
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    56
3bc6351e7369 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
diff changeset
    57
#endif /* GEOMETRY_TYPE_HPP */