Screenshot tweaks from Cameron Moore.
This commit is contained in:
parent
ffe70e3221
commit
4c4d17631f
3 changed files with 30 additions and 11 deletions
|
@ -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 );
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue