summaryrefslogtreecommitdiff
path: root/train_gui.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-02-20 09:26:07 +0000
committerpeter1138 <peter1138@openttd.org>2006-02-20 09:26:07 +0000
commitb5cd24f05d6babfd984d8b317e9c63062a0f711a (patch)
treee87fed6383d92b03125509e76c151eb73cdc1be6 /train_gui.c
parentdac14d4210d810e727b97eea15d112529c63bf2e (diff)
downloadopenttd-b5cd24f05d6babfd984d8b317e9c63062a0f711a.tar.xz
(svn r3620) - 2cc: Replace use of macro to determine colour map with a function call for drawing of vehicles.
Diffstat (limited to 'train_gui.c')
-rw-r--r--train_gui.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/train_gui.c b/train_gui.c
index 68d06179e..4540ce902 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -186,8 +186,7 @@ static void engine_drawing_loop(int *x, int *y, int *pos, int *sel,
if (IS_INT_INSIDE(--*pos, -show_max, 0)) {
DrawString(*x + 59, *y + 2, GetCustomEngineName(i), *sel == 0 ? 0xC : 0x10);
- DrawTrainEngine(*x + 29, *y + 6, i,
- SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
+ DrawTrainEngine(*x + 29, *y + 6, i, GetEnginePalette(i, _local_player));
*y += 14;
}
--*sel;
@@ -360,7 +359,7 @@ static void DrawTrainImage(const Vehicle *v, int x, int y, int count, int skip,
do {
if (--skip < 0) {
int image = GetTrainImage(v, 6);
- uint32 ormod = SPRITE_PALETTE(PLAYER_SPRITE_COLOR(v->owner));
+ uint32 ormod = GetVehiclePalette(v);
int width = v->u.rail.cached_veh_length;
if (dx + width <= count) {
@@ -581,7 +580,7 @@ static void TrainDepotClickTrain(Window *w, int x, int y)
TrainDepotMoveVehicle(v, sel, gdvp.head);
} else if (v != NULL) {
WP(w,traindepot_d).sel = v->index;
- SetObjectToPlaceWnd( SPRITE_PALETTE(PLAYER_SPRITE_COLOR(v->owner)) + GetTrainImage(v, 6), 4, w);
+ SetObjectToPlaceWnd(GetVehiclePalette(v) | GetTrainImage(v, 6), 4, w);
SetWindowDirty(w);
}
break;