summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-11-21 13:22:52 +0100
committerErich Eckner <git@eckner.net>2021-07-21 19:01:20 +0200
commit7704c449e5099380f6f23977fc2805a483b830d8 (patch)
tree5c75777554061a6e60afc75e7d91de76a52f9a8f /src
parentc2e0bc7fac90c44efe952206d6c59906bc8f749b (diff)
downloadopenttd-7704c449e5099380f6f23977fc2805a483b830d8.tar.xz
tired to be closer to the original patch - no difference noticed
Diffstat (limited to 'src')
-rw-r--r--src/station_cmd.cpp50
1 files changed, 29 insertions, 21 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index ea29e2479..018a2b7fd 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -3051,29 +3051,37 @@ draw_default_foundation:
} else {
if (HasBit(pal, SPRITE_MODIFIER_CUSTOM_SPRITE)) {
pal += ground_relocation;
- } else if (ti->tileh != SLOPE_FLAT && (IsRailStation(ti->tile) || IsRoadStop(ti->tile))) {
- /* It's a sloped rail station? */
- Foundation rf = FOUNDATION_NONE;
- if (IsRoadStop(ti->tile)) {
- /* Roadstops without foundation on a slope
- * and on Slopes with one corner raised */
- rf = GetRoadFoundation(ti->tileh, AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(ti->tile))));
- DrawFoundation(ti, rf);
- /* Draws the sloped road */
- if (ti->tileh != SLOPE_FLAT) image = _road_sloped_sprites[ti->tileh - 1] + 0x53F;
+ } else {
+ if (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE)) {
+ image += ground_relocation;
} else {
- /* sloped rail station */
- TrackBits track = AxisToTrackBits(GetRailStationAxis(ti->tile));
- rf = GetRailFoundation(ti->tileh, track);
- DrawFoundation(ti, rf);
- if (rf != FOUNDATION_LEVELED) {
- image = _track_sloped_sprites[ti->tileh - 1] + rti->base_sprites.track_y;
- } else {
- (image = rti->base_sprites.track_y, track == TRACK_BIT_Y ) || (image++, track == TRACK_BIT_X);
- }
+ if (ti->tileh != SLOPE_FLAT && (IsRailStation(ti->tile) || IsRoadStop(ti->tile))) {
+ /* It's a sloped rail station? */
+ Foundation rf = FOUNDATION_NONE;
+ if (IsRoadStop(ti->tile)) {
+ /* Roadstops without foundation on a slope
+ * and on Slopes with one corner raised */
+ rf = GetRoadFoundation(ti->tileh, AxisToRoadBits(DiagDirToAxis(GetRoadStopDir(ti->tile))));
+ DrawFoundation(ti, rf);
+ /* Draws the sloped road */
+ if (ti->tileh != SLOPE_FLAT) image = _road_sloped_sprites[ti->tileh - 1] + 0x53F;
+ } else {
+ /* sloped rail station */
+ TrackBits track = AxisToTrackBits(GetRailStationAxis(ti->tile));
+ rf = GetRailFoundation(ti->tileh, track);
+ DrawFoundation(ti, rf);
+ if (rf != FOUNDATION_LEVELED) {
+ image = _track_sloped_sprites[ti->tileh - 1] + rti->base_sprites.track_y;
+ } else {
+ (image = rti->base_sprites.track_y, track == TRACK_BIT_Y ) || (image++, track == TRACK_BIT_X);
+ }
+ }
+ } else {
+ /* it's not a slope */
+ image += total_offset;
+ }
}
- } else
- image += HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE) ? ground_relocation : total_offset;
+ }
DrawGroundSprite(image, GroundSpritePaletteTransform(image, pal, palette));
/* PBS debugging, draw reserved tracks darker */