Mercurial > hg > openttd
changeset 13971:31d285a8abf8 draft
(svn r18509) -Codechange (r2515,r2753): Data for drawing single_x/y rail pieces was inverted.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Tue, 15 Dec 2009 13:59:20 +0000 |
parents | bf79f84b8631 |
children | b48b5f0ff30e |
files | src/rail.h src/rail_cmd.cpp src/road_cmd.cpp src/station_cmd.cpp src/table/railtypes.h src/table/sprites.h src/tunnelbridge_cmd.cpp |
diffstat | 7 files changed, 21 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/src/rail.h +++ b/src/rail.h @@ -54,8 +54,8 @@ 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
--- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1804,8 +1804,8 @@ /* 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 @@ 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 @@ /* 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; } }
--- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1193,7 +1193,7 @@ /* 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)) {
--- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2373,7 +2373,7 @@ /* 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); } }
--- 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 @@ /** 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 @@ /** 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 @@ /** 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,
--- a/src/table/sprites.h +++ b/src/table/sprites.h @@ -306,8 +306,8 @@ 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 @@ 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 @@ 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,
--- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -911,7 +911,7 @@ /* 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 @@ 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); }