@@ -573,7 +573,7 @@ static bool _are_formats_compatible(Image::Format p_format0, Image::Format p_for
573573void Image::convert (Format p_new_format) {
574574 ERR_FAIL_INDEX_MSG (p_new_format, FORMAT_MAX, vformat (" The Image format specified (%d) is out of range. See Image's Format enum." , p_new_format));
575575
576- if (data.size () == 0 || p_new_format == format) {
576+ if (data.is_empty () || p_new_format == format) {
577577 return ;
578578 }
579579
@@ -2177,7 +2177,7 @@ void Image::clear_mipmaps() {
21772177}
21782178
21792179bool Image::is_empty () const {
2180- return (data.size () == 0 );
2180+ return (data.is_empty () );
21812181}
21822182
21832183Vector<uint8_t > Image::get_data () const {
@@ -3096,7 +3096,7 @@ void Image::_repeat_pixel_over_subsequent_memory(uint8_t *p_pixel, int p_pixel_s
30963096}
30973097
30983098void Image::fill (const Color &p_color) {
3099- if (data.size () == 0 ) {
3099+ if (data.is_empty () ) {
31003100 return ;
31013101 }
31023102 ERR_FAIL_COND_MSG (is_compressed (), " Cannot fill in compressed image formats." );
@@ -3112,7 +3112,7 @@ void Image::fill(const Color &p_color) {
31123112}
31133113
31143114void Image::fill_rect (const Rect2i &p_rect, const Color &p_color) {
3115- if (data.size () == 0 ) {
3115+ if (data.is_empty () ) {
31163116 return ;
31173117 }
31183118 ERR_FAIL_COND_MSG (is_compressed (), " Cannot fill rect in compressed image formats." );
@@ -3734,7 +3734,7 @@ void Image::normal_map_to_xy() {
37343734}
37353735
37363736Ref<Image> Image::rgbe_to_srgb () {
3737- if (data.size () == 0 ) {
3737+ if (data.is_empty () ) {
37383738 return Ref<Image>();
37393739 }
37403740
@@ -3856,7 +3856,7 @@ bool Image::detect_signed(bool p_include_mips) const {
38563856}
38573857
38583858void Image::srgb_to_linear () {
3859- if (data.size () == 0 ) {
3859+ if (data.is_empty () ) {
38603860 return ;
38613861 }
38623862
@@ -3887,7 +3887,7 @@ void Image::srgb_to_linear() {
38873887}
38883888
38893889void Image::linear_to_srgb () {
3890- if (data.size () == 0 ) {
3890+ if (data.is_empty () ) {
38913891 return ;
38923892 }
38933893
@@ -3918,7 +3918,7 @@ void Image::linear_to_srgb() {
39183918}
39193919
39203920void Image::premultiply_alpha () {
3921- if (data.size () == 0 ) {
3921+ if (data.is_empty () ) {
39223922 return ;
39233923 }
39243924
@@ -3940,7 +3940,7 @@ void Image::premultiply_alpha() {
39403940}
39413941
39423942void Image::fix_alpha_edges () {
3943- if (data.size () == 0 ) {
3943+ if (data.is_empty () ) {
39443944 return ;
39453945 }
39463946
0 commit comments