Mercurial > hg > openttd
annotate src/newgrf_canal.h @ 14040:869eedf8fbc5 draft
(svn r18583) -Codechange: Add WWT_SHADEBOX widget and its functions (heavily based on code by erikjanp).
author | alberth <alberth@openttd.org> |
---|---|
date | Mon, 21 Dec 2009 16:06:20 +0000 |
parents | 8e2a0e8fa275 |
children | a899d4e5ee1a |
rev | line source |
---|---|
6583
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
1 /* $Id$ */ |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
2 |
12778
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
9750
diff
changeset
|
3 /* |
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
9750
diff
changeset
|
4 * This file is part of OpenTTD. |
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
9750
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:
9750
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:
9750
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:
9750
diff
changeset
|
8 */ |
bc7926153e19
(svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents:
9750
diff
changeset
|
9 |
9111
d48433370037
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium <rubidium@openttd.org>
parents:
8372
diff
changeset
|
10 /** @file newgrf_canal.h Handling of NewGRF canals. */ |
d48433370037
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium <rubidium@openttd.org>
parents:
8372
diff
changeset
|
11 |
6583
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
12 #ifndef NEWGRF_CANAL_H |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
13 #define NEWGRF_CANAL_H |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
14 |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
15 /** List of different canal 'features'. |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
16 * Each feature gets an entry in the canal spritegroup table */ |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
17 enum CanalFeature { |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
18 CF_WATERSLOPE, |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
19 CF_LOCKS, |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
20 CF_DIKES, |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
21 CF_ICON, |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
22 CF_DOCKS, |
8360
bf5f533a604f
(svn r11926) -Feature: Rivers. Graphics must be provided by NewGRF else rivers are drawn as canals. Rivers can currently only be placed with-in the scenario editor.
peter1138 <peter1138@openttd.org>
parents:
6583
diff
changeset
|
23 CF_RIVER_SLOPE, |
bf5f533a604f
(svn r11926) -Feature: Rivers. Graphics must be provided by NewGRF else rivers are drawn as canals. Rivers can currently only be placed with-in the scenario editor.
peter1138 <peter1138@openttd.org>
parents:
6583
diff
changeset
|
24 CF_RIVER_EDGE, |
6583
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
25 CF_END, |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
26 }; |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
27 |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
28 |
8372
2628bf7d5b77
(svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138 <peter1138@openttd.org>
parents:
8360
diff
changeset
|
29 struct WaterFeature { |
2628bf7d5b77
(svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138 <peter1138@openttd.org>
parents:
8360
diff
changeset
|
30 const SpriteGroup *group; |
9750
0654bf387d06
(svn r13885) -Fix [FS#2168]: Var 0x7F is not feature-specific.
frosch <frosch@openttd.org>
parents:
9111
diff
changeset
|
31 const GRFFile *grffile; ///< newgrf where 'group' belongs to |
13036
8e2a0e8fa275
(svn r17534) -Codechange: unify the naming of callback masks/flags
rubidium <rubidium@openttd.org>
parents:
12778
diff
changeset
|
32 uint8 callback_mask; ///< Bitmask of canal callbacks that have to be called |
8372
2628bf7d5b77
(svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138 <peter1138@openttd.org>
parents:
8360
diff
changeset
|
33 uint8 flags; |
2628bf7d5b77
(svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138 <peter1138@openttd.org>
parents:
8360
diff
changeset
|
34 }; |
2628bf7d5b77
(svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138 <peter1138@openttd.org>
parents:
8360
diff
changeset
|
35 |
2628bf7d5b77
(svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138 <peter1138@openttd.org>
parents:
8360
diff
changeset
|
36 |
6583
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
37 /** Table of canal 'feature' sprite groups */ |
8372
2628bf7d5b77
(svn r11938) -Codechange: support loading of canal/river properties (though still ignored)
peter1138 <peter1138@openttd.org>
parents:
8360
diff
changeset
|
38 extern WaterFeature _water_feature[CF_END]; |
6583
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
39 |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
40 |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
41 /** Lookup the base sprite to use for a canal. |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
42 * @param feature Which canal feature we want. |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
43 * @param tile Tile index of canal, if appropriate. |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
44 * @return Base sprite returned by GRF, or 0 if none. |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
45 */ |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
46 SpriteID GetCanalSprite(CanalFeature feature, TileIndex tile); |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
47 |
7e15dfbfb126
(svn r9797) -Feature: [NewGRF] Add action 1, 2 and 3 support for canals.
peter1138 <peter1138@openttd.org>
parents:
diff
changeset
|
48 #endif /* NEWGRF_CANAL_H */ |