]> git.mxchange.org Git - flightgear.git/commitdiff
Refactor things so that individual subsystems can override suspension.
authordavid <david>
Sat, 1 Mar 2003 21:29:16 +0000 (21:29 +0000)
committerdavid <david>
Sat, 1 Mar 2003 21:29:16 +0000 (21:29 +0000)
src/Main/fgfs.cxx

index e66db61ebd46e4700b67c635306a2b24aec833ad..1997693262edd5543d5a507e40e1adb6a5849ff8 100644 (file)
@@ -115,16 +115,13 @@ FGSubsystemGroup::unbind ()
 void
 FGSubsystemGroup::update (double delta_time_sec)
 {
-    if (!is_suspended()) {
-        for (int i = 0; i < _members.size(); i++)
-            _members[i]->update(delta_time_sec); // indirect call
-    }
+    for (int i = 0; i < _members.size(); i++)
+        _members[i]->update(delta_time_sec); // indirect call
 }
 
 void
 FGSubsystemGroup::suspend ()
 {
-    FGSubsystem::suspend();
     for (int i = 0; i < _members.size(); i++)
         _members[i]->subsystem->suspend();
 }
@@ -132,7 +129,6 @@ FGSubsystemGroup::suspend ()
 void
 FGSubsystemGroup::resume ()
 {
-    FGSubsystem::resume();
     for (int i = 0; i < _members.size(); i++)
         _members[i]->subsystem->resume();
 }
@@ -140,7 +136,7 @@ FGSubsystemGroup::resume ()
 bool
 FGSubsystemGroup::is_suspended () const
 {
-    return FGSubsystem::is_suspended();
+    return false;
 }
 
 void
@@ -229,8 +225,10 @@ FGSubsystemGroup::Member::update (double delta_time_sec)
 {
     elapsed_sec += delta_time_sec;
     if (elapsed_sec >= min_step_sec) {
-        subsystem->update(delta_time_sec);
-        elapsed_sec -= min_step_sec;
+        if (!subsystem->is_suspended()) {
+            subsystem->update(delta_time_sec);
+            elapsed_sec -= min_step_sec;
+        }
     }
 }
 
@@ -280,16 +278,14 @@ FGSubsystemMgr::unbind ()
 void
 FGSubsystemMgr::update (double delta_time_sec)
 {
-    if (!is_suspended()) {
-        for (int i = 0; i < MAX_GROUPS; i++)
-            _groups[i].update(delta_time_sec);
+    for (int i = 0; i < MAX_GROUPS; i++) {
+        _groups[i].update(delta_time_sec);
     }
 }
 
 void
 FGSubsystemMgr::suspend ()
 {
-    FGSubsystem::suspend();
     for (int i = 0; i < MAX_GROUPS; i++)
         _groups[i].suspend();
 }
@@ -297,7 +293,6 @@ FGSubsystemMgr::suspend ()
 void
 FGSubsystemMgr::resume ()
 {
-    FGSubsystem::resume();
     for (int i = 0; i < MAX_GROUPS; i++)
         _groups[i].resume();
 }
@@ -305,7 +300,7 @@ FGSubsystemMgr::resume ()
 bool
 FGSubsystemMgr::is_suspended () const
 {
-    return FGSubsystem::is_suspended();
+    return false;
 }
 
 void