Extend industry production/transported totals to 32 bits
This commit is contained in:
@@ -193,6 +193,7 @@ const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
|
||||
{ XSLFI_VARIABLE_TICK_RATE, XSCF_IGNORABLE_ALL, 1, 1, "variable_tick_rate", nullptr, nullptr, nullptr },
|
||||
{ XSLFI_ROAD_VEH_FLAGS, XSCF_NULL, 1, 1, "road_veh_flags", nullptr, nullptr, nullptr },
|
||||
{ XSLFI_STATION_TILE_CACHE_FLAGS, XSCF_IGNORABLE_ALL, 1, 1, "station_tile_cache_flags", saveSTC, loadSTC, nullptr },
|
||||
{ XSLFI_INDUSTRY_CARGO_TOTALS, XSCF_NULL, 1, 1, "industry_cargo_totals", nullptr, nullptr, nullptr },
|
||||
|
||||
{ XSLFI_SCRIPT_INT64, XSCF_NULL, 1, 1, "script_int64", nullptr, nullptr, nullptr },
|
||||
{ XSLFI_U64_TICK_COUNTER, XSCF_NULL, 1, 1, "u64_tick_counter", nullptr, nullptr, nullptr },
|
||||
|
@@ -142,6 +142,7 @@ enum SlXvFeatureIndex {
|
||||
XSLFI_VARIABLE_TICK_RATE, ///< Variable tick rate
|
||||
XSLFI_ROAD_VEH_FLAGS, ///< Road vehicle flags
|
||||
XSLFI_STATION_TILE_CACHE_FLAGS, ///< Station tile cache flags
|
||||
XSLFI_INDUSTRY_CARGO_TOTALS, ///< Industry cargo totals are 32 bit
|
||||
|
||||
XSLFI_SCRIPT_INT64, ///< See: SLV_SCRIPT_INT64
|
||||
XSLFI_U64_TICK_COUNTER, ///< See: SLV_U64_TICK_COUNTER
|
||||
|
@@ -37,16 +37,20 @@ static const SaveLoad _industry_desc[] = {
|
||||
SLE_CONDARR(Industry, accepts_cargo, SLE_UINT8, 3, SLV_78, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR(Industry, accepts_cargo, SLE_UINT8, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION),
|
||||
SLE_VAR(Industry, prod_level, SLE_UINT8),
|
||||
SLE_CONDARR(Industry, this_month_production, SLE_UINT16, 2, SL_MIN_VERSION, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR(Industry, this_month_production, SLE_UINT16, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION),
|
||||
SLE_CONDARR(Industry, this_month_transported, SLE_UINT16, 2, SL_MIN_VERSION, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR(Industry, this_month_transported, SLE_UINT16, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION),
|
||||
SLE_CONDARR(Industry, last_month_pct_transported, SLE_UINT8, 2, SL_MIN_VERSION, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR(Industry, last_month_pct_transported, SLE_UINT8, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION),
|
||||
SLE_CONDARR(Industry, last_month_production, SLE_UINT16, 2, SL_MIN_VERSION, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR(Industry, last_month_production, SLE_UINT16, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION),
|
||||
SLE_CONDARR(Industry, last_month_transported, SLE_UINT16, 2, SL_MIN_VERSION, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR(Industry, last_month_transported, SLE_UINT16, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION),
|
||||
SLE_CONDARR(Industry, this_month_production, SLE_FILE_U16 | SLE_VAR_U32, 2, SL_MIN_VERSION, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR_X(Industry, this_month_production, SLE_FILE_U16 | SLE_VAR_U32, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_INDUSTRY_CARGO_TOTALS, 0, 0)),
|
||||
SLE_CONDARR_X(Industry, this_month_production, SLE_UINT32, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_INDUSTRY_CARGO_TOTALS, 1)),
|
||||
SLE_CONDARR(Industry, this_month_transported, SLE_FILE_U16 | SLE_VAR_U32, 2, SL_MIN_VERSION, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR_X(Industry, this_month_transported, SLE_FILE_U16 | SLE_VAR_U32, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_INDUSTRY_CARGO_TOTALS, 0, 0)),
|
||||
SLE_CONDARR_X(Industry, this_month_transported, SLE_UINT32, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_INDUSTRY_CARGO_TOTALS, 1)),
|
||||
SLE_CONDARR(Industry, last_month_pct_transported, SLE_UINT8, 2, SL_MIN_VERSION, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR(Industry, last_month_pct_transported, SLE_UINT8, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION),
|
||||
SLE_CONDARR(Industry, last_month_production, SLE_FILE_U16 | SLE_VAR_U32, 2, SL_MIN_VERSION, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR_X(Industry, last_month_production, SLE_FILE_U16 | SLE_VAR_U32, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_INDUSTRY_CARGO_TOTALS, 0, 0)),
|
||||
SLE_CONDARR_X(Industry, last_month_production, SLE_UINT32, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_INDUSTRY_CARGO_TOTALS, 1)),
|
||||
SLE_CONDARR(Industry, last_month_transported, SLE_FILE_U16 | SLE_VAR_U32, 2, SL_MIN_VERSION, SLV_EXTEND_INDUSTRY_CARGO_SLOTS),
|
||||
SLE_CONDARR_X(Industry, last_month_transported, SLE_FILE_U16 | SLE_VAR_U32, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_INDUSTRY_CARGO_TOTALS, 0, 0)),
|
||||
SLE_CONDARR_X(Industry, last_month_transported, SLE_UINT32, 16, SLV_EXTEND_INDUSTRY_CARGO_SLOTS, SL_MAX_VERSION, SlXvFeatureTest(XSLFTO_AND, XSLFI_INDUSTRY_CARGO_TOTALS, 1)),
|
||||
|
||||
SLE_VAR(Industry, counter, SLE_UINT16),
|
||||
|
||||
|
@@ -822,18 +822,18 @@ static const OldChunks industry_chunk[] = {
|
||||
|
||||
OCL_SVAR( OC_UINT8, Industry, prod_level ),
|
||||
|
||||
OCL_SVAR( OC_UINT16, Industry, this_month_production[0] ),
|
||||
OCL_SVAR( OC_UINT16, Industry, this_month_production[1] ),
|
||||
OCL_SVAR( OC_UINT16, Industry, this_month_transported[0] ),
|
||||
OCL_SVAR( OC_UINT16, Industry, this_month_transported[1] ),
|
||||
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Industry, this_month_production[0] ),
|
||||
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Industry, this_month_production[1] ),
|
||||
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Industry, this_month_transported[0] ),
|
||||
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Industry, this_month_transported[1] ),
|
||||
|
||||
OCL_SVAR( OC_UINT8, Industry, last_month_pct_transported[0] ),
|
||||
OCL_SVAR( OC_UINT8, Industry, last_month_pct_transported[1] ),
|
||||
|
||||
OCL_SVAR( OC_UINT16, Industry, last_month_production[0] ),
|
||||
OCL_SVAR( OC_UINT16, Industry, last_month_production[1] ),
|
||||
OCL_SVAR( OC_UINT16, Industry, last_month_transported[0] ),
|
||||
OCL_SVAR( OC_UINT16, Industry, last_month_transported[1] ),
|
||||
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Industry, last_month_production[0] ),
|
||||
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Industry, last_month_production[1] ),
|
||||
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Industry, last_month_transported[0] ),
|
||||
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Industry, last_month_transported[1] ),
|
||||
|
||||
OCL_SVAR( OC_UINT8, Industry, type ),
|
||||
OCL_SVAR( OC_TTO | OC_FILE_U8 | OC_VAR_U16, Industry, counter ),
|
||||
|
Reference in New Issue
Block a user