]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/mouse.cxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / GUI / mouse.cxx
index 9e6fc7b26d5ba5478b56daddbe22caeb10f59f5e..4f63d7c4f522a2e26b572b747a78a8e47c9d9c92 100644 (file)
@@ -38,8 +38,7 @@
 #  include <windows.h>
 #endif
 
-#include <GL/glut.h>
-#include <GL/gl.h>
+#include GLUT_H
 
 #if defined(FX) && defined(XMESA)
 #  include <GL/xmesa.h>
 #include "gui_local.hxx"
 
 SG_USING_STD(string);
-
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
 SG_USING_STD(cout);
-#endif
 
 /* --------------------------------------------------------------------
 Mouse stuff
@@ -175,7 +171,7 @@ static inline int right_button( void ) {
 
 static inline void set_goal_view_offset( float offset )
 {
-       globals->get_current_view()->set_goal_view_offset(offset * SGD_RADIANS_TO_DEGREES);
+       globals->get_current_view()->setGoalHeadingOffset_deg(offset * SGD_RADIANS_TO_DEGREES);
 }
 
 static inline void set_view_offset( float offset )
@@ -185,7 +181,7 @@ static inline void set_view_offset( float offset )
 
 static inline void set_goal_view_tilt( float tilt )
 {
-       globals->get_current_view()->set_goal_view_tilt(tilt);
+       globals->get_current_view()->setGoalPitchOffset_deg(tilt);
 }
 
 static inline void set_view_tilt( float tilt )
@@ -198,7 +194,7 @@ static inline float get_view_offset() {
 }
 
 static inline float get_goal_view_offset() {
-       return globals->get_current_view()->get_goal_view_offset() * SGD_DEGREES_TO_RADIANS;
+       return globals->get_current_view()->getGoalHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS;
 }
 
 static inline void move_brake(float offset) {
@@ -327,7 +323,9 @@ void CenterView( void ) {
        glutSetCursor(GLUT_CURSOR_INHERIT);
 
        // Is this necessary ??
+#if defined(FG_OLD_MENU)
        if( !gui_menu_on )   TurnCursorOff();
+#endif
 
        glutWarpPointer( _savedX, _savedY );
     }
@@ -372,6 +370,7 @@ void guiMotionFunc ( int x, int y )
     wh = MOUSE_YSIZE;
 
     if (mouse_mode == MOUSE_POINTER) {
+#if defined(FG_OLD_MENU)
         // TURN MENU ON IF MOUSE AT TOP
         if( y < 1 ) {
             if( !gui_menu_on )
@@ -382,6 +381,7 @@ void guiMotionFunc ( int x, int y )
             if( gui_menu_on )
                 guiToggleMenu();                       
         }
+#endif
         puMouse ( x, y ) ;
         glutPostRedisplay () ;
     } else {
@@ -518,9 +518,6 @@ void guiMouseFunc(int button, int updown, int x, int y)
     static float _quat[4];
     static double _view_offset;
     
-    // general purpose variables
-    double offset;
-            
     glutModifiers = glutGetModifiers();
     glut_active_shift = glutModifiers & GLUT_ACTIVE_SHIFT;
     glut_active_ctrl  = glutModifiers & GLUT_ACTIVE_CTRL; 
@@ -627,11 +624,13 @@ void guiMouseFunc(int button, int updown, int x, int y)
 #endif // NO_SMOOTH_MOUSE_VIEW
 #endif // RESET_VIEW_ON_LEAVING_MOUSE_VIEW
                     glutSetCursor(GLUT_CURSOR_INHERIT);
-                    
+
+#if defined(FG_OLD_MENU)                    
 #if defined(WIN32_CURSOR_TWEAKS_OFF)
                     if(!gui_menu_on)
                         TurnCursorOff();
 #endif // WIN32_CURSOR_TWEAKS_OFF
+#endif // FG_OLD_MENU
                     break;
             } // end switch (mouse_mode)
             glutWarpPointer( x, y );
@@ -649,8 +648,8 @@ void guiMouseFunc(int button, int updown, int x, int y)
     // know what's going on.
     if (mouse_mode == MOUSE_POINTER) {
       if (!puMouse (button, updown, x,y)) {
-        if ( current_panel != NULL ) {
-          current_panel->doMouseAction(button, updown, x, y);
+        if ( globals->get_current_panel() != NULL ) {
+          globals->get_current_panel()->doMouseAction(button, updown, x, y);
         }
       }
     }
@@ -665,3 +664,4 @@ void guiMouseFunc(int button, int updown, int x, int y)
 
 
 
+