[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Tue Aug 31 21:20:17 CEST 2010
SVN commit 1170389 by jmhoffmann:
AbstractScanlineTextureMapper: Do not unnecessarily check for lat/lon < 0.
M +16 -8 AbstractScanlineTextureMapper.cpp
--- trunk/KDE/kdeedu/marble/src/lib/AbstractScanlineTextureMapper.cpp #1170388:1170389
@@ -488,12 +488,16 @@
// ( with origin in upper left corner, measured in pixel)
int lon = posX + m_tilePosX;
- if ( lon > m_maxGlobalX ) lon -= m_maxGlobalX;
- if ( lon < 0 ) lon += m_maxGlobalX;
+ if ( lon > m_maxGlobalX )
+ lon -= m_maxGlobalX;
+ else if ( lon < 0 )
+ lon += m_maxGlobalX;
int lat = posY + m_tilePosY;
- if ( lat > m_maxGlobalY ) lat -= m_maxGlobalY;
- if ( lat < 0 ) lat += m_maxGlobalY;
+ if ( lat > m_maxGlobalY )
+ lat -= m_maxGlobalY;
+ else if ( lat < 0 )
+ lat += m_maxGlobalY;
// tileCol counts the tile columns left from the current tile.
// tileRow counts the tile rows on the top from the current tile.
@@ -525,12 +529,16 @@
// ( with origin in upper left corner, measured in pixel)
int lon = (int)(posX + m_tilePosX);
- if ( lon > m_maxGlobalX ) lon -= m_maxGlobalX;
- if ( lon < 0 ) lon += m_maxGlobalX;
+ if ( lon > m_maxGlobalX )
+ lon -= m_maxGlobalX;
+ else if ( lon < 0 )
+ lon += m_maxGlobalX;
int lat = (int)(posY + m_tilePosY);
- if ( lat > m_maxGlobalY ) lat -= m_maxGlobalY;
- if ( lat < 0 ) lat += m_maxGlobalY;
+ if ( lat > m_maxGlobalY )
+ lat -= m_maxGlobalY;
+ else if ( lat < 0 )
+ lat += m_maxGlobalY;
// tileCol counts the tile columns left from the current tile.
// tileRow counts the tile rows on the top from the current tile.
More information about the Marble-commits
mailing list