]> git.mxchange.org Git - flightgear.git/commitdiff
remove depreciated gui_local.[ch]xx:
authormfranz <mfranz>
Wed, 9 Jul 2008 12:22:33 +0000 (12:22 +0000)
committermfranz <mfranz>
Wed, 9 Jul 2008 12:22:33 +0000 (12:22 +0000)
- drop unused parts (MouseQuat/GuiQuat)
- move "old-reinit-dialog" fgcommand to fg_command.cxx under new name
  "reset" for now. (May later get merged with fgcommand "reinit".)
- move reInit() to fg_init.cxx: This was used by Shift-Esc and
  Menu->File-Reset (via fgcommand "old-reinit-dialog"). We have already
  a similar function fgReInitSubsystems() in fg_init.cxx, so these two
  functions will probably get merged later.)

src/GUI/Makefile.am
src/GUI/README
src/GUI/gui.cxx
src/GUI/gui_funcs.cxx
src/GUI/gui_local.cxx [deleted file]
src/GUI/gui_local.hxx [deleted file]
src/GUI/menubar.cxx
src/GUI/mouse.cxx
src/Main/fg_commands.cxx
src/Main/fg_init.cxx

index 960580cf4fbf6eabe723fcbbf827958fa3c0edf1..92bc5de7a2df3b6d0cf31b4f949b78f46a52aa16 100644 (file)
@@ -6,7 +6,6 @@ libGUI_a_SOURCES = \
         dialog.cxx dialog.hxx \
        menubar.cxx menubar.hxx \
        gui.cxx gui.h gui_funcs.cxx \
-       gui_local.cxx gui_local.hxx \
        mouse.cxx fonts.cxx \
        trackball.c trackball.h \
        AirportList.cxx AirportList.hxx \
index 5486ea1f52a8ae14dfedb34540d5aae6780abb21..ed947748c7f8a92f19057ebfe53499a3b5c1f427 100644 (file)
@@ -9,7 +9,6 @@ Files:
 dialog.[ch]xx           XML-configurable dialog box.
 gui.cxx, gui.h          Top-level GUI functions (deprecated).
 gui_funcs.cxx           Implementation of internal GUI functions (deprecated).
-gui_local.[ch]xx        More internal GUI functions (deprecated).
 menubar.[ch]xx          XML-configurable menu bar.
 mouse.cxx               Old GUI mouse support (deprecated).
 new_gui.[ch]xx          Top-level for the GUI subsystem.
index 69b172d1b77f7b8e844e858723ea7f32190ec47f..3675fb6d8169162ef9f8cc361f0733f7e7e779d4 100644 (file)
@@ -51,7 +51,6 @@
 #include <GUI/new_gui.hxx>
 
 #include "gui.h"
-#include "gui_local.hxx"
 #include "layout.hxx"
 
 using namespace osg;
@@ -133,7 +132,6 @@ bool guiFinishInit()
         return false;
     if (!initOp->isFinished())
         return false;
-    initMouseQuat();
     initOp = 0;
     return true;
 }
index dae131cde9eb1aefca8a3cc2543e09338b20c110..2c96b0e3171db24576918145162e78e1be342dad 100644 (file)
@@ -88,7 +88,6 @@
 #endif
 
 #include "gui.h"
-#include "gui_local.hxx"
 
 SG_USING_STD(string);
 SG_USING_STD(cout);
