diff options
author | darkvater <darkvater@openttd.org> | 2004-11-14 11:04:59 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2004-11-14 11:04:59 +0000 |
commit | 989289faddc4b1f7dee97defb7d80e6d1cea0465 (patch) | |
tree | ca221c544cee439913b1d184c7b4c814b2b41f3a /rail_cmd.c | |
parent | 4f6fa3b4682f286f8a2deb87a116c7a99de502aa (diff) | |
download | openttd-989289faddc4b1f7dee97defb7d80e6d1cea0465.tar.xz |
(svn r585) -newgrf: GUI for selecting custom waypoint graphics to use. Patch by dominik81 and pasky.
Diffstat (limited to 'rail_cmd.c')
-rw-r--r-- | rail_cmd.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/rail_cmd.c b/rail_cmd.c index 5a79829be..67b7812d3 100644 --- a/rail_cmd.c +++ b/rail_cmd.c @@ -1620,6 +1620,35 @@ void DrawTrainDepotSprite(int x, int y, int image, int railtype) } } +void DrawCheckpointSprite(int x, int y, int stat_id) +{ + // TODO: We should use supersets with cargo-id FF, if available. --pasky + DrawTileSprites *cust = GetCustomStation('WAYP', stat_id); + DrawTileSeqStruct const *seq; + uint32 ormod, img; + + assert(cust); + + // emulate station tile - open with building + // add 1 to get the other direction + cust = &cust[2]; + + ormod = SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)); + + x += 33; + y += 17; + + img = cust->ground_sprite; + if (img & 0x8000) img = (img & 0x7FFF); + DrawSprite(img, x, y); + + foreach_draw_tile_seq(seq, cust->seq) { + Point pt = RemapCoords(seq->delta_x, seq->delta_y, seq->delta_z); + DrawSprite((seq->image&0x3FFF) | ormod, x + pt.x, y + pt.y); + } +} + + #define NUM_SSD_ENTRY 256 #define NUM_SSD_STACK 32 |