[Marble-commits] branches/KDE/4.6/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Mon Jan 3 12:52:50 CET 2011
SVN commit 1211242 by beschow:
cleanup TextureLayer::paintGlobe()
* remove redundant variable redrawBackground
* Do not repaint when viewParams->canvasImage()->isNull(). It seems to have been introduced to fix initialization, but isn't needed any longer since d->m_justModified is
initialized properly in the constructor.
* reduce scope of variable "radius"
M +7 -10 TextureLayer.cpp
--- branches/KDE/4.6/kdeedu/marble/src/lib/TextureLayer.cpp #1211241:1211242
@@ -149,26 +149,26 @@
if ( !d->m_mapTheme )
return;
- const bool redrawBackground = d->m_justModified || viewParams->canvasImage()->isNull();
+ if ( !d->m_mapTheme->map()->hasTextureLayers() )
+ return;
- if ( redrawBackground ) {
- if ( d->m_mapTheme->map()->hasTextureLayers() ) {
+ if ( d->m_justModified ) {
// Create the height map image a.k.a viewParams->d->m_canvasImage.
d->m_texmapper->mapTexture( viewParams );
if ( d->m_texcolorizer ) {
d->m_texcolorizer->colorize( viewParams );
}
+
+ d->m_justModified = false;
}
- }
// Paint the map on the Widget
// QTime t;
// t.start();
- int radius = (int)(1.05 * (qreal)(viewParams->radius()));
-
- if ( d->m_mapTheme->map()->hasTextureLayers() ) {
if ( viewParams->projection() == Spherical ) {
+ const int radius = (int)(1.05 * (qreal)(viewParams->radius()));
+
QRect rect( viewParams->width() / 2 - radius, viewParams->height() / 2 - radius,
2 * radius, 2 * radius);
rect = rect.intersect( dirtyRect );
@@ -177,11 +177,8 @@
else {
painter->drawImage( dirtyRect, *viewParams->canvasImage(), dirtyRect );
}
- }
// qDebug( "Painted in %ims", t.elapsed() );
-
- d->m_justModified = false;
}
void TextureLayer::setShowTileId( bool show )
More information about the Marble-commits
mailing list