(svn r9962) -Feature: Add smooth viewport scrolling. This must be enabled with patch setting 'smooth_scroll'

This commit is contained in:
peter1138
2007-05-28 16:46:16 +00:00
parent 493494a35d
commit 2851f58efa
10 changed files with 64 additions and 20 deletions

View File

@@ -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;