# endif
#endif
+#include <plib/ssg.h>
+
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/sg_path.hxx>
#if defined( TR_HIRES_SNAP)
#include <simgear/screen/tr.h>
-extern void trRenderFrame( void );
extern void fgUpdateHUD( GLfloat x_start, GLfloat y_start,
GLfloat x_end, GLfloat y_end );
#endif
{"loadFlight", loadFlight},
{"reInit", reInit},
#ifdef TR_HIRES_SNAP
- {"dumpHiResSnapShot", dumpHiResSnapShot},
+ {"dumpHiResSnapShot", fgHiResDumpWrapper},
#endif
- {"dumpSnapShot", dumpSnapShot},
+ {"dumpSnapShot", fgDumpSnapShotWrapper},
#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
{"printScreen", printScreen},
#endif
static int count = 1;
static const SGPropertyNode *master_freeze
- = fgGetNode("/sim/freeze/master");
+ = fgGetNode("/sim/freeze/master");
bool freeze = master_freeze->getBoolValue();
if ( !freeze ) {
fgSetBool("/sim/freeze/master", true);
}
+ TurnCursorOff();
if ( !puCursorIsHidden() ) {
- show_pu_cursor = true;
- puHideCursor();
+ show_pu_cursor = true;
+ puHideCursor();
}
FGRenderer *renderer = globals->get_renderer();
// we need two render frames here to clear the menu and cursor
// ... not sure why but doing an extra fgRenderFrame() shouldn't
// hurt anything
- renderer->update( 0.0 );
- renderer->update( 0.0 );
-
- // Make sure we have SSG projection primed for current view
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- ssgSetCamera( (sgVec4 *)globals->get_current_view()->get_VIEW() );
- ssgSetFOV( globals->get_current_view()->get_h_fov(),
- globals->get_current_view()->get_v_fov() );
- // ssgSetNearFar( 10.0f, 120000.0f );
- ssgSetNearFar( 0.5f, 1200000.0f );
+ renderer->update( true );
+ renderer->update( true );
-
// This ImageSize stuff is a temporary hack
// should probably use 128x128 tile size and
// support any image size
// This should be a requester to get multiplier from user
- int multiplier = 3;
+ int multiplier = fgGetInt("/sim/startup/hires-multiplier", 3);
int width = fgGetInt("/sim/startup/xsize");
int height = fgGetInt("/sim/startup/ysize");
trBeginTile(tr);
int curColumn = trGet(tr, TR_CURRENT_COLUMN);
int curRow = trGet(tr, TR_CURRENT_ROW);
- trRenderFrame();
+ renderer->update( false );
if ( do_hud )
fgUpdateHUD( curColumn*hud_col_step, curRow*hud_row_step,
(curColumn+1)*hud_col_step, (curRow+1)*hud_row_step );
}
- globals->get_renderer()->resize( width, height );
+ renderer->resize( width, height );
trDelete(tr);
puShowCursor();
}
+ TurnCursorOn();
+
if ( !freeze ) {
fgSetBool("/sim/freeze/master", false);
}
globals->get_renderer()->resize( cur_width, cur_height );
// pan to tile
rotateView( 0, (y*fov)-((multiplier-1)*fov/2), (x*fov)-((multiplier-1)*fov/2) );
- fgRenderFrame();
+ globals->get_renderer()->update( false );
// restore view
GlBitmap b2;
b1->copyBitmap( &b2, cur_width*x, cur_height*y );
int cur_width = fgGetInt("/sim/startup/xsize");
int cur_height = fgGetInt("/sim/startup/ysize");
p.Begin( "FlightGear", cur_width*3, cur_height*3 );
- p.End( hiResScreenCapture(3) );
+ p.End( hiResScreenCapture(3) );
// BusyCursor(1);
if ( show_pu_cursor ) {
#endif // #ifdef WIN32
-void dumpSnapShot ( puObject *obj ) {
+void fgDumpSnapShotWrapper ( puObject *obj ) {
fgDumpSnapShot();
}
-void dumpHiResSnapShot ( puObject *obj ) {
+void fgHiResDumpWrapper ( puObject *obj ) {
fgHiResDump();
}
puHideCursor();
}
- globals->get_renderer()->init();
- globals->get_renderer()->resize( fgGetInt("/sim/startup/xsize"),
- fgGetInt("/sim/startup/ysize") );
+ FGRenderer *renderer = globals->get_renderer();
+ renderer->init();
+ renderer->resize( fgGetInt("/sim/startup/xsize"),
+ fgGetInt("/sim/startup/ysize") );
// we need two render frames here to clear the menu and cursor
// ... not sure why but doing an extra fgRenderFrame() shouldn't
// hurt anything
- fgRenderFrame();
- fgRenderFrame();
+ renderer->update( true );
+ renderer->update( true );
while (count < 1000) {
FILE *fp;