Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-04-28 10:31:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-28 10:31:57 +0400
commitb340f930ec5639f24e7e2d47fab221fb752b61dd (patch)
tree0e880a36bb528d133af6d10701fc090716b3b7f8 /source/blender/imbuf/intern/dds/ColorBlock.cpp
parent09dc600839904a198ab4ba3fad62ce58c2d3aa07 (diff)
style cleanup: changes to brace placement / newlines - for/while/if/switch
Diffstat (limited to 'source/blender/imbuf/intern/dds/ColorBlock.cpp')
-rw-r--r--source/blender/imbuf/intern/dds/ColorBlock.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.cpp b/source/blender/imbuf/intern/dds/ColorBlock.cpp
index 42ef799cf3e..42bec5874ca 100644
--- a/source/blender/imbuf/intern/dds/ColorBlock.cpp
+++ b/source/blender/imbuf/intern/dds/ColorBlock.cpp
@@ -93,12 +93,10 @@ void ColorBlock::init(uint w, uint h, const uint * data, uint x, uint y)
// @@ Thats only correct when block size is 1, 2 or 4, but not with 3. :(
// @@ Ideally we should zero the weights of the pixels out of range.
- for (uint i = 0; i < 4; i++)
- {
+ for (uint i = 0; i < 4; i++) {
const int by = i % bh;
- for (uint e = 0; e < 4; e++)
- {
+ for (uint e = 0; e < 4; e++) {
const int bx = e % bw;
const uint idx = (y + by) * w + x + bx;
@@ -118,12 +116,10 @@ void ColorBlock::init(uint w, uint h, const float * data, uint x, uint y)
uint srcPlane = w * h;
- for (uint i = 0; i < 4; i++)
- {
+ for (uint i = 0; i < 4; i++) {
const uint by = i % bh;
- for (uint e = 0; e < 4; e++)
- {
+ for (uint e = 0; e < 4; e++) {
const uint bx = e % bw;
const uint idx = ((y + by) * w + x + bx);
@@ -148,8 +144,7 @@ static inline uint8 component(Color32 c, uint i)
void ColorBlock::swizzle(uint x, uint y, uint z, uint w)
{
- for (int i = 0; i < 16; i++)
- {
+ for (int i = 0; i < 16; i++) {
Color32 c = m_color[i];
m_color[i].r = component(c, x);
m_color[i].g = component(c, y);
@@ -164,10 +159,8 @@ bool ColorBlock::isSingleColor(Color32 mask/*= Color32(0xFF, 0xFF, 0xFF, 0x00)*/
{
uint u = m_color[0].u & mask.u;
- for (int i = 1; i < 16; i++)
- {
- if (u != (m_color[i].u & mask.u))
- {
+ for (int i = 1; i < 16; i++) {
+ if (u != (m_color[i].u & mask.u)) {
return false;
}
}
@@ -243,8 +236,7 @@ Color32 ColorBlock::averageColor() const
/// Return true if the block is not fully opaque.
bool ColorBlock::hasAlpha() const
{
- for (uint i = 0; i < 16; i++)
- {
+ for (uint i = 0; i < 16; i++) {
if (m_color[i].a != 255) return true;
}
return false;