-// Save the current state as the initial state.
-void
-FGGlobals::saveInitialState ()
-{
- initial_state = new SGPropertyNode();
-
- // copy properties which are READ/WRITEable - but not USERARCHIVEd or PRESERVEd
- int checked = SGPropertyNode::READ+SGPropertyNode::WRITE+
- SGPropertyNode::USERARCHIVE+SGPropertyNode::PRESERVE;
- int expected = SGPropertyNode::READ+SGPropertyNode::WRITE;
- if (!copyProperties(props, initial_state, expected, checked))
- SG_LOG(SG_GENERAL, SG_ALERT, "Error saving initial state");
-
- // delete various properties from the initial state, since we want to
- // preserve their values even if doing a restore
- // => Properties should now use the PRESERVE flag to protect their values
- // on sim-reset. Remove some specific properties for backward compatibility.
- SGPropertyNode* sim = initial_state->getChild("sim");
- SGPropertyNode* cameraGroupNode = sim->getNode("rendering/camera-group");
- if (cameraGroupNode) {
- cameraGroupNode->removeChild("camera");
- cameraGroupNode->removeChild("gui");
- }
-}
-