Merge branch 'master' into jgrpp

# Conflicts:
#	.gitignore
#	CMakeLists.txt
#	src/3rdparty/optional/optional.hpp
#	src/group_cmd.cpp
#	src/industry_cmd.cpp
#	src/misc_gui.cpp
#	src/video/sdl2_v.cpp
This commit is contained in:
Jonathan G Rennison
2021-01-29 17:45:15 +00:00
68 changed files with 2084 additions and 1978 deletions

View File

@@ -3293,8 +3293,7 @@ bool AfterLoadGame()
cur_skip = prev_tile_skip;
}
/*C++17: uint &this_skip = */ skip_frames.push_back(prev_tile_skip);
uint &this_skip = skip_frames.back();
uint &this_skip = skip_frames.emplace_back(prev_tile_skip);
/* The following 3 curves now take longer than before */
switch (u->state) {

View File

@@ -191,8 +191,7 @@ static void Load_EIDS()
_engine_mngr.clear();
while (SlIterateArray() != -1) {
/*C++17: EngineIDMapping *eid = &*/ _engine_mngr.emplace_back();
EngineIDMapping *eid = &_engine_mngr.back();
EngineIDMapping *eid = &_engine_mngr.emplace_back();
SlObject(eid, _engine_id_mapping_desc);
}
}

View File

@@ -46,6 +46,9 @@
#include "../scope.h"
#include <atomic>
#include <string>
#ifdef __EMSCRIPTEN__
# include <emscripten.h>
#endif
#include "../tbtr_template_vehicle.h"
@@ -2928,6 +2931,10 @@ static void SaveFileDone()
InvalidateWindowData(WC_STATUS_BAR, 0, SBI_SAVELOAD_FINISH);
_sl.saveinprogress = false;
#ifdef __EMSCRIPTEN__
EM_ASM(if (window["openttd_syncfs"]) openttd_syncfs());
#endif
}
/** Set the error message from outside of the actual loading/saving of the game (AfterLoadGame and friends) */

View File

@@ -192,8 +192,7 @@ static void Load_WAYP()
int index;
while ((index = SlIterateArray()) != -1) {
/*C++17: OldWaypoint *wp = &*/ _old_waypoints.emplace_back();
OldWaypoint *wp = &_old_waypoints.back();
OldWaypoint *wp = &_old_waypoints.emplace_back();
wp->index = index;
SlObject(wp, _old_waypoint_desc);