]> git.mxchange.org Git - flightgear.git/commitdiff
add command line option --expire to fgelev, overriding the hardcoded
authorradi <radi_@web.de>
Mon, 6 Oct 2014 09:23:27 +0000 (11:23 +0200)
committerradi <radi_@web.de>
Mon, 6 Oct 2014 09:23:27 +0000 (11:23 +0200)
default of 10 if given.

This improves performance _a lot_ if massively probing across
a bucket border as it prevents constant terrain unloading/reloading.

utils/fgelev/fgelev.cxx

index 3ad0b5850cedb11276d2da157db1623b93af3088..5d9ae9f847a695521a8167ff14899e272f985c0a 100644 (file)
@@ -93,6 +93,10 @@ main(int argc, char** argv)
     // use an ArgumentParser object to manage the program arguments.
     osg::ArgumentParser arguments(&argc, argv);
 
+    unsigned expire;
+    if (arguments.read("--expire", expire)) {
+    } else expire = 10;
+    
     std::string fg_root;
     if (arguments.read("--fg-root", fg_root)) {
     } else if (const char *fg_root_env = std::getenv("FG_ROOT")) {
@@ -184,7 +188,7 @@ main(int argc, char** argv)
         // Increment the paging relevant number
         pager.setUseStamp(1 + pager.getUseStamp());
         // and expire everything not accessed for the past 30 requests
-        pager.update(10);
+        pager.update(expire);
 
         std::string id;
         std::cin >> id;