summaryrefslogtreecommitdiff
path: root/modules/hdr
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:41:43 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 21:57:34 +0200
commit0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (patch)
tree198d4ff7665d89307f6ca2469fa38620a9eb1672 /modules/hdr
parent07bc4e2f96f8f47991339654ff4ab16acc19d44f (diff)
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/hdr')
-rw-r--r--modules/hdr/image_loader_hdr.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/hdr/image_loader_hdr.cpp b/modules/hdr/image_loader_hdr.cpp
index 19cd8ae584..333b1cf377 100644
--- a/modules/hdr/image_loader_hdr.cpp
+++ b/modules/hdr/image_loader_hdr.cpp
@@ -41,8 +41,9 @@ Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force
while (true) {
String line = f->get_line();
ERR_FAIL_COND_V(f->eof_reached(), ERR_FILE_UNRECOGNIZED);
- if (line == "") // empty line indicates end of header
+ if (line == "") { // empty line indicates end of header
break;
+ }
if (line.begins_with("FORMAT=")) { // leave option to implement other commands
ERR_FAIL_COND_V_MSG(line != "FORMAT=32-bit_rle_rgbe", ERR_FILE_UNRECOGNIZED, "Only 32-bit_rle_rgbe is supported for HDR files.");
} else if (!line.begins_with("#")) { // not comment
@@ -107,12 +108,14 @@ Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force
// Run
int value = f->get_8();
count -= 128;
- for (int z = 0; z < count; ++z)
+ for (int z = 0; z < count; ++z) {
ptr[(j * width + i++) * 4 + k] = uint8_t(value);
+ }
} else {
// Dump
- for (int z = 0; z < count; ++z)
+ for (int z = 0; z < count; ++z) {
ptr[(j * width + i++) * 4 + k] = f->get_8();
+ }
}
}
}