(svn r23080) -Feature: [NewGRF] Use variable 10 to enable vehicle GRFs to draw different sprites on the map and in various GUIs.

This commit is contained in:
frosch
2011-11-01 16:51:47 +00:00
parent a5ddc39bad
commit 6e61fee028
25 changed files with 124 additions and 111 deletions

View File

@@ -90,7 +90,7 @@ static int HighlightDragPosition(int px, int max_width, VehicleID selection)
* @param skip Number of pixels to skip at the front (for scrolling)
* @param drag_dest The vehicle another one is dragged over, \c INVALID_VEHICLE if none.
*/
void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID selection, int skip, VehicleID drag_dest)
void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip, VehicleID drag_dest)
{
bool rtl = _current_text_dir == TD_RTL;
Direction dir = rtl ? DIR_E : DIR_W;
@@ -122,7 +122,7 @@ void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID select
if (rtl ? px + width > 0 : px - width < max_width) {
PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
DrawSprite(v->GetImage(dir), pal, px + (rtl ? -offset.x : offset.x), 7 + offset.y);
DrawSprite(v->GetImage(dir, image_type), pal, px + (rtl ? -offset.x : offset.x), 7 + offset.y);
}
if (!v->IsArticulatedPart()) sel_articulated = false;
@@ -359,7 +359,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po
int width = u->GetDisplayImageWidth(&offset);
if (vscroll_pos <= 0 && vscroll_pos > -vscroll_cap) {
PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
DrawSprite(u->GetImage(dir), pal, px + (rtl ? -offset.x : offset.x), y - line_height * vscroll_pos + sprite_y_offset + offset.y);
DrawSprite(u->GetImage(dir, EIT_IN_DETAILS), pal, px + (rtl ? -offset.x : offset.x), y - line_height * vscroll_pos + sprite_y_offset + offset.y);
}
px += rtl ? -width : width;
dx += width;