[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Wed Jan 27 13:19:48 CET 2010
SVN commit 1081008 by jmhoffmann:
TextureTile::loadDataset: drop redundant TileId parameter, TextureTile already has a TileId as a (inherited) member.
M +1 -1 MergedLayerDecorator.cpp
M +9 -8 TextureTile.cpp
M +1 -1 TextureTile.h
M +3 -3 TileLoader.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MergedLayerDecorator.cpp #1081007:1081008
@@ -142,7 +142,7 @@
connect( &tile, SIGNAL( downloadTile( const QUrl&, const QString&, const QString&, DownloadUsage ) ),
this, SIGNAL( downloadTile( const QUrl&, const QString&, const QString&, DownloadUsage ) ) );
- tile.loadDataset( textureLayer, m_id );
+ tile.loadDataset( textureLayer );
return *( tile.tile() );
}
--- trunk/KDE/kdeedu/marble/src/lib/TextureTile.cpp #1081007:1081008
@@ -271,7 +271,7 @@
{
}
-void TextureTile::loadDataset( GeoSceneTexture *textureLayer, const TileId &id,
+void TextureTile::loadDataset( GeoSceneTexture *textureLayer,
QCache<TileId, TextureTile> *tileCache )
{
// mDebug() << "TextureTile::loadDataset" << level << x << y;
@@ -288,19 +288,20 @@
const int levelZeroColumns = textureLayer->levelZeroColumns();
const int levelZeroRows = textureLayer->levelZeroRows();
- const int rowsRequestedLevel = TileLoaderHelper::levelToRow( levelZeroRows, id.zoomLevel() );
+ const int rowsRequestedLevel = TileLoaderHelper::levelToRow( levelZeroRows,
+ d->m_id.zoomLevel() );
const int columnsRequestedLevel = TileLoaderHelper::levelToColumn( levelZeroColumns,
- id.zoomLevel() );
+ d->m_id.zoomLevel() );
bool tileFound = false;
- for ( int currentLevel = id.zoomLevel(); !tileFound && currentLevel > -1; --currentLevel ) {
+ for ( int currentLevel = d->m_id.zoomLevel(); !tileFound && currentLevel > -1; --currentLevel ) {
const int rowsCurrentLevel =
TileLoaderHelper::levelToRow( levelZeroRows, currentLevel );
const int columnsCurrentLevel =
TileLoaderHelper::levelToColumn( levelZeroColumns, currentLevel );
- qreal normalizedX = (qreal)( id.x() ) / (qreal)( rowsRequestedLevel );
- qreal normalizedY = (qreal)( id.y() ) / (qreal)( columnsRequestedLevel );
+ qreal normalizedX = (qreal)( d->m_id.x() ) / (qreal)( rowsRequestedLevel );
+ qreal normalizedY = (qreal)( d->m_id.y() ) / (qreal)( columnsRequestedLevel );
qreal currentX = normalizedX * (qreal)( rowsCurrentLevel );
qreal currentY = normalizedY * (qreal)( columnsCurrentLevel );
@@ -371,9 +372,9 @@
if ( !temptile.isNull() ) {
// Don't scale if the current tile isn't a fallback
- if ( id.zoomLevel() != currentLevel ) {
+ if ( d->m_id.zoomLevel() != currentLevel ) {
d->scaleTileFrom( textureLayer, temptile, currentX, currentY, currentLevel,
- id.x(), id.y(), id.zoomLevel() );
+ d->m_id.x(), d->m_id.y(), d->m_id.zoomLevel() );
}
else {
d->m_state = TileComplete;
--- trunk/KDE/kdeedu/marble/src/lib/TextureTile.h #1081007:1081008
@@ -47,7 +47,7 @@
virtual ~TextureTile();
// TODO: Move into DatasetProvider:
- void loadDataset( GeoSceneTexture *textureLayer, const TileId &id,
+ void loadDataset( GeoSceneTexture *textureLayer,
QCache<TileId, TextureTile> *tileCache = 0 );
int depth() const;
--- trunk/KDE/kdeedu/marble/src/lib/TileLoader.cpp #1081007:1081008
@@ -123,7 +123,7 @@
GeoSceneTexture * texture = static_cast<GeoSceneTexture *>( d->m_layer->groundDataset() );
- tile.loadDataset( texture, id );
+ tile.loadDataset( texture );
// We assume that all tiles have the same size. TODO: check to be safe
d->m_tileWidth = tile.rawtile().width();
@@ -252,7 +252,7 @@
connect( tile, SIGNAL( tileUpdateDone() ),
this, SIGNAL( tileUpdateAvailable() ) );
- tile->loadDataset( texture, tileId, &d->m_tileCache );
+ tile->loadDataset( texture, &d->m_tileCache );
tile->initJumpTables( false );
// TODO should emit signal rather than directly calling paintTile
@@ -361,7 +361,7 @@
// emit paintTile( d->m_tilesOnDisplay[id], x, y, level, d->m_theme, true );
GeoSceneTexture * texture = static_cast<GeoSceneTexture *>( d->m_layer->groundDataset() );
- d->m_tilesOnDisplay[id]->loadDataset( texture, id, &d->m_tileCache );
+ d->m_tilesOnDisplay[id]->loadDataset( texture, &d->m_tileCache );
m_parent->paintTile( d->m_tilesOnDisplay[id], texture, true );
// (d->m_tilesOnDisplay[id])->reloadTile( x, y, level, d->m_theme );
} else {
More information about the Marble-commits
mailing list