summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-13 05:07:44 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-08-13 05:07:44 (GMT)
commitb1f68ad53f92ea64321f8ff4197d80b101c9d199 (patch)
treed0f765c3c2c194061f325a8ac38e51dd656458fe
parenta92c7254e1a6d13bb8cebe5f73b7f430ee53b008 (diff)
SunLightBlending: calculate longitudes iteratively in loop, not from scratch
-rw-r--r--src/lib/marble/blendings/SunLightBlending.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/marble/blendings/SunLightBlending.cpp b/src/lib/marble/blendings/SunLightBlending.cpp
index d238bc7..20410f0 100644
--- a/src/lib/marble/blendings/SunLightBlending.cpp
+++ b/src/lib/marble/blendings/SunLightBlending.cpp
@@ -104,14 +104,16 @@ void SunLightBlending::blend( QImage * const tileImage, TextureTile const * cons
cur_x += n;
continue;
}
+
+ qreal lon = lon_scale * (id.x() * tileWidth + cur_x);
for ( int t = 0; t < n ; ++t ) {
- qreal lon = lon_scale * ( id.x() * tileWidth + cur_x );
shade = m_sunLocator->shading( lon, a, c );
m_sunLocator->shadePixelComposite( *scanline, *nscanline, shade );
++scanline;
++nscanline;
- ++cur_x;
+ lon += lon_scale;
}
+ cur_x += n;
}
else {