diff options
author | glx <glx@openttd.org> | 2008-05-11 15:08:44 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-05-11 15:08:44 +0000 |
commit | dacd2c5de8fb7b36f046a08e7f447f9497dcf8d6 (patch) | |
tree | dfb592610399f3c49e4292af8aacfd992b50d368 /src/window.cpp | |
parent | ee3c14b344c70017c12c3a2a56748e0283a0fe07 (diff) | |
download | openttd-dacd2c5de8fb7b36f046a08e7f447f9497dcf8d6.tar.xz |
(svn r13047) -Codechange: remove vp_d
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/window.cpp b/src/window.cpp index 3efdb2df3..4c7f89454 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1713,9 +1713,9 @@ static bool HandleViewportScroll() return true; } - if (WP(w, vp_d).follow_vehicle != INVALID_VEHICLE && w == FindWindowById(WC_MAIN_WINDOW, 0)) { + if (w == FindWindowById(WC_MAIN_WINDOW, 0) && w->viewport->follow_vehicle != INVALID_VEHICLE) { /* If the main window is following a vehicle, then first let go of it! */ - const Vehicle *veh = GetVehicle(WP(w, vp_d).follow_vehicle); + const Vehicle *veh = GetVehicle(w->viewport->follow_vehicle); ScrollMainWindowTo(veh->x_pos, veh->y_pos, true); /* This also resets follow_vehicle */ return true; } @@ -1915,14 +1915,14 @@ static void HandleAutoscroll() /* here allows scrolling in both x and y axis */ #define scrollspeed 3 if (x - 15 < 0) { - WP(w, vp_d).dest_scrollpos_x += ScaleByZoom((x - 15) * scrollspeed, vp->zoom); + w->viewport->dest_scrollpos_x += ScaleByZoom((x - 15) * scrollspeed, vp->zoom); } else if (15 - (vp->width - x) > 0) { - WP(w, vp_d).dest_scrollpos_x += ScaleByZoom((15 - (vp->width - x)) * scrollspeed, vp->zoom); + w->viewport->dest_scrollpos_x += ScaleByZoom((15 - (vp->width - x)) * scrollspeed, vp->zoom); } if (y - 15 < 0) { - WP(w, vp_d).dest_scrollpos_y += ScaleByZoom((y - 15) * scrollspeed, vp->zoom); + w->viewport->dest_scrollpos_y += ScaleByZoom((y - 15) * scrollspeed, vp->zoom); } else if (15 - (vp->height - y) > 0) { - WP(w, vp_d).dest_scrollpos_y += ScaleByZoom((15 - (vp->height - y)) * scrollspeed, vp->zoom); + w->viewport->dest_scrollpos_y += ScaleByZoom((15 - (vp->height - y)) * scrollspeed, vp->zoom); } #undef scrollspeed } |