diff --git a/core/SCsub b/core/SCsub index c847f50c404..778ae5ea7c3 100644 --- a/core/SCsub +++ b/core/SCsub @@ -181,17 +181,17 @@ def version_info_builder(target, source, env): with methods.generated_wrapper(str(target[0])) as file: file.write( """\ -#define VERSION_SHORT_NAME "{short_name}" -#define VERSION_NAME "{name}" -#define VERSION_MAJOR {major} -#define VERSION_MINOR {minor} -#define VERSION_PATCH {patch} -#define VERSION_STATUS "{status}" -#define VERSION_BUILD "{build}" -#define VERSION_MODULE_CONFIG "{module_config}" -#define VERSION_WEBSITE "{website}" -#define VERSION_DOCS_BRANCH "{docs_branch}" -#define VERSION_DOCS_URL "https://docs.godotengine.org/en/" VERSION_DOCS_BRANCH +#define GODOT_VERSION_SHORT_NAME "{short_name}" +#define GODOT_VERSION_NAME "{name}" +#define GODOT_VERSION_MAJOR {major} +#define GODOT_VERSION_MINOR {minor} +#define GODOT_VERSION_PATCH {patch} +#define GODOT_VERSION_STATUS "{status}" +#define GODOT_VERSION_BUILD "{build}" +#define GODOT_VERSION_MODULE_CONFIG "{module_config}" +#define GODOT_VERSION_WEBSITE "{website}" +#define GODOT_VERSION_DOCS_BRANCH "{docs_branch}" +#define GODOT_VERSION_DOCS_URL "https://docs.godotengine.org/en/" GODOT_VERSION_DOCS_BRANCH """.format(**source[0].read()) ) @@ -210,8 +210,8 @@ def version_hash_builder(target, source, env): """\ #include "core/version.h" -const char *const VERSION_HASH = "{git_hash}"; -const uint64_t VERSION_TIMESTAMP = {git_timestamp}; +const char *const GODOT_VERSION_HASH = "{git_hash}"; +const uint64_t GODOT_VERSION_TIMESTAMP = {git_timestamp}; """.format(**source[0].read()) ) diff --git a/core/config/engine.cpp b/core/config/engine.cpp index 402e6281ce4..0f7ead2f76e 100644 --- a/core/config/engine.cpp +++ b/core/config/engine.cpp @@ -125,17 +125,17 @@ double Engine::get_unfrozen_time_scale() const { Dictionary Engine::get_version_info() const { Dictionary dict; - dict["major"] = VERSION_MAJOR; - dict["minor"] = VERSION_MINOR; - dict["patch"] = VERSION_PATCH; - dict["hex"] = VERSION_HEX; - dict["status"] = VERSION_STATUS; - dict["build"] = VERSION_BUILD; + dict["major"] = GODOT_VERSION_MAJOR; + dict["minor"] = GODOT_VERSION_MINOR; + dict["patch"] = GODOT_VERSION_PATCH; + dict["hex"] = GODOT_VERSION_HEX; + dict["status"] = GODOT_VERSION_STATUS; + dict["build"] = GODOT_VERSION_BUILD; - String hash = String(VERSION_HASH); + String hash = String(GODOT_VERSION_HASH); dict["hash"] = hash.is_empty() ? String("unknown") : hash; - dict["timestamp"] = VERSION_TIMESTAMP; + dict["timestamp"] = GODOT_VERSION_TIMESTAMP; String stringver = String(dict["major"]) + "." + String(dict["minor"]); if ((int)dict["patch"] != 0) { diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 8183c7737bc..48f89ca0ad9 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -77,7 +77,7 @@ String ProjectSettings::get_imported_files_path() const { // This is used by the project manager to provide the initial_settings for config/features. const PackedStringArray ProjectSettings::get_required_features() { PackedStringArray features; - features.append(VERSION_BRANCH); + features.append(GODOT_VERSION_BRANCH); #ifdef REAL_T_IS_DOUBLE features.append("Double Precision"); #endif @@ -92,9 +92,9 @@ const PackedStringArray ProjectSettings::_get_supported_features() { #endif // Allow pinning to a specific patch number or build type by marking // them as supported. They're only used if the user adds them manually. - features.append(VERSION_BRANCH "." _MKSTR(VERSION_PATCH)); - features.append(VERSION_FULL_CONFIG); - features.append(VERSION_FULL_BUILD); + features.append(GODOT_VERSION_BRANCH "." _MKSTR(GODOT_VERSION_PATCH)); + features.append(GODOT_VERSION_FULL_CONFIG); + features.append(GODOT_VERSION_FULL_BUILD); #ifdef RD_ENABLED features.append("Forward Plus"); diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp index 315a5d874e9..f9b99011228 100644 --- a/core/extension/extension_api_dump.cpp +++ b/core/extension/extension_api_dump.cpp @@ -106,16 +106,16 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) { { //header Dictionary header; - header["version_major"] = VERSION_MAJOR; - header["version_minor"] = VERSION_MINOR; -#if VERSION_PATCH - header["version_patch"] = VERSION_PATCH; + header["version_major"] = GODOT_VERSION_MAJOR; + header["version_minor"] = GODOT_VERSION_MINOR; +#if GODOT_VERSION_PATCH + header["version_patch"] = GODOT_VERSION_PATCH; #else header["version_patch"] = 0; #endif - header["version_status"] = VERSION_STATUS; - header["version_build"] = VERSION_BUILD; - header["version_full_name"] = VERSION_FULL_NAME; + header["version_status"] = GODOT_VERSION_STATUS; + header["version_build"] = GODOT_VERSION_BUILD; + header["version_full_name"] = GODOT_VERSION_FULL_NAME; #if REAL_T_IS_DOUBLE header["precision"] = "double"; @@ -1603,8 +1603,8 @@ Error GDExtensionAPIDump::validate_extension_json_file(const String &p_path) { int major = header["version_major"]; int minor = header["version_minor"]; - ERR_FAIL_COND_V_MSG(major != VERSION_MAJOR, ERR_INVALID_DATA, vformat("JSON API dump is for a different engine version (%d) than this one (%d)", major, VERSION_MAJOR)); - ERR_FAIL_COND_V_MSG(minor > VERSION_MINOR, ERR_INVALID_DATA, vformat("JSON API dump is for a newer version of the engine: %d.%d", major, minor)); + ERR_FAIL_COND_V_MSG(major != GODOT_VERSION_MAJOR, ERR_INVALID_DATA, vformat("JSON API dump is for a different engine version (%d) than this one (%d)", major, GODOT_VERSION_MAJOR)); + ERR_FAIL_COND_V_MSG(minor > GODOT_VERSION_MINOR, ERR_INVALID_DATA, vformat("JSON API dump is for a newer version of the engine: %d.%d", major, minor)); } bool failed = false; diff --git a/core/extension/gdextension_interface.cpp b/core/extension/gdextension_interface.cpp index 4ab9849404e..36eda9d82d5 100644 --- a/core/extension/gdextension_interface.cpp +++ b/core/extension/gdextension_interface.cpp @@ -243,23 +243,23 @@ GDExtensionInterfaceFunctionPtr gdextension_get_proc_address(const char *p_name) #ifndef DISABLE_DEPRECATED static void gdextension_get_godot_version(GDExtensionGodotVersion *r_godot_version) { - r_godot_version->major = VERSION_MAJOR; - r_godot_version->minor = VERSION_MINOR; - r_godot_version->patch = VERSION_PATCH; - r_godot_version->string = VERSION_FULL_NAME; + r_godot_version->major = GODOT_VERSION_MAJOR; + r_godot_version->minor = GODOT_VERSION_MINOR; + r_godot_version->patch = GODOT_VERSION_PATCH; + r_godot_version->string = GODOT_VERSION_FULL_NAME; } #endif static void gdextension_get_godot_version2(GDExtensionGodotVersion2 *r_godot_version) { - r_godot_version->major = VERSION_MAJOR; - r_godot_version->minor = VERSION_MINOR; - r_godot_version->patch = VERSION_PATCH; - r_godot_version->hex = VERSION_HEX; - r_godot_version->status = VERSION_STATUS; - r_godot_version->build = VERSION_BUILD; - r_godot_version->hash = VERSION_HASH; - r_godot_version->timestamp = VERSION_TIMESTAMP; - r_godot_version->string = VERSION_FULL_NAME; + r_godot_version->major = GODOT_VERSION_MAJOR; + r_godot_version->minor = GODOT_VERSION_MINOR; + r_godot_version->patch = GODOT_VERSION_PATCH; + r_godot_version->hex = GODOT_VERSION_HEX; + r_godot_version->status = GODOT_VERSION_STATUS; + r_godot_version->build = GODOT_VERSION_BUILD; + r_godot_version->hash = GODOT_VERSION_HASH; + r_godot_version->timestamp = GODOT_VERSION_TIMESTAMP; + r_godot_version->string = GODOT_VERSION_FULL_NAME; } // Memory Functions diff --git a/core/extension/gdextension_library_loader.cpp b/core/extension/gdextension_library_loader.cpp index 17200916baf..1d6be752ce2 100644 --- a/core/extension/gdextension_library_loader.cpp +++ b/core/extension/gdextension_library_loader.cpp @@ -307,12 +307,12 @@ Error GDExtensionLibraryLoader::parse_gdextension_file(const String &p_path) { bool compatible = true; // Check version lexicographically. - if (VERSION_MAJOR != compatibility_minimum[0]) { - compatible = VERSION_MAJOR > compatibility_minimum[0]; - } else if (VERSION_MINOR != compatibility_minimum[1]) { - compatible = VERSION_MINOR > compatibility_minimum[1]; + if (GODOT_VERSION_MAJOR != compatibility_minimum[0]) { + compatible = GODOT_VERSION_MAJOR > compatibility_minimum[0]; + } else if (GODOT_VERSION_MINOR != compatibility_minimum[1]) { + compatible = GODOT_VERSION_MINOR > compatibility_minimum[1]; } else { - compatible = VERSION_PATCH >= compatibility_minimum[2]; + compatible = GODOT_VERSION_PATCH >= compatibility_minimum[2]; } if (!compatible) { ERR_PRINT(vformat("GDExtension only compatible with Godot version %d.%d.%d or later: %s", compatibility_minimum[0], compatibility_minimum[1], compatibility_minimum[2], p_path)); @@ -334,15 +334,15 @@ Error GDExtensionLibraryLoader::parse_gdextension_file(const String &p_path) { } compatible = true; - if (VERSION_MAJOR != compatibility_maximum[0]) { - compatible = VERSION_MAJOR < compatibility_maximum[0]; - } else if (VERSION_MINOR != compatibility_maximum[1]) { - compatible = VERSION_MINOR < compatibility_maximum[1]; + if (GODOT_VERSION_MAJOR != compatibility_maximum[0]) { + compatible = GODOT_VERSION_MAJOR < compatibility_maximum[0]; + } else if (GODOT_VERSION_MINOR != compatibility_maximum[1]) { + compatible = GODOT_VERSION_MINOR < compatibility_maximum[1]; } -#if VERSION_PATCH +#if GODOT_VERSION_PATCH // #if check to avoid -Wtype-limits warning when 0. else { - compatible = VERSION_PATCH <= compatibility_maximum[2]; + compatible = GODOT_VERSION_PATCH <= compatibility_maximum[2]; } #endif diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 3fba2c70679..ee901850a09 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -264,7 +264,7 @@ bool PackedSourcePCK::try_open_pack(const String &p_path, bool p_replace_files, f->get_32(); // patch number, not used for validation. ERR_FAIL_COND_V_MSG(version != PACK_FORMAT_VERSION, false, vformat("Pack version unsupported: %d.", version)); - ERR_FAIL_COND_V_MSG(ver_major > VERSION_MAJOR || (ver_major == VERSION_MAJOR && ver_minor > VERSION_MINOR), false, vformat("Pack created with a newer version of the engine: %d.%d.", ver_major, ver_minor)); + ERR_FAIL_COND_V_MSG(ver_major > GODOT_VERSION_MAJOR || (ver_major == GODOT_VERSION_MAJOR && ver_minor > GODOT_VERSION_MINOR), false, vformat("Pack created with a newer version of the engine: %d.%d.", ver_major, ver_minor)); uint32_t pack_flags = f->get_32(); uint64_t file_base = f->get_64(); diff --git a/core/io/http_client_tcp.cpp b/core/io/http_client_tcp.cpp index b66ecb0ec07..0054c45c1b4 100644 --- a/core/io/http_client_tcp.cpp +++ b/core/io/http_client_tcp.cpp @@ -196,7 +196,7 @@ Error HTTPClientTCP::request(Method p_method, const String &p_url, const Vector< // Should it add utf8 encoding? } if (add_uagent) { - request += "User-Agent: GodotEngine/" + String(VERSION_FULL_BUILD) + " (" + OS::get_singleton()->get_name() + ")\r\n"; + request += "User-Agent: GodotEngine/" + String(GODOT_VERSION_FULL_BUILD) + " (" + OS::get_singleton()->get_name() + ")\r\n"; } if (add_accept) { request += "Accept: */*\r\n"; diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp index c7cfca190d7..ae1f4bc93d7 100644 --- a/core/io/pck_packer.cpp +++ b/core/io/pck_packer.cpp @@ -91,9 +91,9 @@ Error PCKPacker::pck_start(const String &p_pck_path, int p_alignment, const Stri file->store_32(PACK_HEADER_MAGIC); file->store_32(PACK_FORMAT_VERSION); - file->store_32(VERSION_MAJOR); - file->store_32(VERSION_MINOR); - file->store_32(VERSION_PATCH); + file->store_32(GODOT_VERSION_MAJOR); + file->store_32(GODOT_VERSION_MINOR); + file->store_32(GODOT_VERSION_PATCH); uint32_t pack_flags = 0; if (enc_dir) { diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 891510e3dc0..3f570332dde 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -1028,10 +1028,10 @@ void ResourceLoaderBinary::open(Ref p_f, bool p_no_resources, bool p print_bl("minor: " + itos(ver_minor)); print_bl("format: " + itos(ver_format)); - if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) { + if (ver_format > FORMAT_VERSION || ver_major > GODOT_VERSION_MAJOR) { f.unref(); ERR_FAIL_MSG(vformat("File '%s' can't be loaded, as it uses a format version (%d) or engine version (%d.%d) which are not supported by your engine version (%s).", - local_path, ver_format, ver_major, ver_minor, VERSION_BRANCH)); + local_path, ver_format, ver_major, ver_minor, GODOT_VERSION_BRANCH)); } type = get_unicode_string(); @@ -1155,7 +1155,7 @@ String ResourceLoaderBinary::recognize(Ref p_f) { f->get_32(); // ver_minor uint32_t ver_fmt = f->get_32(); - if (ver_fmt > FORMAT_VERSION || ver_major > VERSION_MAJOR) { + if (ver_fmt > FORMAT_VERSION || ver_major > GODOT_VERSION_MAJOR) { f.unref(); return ""; } @@ -1196,7 +1196,7 @@ String ResourceLoaderBinary::recognize_script_class(Ref p_f) { f->get_32(); // ver_minor uint32_t ver_fmt = f->get_32(); - if (ver_fmt > FORMAT_VERSION || ver_major > VERSION_MAJOR) { + if (ver_fmt > FORMAT_VERSION || ver_major > GODOT_VERSION_MAJOR) { f.unref(); return ""; } @@ -1392,10 +1392,10 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons return ResourceFormatSaverBinary::singleton->save(res, p_path); } - if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) { + if (ver_format > FORMAT_VERSION || ver_major > GODOT_VERSION_MAJOR) { ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, vformat("File '%s' can't be loaded, as it uses a format version (%d) or engine version (%d.%d) which are not supported by your engine version (%s).", - local_path, ver_format, ver_major, ver_minor, VERSION_BRANCH)); + local_path, ver_format, ver_major, ver_minor, GODOT_VERSION_BRANCH)); } // Since we're not actually converting the file contents, leave the version @@ -2186,8 +2186,8 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const Refstore_32(0); //64 bits file, false for now - f->store_32(VERSION_MAJOR); - f->store_32(VERSION_MINOR); + f->store_32(GODOT_VERSION_MAJOR); + f->store_32(GODOT_VERSION_MINOR); f->store_32(FORMAT_VERSION); if (f->get_error() != OK && f->get_error() != ERR_FILE_EOF) { @@ -2450,10 +2450,10 @@ Error ResourceFormatSaverBinaryInstance::set_uid(const String &p_path, ResourceU return ERR_UNAVAILABLE; } - if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) { + if (ver_format > FORMAT_VERSION || ver_major > GODOT_VERSION_MAJOR) { ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, vformat("File '%s' can't be loaded, as it uses a format version (%d) or engine version (%d.%d) which are not supported by your engine version (%s).", - local_path, ver_format, ver_major, ver_minor, VERSION_BRANCH)); + local_path, ver_format, ver_major, ver_minor, GODOT_VERSION_BRANCH)); } // Since we're not actually converting the file contents, leave the version diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index e6536fe8e98..a6da4afa9ac 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -378,7 +378,7 @@ uint32_t ClassDB::get_api_hash(APIType p_api) { return api_hashes_cache[p_api]; } - uint64_t hash = hash_murmur3_one_64(HashMapHasherDefault::hash(VERSION_FULL_CONFIG)); + uint64_t hash = hash_murmur3_one_64(HashMapHasherDefault::hash(GODOT_VERSION_FULL_CONFIG)); List class_list; for (const KeyValue &E : classes) { diff --git a/core/os/os.cpp b/core/os/os.cpp index bbeb5b1fb28..c67c28de88b 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -274,7 +274,7 @@ String OS::get_safe_dir_name(const String &p_dir_name, bool p_allow_paths) const // Get properly capitalized engine name for system paths String OS::get_godot_dir_name() const { // Default to lowercase, so only override when different case is needed - return String(VERSION_SHORT_NAME).to_lower(); + return String(GODOT_VERSION_SHORT_NAME).to_lower(); } // OS equivalent of XDG_DATA_HOME diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 37c7692a514..74955ed52d4 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -6050,10 +6050,10 @@ String DTR(const String &p_text, const String &p_context) { const String text = p_text.dedent().strip_edges(); if (TranslationServer::get_singleton()) { - return String(TranslationServer::get_singleton()->doc_translate(text, p_context)).replace("$DOCS_URL", VERSION_DOCS_URL); + return String(TranslationServer::get_singleton()->doc_translate(text, p_context)).replace("$DOCS_URL", GODOT_VERSION_DOCS_URL); } - return text.replace("$DOCS_URL", VERSION_DOCS_URL); + return text.replace("$DOCS_URL", GODOT_VERSION_DOCS_URL); } /** @@ -6067,14 +6067,14 @@ String DTRN(const String &p_text, const String &p_text_plural, int p_n, const St const String text_plural = p_text_plural.dedent().strip_edges(); if (TranslationServer::get_singleton()) { - return String(TranslationServer::get_singleton()->doc_translate_plural(text, text_plural, p_n, p_context)).replace("$DOCS_URL", VERSION_DOCS_URL); + return String(TranslationServer::get_singleton()->doc_translate_plural(text, text_plural, p_n, p_context)).replace("$DOCS_URL", GODOT_VERSION_DOCS_URL); } // Return message based on English plural rule if translation is not possible. if (p_n == 1) { - return text.replace("$DOCS_URL", VERSION_DOCS_URL); + return text.replace("$DOCS_URL", GODOT_VERSION_DOCS_URL); } - return text_plural.replace("$DOCS_URL", VERSION_DOCS_URL); + return text_plural.replace("$DOCS_URL", GODOT_VERSION_DOCS_URL); } #endif diff --git a/core/version.h b/core/version.h index a20fbdf6774..bced3267fae 100644 --- a/core/version.h +++ b/core/version.h @@ -47,37 +47,60 @@ // Defines the main "branch" version. Patch versions in this branch should be // forward-compatible. // Example: "3.1" -#define VERSION_BRANCH _MKSTR(VERSION_MAJOR) "." _MKSTR(VERSION_MINOR) -#if VERSION_PATCH +#define GODOT_VERSION_BRANCH _MKSTR(GODOT_VERSION_MAJOR) "." _MKSTR(GODOT_VERSION_MINOR) +#if GODOT_VERSION_PATCH // Example: "3.1.4" -#define VERSION_NUMBER VERSION_BRANCH "." _MKSTR(VERSION_PATCH) +#define GODOT_VERSION_NUMBER GODOT_VERSION_BRANCH "." _MKSTR(GODOT_VERSION_PATCH) #else // patch is 0, we don't include it in the "pretty" version number. // Example: "3.1" instead of "3.1.0" -#define VERSION_NUMBER VERSION_BRANCH -#endif // VERSION_PATCH +#define GODOT_VERSION_NUMBER GODOT_VERSION_BRANCH +#endif // GODOT_VERSION_PATCH // Version number encoded as hexadecimal int with one byte for each number, // for easy comparison from code. // Example: 3.1.4 will be 0x030104, making comparison easy from script. -#define VERSION_HEX 0x10000 * VERSION_MAJOR + 0x100 * VERSION_MINOR + VERSION_PATCH +#define GODOT_VERSION_HEX 0x10000 * GODOT_VERSION_MAJOR + 0x100 * GODOT_VERSION_MINOR + GODOT_VERSION_PATCH // Describes the full configuration of that Godot version, including the version number, // the status (beta, stable, etc.) and potential module-specific features (e.g. mono). // Example: "3.1.4.stable.mono" -#define VERSION_FULL_CONFIG VERSION_NUMBER "." VERSION_STATUS VERSION_MODULE_CONFIG +#define GODOT_VERSION_FULL_CONFIG GODOT_VERSION_NUMBER "." GODOT_VERSION_STATUS GODOT_VERSION_MODULE_CONFIG -// Similar to VERSION_FULL_CONFIG, but also includes the (potentially custom) VERSION_BUILD +// Similar to GODOT_VERSION_FULL_CONFIG, but also includes the (potentially custom) GODOT_VERSION_BUILD // description (e.g. official, custom_build, etc.). // Example: "3.1.4.stable.mono.official" -#define VERSION_FULL_BUILD VERSION_FULL_CONFIG "." VERSION_BUILD +#define GODOT_VERSION_FULL_BUILD GODOT_VERSION_FULL_CONFIG "." GODOT_VERSION_BUILD // Same as above, but prepended with Godot's name and a cosmetic "v" for "version". // Example: "Godot v3.1.4.stable.official.mono" -#define VERSION_FULL_NAME VERSION_NAME " v" VERSION_FULL_BUILD +#define GODOT_VERSION_FULL_NAME GODOT_VERSION_NAME " v" GODOT_VERSION_FULL_BUILD // Git commit hash, generated at build time in `core/version_hash.gen.cpp`. -extern const char *const VERSION_HASH; +extern const char *const GODOT_VERSION_HASH; // Git commit date UNIX timestamp (in seconds), generated at build time in `core/version_hash.gen.cpp`. // Set to 0 if unknown. -extern const uint64_t VERSION_TIMESTAMP; +extern const uint64_t GODOT_VERSION_TIMESTAMP; + +#ifndef DISABLE_DEPRECATED +// Compatibility with pre-4.5 modules. +#define VERSION_SHORT_NAME GODOT_VERSION_SHORT_NAME +#define VERSION_NAME GODOT_VERSION_NAME +#define VERSION_MAJOR GODOT_VERSION_MAJOR +#define VERSION_MINOR GODOT_VERSION_MINOR +#define VERSION_PATCH GODOT_VERSION_PATCH +#define VERSION_STATUS GODOT_VERSION_STATUS +#define VERSION_BUILD GODOT_VERSION_BUILD +#define VERSION_MODULE_CONFIG GODOT_VERSION_MODULE_CONFIG +#define VERSION_WEBSITE GODOT_VERSION_WEBSITE +#define VERSION_DOCS_BRANCH GODOT_VERSION_DOCS_BRANCH +#define VERSION_DOCS_URL GODOT_VERSION_DOCS_URL +#define VERSION_BRANCH GODOT_VERSION_BRANCH +#define VERSION_NUMBER GODOT_VERSION_NUMBER +#define VERSION_HEX GODOT_VERSION_HEX +#define VERSION_FULL_CONFIG GODOT_VERSION_FULL_CONFIG +#define VERSION_FULL_BUILD GODOT_VERSION_FULL_BUILD +#define VERSION_FULL_NAME GODOT_VERSION_FULL_NAME +#define VERSION_HASH GODOT_VERSION_HASH +#define VERSION_TIMESTAMP GODOT_VERSION_TIMESTAMP +#endif // DISABLE_DEPRECATED diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 7198f4dd0d0..0c517f4a545 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -312,11 +312,11 @@ Error AudioDriverPulseAudio::init() { String context_name; if (Engine::get_singleton()->is_editor_hint()) { - context_name = VERSION_NAME " Editor"; + context_name = GODOT_VERSION_NAME " Editor"; } else { context_name = GLOBAL_GET("application/config/name"); if (context_name.is_empty()) { - context_name = VERSION_NAME " Project"; + context_name = GODOT_VERSION_NAME " Project"; } } diff --git a/drivers/vulkan/rendering_context_driver_vulkan.cpp b/drivers/vulkan/rendering_context_driver_vulkan.cpp index 3c1aa323f45..f702cf233d7 100644 --- a/drivers/vulkan/rendering_context_driver_vulkan.cpp +++ b/drivers/vulkan/rendering_context_driver_vulkan.cpp @@ -686,8 +686,8 @@ Error RenderingContextDriverVulkan::_initialize_instance() { VkApplicationInfo app_info = {}; app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; app_info.pApplicationName = cs.get_data(); - app_info.pEngineName = VERSION_NAME; - app_info.engineVersion = VK_MAKE_VERSION(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); + app_info.pEngineName = GODOT_VERSION_NAME; + app_info.engineVersion = VK_MAKE_VERSION(GODOT_VERSION_MAJOR, GODOT_VERSION_MINOR, GODOT_VERSION_PATCH); app_info.apiVersion = application_api_version; TightLocalVector enabled_layer_names; diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index a4a4d7ad490..c4aa63c095a 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -1762,7 +1762,7 @@ void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) { // Construct a GitHub repository URL and open it in the user's default web browser. // If the commit hash is available, use it for greater accuracy. Otherwise fall back to tagged release. - String git_ref = String(VERSION_HASH).is_empty() ? String(VERSION_NUMBER) + "-stable" : String(VERSION_HASH); + String git_ref = String(GODOT_VERSION_HASH).is_empty() ? String(GODOT_VERSION_NUMBER) + "-stable" : String(GODOT_VERSION_HASH); OS::get_singleton()->shell_open(vformat("https://github.com/godotengine/godot/blob/%s/%s#L%d", git_ref, file, line_number)); } break; diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 3a42405f625..e154bf4a387 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -66,7 +66,7 @@ #include "modules/mono/csharp_script.h" #endif -#define CONTRIBUTE_URL vformat("%s/contributing/documentation/updating_the_class_reference.html", VERSION_DOCS_URL) +#define CONTRIBUTE_URL vformat("%s/contributing/documentation/updating_the_class_reference.html", GODOT_VERSION_DOCS_URL) #ifdef MODULE_MONO_ENABLED // Sync with the types mentioned in https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_differences.html @@ -1127,7 +1127,7 @@ void EditorHelp::_update_doc() { class_desc->add_newline(); class_desc->add_newline(); - const String &csharp_differences_url = vformat("%s/tutorials/scripting/c_sharp/c_sharp_differences.html", VERSION_DOCS_URL); + const String &csharp_differences_url = vformat("%s/tutorials/scripting/c_sharp/c_sharp_differences.html", GODOT_VERSION_DOCS_URL); class_desc->push_indent(1); _push_normal_font(); @@ -2914,7 +2914,7 @@ void EditorHelp::_compute_doc_version_hash() { } String EditorHelp::get_cache_full_path() { - return EditorPaths::get_singleton()->get_cache_dir().path_join(vformat("editor_doc_cache-%d.%d.res", VERSION_MAJOR, VERSION_MINOR)); + return EditorPaths::get_singleton()->get_cache_dir().path_join(vformat("editor_doc_cache-%d.%d.res", GODOT_VERSION_MAJOR, GODOT_VERSION_MINOR)); } void EditorHelp::load_xml_buffer(const uint8_t *p_buffer, int p_size) { diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 5e1d3e4611a..d33bd6a931f 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -549,7 +549,7 @@ EditorLog::EditorLog() { vb_right->add_child(editor_filter->toggle_button); type_filter_map.insert(MSG_TYPE_EDITOR, editor_filter); - add_message(VERSION_FULL_NAME " (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors."); + add_message(GODOT_VERSION_FULL_NAME " (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors."); eh.errfunc = _error_handler; eh.userdata = this; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f03497a40b3..9604ec86c79 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -339,7 +339,7 @@ void EditorNode::_update_title() { // Display the "modified" mark before anything else so that it can always be seen in the OS task bar. title = vformat("(*) %s", title); } - DisplayServer::get_singleton()->window_set_title(title + String(" - ") + VERSION_NAME); + DisplayServer::get_singleton()->window_set_title(title + String(" - ") + GODOT_VERSION_NAME); if (project_title) { project_title->set_text(title); } @@ -3221,7 +3221,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { command_palette->open_popup(); } break; case HELP_DOCS: { - OS::get_singleton()->shell_open(VERSION_DOCS_URL "/"); + OS::get_singleton()->shell_open(GODOT_VERSION_DOCS_URL "/"); } break; case HELP_FORUM: { OS::get_singleton()->shell_open("https://forum.godotengine.org/"); @@ -5084,9 +5084,9 @@ String EditorNode::_get_system_info() const { } const String distribution_version = OS::get_singleton()->get_version_alias(); - String godot_version = "Godot v" + String(VERSION_FULL_CONFIG); - if (String(VERSION_BUILD) != "official") { - String hash = String(VERSION_HASH); + String godot_version = "Godot v" + String(GODOT_VERSION_FULL_CONFIG); + if (String(GODOT_VERSION_BUILD) != "official") { + String hash = String(GODOT_VERSION_HASH); hash = hash.is_empty() ? String("unknown") : vformat("(%s)", hash.left(9)); godot_version += " " + hash; } diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 477aae46a9e..d02a2e0534a 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -462,7 +462,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { { EngineUpdateLabel::UpdateMode default_update_mode = EngineUpdateLabel::UpdateMode::NEWEST_UNSTABLE; - if (String(VERSION_STATUS) == String("stable")) { + if (String(GODOT_VERSION_STATUS) == String("stable")) { default_update_mode = EngineUpdateLabel::UpdateMode::NEWEST_STABLE; } EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "network/connection/engine_version_update_mode", int(default_update_mode), "Disable Update Checks,Check Newest Preview,Check Newest Stable,Check Newest Patch"); // Uses EngineUpdateLabel::UpdateMode. @@ -1217,16 +1217,16 @@ EditorSettings *EditorSettings::get_singleton() { String EditorSettings::get_existing_settings_path() { const String config_dir = EditorPaths::get_singleton()->get_config_dir(); - int minor = VERSION_MINOR; + int minor = GODOT_VERSION_MINOR; String filename; do { - if (VERSION_MAJOR == 4 && minor < 3) { + if (GODOT_VERSION_MAJOR == 4 && minor < 3) { // Minor version is used since 4.3, so special case to load older settings. - filename = vformat("editor_settings-%d.tres", VERSION_MAJOR); + filename = vformat("editor_settings-%d.tres", GODOT_VERSION_MAJOR); minor = -1; } else { - filename = vformat("editor_settings-%d.%d.tres", VERSION_MAJOR, minor); + filename = vformat("editor_settings-%d.%d.tres", GODOT_VERSION_MAJOR, minor); minor--; } } while (minor >= 0 && !FileAccess::exists(config_dir.path_join(filename))); @@ -1234,7 +1234,7 @@ String EditorSettings::get_existing_settings_path() { } String EditorSettings::get_newest_settings_path() { - const String config_file_name = vformat("editor_settings-%d.%d.tres", VERSION_MAJOR, VERSION_MINOR); + const String config_file_name = vformat("editor_settings-%d.%d.tres", GODOT_VERSION_MAJOR, GODOT_VERSION_MINOR); return EditorPaths::get_singleton()->get_config_dir().path_join(config_file_name); } diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index 447aabf0fb9..fc6290fe508 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -393,7 +393,7 @@ Ref EditorExportPlatform::get_option_icon(int p_index) const { } String EditorExportPlatform::find_export_template(const String &template_file_name, String *err) const { - String current_version = VERSION_FULL_CONFIG; + String current_version = GODOT_VERSION_FULL_CONFIG; String template_path = EditorPaths::get_singleton()->get_export_templates_dir().path_join(current_version).path_join(template_file_name); if (FileAccess::exists(template_path)) { @@ -950,7 +950,7 @@ Dictionary EditorExportPlatform::get_internal_export_files(const Refget_export_templates_dir().path_join(current_version); if (p_debug && p_preset->has("custom_template/debug") && p_preset->get("custom_template/debug") != "") { template_path = p_preset->get("custom_template/debug").operator String().get_base_dir(); @@ -1946,9 +1946,9 @@ Error EditorExportPlatform::save_pack(const Ref &p_preset, b f->store_32(PACK_HEADER_MAGIC); f->store_32(PACK_FORMAT_VERSION); - f->store_32(VERSION_MAJOR); - f->store_32(VERSION_MINOR); - f->store_32(VERSION_PATCH); + f->store_32(GODOT_VERSION_MAJOR); + f->store_32(GODOT_VERSION_MINOR); + f->store_32(GODOT_VERSION_PATCH); uint32_t pack_flags = 0; bool enc_pck = p_preset->get_enc_pck(); diff --git a/editor/export/export_template_manager.cpp b/editor/export/export_template_manager.cpp index a8ea9495961..34513c034c5 100644 --- a/editor/export/export_template_manager.cpp +++ b/editor/export/export_template_manager.cpp @@ -62,10 +62,10 @@ static DownloadsAvailability _get_downloads_availability() { // (which always have a number following their status, e.g. "alpha1"). // Therefore, don't display download-related features when using a development version // (whose builds aren't numbered). - if (String(VERSION_STATUS) == String("dev") || - String(VERSION_STATUS) == String("alpha") || - String(VERSION_STATUS) == String("beta") || - String(VERSION_STATUS) == String("rc")) { + if (String(GODOT_VERSION_STATUS) == String("dev") || + String(GODOT_VERSION_STATUS) == String("alpha") || + String(GODOT_VERSION_STATUS) == String("beta") || + String(GODOT_VERSION_STATUS) == String("rc")) { return DOWNLOADS_NOT_AVAILABLE_FOR_DEV_BUILDS; } @@ -98,7 +98,7 @@ void ExportTemplateManager::_update_template_status() { da->list_dir_end(); // Update the state of the current version. - String current_version = VERSION_FULL_CONFIG; + String current_version = GODOT_VERSION_FULL_CONFIG; current_value->set_text(current_version); if (templates.has(current_version)) { @@ -266,7 +266,7 @@ void ExportTemplateManager::_refresh_mirrors() { } is_refreshing_mirrors = true; - String current_version = VERSION_FULL_CONFIG; + String current_version = GODOT_VERSION_FULL_CONFIG; const String mirrors_metadata_url = "https://godotengine.org/mirrorlist/" + current_version + ".json"; request_mirrors->request(mirrors_metadata_url); } @@ -775,7 +775,7 @@ String ExportTemplateManager::get_android_source_zip(const Refget_export_templates_dir().path_join(VERSION_FULL_CONFIG); + const String templates_dir = EditorPaths::get_singleton()->get_export_templates_dir().path_join(GODOT_VERSION_FULL_CONFIG); return templates_dir.path_join("android_source.zip"); } @@ -787,7 +787,7 @@ String ExportTemplateManager::get_android_template_identifier(const Ref &p_preset) { @@ -1010,14 +1010,14 @@ ExportTemplateManager::ExportTemplateManager() { current_open_button->set_text(TTR("Open Folder")); current_open_button->set_tooltip_text(TTR("Open the folder containing installed templates for the current version.")); current_installed_hb->add_child(current_open_button); - current_open_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_open_template_folder).bind(VERSION_FULL_CONFIG)); + current_open_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_open_template_folder).bind(GODOT_VERSION_FULL_CONFIG)); #endif current_uninstall_button = memnew(Button); current_uninstall_button->set_text(TTR("Uninstall")); current_uninstall_button->set_tooltip_text(TTR("Uninstall templates for the current version.")); current_installed_hb->add_child(current_uninstall_button); - current_uninstall_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_uninstall_template).bind(VERSION_FULL_CONFIG)); + current_uninstall_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_uninstall_template).bind(GODOT_VERSION_FULL_CONFIG)); main_vb->add_child(memnew(HSeparator)); diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index 0982520acd5..4cfd08b3743 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -576,7 +576,7 @@ void ProjectExportDialog::_enc_filters_changed(const String &p_filters) { } void ProjectExportDialog::_open_key_help_link() { - OS::get_singleton()->shell_open(vformat("%s/contributing/development/compiling/compiling_with_script_encryption_key.html", VERSION_DOCS_URL)); + OS::get_singleton()->shell_open(vformat("%s/contributing/development/compiling/compiling_with_script_encryption_key.html", GODOT_VERSION_DOCS_URL)); } void ProjectExportDialog::_enc_pck_changed(bool p_pressed) { diff --git a/editor/gui/editor_version_button.cpp b/editor/gui/editor_version_button.cpp index 635d66f42a9..15f2d46a22d 100644 --- a/editor/gui/editor_version_button.cpp +++ b/editor/gui/editor_version_button.cpp @@ -37,20 +37,20 @@ String _get_version_string(EditorVersionButton::VersionFormat p_format) { String main; switch (p_format) { case EditorVersionButton::FORMAT_BASIC: { - return VERSION_FULL_CONFIG; + return GODOT_VERSION_FULL_CONFIG; } break; case EditorVersionButton::FORMAT_WITH_BUILD: { - main = "v" VERSION_FULL_BUILD; + main = "v" GODOT_VERSION_FULL_BUILD; } break; case EditorVersionButton::FORMAT_WITH_NAME_AND_BUILD: { - main = VERSION_FULL_NAME; + main = GODOT_VERSION_FULL_NAME; } break; default: { - ERR_FAIL_V_MSG(VERSION_FULL_NAME, "Unexpected format: " + itos(p_format)); + ERR_FAIL_V_MSG(GODOT_VERSION_FULL_NAME, "Unexpected format: " + itos(p_format)); } break; } - String hash = VERSION_HASH; + String hash = GODOT_VERSION_HASH; if (!hash.is_empty()) { hash = vformat(" [%s]", hash.left(9)); } @@ -76,8 +76,8 @@ EditorVersionButton::EditorVersionButton(VersionFormat p_format) { set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER); String build_date; - if (VERSION_TIMESTAMP > 0) { - build_date = Time::get_singleton()->get_datetime_string_from_unix_time(VERSION_TIMESTAMP, true) + " UTC"; + if (GODOT_VERSION_TIMESTAMP > 0) { + build_date = Time::get_singleton()->get_datetime_string_from_unix_time(GODOT_VERSION_TIMESTAMP, true) + " UTC"; } else { build_date = TTR("(unknown)"); } diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 76c68b0216e..d37e66b26fb 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1069,7 +1069,7 @@ void EditorAssetLibrary::_search(int p_page) { args += String() + "sort=" + sort_key[sort->get_selected()]; // We use the "branch" version, i.e. major.minor, as patch releases should be compatible - args += "&godot_version=" + String(VERSION_BRANCH); + args += "&godot_version=" + String(GODOT_VERSION_BRANCH); String support_list; for (int i = 0; i < SUPPORT_MAX; i++) { @@ -1373,7 +1373,7 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const // This is typically because the version number changed recently // and no assets compatible with the new version have been published yet. _set_library_message( - vformat(TTR("No results compatible with %s %s for support level(s): %s.\nCheck the enabled support levels using the 'Support' button in the top-right corner."), String(VERSION_SHORT_NAME).capitalize(), String(VERSION_BRANCH), support_list)); + vformat(TTR("No results compatible with %s %s for support level(s): %s.\nCheck the enabled support levels using the 'Support' button in the top-right corner."), String(GODOT_VERSION_SHORT_NAME).capitalize(), String(GODOT_VERSION_BRANCH), support_list)); } } else { library_message_box->hide(); diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 96869011f43..69f5267697b 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1434,10 +1434,10 @@ void ScriptEditor::_menu_option(int p_option) { } if (native_class_doc) { String name = eh->get_class().to_lower(); - String doc_url = vformat(VERSION_DOCS_URL "/classes/class_%s.html", name); + String doc_url = vformat(GODOT_VERSION_DOCS_URL "/classes/class_%s.html", name); OS::get_singleton()->shell_open(doc_url); } else { - OS::get_singleton()->shell_open(VERSION_DOCS_URL "/"); + OS::get_singleton()->shell_open(GODOT_VERSION_DOCS_URL "/"); } } break; case WINDOW_NEXT: { diff --git a/editor/plugins/text_shader_editor.cpp b/editor/plugins/text_shader_editor.cpp index 693cf2436ef..91058a894a3 100644 --- a/editor/plugins/text_shader_editor.cpp +++ b/editor/plugins/text_shader_editor.cpp @@ -727,7 +727,7 @@ void TextShaderEditor::_menu_option(int p_option) { code_editor->remove_all_bookmarks(); } break; case HELP_DOCS: { - OS::get_singleton()->shell_open(vformat("%s/tutorials/shaders/shader_reference/index.html", VERSION_DOCS_URL)); + OS::get_singleton()->shell_open(vformat("%s/tutorials/shaders/shader_reference/index.html", GODOT_VERSION_DOCS_URL)); } break; case EDIT_EMOJI_AND_SYMBOL: { code_editor->get_text_editor()->show_emoji_and_symbol_picker(); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 19bcfe8bc51..c1c55b869df 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -592,7 +592,7 @@ void ProjectManager::_open_selected_projects_check_warnings() { i--; } else if (ProjectList::project_feature_looks_like_version(feature)) { version_convert_feature = feature; - warning_message += vformat(TTR("Warning: This project was last edited in Godot %s. Opening will change it to Godot %s.\n\n"), Variant(feature), Variant(VERSION_BRANCH)); + warning_message += vformat(TTR("Warning: This project was last edited in Godot %s. Opening will change it to Godot %s.\n\n"), Variant(feature), Variant(GODOT_VERSION_BRANCH)); unsupported_features.remove_at(i); i--; } @@ -1227,7 +1227,7 @@ ProjectManager::ProjectManager(bool p_custom_res) { } // TRANSLATORS: This refers to the application where users manage their Godot projects. - SceneTree::get_singleton()->get_root()->set_title(VERSION_NAME + String(" - ") + TTR("Project Manager", "Application")); + SceneTree::get_singleton()->get_root()->set_title(GODOT_VERSION_NAME + String(" - ") + TTR("Project Manager", "Application")); SceneTree::get_singleton()->get_root()->connect("files_dropped", callable_mp(this, &ProjectManager::_files_dropped)); diff --git a/editor/project_manager/project_dialog.cpp b/editor/project_manager/project_dialog.cpp index 09819215c8f..cf0ffcfa71e 100644 --- a/editor/project_manager/project_dialog.cpp +++ b/editor/project_manager/project_dialog.cpp @@ -376,7 +376,7 @@ void ProjectDialog::_browse_project_path() { if (mode == MODE_IMPORT) { fdialog_project->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_ANY); fdialog_project->clear_filters(); - fdialog_project->add_filter("project.godot", vformat("%s %s", VERSION_NAME, TTR("Project"))); + fdialog_project->add_filter("project.godot", vformat("%s %s", GODOT_VERSION_NAME, TTR("Project"))); fdialog_project->add_filter("*.zip", TTR("ZIP File")); } else { fdialog_project->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_DIR); diff --git a/editor/project_manager/project_list.cpp b/editor/project_manager/project_list.cpp index 7f129da9b56..5d86f2feb1e 100644 --- a/editor/project_manager/project_list.cpp +++ b/editor/project_manager/project_list.cpp @@ -156,7 +156,7 @@ void ProjectListItemControl::set_unsupported_features(PackedStringArray p_featur project_version_major = project_version_split[0].to_int(); project_version_minor = project_version_split[1].to_int(); } - if (VERSION_MAJOR != project_version_major || VERSION_MINOR <= project_version_minor) { + if (GODOT_VERSION_MAJOR != project_version_major || GODOT_VERSION_MINOR <= project_version_minor) { // Don't show a warning if the project was last edited in a previous minor version. tooltip_text += TTR("This project was last edited in a different Godot version: ") + p_features[i] + "\n"; } diff --git a/main/main.cpp b/main/main.cpp index 7011d7fd4be..c7e0ca6b165 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -286,11 +286,11 @@ static String unescape_cmdline(const String &p_str) { } static String get_full_version_string() { - String hash = String(VERSION_HASH); + String hash = String(GODOT_VERSION_HASH); if (!hash.is_empty()) { hash = "." + hash.left(9); } - return String(VERSION_FULL_BUILD) + hash; + return String(GODOT_VERSION_FULL_BUILD) + hash; } #if defined(TOOLS_ENABLED) && defined(MODULE_GDSCRIPT_ENABLED) @@ -393,18 +393,18 @@ void finalize_theme_db() { #endif void Main::print_header(bool p_rich) { - if (VERSION_TIMESTAMP > 0) { + if (GODOT_VERSION_TIMESTAMP > 0) { // Version timestamp available. if (p_rich) { - Engine::get_singleton()->print_header_rich("\u001b[38;5;39m" + String(VERSION_NAME) + "\u001b[0m v" + get_full_version_string() + " (" + Time::get_singleton()->get_datetime_string_from_unix_time(VERSION_TIMESTAMP, true) + " UTC) - \u001b[4m" + String(VERSION_WEBSITE)); + Engine::get_singleton()->print_header_rich("\u001b[38;5;39m" + String(GODOT_VERSION_NAME) + "\u001b[0m v" + get_full_version_string() + " (" + Time::get_singleton()->get_datetime_string_from_unix_time(GODOT_VERSION_TIMESTAMP, true) + " UTC) - \u001b[4m" + String(GODOT_VERSION_WEBSITE)); } else { - Engine::get_singleton()->print_header(String(VERSION_NAME) + " v" + get_full_version_string() + " (" + Time::get_singleton()->get_datetime_string_from_unix_time(VERSION_TIMESTAMP, true) + " UTC) - " + String(VERSION_WEBSITE)); + Engine::get_singleton()->print_header(String(GODOT_VERSION_NAME) + " v" + get_full_version_string() + " (" + Time::get_singleton()->get_datetime_string_from_unix_time(GODOT_VERSION_TIMESTAMP, true) + " UTC) - " + String(GODOT_VERSION_WEBSITE)); } } else { if (p_rich) { - Engine::get_singleton()->print_header_rich("\u001b[38;5;39m" + String(VERSION_NAME) + "\u001b[0m v" + get_full_version_string() + " - \u001b[4m" + String(VERSION_WEBSITE)); + Engine::get_singleton()->print_header_rich("\u001b[38;5;39m" + String(GODOT_VERSION_NAME) + "\u001b[0m v" + get_full_version_string() + " - \u001b[4m" + String(GODOT_VERSION_WEBSITE)); } else { - Engine::get_singleton()->print_header(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE)); + Engine::get_singleton()->print_header(String(GODOT_VERSION_NAME) + " v" + get_full_version_string() + " - " + String(GODOT_VERSION_WEBSITE)); } } } diff --git a/misc/scripts/make_tarball.sh b/misc/scripts/make_tarball.sh index 9e02b80af1e..eac9848c93e 100755 --- a/misc/scripts/make_tarball.sh +++ b/misc/scripts/make_tarball.sh @@ -54,7 +54,7 @@ echo " $(dirname $CURDIR)/$NAME.tar.gz" git archive $HEAD --prefix=$NAME/ -o $TMPDIR/$NAME.tar -# Adding custom .git/HEAD to tarball so that we can generate VERSION_HASH. +# Adding custom .git/HEAD to tarball so that we can generate GODOT_VERSION_HASH. cd $TMPDIR mkdir -p $NAME/.git echo $HEAD > $NAME/.git/HEAD diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 1585daf70dc..37bd419d621 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -8087,8 +8087,8 @@ Error GLTFDocument::_serialize_asset_header(Ref p_state) { if (!p_state->copyright.is_empty()) { asset["copyright"] = p_state->copyright; } - String hash = String(VERSION_HASH); - asset["generator"] = String(VERSION_FULL_NAME) + String("@") + (hash.is_empty() ? String("unknown") : hash); + String hash = String(GODOT_VERSION_HASH); + asset["generator"] = String(GODOT_VERSION_FULL_NAME) + String("@") + (hash.is_empty() ? String("unknown") : hash); p_state->json["asset"] = asset; ERR_FAIL_COND_V(!asset.has("version"), Error::FAILED); ERR_FAIL_COND_V(!p_state->json.has("asset"), Error::FAILED); diff --git a/modules/mono/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cpp index df240a59659..42e6df7eac9 100644 --- a/modules/mono/editor/editor_internal_calls.cpp +++ b/modules/mono/editor/editor_internal_calls.cpp @@ -105,7 +105,7 @@ bool godot_icall_EditorProgress_Step(const godot_string *p_task, const godot_str } void godot_icall_Internal_FullExportTemplatesDir(godot_string *r_dest) { - String full_templates_dir = EditorPaths::get_singleton()->get_export_templates_dir().path_join(VERSION_FULL_CONFIG); + String full_templates_dir = EditorPaths::get_singleton()->get_export_templates_dir().path_join(GODOT_VERSION_FULL_CONFIG); memnew_placement(r_dest, String(full_templates_dir)); } diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp index 150d9ea2d79..f39c78a8961 100644 --- a/modules/openxr/openxr_api.cpp +++ b/modules/openxr/openxr_api.cpp @@ -587,7 +587,7 @@ bool OpenXRAPI::create_instance() { "Godot Engine", // applicationName, if we're running a game we'll update this down below. 1, // applicationVersion, we don't currently have this "Godot Engine", // engineName - VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH, // engineVersion 4.0 -> 40000, 4.0.1 -> 40001, 4.1 -> 40100, etc. + GODOT_VERSION_MAJOR * 10000 + GODOT_VERSION_MINOR * 100 + GODOT_VERSION_PATCH, // engineVersion 4.0 -> 40000, 4.0.1 -> 40001, 4.1 -> 40100, etc. XR_API_VERSION_1_0 // apiVersion }; diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index cf980ebec37..9de61b769e5 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -488,7 +488,7 @@ String EditorExportPlatformAndroid::get_project_name(const String &p_name) const } if (aname.is_empty()) { - aname = VERSION_NAME; + aname = GODOT_VERSION_NAME; } return aname; @@ -3478,7 +3478,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Refis_editor_hint()) { - appname = "Godot.GodotEditor." + String(VERSION_BRANCH); + appname = "Godot.GodotEditor." + String(GODOT_VERSION_BRANCH); } else { String name = GLOBAL_GET("application/config/name"); String version = GLOBAL_GET("application/config/version"); @@ -6364,7 +6364,7 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode, PROPVARIANT val; String appname; if (Engine::get_singleton()->is_editor_hint()) { - appname = "Godot.GodotEditor." + String(VERSION_FULL_CONFIG); + appname = "Godot.GodotEditor." + String(GODOT_VERSION_FULL_CONFIG); } else { String name = GLOBAL_GET("application/config/name"); String version = GLOBAL_GET("application/config/version"); @@ -6970,7 +6970,7 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win #endif String appname; if (Engine::get_singleton()->is_editor_hint()) { - appname = "Godot.GodotEditor." + String(VERSION_FULL_CONFIG); + appname = "Godot.GodotEditor." + String(GODOT_VERSION_FULL_CONFIG); } else { String name = GLOBAL_GET("application/config/name"); String version = GLOBAL_GET("application/config/version"); diff --git a/platform/windows/gl_manager_windows_native.cpp b/platform/windows/gl_manager_windows_native.cpp index 2a66ce003e4..88fe1d88ad3 100644 --- a/platform/windows/gl_manager_windows_native.cpp +++ b/platform/windows/gl_manager_windows_native.cpp @@ -170,7 +170,7 @@ void GLManagerNative_Windows::_nvapi_setup_profile() { // We need a name anyways, so let's use the engine name if an application name is not available // (this is used mostly by the Project Manager) if (app_profile_name.is_empty()) { - app_profile_name = VERSION_NAME; + app_profile_name = GODOT_VERSION_NAME; } String old_profile_name = app_profile_name + " Nvidia Profile"; Char16String app_profile_name_u16 = app_profile_name.utf16(); diff --git a/platform/windows/godot_res.rc b/platform/windows/godot_res.rc index 86191ad9d98..039fde9d11a 100644 --- a/platform/windows/godot_res.rc +++ b/platform/windows/godot_res.rc @@ -8,8 +8,8 @@ GODOT_ICON ICON platform/windows/godot.ico 1 RT_MANIFEST "godot.manifest" 1 VERSIONINFO -FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 -PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 +FILEVERSION GODOT_VERSION_MAJOR,GODOT_VERSION_MINOR,GODOT_VERSION_PATCH,0 +PRODUCTVERSION GODOT_VERSION_MAJOR,GODOT_VERSION_MINOR,GODOT_VERSION_PATCH,0 FILEOS 4 FILETYPE 1 BEGIN @@ -18,13 +18,13 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Godot Engine" - VALUE "FileDescription", VERSION_NAME - VALUE "FileVersion", VERSION_NUMBER - VALUE "ProductName", VERSION_NAME + VALUE "FileDescription", GODOT_VERSION_NAME + VALUE "FileVersion", GODOT_VERSION_NUMBER + VALUE "ProductName", GODOT_VERSION_NAME VALUE "Licence", "MIT" VALUE "LegalCopyright", "(c) 2007-present Juan Linietsky, Ariel Manzur and Godot Engine contributors" VALUE "Info", "https://godotengine.org" - VALUE "ProductVersion", VERSION_FULL_BUILD + VALUE "ProductVersion", GODOT_VERSION_FULL_BUILD END END BLOCK "VarFileInfo" diff --git a/platform/windows/godot_res_wrap.rc b/platform/windows/godot_res_wrap.rc index 61e61004979..d6e1f0bf3b5 100644 --- a/platform/windows/godot_res_wrap.rc +++ b/platform/windows/godot_res_wrap.rc @@ -8,8 +8,8 @@ GODOT_ICON ICON platform/windows/godot_console.ico 1 RT_MANIFEST "godot.manifest" 1 VERSIONINFO -FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 -PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 +FILEVERSION GODOT_VERSION_MAJOR,GODOT_VERSION_MINOR,GODOT_VERSION_PATCH,0 +PRODUCTVERSION GODOT_VERSION_MAJOR,GODOT_VERSION_MINOR,GODOT_VERSION_PATCH,0 FILEOS 4 FILETYPE 1 BEGIN @@ -18,13 +18,13 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Godot Engine" - VALUE "FileDescription", VERSION_NAME " (Console)" - VALUE "FileVersion", VERSION_NUMBER - VALUE "ProductName", VERSION_NAME " (Console)" + VALUE "FileDescription", GODOT_VERSION_NAME " (Console)" + VALUE "FileVersion", GODOT_VERSION_NUMBER + VALUE "ProductName", GODOT_VERSION_NAME " (Console)" VALUE "Licence", "MIT" VALUE "LegalCopyright", "(c) 2007-present Juan Linietsky, Ariel Manzur and Godot Engine contributors" VALUE "Info", "https://godotengine.org" - VALUE "ProductVersion", VERSION_FULL_BUILD + VALUE "ProductVersion", GODOT_VERSION_FULL_BUILD END END BLOCK "VarFileInfo" diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 50fa4bd6c3a..e9d8419e0da 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2186,7 +2186,7 @@ String OS_Windows::get_temp_path() const { // Get properly capitalized engine name for system paths String OS_Windows::get_godot_dir_name() const { - return String(VERSION_SHORT_NAME).capitalize(); + return String(GODOT_VERSION_SHORT_NAME).capitalize(); } String OS_Windows::get_system_dir(SystemDir p_dir, bool p_shared_storage) const { diff --git a/scene/resources/3d/fog_material.cpp b/scene/resources/3d/fog_material.cpp index 6c6e98b50dc..b749ec3448a 100644 --- a/scene/resources/3d/fog_material.cpp +++ b/scene/resources/3d/fog_material.cpp @@ -144,7 +144,7 @@ void FogMaterial::_update_shader() { // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). RS::get_singleton()->shader_set_code(shader, R"( -// NOTE: Shader automatically converted from )" VERSION_NAME " " VERSION_FULL_CONFIG R"('s FogMaterial. +// NOTE: Shader automatically converted from )" GODOT_VERSION_NAME " " GODOT_VERSION_FULL_CONFIG R"('s FogMaterial. shader_type fog; diff --git a/scene/resources/3d/sky_material.cpp b/scene/resources/3d/sky_material.cpp index 10ef516f7a4..ce56ee28790 100644 --- a/scene/resources/3d/sky_material.cpp +++ b/scene/resources/3d/sky_material.cpp @@ -276,7 +276,7 @@ void ProceduralSkyMaterial::_update_shader() { // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). RS::get_singleton()->shader_set_code(shader_cache[i], vformat(R"( -// NOTE: Shader automatically converted from )" VERSION_NAME " " VERSION_FULL_CONFIG R"('s ProceduralSkyMaterial. +// NOTE: Shader automatically converted from )" GODOT_VERSION_NAME " " GODOT_VERSION_FULL_CONFIG R"('s ProceduralSkyMaterial. shader_type sky; %s @@ -470,7 +470,7 @@ void PanoramaSkyMaterial::_update_shader() { // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). RS::get_singleton()->shader_set_code(shader_cache[i], vformat(R"( -// NOTE: Shader automatically converted from )" VERSION_NAME " " VERSION_FULL_CONFIG R"('s PanoramaSkyMaterial. +// NOTE: Shader automatically converted from )" GODOT_VERSION_NAME " " GODOT_VERSION_FULL_CONFIG R"('s PanoramaSkyMaterial. shader_type sky; @@ -698,7 +698,7 @@ void PhysicalSkyMaterial::_update_shader() { // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). RS::get_singleton()->shader_set_code(shader_cache[i], vformat(R"( -// NOTE: Shader automatically converted from )" VERSION_NAME " " VERSION_FULL_CONFIG R"('s PhysicalSkyMaterial. +// NOTE: Shader automatically converted from )" GODOT_VERSION_NAME " " GODOT_VERSION_FULL_CONFIG R"('s PhysicalSkyMaterial. shader_type sky; %s diff --git a/scene/resources/canvas_item_material.cpp b/scene/resources/canvas_item_material.cpp index 91ce9704dd5..332773baa65 100644 --- a/scene/resources/canvas_item_material.cpp +++ b/scene/resources/canvas_item_material.cpp @@ -78,7 +78,7 @@ void CanvasItemMaterial::_update_shader() { //must create a shader! // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). - String code = "// NOTE: Shader automatically converted from " VERSION_NAME " " VERSION_FULL_CONFIG "'s CanvasItemMaterial.\n\n"; + String code = "// NOTE: Shader automatically converted from " GODOT_VERSION_NAME " " GODOT_VERSION_FULL_CONFIG "'s CanvasItemMaterial.\n\n"; code += "shader_type canvas_item;\nrender_mode "; switch (blend_mode) { diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index a9dd89289c0..28ed05f3204 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -750,7 +750,7 @@ void BaseMaterial3D::_update_shader() { // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). String code = vformat( - "// NOTE: Shader automatically converted from " VERSION_NAME " " VERSION_FULL_CONFIG "'s %s.\n\n", + "// NOTE: Shader automatically converted from " GODOT_VERSION_NAME " " GODOT_VERSION_FULL_CONFIG "'s %s.\n\n", orm ? "ORMMaterial3D" : "StandardMaterial3D"); // Define shader type and render mode based on property values. diff --git a/scene/resources/particle_process_material.cpp b/scene/resources/particle_process_material.cpp index dd6e659e061..a8584e7fed0 100644 --- a/scene/resources/particle_process_material.cpp +++ b/scene/resources/particle_process_material.cpp @@ -172,7 +172,7 @@ void ParticleProcessMaterial::_update_shader() { // No pre-existing shader, create one. // Add a comment to describe the shader origin (useful when converting to ShaderMaterial). - String code = "// NOTE: Shader automatically converted from " VERSION_NAME " " VERSION_FULL_CONFIG "'s ParticleProcessMaterial.\n\n"; + String code = "// NOTE: Shader automatically converted from " GODOT_VERSION_NAME " " GODOT_VERSION_FULL_CONFIG "'s ParticleProcessMaterial.\n\n"; code += "shader_type particles;\n"; code += "render_mode disable_velocity;\n"; diff --git a/servers/rendering/renderer_rd/shader_rd.cpp b/servers/rendering/renderer_rd/shader_rd.cpp index b35d81c54cb..d2d226bc3af 100644 --- a/servers/rendering/renderer_rd/shader_rd.cpp +++ b/servers/rendering/renderer_rd/shader_rd.cpp @@ -149,9 +149,9 @@ void ShaderRD::setup(const char *p_vertex_code, const char *p_fragment_code, con StringBuilder tohash; tohash.append("[GodotVersionNumber]"); - tohash.append(VERSION_NUMBER); + tohash.append(GODOT_VERSION_NUMBER); tohash.append("[GodotVersionHash]"); - tohash.append(VERSION_HASH); + tohash.append(GODOT_VERSION_HASH); tohash.append("[SpirvCacheKey]"); tohash.append(RenderingDevice::get_singleton()->shader_get_spirv_cache_key()); tohash.append("[BinaryCacheKey]");