diff options
author | peter1138 <peter1138@openttd.org> | 2007-05-28 16:46:16 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-05-28 16:46:16 +0000 |
commit | 344e9007feac6dd1e90154b45e80907c5e49821a (patch) | |
tree | 17d1923b83a591294a9f935eda1159e520609c81 /src/openttd.cpp | |
parent | 1a8a44165b7ccab605673c750596b80eb3d88799 (diff) | |
download | openttd-344e9007feac6dd1e90154b45e80907c5e49821a.tar.xz |
(svn r9962) -Feature: Add smooth viewport scrolling. This must be enabled with patch setting 'smooth_scroll'
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 58fff0971..5d8762319 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -991,8 +991,8 @@ static void ScrollMainViewport(int x, int y) Window *w = FindWindowById(WC_MAIN_WINDOW, 0); assert(w); - WP(w,vp_d).scrollpos_x += ScaleByZoom(x, w->viewport->zoom); - WP(w,vp_d).scrollpos_y += ScaleByZoom(y, w->viewport->zoom); + WP(w,vp_d).dest_scrollpos_x += ScaleByZoom(x, w->viewport->zoom); + WP(w,vp_d).dest_scrollpos_y += ScaleByZoom(y, w->viewport->zoom); } } @@ -1284,6 +1284,8 @@ bool AfterLoadGame() WP(w,vp_d).scrollpos_x = _saved_scrollpos_x; WP(w,vp_d).scrollpos_y = _saved_scrollpos_y; + WP(w,vp_d).dest_scrollpos_x = _saved_scrollpos_x; + WP(w,vp_d).dest_scrollpos_y = _saved_scrollpos_y; vp = w->viewport; vp->zoom = _saved_scrollpos_zoom; |