5a849b66e8
- changed FGSubsystem::update(int) to FGSubsystem::update(delta_time_sec); the argument is now delta time in seconds rather than milliseconds - added FGSubsystem::suspend(), FGSubsystem::suspend(bool), FGSubsystem::resume(), and FGSubsystem::is_suspended(), all with default implementations; is_suspended takes account of the master freeze as well as the subsystem's individual suspended state - the FDMs now use the delta time argument the same as the rest of FlightGear; formerly, main.cxx made a special case and passed a multiloop argument - FDMs now calculate multiloop internally instead of relying on main.cxx There are probably some problems -- I've done basic testing with the major FDMs and subsystems, but we'll probably need a few weeks to sniff out bugs.
50 lines
791 B
C++
50 lines
791 B
C++
#include "fgfs.hxx"
|
||
|
||
#include <simgear/debug/logstream.hxx>
|
||
|
||
#include "globals.hxx"
|
||
#include "fg_props.hxx"
|
||
|
||
|
||
|
||
////////////////////////////////////////////////////////////////////////
|
||
// Implementation of FGSubsystem
|
||
////////////////////////////////////////////////////////////////////////
|
||
|
||
|
||
FGSubsystem::FGSubsystem ()
|
||
: _suspended(false)
|
||
{
|
||
}
|
||
|
||
FGSubsystem::~FGSubsystem ()
|
||
{
|
||
}
|
||
|
||
void
|
||
FGSubsystem::suspend ()
|
||
{
|
||
_suspended = true;
|
||
}
|
||
|
||
void
|
||
FGSubsystem::suspend (bool suspended)
|
||
{
|
||
_suspended = suspended;
|
||
}
|
||
|
||
void
|
||
FGSubsystem::resume ()
|
||
{
|
||
_suspended = false;
|
||
}
|
||
|
||
bool
|
||
FGSubsystem::is_suspended () const
|
||
{
|
||
if (!_freeze_master_node.valid())
|
||
_freeze_master_node = fgGetNode("/sim/freeze/master", true);
|
||
return _suspended || _freeze_master_node->getBoolValue();
|
||
}
|
||
|
||
// end of fgfs.cxx
|