]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a view bug that could make the aircraft appear rotated from an
authorcurt <curt>
Thu, 14 Dec 2000 21:59:47 +0000 (21:59 +0000)
committercurt <curt>
Thu, 14 Dec 2000 21:59:47 +0000 (21:59 +0000)
external view if the primary view was rotated before we switched.

Makefile.am
src/GUI/gui.cxx
src/GUI/gui.h
src/Main/keyboard.cxx

index 9f83df0f5ebe49e7371d0217e5411f5f2c6e3dce..d1124d23b49df58246b4fb3c464b08a6af99a3bc 100644 (file)
@@ -32,9 +32,7 @@ fgfs-base-tar:
        FlightGear/Scenery/w130n30/w123n37 \
        FlightGear/Scenery/w130n30/w122n37 \
        FlightGear/Sounds \
-       FlightGear/Textures \
-       FlightGear/T[A-Za-df-z]* \
-       FlightGear/[U-W]* FlightGear/[c-m]*)
+       FlightGear/[T-Za]* FlightGear/[c-z]*)
 
 fgfs-base-zip:
        (cd $(HOME); \
@@ -44,9 +42,7 @@ fgfs-base-zip:
        FlightGear/Scenery/w130n30/w123n37 \
        FlightGear/Scenery/w130n30/w122n37 \
        FlightGear/Sounds \
-       FlightGear/Textures \
-       FlightGear/T[A-Za-df-z]* \
-       FlightGear/[U-W]* FlightGear/[c-z]* \
+       FlightGear/[T-Za]* FlightGear/[c-z]* \
        -x '*/CVS/*' )
 
 fgfs-base-patch:
@@ -57,9 +53,7 @@ fgfs-base-patch:
        FlightGear/Scenery/w130n30/w123n37 \
        FlightGear/Scenery/w130n30/w122n37 \
        FlightGear/Sounds \
-       FlightGear/Textures \
-       FlightGear/T[A-Za-df-z]* \
-       FlightGear/[U-W]* FlightGear/[c-m]*)
+       FlightGear/[T-Za]* FlightGear/[c-z]*)
 
 fgfs-textures-high:
        (cd $(HOME); \
index 0b2843bd4ab858e4100816134a0df78d88166b9f..9521d276b19bb4a81dc8b9f4731644d33695b3fc 100644 (file)
@@ -354,6 +354,28 @@ void BusyCursor( int restore )
     }
 }
 
+
+// Center the view offsets
+void CenterView( void ) {
+    if( mouse_mode = MOUSE_VIEW ) {
+       mouse_mode = MOUSE_POINTER;
+       _savedX = globals->get_options()->get_xsize()/2;
+       _savedY = globals->get_options()->get_ysize()/2;
+       _mVtoggle = 0;
+       Quat0();
+       build_rotmatrix(quat_mat, curquat);
+       glutSetCursor(GLUT_CURSOR_INHERIT);
+
+       // Is this necessary ??
+       if( !menu_on )   TurnCursorOff();
+
+       glutWarpPointer( _savedX, _savedY );
+    }
+    globals->get_current_view()->set_goal_view_offset(0.0);
+    globals->get_current_view()->set_view_offset(0.0);
+}
+
+
 int guiGetMouseButton(void)
 {
     return last_buttons;
index e33d617176d0cec4a4ffbc02476845ed0bf41486..133a5b4da01cc3d5a01498d6efff45fa2eadc585 100644 (file)
@@ -33,6 +33,7 @@ extern void guiMotionFunc ( int x, int y );
 extern void guiMouseFunc(int button, int updown, int x, int y);
 extern void maybeToggleMouse( void );
 extern void BusyCursor( int restore );
+extern void CenterView( void );
 
 extern void guiToggleMenu(void);
 extern void mkDialog(const char *txt);
index f983144eae6a823339c864b76d7e4b741ce12a86..531f910deec96e0ce290906dd509d923432fdafc 100644 (file)
@@ -370,6 +370,8 @@ void GLUTkey(unsigned char k, int x, int y) {
            fgUpdateSkyAndLightingParams();
            return;
        case 118: // v key
+           // handles GUI state as well as Viewer LookAt Direction
+           CenterView();
            globals->set_current_view( globals->get_viewmgr()->next_view() );
            fgReshape( globals->get_options()->get_xsize(),
                       globals->get_options()->get_ysize() );