From 381bf04bab14528ab47b95a944f67c2769d44b81 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 16 Jan 2010 22:44:03 +0000 Subject: (svn r18839) -Codechange: Detriplicate drawing of spritelayouts in the GUI. --- src/rail_cmd.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/rail_cmd.cpp') diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index f1e74e999..d7622d831 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1986,28 +1986,20 @@ static void DrawTile_Track(TileInfo *ti) DrawBridgeMiddle(ti); } - -static void DrawTileSequence(int x, int y, SpriteID ground, const DrawTileSeqStruct *dtss, uint32 offset) -{ - SpriteID palette = COMPANY_SPRITE_COLOUR(_local_company); - - DrawSprite(ground, PAL_NONE, x, y); - for (; dtss->image.sprite != 0; dtss++) { - Point pt = RemapCoords(dtss->delta_x, dtss->delta_y, dtss->delta_z); - SpriteID image = dtss->image.sprite + offset; - - DrawSprite(image, HasBit(image, PALETTE_MODIFIER_COLOUR) ? palette : PAL_NONE, x + pt.x, y + pt.y); - } -} - void DrawTrainDepotSprite(int x, int y, int dir, RailType railtype) { const DrawTileSprites *dts = &_depot_gfx_table[dir]; SpriteID image = dts->ground.sprite; uint32 offset = GetRailTypeInfo(railtype)->total_offset; + x += 33; + y += 17; + if (image != SPR_FLAT_GRASS_TILE) image += offset; - DrawTileSequence(x + 33, y + 17, image, dts->seq, offset); + SpriteID palette = COMPANY_SPRITE_COLOUR(_local_company); + + DrawSprite(image, PAL_NONE, x, y); + DrawCommonTileSeqInGUI(x, y, dts, offset, 0, palette); } static uint GetSlopeZ_Track(TileIndex tile, uint x, uint y) -- cgit v1.2.3-54-g00ecf