From eca73a810c19ed5cfb3f24cb5560d0735e19ea00 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 14 Aug 2021 18:28:35 +0200 Subject: [PATCH] Change: rebrand 1.12.0 to 12.0 One question that keeps popping up: "when do we release 2.0?". NewGRF will force that at least 1.16 will be 2.0, but to not wait for this, let's drop the "1." and be for ever done with that conversation. We are following in the footstep of giants here. --- CMakeLists.txt | 3 +-- bin/ai/CMakeLists.txt | 2 +- bin/ai/{compat_1.12.nut => compat_12.nut} | 0 bin/game/CMakeLists.txt | 2 +- bin/game/{compat_1.12.nut => compat_12.nut} | 0 cmake/scripts/FindVersion.cmake | 3 --- known-bugs.txt | 2 -- regression/regression/info.nut | 2 +- regression/stationlist/info.nut | 2 +- src/ai/ai_info.cpp | 2 +- src/game/game_info.cpp | 2 +- src/os/windows/ottdres.rc.in | 4 ++-- src/rev.cpp.in | 11 +++++++---- src/script/api/ai_changelog.hpp | 2 +- src/script/api/game_changelog.hpp | 2 +- src/script/api/script_controller.hpp | 15 ++++++++++++--- 16 files changed, 30 insertions(+), 24 deletions(-) rename bin/ai/{compat_1.12.nut => compat_12.nut} (100%) rename bin/game/{compat_1.12.nut => compat_12.nut} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36d504e105..37e8697e40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if(NOT BINARY_NAME) endif() project(${BINARY_NAME} - VERSION 1.12.0 + VERSION 12.0 ) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) @@ -76,7 +76,6 @@ add_custom_target(find_version -DCPACK_BINARY_DIR=${CMAKE_BINARY_DIR} -DREV_MAJOR=${PROJECT_VERSION_MAJOR} -DREV_MINOR=${PROJECT_VERSION_MINOR} - -DREV_BUILD=${PROJECT_VERSION_PATCH} -DWINDOWS=${WIN32} -P "${CMAKE_SOURCE_DIR}/cmake/scripts/FindVersion.cmake" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} diff --git a/bin/ai/CMakeLists.txt b/bin/ai/CMakeLists.txt index 83eb11962d..9417004fce 100644 --- a/bin/ai/CMakeLists.txt +++ b/bin/ai/CMakeLists.txt @@ -12,7 +12,7 @@ set(AI_COMPAT_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/compat_1.9.nut ${CMAKE_CURRENT_SOURCE_DIR}/compat_1.10.nut ${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut - ${CMAKE_CURRENT_SOURCE_DIR}/compat_1.12.nut + ${CMAKE_CURRENT_SOURCE_DIR}/compat_12.nut ) foreach(AI_COMPAT_SOURCE_FILE IN LISTS AI_COMPAT_SOURCE_FILES) diff --git a/bin/ai/compat_1.12.nut b/bin/ai/compat_12.nut similarity index 100% rename from bin/ai/compat_1.12.nut rename to bin/ai/compat_12.nut diff --git a/bin/game/CMakeLists.txt b/bin/game/CMakeLists.txt index 508254e1f2..55a992be32 100644 --- a/bin/game/CMakeLists.txt +++ b/bin/game/CMakeLists.txt @@ -9,7 +9,7 @@ set(GS_COMPAT_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/compat_1.9.nut ${CMAKE_CURRENT_SOURCE_DIR}/compat_1.10.nut ${CMAKE_CURRENT_SOURCE_DIR}/compat_1.11.nut - ${CMAKE_CURRENT_SOURCE_DIR}/compat_1.12.nut + ${CMAKE_CURRENT_SOURCE_DIR}/compat_12.nut ) foreach(GS_COMPAT_SOURCE_FILE IN LISTS GS_COMPAT_SOURCE_FILES) diff --git a/bin/game/compat_1.12.nut b/bin/game/compat_12.nut similarity index 100% rename from bin/game/compat_1.12.nut rename to bin/game/compat_12.nut diff --git a/cmake/scripts/FindVersion.cmake b/cmake/scripts/FindVersion.cmake index 43255e8011..c4ff99a7fd 100644 --- a/cmake/scripts/FindVersion.cmake +++ b/cmake/scripts/FindVersion.cmake @@ -6,9 +6,6 @@ endif() if(NOT REV_MINOR) set(REV_MINOR 0) endif() -if(NOT REV_BUILD) - set(REV_BUILD 0) -endif() # # Finds the current version of the current folder. diff --git a/known-bugs.txt b/known-bugs.txt index 4e9e3e9b5e..1b9a465af7 100644 --- a/known-bugs.txt +++ b/known-bugs.txt @@ -1,6 +1,4 @@ OpenTTD's known bugs -Last updated: 2021-04-01 -Release version: 1.11.0 ------------------------------------------------------------------------ diff --git a/regression/regression/info.nut b/regression/regression/info.nut index 50c9fa5146..1a52cfebbb 100644 --- a/regression/regression/info.nut +++ b/regression/regression/info.nut @@ -4,7 +4,7 @@ class Regression extends AIInfo { function GetShortName() { return "REGR"; } function GetDescription() { return "This runs regression-tests on some commands. On the same map the result should always be the same."; } function GetVersion() { return 1; } - function GetAPIVersion() { return "1.12"; } + function GetAPIVersion() { return "12"; } function GetDate() { return "2007-03-18"; } function CreateInstance() { return "Regression"; } function UseAsRandomAI() { return false; } diff --git a/regression/stationlist/info.nut b/regression/stationlist/info.nut index 0558ccc1fb..ad91c7645c 100644 --- a/regression/stationlist/info.nut +++ b/regression/stationlist/info.nut @@ -4,7 +4,7 @@ class StationList extends AIInfo { function GetShortName() { return "REGS"; } function GetDescription() { return "This runs stationlist-tests on some commands. On the same map the result should always be the same."; } function GetVersion() { return 1; } - function GetAPIVersion() { return "1.12"; } + function GetAPIVersion() { return "12"; } function GetDate() { return "2007-03-18"; } function CreateInstance() { return "StationList"; } function UseAsRandomAI() { return false; } diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp index 10d34ea58a..17ad012579 100644 --- a/src/ai/ai_info.cpp +++ b/src/ai/ai_info.cpp @@ -25,7 +25,7 @@ */ static bool CheckAPIVersion(const char *api_version) { - static const std::set versions = { "0.7", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "1.12" }; + static const std::set versions = { "0.7", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "12" }; return versions.find(api_version) != versions.end(); } diff --git a/src/game/game_info.cpp b/src/game/game_info.cpp index 60b4d0dcca..98818e8dd1 100644 --- a/src/game/game_info.cpp +++ b/src/game/game_info.cpp @@ -23,7 +23,7 @@ */ static bool CheckAPIVersion(const char *api_version) { - static const std::set versions = { "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "1.12" }; + static const std::set versions = { "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11", "12" }; return versions.find(api_version) != versions.end(); } diff --git a/src/os/windows/ottdres.rc.in b/src/os/windows/ottdres.rc.in index 31309382cf..279389a04c 100644 --- a/src/os/windows/ottdres.rc.in +++ b/src/os/windows/ottdres.rc.in @@ -77,8 +77,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION ${REV_MAJOR},${REV_MINOR},${REV_BUILD},${REV_ISODATE} - PRODUCTVERSION ${REV_MAJOR},${REV_MINOR},${REV_BUILD},${REV_ISODATE} + FILEVERSION ${REV_MAJOR},${REV_MINOR},0,${REV_ISODATE} + PRODUCTVERSION ${REV_MAJOR},${REV_MINOR},0,${REV_ISODATE} FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L diff --git a/src/rev.cpp.in b/src/rev.cpp.in index 3939ca5a0e..337519ee28 100644 --- a/src/rev.cpp.in +++ b/src/rev.cpp.in @@ -75,14 +75,17 @@ const byte _openttd_revision_tagged = ${REV_ISTAG}; /** * The NewGRF revision of OTTD: * bits meaning. - * 28-31 major version - * 24-27 minor version - * 20-23 build + * 24-31 major version + 16 + * 20-23 minor version * 19 1 if it is a release, 0 if it is not. * 0-18 used to be the SVN revision, now just last revision before switch to git * * The 19th bit is there so the development/betas/alpha, etc. leading to a * final release will always have a lower version number than the released * version, thus making comparisons on specific revisions easy. + * + * The + 16 for the major version is because we went from 1.11.0 to 12.0, dropping + * the "patch" part of the version. To make sure "1.11.0" is smaller than "12.0", we + * have to adjust the major by 16. */ -const uint32 _openttd_newgrf_version = ${REV_MAJOR} << 28 | ${REV_MINOR} << 24 | ${REV_BUILD} << 20 | ${REV_ISSTABLETAG} << 19 | 28004; +const uint32 _openttd_newgrf_version = (${REV_MAJOR} + 16) << 24 | ${REV_MINOR} << 20 | ${REV_ISSTABLETAG} << 19 | 28004; diff --git a/src/script/api/ai_changelog.hpp b/src/script/api/ai_changelog.hpp index 6e32838203..e5699a7d47 100644 --- a/src/script/api/ai_changelog.hpp +++ b/src/script/api/ai_changelog.hpp @@ -13,7 +13,7 @@ * functions may still be available if you return an older API version * in GetAPIVersion() in info.nut. * - * \b 1.12.0 + * \b 12.0 * * This version is not yet released. The following changes are not set in stone yet. * diff --git a/src/script/api/game_changelog.hpp b/src/script/api/game_changelog.hpp index 5d214efb12..d3efea9197 100644 --- a/src/script/api/game_changelog.hpp +++ b/src/script/api/game_changelog.hpp @@ -13,7 +13,7 @@ * functions may still be available if you return an older API version * in GetAPIVersion() in info.nut. * - * \b 1.12.0 + * \b 12.0 * * This version is not yet released. The following changes are not set in stone yet. * diff --git a/src/script/api/script_controller.hpp b/src/script/api/script_controller.hpp index 992a9ebf22..d0bb129e9d 100644 --- a/src/script/api/script_controller.hpp +++ b/src/script/api/script_controller.hpp @@ -135,11 +135,20 @@ public: /** * Get the OpenTTD version of this executable. The version is formatted * with the bits having the following meaning: - * 28-31 major version - * 24-27 minor version - * 20-23 build + * 24-31 major version + 16. + * 20-23 minor version. * 19 1 if it is a release, 0 if it is not. * 0-18 revision number; 0 when the revision is unknown. + * You have to subtract 16 from the major version to get the correct + * value. + * + * Prior to OpenTTD 12, the bits have the following meaning: + * 28-31 major version. + * 24-27 minor version. + * 20-23 build. + * 19 1 if it is a release, 0 if it is not. + * 0-18 revision number; 0 when the revision is unknown. + * * @return The version in newgrf format. */ static uint GetVersion();