mirror of
https://github.com/chenasraf/redot-engine.git
synced 2026-05-18 01:39:11 +00:00
Deref Godot: core/
This commit is contained in:
@@ -158,7 +158,7 @@ if env["builtin_zstd"]:
|
||||
env.core_sources += thirdparty_obj
|
||||
|
||||
|
||||
# Godot source files
|
||||
# Redot source files
|
||||
|
||||
env.add_source_files(env.core_sources, "*.cpp")
|
||||
|
||||
@@ -190,7 +190,7 @@ def version_info_builder(target, source, env):
|
||||
#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 VERSION_DOCS_URL "https://docs.redotengine.org/en/" VERSION_DOCS_BRANCH
|
||||
""".format(**env.version_info)
|
||||
)
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ String ProjectSettings::get_imported_files_path() const {
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
// Returns the features that a project must have when opened with this build of Godot.
|
||||
// Returns the features that a project must have when opened with this build of Redot.
|
||||
// This is used by the project manager to provide the initial_settings for config/features.
|
||||
const PackedStringArray ProjectSettings::get_required_features() {
|
||||
PackedStringArray features;
|
||||
@@ -87,7 +87,7 @@ const PackedStringArray ProjectSettings::get_required_features() {
|
||||
return features;
|
||||
}
|
||||
|
||||
// Returns the features supported by this build of Godot. Includes all required features.
|
||||
// Returns the features supported by this build of Redot. Includes all required features.
|
||||
const PackedStringArray ProjectSettings::_get_supported_features() {
|
||||
PackedStringArray features = get_required_features();
|
||||
#ifdef MODULE_MONO_ENABLED
|
||||
@@ -110,7 +110,7 @@ const PackedStringArray ProjectSettings::_get_supported_features() {
|
||||
return features;
|
||||
}
|
||||
|
||||
// Returns the features that this project needs but this build of Godot lacks.
|
||||
// Returns the features that this project needs but this build of Redot lacks.
|
||||
const PackedStringArray ProjectSettings::get_unsupported_features(const PackedStringArray &p_project_features) {
|
||||
PackedStringArray unsupported_features;
|
||||
PackedStringArray supported_features = singleton->_get_supported_features();
|
||||
@@ -127,7 +127,7 @@ const PackedStringArray ProjectSettings::get_unsupported_features(const PackedSt
|
||||
return unsupported_features;
|
||||
}
|
||||
|
||||
// Returns the features that both this project has and this build of Godot has, ensuring required features exist.
|
||||
// Returns the features that both this project has and this build of Redot has, ensuring required features exist.
|
||||
const PackedStringArray ProjectSettings::_trim_to_supported_features(const PackedStringArray &p_project_features) {
|
||||
// Remove unsupported features if present.
|
||||
PackedStringArray features = PackedStringArray(p_project_features);
|
||||
@@ -571,7 +571,7 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b
|
||||
bool found = _load_resource_pack(exec_path);
|
||||
|
||||
// Attempt with exec_name.pck.
|
||||
// (This is the usual case when distributing a Godot game.)
|
||||
// (This is the usual case when distributing a Redot game.)
|
||||
String exec_dir = exec_path.get_base_dir();
|
||||
String exec_filename = exec_path.get_file();
|
||||
String exec_basename = exec_filename.get_basename();
|
||||
@@ -1411,7 +1411,7 @@ void ProjectSettings::_add_builtin_input_map() {
|
||||
|
||||
ProjectSettings::ProjectSettings() {
|
||||
// Initialization of engine variables should be done in the setup() method,
|
||||
// so that the values can be overridden from project.godot or project.binary.
|
||||
// so that the values can be overridden from project.redot or project.binary.
|
||||
|
||||
CRASH_COND_MSG(singleton != nullptr, "Instantiating a new ProjectSettings singleton is not supported.");
|
||||
singleton = this;
|
||||
|
||||
@@ -289,18 +289,18 @@ String OS::get_executable_path() const {
|
||||
|
||||
Error OS::shell_open(const String &p_uri) {
|
||||
if (p_uri.begins_with("res://")) {
|
||||
WARN_PRINT("Attempting to open an URL with the \"res://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_open()`.");
|
||||
WARN_PRINT("Attempting to open an URL with the \"res://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Redot-specific path to a system path before opening it with `OS.shell_open()`.");
|
||||
} else if (p_uri.begins_with("user://")) {
|
||||
WARN_PRINT("Attempting to open an URL with the \"user://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_open()`.");
|
||||
WARN_PRINT("Attempting to open an URL with the \"user://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Redot-specific path to a system path before opening it with `OS.shell_open()`.");
|
||||
}
|
||||
return ::OS::get_singleton()->shell_open(p_uri);
|
||||
}
|
||||
|
||||
Error OS::shell_show_in_file_manager(const String &p_path, bool p_open_folder) {
|
||||
if (p_path.begins_with("res://")) {
|
||||
WARN_PRINT("Attempting to explore file path with the \"res://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_show_in_file_manager()`.");
|
||||
WARN_PRINT("Attempting to explore file path with the \"res://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Redot-specific path to a system path before opening it with `OS.shell_show_in_file_manager()`.");
|
||||
} else if (p_path.begins_with("user://")) {
|
||||
WARN_PRINT("Attempting to explore file path with the \"user://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_show_in_file_manager()`.");
|
||||
WARN_PRINT("Attempting to explore file path with the \"user://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Redot-specific path to a system path before opening it with `OS.shell_show_in_file_manager()`.");
|
||||
}
|
||||
return ::OS::get_singleton()->shell_show_in_file_manager(p_path, p_open_folder);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ elif is_builtin:
|
||||
# Needed to force rebuilding the core files when the configuration file is updated.
|
||||
thirdparty_obj = ["#thirdparty/mbedtls/include/godot_module_mbedtls_config.h"]
|
||||
|
||||
# Godot source files
|
||||
# Redot source files
|
||||
|
||||
core_obj = []
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Game Controller DB for Godot in SDL 2.0.16 format
|
||||
# Source: https://github.com/godotengine/godot
|
||||
# Game Controller DB for Redot in SDL 2.0.16 format
|
||||
# Source: https://github.com/Redot-Engine/redot-engine
|
||||
|
||||
# Windows
|
||||
__XINPUT_DEVICE__,XInput Gamepad,a:b12,b:b13,x:b14,y:b15,start:b4,guide:b10,back:b5,leftstick:b6,rightstick:b7,leftshoulder:b8,rightshoulder:b9,dpup:b0,dpdown:b1,dpleft:b2,dpright:b3,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,platform:Windows,
|
||||
|
||||
@@ -148,7 +148,7 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p
|
||||
ERR_FAIL_COND_V(res != BROTLI_DECODER_RESULT_SUCCESS, -1);
|
||||
return ret_size;
|
||||
#else
|
||||
ERR_FAIL_V_MSG(-1, "Godot was compiled without brotli support.");
|
||||
ERR_FAIL_V_MSG(-1, "Redot was compiled without brotli support.");
|
||||
#endif
|
||||
} break;
|
||||
case MODE_FASTLZ: {
|
||||
@@ -269,7 +269,7 @@ int Compression::decompress_dynamic(Vector<uint8_t> *p_dst_vect, int p_max_dst_s
|
||||
BrotliDecoderDestroyInstance(state);
|
||||
return Z_OK;
|
||||
#else
|
||||
ERR_FAIL_V_MSG(Z_ERRNO, "Godot was compiled without brotli support.");
|
||||
ERR_FAIL_V_MSG(Z_ERRNO, "Redot was compiled without brotli support.");
|
||||
#endif
|
||||
} else {
|
||||
// This function only supports GZip and Deflate.
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "core/templates/list.h"
|
||||
#include "core/templates/rb_map.h"
|
||||
|
||||
// Godot's packed file magic header ("GDPC" in ASCII).
|
||||
// Redot's packed file magic header ("GDPC" in ASCII).
|
||||
#define PACK_HEADER_MAGIC 0x43504447
|
||||
// The current packed file format version number.
|
||||
#define PACK_FORMAT_VERSION 2
|
||||
|
||||
@@ -1024,7 +1024,7 @@ Variant JSON::to_native(const Variant &p_json, bool p_allow_classes, bool p_allo
|
||||
case Variant::DICTIONARY: {
|
||||
Dictionary d = p_json;
|
||||
if (d.has(GDTYPE)) {
|
||||
// Specific Godot Variant types serialized to JSON.
|
||||
// Specific Redot Variant types serialized to JSON.
|
||||
String type = d[GDTYPE];
|
||||
if (type == Variant::get_type_name(Variant::VECTOR2)) {
|
||||
ERR_FAIL_COND_V(!d.has(VALUES), Variant());
|
||||
|
||||
@@ -170,6 +170,7 @@ Error RemoteFilesystemClient::_synchronize_with_server(const String &p_host, int
|
||||
// Connection OK, now send the current file state.
|
||||
print_verbose("Remote Filesystem: Connection OK.");
|
||||
|
||||
// FIXME: Is rebranding needed here, to "GDFS"?
|
||||
// Header (GRFS) - Godot Remote File System
|
||||
print_verbose("Remote Filesystem: Sending header");
|
||||
tcp_client->put_u8('G');
|
||||
|
||||
@@ -2328,7 +2328,7 @@ Error ConvexHullComputer::convex_hull(const Vector<Vector3> &p_points, Geometry3
|
||||
e = e->get_next_edge_of_face();
|
||||
} while (e != e_start);
|
||||
|
||||
// reverse indices: Godot wants clockwise, but this is counter-clockwise
|
||||
// reverse indices: Redot wants clockwise, but this is counter-clockwise
|
||||
if (face.indices.size() > 2) {
|
||||
// reverse all but the first index.
|
||||
int *indices = face.indices.ptr();
|
||||
|
||||
@@ -185,8 +185,9 @@ void TransformInterpolator::interpolate_basis_linear(const Basis &p_prev, const
|
||||
r_result = p_prev.lerp(p_curr, p_fraction);
|
||||
|
||||
// It turns out we need to guard against zero scale basis.
|
||||
// This is kind of silly, as we should probably fix the bugs elsewhere in Godot that can't deal with
|
||||
// This is kind of silly, as we should probably fix the bugs elsewhere in Redot that can't deal with
|
||||
// zero scale, but until that time...
|
||||
// TODO: Rewrite this ^
|
||||
for (int n = 0; n < 3; n++) {
|
||||
Vector3 &axis = r_result[n];
|
||||
|
||||
@@ -288,7 +289,7 @@ TransformInterpolator::Method TransformInterpolator::_test_basis(Basis p_basis,
|
||||
r_needed_normalize = true;
|
||||
}
|
||||
|
||||
// Apply less stringent tests than the built in slerp, the standard Godot slerp
|
||||
// Apply less stringent tests than the built in slerp, the standard Redot slerp
|
||||
// is too susceptible to float error to be useful.
|
||||
real_t det = p_basis.determinant();
|
||||
if (!Math::is_equal_approx(det, 1, (real_t)0.01f)) {
|
||||
@@ -343,7 +344,7 @@ bool TransformInterpolator::_basis_is_orthogonal(const Basis &p_basis, real_t p_
|
||||
Basis identity;
|
||||
Basis m = p_basis * p_basis.transposed();
|
||||
|
||||
// Less stringent tests than the standard Godot slerp.
|
||||
// Less stringent tests than the standard Redot slerp.
|
||||
if (!_vec3_is_equal_approx(m[0], identity[0], p_epsilon) || !_vec3_is_equal_approx(m[1], identity[1], p_epsilon) || !_vec3_is_equal_approx(m[2], identity[2], p_epsilon)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
|
||||
// Native structs, used by binder
|
||||
struct NativeStruct {
|
||||
String ccode; // C code to create the native struct, fields separated by ; Arrays accepted (even containing other structs), also function pointers. All types must be Godot types.
|
||||
String ccode; // C code to create the native struct, fields separated by ; Arrays accepted (even containing other structs), also function pointers. All types must be Redot types.
|
||||
uint64_t struct_size; // local size of struct, for comparison
|
||||
};
|
||||
static HashMap<StringName, NativeStruct> native_structs;
|
||||
|
||||
@@ -114,7 +114,7 @@ class Script : public Resource {
|
||||
OBJ_SAVE_TYPE(Script);
|
||||
|
||||
protected:
|
||||
// Scripts are reloaded via the Script Editor when edited in Godot,
|
||||
// Scripts are reloaded via the Script Editor when edited in Redot,
|
||||
// the LSP server when edited in a connected external editor, or
|
||||
// through EditorFileSystem::_update_script_documentation when updated directly on disk.
|
||||
virtual bool editor_can_reload_from_file() override { return false; }
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
// - Must have recursive semnantics (or simulate, as this one does).
|
||||
// The implementation keeps the lock count in TS. Therefore, only
|
||||
// one object of each version of the template can exists; hence the Tag argument.
|
||||
// Tags must be unique across the Godot codebase.
|
||||
// Tags must be unique across the Redot codebase.
|
||||
// Also, don't forget to declare the thread_local variable on each use.
|
||||
template <int Tag>
|
||||
class SafeBinaryMutex {
|
||||
|
||||
@@ -72,7 +72,7 @@ String StringBuilder::as_string() const {
|
||||
|
||||
for (int i = 0; i < appended_strings.size(); i++) {
|
||||
if (appended_strings[i] == -1) {
|
||||
// Godot string
|
||||
// Redot string
|
||||
const String &s = strings[godot_string_elem];
|
||||
|
||||
memcpy(buffer + current_position, s.ptr(), s.length() * sizeof(char32_t));
|
||||
|
||||
@@ -42,7 +42,7 @@ class StringBuilder {
|
||||
Vector<String> strings;
|
||||
Vector<const char *> c_strings;
|
||||
|
||||
// -1 means it's a Godot String
|
||||
// -1 means it's a Redot String
|
||||
// a natural number means C string.
|
||||
Vector<int32_t> appended_strings;
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
_FORCE_INLINE_ uint32_t get_capacity() const { return hash_table_size_primes[capacity_index]; }
|
||||
_FORCE_INLINE_ uint32_t size() const { return num_elements; }
|
||||
|
||||
/* Standard Godot Container API */
|
||||
/* Standard Redot Container API */
|
||||
|
||||
bool is_empty() const {
|
||||
return num_elements == 0;
|
||||
|
||||
@@ -232,7 +232,7 @@ public:
|
||||
_FORCE_INLINE_ uint32_t get_capacity() const { return hash_table_size_primes[capacity_index]; }
|
||||
_FORCE_INLINE_ uint32_t size() const { return num_elements; }
|
||||
|
||||
/* Standard Godot Container API */
|
||||
/* Standard Redot Container API */
|
||||
|
||||
bool is_empty() const {
|
||||
return num_elements == 0;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#define _MKSTR(m_x) _STR(m_x)
|
||||
#endif
|
||||
|
||||
// Godot versions are of the form <major>.<minor> for the initial release,
|
||||
// Redot versions are of the form <major>.<minor> for the initial release,
|
||||
// and then <major>.<minor>.<patch> for subsequent bugfix releases where <patch> != 0
|
||||
// That's arbitrary, but we find it pretty and it's the current policy.
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
// Example: 3.1.4 will be 0x030104, making comparison easy from script.
|
||||
#define VERSION_HEX 0x10000 * VERSION_MAJOR + 0x100 * VERSION_MINOR + VERSION_PATCH
|
||||
|
||||
// Describes the full configuration of that Godot version, including the version number,
|
||||
// Describes the full configuration of that Redot 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
|
||||
@@ -74,8 +74,8 @@
|
||||
// Example: "3.1.4.stable.mono.official"
|
||||
#define VERSION_FULL_BUILD VERSION_FULL_CONFIG "." 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"
|
||||
// Same as above, but prepended with Redot's name and a cosmetic "v" for "version".
|
||||
// Example: "Redot v3.1.4.stable.official.mono"
|
||||
#define VERSION_FULL_NAME VERSION_NAME " v" VERSION_FULL_BUILD
|
||||
|
||||
// Git commit hash, generated at build time in `core/version_hash.gen.cpp`.
|
||||
|
||||
Reference in New Issue
Block a user