diff options
author | rubidium <rubidium@openttd.org> | 2009-07-25 08:54:19 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-07-25 08:54:19 +0000 |
commit | 7440ec7a7350051297439f58f30d63f02018a507 (patch) | |
tree | 5d23745781a128a5644c0169ea0d7eb8913f9e38 /src/saveload | |
parent | 59c48fee8bda56a788310f6d83b99087d518fb0f (diff) | |
download | openttd-7440ec7a7350051297439f58f30d63f02018a507.tar.xz |
(svn r16947) -Codechange: use TileArea instead of train_tile, trainst_w and trainst_h.
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 20 | ||||
-rw-r--r-- | src/saveload/oldloader_sl.cpp | 4 | ||||
-rw-r--r-- | src/saveload/station_sl.cpp | 14 |
3 files changed, 19 insertions, 19 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 5f99ca61b..fd0c016b2 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -387,17 +387,17 @@ bool AfterLoadGame() if (CheckSavegameVersion(2)) { Station *st; FOR_ALL_STATIONS(st) { - if (st->train_tile != 0 && st->trainst_h == 0) { + if (st->train_station.tile != 0 && st->train_station.h == 0) { uint n = _savegame_type == SGT_OTTD ? 4 : 3; // OTTD uses 4 bits per dimensions, TTD 3 bits - uint w = GB(st->trainst_w, n, n); - uint h = GB(st->trainst_w, 0, n); + uint w = GB(st->train_station.w, n, n); + uint h = GB(st->train_station.w, 0, n); - if (GetRailStationAxis(st->train_tile) != AXIS_X) Swap(w, h); + if (GetRailStationAxis(st->train_station.tile) != AXIS_X) Swap(w, h); - st->trainst_w = w; - st->trainst_h = h; + st->train_station.w = w; + st->train_station.h = h; - assert(GetStationIndex(st->train_tile + TileDiffXY(w - 1, h - 1)) == st->index); + assert(GetStationIndex(st->train_station.tile + TileDiffXY(w - 1, h - 1)) == st->index); } } } @@ -452,9 +452,9 @@ bool AfterLoadGame() /* no station is determined by 'tile == INVALID_TILE' now (instead of '0') */ Station *st; FOR_ALL_STATIONS(st) { - if (st->airport_tile == 0) st->airport_tile = INVALID_TILE; - if (st->dock_tile == 0) st->dock_tile = INVALID_TILE; - if (st->train_tile == 0) st->train_tile = INVALID_TILE; + if (st->airport_tile == 0) st->airport_tile = INVALID_TILE; + if (st->dock_tile == 0) st->dock_tile = INVALID_TILE; + if (st->train_station.tile == 0) st->train_station.tile = INVALID_TILE; } /* the same applies to Company::location_of_HQ */ diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index 086d16d58..ed7fe2551 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -772,10 +772,10 @@ static const OldChunks station_chunk[] = { OCL_VAR ( OC_UINT32, 1, &_old_town_index ), OCL_NULL( 4 ), ///< bus/lorry tile - OCL_SVAR( OC_TILE, Station, train_tile ), + OCL_SVAR( OC_TILE, Station, train_station.tile ), OCL_SVAR( OC_TILE, Station, airport_tile ), OCL_SVAR( OC_TILE, Station, dock_tile ), - OCL_SVAR( OC_UINT8, Station, trainst_w ), + OCL_SVAR( OC_UINT8, Station, train_station.w ), OCL_NULL( 1 ), ///< sort-index, no longer in use OCL_NULL( 2 ), ///< sign-width, no longer in use diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index cb6cf1733..72c8f9aae 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -123,15 +123,15 @@ static const SaveLoad _old_station_desc[] = { SLE_CONDVAR(Station, xy, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), SLE_CONDVAR(Station, xy, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDNULL(4, 0, 5), ///< bus/lorry tile - SLE_CONDVAR(Station, train_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), - SLE_CONDVAR(Station, train_tile, SLE_UINT32, 6, SL_MAX_VERSION), + SLE_CONDVAR(Station, train_station.tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), + SLE_CONDVAR(Station, train_station.tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Station, airport_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), SLE_CONDVAR(Station, airport_tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_CONDVAR(Station, dock_tile, SLE_FILE_U16 | SLE_VAR_U32, 0, 5), SLE_CONDVAR(Station, dock_tile, SLE_UINT32, 6, SL_MAX_VERSION), SLE_REF(Station, town, REF_TOWN), - SLE_VAR(Station, trainst_w, SLE_UINT8), - SLE_CONDVAR(Station, trainst_h, SLE_UINT8, 2, SL_MAX_VERSION), + SLE_VAR(Station, train_station.w, SLE_UINT8), + SLE_CONDVAR(Station, train_station.h, SLE_UINT8, 2, SL_MAX_VERSION), SLE_CONDNULL(1, 0, 3), ///< alpha_order @@ -299,9 +299,9 @@ static const SaveLoad _station_desc[] = { SLE_WRITEBYTE(Station, facilities, FACIL_NONE), SLE_ST_INCLUDE(), - SLE_VAR(Station, train_tile, SLE_UINT32), - SLE_VAR(Station, trainst_w, SLE_UINT8), - SLE_VAR(Station, trainst_h, SLE_UINT8), + SLE_VAR(Station, train_station.tile, SLE_UINT32), + SLE_VAR(Station, train_station.w, SLE_UINT8), + SLE_VAR(Station, train_station.h, SLE_UINT8), SLE_REF(Station, bus_stops, REF_ROADSTOPS), SLE_REF(Station, truck_stops, REF_ROADSTOPS), |