From 2e9529aff3a94bbd77958244fbc56da278eb5204 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 16 Jan 2010 22:52:51 +0000 Subject: [PATCH] (svn r18840) -Codechange: Use DrawCommonTileSeq[InGUI] for roaddepot drawing. --- src/road_cmd.cpp | 31 ++----------------------------- src/table/road_land.h | 2 +- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index f6c58b1652..ed91923193 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1223,28 +1223,7 @@ static void DrawTile_Road(TileInfo *ti) } DrawGroundSprite(dts->ground.sprite, PAL_NONE); - - /* End now if buildings are invisible */ - if (IsInvisibilitySet(TO_BUILDINGS)) break; - - for (const DrawTileSeqStruct *dtss = dts->seq; dtss->image.sprite != 0; dtss++) { - SpriteID image = dtss->image.sprite; - SpriteID pal; - - if (!IsTransparencySet(TO_BUILDINGS) && HasBit(image, PALETTE_MODIFIER_COLOUR)) { - pal = palette; - } else { - pal = PAL_NONE; - } - - AddSortableSpriteToDraw( - image, pal, - ti->x + dtss->delta_x, ti->y + dtss->delta_y, - dtss->size_x, dtss->size_y, - dtss->size_z, ti->z, - IsTransparencySet(TO_BUILDINGS) - ); - } + DrawCommonTileSeq(ti, dts, TO_BUILDINGS, 0, 0, palette); break; } } @@ -1260,13 +1239,7 @@ void DrawRoadDepotSprite(int x, int y, DiagDirection dir, RoadType rt) y += 17; DrawSprite(dts->ground.sprite, PAL_NONE, x, y); - - for (const DrawTileSeqStruct *dtss = dts->seq; dtss->image.sprite != 0; dtss++) { - Point pt = RemapCoords(dtss->delta_x, dtss->delta_y, dtss->delta_z); - SpriteID image = dtss->image.sprite; - - DrawSprite(image, HasBit(image, PALETTE_MODIFIER_COLOUR) ? palette : PAL_NONE, x + pt.x, y + pt.y); - } + DrawCommonTileSeqInGUI(x, y, dts, 0, 0, palette); } /** diff --git a/src/table/road_land.h b/src/table/road_land.h index fb8e42ea1d..e6ec411bd8 100644 --- a/src/table/road_land.h +++ b/src/table/road_land.h @@ -10,7 +10,7 @@ /** @file road_land.h Sprite constructs for road depots. */ #define TILE_SEQ_LINE(img, pal, dx, dy, sx, sy) { dx, dy, 0, sx, sy, 20, {img, pal} }, -#define TILE_SEQ_END() { 0, 0, 0, 0, 0, 0, {0, 0} } +#define TILE_SEQ_END() { (int8)0x80, 0, 0, 0, 0, 0, {0, 0} } static const DrawTileSeqStruct _road_depot_NE[] = { TILE_SEQ_LINE(0x584 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 15, 16, 1)