roadveh_gui.c
changeset 3040 c3473d1fb81f
parent 2962 dbd168a4703a
child 3049 b797ca543c13
--- a/roadveh_gui.c	Mon Feb 20 01:36:48 2006 +0000
+++ b/roadveh_gui.c	Mon Feb 20 09:26:07 2006 +0000
@@ -65,7 +65,7 @@
 static void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection)
 {
 	int image = GetRoadVehImage(v, 6);
-	uint32 ormod = SPRITE_PALETTE(PLAYER_SPRITE_COLOR(v->owner));
+	uint32 ormod = GetVehiclePalette(v);
 	if (v->vehstatus & VS_CRASHED) ormod = PALETTE_CRASH;
 	DrawSprite(image | ormod, x + 14, y + 6);
 
@@ -412,7 +412,7 @@
 				if (sel==0) selected_id = engine_id;
 				if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
 					DrawString(x+59, y+2, GetCustomEngineName(engine_id), sel==0 ? 0xC : 0x10);
-					DrawRoadVehEngine(x+29, y+6, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
+					DrawRoadVehEngine(x+29, y+6, engine_id, GetEnginePalette(engine_id, _local_player));
 					y += 14;
 				}
 				sel--;
@@ -638,7 +638,7 @@
 		if (v != NULL) {
 			WP(w,traindepot_d).sel = v->index;
 			SetWindowDirty(w);
-			SetObjectToPlaceWnd( SPRITE_PALETTE(PLAYER_SPRITE_COLOR(v->owner)) + GetRoadVehImage(v, 6), 4, w);
+			SetObjectToPlaceWnd(GetVehiclePalette(v) | GetRoadVehImage(v, 6), 4, w);
 		}
 		break;