]> git.mxchange.org Git - flightgear.git/commitdiff
Cache the renderer in a local pointer.
authorehofman <ehofman>
Mon, 27 Sep 2004 09:13:12 +0000 (09:13 +0000)
committerehofman <ehofman>
Mon, 27 Sep 2004 09:13:12 +0000 (09:13 +0000)
src/GUI/gui_funcs.cxx

index 0672588d8bef644132aaecaa6f26969a50a28a77..4f51dcc7d3f5eb7b18927e81ec2f221619bb2072 100644 (file)
@@ -636,7 +636,7 @@ void fgHiResDump()
         trBeginTile(tr);
         int curColumn = trGet(tr, TR_CURRENT_COLUMN);
         int curRow =  trGet(tr, TR_CURRENT_ROW);
-        globals->get_renderer()->screendump();
+        renderer->screendump();
         if ( do_hud )
             fgUpdateHUD( curColumn*hud_col_step,      curRow*hud_row_step,
                          (curColumn+1)*hud_col_step, (curRow+1)*hud_row_step );
@@ -673,7 +673,7 @@ void fgHiResDump()
 
     }
 
-    globals->get_renderer()->resize( width, height );
+    renderer->resize( width, height );
 
     trDelete(tr);
 
@@ -797,15 +797,16 @@ void fgDumpSnapShot () {
        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
-    globals->get_renderer()->update();
-    globals->get_renderer()->update();
+    renderer->update();
+    renderer->update();
 
     while (count < 1000) {
         FILE *fp;