Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Spartan322 committed Dec 21, 2024
2 parents e2a601f + a7a2a12 commit 63f20a5
Show file tree
Hide file tree
Showing 746 changed files with 15,794 additions and 4,644 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ jobs:
python-version: 3.8
scons-version: 4.0

- name: Force remove preinstalled .NET SDKs
if: matrix.build-mono
run: |
sudo rm -rf /usr/share/dotnet/sdk/*
- name: Setup older .NET SDK as baseline
if: matrix.build-mono
uses: actions/setup-dotnet@v4
with:
# Targeting the oldest version we want to support to ensure it still builds.
dotnet-version: '8.0.100'

- name: Compilation
uses: ./.github/actions/godot-build
with:
Expand All @@ -163,7 +175,8 @@ jobs:
- name: Build .NET solutions
if: matrix.build-mono
run: |
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
dotnet --info
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd --werror
- name: Prepare artifact
if: matrix.artifact
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ repos:
name: doc-status
language: python
entry: python doc/tools/doc_status.py
args: [doc/classes, modules/*/doc_classes, platform/*/doc_classes]
args: [doc/classes, modules/*/doc_classes, platform/*/doc_classes, -c]
pass_filenames: false
files: ^(doc/classes|.*/doc_classes)/.*\.xml$

Expand Down
2 changes: 1 addition & 1 deletion COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Comment: Intel ASSAO and related files
Copyright: 2016, Intel Corporation
License: Expat

Files: ./servers/rendering/renderer_rd/shaders/taa_resolve.glsl
Files: ./servers/rendering/renderer_rd/shaders/effects/taa_resolve.glsl
Comment: Temporal Anti-Aliasing resolve implementation
Copyright: 2016, Panos Karabelas
License: Expat
Expand Down
26 changes: 4 additions & 22 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,13 @@ import gles3_builders
import glsl_builders
import methods
import scu_builders
from methods import print_error, print_warning
from methods import Ansi, print_error, print_info, print_warning
from platform_methods import architecture_aliases, architectures, compatibility_platform_aliases

if ARGUMENTS.get("target", "editor") == "editor":
_helper_module("editor.editor_builders", "editor/editor_builders.py")
_helper_module("editor.template_builders", "editor/template_builders.py")

# Enable ANSI escape code support on Windows 10 and later (for colored console output).
# <https://github.com/python/cpython/issues/73245>
if sys.stdout.isatty() and sys.platform == "win32":
try:
from ctypes import WinError, byref, windll # type: ignore
from ctypes.wintypes import DWORD # type: ignore

stdout_handle = windll.kernel32.GetStdHandle(DWORD(-11))
mode = DWORD(0)
if not windll.kernel32.GetConsoleMode(stdout_handle, byref(mode)):
raise WinError()
mode = DWORD(mode.value | 4)
if not windll.kernel32.SetConsoleMode(stdout_handle, mode):
raise WinError()
except Exception as e:
methods._colorize = False
print_error(f"Failed to enable ANSI escape code support, disabling color output.\n{e}")

# Scan possible build platforms

platform_list = [] # list of platforms
Expand Down Expand Up @@ -635,7 +617,7 @@ detect.configure(env)

print(f'Building for platform "{env["platform"]}", architecture "{env["arch"]}", target "{env["target"]}".')
if env.dev_build:
print("NOTE: Developer build, with debug optimization level and debug symbols (unless overridden).")
print_info("Developer build, with debug optimization level and debug symbols (unless overridden).")

# Enforce our minimal compiler version requirements
cc_version = methods.get_compiler_version(env)
Expand Down Expand Up @@ -1111,10 +1093,10 @@ def print_elapsed_time():
time_centiseconds = round((elapsed_time_sec % 1) * 100)
print(
"{}[Time elapsed: {}.{:02}]{}".format(
methods.ANSI.GRAY,
Ansi.GRAY,
time.strftime("%H:%M:%S", time.gmtime(elapsed_time_sec)),
time_centiseconds,
methods.ANSI.RESET,
Ansi.RESET,
)
)

Expand Down
8 changes: 8 additions & 0 deletions core/config/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,14 @@ void Engine::set_freeze_time_scale(bool p_frozen) {
freeze_time_scale = p_frozen;
}

void Engine::set_embedded_in_editor(bool p_enabled) {
embedded_in_editor = p_enabled;
}

bool Engine::is_embedded_in_editor() const {
return embedded_in_editor;
}

Engine::Engine() {
singleton = this;
}
Expand Down
4 changes: 3 additions & 1 deletion core/config/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "core/os/main_loop.h"
#include "core/string/ustring.h"
#include "core/templates/list.h"
#include "core/templates/vector.h"

