Rename version defines to GODOT_VERSION_* to match GDExtension godot-cpp

This commit is contained in:
Aaron Franke 2025-03-03 22:27:29 -08:00
parent 74907876d3
commit 97ee05e9b7
No known key found for this signature in database
GPG Key ID: 40A1750B977E56BF
53 changed files with 220 additions and 197 deletions

View File

@ -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())
)

View File

@ -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) {

View File

@ -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");

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -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";

View File

@ -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) {

View File

@ -1028,10 +1028,10 @@ void ResourceLoaderBinary::open(Ref<FileAccess> 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<FileAccess> 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<FileAccess> 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 Ref<Re
}
f->store_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

View File

@ -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<StringName> class_list;
for (const KeyValue<StringName, ClassInfo> &E : classes) {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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";
}
}

View File

@ -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<const char *> enabled_layer_names;

View File

@ -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;

View File

@ -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) {

View File

@ -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;

View File

@ -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;
}

View File

@ -462,7 +462,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> 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);
}

View File

@ -393,7 +393,7 @@ Ref<ImageTexture> 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 Ref<EditorExpor
export_ok = true;
}
} else {
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);
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<EditorExportPreset> &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();

View File

@ -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 Ref<EditorExportPrese
}
}
const String templates_dir = EditorPaths::get_singleton()->get_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<EditorEx
return android_source_zip + String(" [") + FileAccess::get_md5(android_source_zip) + String("]");
}
}
return VERSION_FULL_CONFIG;
return GODOT_VERSION_FULL_CONFIG;
}
bool ExportTemplateManager::is_android_template_installed(const Ref<EditorExportPreset> &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));

View File

@ -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) {

View File

@ -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)");
}

View File

@ -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();

View File

@ -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: {

View File

@ -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();

View File

@ -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));

View File

@ -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);

View File

@ -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";
}

View File

@ -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));
}
}
}

View File

@ -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

View File

@ -8087,8 +8087,8 @@ Error GLTFDocument::_serialize_asset_header(Ref<GLTFState> 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);

View File

@ -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));
}

View File

@ -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
};

View File

@ -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 Ref<EditorExportP
cmdline.push_back("-Pperform_zipalign=" + zipalign_flag); // argument to specify whether the build should be zipaligned.
cmdline.push_back("-Pperform_signing=" + sign_flag); // argument to specify whether the build should be signed.
cmdline.push_back("-Pcompress_native_libraries=" + compress_native_libraries_flag); // argument to specify whether the build should compress native libraries.
cmdline.push_back("-Pgodot_editor_version=" + String(VERSION_FULL_CONFIG));
cmdline.push_back("-Pgodot_editor_version=" + String(GODOT_VERSION_FULL_CONFIG));
cmdline.push_back("-Pgodot_rendering_method=" + current_renderer);
// NOTE: The release keystore is not included in the verbose logging

View File

@ -81,10 +81,10 @@ static void handle_crash(int sig) {
print_error(vformat("%s: Program crashed with signal %d", __FUNCTION__, sig));
// Print the engine version just before, so that people are reminded to include the version in backtrace reports.
if (String(VERSION_HASH).is_empty()) {
print_error(vformat("Engine version: %s", VERSION_FULL_NAME));
if (String(GODOT_VERSION_HASH).is_empty()) {
print_error(vformat("Engine version: %s", GODOT_VERSION_FULL_NAME));
} else {
print_error(vformat("Engine version: %s (%s)", VERSION_FULL_NAME, VERSION_HASH));
print_error(vformat("Engine version: %s (%s)", GODOT_VERSION_FULL_NAME, GODOT_VERSION_HASH));
}
print_error(vformat("Dumping the backtrace. %s", msg));
char **strings = backtrace_symbols(bt_buffer, size);

View File

@ -105,10 +105,10 @@ static void handle_crash(int sig) {
print_error(vformat("%s: Program crashed with signal %d", __FUNCTION__, sig));
// Print the engine version just before, so that people are reminded to include the version in backtrace reports.
if (String(VERSION_HASH).is_empty()) {
print_error(vformat("Engine version: %s", VERSION_FULL_NAME));
if (String(GODOT_VERSION_HASH).is_empty()) {
print_error(vformat("Engine version: %s", GODOT_VERSION_FULL_NAME));
} else {
print_error(vformat("Engine version: %s (%s)", VERSION_FULL_NAME, VERSION_HASH));
print_error(vformat("Engine version: %s (%s)", GODOT_VERSION_FULL_NAME, GODOT_VERSION_HASH));
}
print_error(vformat("Dumping the backtrace. %s", msg));
char **strings = backtrace_symbols(bt_buffer, size);

View File

@ -342,7 +342,7 @@ String OS_MacOS::get_bundle_icon_path() const {
// Get properly capitalized engine name for system paths
String OS_MacOS::get_godot_dir_name() const {
return String(VERSION_SHORT_NAME).capitalize();
return String(GODOT_VERSION_SHORT_NAME).capitalize();
}
String OS_MacOS::get_system_dir(SystemDir p_dir, bool p_shared_storage) const {

View File

@ -147,10 +147,10 @@ DWORD CrashHandlerException(EXCEPTION_POINTERS *ep) {
print_error(vformat("%s: Program crashed", __FUNCTION__));
// Print the engine version just before, so that people are reminded to include the version in backtrace reports.
if (String(VERSION_HASH).is_empty()) {
print_error(vformat("Engine version: %s", VERSION_FULL_NAME));
if (String(GODOT_VERSION_HASH).is_empty()) {
print_error(vformat("Engine version: %s", GODOT_VERSION_FULL_NAME));
} else {
print_error(vformat("Engine version: %s (%s)", VERSION_FULL_NAME, VERSION_HASH));
print_error(vformat("Engine version: %s (%s)", GODOT_VERSION_FULL_NAME, GODOT_VERSION_HASH));
}
print_error(vformat("Dumping the backtrace. %s", msg));

View File

@ -153,10 +153,10 @@ extern void CrashHandlerException(int signal) {
print_error(vformat("%s: Program crashed with signal %d", __FUNCTION__, signal));
// Print the engine version just before, so that people are reminded to include the version in backtrace reports.
if (String(VERSION_HASH).is_empty()) {
print_error(vformat("Engine version: %s", VERSION_FULL_NAME));
if (String(GODOT_VERSION_HASH).is_empty()) {
print_error(vformat("Engine version: %s", GODOT_VERSION_FULL_NAME));
} else {
print_error(vformat("Engine version: %s (%s)", VERSION_FULL_NAME, VERSION_HASH));
print_error(vformat("Engine version: %s (%s)", GODOT_VERSION_FULL_NAME, GODOT_VERSION_HASH));
}
print_error(vformat("Dumping the backtrace. %s", msg));

View File

@ -713,7 +713,7 @@ Error DisplayServerWindows::_file_dialog_with_options_show(const String &p_title
String appname;
if (Engine::get_singleton()->is_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");

View File

@ -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();

View File

@ -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"

View File

@ -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"

View File

@ -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 {

View File

@ -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;

View File

@ -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

View File

@ -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) {

View File

@ -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.

View File

@ -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";

View File

@ -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]");