Changeset View
Changeset View
Standalone View
Standalone View
src/lib/marble/TileLoader.cpp
Show First 20 Lines • Show All 286 Lines • ▼ Show 20 Line(s) | 286 | if (level > 0 && level < minimumLevel) { | |||
---|---|---|---|---|---|
287 | continue; | 287 | continue; | ||
288 | } | 288 | } | ||
289 | int const deltaLevel = id.zoomLevel() - level; | 289 | int const deltaLevel = id.zoomLevel() - level; | ||
290 | 290 | | |||
291 | TileId const replacementTileId( id.mapThemeIdHash(), level, | 291 | TileId const replacementTileId( id.mapThemeIdHash(), level, | ||
292 | id.x() >> deltaLevel, id.y() >> deltaLevel ); | 292 | id.x() >> deltaLevel, id.y() >> deltaLevel ); | ||
293 | QString const fileName = tileFileName( textureData, replacementTileId ); | 293 | QString const fileName = tileFileName( textureData, replacementTileId ); | ||
294 | mDebug() << "TileLoader::scaledLowerLevelTile" << "trying" << fileName; | 294 | mDebug() << "TileLoader::scaledLowerLevelTile" << "trying" << fileName; | ||
295 | QImage toScale = QFile::exists(fileName) ? QImage(fileName) : QImage(); | 295 | QImage toScale = (!fileName.isEmpty() && QFile::exists(fileName)) ? QImage(fileName) : QImage(); | ||
296 | 296 | | |||
297 | if ( level == 0 && toScale.isNull() ) { | 297 | if ( level == 0 && toScale.isNull() ) { | ||
298 | mDebug() << "No level zero tile installed in map theme dir. Falling back to a transparent image for now."; | 298 | mDebug() << "No level zero tile installed in map theme dir. Falling back to a transparent image for now."; | ||
299 | QSize tileSize = textureData->tileSize(); | 299 | QSize tileSize = textureData->tileSize(); | ||
300 | Q_ASSERT( !tileSize.isEmpty() ); // assured by textureLayer | 300 | Q_ASSERT( !tileSize.isEmpty() ); // assured by textureLayer | ||
301 | toScale = QImage( tileSize, QImage::Format_ARGB32_Premultiplied ); | 301 | toScale = QImage( tileSize, QImage::Format_ARGB32_Premultiplied ); | ||
302 | toScale.fill( qRgba( 0, 0, 0, 0 ) ); | 302 | toScale.fill( qRgba( 0, 0, 0, 0 ) ); | ||
303 | } | 303 | } | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |