From 6f68ac46b8c603b23123b5d899afa6988836f497 Mon Sep 17 00:00:00 2001 From: celestar Date: Tue, 13 Feb 2007 12:34:54 +0000 Subject: [PATCH] (svn r8705) -Codechange: Increased the number of airport blocks to 64. This involves changing the enum of airport blocks to a static const uint64 as SOME platforms do not support 64-bit enums --- src/airport.h | 5 ++--- src/airport_movement.h | 2 +- src/saveload.cpp | 2 +- src/station.h | 3 +-- src/station_cmd.cpp | 5 +++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/airport.h b/src/airport.h index 1b515da5cd..ab1b110751 100644 --- a/src/airport.h +++ b/src/airport.h @@ -77,7 +77,7 @@ enum { /* Movement Blocks on Airports */ // blocks (eg_airport_flags) -enum { +static const uint64 TERM1_block = 1 << 0, TERM2_block = 1 << 1, TERM3_block = 1 << 2, @@ -119,8 +119,7 @@ enum { OUT_WAY_block2 = 1 << 31, // end of new blocks - NOTHING_block = 1 << 30 -}; + NOTHING_block = 1 << 30; typedef struct AirportMovingData { int16 x; diff --git a/src/airport_movement.h b/src/airport_movement.h index 4892a4f32b..1b225c808b 100644 --- a/src/airport_movement.h +++ b/src/airport_movement.h @@ -9,7 +9,7 @@ typedef struct AirportFTAbuildup { byte position; // the position that an airplane is at byte heading; // the current orders (eg. TAKEOFF, HANGAR, ENDLANDING, etc.) - uint32 block; // the block this position is on on the airport (st->airport_flags) + uint64 block; // the block this position is on on the airport (st->airport_flags) byte next; // next position from this position } AirportFTAbuildup; diff --git a/src/saveload.cpp b/src/saveload.cpp index d694d54879..4335b2da45 100644 --- a/src/saveload.cpp +++ b/src/saveload.cpp @@ -30,7 +30,7 @@ #include "variables.h" #include -extern const uint16 SAVEGAME_VERSION = 45; +extern const uint16 SAVEGAME_VERSION = 46; uint16 _sl_version; /// the major savegame version identifier byte _sl_minor_version; /// the minor savegame version, DO NOT USE! diff --git a/src/station.h b/src/station.h index d9f6d0c32d..40d5297efd 100644 --- a/src/station.h +++ b/src/station.h @@ -139,8 +139,7 @@ struct Station { Date build_date; - //uint16 airport_flags; - uint32 airport_flags; + uint64 airport_flags; /// stores which blocks on the airport are taken. was 16 bit earlier on, then 32 StationID index; byte last_vehicle_type; diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index d994aa7ee4..ac597e27b8 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2855,8 +2855,9 @@ static const SaveLoad _station_desc[] = { SLE_CONDNULL(2, 0, 5), // Truck/bus stop status SLE_CONDNULL(1, 0, 4), // Blocked months - SLE_CONDVAR(Station, airport_flags, SLE_VAR_U32 | SLE_FILE_U16, 0, 2), - SLE_CONDVAR(Station, airport_flags, SLE_UINT32, 3, SL_MAX_VERSION), + SLE_CONDVAR(Station, airport_flags, SLE_VAR_U64 | SLE_FILE_U16, 0, 2), + SLE_CONDVAR(Station, airport_flags, SLE_VAR_U64 | SLE_FILE_U32, 3, 45), + SLE_CONDVAR(Station, airport_flags, SLE_UINT64, 46, SL_MAX_VERSION), SLE_CONDNULL(2, 0, 25), /* Ex last-vehicle */ SLE_CONDVAR(Station, last_vehicle_type, SLE_UINT8, 26, SL_MAX_VERSION),