[Marble-commits] KDE/kdeedu/marble/src/lib

Jens-Michael Hoffmann jensmh at gmx.de
Tue Mar 23 08:53:52 CET 2010


SVN commit 1106547 by jmhoffmann:

Move setting uf "use" member from StackedTileLoader::loadTile to
AbstractScanlineTextureMapper::nextTile, as it makes more sense to do it there.
Not every user of a tile might need it in the hash for multiple very fast access.

 M  +2 -0      AbstractScanlineTextureMapper.cpp  
 M  +0 -2      StackedTileLoader.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp #1106546:1106547
@@ -530,6 +530,7 @@
     int tileRow = lat / m_tileSize.height();
 
     m_tile = m_tileLoader->loadTile( TileId( m_mapThemeIdHash, m_tileLevel, tileCol, tileRow ));
+    m_tile->setUsed( true );
 
     // Update position variables:
     // m_tilePosX/Y stores the position of the tiles in 
@@ -565,6 +566,7 @@
     int tileRow = lat / m_tileSize.height();
 
     m_tile = m_tileLoader->loadTile( TileId( m_mapThemeIdHash, m_tileLevel, tileCol, tileRow ));
+    m_tile->setUsed( true );
 
     // Update position variables:
     // m_tilePosX/Y stores the position of the tiles in 
--- trunk/KDE/kdeedu/marble/src/lib/StackedTileLoader.cpp #1106546:1106547
@@ -151,7 +151,6 @@
     // check if the tile is in the hash
     StackedTile * tile = d->m_tilesOnDisplay.value( stackedTileId, 0 );
     if ( tile ) {
-        tile->setUsed( true );
         return tile;
     }
     // here ends the performance critical section of this method
@@ -165,7 +164,6 @@
         // the tile was in the cache, but is it up to date?
         if ( !tile->isExpired() ) {
             d->m_tilesOnDisplay[ stackedTileId ] = tile;
-            tile->setUsed( true );
             return tile;
         } else {
             delete tile;


More information about the Marble-commits mailing list