From: curt Date: Sun, 22 Apr 2001 22:04:25 +0000 (+0000) Subject: Screenshot tweaks from Cameron Moore. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4c4d17631fb9a7794e0009ebebe285b1f9eed967;p=flightgear.git Screenshot tweaks from Cameron Moore. --- diff --git a/src/Autopilot/auto_gui.cxx b/src/Autopilot/auto_gui.cxx index 6e8916a8b..833180d90 100644 --- a/src/Autopilot/auto_gui.cxx +++ b/src/Autopilot/auto_gui.cxx @@ -590,7 +590,7 @@ void TgtAptDialog_OK (puObject *) string tmp = s; double alt = 0.0; - int pos = tmp.find( "@" ); + unsigned int pos = tmp.find( "@" ); if ( pos != string::npos ) { TgtAptId = tmp.substr( 0, pos ); string alt_str = tmp.substr( pos + 1 ); diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index 76ecb8f3c..fb10cdaaa 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -980,11 +980,11 @@ static void set_hud_color(float r, float g, float b) { // void fgUpdateHUD( void ) { int brightness; -// int day_night_sw = current_aircraft.controls->day_night_switch; + // int day_night_sw = current_aircraft.controls->day_night_switch; int day_night_sw = global_day_night_switch; int hud_displays = HUD_deque.size(); instr_item *pHUDInstr; - float line_width; + // float line_width; if( !hud_displays ) { // Trust everyone, but ALWAYS cut the cards! return; @@ -992,11 +992,11 @@ void fgUpdateHUD( void ) { HUD_TextList.erase(); HUD_LineList.erase(); -// HUD_StippleLineList.erase(); + // HUD_StippleLineList.erase(); pHUDInstr = HUD_deque[0]; brightness = pHUDInstr->get_brightness(); -// brightness = HUD_deque.at(0)->get_brightness(); + // brightness = HUD_deque.at(0)->get_brightness(); glMatrixMode(GL_PROJECTION); glPushMatrix(); diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index 5bc08bbcd..db0b9f347 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -525,6 +525,9 @@ void dumpSnapShot ( puObject *obj ) { // do a screen snap shot void fgDumpSnapShot () { bool show_pu_cursor = false; + char *filename = new char [24]; + string message; + static int count = 1; int freeze = globals->get_freeze(); if(!freeze) @@ -542,16 +545,32 @@ void fgDumpSnapShot () { fgGetInt("/sim/startup/ysize") ); // we need two render frames here to clear the menu and cursor - // ... not sure why but doing an extra fgFenderFrame() shoulnd't + // ... not sure why but doing an extra fgRenderFrame() shouldn't // hurt anything fgRenderFrame(); fgRenderFrame(); - my_glDumpWindow( "fgfs-screen.ppm", - fgGetInt("/sim/startup/xsize"), - fgGetInt("/sim/startup/ysize") ); - - mkDialog ("Snap shot saved to fgfs-screen.ppm"); + while (count < 1000) { + FILE *fp; + snprintf(filename, 24, "fgfs-screen-%03d.ppm", count++); + if ( (fp = fopen(filename, "r")) == NULL ) + break; + fclose(fp); + } + + if ( sg_glDumpWindow( filename, + fgGetInt("/sim/startup/xsize"), + fgGetInt("/sim/startup/ysize")) ) { + message = "Snap shot saved to "; + message += filename; + } else { + message = "Failed to save to "; + message += filename; + } + + mkDialog (message.c_str()); + + delete [] filename; if ( show_pu_cursor ) { puShowCursor();