summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2009-12-15 13:59:20 +0000
committerpeter1138 <peter1138@openttd.org>2009-12-15 13:59:20 +0000
commit7b136d1fddbb2d0840076dfe2ddbe666b29fee8d (patch)
tree4586a6a930aad8f3891247f1f43cb4f6fcb819c5 /src
parent7c2a61e2107eb5bd3d680128c1eea22650f70bdf (diff)
downloadopenttd-7b136d1fddbb2d0840076dfe2ddbe666b29fee8d.tar.xz
(svn r18509) -Codechange (r2515,r2753): Data for drawing single_x/y rail pieces was inverted.
Diffstat (limited to 'src')
-rw-r--r--src/rail.h2
-rw-r--r--src/rail_cmd.cpp12
-rw-r--r--src/road_cmd.cpp2
-rw-r--r--src/station_cmd.cpp2
-rw-r--r--src/table/railtypes.h8
-rw-r--r--src/table/sprites.h12
-rw-r--r--src/tunnelbridge_cmd.cpp4
7 files changed, 21 insertions, 21 deletions
diff --git a/src/rail.h b/src/rail.h
index 06445d558..69038c205 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -54,8 +54,8 @@ struct RailtypeInfo {
SpriteID track_y; ///< single piece of rail in Y direction, with ground
SpriteID track_ns; ///< two pieces of rail in North and South corner (East-West direction)
SpriteID ground; ///< ground sprite for a 3-way switch
+ SpriteID single_x; ///< single piece of rail in X direction, without ground
SpriteID single_y; ///< single piece of rail in Y direction, without ground
- SpriteID single_x; ///< single piece of rail in X direction
SpriteID single_n; ///< single piece of rail in the northern corner
SpriteID single_s; ///< single piece of rail in the southern corner
SpriteID single_e; ///< single piece of rail in the eastern corner
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 90ec223d9..8fcb666b1 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1804,8 +1804,8 @@ static void DrawTrackBits(TileInfo *ti, TrackBits track)
/* Draw track pieces individually for junction tiles */
if (junction) {
- if (track & TRACK_BIT_X) DrawGroundSprite(rti->base_sprites.single_y, PAL_NONE);
- if (track & TRACK_BIT_Y) DrawGroundSprite(rti->base_sprites.single_x, PAL_NONE);
+ if (track & TRACK_BIT_X) DrawGroundSprite(rti->base_sprites.single_x, PAL_NONE);
+ if (track & TRACK_BIT_Y) DrawGroundSprite(rti->base_sprites.single_y, PAL_NONE);
if (track & TRACK_BIT_UPPER) DrawGroundSprite(rti->base_sprites.single_n, PAL_NONE);
if (track & TRACK_BIT_LOWER) DrawGroundSprite(rti->base_sprites.single_s, PAL_NONE);
if (track & TRACK_BIT_LEFT) DrawGroundSprite(rti->base_sprites.single_w, PAL_NONE);
@@ -1818,14 +1818,14 @@ static void DrawTrackBits(TileInfo *ti, TrackBits track)
TrackBits pbs = GetRailReservationTrackBits(ti->tile) & track;
if (pbs & TRACK_BIT_X) {
if (ti->tileh == SLOPE_FLAT || ti->tileh == SLOPE_ELEVATED) {
- DrawGroundSprite(rti->base_sprites.single_y, PALETTE_CRASH);
+ DrawGroundSprite(rti->base_sprites.single_x, PALETTE_CRASH);
} else {
DrawGroundSprite(_track_sloped_sprites[ti->tileh - 1] + rti->base_sprites.single_sloped - 20, PALETTE_CRASH);
}
}
if (pbs & TRACK_BIT_Y) {
if (ti->tileh == SLOPE_FLAT || ti->tileh == SLOPE_ELEVATED) {
- DrawGroundSprite(rti->base_sprites.single_x, PALETTE_CRASH);
+ DrawGroundSprite(rti->base_sprites.single_y, PALETTE_CRASH);
} else {
DrawGroundSprite(_track_sloped_sprites[ti->tileh - 1] + rti->base_sprites.single_sloped - 20, PALETTE_CRASH);
}
@@ -1959,8 +1959,8 @@ static void DrawTile_Track(TileInfo *ti)
/* PBS debugging, draw reserved tracks darker */
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasDepotReservation(ti->tile)) {
switch (GetRailDepotDirection(ti->tile)) {
- case DIAGDIR_SW: DrawGroundSprite(rti->base_sprites.single_y, PALETTE_CRASH); break;
- case DIAGDIR_SE: DrawGroundSprite(rti->base_sprites.single_x, PALETTE_CRASH); break;
+ case DIAGDIR_SW: DrawGroundSprite(rti->base_sprites.single_x, PALETTE_CRASH); break;
+ case DIAGDIR_SE: DrawGroundSprite(rti->base_sprites.single_y, PALETTE_CRASH); break;
default: break;
}
}
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index ce8ba45a5..4ef98fc5e 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -1193,7 +1193,7 @@ static void DrawTile_Road(TileInfo *ti)
/* PBS debugging, draw reserved tracks darker */
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasCrossingReservation(ti->tile)) {
- DrawGroundSprite(GetCrossingRoadAxis(ti->tile) == AXIS_Y ? GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.single_y : GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.single_x, PALETTE_CRASH);
+ DrawGroundSprite(GetCrossingRoadAxis(ti->tile) == AXIS_Y ? GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.single_x : GetRailTypeInfo(GetRailType(ti->tile))->base_sprites.single_y, PALETTE_CRASH);
}
if (HasTileRoadType(ti->tile, ROADTYPE_TRAM)) {
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index f93a72461..e9d9dba11 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2373,7 +2373,7 @@ static void DrawTile_Station(TileInfo *ti)
/* PBS debugging, draw reserved tracks darker */
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasStationRail(ti->tile) && HasStationReservation(ti->tile)) {
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile));
- DrawGroundSprite(GetRailStationAxis(ti->tile) == AXIS_X ? rti->base_sprites.single_y : rti->base_sprites.single_x, PALETTE_CRASH);
+ DrawGroundSprite(GetRailStationAxis(ti->tile) == AXIS_X ? rti->base_sprites.single_x : rti->base_sprites.single_y, PALETTE_CRASH);
}
}
diff --git a/src/table/railtypes.h b/src/table/railtypes.h
index 33d56bbc4..c17e5a13c 100644
--- a/src/table/railtypes.h
+++ b/src/table/railtypes.h
@@ -19,7 +19,7 @@
static const RailtypeInfo _original_railtypes[] = {
/** Railway */
{ // Main Sprites
- { SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_Y, SPR_RAIL_SINGLE_X,
+ { SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_X, SPR_RAIL_SINGLE_Y,
SPR_RAIL_SINGLE_NORTH, SPR_RAIL_SINGLE_SOUTH, SPR_RAIL_SINGLE_EAST, SPR_RAIL_SINGLE_WEST,
SPR_TRACKS_FOR_SLOPES_RAIL_BASE,
SPR_CROSSING_OFF_X_RAIL,
@@ -87,7 +87,7 @@ static const RailtypeInfo _original_railtypes[] = {
/** Electrified railway */
{ // Main Sprites
- { SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_Y, SPR_RAIL_SINGLE_X,
+ { SPR_RAIL_TRACK_Y, SPR_RAIL_TRACK_N_S, SPR_RAIL_TRACK_BASE, SPR_RAIL_SINGLE_X, SPR_RAIL_SINGLE_Y,
SPR_RAIL_SINGLE_NORTH, SPR_RAIL_SINGLE_SOUTH, SPR_RAIL_SINGLE_EAST, SPR_RAIL_SINGLE_WEST,
SPR_TRACKS_FOR_SLOPES_RAIL_BASE,
SPR_CROSSING_OFF_X_RAIL,
@@ -159,7 +159,7 @@ static const RailtypeInfo _original_railtypes[] = {
/** Monorail */
{ // Main Sprites
- { SPR_MONO_TRACK_Y, SPR_MONO_TRACK_N_S, SPR_MONO_TRACK_BASE, SPR_MONO_SINGLE_Y, SPR_MONO_SINGLE_X,
+ { SPR_MONO_TRACK_Y, SPR_MONO_TRACK_N_S, SPR_MONO_TRACK_BASE, SPR_MONO_SINGLE_X, SPR_MONO_SINGLE_Y,
SPR_MONO_SINGLE_NORTH, SPR_MONO_SINGLE_SOUTH, SPR_MONO_SINGLE_EAST, SPR_MONO_SINGLE_WEST,
SPR_TRACKS_FOR_SLOPES_MONO_BASE,
SPR_CROSSING_OFF_X_MONO,
@@ -227,7 +227,7 @@ static const RailtypeInfo _original_railtypes[] = {
/** Maglev */
{ // Main sprites
- { SPR_MGLV_TRACK_Y, SPR_MGLV_TRACK_N_S, SPR_MGLV_TRACK_BASE, SPR_MGLV_SINGLE_Y, SPR_MGLV_SINGLE_X,
+ { SPR_MGLV_TRACK_Y, SPR_MGLV_TRACK_N_S, SPR_MGLV_TRACK_BASE, SPR_MGLV_SINGLE_X, SPR_MGLV_SINGLE_Y,
SPR_MGLV_SINGLE_NORTH, SPR_MGLV_SINGLE_SOUTH, SPR_MGLV_SINGLE_EAST, SPR_MGLV_SINGLE_WEST,
SPR_TRACKS_FOR_SLOPES_MAGLEV_BASE,
SPR_CROSSING_OFF_X_MAGLEV,
diff --git a/src/table/sprites.h b/src/table/sprites.h
index 3ffe4d145..19b9a72af 100644
--- a/src/table/sprites.h
+++ b/src/table/sprites.h
@@ -306,8 +306,8 @@ enum Sprites {
SPR_ORIGINAL_SIGNALS_BASE = 1275,
- SPR_RAIL_SINGLE_Y = 1005,
- SPR_RAIL_SINGLE_X = 1006,
+ SPR_RAIL_SINGLE_X = 1005,
+ SPR_RAIL_SINGLE_Y = 1006,
SPR_RAIL_SINGLE_NORTH = 1007,
SPR_RAIL_SINGLE_SOUTH = 1008,
SPR_RAIL_SINGLE_EAST = 1009,
@@ -342,8 +342,8 @@ enum Sprites {
SPR_RAIL_ROOF_GLASS_Y_TILE_A = 1084,
SPR_RAIL_ROOF_GLASS_X_TILE_B = 1085, // second half of the roof glass
SPR_RAIL_ROOF_GLASS_Y_TILE_B = 1086,
- SPR_MONO_SINGLE_Y = 1087,
- SPR_MONO_SINGLE_X = 1088,
+ SPR_MONO_SINGLE_X = 1087,
+ SPR_MONO_SINGLE_Y = 1088,
SPR_MONO_SINGLE_NORTH = 1089,
SPR_MONO_SINGLE_SOUTH = 1090,
SPR_MONO_SINGLE_EAST = 1091,
@@ -351,8 +351,8 @@ enum Sprites {
SPR_MONO_TRACK_Y = 1093,
SPR_MONO_TRACK_BASE = 1100,
SPR_MONO_TRACK_N_S = 1117,
- SPR_MGLV_SINGLE_Y = 1169,
- SPR_MGLV_SINGLE_X = 1170,
+ SPR_MGLV_SINGLE_X = 1169,
+ SPR_MGLV_SINGLE_Y = 1170,
SPR_MGLV_SINGLE_NORTH = 1171,
SPR_MGLV_SINGLE_SOUTH = 1172,
SPR_MGLV_SINGLE_EAST = 1173,
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 164318384..42e18201b 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -911,7 +911,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
/* PBS debugging, draw reserved tracks darker */
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && (transport_type == TRANSPORT_RAIL && HasTunnelBridgeReservation(ti->tile))) {
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile));
- DrawGroundSprite(DiagDirToAxis(tunnelbridge_direction) == AXIS_X ? rti->base_sprites.single_y : rti->base_sprites.single_x, PALETTE_CRASH);
+ DrawGroundSprite(DiagDirToAxis(tunnelbridge_direction) == AXIS_X ? rti->base_sprites.single_x : rti->base_sprites.single_y, PALETTE_CRASH);
}
if (transport_type == TRANSPORT_ROAD) {
@@ -997,7 +997,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && transport_type == TRANSPORT_RAIL && HasTunnelBridgeReservation(ti->tile)) {
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile));
if (HasBridgeFlatRamp(ti->tileh, DiagDirToAxis(tunnelbridge_direction))) {
- AddSortableSpriteToDraw(DiagDirToAxis(tunnelbridge_direction) == AXIS_X ? rti->base_sprites.single_y : rti->base_sprites.single_x, PALETTE_CRASH, ti->x, ti->y, 16, 16, 0, ti->z + 8);
+ AddSortableSpriteToDraw(DiagDirToAxis(tunnelbridge_direction) == AXIS_X ? rti->base_sprites.single_x : rti->base_sprites.single_y, PALETTE_CRASH, ti->x, ti->y, 16, 16, 0, ti->z + 8);
} else {
AddSortableSpriteToDraw(rti->base_sprites.single_sloped + tunnelbridge_direction, PALETTE_CRASH, ti->x, ti->y, 16, 16, 8, ti->z);
}