]> git.mxchange.org Git - flightgear.git/commitdiff
Remove the GUI popup from the screen capture C++ code (a request via
authorandy <andy>
Thu, 7 Jun 2007 16:57:59 +0000 (16:57 +0000)
committerandy <andy>
Thu, 7 Jun 2007 16:57:59 +0000 (16:57 +0000)
IRC wanted this to be scritable) and add it back (as a tip popup) via
a little nasal in the keyboard handler.  Also put the synthesis of
property nodes back into fgcommand(), because I got cold feet.

src/GUI/gui_funcs.cxx
src/Scripting/NasalSys.cxx

index d8bb9b280597d9b2becbe0f1f21ee634bcbd25c7..de6aded6ac4ab181b2bbd35759d6ebc15d8b7878 100644 (file)
@@ -506,7 +506,6 @@ void fgHiResDumpWrapper ( puObject *obj ) {
 void fgDumpSnapShot () {
     bool show_pu_cursor = false;
     char *filename = new char [24];
-    string message;
     static int count = 1;
 
     static const SGPropertyNode *master_freeze
@@ -543,20 +542,13 @@ void fgDumpSnapShot () {
         fclose(fp);
     }
 
-    if ( sg_glDumpWindow( filename,
-                         fgGetInt("/sim/startup/xsize"), 
-                         fgGetInt("/sim/startup/ysize")) ) {
-       message = "Snapshot saved to \"";
-       message += filename;
-       message += "\".";
-    } else {
-        message = "Failed to save to \"";
-       message += filename;
-       message += "\".";
-    }
+    int result = sg_glDumpWindow(filename,
+                                 fgGetInt("/sim/startup/xsize"),
+                                 fgGetInt("/sim/startup/ysize"));
+    fgSetString("/sim/last-screenshot", result ? filename : "");
 
     fgSetBool("/sim/signals/screenshot", false);
-    mkDialog (message.c_str());
+    //mkDialog (message.c_str());
 
     delete [] filename;
 
index 7fb471b49fc55a4008d614ff32c24b4bb0714441..1e832d45f3dc5bc9a98badd3f9686b9867d1cb68 100644 (file)
@@ -256,9 +256,13 @@ static naRef f_fgcommand(naContext c, naRef me, int argc, naRef* args)
     naRef props = argc > 1 ? args[1] : naNil();
     if(!naIsString(cmd) || (!naIsNil(props) && !naIsGhost(props)))
         naRuntimeError(c, "bad arguments to fgcommand()");
-    SGPropertyNode_ptr* node = NULL;
+    SGPropertyNode_ptr tmp, *node;
     if(!naIsNil(props))
         node = (SGPropertyNode_ptr*)naGhost_ptr(props);
+    else {
+        tmp = new SGPropertyNode();
+        node = &tmp;
+    }
     return naNum(globals->get_commands()->execute(naStr_data(cmd), *node));
 }