1
0
Fork 0

Fix a view bug that could make the aircraft appear rotated from an

external view if the primary view was rotated before we switched.
This commit is contained in:
curt 2000-12-14 21:59:47 +00:00
parent e333080388
commit 0d457e78e2
4 changed files with 28 additions and 9 deletions

View 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); \

View 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;

View 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);

View 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() );