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

Jens-Michael Hoffmann jensmh at gmx.de
Wed Jan 27 13:19:40 CET 2010


SVN commit 1081006 by jmhoffmann:

TileLoader::loadTile: switch signature to TileId.

 M  +3 -2      AbstractScanlineTextureMapper.cpp  
 M  +1 -3      TileLoader.cpp  
 M  +2 -4      TileLoader.h  


--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp #1081005:1081006
@@ -12,6 +12,7 @@
 
 #include "MarbleDebug.h"
 #include "TextureTile.h"
+#include "TileId.h"
 #include "TileLoader.h"
 #include "TileLoaderHelper.h"
 #include "ViewParams.h"
@@ -531,7 +532,7 @@
     int tileCol = lon / m_tileLoader->tileWidth();
     int tileRow = lat / m_tileLoader->tileHeight();
 
-    m_tile = m_tileLoader->loadTile( tileCol, tileRow, m_tileLevel );
+    m_tile = m_tileLoader->loadTile( TileId( m_tileLevel, tileCol, tileRow ));
 
     // Update position variables:
     // m_tilePosX/Y stores the position of the tiles in 
@@ -566,7 +567,7 @@
     int tileCol = lon / m_tileLoader->tileWidth();
     int tileRow = lat / m_tileLoader->tileHeight();
 
-    m_tile = m_tileLoader->loadTile( tileCol, tileRow, m_tileLevel );
+    m_tile = m_tileLoader->loadTile( TileId( m_tileLevel, tileCol, tileRow ));
 
     // Update position variables:
     // m_tilePosX/Y stores the position of the tiles in 
--- trunk/KDE/kdeedu/marble/src/lib/TileLoader.cpp #1081005:1081006
@@ -203,12 +203,10 @@
                                 texture->levelZeroRows(), level );
 }
 
-TextureTile* TileLoader::loadTile( int tilx, int tily, int tileLevel )
+TextureTile* TileLoader::loadTile( TileId const &tileId )
 {
     if ( !d->m_layer ) return 0;
 
-    TileId tileId( tileLevel, tilx, tily );
-
     // check if the tile is in the hash
     TextureTile * tile = d->m_tilesOnDisplay.value( tileId, 0 );
     if ( tile ) {
--- trunk/KDE/kdeedu/marble/src/lib/TileLoader.h #1081005:1081006
@@ -80,11 +80,9 @@
         /**
          * Loads a tile and returns it.
          *
-         * @param tilx The x coordinate of the requested tile.
-         * @param tily The y coordinate of the requested tile.
-         * @param tileLevel The zoom level of the requested tile.
+         * @param tileId The Id of the requested tile, containing the x and y coordinate and the zoom level.
          */
-        TextureTile* loadTile( int tilx, int tily, int tileLevel );
+        TextureTile* loadTile( TileId const &tileId );
 
         /**
          * Sets the texture layer @p the tiles shall be loaded for.


More information about the Marble-commits mailing list