equal
deleted
inserted
replaced
358 } |
358 } |
359 |
359 |
360 extern uint16 _custom_sprites_base; |
360 extern uint16 _custom_sprites_base; |
361 |
361 |
362 /* Draw a waypoint */ |
362 /* Draw a waypoint */ |
363 void DrawWaypointSprite(int x, int y, int stat_id, int railtype) |
363 void DrawWaypointSprite(int x, int y, int stat_id, uint railtype) |
364 { |
364 { |
365 StationSpec *stat; |
365 StationSpec *stat; |
366 uint32 relocation; |
366 uint32 relocation; |
367 DrawTileSprites *cust; |
367 DrawTileSprites *cust; |
368 DrawTileSeqStruct const *seq; |
368 DrawTileSeqStruct const *seq; |
|
369 const RailtypeInfo *rti = GetRailTypeInfo(railtype); |
369 uint32 ormod, img; |
370 uint32 ormod, img; |
370 |
371 |
371 ormod = SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)); |
372 ormod = SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)); |
372 |
373 |
373 x += 33; |
374 x += 33; |
376 /* draw default waypoint graphics of ID 0 */ |
377 /* draw default waypoint graphics of ID 0 */ |
377 if (stat_id == 0) { |
378 if (stat_id == 0) { |
378 const DrawTrackSeqStruct *dtss = _track_depot_layout_table[4]; |
379 const DrawTrackSeqStruct *dtss = _track_depot_layout_table[4]; |
379 |
380 |
380 img = dtss++->image; |
381 img = dtss++->image; |
381 if (img & PALETTE_MODIFIER_COLOR) img = (img & SPRITE_MASK) + railtype*TRACKTYPE_SPRITE_PITCH; |
382 if (img & PALETTE_MODIFIER_COLOR) img = (img & SPRITE_MASK) + rti->total_offset; |
382 DrawSprite(img, x, y); |
383 DrawSprite(img, x, y); |
383 |
384 |
384 for (; dtss->image != 0; dtss++) { |
385 for (; dtss->image != 0; dtss++) { |
385 Point pt = RemapCoords(dtss->subcoord_x, dtss->subcoord_y, 0); |
386 Point pt = RemapCoords(dtss->subcoord_x, dtss->subcoord_y, 0); |
386 img = dtss->image; |
387 img = dtss->image; |
396 // emulate station tile - open with building |
397 // emulate station tile - open with building |
397 // add 1 to get the other direction |
398 // add 1 to get the other direction |
398 cust = &stat->renderdata[2]; |
399 cust = &stat->renderdata[2]; |
399 |
400 |
400 img = cust->ground_sprite; |
401 img = cust->ground_sprite; |
401 img += railtype * ((img < _custom_sprites_base) ? TRACKTYPE_SPRITE_PITCH : 1); |
402 img += (img < _custom_sprites_base) ? rti->total_offset : railtype; |
402 |
403 |
403 if (img & PALETTE_MODIFIER_COLOR) img = (img & SPRITE_MASK); |
404 if (img & PALETTE_MODIFIER_COLOR) img = (img & SPRITE_MASK); |
404 DrawSprite(img, x, y); |
405 DrawSprite(img, x, y); |
405 |
406 |
406 foreach_draw_tile_seq(seq, cust->seq) { |
407 foreach_draw_tile_seq(seq, cust->seq) { |