Mercurial > hg > openttd
changeset 13825:254768f95618 draft
(svn r18351) -Fix [FS#3333]: endianness issue with saving the zoom level
author | rubidium <rubidium@openttd.org> |
---|---|
date | Mon, 30 Nov 2009 11:29:52 +0000 |
parents | 6d4b1112d84e |
children | 93b2e4531a3f |
files | src/saveload/misc_sl.cpp src/saveload/saveload_internal.h src/viewport.cpp src/zoom_func.h src/zoom_type.h |
diffstat | 5 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/saveload/misc_sl.cpp +++ b/src/saveload/misc_sl.cpp @@ -29,6 +29,7 @@ /* Keep track of current game position */ int _saved_scrollpos_x; int _saved_scrollpos_y; +ZoomLevelByte _saved_scrollpos_zoom; void SaveViewportBeforeSaveGame() { @@ -51,7 +52,7 @@ w->viewport->dest_scrollpos_y = _saved_scrollpos_y; ViewPort *vp = w->viewport; - vp->zoom = min(_saved_scrollpos_zoom, ZOOM_LVL_MAX); + vp->zoom = min<ZoomLevel>(_saved_scrollpos_zoom, ZOOM_LVL_MAX); vp->virtual_width = ScaleByZoom(vp->width, vp->zoom); vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);
--- a/src/saveload/saveload_internal.h +++ b/src/saveload/saveload_internal.h @@ -45,6 +45,7 @@ extern int32 _saved_scrollpos_x; extern int32 _saved_scrollpos_y; +extern ZoomLevelByte _saved_scrollpos_zoom; extern SavegameType _savegame_type; extern uint32 _ttdp_version;
--- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -53,7 +53,6 @@ PlaceProc *_place_proc; Point _tile_fract_coords; -ZoomLevel _saved_scrollpos_zoom; struct StringSpriteToDraw { StringID string;