# HG changeset patch # User rubidium # Date 1174334176 0 # Node ID d5841259ac07f1df9f1fec57146ba09056939b48 # Parent eaf87cf4d276151ff1a216c1e09fa37a0139d97d (svn r9347) [0.5] -Backport from trunk (r9019, r9076, r9077): - Fix: use <> for system-headers (r9019) - Fix: the intercontinental airport used 'T-junction' runway sprites when there is no exit in the middle of the runway as in the city airport (r9076) - Fix: the wrong catenary wires were drawn for tunnel entrances (r9077) diff -r eaf87cf4d276 -r d5841259ac07 economy.c --- a/economy.c Mon Mar 19 19:42:40 2007 +0000 +++ b/economy.c Mon Mar 19 19:56:16 2007 +0000 @@ -365,6 +365,8 @@ static void ChangeNetworkOwner(PlayerID current_player, PlayerID new_player) { #ifdef ENABLE_NETWORK + NetworkClientState *cs; + NetworkClientInfo *ci; if (!_networking) return; if (current_player == _local_player) { @@ -376,8 +378,7 @@ /* The server has to handle all administrative issues, for example * updating and notifying all clients of what has happened */ - NetworkClientState *cs; - NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(NETWORK_SERVER_INDEX); + ci = NetworkFindClientInfoFromIndex(NETWORK_SERVER_INDEX); /* The server has just changed from player */ if (current_player == ci->client_playas) { diff -r eaf87cf4d276 -r d5841259ac07 elrail.c --- a/elrail.c Mon Mar 19 19:42:40 2007 +0000 +++ b/elrail.c Mon Mar 19 19:56:16 2007 +0000 @@ -133,7 +133,7 @@ { if (IsTileType(tile, MP_TUNNELBRIDGE)) { if (IsTunnel(tile)) { - *tileh = SLOPE_FLAT; + *tileh = SLOPE_STEEP; /* XXX - Hack to make tunnel entrances to always have a pylon */ } else { if (IsBridgeRamp(tile)) { if (*tileh != SLOPE_FLAT) { @@ -294,12 +294,24 @@ /* Drawing of pylons is finished, now draw the wires */ for (t = 0; t < TRACK_END; t++) { if (HASBIT(trackconfig[TS_HOME], t)) { + byte PCPconfig; + const SortableSpriteStruct *sss; + int tileh_selector; - byte PCPconfig = HASBIT(PCPstatus, PCPpositions[t][0]) + + if (IsTunnelTile(ti->tile)) { + const SortableSpriteStruct* sss = &CatenarySpriteData_Tunnel[GetTunnelDirection(ti->tile)]; + + AddSortableSpriteToDraw( + sss->image, ti->x + sss->x_offset, ti->y + sss->y_offset, + sss->x_size, sss->y_size, sss->z_size, + GetTileZ(ti->tile) + sss->z_offset + ); + break; + } + PCPconfig = HASBIT(PCPstatus, PCPpositions[t][0]) + (HASBIT(PCPstatus, PCPpositions[t][1]) << 1); - const SortableSpriteStruct *sss; - int tileh_selector = !(tileh[TS_HOME] % 3) * tileh[TS_HOME] / 3; /* tileh for the slopes, 0 otherwise */ + tileh_selector = !(tileh[TS_HOME] % 3) * tileh[TS_HOME] / 3; /* tileh for the slopes, 0 otherwise */ assert(PCPconfig != 0); /* We have a pylon on neither end of the wire, that doesn't work (since we have no sprites for that) */ assert(!IsSteepSlope(tileh[TS_HOME])); @@ -367,7 +379,7 @@ switch (GetTileType(ti->tile)) { case MP_RAILWAY: - if (IsRailDepot(ti->tile)) { + if ( IsRailDepot(ti->tile)) { const SortableSpriteStruct* sss = &CatenarySpriteData_Depot[GetRailDepotDirection(ti->tile)]; AddSortableSpriteToDraw( diff -r eaf87cf4d276 -r d5841259ac07 heightmap.c --- a/heightmap.c Mon Mar 19 19:42:40 2007 +0000 +++ b/heightmap.c Mon Mar 19 19:56:16 2007 +0000 @@ -29,7 +29,7 @@ #ifdef WITH_PNG -#include "png.h" +#include /** * The PNG Heightmap loader. diff -r eaf87cf4d276 -r d5841259ac07 station_cmd.c --- a/station_cmd.c Mon Mar 19 19:42:40 2007 +0000 +++ b/station_cmd.c Mon Mar 19 19:56:16 2007 +0000 @@ -1589,7 +1589,7 @@ // Intercontinental Airport (vlarge) - 4 runways static const byte _airport_sections_intercontinental[] = { 102, 120, 89, 89, 89, 89, 89, 89, 118, - 120, 22, 22, 22, 22, 22, 22, 119, 117, + 120, 23, 23, 23, 23, 23, 23, 119, 117, 87, 54, 87, 8, 8, 8, 8, 51, 117, 87, 162, 87, 85, 116, 116, 8, 9, 10, 87, 8, 8, 11, 31, 11, 8, 160, 32, @@ -1598,7 +1598,7 @@ 87, 142, 8, 11, 29, 11, 10, 163, 10, 87, 164, 87, 8, 8, 8, 10, 37, 117, 87, 120, 89, 89, 89, 89, 89, 89, 119, - 121, 22, 22, 22, 22, 22, 22, 119, 37 + 121, 23, 23, 23, 23, 23, 23, 119, 37 }; diff -r eaf87cf4d276 -r d5841259ac07 table/elrail_data.h --- a/table/elrail_data.h Mon Mar 19 19:42:40 2007 +0000 +++ b/table/elrail_data.h Mon Mar 19 19:56:16 2007 +0000 @@ -340,6 +340,14 @@ { SPR_WIRE_DEPOT_NW, 8, 0, 1, 8, 1, ELRAIL_ELEVATION } //! Wire for NW depot exit }; +static const SortableSpriteStruct CatenarySpriteData_Tunnel[] = { + { SPR_WIRE_TUNNEL_NE, 0, 8, 8, 1, 1, ELRAIL_ELEVATION }, //! Wire for NE tunnel exit + { SPR_WIRE_TUNNEL_SE, 8, 0, 1, 8, 1, ELRAIL_ELEVATION }, //! Wire for SE tunnel exit + { SPR_WIRE_TUNNEL_SW, 0, 8, 8, 1, 1, ELRAIL_ELEVATION }, //! Wire for SW tunnel exit + { SPR_WIRE_TUNNEL_NW, 8, 0, 1, 8, 1, ELRAIL_ELEVATION } //! Wire for NW tunnel exit +}; + + /** Refers to a certain element of the catenary. * Identifiers for Wires: *
  1. Direction of the wire
  2. diff -r eaf87cf4d276 -r d5841259ac07 table/sprites.h --- a/table/sprites.h Mon Mar 19 19:42:40 2007 +0000 +++ b/table/sprites.h Mon Mar 19 19:56:16 2007 +0000 @@ -276,6 +276,12 @@ SPR_WIRE_Y_NW_DOWN = SPR_ELRAIL_BASE + 26, /* Tunnel entries */ + SPR_WIRE_TUNNEL_NE = SPR_ELRAIL_BASE + 27, + SPR_WIRE_TUNNEL_SE = SPR_ELRAIL_BASE + 28, + SPR_WIRE_TUNNEL_SW = SPR_ELRAIL_BASE + 29, + SPR_WIRE_TUNNEL_NW = SPR_ELRAIL_BASE + 30, + + /* Depot entries */ SPR_WIRE_DEPOT_SW = SPR_ELRAIL_BASE + 27, SPR_WIRE_DEPOT_NW = SPR_ELRAIL_BASE + 28, SPR_WIRE_DEPOT_NE = SPR_ELRAIL_BASE + 29,