]> git.mxchange.org Git - flightgear.git/commitdiff
Added write-all parameter to save command. If set to true, the
authordavid <david>
Sun, 3 Mar 2002 22:48:40 +0000 (22:48 +0000)
committerdavid <david>
Sun, 3 Mar 2002 22:48:40 +0000 (22:48 +0000)
command will save *all* properties, rather than just those marked as
archivable.  This feature was requested by Tony Peden to make it
easier to write documentation on the properties, but it should also be
useful for debugging.  There is currently no default binding for the
command with the write-all parameter set to true.

src/Main/fg_commands.cxx
src/Main/fg_props.cxx
src/Main/fg_props.hxx

index 36554cb23830cd48ec1565a64e24006738415978..76b0441fdd58aeb303b3f83d1b8b2e7a4f9c93a5 100644 (file)
@@ -168,9 +168,10 @@ static bool
 do_save (const SGPropertyNode * arg, SGCommandState ** state)
 {
   const string &file = arg->getStringValue("file", "fgfs.sav");
+  bool write_all = arg->getBoolValue("write-all", false);
   SG_LOG(SG_INPUT, SG_INFO, "Saving flight");
   ofstream output(file.c_str());
-  if (output.good() && fgSaveFlight(output)) {
+  if (output.good() && fgSaveFlight(output, write_all)) {
     output.close();
     SG_LOG(SG_INPUT, SG_INFO, "Saved flight to " << file);
     return true;
index b7966352e9aaeabc14efb2f411ddf3d795065898..a65196ca9a6fdc0ff30dd69e4932850549bc45b5 100644 (file)
@@ -864,10 +864,10 @@ fgUpdateProps ()
  * Save the current state of the simulator to a stream.
  */
 bool
-fgSaveFlight (ostream &output)
+fgSaveFlight (ostream &output, bool write_all)
 {
   try {
-    writeProperties(output, globals->get_props());
+    writeProperties(output, globals->get_props(), write_all);
   } catch (const sg_exception &e) {
     guiErrorMessage("Error saving flight: ", e);
     return false;
index 9d907249709621ce1ce6508ebcf1463d1b731d17..a21c438c5c378269df425cf6fdeb03b95461b384 100644 (file)
@@ -43,9 +43,11 @@ extern void fgUpdateProps ();
  * so that the current flight can be restored later.
  *
  * @param output The output stream to write the XML save file to.
+ * @param write_all If true, write all properties rather than
+ *        just the ones flagged as archivable.
  * @return true if the flight was saved successfully.
  */
-extern bool fgSaveFlight (ostream &output);
+extern bool fgSaveFlight (ostream &output, bool write_all = false);
 
 
 /**