summaryrefslogtreecommitdiff
path: root/core/extension
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-03 14:28:18 +0200
committerGitHub <noreply@github.com>2022-05-03 14:28:18 +0200
commit297241f368632dd91a3e7df47da3d9e5197e4f1e (patch)
tree78eba933e9940b9a65bbe1ee02027a61e98f6716 /core/extension
parent77c9138e7274f0b7d2ae1327748774ab74bd5d5c (diff)
parent180e5d30286279c979507a571bf6d336aa49da9d (diff)
Merge pull request #60714 from Calinou/typedef-remove-ref
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
Diffstat (limited to 'core/extension')
-rw-r--r--core/extension/native_extension.cpp10
-rw-r--r--core/extension/native_extension.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/core/extension/native_extension.cpp b/core/extension/native_extension.cpp
index 4fc7d71387..5c02cb9190 100644
--- a/core/extension/native_extension.cpp
+++ b/core/extension/native_extension.cpp
@@ -363,7 +363,7 @@ void NativeExtension::initialize_native_extensions() {
gdnative_interface.get_library_path = _get_library_path;
}
-RES NativeExtensionResourceLoader::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) {
+Ref<Resource> NativeExtensionResourceLoader::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) {
Ref<ConfigFile> config;
config.instantiate();
@@ -374,14 +374,14 @@ RES NativeExtensionResourceLoader::load(const String &p_path, const String &p_or
}
if (err != OK) {
- return RES();
+ return Ref<Resource>();
}
if (!config->has_section_key("configuration", "entry_symbol")) {
if (r_error) {
*r_error = ERR_INVALID_DATA;
}
- return RES();
+ return Ref<Resource>();
}
String entry_symbol = config->get_value("configuration", "entry_symbol");
@@ -413,7 +413,7 @@ RES NativeExtensionResourceLoader::load(const String &p_path, const String &p_or
if (r_error) {
*r_error = ERR_FILE_NOT_FOUND;
}
- return RES();
+ return Ref<Resource>();
}
if (!library_path.is_resource_file()) {
@@ -430,7 +430,7 @@ RES NativeExtensionResourceLoader::load(const String &p_path, const String &p_or
}
if (err != OK) {
- return RES();
+ return Ref<Resource>();
}
return lib;
diff --git a/core/extension/native_extension.h b/core/extension/native_extension.h
index d29ccd81b8..028a627b2e 100644
--- a/core/extension/native_extension.h
+++ b/core/extension/native_extension.h
@@ -92,7 +92,7 @@ VARIANT_ENUM_CAST(NativeExtension::InitializationLevel)
class NativeExtensionResourceLoader : public ResourceFormatLoader {
public:
- virtual RES load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads = false, float *r_progress = nullptr, CacheMode p_cache_mode = CACHE_MODE_REUSE);
+ virtual Ref<Resource> load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads = false, float *r_progress = nullptr, CacheMode p_cache_mode = CACHE_MODE_REUSE);
virtual void get_recognized_extensions(List<String> *p_extensions) const;
virtual bool handles_type(const String &p_type) const;
virtual String get_resource_type(const String &p_path) const;