diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-21 11:58:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-21 11:58:38 +0400 |
commit | d599b643b7a1882ea79851e334d7ed133f362bb3 (patch) | |
tree | 4e4640c1b2e7cc82d9db81dbd98a39777dcbce7c /source/blender/imbuf/intern/dds | |
parent | f3ece5a108db0bdbefb4663ef4ebd9a7e039e263 (diff) |
style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
Diffstat (limited to 'source/blender/imbuf/intern/dds')
-rw-r--r-- | source/blender/imbuf/intern/dds/DirectDrawSurface.cpp | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/dds/PixelFormat.h | 62 |
2 files changed, 32 insertions, 32 deletions
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp index d9d0cb86ee0..1fd41aa8c2d 100644 --- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp +++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp @@ -737,7 +737,7 @@ void DDSHeader::setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask { // Compute bit count from the masks. uint total = rmask | gmask | bmask | amask; - while(total != 0) { + while (total != 0) { bitcount++; total >>= 1; } diff --git a/source/blender/imbuf/intern/dds/PixelFormat.h b/source/blender/imbuf/intern/dds/PixelFormat.h index ce36fb00b97..2bb1864e49d 100644 --- a/source/blender/imbuf/intern/dds/PixelFormat.h +++ b/source/blender/imbuf/intern/dds/PixelFormat.h @@ -101,37 +101,37 @@ } } - inline float quantizeCeil(float f, int inbits, int outbits) - { - //uint i = f * (float(1 << inbits) - 1); - //i = convert(i, inbits, outbits); - //float result = float(i) / (float(1 << outbits) - 1); - //nvCheck(result >= f); - float result; - int offset = 0; - do { - uint i = offset + uint(f * (float(1 << inbits) - 1)); - i = convert(i, inbits, outbits); - result = float(i) / (float(1 << outbits) - 1); - offset++; - } while (result < f); - - return result; - } - - /* - inline float quantizeRound(float f, int bits) - { - float scale = float(1 << bits); - return fround(f * scale) / scale; - } - - inline float quantizeFloor(float f, int bits) - { - float scale = float(1 << bits); - return floor(f * scale) / scale; - } - */ + inline float quantizeCeil(float f, int inbits, int outbits) + { + //uint i = f * (float(1 << inbits) - 1); + //i = convert(i, inbits, outbits); + //float result = float(i) / (float(1 << outbits) - 1); + //nvCheck(result >= f); + float result; + int offset = 0; + do { + uint i = offset + uint(f * (float(1 << inbits) - 1)); + i = convert(i, inbits, outbits); + result = float(i) / (float(1 << outbits) - 1); + offset++; + } while (result < f); + + return result; + } + +#if 0 + inline float quantizeRound(float f, int bits) + { + float scale = float(1 << bits); + return fround(f * scale) / scale; + } + + inline float quantizeFloor(float f, int bits) + { + float scale = float(1 << bits); + return floor(f * scale) / scale; + } +#endif } // PixelFormat namespace |