~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/saveload/misc_sl.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Kooijman, cdcb73a
  • Date: 2009-12-24 00:55:45 UTC
  • mfrom: (1.1.9 upstream) (2.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091224005545-ffwi801t8mvqtgwz
[cdcb73a] Imported Upstream version 0.7.5. This release fixes
CVE-2009-4007.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: misc_sl.cpp 16355 2009-05-18 20:17:28Z rubidium $ */
 
1
/* $Id: misc_sl.cpp 18476 2009-12-13 00:13:06Z rubidium $ */
2
2
 
3
3
/** @file misc_sl.cpp Saving and loading of things that didn't fit anywhere else */
4
4
 
23
23
/* Keep track of current game position */
24
24
int _saved_scrollpos_x;
25
25
int _saved_scrollpos_y;
 
26
ZoomLevelByte _saved_scrollpos_zoom;
26
27
 
27
28
void SaveViewportBeforeSaveGame()
28
29
{
45
46
        w->viewport->dest_scrollpos_y = _saved_scrollpos_y;
46
47
 
47
48
        ViewPort *vp = w->viewport;
48
 
        vp->zoom = min(_saved_scrollpos_zoom, ZOOM_LVL_MAX);
 
49
        vp->zoom = (ZoomLevel)min(_saved_scrollpos_zoom, ZOOM_LVL_MAX);
49
50
        vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
50
51
        vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);
51
52