Changeset - r25772:5ba83ce3a853
src/saveload/ai_sl.cpp
Show inline comments
 
@@ -127,8 +127,9 @@ static void Save_AIPL()
 
	}
 
}
 

	
 
static const ChunkHandler ai_chunk_handlers[] = {
 
	{ 'AIPL', Save_AIPL, Load_AIPL, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler AIPL{ 'AIPL', Save_AIPL, Load_AIPL, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef ai_chunk_handlers[] = {
 
	AIPL,
 
};
 

	
 
extern const ChunkHandlerTable _ai_chunk_handlers(ai_chunk_handlers);
src/saveload/airport_sl.cpp
Show inline comments
 
@@ -34,9 +34,11 @@ static void Load_ATID()
 
	Load_NewGRFMapping(_airporttile_mngr);
 
}
 

	
 
static const ChunkHandler airport_chunk_handlers[] = {
 
	{ 'ATID', Save_ATID, Load_ATID, nullptr, nullptr, CH_TABLE },
 
	{ 'APID', Save_APID, Load_APID, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler ATID{ 'ATID', Save_ATID, Load_ATID, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandler APID{ 'APID', Save_APID, Load_APID, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef airport_chunk_handlers[] = {
 
	ATID,
 
	APID,
 
};
 

	
 
extern const ChunkHandlerTable _airport_chunk_handlers(airport_chunk_handlers);
src/saveload/animated_tile_sl.cpp
Show inline comments
 
@@ -68,8 +68,9 @@ static void Load_ANIT()
 
	if (SlIterateArray() != -1) SlErrorCorrupt("Too many ANIT entries");
 
}
 

	
 
static const ChunkHandler animated_tile_chunk_handlers[] = {
 
	{ 'ANIT', Save_ANIT, Load_ANIT, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler ANIT{ 'ANIT', Save_ANIT, Load_ANIT, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef animated_tile_chunk_handlers[] = {
 
	ANIT,
 
};
 

	
 
extern const ChunkHandlerTable _animated_tile_chunk_handlers(animated_tile_chunk_handlers);
src/saveload/autoreplace_sl.cpp
Show inline comments
 
@@ -61,8 +61,9 @@ static void Ptrs_ERNW()
 
	}
 
}
 

	
 
static const ChunkHandler autoreplace_chunk_handlers[] = {
 
	{ 'ERNW', Save_ERNW, Load_ERNW, Ptrs_ERNW, nullptr, CH_TABLE },
 
static const ChunkHandler ERNW{ 'ERNW', Save_ERNW, Load_ERNW, Ptrs_ERNW, nullptr, CH_TABLE };
 
static const ChunkHandlerRef autoreplace_chunk_handlers[] = {
 
	ERNW,
 
};
 

	
 
extern const ChunkHandlerTable _autoreplace_chunk_handlers(autoreplace_chunk_handlers);
src/saveload/cargomonitor_sl.cpp
Show inline comments
 
@@ -127,9 +127,11 @@ static void LoadPickup()
 
}
 

	
 
/** Chunk definition of the cargomonitoring maps. */
 
extern const ChunkHandler cargomonitor_chunk_handlers[] = {
 
	{ 'CMDL', SaveDelivery, LoadDelivery, nullptr, nullptr, CH_TABLE },
 
	{ 'CMPU', SavePickup,   LoadPickup,   nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler CMDL{ 'CMDL', SaveDelivery, LoadDelivery, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandler CMPU{ 'CMPU', SavePickup,   LoadPickup,   nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef cargomonitor_chunk_handlers[] = {
 
	CMDL,
 
	CMPU,
 
};
 

	
 
extern const ChunkHandlerTable _cargomonitor_chunk_handlers(cargomonitor_chunk_handlers);
src/saveload/cargopacket_sl.cpp
Show inline comments
 
@@ -128,8 +128,9 @@ static void Load_CAPA()
 
	}
 
}
 

	
 
static const ChunkHandler cargopacket_chunk_handlers[] = {
 
	{ 'CAPA', Save_CAPA, Load_CAPA, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler CAPA{ 'CAPA', Save_CAPA, Load_CAPA, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef cargopacket_chunk_handlers[] = {
 
	CAPA,
 
};
 

	
 
extern const ChunkHandlerTable _cargopacket_chunk_handlers(cargopacket_chunk_handlers);
src/saveload/cheat_sl.cpp
Show inline comments
 
@@ -75,8 +75,9 @@ static void Load_CHTS()
 
	if (!IsSavegameVersionBefore(SLV_RIFF_TO_ARRAY) && SlIterateArray() != -1) SlErrorCorrupt("Too many CHTS entries");
 
}
 

	
 
static const ChunkHandler cheat_chunk_handlers[] = {
 
	{ 'CHTS', Save_CHTS, Load_CHTS, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler CHTS{ 'CHTS', Save_CHTS, Load_CHTS, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef cheat_chunk_handlers[] = {
 
	CHTS,
 
};
 

	
 
extern const ChunkHandlerTable _cheat_chunk_handlers(cheat_chunk_handlers);
src/saveload/company_sl.cpp
Show inline comments
 
@@ -557,9 +557,9 @@ static void Ptrs_PLYR()
 
	}
 
}
 

	
 

	
 
static const ChunkHandler company_chunk_handlers[] = {
 
	{ 'PLYR', Save_PLYR, Load_PLYR, Ptrs_PLYR, Check_PLYR, CH_TABLE },
 
static const ChunkHandler PLYR{ 'PLYR', Save_PLYR, Load_PLYR, Ptrs_PLYR, Check_PLYR, CH_TABLE };
 
static const ChunkHandlerRef company_chunk_handlers[] = {
 
	PLYR,
 
};
 

	
 
extern const ChunkHandlerTable _company_chunk_handlers(company_chunk_handlers);
src/saveload/depot_sl.cpp
Show inline comments
 
@@ -62,8 +62,9 @@ static void Ptrs_DEPT()
 
	}
 
}
 

	
 
static const ChunkHandler depot_chunk_handlers[] = {
 
	{ 'DEPT', Save_DEPT, Load_DEPT, Ptrs_DEPT, nullptr, CH_TABLE },
 
static const ChunkHandler DEPT{ 'DEPT', Save_DEPT, Load_DEPT, Ptrs_DEPT, nullptr, CH_TABLE };
 
static const ChunkHandlerRef depot_chunk_handlers[] = {
 
	DEPT,
 
};
 

	
 
extern const ChunkHandlerTable _depot_chunk_handlers(depot_chunk_handlers);
src/saveload/economy_sl.cpp
Show inline comments
 
@@ -105,12 +105,15 @@ static void Ptrs_CAPY()
 
	}
 
}
 

	
 

	
 
static const ChunkHandler economy_chunk_handlers[] = {
 
	{ 'CAPY', Save_CAPY, Load_CAPY, Ptrs_CAPY, nullptr, CH_TABLE },
 
	{ 'PRIC', nullptr,   Load_PRIC, nullptr,   nullptr, CH_READONLY  },
 
	{ 'CAPR', nullptr,   Load_CAPR, nullptr,   nullptr, CH_READONLY  },
 
	{ 'ECMY', Save_ECMY, Load_ECMY, nullptr,   nullptr, CH_TABLE },
 
static const ChunkHandler CAPY{ 'CAPY', Save_CAPY, Load_CAPY, Ptrs_CAPY, nullptr, CH_TABLE };
 
static const ChunkHandler PRIC{ 'PRIC', nullptr,   Load_PRIC, nullptr,   nullptr, CH_READONLY };
 
static const ChunkHandler CAPR{ 'CAPR', nullptr,   Load_CAPR, nullptr,   nullptr, CH_READONLY };
 
static const ChunkHandler ECMY{ 'ECMY', Save_ECMY, Load_ECMY, nullptr,   nullptr, CH_TABLE };
 
static const ChunkHandlerRef economy_chunk_handlers[] = {
 
	CAPY,
 
	PRIC,
 
	CAPR,
 
	ECMY,
 
};
 

	
 
extern const ChunkHandlerTable _economy_chunk_handlers(economy_chunk_handlers);
src/saveload/engine_sl.cpp
Show inline comments
 
@@ -199,10 +199,13 @@ static void Load_EIDS()
 
	}
 
}
 

	
 
static const ChunkHandler engine_chunk_handlers[] = {
 
	{ 'EIDS', Save_EIDS, Load_EIDS, nullptr, nullptr, CH_TABLE },
 
	{ 'ENGN', Save_ENGN, Load_ENGN, nullptr, nullptr, CH_TABLE },
 
	{ 'ENGS', nullptr,   Load_ENGS, nullptr, nullptr, CH_READONLY  },
 
static const ChunkHandler EIDS{ 'EIDS', Save_EIDS, Load_EIDS, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandler ENGN{ 'ENGN', Save_ENGN, Load_ENGN, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandler ENGS{ 'ENGS', nullptr,   Load_ENGS, nullptr, nullptr, CH_READONLY };
 
static const ChunkHandlerRef engine_chunk_handlers[] = {
 
	EIDS,
 
	ENGN,
 
	ENGS,
 
};
 

	
 
extern const ChunkHandlerTable _engine_chunk_handlers(engine_chunk_handlers);
src/saveload/game_sl.cpp
Show inline comments
 
@@ -188,9 +188,11 @@ static void Save_GSTR()
 
	}
 
}
 

	
 
static const ChunkHandler game_chunk_handlers[] = {
 
	{ 'GSTR', Save_GSTR, Load_GSTR, nullptr, nullptr, CH_TABLE },
 
	{ 'GSDT', Save_GSDT, Load_GSDT, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler GSTR{ 'GSTR', Save_GSTR, Load_GSTR, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandler GSDT{ 'GSDT', Save_GSDT, Load_GSDT, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef game_chunk_handlers[] = {
 
	GSTR,
 
	GSDT,
 
};
 

	
 
extern const ChunkHandlerTable _game_chunk_handlers(game_chunk_handlers);
src/saveload/gamelog_sl.cpp
Show inline comments
 
@@ -401,8 +401,9 @@ static void Check_GLOG()
 
	Load_GLOG_common(_load_check_data.gamelog_action, _load_check_data.gamelog_actions);
 
}
 

	
 
static const ChunkHandler gamelog_chunk_handlers[] = {
 
	{ 'GLOG', Save_GLOG, Load_GLOG, nullptr, Check_GLOG, CH_TABLE }
 
static const ChunkHandler GLOG{ 'GLOG', Save_GLOG, Load_GLOG, nullptr, Check_GLOG, CH_TABLE };
 
static const ChunkHandlerRef gamelog_chunk_handlers[] = {
 
	GLOG,
 
};
 

	
 
extern const ChunkHandlerTable _gamelog_chunk_handlers(gamelog_chunk_handlers);
src/saveload/goal_sl.cpp
Show inline comments
 
@@ -46,8 +46,9 @@ static void Load_GOAL()
 
	}
 
}
 

	
 
static const ChunkHandler goal_chunk_handlers[] = {
 
	{ 'GOAL', Save_GOAL, Load_GOAL, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler GOAL{ 'GOAL', Save_GOAL, Load_GOAL, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef goal_chunk_handlers[] = {
 
	GOAL,
 
};
 

	
 
extern const ChunkHandlerTable _goal_chunk_handlers(goal_chunk_handlers);
src/saveload/group_sl.cpp
Show inline comments
 
@@ -59,8 +59,9 @@ static void Load_GRPS()
 
	}
 
}
 

	
 
static const ChunkHandler group_chunk_handlers[] = {
 
	{ 'GRPS', Save_GRPS, Load_GRPS, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler GRPS{ 'GRPS', Save_GRPS, Load_GRPS, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef group_chunk_handlers[] = {
 
	GRPS,
 
};
 

	
 
extern const ChunkHandlerTable _group_chunk_handlers(group_chunk_handlers);
src/saveload/industry_sl.cpp
Show inline comments
 
@@ -194,12 +194,17 @@ static void Load_ITBL()
 
	}
 
}
 

	
 
static const ChunkHandler industry_chunk_handlers[] = {
 
	{ 'INDY', Save_INDY, Load_INDY, Ptrs_INDY, nullptr, CH_TABLE },
 
	{ 'IIDS', Save_IIDS, Load_IIDS, nullptr,   nullptr, CH_TABLE },
 
	{ 'TIDS', Save_TIDS, Load_TIDS, nullptr,   nullptr, CH_TABLE },
 
	{ 'IBLD', Save_IBLD, Load_IBLD, nullptr,   nullptr, CH_TABLE },
 
	{ 'ITBL', Save_ITBL, Load_ITBL, nullptr,   nullptr, CH_TABLE },
 
static const ChunkHandler INDY{ 'INDY', Save_INDY, Load_INDY, Ptrs_INDY, nullptr, CH_TABLE };
 
static const ChunkHandler IIDS{ 'IIDS', Save_IIDS, Load_IIDS, nullptr,   nullptr, CH_TABLE };
 
static const ChunkHandler TIDS{ 'TIDS', Save_TIDS, Load_TIDS, nullptr,   nullptr, CH_TABLE };
 
static const ChunkHandler IBLD{ 'IBLD', Save_IBLD, Load_IBLD, nullptr,   nullptr, CH_TABLE };
 
static const ChunkHandler ITBL{ 'ITBL', Save_ITBL, Load_ITBL, nullptr,   nullptr, CH_TABLE };
 
static const ChunkHandlerRef industry_chunk_handlers[] = {
 
	INDY,
 
	IIDS,
 
	TIDS,
 
	IBLD,
 
	ITBL,
 
};
 

	
 
extern const ChunkHandlerTable _industry_chunk_handlers(industry_chunk_handlers);
src/saveload/labelmaps_sl.cpp
Show inline comments
 
@@ -127,8 +127,9 @@ static void Load_RAIL()
 
	}
 
}
 

	
 
static const ChunkHandler labelmaps_chunk_handlers[] = {
 
	{ 'RAIL', Save_RAIL, Load_RAIL, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler RAIL{ 'RAIL', Save_RAIL, Load_RAIL, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef labelmaps_chunk_handlers[] = {
 
	RAIL,
 
};
 

	
 
extern const ChunkHandlerTable _labelmaps_chunk_handlers(labelmaps_chunk_handlers);
src/saveload/linkgraph_sl.cpp
Show inline comments
 
@@ -326,10 +326,13 @@ static void Ptrs_LGRS()
 
	SlObject(&LinkGraphSchedule::instance, GetLinkGraphScheduleDesc());
 
}
 

	
 
static const ChunkHandler linkgraph_chunk_handlers[] = {
 
	{ 'LGRP', Save_LGRP, Load_LGRP, nullptr,   nullptr, CH_TABLE },
 
	{ 'LGRJ', Save_LGRJ, Load_LGRJ, nullptr,   nullptr, CH_TABLE },
 
	{ 'LGRS', Save_LGRS, Load_LGRS, Ptrs_LGRS, nullptr, CH_TABLE },
 
static const ChunkHandler LGRP{ 'LGRP', Save_LGRP, Load_LGRP, nullptr,   nullptr, CH_TABLE };
 
static const ChunkHandler LGRJ{ 'LGRJ', Save_LGRJ, Load_LGRJ, nullptr,   nullptr, CH_TABLE };
 
static const ChunkHandler LGRS{ 'LGRS', Save_LGRS, Load_LGRS, Ptrs_LGRS, nullptr, CH_TABLE };
 
static const ChunkHandlerRef linkgraph_chunk_handlers[] = {
 
	LGRP,
 
	LGRJ,
 
	LGRS,
 
};
 

	
 
extern const ChunkHandlerTable _linkgraph_chunk_handlers(linkgraph_chunk_handlers);
src/saveload/map_sl.cpp
Show inline comments
 
@@ -309,19 +309,29 @@ static void Save_MAP8()
 
	}
 
}
 

	
 

	
 
static const ChunkHandler map_chunk_handlers[] = {
 
	{ 'MAPS', Save_MAPS, Load_MAPS, nullptr, Check_MAPS, CH_TABLE },
 
	{ 'MAPT', Save_MAPT, Load_MAPT, nullptr, nullptr,    CH_RIFF },
 
	{ 'MAPH', Save_MAPH, Load_MAPH, nullptr, nullptr,    CH_RIFF },
 
	{ 'MAPO', Save_MAP1, Load_MAP1, nullptr, nullptr,    CH_RIFF },
 
	{ 'MAP2', Save_MAP2, Load_MAP2, nullptr, nullptr,    CH_RIFF },
 
	{ 'M3LO', Save_MAP3, Load_MAP3, nullptr, nullptr,    CH_RIFF },
 
	{ 'M3HI', Save_MAP4, Load_MAP4, nullptr, nullptr,    CH_RIFF },
 
	{ 'MAP5', Save_MAP5, Load_MAP5, nullptr, nullptr,    CH_RIFF },
 
	{ 'MAPE', Save_MAP6, Load_MAP6, nullptr, nullptr,    CH_RIFF },
 
	{ 'MAP7', Save_MAP7, Load_MAP7, nullptr, nullptr,    CH_RIFF },
 
	{ 'MAP8', Save_MAP8, Load_MAP8, nullptr, nullptr,    CH_RIFF },
 
static const ChunkHandler MAPS{ 'MAPS', Save_MAPS, Load_MAPS, nullptr, Check_MAPS, CH_TABLE };
 
static const ChunkHandler MAPT{ 'MAPT', Save_MAPT, Load_MAPT, nullptr, nullptr,    CH_RIFF };
 
static const ChunkHandler MAPH{ 'MAPH', Save_MAPH, Load_MAPH, nullptr, nullptr,    CH_RIFF };
 
static const ChunkHandler MAPO{ 'MAPO', Save_MAP1, Load_MAP1, nullptr, nullptr,    CH_RIFF };
 
static const ChunkHandler MAP2{ 'MAP2', Save_MAP2, Load_MAP2, nullptr, nullptr,    CH_RIFF };
 
static const ChunkHandler M3LO{ 'M3LO', Save_MAP3, Load_MAP3, nullptr, nullptr,    CH_RIFF };
 
static const ChunkHandler M3HI{ 'M3HI', Save_MAP4, Load_MAP4, nullptr, nullptr,    CH_RIFF };
 
static const ChunkHandler MAP5{ 'MAP5', Save_MAP5, Load_MAP5, nullptr, nullptr,    CH_RIFF };
 
static const ChunkHandler MAPE{ 'MAPE', Save_MAP6, Load_MAP6, nullptr, nullptr,    CH_RIFF };
 
static const ChunkHandler MAP7{ 'MAP7', Save_MAP7, Load_MAP7, nullptr, nullptr,    CH_RIFF };
 
static const ChunkHandler MAP8{ 'MAP8', Save_MAP8, Load_MAP8, nullptr, nullptr,    CH_RIFF };
 
static const ChunkHandlerRef map_chunk_handlers[] = {
 
	MAPS,
 
	MAPT,
 
	MAPH,
 
	MAPO,
 
	MAP2,
 
	M3LO,
 
	M3HI,
 
	MAP5,
 
	MAPE,
 
	MAP7,
 
	MAP8,
 
};
 

	
 
extern const ChunkHandlerTable _map_chunk_handlers(map_chunk_handlers);
src/saveload/misc_sl.cpp
Show inline comments
 
@@ -152,9 +152,11 @@ static void Load_VIEW()
 
	if (!IsSavegameVersionBefore(SLV_RIFF_TO_ARRAY) && SlIterateArray() != -1) SlErrorCorrupt("Too many DATE entries");
 
}
 

	
 
static const ChunkHandler misc_chunk_handlers[] = {
 
	{ 'DATE', Save_DATE, Load_DATE, nullptr, Check_DATE, CH_TABLE },
 
	{ 'VIEW', Save_VIEW, Load_VIEW, nullptr, nullptr,    CH_TABLE },
 
static const ChunkHandler DATE{ 'DATE', Save_DATE, Load_DATE, nullptr, Check_DATE, CH_TABLE };
 
static const ChunkHandler VIEW{ 'VIEW', Save_VIEW, Load_VIEW, nullptr, nullptr,    CH_TABLE };
 
static const ChunkHandlerRef misc_chunk_handlers[] = {
 
	DATE,
 
	VIEW,
 
};
 

	
 
extern const ChunkHandlerTable _misc_chunk_handlers(misc_chunk_handlers);
src/saveload/newgrf_sl.cpp
Show inline comments
 
@@ -121,8 +121,9 @@ static void Check_NGRF()
 
	Load_NGRF_common(_load_check_data.grfconfig);
 
}
 

	
 
static const ChunkHandler newgrf_chunk_handlers[] = {
 
	{ 'NGRF', Save_NGRF, Load_NGRF, nullptr, Check_NGRF, CH_TABLE }
 
static const ChunkHandler NGRF{ 'NGRF', Save_NGRF, Load_NGRF, nullptr, Check_NGRF, CH_TABLE };
 
static const ChunkHandlerRef newgrf_chunk_handlers[] = {
 
	NGRF,
 
};
 

	
 
extern const ChunkHandlerTable _newgrf_chunk_handlers(newgrf_chunk_handlers);
src/saveload/object_sl.cpp
Show inline comments
 
@@ -72,9 +72,11 @@ static void Load_OBID()
 
	Load_NewGRFMapping(_object_mngr);
 
}
 

	
 
static const ChunkHandler object_chunk_handlers[] = {
 
	{ 'OBID', Save_OBID, Load_OBID, nullptr,   nullptr, CH_TABLE },
 
	{ 'OBJS', Save_OBJS, Load_OBJS, Ptrs_OBJS, nullptr, CH_TABLE },
 
static const ChunkHandler OBID{ 'OBID', Save_OBID, Load_OBID, nullptr,   nullptr, CH_TABLE };
 
static const ChunkHandler OBJS{ 'OBJS', Save_OBJS, Load_OBJS, Ptrs_OBJS, nullptr, CH_TABLE };
 
static const ChunkHandlerRef object_chunk_handlers[] = {
 
	OBID,
 
	OBJS,
 
};
 

	
 
extern const ChunkHandlerTable _object_chunk_handlers(object_chunk_handlers);
src/saveload/order_sl.cpp
Show inline comments
 
@@ -298,10 +298,13 @@ static void Ptrs_BKOR()
 
	}
 
}
 

	
 
static const ChunkHandler order_chunk_handlers[] = {
 
	{ 'BKOR', Save_BKOR, Load_BKOR, Ptrs_BKOR, nullptr, CH_TABLE },
 
	{ 'ORDR', Save_ORDR, Load_ORDR, Ptrs_ORDR, nullptr, CH_TABLE },
 
	{ 'ORDL', Save_ORDL, Load_ORDL, Ptrs_ORDL, nullptr, CH_TABLE },
 
static const ChunkHandler BKOR{ 'BKOR', Save_BKOR, Load_BKOR, Ptrs_BKOR, nullptr, CH_TABLE };
 
static const ChunkHandler ORDR{ 'ORDR', Save_ORDR, Load_ORDR, Ptrs_ORDR, nullptr, CH_TABLE };
 
static const ChunkHandler ORDL{ 'ORDL', Save_ORDL, Load_ORDL, Ptrs_ORDL, nullptr, CH_TABLE };
 
static const ChunkHandlerRef order_chunk_handlers[] = {
 
	BKOR,
 
	ORDR,
 
	ORDL,
 
};
 

	
 
extern const ChunkHandlerTable _order_chunk_handlers(order_chunk_handlers);
src/saveload/saveload.cpp
Show inline comments
 
@@ -216,7 +216,7 @@ struct SaveLoadParams {
 

	
 
static SaveLoadParams _sl; ///< Parameters used for/at saveload.
 

	
 
static const std::vector<ChunkHandler> &ChunkHandlers()
 
static const std::vector<ChunkHandlerRef> &ChunkHandlers()
 
{
 
	/* These define the chunks */
 
	extern const ChunkHandlerTable _gamelog_chunk_handlers;
 
@@ -290,7 +290,7 @@ static const std::vector<ChunkHandler> &
 
		_persistent_storage_chunk_handlers,
 
	};
 

	
 
	static std::vector<ChunkHandler> _chunk_handlers;
 
	static std::vector<ChunkHandlerRef> _chunk_handlers;
 

	
 
	if (_chunk_handlers.empty()) {
 
		for (auto &chunk_handler_table : _chunk_handler_tables) {
 
@@ -313,7 +313,7 @@ static void SlNullPointers()
 
	 * pointers from other pools. */
 
	_sl_version = SAVEGAME_VERSION;
 

	
 
	for (auto &ch : ChunkHandlers()) {
 
	for (const ChunkHandler &ch : ChunkHandlers()) {
 
		if (ch.fix_pointers) {
 
			Debug(sl, 3, "Nulling pointers for {:c}{:c}{:c}{:c}", ch.id >> 24, ch.id >> 16, ch.id >> 8, ch.id);
 
			ch.FixPointers();
 
@@ -2312,7 +2312,7 @@ static void SlSaveChunks()
 
 */
 
static const ChunkHandler *SlFindChunkHandler(uint32 id)
 
{
 
	for (auto &ch : ChunkHandlers()) if (ch.id == id) return &ch;
 
	for (const ChunkHandler &ch : ChunkHandlers()) if (ch.id == id) return &ch;
 
	return nullptr;
 
}
 

	
 
@@ -2351,7 +2351,7 @@ static void SlFixPointers()
 
{
 
	_sl.action = SLA_PTRS;
 

	
 
	for (auto &ch : ChunkHandlers()) {
 
	for (const ChunkHandler &ch : ChunkHandlers()) {
 
		if (ch.fix_pointers) {
 
			Debug(sl, 3, "Fixing pointers for {:c}{:c}{:c}{:c}", ch.id >> 24, ch.id >> 16, ch.id >> 8, ch.id);
 
			ch.FixPointers();
src/saveload/saveload.h
Show inline comments
 
@@ -450,8 +450,11 @@ struct ChunkHandler {
 
	virtual void LoadCheck(size_t len = 0) const;
 
};
 

	
 
/** A reference to ChunkHandler. */
 
using ChunkHandlerRef = std::reference_wrapper<const ChunkHandler>;
 

	
 
/** A table of ChunkHandler entries. */
 
using ChunkHandlerTable = span<const ChunkHandler>;
 
using ChunkHandlerTable = span<const ChunkHandlerRef>;
 

	
 
/** A table of SaveLoad entries. */
 
using SaveLoadTable = span<const struct SaveLoad>;
src/saveload/settings_sl.cpp
Show inline comments
 
@@ -170,9 +170,11 @@ static void Save_PATS()
 
	SaveSettings(_settings, &_settings_game);
 
}
 

	
 
static const ChunkHandler setting_chunk_handlers[] = {
 
	{ 'OPTS', nullptr,   Load_OPTS, nullptr, nullptr,    CH_READONLY  },
 
	{ 'PATS', Save_PATS, Load_PATS, nullptr, Check_PATS, CH_TABLE },
 
static const ChunkHandler OPTS{ 'OPTS', nullptr,   Load_OPTS, nullptr, nullptr,    CH_READONLY };
 
static const ChunkHandler PATS{ 'PATS', Save_PATS, Load_PATS, nullptr, Check_PATS, CH_TABLE };
 
static const ChunkHandlerRef setting_chunk_handlers[] = {
 
	OPTS,
 
	PATS,
 
};
 

	
 
extern const ChunkHandlerTable _setting_chunk_handlers(setting_chunk_handlers);
src/saveload/signs_sl.cpp
Show inline comments
 
@@ -67,8 +67,9 @@ static void Load_SIGN()
 
	}
 
}
 

	
 
static const ChunkHandler sign_chunk_handlers[] = {
 
	{ 'SIGN', Save_SIGN, Load_SIGN, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler SIGN{ 'SIGN', Save_SIGN, Load_SIGN, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef sign_chunk_handlers[] = {
 
	SIGN,
 
};
 

	
 
extern const ChunkHandlerTable _sign_chunk_handlers(sign_chunk_handlers);
src/saveload/station_sl.cpp
Show inline comments
 
@@ -719,10 +719,13 @@ static void Ptrs_ROADSTOP()
 
	}
 
}
 

	
 
static const ChunkHandler station_chunk_handlers[] = {
 
	{ 'STNS', nullptr,       Load_STNS,     Ptrs_STNS,     nullptr, CH_READONLY },
 
	{ 'STNN', Save_STNN,     Load_STNN,     Ptrs_STNN,     nullptr, CH_TABLE },
 
	{ 'ROAD', Save_ROADSTOP, Load_ROADSTOP, Ptrs_ROADSTOP, nullptr, CH_TABLE },
 
static const ChunkHandler STNS{ 'STNS', nullptr,       Load_STNS,     Ptrs_STNS,     nullptr, CH_READONLY };
 
static const ChunkHandler STNN{ 'STNN', Save_STNN,     Load_STNN,     Ptrs_STNN,     nullptr, CH_TABLE };
 
static const ChunkHandler ROAD{ 'ROAD', Save_ROADSTOP, Load_ROADSTOP, Ptrs_ROADSTOP, nullptr, CH_TABLE };
 
static const ChunkHandlerRef station_chunk_handlers[] = {
 
	STNS,
 
	STNN,
 
	ROAD,
 
};
 

	
 
extern const ChunkHandlerTable _station_chunk_handlers(station_chunk_handlers);
src/saveload/storage_sl.cpp
Show inline comments
 
@@ -50,8 +50,9 @@ static void Save_PSAC()
 
	}
 
}
 

	
 
static const ChunkHandler persistent_storage_chunk_handlers[] = {
 
	{ 'PSAC', Save_PSAC, Load_PSAC, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler PSAC{ 'PSAC', Save_PSAC, Load_PSAC, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef persistent_storage_chunk_handlers[] = {
 
	PSAC,
 
};
 

	
 
extern const ChunkHandlerTable _persistent_storage_chunk_handlers(persistent_storage_chunk_handlers);
src/saveload/story_sl.cpp
Show inline comments
 
@@ -105,9 +105,11 @@ static void Load_STORY_PAGE()
 
	_story_page_next_sort_value = max_sort_value + 1;
 
}
 

	
 
static const ChunkHandler story_page_chunk_handlers[] = {
 
	{ 'STPE', Save_STORY_PAGE_ELEMENT, Load_STORY_PAGE_ELEMENT, nullptr, nullptr, CH_TABLE },
 
	{ 'STPA', Save_STORY_PAGE,         Load_STORY_PAGE,         nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler STPE{ 'STPE', Save_STORY_PAGE_ELEMENT, Load_STORY_PAGE_ELEMENT, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandler STPA{ 'STPA', Save_STORY_PAGE,         Load_STORY_PAGE,         nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef story_page_chunk_handlers[] = {
 
	STPE,
 
	STPA,
 
};
 

	
 
extern const ChunkHandlerTable _story_page_chunk_handlers(story_page_chunk_handlers);
src/saveload/strings_sl.cpp
Show inline comments
 
@@ -130,8 +130,9 @@ static void Load_NAME()
 
	}
 
}
 

	
 
static const ChunkHandler name_chunk_handlers[] = {
 
	{ 'NAME', nullptr, Load_NAME, nullptr, nullptr, CH_READONLY },
 
static const ChunkHandler NAME{ 'NAME', nullptr, Load_NAME, nullptr, nullptr, CH_READONLY };
 
static const ChunkHandlerRef name_chunk_handlers[] = {
 
	NAME,
 
};
 

	
 
extern const ChunkHandlerTable _name_chunk_handlers(name_chunk_handlers);
src/saveload/subsidy_sl.cpp
Show inline comments
 
@@ -50,8 +50,9 @@ static void Load_SUBS()
 
	}
 
}
 

	
 
static const ChunkHandler subsidy_chunk_handlers[] = {
 
	{ 'SUBS', Save_SUBS, Load_SUBS, nullptr, nullptr, CH_TABLE },
 
static const ChunkHandler SUBS{ 'SUBS', Save_SUBS, Load_SUBS, nullptr, nullptr, CH_TABLE };
 
static const ChunkHandlerRef subsidy_chunk_handlers[] = {
 
	SUBS,
 
};
 

	
 
extern const ChunkHandlerTable _subsidy_chunk_handlers(subsidy_chunk_handlers);
src/saveload/town_sl.cpp
Show inline comments
 
@@ -318,9 +318,11 @@ static void Ptrs_TOWN()
 
	}
 
}
 

	
 
static const ChunkHandler town_chunk_handlers[] = {
 
	{ 'HIDS', Save_HIDS, Load_HIDS, nullptr,   nullptr, CH_TABLE },
 
	{ 'CITY', Save_TOWN, Load_TOWN, Ptrs_TOWN, nullptr, CH_TABLE },
 
static const ChunkHandler HIDS{ 'HIDS', Save_HIDS, Load_HIDS, nullptr,   nullptr, CH_TABLE };
 
static const ChunkHandler CITY{ 'CITY', Save_TOWN, Load_TOWN, Ptrs_TOWN, nullptr, CH_TABLE };
 
static const ChunkHandlerRef town_chunk_handlers[] = {
 
	HIDS,
 
	CITY,
 
};
 

	
 
extern const ChunkHandlerTable _town_chunk_handlers(town_chunk_handlers);
src/saveload/vehicle_sl.cpp
Show inline comments
 
@@ -1064,8 +1064,9 @@ void Ptrs_VEHS()
 
	}
 
}
 

	
 
static const ChunkHandler veh_chunk_handlers[] = {
 
	{ 'VEHS', Save_VEHS, Load_VEHS, Ptrs_VEHS, nullptr, CH_SPARSE_TABLE },
 
static const ChunkHandler VEHS{ 'VEHS', Save_VEHS, Load_VEHS, Ptrs_VEHS, nullptr, CH_SPARSE_TABLE };
 
static const ChunkHandlerRef veh_chunk_handlers[] = {
 
	VEHS,
 
};
 

	
 
extern const ChunkHandlerTable _veh_chunk_handlers(veh_chunk_handlers);
src/saveload/waypoint_sl.cpp
Show inline comments
 
@@ -224,8 +224,9 @@ static void Ptrs_WAYP()
 
	}
 
}
 

	
 
static const ChunkHandler waypoint_chunk_handlers[] = {
 
	{ 'CHKP', nullptr, Load_WAYP, Ptrs_WAYP, nullptr, CH_READONLY },
 
static const ChunkHandler CHKP{ 'CHKP', nullptr, Load_WAYP, Ptrs_WAYP, nullptr, CH_READONLY };
 
static const ChunkHandlerRef waypoint_chunk_handlers[] = {
 
	CHKP,
 
};
 

	
 
extern const ChunkHandlerTable _waypoint_chunk_handlers(waypoint_chunk_handlers);
0 comments (0 inline, 0 general)