Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
committed by
AThousandShips
parent
0f95e9f8e6
commit
a1846b27ea
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user