From 4a36520ba2b9cb96df0b99fb7aedbe8a9aff831a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 10 Jan 2022 07:52:39 +0100 Subject: [PATCH] Fix #16408: Report extended version information (#16413) * Fix #16408: Report extended version information * Update distribution/changelog.txt Co-authored-by: Tulio Leao Co-authored-by: Tulio Leao --- distribution/changelog.txt | 1 + src/openrct2/cmdline/RootCommands.cpp | 15 +++++++++++++++ src/openrct2/park/ParkFile.cpp | 6 ------ src/openrct2/park/ParkFile.h | 6 ++++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 29df902608..674f1c37c7 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -18,6 +18,7 @@ - Improved: [#10664, #16072] Visibility status can be modified directly in the Tile Inspector's list. - Improved: [#16251] Plugin API handles null values better. - Improved: [#16258] Increased image limit in the engine. +- Improved: [#16408] Improve --version cli option to report more compatibility information. - Change: [#16077] When importing SV6 files, the RCT1 land types are only added when they were actually used. - Fix: [#15571] Non-ASCII characters in scenario description get distorted while saving. - Fix: [#15830] Objects with RCT1 images are very glitchy if OpenRCT2 is not linked to an RCT1 install. diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index 1cd38f9d82..e592636504 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -21,8 +21,10 @@ #include "../localisation/Language.h" #include "../network/network.h" #include "../object/ObjectRepository.h" +#include "../park/ParkFile.h" #include "../platform/Crash.h" #include "../platform/Platform2.h" +#include "../scripting/ScriptEngine.h" #include "CommandLine.hpp" #include @@ -456,6 +458,19 @@ static void PrintVersion() Console::WriteLine(buffer); Console::WriteFormat("%s (%s)", OPENRCT2_PLATFORM, OPENRCT2_ARCHITECTURE); Console::WriteLine(); + Console::WriteFormat("Network version: %s", network_get_version().c_str()); + Console::WriteLine(); +#ifdef ENABLE_SCRIPTING + Console::WriteFormat("Plugin API version: %d", OpenRCT2::Scripting::OPENRCT2_PLUGIN_API_VERSION); + Console::WriteLine(); +#else + Console::WriteFormat("Plugin API not enabled in this build"); + Console::WriteLine(); +#endif + Console::WriteFormat("Current park file version: %d", OpenRCT2::PARK_FILE_CURRENT_VERSION); + Console::WriteLine(); + Console::WriteFormat("Minimum park file version: %d", OpenRCT2::PARK_FILE_MIN_VERSION); + Console::WriteLine(); } static void PrintLaunchInformation() diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index ac67147ac4..0f143c70e4 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -65,12 +65,6 @@ using namespace OpenRCT2; namespace OpenRCT2 { - // Current version that is saved. - constexpr uint32_t PARK_FILE_CURRENT_VERSION = 0x8; - - // The minimum version that is forwards compatible with the current version. - constexpr uint32_t PARK_FILE_MIN_VERSION = 0x8; - namespace ParkFileChunkType { // clang-format off diff --git a/src/openrct2/park/ParkFile.h b/src/openrct2/park/ParkFile.h index 4ce953abf0..a58be99eb7 100644 --- a/src/openrct2/park/ParkFile.h +++ b/src/openrct2/park/ParkFile.h @@ -7,6 +7,12 @@ struct ObjectRepositoryItem; namespace OpenRCT2 { + // Current version that is saved. + constexpr uint32_t PARK_FILE_CURRENT_VERSION = 0x8; + + // The minimum version that is forwards compatible with the current version. + constexpr uint32_t PARK_FILE_MIN_VERSION = 0x8; + constexpr uint32_t PARK_FILE_MAGIC = 0x4B524150; // PARK struct IStream;