[Marble-commits] branches/KDE/4.6/kdeedu/marble/src/lib
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Sat Jan 1 13:24:21 CET 2011
SVN commit 1210615 by beschow:
backport trunk-r1210497: allow base tiles to be displayed and make sure the attributes get properly initialized
M +6 -4 AbstractScanlineTextureMapper.cpp
--- branches/KDE/4.6/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp #1210614:1210615
@@ -58,14 +58,14 @@
// As our tile resolution doubles with each level we calculate
// the tile level from tilesize and the globe radius via log(2)
- qreal linearLevel = ( 2.0 * (qreal)( radius )
+ qreal linearLevel = ( 4.0 * (qreal)( radius )
/ (qreal)( m_tileSize.width() ) );
int tileLevel = 0;
if ( linearLevel < 1.0 )
linearLevel = 1.0; // Dirty fix for invalid entry linearLevel
- qreal tileLevelF = log( linearLevel ) / log( 2.0 ) + 1.0;
+ qreal tileLevelF = log( linearLevel ) / log( 2.0 );
tileLevel = (int)( tileLevelF );
// mDebug() << "tileLevelF: " << tileLevelF << " tileLevel: " << tileLevel;
@@ -73,8 +73,7 @@
if ( tileLevel > m_tileLoader->maximumTileLevel() )
tileLevel = m_tileLoader->maximumTileLevel();
- if ( tileLevel != m_tileLevel ) {
- m_tileLoader->flush();
+ const bool changedTileLevel = tileLevel != m_tileLevel;
// mDebug() << "Texture Level was set to: " << tileLevel;
m_tileLevel = tileLevel;
@@ -95,6 +94,9 @@
m_toTileCoordinatesLon = (qreal)(m_globalWidth / 2 - m_tilePosX);
m_toTileCoordinatesLat = (qreal)(m_globalHeight / 2 - m_tilePosY);
+ if ( changedTileLevel ) {
+ m_tileLoader->flush();
+
emit tileLevelChanged( m_tileLevel );
}
}
More information about the Marble-commits
mailing list