summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-01-19 21:40:10 +0000
committerpeter1138 <peter1138@openttd.org>2007-01-19 21:40:10 +0000
commitd3761d97eb20d2324a4e6c1f4853941af915349b (patch)
treec640d17aaa58d0ed8da9226bec3ccb51b2df153d /src
parentf07cbde398e8a2a2adab32f29ce47f33718bdaea (diff)
downloadopenttd-d3761d97eb20d2324a4e6c1f4853941af915349b.tar.xz
(svn r8283) -Fix (r8128): Custom waypoint drawing used wrong bits since bitshuffling occurred. Also update with other station drawing changes (code duplication,
eh?)
Diffstat (limited to 'src')
-rw-r--r--src/rail_cmd.cpp30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index a5643a48f..04deae559 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -1324,8 +1324,7 @@ static void DrawTile_Track(TileInfo *ti)
relocation = GetCustomStationRelocation(statspec, st, ti->tile);
image = dts->ground_sprite;
- if (HASBIT(image, 31)) {
- CLRBIT(image, 31);
+ if (HASBIT(image, SPRITE_MODIFIER_USE_OFFSET)) {
image += GetCustomStationGroundRelocation(statspec, st, ti->tile);
image += rti->custom_ground_offset;
} else {
@@ -1349,9 +1348,18 @@ default_waypoint:
if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenary(ti);
foreach_draw_tile_seq(dtss, dts->seq) {
- SpriteID image = dtss->image + relocation;
+ SpriteID image = dtss->image;
SpriteID pal;
+ /* Unlike stations, our default waypoint has no variation for
+ * different railtype, so don't use the railtype offset if
+ * no relocation is set */
+ if (HASBIT(image, SPRITE_MODIFIER_USE_OFFSET)) {
+ image += rti->total_offset;
+ } else {
+ image += relocation;
+ }
+
if (_display_opt & DO_TRANS_BUILDINGS) {
SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
pal = PALETTE_TO_TRANSPARENT;
@@ -1361,12 +1369,16 @@ default_waypoint:
pal = dtss->pal;
}
- AddSortableSpriteToDraw(
- image, pal,
- ti->x + dtss->delta_x, ti->y + dtss->delta_y,
- dtss->size_x, dtss->size_y,
- dtss->size_z, ti->z + dtss->delta_z
- );
+ if ((byte)dtss->delta_z != 0x80) {
+ AddSortableSpriteToDraw(
+ image, pal,
+ ti->x + dtss->delta_x, ti->y + dtss->delta_y,
+ dtss->size_x, dtss->size_y,
+ dtss->size_z, ti->z + dtss->delta_z
+ );
+ } else {
+ AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y);
+ }
}
}
DrawBridgeMiddle(ti);