summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-13 04:26:46 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-13 04:26:46 (GMT)
commita92c7254e1a6d13bb8cebe5f73b7f430ee53b008 (patch)
tree76a2d12a091cb8189223508932970e8c2d7607e6
parentad5d3fc8990d002c56b4d3477e4ccd04359cebb9 (diff)
Do bound check on other side only if still needed
-rw-r--r--src/lib/marble/TextureColorizer.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/marble/TextureColorizer.cpp b/src/lib/marble/TextureColorizer.cpp
index 0d0f28e..ca44f52 100644
--- a/src/lib/marble/TextureColorizer.cpp
+++ b/src/lib/marble/TextureColorizer.cpp
@@ -290,8 +290,11 @@ void TextureColorizer::colorize( QImage *origimg, const ViewportParams *viewport
if ( m_showRelief ) {
emboss.enqueue(grey);
bump = ( emboss.head() + 8 - grey );
- if ( bump < 0 ) bump = 0;
- if ( bump > 15 ) bump = 15;
+ if (bump < 0) {
+ bump = 0;
+ } else if (bump > 15) {
+ bump = 15;
+ }
}
setPixel( coastData, writeData, bump, grey );
}
@@ -332,8 +335,11 @@ void TextureColorizer::colorize( QImage *origimg, const ViewportParams *viewport
if ( m_showRelief ) {
emboss.enqueue(grey);
bump = ( emboss.head() + 16 - grey ) >> 1;
- if ( bump > 15 ) bump = 15;
- if ( bump < 0 ) bump = 0;
+ if (bump < 0) {
+ bump = 0;
+ } else if (bump > 15) {
+ bump = 15;
+ }
}
setPixel( coastData, writeData, bump, grey );
}