# road_land.h

Go to the documentation of this file.

    00001 /* $Id: road_land.h 17701 2009-10-04 20:51:50Z smatz $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #define TILE_SEQ_LINE(img, pal, dx, dy, sx, sy) { dx, dy, 0, sx, sy, 20, {img, pal} },
    00013 #define TILE_SEQ_END() { 0, 0, 0, 0, 0, 0, {0, 0} }
    00014
    00015 static const DrawTileSeqStruct _road_depot_NE[] = {
    00016   TILE_SEQ_LINE(0x584 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 15, 16, 1)
    00017   TILE_SEQ_END()
    00018 };
    00019
    00020 static const DrawTileSeqStruct _road_depot_SE[] = {
    00021   TILE_SEQ_LINE(0x580 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 1, 16)
    00022   TILE_SEQ_LINE(0x581 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 15, 0, 1, 16)
    00023   TILE_SEQ_END()
    00024 };
    00025
    00026 static const DrawTileSeqStruct _road_depot_SW[] = {
    00027   TILE_SEQ_LINE(0x582 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 1)
    00028   TILE_SEQ_LINE(0x583 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 15, 16, 1)
    00029   TILE_SEQ_END()
    00030 };
    00031
    00032 static const DrawTileSeqStruct _road_depot_NW[] = {
    00033   TILE_SEQ_LINE(0x585 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 15, 0, 1, 16)
    00034   TILE_SEQ_END()
    00035 };
    00036
    00037 static const DrawTileSprites _road_depot[] = {
    00038   { {0xA4A, PAL_NONE}, _road_depot_NE },
    00039   { {0xA4A, PAL_NONE}, _road_depot_SE },
    00040   { {0xA4A, PAL_NONE}, _road_depot_SW },
    00041   { {0xA4A, PAL_NONE}, _road_depot_NW }
    00042 };
    00043
    00044 static const DrawTileSeqStruct _tram_depot_NE[] = {
    00045   TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x35) | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 15, 16, 1)
    00046   TILE_SEQ_END()
    00047 };
    00048
    00049 static const DrawTileSeqStruct _tram_depot_SE[] = {
    00050   TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x31) | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 1, 16)
    00051   TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x32) | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 15, 0, 1, 16)
    00052   TILE_SEQ_END()
    00053 };
    00054
    00055 static const DrawTileSeqStruct _tram_depot_SW[] = {
    00056   TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x33) | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 1)
    00057   TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x34) | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 15, 16, 1)
    00058   TILE_SEQ_END()
    00059 };
    00060
    00061 static const DrawTileSeqStruct _tram_depot_NW[] = {
    00062   TILE_SEQ_LINE((SPR_TRAMWAY_BASE + 0x36) | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 15, 0, 1, 16)
    00063   TILE_SEQ_END()
    00064 };
    00065
    00066 static const DrawTileSprites _tram_depot[] = {
    00067   { {0xA4A, PAL_NONE}, _tram_depot_NE },
    00068   { {0xA4A, PAL_NONE}, _tram_depot_SE },
    00069   { {0xA4A, PAL_NONE}, _tram_depot_SW },
    00070   { {0xA4A, PAL_NONE}, _tram_depot_NW }
    00071 };
    00072
    00073 #undef TILE_SEQ_LINE
    00074 #undef TILE_SEQ_END
    00075
    00076
    00077 static const SpriteID _road_tile_sprites_1[16] = {
    00078       0, 0x546, 0x545, 0x53B, 0x544, 0x534, 0x53E, 0x539,
    00079   0x543, 0x53C, 0x535, 0x538, 0x53D, 0x537, 0x53A, 0x536
    00080 };
    00081
    00082 static const SpriteID _road_frontwire_sprites_1[16] = {
    00083   0, 0x54, 0x55, 0x5B, 0x54, 0x54, 0x5E, 0x5A, 0x55, 0x5C, 0x55, 0x58, 0x5D, 0x57, 0x59, 0x56
    00084 };
    00085
    00086 static const SpriteID _road_backpole_sprites_1[16] = {
    00087   0, 0x38, 0x39, 0x40, 0x38, 0x38, 0x43, 0x3E, 0x39, 0x41, 0x39, 0x3C, 0x42, 0x3B, 0x3D, 0x3A
    00088 };
    00089
    00090 #define MAKELINE(a, b, c) { a, b, c },
    00091 #define ENDLINE { 0, 0, 0 }
    00092
    00093 static const DrawRoadTileStruct _roadside_nothing[] = {
    00094   ENDLINE
    00095 };
    00096
    00097 static const DrawRoadTileStruct _road_display_datas2_3[] = {
    00098   MAKELINE(0x57f,  1,  8)
    00099   ENDLINE
    00100 };
    00101
    00102 static const DrawRoadTileStruct _road_display_datas2_5[] = {
    00103   MAKELINE(0x57f,  1,  8)
    00104   MAKELINE(0x57e, 14,  8)
    00105   ENDLINE
    00106 };
    00107
    00108 static const DrawRoadTileStruct _road_display_datas2_6[] = {
    00109   MAKELINE(0x57e,  8,  1)
    00110   ENDLINE
    00111 };
    00112
    00113 static const DrawRoadTileStruct _road_display_datas2_7[] = {
    00114   MAKELINE(0x57f,  1,  8)
    00115   ENDLINE
    00116 };
    00117
    00118 static const DrawRoadTileStruct _road_display_datas2_9[] = {
    00119   MAKELINE(0x57f,  8, 14)
    00120   ENDLINE
    00121 };
    00122
    00123 static const DrawRoadTileStruct _road_display_datas2_10[] = {
    00124   MAKELINE(0x57f,  8, 14)
    00125   MAKELINE(0x57e,  8,  1)
    00126   ENDLINE
    00127 };
    00128
    00129 static const DrawRoadTileStruct _road_display_datas2_11[] = {
    00130   MAKELINE(0x57f,  8, 14)
    00131   ENDLINE
    00132 };
    00133
    00134 static const DrawRoadTileStruct _road_display_datas2_12[] = {
    00135   MAKELINE(0x57e,  8,  1)
    00136   ENDLINE
    00137 };
    00138
    00139 static const DrawRoadTileStruct _road_display_datas2_13[] = {
    00140   MAKELINE(0x57e, 14,  8)
    00141   ENDLINE
    00142 };
    00143
    00144 static const DrawRoadTileStruct _road_display_datas2_14[] = {
    00145   MAKELINE(0x57e,  8,  1)
    00146   ENDLINE
    00147 };
    00148
    00149 static const DrawRoadTileStruct _road_display_datas2_19[] = {
    00150   MAKELINE(0x1212,  0,  2)
    00151   MAKELINE(0x1212,  3,  9)
    00152   MAKELINE(0x1212, 10, 12)
    00153   ENDLINE
    00154 };
    00155
    00156 static const DrawRoadTileStruct _road_display_datas2_21[] = {
    00157   MAKELINE(0x1212,  0,  2)
    00158   MAKELINE(0x1212,  0, 10)
    00159   MAKELINE(0x1212, 12,  2)
    00160   MAKELINE(0x1212, 12, 10)
    00161   ENDLINE
    00162 };
    00163
    00164 static const DrawRoadTileStruct _road_display_datas2_22[] = {
    00165   MAKELINE(0x1212, 10,  0)
    00166   MAKELINE(0x1212,  3,  3)
    00167   MAKELINE(0x1212,  0, 10)
    00168   ENDLINE
    00169 };
    00170
    00171 static const DrawRoadTileStruct _road_display_datas2_23[] = {
    00172   MAKELINE(0x1212,  0,  2)
    00173   MAKELINE(0x1212,  0, 10)
    00174   ENDLINE
    00175 };
    00176
    00177 static const DrawRoadTileStruct _road_display_datas2_25[] = {
    00178   MAKELINE(0x1212, 12,  2)
    00179   MAKELINE(0x1212,  9,  9)
    00180   MAKELINE(0x1212,  2, 12)
    00181   ENDLINE
    00182 };
    00183
    00184 static const DrawRoadTileStruct _road_display_datas2_26[] = {
    00185   MAKELINE(0x1212,  2,  0)
    00186   MAKELINE(0x1212, 10,  0)
    00187   MAKELINE(0x1212,  2, 12)
    00188   MAKELINE(0x1212, 10, 12)
    00189   ENDLINE
    00190 };
    00191
    00192 static const DrawRoadTileStruct _road_display_datas2_27[] = {
    00193   MAKELINE(0x1212,  2, 12)
    00194   MAKELINE(0x1212, 10, 12)
    00195   ENDLINE
    00196 };
    00197
    00198 static const DrawRoadTileStruct _road_display_datas2_28[] = {
    00199   MAKELINE(0x1212,  2,  0)
    00200   MAKELINE(0x1212,  9,  3)
    00201   MAKELINE(0x1212, 12, 10)
    00202   ENDLINE
    00203 };
    00204
    00205 static const DrawRoadTileStruct _road_display_datas2_29[] = {
    00206   MAKELINE(0x1212, 12,  2)
    00207   MAKELINE(0x1212, 12, 10)
    00208   ENDLINE
    00209 };
    00210
    00211 static const DrawRoadTileStruct _road_display_datas2_30[] = {
    00212   MAKELINE(0x1212,  2, 0)
    00213   MAKELINE(0x1212, 10, 0)
    00214   ENDLINE
    00215 };
    00216
    00217 #undef MAKELINE
    00218 #undef ENDLINE
    00219
    00220 static const DrawRoadTileStruct * const _roadside_none[] = {
    00221   _roadside_nothing, _roadside_nothing,
    00222   _roadside_nothing, _roadside_nothing,
    00223   _roadside_nothing, _roadside_nothing,
    00224   _roadside_nothing, _roadside_nothing,
    00225   _roadside_nothing, _roadside_nothing,
    00226   _roadside_nothing, _roadside_nothing,
    00227   _roadside_nothing, _roadside_nothing,
    00228   _roadside_nothing, _roadside_nothing
    00229 };
    00230
    00231 static const DrawRoadTileStruct * const _roadside_lamps[] = {
    00232   _roadside_nothing,
    00233   _roadside_nothing,
    00234   _roadside_nothing,
    00235   _road_display_datas2_3,
    00236   _roadside_nothing,
    00237   _road_display_datas2_5,
    00238   _road_display_datas2_6,
    00239   _road_display_datas2_7,
    00240   _roadside_nothing,
    00241   _road_display_datas2_9,
    00242   _road_display_datas2_10,
    00243   _road_display_datas2_11,
    00244   _road_display_datas2_12,
    00245   _road_display_datas2_13,
    00246   _road_display_datas2_14,
    00247   _roadside_nothing,
    00248 };
    00249
    00250 static const DrawRoadTileStruct * const _roadside_trees[] = {
    00251   _roadside_nothing,
    00252   _roadside_nothing,
    00253   _roadside_nothing,
    00254   _road_display_datas2_19,
    00255   _roadside_nothing,
    00256   _road_display_datas2_21,
    00257   _road_display_datas2_22,
    00258   _road_display_datas2_23,
    00259
    00260   _roadside_nothing,
    00261   _road_display_datas2_25,
    00262   _road_display_datas2_26,
    00263   _road_display_datas2_27,
    00264   _road_display_datas2_28,
    00265   _road_display_datas2_29,
    00266   _road_display_datas2_30,
    00267   _roadside_nothing,
    00268 };
    00269
    00270 static const DrawRoadTileStruct * const * const _road_display_table[] = {
    00271   _roadside_none,
    00272   _roadside_none,
    00273   _roadside_none,
    00274   _roadside_lamps,
    00275   _roadside_none,
    00276   _roadside_trees,
    00277 };