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 );
//
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;
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();
// 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)
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();