]> git.mxchange.org Git - flightgear.git/commitdiff
Fix for reinit after user resizes screen.
authorcurt <curt>
Mon, 16 Apr 2001 20:31:26 +0000 (20:31 +0000)
committercurt <curt>
Mon, 16 Apr 2001 20:31:26 +0000 (20:31 +0000)
src/GUI/gui_local.cxx

index a68e3063ebee97b1d7187339b4f55f5831cd7135..9e9bc19ac25eb1a544a8cb261ffbe1588e1fb7d6 100644 (file)
@@ -1,13 +1,16 @@
 #include <GL/glut.h>           // needed before pu.h
 #include <plib/pu.h>           // plib include
 
-
 #include <Main/globals.hxx>
 #include <Main/fg_init.hxx>
+#include <Main/fg_props.hxx>
 
 #include "gui.h"
 #include "trackball.h"
 
+// from main.cxx
+extern void fgReshape(int, int);
+
 // FOR MOUSE VIEW MODE
 // stashed trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
 static float _quat0[4];
@@ -38,9 +41,19 @@ void reInit(puObject *cb)
 {
        BusyCursor(0);
        Quat0();
+
+       // in case user has changed window size as
+       // restoreInitialState() overwrites these
+       int xsize = fgGetInt("/sim/startup/xsize");
+       int ysize = fgGetInt("/sim/startup/ysize");
+
        build_rotmatrix(GuiQuat_mat, curGuiQuat);
        /* check */ globals->restoreInitialState();
+
        fgReInitSubsystems();
+
+       fgReshape( xsize, ysize );
+
        BusyCursor(1);
 }