mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-06 22:37:22 +00:00
(svn r8283) -Fix (r8128): Custom waypoint drawing used wrong bits since bitshuffling occurred. Also update with other station drawing changes (code duplication,
eh?)
This commit is contained in:
parent
f07cbde398
commit
d3761d97eb
@ -1324,8 +1324,7 @@ static void DrawTile_Track(TileInfo *ti)
|
|||||||
relocation = GetCustomStationRelocation(statspec, st, ti->tile);
|
relocation = GetCustomStationRelocation(statspec, st, ti->tile);
|
||||||
|
|
||||||
image = dts->ground_sprite;
|
image = dts->ground_sprite;
|
||||||
if (HASBIT(image, 31)) {
|
if (HASBIT(image, SPRITE_MODIFIER_USE_OFFSET)) {
|
||||||
CLRBIT(image, 31);
|
|
||||||
image += GetCustomStationGroundRelocation(statspec, st, ti->tile);
|
image += GetCustomStationGroundRelocation(statspec, st, ti->tile);
|
||||||
image += rti->custom_ground_offset;
|
image += rti->custom_ground_offset;
|
||||||
} else {
|
} else {
|
||||||
@ -1349,9 +1348,18 @@ default_waypoint:
|
|||||||
if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenary(ti);
|
if (GetRailType(ti->tile) == RAILTYPE_ELECTRIC) DrawCatenary(ti);
|
||||||
|
|
||||||
foreach_draw_tile_seq(dtss, dts->seq) {
|
foreach_draw_tile_seq(dtss, dts->seq) {
|
||||||
SpriteID image = dtss->image + relocation;
|
SpriteID image = dtss->image;
|
||||||
SpriteID pal;
|
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) {
|
if (_display_opt & DO_TRANS_BUILDINGS) {
|
||||||
SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
|
SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
|
||||||
pal = PALETTE_TO_TRANSPARENT;
|
pal = PALETTE_TO_TRANSPARENT;
|
||||||
@ -1361,12 +1369,16 @@ default_waypoint:
|
|||||||
pal = dtss->pal;
|
pal = dtss->pal;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddSortableSpriteToDraw(
|
if ((byte)dtss->delta_z != 0x80) {
|
||||||
image, pal,
|
AddSortableSpriteToDraw(
|
||||||
ti->x + dtss->delta_x, ti->y + dtss->delta_y,
|
image, pal,
|
||||||
dtss->size_x, dtss->size_y,
|
ti->x + dtss->delta_x, ti->y + dtss->delta_y,
|
||||||
dtss->size_z, ti->z + dtss->delta_z
|
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);
|
DrawBridgeMiddle(ti);
|
||||||
|
Loading…
Reference in New Issue
Block a user