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

Jens-Michael Hoffmann jensmh at gmx.de
Sat Apr 24 15:23:12 CEST 2010


SVN commit 1118346 by jmhoffmann:

AbstractScanlineTextureMapper: remove tileWidth and tileHeight parameters of
isOutOfTileRange/isOutOfTileRangeF and use member m_tileSize instead.

Since QSize::width() and QSize::height() are simple inlined getters
there should be no performance penalty in release builds.

 M  +10 -14    AbstractScanlineTextureMapper.cpp  
 M  +0 -2      AbstractScanlineTextureMapper.h  


--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp #1118345:1118346
@@ -267,8 +267,7 @@
         qreal oldPosY = 0;
 
         const bool alwaysCheckTileRange =
-                isOutOfTileRangeF( itLon, itLat, itStepLon, itStepLat,
-                                   tileWidth, tileHeight, n );
+                isOutOfTileRangeF( itLon, itLat, itStepLon, itStepLat, n );
         
         for ( int j=1; j < n; ++j ) {
             qreal posX = itLon + itStepLon * j;
@@ -356,17 +355,16 @@
 
 bool AbstractScanlineTextureMapper::isOutOfTileRangeF( qreal itLon, qreal itLat,
                                                        qreal itStepLon, qreal itStepLat,
-                                                       int tileWidth, int tileHeight,
                                                        int n ) const
 {
     qreal minIPosX = itLon + itStepLon;
     qreal minIPosY = itLat + itStepLat;
     qreal maxIPosX = itLon + itStepLon * ( n - 1 );
     qreal maxIPosY = itLat + itStepLat * ( n - 1 );
-    return (    maxIPosX >= tileWidth  || maxIPosX < 0
-             || maxIPosY >= tileHeight || maxIPosY < 0
-             || minIPosX >= tileWidth  || minIPosX < 0
-             || minIPosY >= tileHeight || minIPosY < 0 );
+    return (    maxIPosX >= m_tileSize.width()  || maxIPosX < 0
+             || maxIPosY >= m_tileSize.height() || maxIPosY < 0
+             || minIPosX >= m_tileSize.width()  || minIPosX < 0
+             || minIPosY >= m_tileSize.height() || minIPosY < 0 );
 }
 
 
@@ -402,8 +400,7 @@
         const int tileHeight = m_tileSize.height();
 
         const bool alwaysCheckTileRange =
-                isOutOfTileRange( itLon, itLat, itStepLon, itStepLat,
-                                  tileWidth, tileHeight, n );
+                isOutOfTileRange( itLon, itLat, itStepLon, itStepLat, n );
                                   
         if ( !alwaysCheckTileRange ) {
             int iPosXf = itLon;
@@ -482,17 +479,16 @@
 
 bool AbstractScanlineTextureMapper::isOutOfTileRange( int itLon, int itLat,
                                                       int itStepLon, int itStepLat,
-                                                      int tileWidth, int tileHeight,
                                                       int n ) const
 {
     int minIPosX = ( itLon + itStepLon ) >> 7;
     int minIPosY = ( itLat + itStepLat ) >> 7;
     int maxIPosX = ( itLon + itStepLon * ( n - 1 ) ) >> 7;
     int maxIPosY = ( itLat + itStepLat * ( n - 1 ) ) >> 7;
-    return (    maxIPosX >= tileWidth  || maxIPosX < 0
-             || maxIPosY >= tileHeight || maxIPosY < 0
-             || minIPosX >= tileWidth  || minIPosX < 0
-             || minIPosY >= tileHeight || minIPosY < 0 );
+    return (    maxIPosX >= m_tileSize.width()  || maxIPosX < 0
+             || maxIPosY >= m_tileSize.height() || maxIPosY < 0
+             || minIPosX >= m_tileSize.width()  || minIPosX < 0
+             || minIPosY >= m_tileSize.height() || minIPosY < 0 );
 }
 
 
--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.h #1118345:1118346
@@ -90,12 +90,10 @@
     // one tile
     bool isOutOfTileRange( int itLon, int itLat,
                            int itStepLon, int itStepLat,
-                           int tileWidth, int tileHeight,
                            int n ) const;
 
     bool isOutOfTileRangeF( qreal itLon, qreal itLat,
                             qreal itStepLon, qreal itStepLat,
-                            int tileWidth, int tileHeight,
                             int n ) const;
                            
     // maximum values for global texture coordinates


More information about the Marble-commits mailing list