template <typename T>
class TypedArray;
Expand Down Expand Up @@ -89,6 +88,7 @@ class Engine {
bool editor_hint = false;
bool project_manager_hint = false;
bool extension_reloading = false;
bool embedded_in_editor = false;

bool _print_header = true;

Expand Down Expand Up @@ -206,6 +206,8 @@ class Engine {
bool notify_frame_server_synced();

void set_freeze_time_scale(bool p_frozen);
void set_embedded_in_editor(bool p_enabled);
bool is_embedded_in_editor() const;

Engine();
virtual ~Engine();
Expand Down
9 changes: 4 additions & 5 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include "core/io/marshalls.h"
#include "core/io/resource_uid.h"
#include "core/object/script_language.h"
#include "core/os/keyboard.h"
#include "core/templates/rb_set.h"
#include "core/variant/typed_array.h"
#include "core/variant/variant_parser.h"
Expand Down Expand Up @@ -900,7 +899,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const RBMap<S

if (!p_custom_features.is_empty()) {
// Store how many properties are saved, add one for custom features, which must always go first.
file->store_32(count + 1);
file->store_32(uint32_t(count + 1));
String key = CoreStringName(_custom_features);
file->store_pascal_string(key);

Expand All @@ -913,12 +912,12 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const RBMap<S

err = encode_variant(p_custom_features, buff.ptrw(), len, false);
ERR_FAIL_COND_V(err != OK, err);
file->store_32(len);
file->store_32(uint32_t(len));
file->store_buffer(buff.ptr(), buff.size());

} else {
// Store how many properties are saved.
file->store_32(count);
file->store_32(uint32_t(count));
}

for (const KeyValue<String, List<String>> &E : p_props) {
Expand All @@ -945,7 +944,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const RBMap<S

err = encode_variant(value, buff.ptrw(), len, true);
ERR_FAIL_COND_V_MSG(err != OK, ERR_INVALID_DATA, "Error when trying to encode Variant.");
file->store_32(len);
file->store_32(uint32_t(len));
file->store_buffer(buff.ptr(), buff.size());
}
}
Expand Down
6 changes: 2 additions & 4 deletions core/config/project_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ class ProjectSettings : public Object {
typedef HashMap<String, Variant> CustomMap;
static const String PROJECT_DATA_DIR_NAME_SUFFIX;

enum {
// Properties that are not for built in values begin from this value, so builtin ones are displayed first.
NO_BUILTIN_ORDER_BASE = 1 << 16
};
// Properties that are not for built in values begin from this value, so builtin ones are displayed first.
constexpr static const int32_t NO_BUILTIN_ORDER_BASE = 1 << 16;

#ifdef TOOLS_ENABLED
const static PackedStringArray get_required_features();
Expand Down
12 changes: 10 additions & 2 deletions core/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include "core/crypto/crypto_core.h"
#include "core/debugger/engine_debugger.h"
#include "core/debugger/script_debugger.h"
#include "core/io/file_access_compressed.h"
#include "core/io/file_access_encrypted.h"
#include "core/io/marshalls.h"
#include "core/math/geometry_2d.h"
#include "core/math/geometry_3d.h"
Expand Down Expand Up @@ -426,6 +424,10 @@ String OS::get_version() const {
return ::OS::get_singleton()->get_version();
}

String OS::get_version_alias() const {
return ::OS::get_singleton()->get_version_alias();
}

Vector<String> OS::get_video_adapter_driver_info() const {
return ::OS::get_singleton()->get_video_adapter_driver_info();
}
Expand Down Expand Up @@ -682,6 +684,7 @@ void OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_name"), &OS::get_name);
ClassDB::bind_method(D_METHOD("get_distribution_name"), &OS::get_distribution_name);
ClassDB::bind_method(D_METHOD("get_version"), &OS::get_version);
ClassDB::bind_method(D_METHOD("get_version_alias"), &OS::get_version_alias);
ClassDB::bind_method(D_METHOD("get_cmdline_args"), &OS::get_cmdline_args);
ClassDB::bind_method(D_METHOD("get_cmdline_user_args"), &OS::get_cmdline_user_args);

Expand Down Expand Up @@ -1917,6 +1920,10 @@ bool Engine::is_editor_hint() const {
return ::Engine::get_singleton()->is_editor_hint();
}

bool Engine::is_embedded_in_editor() const {
return ::Engine::get_singleton()->is_embedded_in_editor();
}

String Engine::get_write_movie_path() const {
return ::Engine::get_singleton()->get_write_movie_path();
}
Expand Down Expand Up @@ -1997,6 +2004,7 @@ void Engine::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_script_language", "index"), &Engine::get_script_language);

ClassDB::bind_method(D_METHOD("is_editor_hint"), &Engine::is_editor_hint);
ClassDB::bind_method(D_METHOD("is_embedded_in_editor"), &Engine::is_embedded_in_editor);

ClassDB::bind_method(D_METHOD("get_write_movie_path"), &Engine::get_write_movie_path);

Expand Down
5 changes: 3 additions & 2 deletions core/core_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
#include "core/debugger/engine_profiler.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/object/script_language.h"
#include "core/os/os.h"
#include "core/os/semaphore.h"
#include "core/os/thread.h"
#include "core/templates/safe_refcount.h"
Expand Down Expand Up @@ -210,6 +208,7 @@ class OS : public Object {
String get_name() const;
String get_distribution_name() const;
String get_version() const;
String get_version_alias() const;
Vector<String> get_cmdline_args();
Vector<String> get_cmdline_user_args();

Expand Down Expand Up @@ -590,6 +589,8 @@ class Engine : public Object {
void set_editor_hint(bool p_enabled);
bool is_editor_hint() const;

bool is_embedded_in_editor() const;

// `set_write_movie_path()` is not exposed to the scripting API as changing it at run-time has no effect.
String get_write_movie_path() const;

Expand Down
1 change: 0 additions & 1 deletion core/core_constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "core/input/input_event.h"
#include "core/object/class_db.h"
#include "core/os/keyboard.h"
#include "core/templates/hash_set.h"
#include "core/variant/variant.h"

struct _CoreConstant {
Expand Down
2 changes: 1 addition & 1 deletion core/core_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define CORE_CONSTANTS_H

#include "core/string/string_name.h"
#include "core/templates/hash_set.h"
#include "core/templates/hash_map.h"

class CoreConstants {
public:
Expand Down
2 changes: 1 addition & 1 deletion core/crypto/aes_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AESContext : public RefCounted {
GDCLASS(AESContext, RefCounted);

public:
enum Mode {
enum Mode : int32_t {
MODE_ECB_ENCRYPT,
MODE_ECB_DECRYPT,
MODE_CBC_ENCRYPT,
Expand Down
4 changes: 0 additions & 4 deletions core/crypto/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@

#include "crypto.h"

#include "core/config/engine.h"
#include "core/io/certs_compressed.gen.h"
#include "core/io/compression.h"

/// Resources

CryptoKey *(*CryptoKey::_create)(bool p_notify_postinitialize) = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion core/crypto/hashing_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class HashingContext : public RefCounted {
GDCLASS(HashingContext, RefCounted);

public:
enum HashType {
enum HashType : int32_t {
HASH_MD5,
HASH_SHA1,
HASH_SHA256
Expand Down
1 change: 0 additions & 1 deletion core/debugger/engine_debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "core/templates/hash_map.h"
#include "core/templates/vector.h"
#include "core/variant/array.h"
#include "core/variant/variant.h"

class RemoteDebuggerPeer;
class ScriptDebugger;
Expand Down
1 change: 0 additions & 1 deletion core/debugger/script_debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "core/object/script_language.h"
#include "core/string/string_name.h"
#include "core/templates/hash_set.h"
#include "core/templates/rb_map.h"
#include "core/templates/vector.h"

class ScriptDebugger {
Expand Down
33 changes: 0 additions & 33 deletions core/doc_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,28 +107,6 @@ void DocData::argument_doc_from_arginfo(DocData::ArgumentDoc &p_argument, const
}
}

void DocData::property_doc_from_scriptmemberinfo(DocData::PropertyDoc &p_property, const ScriptMemberInfo &p_memberinfo) {
p_property.name = p_memberinfo.propinfo.name;
p_property.description = p_memberinfo.doc_string;

if (p_memberinfo.propinfo.type == Variant::OBJECT) {
p_property.type = p_memberinfo.propinfo.class_name;
} else if (p_memberinfo.propinfo.type == Variant::NIL && p_memberinfo.propinfo.usage & PROPERTY_USAGE_NIL_IS_VARIANT) {
p_property.type = "Variant";
} else {
p_property.type = Variant::get_type_name(p_memberinfo.propinfo.type);
}

p_property.setter = p_memberinfo.setter;
p_property.getter = p_memberinfo.getter;

if (p_memberinfo.has_default_value && p_memberinfo.default_value.get_type() != Variant::OBJECT) {
p_property.default_value = get_default_value_string(p_memberinfo.default_value);
}

p_property.overridden = false;
}

void DocData::method_doc_from_methodinfo(DocData::MethodDoc &p_method, const MethodInfo &p_methodinfo, const String &p_desc) {
p_method.name = p_methodinfo.name;
p_method.description = p_desc;
Expand Down Expand Up @@ -172,14 +150,3 @@ void DocData::method_doc_from_methodinfo(DocData::MethodDoc &p_method, const Met
p_method.arguments.push_back(argument);
}
}

void DocData::constant_doc_from_variant(DocData::ConstantDoc &p_const, const StringName &p_name, const Variant &p_value, const String &p_desc) {
p_const.name = p_name;
p_const.value = p_value;
p_const.is_value_valid = (p_value.get_type() != Variant::OBJECT);
p_const.description = p_desc;
}

void DocData::signal_doc_from_methodinfo(DocData::MethodDoc &p_signal, const MethodInfo &p_methodinfo, const String &p_desc) {
return method_doc_from_methodinfo(p_signal, p_methodinfo, p_desc);
}
Loading

0 comments on commit 63f20a5

Please sign in to comment.