[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/marble/src/lib
From:       Ariya Hidayat <ariya () kde ! org>
Date:       2010-01-21 15:18:50
Message-ID: 1264087130.299132.11274.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1078110 by ariya:

Minor speed-up: do not carry out multiplications inside the inner loop.


 M  +5 -3      AbstractScanlineTextureMapper.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp #1078109:1078110
@@ -412,10 +412,12 @@
                                   tileWidth, tileHeight, n );
                                   
         if ( !alwaysCheckTileRange ) {
+            int iPosXf = itLon;
+            int iPosYf = itLat;
             for ( int j = 1; j < n; ++j ) {
-                int iPosX = ( itLon + itStepLon * j ) >> 7;
-                int iPosY = ( itLat + itStepLat * j ) >> 7;
-                *scanLine = m_tile->pixel( iPosX, iPosY );
+                iPosXf += itStepLon;
+                iPosYf += itStepLat;
+                *scanLine = m_tile->pixel( iPosXf >> 7, iPosYf >> 7 );
                 ++scanLine;
             }
         }        
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic