diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:41:43 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 21:57:34 +0200 |
commit | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (patch) | |
tree | 198d4ff7665d89307f6ca2469fa38620a9eb1672 /modules/etc/image_etc.cpp | |
parent | 07bc4e2f96f8f47991339654ff4ab16acc19d44f (diff) | |
download | redot-engine-0ee0fa42e6639b6fa474b7cf6afc6b1a78142185.tar.gz |
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
Diffstat (limited to 'modules/etc/image_etc.cpp')
-rw-r--r-- | modules/etc/image_etc.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/etc/image_etc.cpp b/modules/etc/image_etc.cpp index 6bf4a7ef47..9b6d8a2d35 100644 --- a/modules/etc/image_etc.cpp +++ b/modules/etc/image_etc.cpp @@ -127,8 +127,9 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f Ref<Image> img = p_img->duplicate(); - if (img->get_format() != Image::FORMAT_RGBA8) + if (img->get_format() != Image::FORMAT_RGBA8) { img->convert(Image::FORMAT_RGBA8); //still uses RGBA to convert + } if (img->has_mipmaps()) { if (next_power_of_2(imgw) != imgw || next_power_of_2(imgh) != imgh) { @@ -165,12 +166,13 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f int encoding_time = 0; float effort = 0.0; //default, reasonable time - if (p_lossy_quality > 0.75) + if (p_lossy_quality > 0.75) { effort = 0.4; - else if (p_lossy_quality > 0.85) + } else if (p_lossy_quality > 0.85) { effort = 0.6; - else if (p_lossy_quality > 0.95) + } else if (p_lossy_quality > 0.95) { effort = 0.8; + } Etc::ErrorMetric error_metric = Etc::ErrorMetric::RGBX; // NOTE: we can experiment with other error metrics Etc::Image::Format etc2comp_etc_format = _image_format_to_etc2comp_format(etc_format); |