From 08f01799160d91f19764aa4358231e966dee2dc6 Mon Sep 17 00:00:00 2001 From: frosch Date: Thu, 6 Mar 2008 14:21:10 +0000 Subject: (svn r12347) -Feature(ette): Increase house animation frame number from 32 to 128. --- src/openttd.cpp | 9 +++++++++ src/saveload.cpp | 2 +- src/town_map.h | 5 +++-- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/openttd.cpp b/src/openttd.cpp index 66dd0d3a5..98975a36d 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -2431,6 +2431,15 @@ bool AfterLoadGame() } } + if (CheckSavegameVersion(91)) { + /* Increase HouseAnimationFrame from 5 to 7 bits */ + for (TileIndex t = 0; t < map_size; t++) { + if (IsTileType(t, MP_HOUSE) && GetHouseType(t) >= NEW_HOUSE_OFFSET) { + SetHouseAnimationFrame(t, GB(_m[t].m6, 3, 5)); + } + } + } + return InitializeWindowsAndCaches(); } diff --git a/src/saveload.cpp b/src/saveload.cpp index 1e55d1e86..9726e8872 100644 --- a/src/saveload.cpp +++ b/src/saveload.cpp @@ -34,7 +34,7 @@ #include "table/strings.h" -extern const uint16 SAVEGAME_VERSION = 90; +extern const uint16 SAVEGAME_VERSION = 91; uint16 _sl_version; ///< the major savegame version identifier byte _sl_minor_version; ///< the minor savegame version, DO NOT USE! diff --git a/src/town_map.h b/src/town_map.h index 4960522ce..11fbb1318 100644 --- a/src/town_map.h +++ b/src/town_map.h @@ -145,7 +145,7 @@ static inline void SetLiftPosition(TileIndex t, byte pos) static inline byte GetHouseAnimationFrame(TileIndex t) { assert(IsTileType(t, MP_HOUSE)); - return GB(_m[t].m6, 3, 5); + return GB(_m[t].m6, 2, 6) | (GB(_m[t].m3, 5, 1) << 6); } /** @@ -157,7 +157,8 @@ static inline byte GetHouseAnimationFrame(TileIndex t) static inline void SetHouseAnimationFrame(TileIndex t, byte frame) { assert(IsTileType(t, MP_HOUSE)); - SB(_m[t].m6, 3, 5, frame); + SB(_m[t].m6, 2, 6, GB(frame, 0, 6)); + SB(_m[t].m3, 5, 1, GB(frame, 6, 1)); } /** -- cgit v1.2.3-70-g09d2