]> git.mxchange.org Git - flightgear.git/commitdiff
write to /sim/startup/xsize only if the size really changed; likewise for
authormfranz <mfranz>
Sat, 28 Jan 2006 10:40:47 +0000 (10:40 +0000)
committermfranz <mfranz>
Sat, 28 Jan 2006 10:40:47 +0000 (10:40 +0000)
ysize. This is useful for listeners, e.g. the one that will re-position the
FPS dialog.

src/Main/renderer.cxx

index 9f7ccb0dbe60381d5ec62540ca7df5672ee3d4d7..7e9c6f9974346b6a2684104868040ae6bac12f2f 100644 (file)
@@ -796,8 +796,13 @@ FGRenderer::resize( int width, int height ) {
 
     glViewport( 0, (GLint)(height - view_h), (GLint)(width), (GLint)(view_h) );
 
-    fgSetInt("/sim/startup/xsize", width);
-    fgSetInt("/sim/startup/ysize", height);
+    static int lastwidth = width;
+    static int lastheight = height;
+    if (width != lastwidth)
+        fgSetInt("/sim/startup/xsize", lastwidth = width);
+    if (height != lastheight)
+        fgSetInt("/sim/startup/ysize", lastheight = height);
+
     guiInitMouse(width, height);
 
     // for all views