# road_land.h

Go to the documentation of this file.

    00001 /* $Id: road_land.h 19056 2010-02-07 22:22:54Z peter1138 $ */
    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() { (int8)0x80, 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 /* Sprite layout for level crossings. The SpriteIDs are actually offsets
    00074  * from the base SpriteID returned from the NewGRF sprite resolver. */
    00075 static const DrawTileSeqStruct _crossing_layout_ALL[] = {
    00076   TILE_SEQ_LINE(2, PAL_NONE,  0,  0, 3, 3)
    00077   TILE_SEQ_LINE(4, PAL_NONE,  0, 13, 3, 3)
    00078   TILE_SEQ_LINE(6, PAL_NONE, 13,  0, 3, 3)
    00079   TILE_SEQ_LINE(8, PAL_NONE, 13, 13, 3, 3)
    00080   TILE_SEQ_END()
    00081 };
    00082
    00083 static const DrawTileSprites _crossing_layout = {
    00084   {0, PAL_NONE}, _crossing_layout_ALL
    00085 };
    00086
    00087 #undef TILE_SEQ_LINE
    00088 #undef TILE_SEQ_END
    00089
    00090
    00091 static const SpriteID _road_tile_sprites_1[16] = {
    00092       0, 0x546, 0x545, 0x53B, 0x544, 0x534, 0x53E, 0x539,
    00093   0x543, 0x53C, 0x535, 0x538, 0x53D, 0x537, 0x53A, 0x536
    00094 };
    00095
    00096 static const SpriteID _road_frontwire_sprites_1[16] = {
    00097   0, 0x54, 0x55, 0x5B, 0x54, 0x54, 0x5E, 0x5A, 0x55, 0x5C, 0x55, 0x58, 0x5D, 0x57, 0x59, 0x56
    00098 };
    00099
    00100 static const SpriteID _road_backpole_sprites_1[16] = {
    00101   0, 0x38, 0x39, 0x40, 0x38, 0x38, 0x43, 0x3E, 0x39, 0x41, 0x39, 0x3C, 0x42, 0x3B, 0x3D, 0x3A
    00102 };
    00103
    00104 #define MAKELINE(a, b, c) { a, b, c },
    00105 #define ENDLINE { 0, 0, 0 }
    00106
    00107 static const DrawRoadTileStruct _roadside_nothing[] = {
    00108   ENDLINE
    00109 };
    00110
    00111 static const DrawRoadTileStruct _road_display_datas2_3[] = {
    00112   MAKELINE(0x57f,  1,  8)
    00113   ENDLINE
    00114 };
    00115
    00116 static const DrawRoadTileStruct _road_display_datas2_5[] = {
    00117   MAKELINE(0x57f,  1,  8)
    00118   MAKELINE(0x57e, 14,  8)
    00119   ENDLINE
    00120 };
    00121
    00122 static const DrawRoadTileStruct _road_display_datas2_6[] = {
    00123   MAKELINE(0x57e,  8,  1)
    00124   ENDLINE
    00125 };
    00126
    00127 static const DrawRoadTileStruct _road_display_datas2_7[] = {
    00128   MAKELINE(0x57f,  1,  8)
    00129   ENDLINE
    00130 };
    00131
    00132 static const DrawRoadTileStruct _road_display_datas2_9[] = {
    00133   MAKELINE(0x57f,  8, 14)
    00134   ENDLINE
    00135 };
    00136
    00137 static const DrawRoadTileStruct _road_display_datas2_10[] = {
    00138   MAKELINE(0x57f,  8, 14)
    00139   MAKELINE(0x57e,  8,  1)
    00140   ENDLINE
    00141 };
    00142
    00143 static const DrawRoadTileStruct _road_display_datas2_11[] = {
    00144   MAKELINE(0x57f,  8, 14)
    00145   ENDLINE
    00146 };
    00147
    00148 static const DrawRoadTileStruct _road_display_datas2_12[] = {
    00149   MAKELINE(0x57e,  8,  1)
    00150   ENDLINE
    00151 };
    00152
    00153 static const DrawRoadTileStruct _road_display_datas2_13[] = {
    00154   MAKELINE(0x57e, 14,  8)
    00155   ENDLINE
    00156 };
    00157
    00158 static const DrawRoadTileStruct _road_display_datas2_14[] = {
    00159   MAKELINE(0x57e,  8,  1)
    00160   ENDLINE
    00161 };
    00162
    00163 static const DrawRoadTileStruct _road_display_datas2_19[] = {
    00164   MAKELINE(0x1212,  0,  2)
    00165   MAKELINE(0x1212,  3,  9)
    00166   MAKELINE(0x1212, 10, 12)
    00167   ENDLINE
    00168 };
    00169
    00170 static const DrawRoadTileStruct _road_display_datas2_21[] = {
    00171   MAKELINE(0x1212,  0,  2)
    00172   MAKELINE(0x1212,  0, 10)
    00173   MAKELINE(0x1212, 12,  2)
    00174   MAKELINE(0x1212, 12, 10)
    00175   ENDLINE
    00176 };
    00177
    00178 static const DrawRoadTileStruct _road_display_datas2_22[] = {
    00179   MAKELINE(0x1212, 10,  0)
    00180   MAKELINE(0x1212,  3,  3)
    00181   MAKELINE(0x1212,  0, 10)
    00182   ENDLINE
    00183 };
    00184
    00185 static const DrawRoadTileStruct _road_display_datas2_23[] = {
    00186   MAKELINE(0x1212,  0,  2)
    00187   MAKELINE(0x1212,  0, 10)
    00188   ENDLINE
    00189 };
    00190
    00191 static const DrawRoadTileStruct _road_display_datas2_25[] = {
    00192   MAKELINE(0x1212, 12,  2)
    00193   MAKELINE(0x1212,  9,  9)
    00194   MAKELINE(0x1212,  2, 12)
    00195   ENDLINE
    00196 };
    00197
    00198 static const DrawRoadTileStruct _road_display_datas2_26[] = {
    00199   MAKELINE(0x1212,  2,  0)
    00200   MAKELINE(0x1212, 10,  0)
    00201   MAKELINE(0x1212,  2, 12)
    00202   MAKELINE(0x1212, 10, 12)
    00203   ENDLINE
    00204 };
    00205
    00206 static const DrawRoadTileStruct _road_display_datas2_27[] = {
    00207   MAKELINE(0x1212,  2, 12)
    00208   MAKELINE(0x1212, 10, 12)
    00209   ENDLINE
    00210 };
    00211
    00212 static const DrawRoadTileStruct _road_display_datas2_28[] = {
    00213   MAKELINE(0x1212,  2,  0)
    00214   MAKELINE(0x1212,  9,  3)
    00215   MAKELINE(0x1212, 12, 10)
    00216   ENDLINE
    00217 };
    00218
    00219 static const DrawRoadTileStruct _road_display_datas2_29[] = {
    00220   MAKELINE(0x1212, 12,  2)
    00221   MAKELINE(0x1212, 12, 10)
    00222   ENDLINE
    00223 };
    00224
    00225 static const DrawRoadTileStruct _road_display_datas2_30[] = {
    00226   MAKELINE(0x1212,  2, 0)
    00227   MAKELINE(0x1212, 10, 0)
    00228   ENDLINE
    00229 };
    00230
    00231 #undef MAKELINE
    00232 #undef ENDLINE
    00233
    00234 static const DrawRoadTileStruct * const _roadside_none[] = {
    00235   _roadside_nothing, _roadside_nothing,
    00236   _roadside_nothing, _roadside_nothing,
    00237   _roadside_nothing, _roadside_nothing,
    00238   _roadside_nothing, _roadside_nothing,
    00239   _roadside_nothing, _roadside_nothing,
    00240   _roadside_nothing, _roadside_nothing,
    00241   _roadside_nothing, _roadside_nothing,
    00242   _roadside_nothing, _roadside_nothing
    00243 };
    00244
    00245 static const DrawRoadTileStruct * const _roadside_lamps[] = {
    00246   _roadside_nothing,
    00247   _roadside_nothing,
    00248   _roadside_nothing,
    00249   _road_display_datas2_3,
    00250   _roadside_nothing,
    00251   _road_display_datas2_5,
    00252   _road_display_datas2_6,
    00253   _road_display_datas2_7,
    00254   _roadside_nothing,
    00255   _road_display_datas2_9,
    00256   _road_display_datas2_10,
    00257   _road_display_datas2_11,
    00258   _road_display_datas2_12,
    00259   _road_display_datas2_13,
    00260   _road_display_datas2_14,
    00261   _roadside_nothing,
    00262 };
    00263
    00264 static const DrawRoadTileStruct * const _roadside_trees[] = {
    00265   _roadside_nothing,
    00266   _roadside_nothing,
    00267   _roadside_nothing,
    00268   _road_display_datas2_19,
    00269   _roadside_nothing,
    00270   _road_display_datas2_21,
    00271   _road_display_datas2_22,
    00272   _road_display_datas2_23,
    00273
    00274   _roadside_nothing,
    00275   _road_display_datas2_25,
    00276   _road_display_datas2_26,
    00277   _road_display_datas2_27,
    00278   _road_display_datas2_28,
    00279   _road_display_datas2_29,
    00280   _road_display_datas2_30,
    00281   _roadside_nothing,
    00282 };
    00283
    00284 static const DrawRoadTileStruct * const * const _road_display_table[] = {
    00285   _roadside_none,
    00286   _roadside_none,
    00287   _roadside_none,
    00288   _roadside_lamps,
    00289   _roadside_none,
    00290   _roadside_trees,
    00291 };