Merge branch 'master' into jgrpp
# Conflicts: # CMakeLists.txt # src/saveload/town_sl.cpp # src/screenshot.h # src/script/api/ai/ai_date.hpp.sq # src/script/api/ai/ai_marine.hpp.sq # src/script/api/ai/ai_station.hpp.sq # src/script/api/game/game_date.hpp.sq # src/script/api/game/game_marine.hpp.sq # src/script/api/game/game_station.hpp.sq # src/script/api/game/game_window.hpp.sq # src/script/api/script_window.hpp # src/script/api/template/template_window.hpp.sq # src/signal.cpp # src/statusbar_gui.cpp # src/toolbar_gui.cpp # src/viewport.cpp # src/viewport_func.h
This commit is contained in:
@@ -52,7 +52,7 @@ void ResetViewportAfterLoadGame()
|
||||
w->viewport->dest_scrollpos_x = _saved_scrollpos_x;
|
||||
w->viewport->dest_scrollpos_y = _saved_scrollpos_y;
|
||||
|
||||
ViewPort *vp = w->viewport;
|
||||
Viewport *vp = w->viewport;
|
||||
vp->zoom = (ZoomLevel)min(_saved_scrollpos_zoom, ZOOM_LVL_MAX);
|
||||
vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
|
||||
vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);
|
||||
|
||||
@@ -306,6 +306,7 @@ enum SaveLoadVersion : uint16 {
|
||||
SLV_MULTITILE_DOCKS, ///< 216 PR#7380 Multiple docks per station.
|
||||
SLV_TRADING_AGE, ///< 217 PR#7780 Configurable company trading age.
|
||||
SLV_ENDING_YEAR, ///< 218 PR#7747 v1.10 Configurable ending year.
|
||||
SLV_REMOVE_TOWN_CARGO_CACHE, ///< 219 PR#8258 Remove town cargo acceptance and production caches.
|
||||
|
||||
SL_MAX_VERSION, ///< Highest possible saveload version
|
||||
|
||||
|
||||
@@ -212,10 +212,8 @@ static const SaveLoad _town_desc[] = {
|
||||
SLE_CONDLST(Town, psa_list, REF_STORAGE, SLV_161, SL_MAX_VERSION),
|
||||
|
||||
SLE_CONDNULL(4, SLV_166, SLV_EXTEND_CARGOTYPES), ///< cargo_produced, no longer in use
|
||||
SLE_CONDNULL(8, SLV_EXTEND_CARGOTYPES, SL_MAX_VERSION), ///< cargo_produced, no longer in use
|
||||
|
||||
/* reserve extra space in savegame here. (currently 30 bytes) */
|
||||
SLE_CONDNULL(30, SLV_2, SL_MAX_VERSION),
|
||||
SLE_CONDNULL(8, SLV_EXTEND_CARGOTYPES, SLV_REMOVE_TOWN_CARGO_CACHE), ///< cargo_produced, no longer in use
|
||||
SLE_CONDNULL(30, SLV_2, SLV_REMOVE_TOWN_CARGO_CACHE), ///< old reserved space
|
||||
|
||||
SLE_END()
|
||||
};
|
||||
@@ -278,11 +276,6 @@ static void RealSave_Town(Town *t)
|
||||
for (int i = TE_BEGIN; i < NUM_TE; i++) {
|
||||
SlObjectSaveFiltered(&t->received[i], _filtered_town_received_desc.data());
|
||||
}
|
||||
|
||||
/* Write an empty matrix to avoid bumping savegame version. */
|
||||
SlWriteUint32(0); // tile
|
||||
SlWriteUint16(0); // w
|
||||
SlWriteUint16(0); // h
|
||||
}
|
||||
|
||||
static void Save_TOWN()
|
||||
@@ -321,7 +314,7 @@ static void Load_TOWN()
|
||||
SlErrorCorrupt("Invalid town name generator");
|
||||
}
|
||||
|
||||
if (!IsSavegameVersionBefore(SLV_166) || SlXvIsFeaturePresent(XSLFI_TOWN_CARGO_MATRIX)) {
|
||||
if ((!IsSavegameVersionBefore(SLV_166) && IsSavegameVersionBefore(SLV_REMOVE_TOWN_CARGO_CACHE)) || SlXvIsFeaturePresent(XSLFI_TOWN_CARGO_MATRIX)) {
|
||||
SlSkipBytes(4); // tile
|
||||
uint16 w = SlReadUint16();
|
||||
uint16 h = SlReadUint16();
|
||||
|
||||
Reference in New Issue
Block a user