annotate src/tile_type.h @ 19968:0dba7f49118c draft

(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
author planetmaker <planetmaker@openttd.org>
date Tue, 08 Jan 2013 22:46:42 +0000
parents 0badfcb4cc4d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8108
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
1 /* $Id$ */
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
2
12778
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11700
diff changeset
3 /*
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11700
diff changeset
4 * This file is part of OpenTTD.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11700
diff changeset
5 * 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.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11700
diff changeset
6 * 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.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11700
diff changeset
7 * 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/>.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11700
diff changeset
8 */
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 11700
diff changeset
9
8108
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
10 /** @file tile_type.h Types related to tiles. */
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
11
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
12 #ifndef TILE_TYPE_H
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
13 #define TILE_TYPE_H
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
14
15187
03033976eab9 (svn r19816) -Codechange: use static const uint for the unnamed 'tile consts' enum as well
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
15 static const uint TILE_SIZE = 16; ///< Tiles are 16x16 "units" in size
17139
1fd716ceadc8 (svn r21877) -Codechange: move definition of HALF_TILE_SIZE to tile_type.h
smatz <smatz@openttd.org>
parents: 15744
diff changeset
16 static const uint TILE_UNIT_MASK = TILE_SIZE - 1; ///< For masking in/out the inner-tile units.
15187
03033976eab9 (svn r19816) -Codechange: use static const uint for the unnamed 'tile consts' enum as well
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
17 static const uint TILE_PIXELS = 32; ///< a tile is 32x32 pixels
03033976eab9 (svn r19816) -Codechange: use static const uint for the unnamed 'tile consts' enum as well
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
18 static const uint TILE_HEIGHT = 8; ///< The standard height-difference between tiles on two levels is 8 (z-diff 8)
8108
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
19
15187
03033976eab9 (svn r19816) -Codechange: use static const uint for the unnamed 'tile consts' enum as well
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
20 static const uint MAX_TILE_HEIGHT = 15; ///< Maximum allowed tile height
8108
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
21
15187
03033976eab9 (svn r19816) -Codechange: use static const uint for the unnamed 'tile consts' enum as well
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
22 static const uint MIN_SNOWLINE_HEIGHT = 2; ///< Minimum snowline height
03033976eab9 (svn r19816) -Codechange: use static const uint for the unnamed 'tile consts' enum as well
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
23 static const uint DEF_SNOWLINE_HEIGHT = 7; ///< Default snowline height
03033976eab9 (svn r19816) -Codechange: use static const uint for the unnamed 'tile consts' enum as well
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
24 static const uint MAX_SNOWLINE_HEIGHT = (MAX_TILE_HEIGHT - 2); ///< Maximum allowed snowline height
8138
60ea0f95de91 (svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents: 8108
diff changeset
25
8108
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
26
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
27 /**
10233
63a58f4b2607 (svn r14461) -Document: add some doxygen comments (Albert)
rubidium <rubidium@openttd.org>
parents: 8450
diff changeset
28 * The different types of tiles.
8108
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
29 *
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
30 * Each tile belongs to one type, according whatever is build on it.
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
31 *
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
32 * @note A railway with a crossing street is marked as MP_ROAD.
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
33 */
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
34 enum TileType {
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
35 MP_CLEAR, ///< A tile without any structures, i.e. grass, rocks, farm fields etc.
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
36 MP_RAILWAY, ///< A railway
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
37 MP_ROAD, ///< A tile with road (or tram tracks)
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
38 MP_HOUSE, ///< A house by a town
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
39 MP_TREES, ///< Tile got trees
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
40 MP_STATION, ///< A tile of a station
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
41 MP_WATER, ///< Water tile
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
42 MP_VOID, ///< Invisible tiles at the SW and SE border
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
43 MP_INDUSTRY, ///< Part of an industry
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
44 MP_TUNNELBRIDGE, ///< Tunnel entry/exit and bridge heads
15744
f9e8032ac213 (svn r20411) -Codechange: rename unmovables as quite a lot of them are actually movable; e.g. HQ and owned land are pretty movable.
rubidium <rubidium@openttd.org>
parents: 15187
diff changeset
45 MP_OBJECT, ///< Contains objects such as transmitters and owned land
8108
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
46 };
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
47
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
48 /**
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
49 * Additional infos of a tile on a tropic game.
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
50 *
8450
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
51 * The tropiczone is not modified during gameplay. It mainly affects tree growth. (desert tiles are visible though)
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
52 *
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
53 * In randomly generated maps:
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
54 * TROPICZONE_DESERT: Generated everywhere, if there is neither water nor mountains (TileHeight >= 4) in a certain distance from the tile.
19968
0dba7f49118c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
planetmaker <planetmaker@openttd.org>
parents: 19631
diff changeset
55 * TROPICZONE_RAINFOREST: Generated everywhere, if there is no desert in a certain distance from the tile.
8450
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
56 * TROPICZONE_NORMAL: Everywhere else, i.e. between desert and rainforest and on sea (if you clear the water).
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
57 *
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
58 * In scenarios:
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
59 * TROPICZONE_NORMAL: Default value.
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
60 * TROPICZONE_DESERT: Placed manually.
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
61 * TROPICZONE_RAINFOREST: Placed if you plant certain rainforest-trees.
8108
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
62 */
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
63 enum TropicZone {
8450
4f8718f910d8 (svn r12020) -Documentation: Correct description of TropicZone.
frosch <frosch@openttd.org>
parents: 8138
diff changeset
64 TROPICZONE_NORMAL = 0, ///< Normal tropiczone
8108
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
65 TROPICZONE_DESERT = 1, ///< Tile is desert
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
66 TROPICZONE_RAINFOREST = 2, ///< Rainforest tile
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
67 };
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
68
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
69 /**
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
70 * The index/ID of a Tile.
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
71 */
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
72 typedef uint32 TileIndex;
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
73
8138
60ea0f95de91 (svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents: 8108
diff changeset
74 /**
60ea0f95de91 (svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents: 8108
diff changeset
75 * The very nice invalid tile marker
60ea0f95de91 (svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents: 8108
diff changeset
76 */
60ea0f95de91 (svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents: 8108
diff changeset
77 static const TileIndex INVALID_TILE = (TileIndex)-1;
60ea0f95de91 (svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium <rubidium@openttd.org>
parents: 8108
diff changeset
78
8108
4faab45e2603 (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium <rubidium@openttd.org>
parents:
diff changeset
79 #endif /* TILE_TYPE_H */