rail_cmd.c
changeset 3775 0fb5118536c3
parent 3763 7098c393c172
child 3777 455c0c7b657e
equal deleted inserted replaced
3774:898b225669bb 3775:0fb5118536c3
    28 #include "railtypes.h" // include table for railtypes
    28 #include "railtypes.h" // include table for railtypes
    29 #include "newgrf.h"
    29 #include "newgrf.h"
    30 #include "newgrf_callbacks.h"
    30 #include "newgrf_callbacks.h"
    31 #include "newgrf_station.h"
    31 #include "newgrf_station.h"
    32 
    32 
    33 extern uint16 _custom_sprites_base;
       
    34 
       
    35 const byte _track_sloped_sprites[14] = {
    33 const byte _track_sloped_sprites[14] = {
    36 	14, 15, 22, 13,
    34 	14, 15, 22, 13,
    37 	 0, 21, 17, 12,
    35 	 0, 21, 17, 12,
    38 	23,  0, 18, 20,
    36 	23,  0, 18, 20,
    39 	19, 16
    37 	19, 16
  1336 					if (callback != CALLBACK_FAILED) tile = callback;
  1334 					if (callback != CALLBACK_FAILED) tile = callback;
  1337 				}
  1335 				}
  1338 
  1336 
  1339 				if (statspec->renderdata == NULL) {
  1337 				if (statspec->renderdata == NULL) {
  1340 					cust = GetStationTileLayout(tile);
  1338 					cust = GetStationTileLayout(tile);
  1341 					relocation -= 0x42D;
       
  1342 				} else {
  1339 				} else {
  1343 					cust = &statspec->renderdata[(tile < statspec->tiles ? tile : 0) + GetWaypointAxis(ti->tile)];
  1340 					cust = &statspec->renderdata[(tile < statspec->tiles ? tile : 0) + GetWaypointAxis(ti->tile)];
  1344 				}
  1341 				}
  1345 
  1342 
  1346 				/* If there is no sprite layout, we fall back to the default waypoint graphics. */
  1343 				/* If there is no sprite layout, we fall back to the default waypoint graphics. */
  1347 				if (cust != NULL && cust->seq != NULL) {
  1344 				if (cust != NULL && cust->seq != NULL) {
  1348 					image = cust->ground_sprite;
  1345 					image = cust->ground_sprite;
  1349 					image += (image < _custom_sprites_base) ? rti->total_offset : rti->custom_ground_offset;
  1346 					if (HASBIT(image, 31)) {
       
  1347 						CLRBIT(image, 31);
       
  1348 						image += GetCustomStationGroundRelocation(statspec, st, ti->tile);
       
  1349 						image += rti->custom_ground_offset;
       
  1350 					} else {
       
  1351 						image += rti->total_offset;
       
  1352 					}
  1350 
  1353 
  1351 					DrawGroundSprite(image);
  1354 					DrawGroundSprite(image);
  1352 
  1355 
  1353 					if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenary(ti);
  1356 					if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenary(ti);
  1354 
  1357