Add save/load support for train speed adaptation
This commit is contained in:
@@ -479,6 +479,7 @@ add_files(
|
|||||||
train.h
|
train.h
|
||||||
train_cmd.cpp
|
train_cmd.cpp
|
||||||
train_gui.cpp
|
train_gui.cpp
|
||||||
|
train_speed_adaptation.h
|
||||||
transparency.h
|
transparency.h
|
||||||
transparency_gui.cpp
|
transparency_gui.cpp
|
||||||
transparency_gui.h
|
transparency_gui.h
|
||||||
|
@@ -48,6 +48,7 @@ add_files(
|
|||||||
tbtr_template_veh_sl.cpp
|
tbtr_template_veh_sl.cpp
|
||||||
town_sl.cpp
|
town_sl.cpp
|
||||||
tracerestrict_sl.cpp
|
tracerestrict_sl.cpp
|
||||||
|
train_speed_adaptation.cpp
|
||||||
tunnel_sl.cpp
|
tunnel_sl.cpp
|
||||||
vehicle_sl.cpp
|
vehicle_sl.cpp
|
||||||
waypoint_sl.cpp
|
waypoint_sl.cpp
|
||||||
|
@@ -151,6 +151,7 @@ const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
|
|||||||
{ XSLFI_WATER_FLOODING, XSCF_NULL, 2, 2, "water_flooding", nullptr, nullptr, nullptr },
|
{ XSLFI_WATER_FLOODING, XSCF_NULL, 2, 2, "water_flooding", nullptr, nullptr, nullptr },
|
||||||
{ XSLFI_MORE_HOUSES, XSCF_NULL, 2, 2, "more_houses", nullptr, nullptr, nullptr },
|
{ XSLFI_MORE_HOUSES, XSCF_NULL, 2, 2, "more_houses", nullptr, nullptr, nullptr },
|
||||||
{ XSLFI_CUSTOM_TOWN_ZONE, XSCF_IGNORABLE_UNKNOWN, 1, 1, "custom_town_zone", nullptr, nullptr, nullptr },
|
{ XSLFI_CUSTOM_TOWN_ZONE, XSCF_IGNORABLE_UNKNOWN, 1, 1, "custom_town_zone", nullptr, nullptr, nullptr },
|
||||||
|
{ XSLFI_TRAIN_SPEED_ADAPTATION, XSCF_NULL, 1, 1, "train_speed_adaptation", nullptr, nullptr, "TSAS" },
|
||||||
{ XSLFI_NULL, XSCF_NULL, 0, 0, nullptr, nullptr, nullptr, nullptr },// This is the end marker
|
{ XSLFI_NULL, XSCF_NULL, 0, 0, nullptr, nullptr, nullptr, nullptr },// This is the end marker
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -105,6 +105,7 @@ enum SlXvFeatureIndex {
|
|||||||
XSLFI_WATER_FLOODING, ///< Water flooding map bit
|
XSLFI_WATER_FLOODING, ///< Water flooding map bit
|
||||||
XSLFI_MORE_HOUSES, ///< More house types
|
XSLFI_MORE_HOUSES, ///< More house types
|
||||||
XSLFI_CUSTOM_TOWN_ZONE, ///< Custom town zones
|
XSLFI_CUSTOM_TOWN_ZONE, ///< Custom town zones
|
||||||
|
XSLFI_TRAIN_SPEED_ADAPTATION, ///< Train speed adaptation
|
||||||
|
|
||||||
XSLFI_RIFF_HEADER_60_BIT, ///< Size field in RIFF chunk header is 60 bit
|
XSLFI_RIFF_HEADER_60_BIT, ///< Size field in RIFF chunk header is 60 bit
|
||||||
XSLFI_HEIGHT_8_BIT, ///< Map tile height is 8 bit instead of 4 bit, but savegame version may be before this became true in trunk
|
XSLFI_HEIGHT_8_BIT, ///< Map tile height is 8 bit instead of 4 bit, but savegame version may be before this became true in trunk
|
||||||
|
@@ -288,6 +288,7 @@ extern const ChunkHandler _template_replacement_chunk_handlers[];
|
|||||||
extern const ChunkHandler _template_vehicle_chunk_handlers[];
|
extern const ChunkHandler _template_vehicle_chunk_handlers[];
|
||||||
extern const ChunkHandler _bridge_signal_chunk_handlers[];
|
extern const ChunkHandler _bridge_signal_chunk_handlers[];
|
||||||
extern const ChunkHandler _tunnel_chunk_handlers[];
|
extern const ChunkHandler _tunnel_chunk_handlers[];
|
||||||
|
extern const ChunkHandler _train_speed_adaptation_chunk_handlers[];
|
||||||
extern const ChunkHandler _debug_chunk_handlers[];
|
extern const ChunkHandler _debug_chunk_handlers[];
|
||||||
|
|
||||||
/** Array of all chunks in a savegame, \c nullptr terminated. */
|
/** Array of all chunks in a savegame, \c nullptr terminated. */
|
||||||
@@ -333,6 +334,7 @@ static const ChunkHandler * const _chunk_handlers[] = {
|
|||||||
_template_vehicle_chunk_handlers,
|
_template_vehicle_chunk_handlers,
|
||||||
_bridge_signal_chunk_handlers,
|
_bridge_signal_chunk_handlers,
|
||||||
_tunnel_chunk_handlers,
|
_tunnel_chunk_handlers,
|
||||||
|
_train_speed_adaptation_chunk_handlers,
|
||||||
_debug_chunk_handlers,
|
_debug_chunk_handlers,
|
||||||
nullptr,
|
nullptr,
|
||||||
};
|
};
|
||||||
|
@@ -807,6 +807,7 @@ const SaveLoad *GetVehicleDescription(VehicleType vt)
|
|||||||
SLE_CONDNULL(11, SLV_2, SLV_144), // old reserved space
|
SLE_CONDNULL(11, SLV_2, SLV_144), // old reserved space
|
||||||
SLE_CONDVAR_X(Train, reverse_distance, SLE_UINT16, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REVERSE_AT_WAYPOINT)),
|
SLE_CONDVAR_X(Train, reverse_distance, SLE_UINT16, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_REVERSE_AT_WAYPOINT)),
|
||||||
SLE_CONDVAR_X(Train, speed_restriction, SLE_UINT16, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPEED_RESTRICTION)),
|
SLE_CONDVAR_X(Train, speed_restriction, SLE_UINT16, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_SPEED_RESTRICTION)),
|
||||||
|
SLE_CONDVAR_X(Train, signal_speed_restriction, SLE_UINT16, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_TRAIN_SPEED_ADAPTATION)),
|
||||||
SLE_CONDVAR_X(Train, critical_breakdown_count, SLE_UINT8, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_IMPROVED_BREAKDOWNS, 2)),
|
SLE_CONDVAR_X(Train, critical_breakdown_count, SLE_UINT8, SL_MIN_VERSION, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_IMPROVED_BREAKDOWNS, 2)),
|
||||||
|
|
||||||
SLE_END()
|
SLE_END()
|
||||||
|
Reference in New Issue
Block a user