You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
This commit is contained in:
@@ -5393,7 +5393,7 @@ void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) cons
|
||||
bool add_preview = false;
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
String path = files[i];
|
||||
RES res = ResourceLoader::load(path);
|
||||
Ref<Resource> res = ResourceLoader::load(path);
|
||||
ERR_FAIL_COND(res.is_null());
|
||||
Ref<Texture2D> texture = Ref<Texture2D>(Object::cast_to<Texture2D>(*res));
|
||||
Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res));
|
||||
@@ -5588,7 +5588,7 @@ void CanvasItemEditorViewport::_perform_drop_data() {
|
||||
|
||||
for (int i = 0; i < selected_files.size(); i++) {
|
||||
String path = selected_files[i];
|
||||
RES res = ResourceLoader::load(path);
|
||||
Ref<Resource> res = ResourceLoader::load(path);
|
||||
if (res.is_null()) {
|
||||
continue;
|
||||
}
|
||||
@@ -5643,7 +5643,7 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
// Check if dragged files with texture or scene extension can be created at least once.
|
||||
if (texture_extensions.find(files[i].get_extension()) || scene_extensions.find(files[i].get_extension())) {
|
||||
RES res = ResourceLoader::load(files[i]);
|
||||
Ref<Resource> res = ResourceLoader::load(files[i]);
|
||||
if (res.is_null()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user