diff --git a/src/GUI/gui_local.cxx b/src/GUI/gui_local.cxx
deleted file mode 100644 (file)
index 8cf3458..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
-#include <plib/pu.h>        // plib include
-
-#include <FDM/flight.hxx>
-
-#include <Main/globals.hxx>
-#include <Main/fg_init.hxx>
-#include <Main/fg_props.hxx>
-#include <Main/renderer.hxx>
-#include <Scenery/tilemgr.hxx>
-#include <Time/light.hxx>
-
-#include "gui.h"
-#include "trackball.h"
-
-// FOR MOUSE VIEW MODE
-// stashed trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
-static float _quat0[4];
-
-float curGuiQuat[4];
-
-// To apply our mouse rotation quat to VIEW
-// sgPreMultMat4( VIEW, GuiQuat_mat);
-// This is here temporarily should be in views.hxx
-float GuiQuat_mat[4][4];
-
-void Quat0( void ) {
-    curGuiQuat[0] = _quat0[0];
-    curGuiQuat[1] = _quat0[1];
-    curGuiQuat[2] = _quat0[2];
-    curGuiQuat[3] = _quat0[3];
-}
-
-void initMouseQuat(void) {
-    trackball(_quat0, 0.0, 0.0, 0.0, 0.0);  
-    Quat0();
-    build_rotmatrix(GuiQuat_mat, curGuiQuat);
-}
-
-
-void reInit(void)
-{
-    Quat0();
-
-    static const SGPropertyNode *master_freeze
-       = fgGetNode("/sim/freeze/master");
-
-    bool freeze = master_freeze->getBoolValue();
-    if ( !freeze ) {
-        fgSetBool("/sim/freeze/master", true);
-    }
-
-    fgSetBool("/sim/signals/reinit", true);
-    cur_fdm_state->unbind();
-
-    // 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);
-
-    globals->restoreInitialState();
-
-    // update our position based on current presets
-    fgInitPosition();
-
-    // We don't know how to resize the window, so keep the last values 
-    //  for xsize and ysize, and don't use the one set initially
-    fgSetInt("/sim/startup/xsize",xsize);
-    fgSetInt("/sim/startup/ysize",ysize);
-
-    SGTime *t = globals->get_time_params();
-    delete t;
-    t = fgInitTime();
-    globals->set_time_params( t );
-
-    fgReInitSubsystems();
-
-    globals->get_tile_mgr()->update( fgGetDouble("/environment/visibility-m") );
-    globals->get_renderer()->resize( xsize, ysize );
-    fgSetBool("/sim/signals/reinit", false);
-
-    if ( !freeze ) {
-        fgSetBool("/sim/freeze/master", false);
-    }
-}
-
diff --git a/src/GUI/gui_local.hxx b/src/GUI/gui_local.hxx
deleted file mode 100644 (file)
index 5925175..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include <simgear/compiler.h>
-
-#include "trackball.h"
-
-#if defined(WIN32) || defined(__CYGWIN32__)
-#define WIN32_CURSOR_TWEAKS
-// uncomment this for cursor to turn off when menu is disabled
-// #define WIN32_CURSOR_TWEAKS_OFF
-#elif (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
-#define X_CURSOR_TWEAKS
-#endif
-
-typedef enum {
-       MOUSE_POINTER,
-       MOUSE_YOKE,
-       MOUSE_VIEW
-} MouseMode;
-
-extern MouseMode mouse_mode;
-extern int gui_menu_on;
-
-extern float curGuiQuat[4];
-extern float GuiQuat_mat[4][4];
-
-extern void initMouseQuat( void );
-extern void Quat0( void );
-
-extern void reInit(void);
index fd034c1969db1e0c15f3ce620c1e2a59b762d92a..db8e32aab94bb23a307fdb5540c2962dbe225070 100644 (file)
 // user-configured dialogs and new commands where necessary.
 ////////////////////////////////////////////////////////////////////////
 
-extern void reInit (void);
-static bool
-do_reinit_dialog (const SGPropertyNode * arg)
-{
-    reInit();
-    return true;
-}
-
 #if defined(TR_HIRES_SNAP)
 extern void dumpHiResSnapShot ();
 static bool
