]> git.mxchange.org Git - flightgear.git/commitdiff
fix bug that prevented /sim/sceneryloaded from ever becoming "true" if
authormfranz <mfranz>
Tue, 19 Jun 2007 10:18:14 +0000 (10:18 +0000)
committermfranz <mfranz>
Tue, 19 Jun 2007 10:18:14 +0000 (10:18 +0000)
/sim/screneryloaded-override was "true". At least one subsystem (od_gauge)
waits for /sim/sceneryloaded to bypass CPU intensive code until the scenery
is up. This broke e.g. the RTT-radar when using /sim/screneryloaded-override

--prop:sim/sceneryloaded-override=true has the effect that fgfs
doesn't show the splash screen until the scenery is loaded, but shows
the OTW view (scenery/aircraft) at the earliest possible moment. This is
useful for developers who often need to run fgfs only to check some minor
detail, while not caring about stuttering caused by scenery loading.

src/Main/main.cxx

index ffb8d499bfb9a631e06135eb01c0b861b58d2635..4b369785e69ba789cfe79b9d1721a5c9356d412f 100644 (file)
@@ -219,7 +219,8 @@ static void fgMainLoop( void ) {
 
     SGCloudLayer::enable_bump_mapping = fgGetBool("/sim/rendering/bump-mapping");
 
-    bool scenery_loaded = fgGetBool("sim/sceneryloaded") || fgGetBool("sim/sceneryloaded-override");
+    bool scenery_loaded = fgGetBool("sim/sceneryloaded");
+    bool wait_for_scenery = !(scenery_loaded || fgGetBool("sim/sceneryloaded-override"));
 
     // Update the elapsed time.
     static bool first_time = true;
@@ -229,7 +230,7 @@ static void fgMainLoop( void ) {
     }
 
     double throttle_hz = fgGetDouble("/sim/frame-rate-throttle-hz", 0.0);
-    if ( throttle_hz > 0.0 && scenery_loaded ) {
+    if ( throttle_hz > 0.0 && !wait_for_scenery ) {
         // optionally throttle the frame rate (to get consistent frame
         // rates or reduce cpu usage.
 
@@ -314,7 +315,7 @@ static void fgMainLoop( void ) {
     }
 
 
-    if (clock_freeze->getBoolValue() || !scenery_loaded) {
+    if (clock_freeze->getBoolValue() || wait_for_scenery) {
         delta_time_sec = 0;
     } else {
         delta_time_sec = real_delta_time_sec;