Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/all_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ env:
# TODO: change this back to godotengine/godot and target master when #109685 and #109475 are merged
GODOT_REPOSITORY: nikitalita/godot
# Change the README too
GODOT_MAIN_SYNC_REF: gdre-wb-c53c5a1f49
GODOT_MAIN_SYNC_REF: gdre-wb-babc272d44e
SCONSFLAGS: verbose=yes warnings=all werror=no module_text_server_fb_enabled=yes minizip=yes deprecated=yes
SCONSFLAGS_TEMPLATE: no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no
SCONS_CACHE_MSVC_CONFIG: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Note: Make sure to build the editor build first, and to launch the editor to edi

### Requirements

[Our fork of godot](https://github.com/nikitalita/godot) @ branch `gdre-wb-c53c5a1f49`
[Our fork of godot](https://github.com/nikitalita/godot) @ branch `gdre-wb-babc272d44e`

- Support for building on 3.x has been dropped and no new features are being pushed
- Godot RE Tools still retains the ability to decompile 3.x and 2.x projects, however.
Expand Down
2 changes: 1 addition & 1 deletion build/mono_decomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def build_godot_mono_decomp(
else:
lib_suffix = ".so"

src_suffixes = ["*.h", "*.cs", "*.csproj", "*.props", "*.targets", "*.pubxml"]
src_suffixes = ["*.h", "*.cs", "*.csproj", "*.props", "*.targets", "*.pubxml", "*.config"]

def _builder_action(target, source, env):
return godot_mono_builder(
Expand Down
8 changes: 2 additions & 6 deletions bytecode/bytecode_custom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ GDScriptDecomp_custom::GDScriptDecomp_custom(Dictionary p_custom_def) {
functions = p_custom_def.get("func_names", Vector<String>());
}

GDScriptDecomp_custom *GDScriptDecomp_custom::_create_from_json(Dictionary p_custom_def) {
Ref<GDScriptDecomp_custom> GDScriptDecomp_custom::create_from_json(Dictionary p_custom_def) {
if ((int)p_custom_def.get("bytecode_version", 0) == 0) {
ERR_FAIL_V_MSG(nullptr, "Bytecode version is required");
}
Expand Down Expand Up @@ -194,9 +194,5 @@ GDScriptDecomp_custom *GDScriptDecomp_custom::_create_from_json(Dictionary p_cus
// if (p_custom_def.get("date", "") == "") {
// return nullptr;
// }
return memnew(GDScriptDecomp_custom(p_custom_def));
}

Ref<GDScriptDecomp_custom> GDScriptDecomp_custom::create_from_json(Dictionary p_custom_def) {
return Ref<GDScriptDecomp_custom>(_create_from_json(p_custom_def));
return Ref<GDScriptDecomp_custom>(memnew(GDScriptDecomp_custom(p_custom_def)));
}
1 change: 0 additions & 1 deletion bytecode/bytecode_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ class GDScriptDecomp_custom : public GDScriptDecomp {
virtual bool is_custom() const override { return true; }
GDScriptDecomp_custom() {}

static GDScriptDecomp_custom *_create_from_json(Dictionary p_custom_def);
static Ref<GDScriptDecomp_custom> create_from_json(Dictionary p_custom_def);
};
6 changes: 3 additions & 3 deletions bytecode/bytecode_versions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void register_decomp_versions() {
ClassDB::register_class<GDScriptDecomp_custom>();
}

GDScriptDecomp *GDScriptDecompVersion::create_decomp_for_commit(int p_commit_hash) {
Ref<GDScriptDecomp> GDScriptDecompVersion::create_decomp_for_commit(int p_commit_hash) {
switch (p_commit_hash) {
case 0xebc36a7: return memnew(GDScriptDecomp_ebc36a7);
case 0x2e216b5: return memnew(GDScriptDecomp_2e216b5);
Expand Down Expand Up @@ -297,9 +297,9 @@ Vector<GDScriptDecompVersion> GDScriptDecompVersion::get_decomp_versions(bool in
return versions;
}

GDScriptDecomp *GDScriptDecompVersion::create_decomp() const {
Ref<GDScriptDecomp> GDScriptDecompVersion::create_decomp() const {
if (is_custom()) {
return GDScriptDecomp_custom::_create_from_json(custom);
return GDScriptDecomp_custom::create_from_json(custom);
}
return create_decomp_for_commit(commit);
}
Expand Down
4 changes: 2 additions & 2 deletions bytecode/bytecode_versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct GDScriptDecompVersion {

int get_major_version() const;

static GDScriptDecomp *create_decomp_for_commit(int p_commit_hash);
static Ref<GDScriptDecomp> create_decomp_for_commit(int p_commit_hash);
static Vector<Ref<GDScriptDecomp>> get_decomps_for_bytecode_ver(int bytecode_version, bool include_dev = false);
static Vector<GDScriptDecompVersion> get_decomp_versions(bool include_dev = true, int ver_major = 0);

Expand All @@ -34,5 +34,5 @@ struct GDScriptDecompVersion {
static int register_decomp_version_custom(Dictionary p_custom_def);
static int register_derived_decomp_version_custom(int revision, Dictionary p_custom_def);

GDScriptDecomp *create_decomp() const;
Ref<GDScriptDecomp> create_decomp() const;
};
12 changes: 6 additions & 6 deletions compat/resource_compat_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ Error ResourceLoaderCompatBinary::load() {
Ref<Resource> res;
Resource *r = nullptr;

MissingResource *missing_resource = nullptr;
Ref<MissingResource> missing_resource = nullptr;
Ref<ResourceCompatConverter> converter;

if (main && (is_real_load())) {
Expand All @@ -810,7 +810,7 @@ Error ResourceLoaderCompatBinary::load() {
auto nres = main ? CompatFormatLoader::create_missing_main_resource(path, t, uid, no_fake_script) : CompatFormatLoader::create_missing_internal_resource(path, t, id, no_fake_script);
res = Ref<Resource>(nres);
if (res->get_class() == "MissingResource") {
missing_resource = Object::cast_to<MissingResource>(res.ptr());
missing_resource = res;
} else {
fake_script = true;
}
Expand Down Expand Up @@ -849,7 +849,7 @@ Error ResourceLoaderCompatBinary::load() {
missing_resource = memnew(MissingResource);
missing_resource->set_original_class(t);
missing_resource->set_recording_properties(true);
obj = missing_resource;
obj = missing_resource.ptr();
} else {
error = ERR_FILE_CORRUPT;
ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, vformat("'%s': Resource of unrecognized type in file: '%s'.", local_path, t));
Expand Down Expand Up @@ -914,7 +914,7 @@ Error ResourceLoaderCompatBinary::load() {
}

bool set_valid = true;
if (value.get_type() == Variant::OBJECT && (!fake_script && missing_resource == nullptr) && ResourceLoader::is_creating_missing_resources_if_class_unavailable_enabled()) {
if (value.get_type() == Variant::OBJECT && (!fake_script && missing_resource.is_null()) && ResourceLoader::is_creating_missing_resources_if_class_unavailable_enabled()) {
// If the property being set is a missing resource (and the parent is not),
// then setting it will most likely not work.
// Instead, save it as metadata.
Expand Down Expand Up @@ -969,7 +969,7 @@ Error ResourceLoaderCompatBinary::load() {
}

if (set_valid) {
if (!missing_resource && ver_major <= 2 && name == "resource/name") {
if (missing_resource.is_null() && ver_major <= 2 && name == "resource/name") {
name = "resource_name";
}
bool valid = false;
Expand All @@ -985,7 +985,7 @@ Error ResourceLoaderCompatBinary::load() {
}
}

if (missing_resource) {
if (missing_resource.is_valid()) {
missing_resource->set_recording_properties(false);
if (converter.is_valid()) {
Ref<ResourceInfo> compat = ResourceInfo::get_info_from_resource(missing_resource);
Expand Down
18 changes: 10 additions & 8 deletions compat/resource_compat_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ Error ResourceLoaderCompatText::load() {

bool not_cached = false;
bool fake_script = false;
MissingResource *missing_resource = nullptr;
Ref<MissingResource> missing_resource = nullptr;
Ref<ResourceCompatConverter> converter;
auto init_missing_internal_resource([&](bool no_fake_script) {
auto nres = CompatFormatLoader::create_missing_internal_resource(path, type, id, no_fake_script);
Expand Down Expand Up @@ -690,7 +690,7 @@ Error ResourceLoaderCompatText::load() {
missing_resource = memnew(MissingResource);
missing_resource->set_original_class(type);
missing_resource->set_recording_properties(true);
obj = missing_resource;
obj = missing_resource.ptr();
} else {
error_text = vformat("Can't create sub resource of type '%s'", type);
_printerr();
Expand Down Expand Up @@ -799,7 +799,7 @@ Error ResourceLoaderCompatText::load() {
}

if (set_valid) {
if (!missing_resource && ver_major <= 2 && assign == "resource/name") {
if (missing_resource.is_null() && ver_major <= 2 && assign == "resource/name") {
assign = "resource_name";
}
bool valid = false;
Expand All @@ -826,7 +826,7 @@ Error ResourceLoaderCompatText::load() {
}
}

if (missing_resource) {
if (missing_resource.is_valid()) {
missing_resource->set_recording_properties(false);
if (converter.is_valid()) {
Ref<ResourceInfo> compat = ResourceInfo::get_info_from_resource(missing_resource);
Expand Down Expand Up @@ -880,7 +880,7 @@ Error ResourceLoaderCompatText::load() {
}

bool fake_script = false;
MissingResource *missing_resource = nullptr;
Ref<MissingResource> missing_resource = nullptr;
Ref<ResourceCompatConverter> converter;
auto init_missing_main_resource([&](bool no_fake_script) {
auto res = CompatFormatLoader::create_missing_main_resource(local_path, res_type, res_uid, no_fake_script);
Expand Down Expand Up @@ -914,10 +914,12 @@ Error ResourceLoaderCompatText::load() {
}

if (!resource.is_valid()) {
Ref<Resource> res;
Object *obj = ClassDB::class_exists(res_type) || !ClassDB::get_compatibility_class(res_type).is_empty() ? ClassDB::instantiate(res_type) : nullptr;
if (!obj) {
if (ResourceLoader::is_creating_missing_resources_if_class_unavailable_enabled()) {
obj = CompatFormatLoader::create_missing_main_resource(local_path, res_type, res_uid);
res = CompatFormatLoader::create_missing_main_resource(local_path, res_type, res_uid);
obj = res.ptr();
if (obj->get_class() == "MissingResource") {
missing_resource = Object::cast_to<MissingResource>(obj);
missing_resource->set_original_class(res_type);
Expand Down Expand Up @@ -1015,7 +1017,7 @@ Error ResourceLoaderCompatText::load() {
}

if (set_valid) {
if (!missing_resource && ver_major <= 2 && assign == "resource/name") {
if (missing_resource.is_null() && ver_major <= 2 && assign == "resource/name") {
assign = "resource_name";
}
bool valid = false;
Expand Down Expand Up @@ -1046,7 +1048,7 @@ Error ResourceLoaderCompatText::load() {
*progress = resource_current / float(resources_total);
}

if (missing_resource) {
if (missing_resource.is_valid()) {
missing_resource->set_recording_properties(false);
if (converter.is_valid()) {
Ref<ResourceInfo> compat = ResourceInfo::get_info_from_resource(missing_resource);
Expand Down
20 changes: 10 additions & 10 deletions compat/resource_loader_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ class CompatFormatLoader : public ResourceFormatLoader {
}
}

static Resource *make_fakescript_or_mising_resource(const String &path, const String &type, const String &scene_id = "", bool no_fake_script = false) {
Resource *ret;
static Ref<Resource> make_fakescript_or_mising_resource(const String &path, const String &type, const String &scene_id = "", bool no_fake_script = false) {
Ref<Resource> ret;
if (!no_fake_script && (type == "Script" || type == "GDScript" || type == "CSharpScript")) {
FakeScript *res{ memnew(FakeScript) };
Ref<FakeScript> res{ memnew(FakeScript) };
res->set_original_class(type);
res->set_instance_recording_properties(false);
ret = res;
} else {
MissingResource *res{ memnew(MissingResource) };
Ref<MissingResource> res{ memnew(MissingResource) };
res->set_original_class(type);
res->set_recording_properties(true);
ret = res;
Expand All @@ -152,25 +152,25 @@ class CompatFormatLoader : public ResourceFormatLoader {
return res;
}

static Resource *create_missing_main_resource(const String &path, const String &type, const ResourceUID::ID uid, bool no_fake_script = false) {
Resource *res{ make_fakescript_or_mising_resource(path, type, "", no_fake_script) };
static Ref<Resource> create_missing_main_resource(const String &path, const String &type, const ResourceUID::ID uid, bool no_fake_script = false) {
Ref<Resource> res{ make_fakescript_or_mising_resource(path, type, "", no_fake_script) };
Ref<ResourceInfo> compat;
compat.instantiate();
compat->uid = uid;
compat->type = type;
compat->topology_type = ResourceInfo::MAIN_RESOURCE;
compat->_set_on_resource(res);
compat->set_on_resource(res);
return res;
}

static Resource *create_missing_internal_resource(const String &path, const String &type, const String &scene_id, bool no_fake_script = false) {
Resource *res{ make_fakescript_or_mising_resource("", type, scene_id, no_fake_script) };
static Ref<Resource> create_missing_internal_resource(const String &path, const String &type, const String &scene_id, bool no_fake_script = false) {
Ref<Resource> res{ make_fakescript_or_mising_resource("", type, scene_id, no_fake_script) };
Ref<ResourceInfo> compat;
compat.instantiate();
compat->uid = ResourceUID::INVALID_ID;
compat->type = type;
compat->topology_type = ResourceInfo::INTERNAL_RESOURCE;
compat->_set_on_resource(res);
compat->set_on_resource(res);
return res;
}

Expand Down
1 change: 0 additions & 1 deletion editor/gdre_cmp_dlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
/*************************************************************************/
#ifdef TOOLS_ENABLED
#include "editor/editor_node.h"
#include "editor/settings/editor_settings.h"
#endif
/*************************************************************************/

Expand Down
Loading
Loading