#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/scene/tsync/terrasync.hxx>
#include <simgear/misc/strutils.hxx>
+#include <simgear/scene/material/matlib.hxx>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
TileEntry *e;
int loading=0;
int sz=0;
-
+ bool didRefreshMaterialCache = false;
+
tile_cache.set_current_time( current_time );
tile_cache.reset_traversal();
e->prep_ssg_node(vis);
if (!e->is_loaded()) {
+ if (!didRefreshMaterialCache) {
+ didRefreshMaterialCache = true;
+ globals->get_matlib()->refreshActiveMaterials();
+ }
+
bool nonExpiredOrCurrent = !e->is_expired(current_time) || e->is_current_view();
bool downloading = isTileDirSyncing(e->tileFileName);
isDownloadingScenery |= downloading;