(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)
This commit is contained in:
rubidium 2007-03-19 19:56:16 +00:00
parent c559703312
commit 41727b6e23
6 changed files with 37 additions and 10 deletions

View File

@ -365,6 +365,8 @@ void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player)
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 @@ static void ChangeNetworkOwner(PlayerID current_player, PlayerID new_player)
/* 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) {

View File

@ -133,7 +133,7 @@ static void AdjustTileh(TileIndex tile, Slope *tileh)
{
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 @@ static void DrawCatenaryRailway(const TileInfo *ti)
/* 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 @@ void DrawCatenary(const TileInfo *ti)
switch (GetTileType(ti->tile)) {
case MP_RAILWAY:
if (IsRailDepot(ti->tile)) {
if ( IsRailDepot(ti->tile)) {
const SortableSpriteStruct* sss = &CatenarySpriteData_Depot[GetRailDepotDirection(ti->tile)];
AddSortableSpriteToDraw(

View File

@ -29,7 +29,7 @@ static inline byte RGBToGrayscale(byte red, byte green, byte blue)
#ifdef WITH_PNG
#include "png.h"
#include <png.h>
/**
* The PNG Heightmap loader.

View File

@ -1589,7 +1589,7 @@ static const byte _airport_sections_international[] = {
// 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 @@ static const byte _airport_sections_intercontinental[] = {
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
};

View File

@ -340,6 +340,14 @@ static const SortableSpriteStruct CatenarySpriteData_Depot[] = {
{ 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:
* <ol><li>Direction of the wire</li>

View File

@ -276,6 +276,12 @@ enum Sprites {
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,