@@ -66,7 +58,6 @@ static struct {
     const char * name;
     SGCommandMgr::command_t command;
 } deprecated_dialogs [] = {
-    { "old-reinit-dialog", do_reinit_dialog },
 #if defined(TR_HIRES_SNAP)
     { "old-hires-snapshot-dialog", do_hires_snapshot_dialog },
 #endif
index 29e1df2626efe68526cde361de6bd9323500b711..ec2c4a68f97cf907f321aa35d1feecb0857cbdd4 100644 (file)
@@ -64,7 +64,6 @@
 #include <Main/viewmgr.hxx>
 
 #include "gui.h"
-#include "gui_local.hxx"
 
 SG_USING_STD(string);
 SG_USING_STD(cout);
@@ -73,11 +72,25 @@ SG_USING_STD(cout);
 Mouse stuff
 ---------------------------------------------------------------------*/
 
+#if defined(WIN32) || defined(__CYGWIN32__)
+#define WIN32_CURSOR_TWEAKS
+// uncomment this for cursor to turn off when menu is disabled
+// #define WIN32_CURSOR_TWEAKS_OFF
+#elif (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
+#define X_CURSOR_TWEAKS
+#endif
+
 static int mouse_active = 0;
 
 static int MOUSE_XSIZE = 0;
 static int MOUSE_YSIZE = 0;
 
+typedef enum {
+       MOUSE_POINTER,
+       MOUSE_YOKE,
+       MOUSE_VIEW
+} MouseMode;
+
 /* --------------------------------------------------------------------
 Support for mouse as control yoke (david@megginson.com)
 
index 34bc4a286447e1b2cbede0675f560a49d9a2ff2c..caec3c0d1fc67d81d164631a6dfbe1617bd023d0 100644 (file)
@@ -211,6 +211,17 @@ do_exit (const SGPropertyNode * arg)
 }
 
 
+/**
+ * Reset FlightGear (Shift-Escape or Menu->File->Reset)
+ */
+static bool
+do_reset (const SGPropertyNode * arg)
+{
+    reInit();
+    return true;
+}
+
+
 /**
  * Built-in command: reinitialize one or more subsystems.
  *
@@ -1445,6 +1456,7 @@ static struct {
     { "null", do_null },
     { "nasal", do_nasal },
     { "exit", do_exit },
+    { "reset", do_reset },
     { "reinit", do_reinit },
     { "suspend", do_reinit },
     { "resume", do_reinit },
index d25cd6fb650698812eb93a62442ff1f1dac4be52..6a83efb412f6cf2edaac395fce3603b03fff971b 100644 (file)
 #include "options.hxx"
 #include "globals.hxx"
 #include "logger.hxx"
+#include "renderer.hxx"
 #include "viewmgr.hxx"
 #include "main.hxx"
 
@@ -1986,3 +1987,45 @@ void fgReInitSubsystems()
     fgSetBool("/sim/sceneryloaded",false);
 }
 
+
+void reInit(void)  // from gui_local.cxx -- TODO merge with fgReInitSubsystems()
+{
+    static SGPropertyNode_ptr master_freeze = fgGetNode("/sim/freeze/master", true);
+
+    bool freeze = master_freeze->getBoolValue();
+    if (!freeze)
+        master_freeze->setBoolValue(true);
+
+    fgSetBool("/sim/signals/reinit", true);
+    cur_fdm_state->unbind();
+
+    // in case user has changed window size as
+    // restoreInitialState() overwrites these
+    int xsize = fgGetInt("/sim/startup/xsize");
+    int ysize = fgGetInt("/sim/startup/ysize");
+
+    globals->restoreInitialState();
+
+    // update our position based on current presets
+    fgInitPosition();
+
+    // We don't know how to resize the window, so keep the last values
+    //  for xsize and ysize, and don't use the one set initially
+    fgSetInt("/sim/startup/xsize", xsize);
+    fgSetInt("/sim/startup/ysize", ysize);
+
+    SGTime *t = globals->get_time_params();
+    delete t;
+    t = fgInitTime();
+    globals->set_time_params(t);
+
+    fgReInitSubsystems();
+
+    globals->get_tile_mgr()->update(fgGetDouble("/environment/visibility-m"));
+    globals->get_renderer()->resize(xsize, ysize);
+    fgSetBool("/sim/signals/reinit", false);
+
+    if (!freeze)
+        master_freeze->setBoolValue(false);
+}
+