diff options
author | frosch <frosch@openttd.org> | 2016-08-15 18:33:52 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2016-08-15 18:33:52 +0000 |
commit | ddc920521215c38ab7e96bebb929b313758268df (patch) | |
tree | 7cf2b7ca745d1d95af0d13b82d6b7f834913e0a6 /src/depot_gui.cpp | |
parent | cff2b493653eda314f997f998b297621eeb9e190 (diff) | |
download | openttd-ddc920521215c38ab7e96bebb929b313758268df.tar.xz |
(svn r27630) -Codechange: Deduplicate code to attach vehicle to cursor.
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r-- | src/depot_gui.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 76bb8df50..47eefc65e 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -505,16 +505,12 @@ struct DepotWindow : Window { this->sel = INVALID_VEHICLE; TrainDepotMoveVehicle(v, sel, gdvp.head); } else if (v != NULL) { - bool rtl = _current_text_dir == TD_RTL; - int image = v->GetImage(rtl ? DIR_E : DIR_W, EIT_IN_DEPOT); - SetObjectToPlaceWnd(image, GetVehiclePalette(v), HT_DRAG, this); + SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this); + SetMouseCursorVehicle(v, EIT_IN_DEPOT); + _cursor.vehchain = _ctrl_pressed; this->sel = v->index; this->SetDirty(); - - _cursor.sprite_pos[0].x = v->IsGroundVehicle() ? (16 - v->GetGroundVehicleCache()->cached_veh_length * 2) * (rtl ? -1 : 1) : 0; - _cursor.vehchain = _ctrl_pressed; - UpdateCursorSize(); } break; } |