Improve use of Ref.is_null/valid

Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
A Thousand Ships
2024-08-25 14:15:10 +02:00
committed by AThousandShips
parent 0f95e9f8e6
commit a1846b27ea
177 changed files with 517 additions and 519 deletions

View File

@ -191,7 +191,7 @@ Error MovieWriterMJPEG::write_begin(const Size2i &p_movie_size, uint32_t p_fps,
}
Error MovieWriterMJPEG::write_frame(const Ref<Image> &p_image, const int32_t *p_audio_data) {
ERR_FAIL_COND_V(!f.is_valid(), ERR_UNCONFIGURED);
ERR_FAIL_COND_V(f.is_null(), ERR_UNCONFIGURED);
Vector<uint8_t> jpg_buffer = p_image->save_jpg_to_buffer(quality);
uint32_t s = jpg_buffer.size();

View File

@ -140,7 +140,7 @@ Error MovieWriterPNGWAV::write_begin(const Size2i &p_movie_size, uint32_t p_fps,
}
Error MovieWriterPNGWAV::write_frame(const Ref<Image> &p_image, const int32_t *p_audio_data) {
ERR_FAIL_COND_V(!f_wav.is_valid(), ERR_UNCONFIGURED);
ERR_FAIL_COND_V(f_wav.is_null(), ERR_UNCONFIGURED);
Vector<uint8_t> png_buffer = p_image->save_png_to_buffer();