mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
parent
0f95e9f8e6
commit
a1846b27ea
177 changed files with 517 additions and 519 deletions
|
|
@ -91,12 +91,12 @@ Ref<Texture2D> EditorTexturePreviewPlugin::generate(const Ref<Resource> &p_from,
|
|||
|
||||
if (tex_atlas.is_valid()) {
|
||||
Ref<Texture2D> tex = tex_atlas->get_atlas();
|
||||
if (!tex.is_valid()) {
|
||||
if (tex.is_null()) {
|
||||
return Ref<Texture2D>();
|
||||
}
|
||||
|
||||
Ref<Image> atlas = tex->get_image();
|
||||
if (!atlas.is_valid()) {
|
||||
if (atlas.is_null()) {
|
||||
return Ref<Texture2D>();
|
||||
}
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ Ref<Texture2D> EditorMaterialPreviewPlugin::generate(const Ref<Resource> &p_from
|
|||
Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
|
||||
RS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
|
||||
|
||||
ERR_FAIL_COND_V(!img.is_valid(), Ref<ImageTexture>());
|
||||
ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
|
||||
|
||||
img->convert(Image::FORMAT_RGBA8);
|
||||
int thumbnail_size = MAX(p_size.x, p_size.y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue