Remove the GUI popup from the screen capture C++ code (a request via
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.
This commit is contained in:
parent
5a73a46cd0
commit
99885791e9
2 changed files with 10 additions and 14 deletions
|
@ -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,
|
||||
int result = 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 += "\".";
|
||||
}
|
||||
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;
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue