* Update the various queues maintained by the tilemagr (private
* internal function, do not call directly.)
*/
-void FGTileMgr::update_queues()
+void FGTileMgr::update_queues(bool& isDownloadingScenery)
{
osg::FrameStamp* framestamp
= globals->get_renderer()->getViewer()->getFrameStamp();
// based on current visibilty
e->prep_ssg_node(vis);
- bool nonExpiredOrCurrent = !e->is_expired(current_time) || e->is_current_view();
- if ( !e->is_loaded() &&
- !isTileDirSyncing(e->tileFileName) &&
- nonExpiredOrCurrent)
- {
- // schedule tile for loading with osg pager
- _pager->queueRequest(e->tileFileName,
- e->getNode(),
- e->get_priority(),
- framestamp,
- e->getDatabaseRequest(),
- _options.get());
- loading++;
- }
- } else
- {
+ if (!e->is_loaded()) {
+ bool nonExpiredOrCurrent = !e->is_expired(current_time) || e->is_current_view();
+ bool downloading = isTileDirSyncing(e->tileFileName);
+ isDownloadingScenery |= downloading;
+ if ( !downloading && nonExpiredOrCurrent) {
+ // schedule tile for loading with osg pager
+ _pager->queueRequest(e->tileFileName,
+ e->getNode(),
+ e->get_priority(),
+ framestamp,
+ e->getDatabaseRequest(),
+ _options.get());
+ loading++;
+ }
+ } // of tile not loaded case
+ } else {
SG_LOG(SG_TERRAIN, SG_ALERT, "Warning: empty tile in cache!");
}
tile_cache.next();
double vis = _visibilityMeters->getDoubleValue();
schedule_tiles_at(globals->get_view_position(), vis);
- update_queues();
+ bool waitingOnTerrasync = false;
+ update_queues(waitingOnTerrasync);
// scenery loading check, triggers after each sim (tile manager) reinit
if (!_scenery_loaded->getBoolValue())
bool positionFinalized = fgGetBool("sim/position-finalized");
bool sceneryOverride = _scenery_override->getBoolValue();
+
// we are done if final position is set and the scenery & FDM are done.
// scenery-override can ignore the last two, but not position finalization.
if (positionFinalized && (sceneryOverride || (isSceneryLoaded() && fdmInited)))
}
else
{
- fgSplashProgress(positionFinalized ? "loading-scenery" : "finalize-position");
+ if (!positionFinalized) {
+ fgSplashProgress("finalize-position");
+ } else if (waitingOnTerrasync) {
+ fgSplashProgress("downloading-scenery");
+ } else {
+ fgSplashProgress("loading-scenery");
+ }
+
// be nice to loader threads while waiting for initial scenery, reduce to 20fps
SGTimeStamp::sleepForMSec(50);
}
text = globals->get_locale()->getLocalizedString(id.c_str(),
"sys", "<incomplete language resource>");
}
-
- if (!strcmp(fgGetString("/sim/startup/splash-progress-text"), text)) {
- return;
- }
+
+ if (!strcmp(fgGetString("/sim/startup/splash-progress-text"), text)) {
+ return;
+ }
+
+ if (!strcmp(identifier,"downloading-scenery")) {
+ std::ostringstream oss;
+ unsigned int kbytesPerSec = fgGetInt("/sim/terrasync/transfer-rate-bytes-sec") / 1024;
+ oss << text;
+ if (kbytesPerSec > 0) {
+ oss << " - " << kbytesPerSec << " KBytes/sec";
+ }
+ fgSetString("/sim/startup/splash-progress-text", oss.str());
+ } else {
+ SG_LOG( SG_VIEW, SG_INFO, "Splash screen progress " << identifier );
+ fgSetString("/sim/startup/splash-progress-text", text);
+ }
- SG_LOG( SG_VIEW, SG_INFO, "Splash screen progress " << identifier );
- fgSetString("/sim/startup/splash-progress-text", text);
}