Activated gyro drift ... look out!
Cleaned a bit of cruft out of gui.[ch]xx Cleaned up win_ratio() and fov code to make more sense and be a bit more consistant and robust and less buggy and less susceptible to screw ups. Panel is activated now by default, HUD is off by default.
This commit is contained in:
parent
81b266aa4a
commit
fc84045169
7 changed files with 23 additions and 47 deletions
|
@ -323,7 +323,7 @@ void FGSteam::_CatchUp()
|
|||
*/
|
||||
if ( _UpdatesPending > 999999 )
|
||||
the_DG_err = FGBFI::getMagVar();
|
||||
the_DG_degps = 0.0; /* HACK! */
|
||||
the_DG_degps = 0.01; /* HACK! */
|
||||
if (dt<1.0) the_DG_err += dt * the_DG_degps;
|
||||
the_DG_deg = FGBFI::getHeading () - the_DG_err;
|
||||
|
||||
|
|
|
@ -667,26 +667,6 @@ void mkDialog (const char *txt)
|
|||
FG_PUSH_PUI_DIALOG( dialogBox );
|
||||
}
|
||||
|
||||
// Repair any damage done to the Panel by other Gui Items
|
||||
void guiFixPanel( void )
|
||||
{
|
||||
#if 0 // this function does nothing anyway
|
||||
bool freeze = globals->get_freeze();
|
||||
|
||||
if ( current_options.get_panel_status() ) {
|
||||
// FGView *v = ¤t_view;
|
||||
if( !freeze )
|
||||
globals->set_freeze( true );
|
||||
|
||||
// we must have some something here at some point but this
|
||||
// function does nothing now.
|
||||
|
||||
if( !freeze )
|
||||
globals->set_freeze( false );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Toggle the Menu and Mouse display state
|
||||
void guiToggleMenu(void)
|
||||
{
|
||||
|
|
|
@ -37,7 +37,6 @@ extern void BusyCursor( int restore );
|
|||
extern void guiToggleMenu(void);
|
||||
extern void mkDialog(const char *txt);
|
||||
extern void ConfirmExitDialog(void);
|
||||
extern void guiFixPanel( void );
|
||||
|
||||
extern void fgDumpSnapShot();
|
||||
|
||||
|
@ -66,7 +65,6 @@ extern char *gui_msg_RESET; // "RESET"
|
|||
#define FG_POP_PUI_DIALOG( X ) \
|
||||
(X)->hide(); \
|
||||
puPopLiveInterface(); \
|
||||
guiFixPanel(); \
|
||||
maybeToggleMouse();
|
||||
|
||||
// Finalize Dialog Box Construction
|
||||
|
|
|
@ -480,7 +480,8 @@ void fgRenderFrame( void ) {
|
|||
// glMatrixMode( GL_PROJECTION );
|
||||
// glLoadIdentity();
|
||||
float fov = current_options.get_fov();
|
||||
ssgSetFOV(fov * current_view.get_win_ratio(), fov);
|
||||
// ssgSetFOV(fov * current_view.get_win_ratio(), fov);
|
||||
ssgSetFOV(fov, fov * current_view.get_win_ratio());
|
||||
|
||||
double agl = current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER
|
||||
- scenery.cur_elev;
|
||||
|
@ -1111,12 +1112,11 @@ static void fgIdleFunction ( void ) {
|
|||
// options.cxx needs to see this for toggle_panel()
|
||||
// Handle new window size or exposure
|
||||
void fgReshape( int width, int height ) {
|
||||
if ( ! current_options.get_panel_status() ) {
|
||||
current_view.set_win_ratio( (GLfloat) width / (GLfloat) height );
|
||||
if ( ! current_options.get_panel_status() || idle_state != 1000 ) {
|
||||
current_view.set_win_ratio( height / width );
|
||||
glViewport(0, 0 , (GLint)(width), (GLint)(height) );
|
||||
} else {
|
||||
current_view.set_win_ratio( (GLfloat) width /
|
||||
((GLfloat) (height)*0.4232) );
|
||||
current_view.set_win_ratio( (height*0.4232) / width );
|
||||
glViewport(0, (GLint)((height)*0.5768),
|
||||
(GLint)(width), (GLint)((height)*0.4232) );
|
||||
}
|
||||
|
@ -1132,7 +1132,8 @@ void fgReshape( int width, int height ) {
|
|||
|
||||
// glViewport ( 0, 0, width, height );
|
||||
float fov = current_options.get_fov();
|
||||
ssgSetFOV(fov * current_view.get_win_ratio(), fov);
|
||||
// ssgSetFOV(fov * current_view.get_win_ratio(), fov);
|
||||
ssgSetFOV(fov, fov * current_view.get_win_ratio());
|
||||
|
||||
fgHUDReshape();
|
||||
|
||||
|
|
|
@ -160,8 +160,8 @@ fgOPTIONS::fgOPTIONS() :
|
|||
auto_coordination(FG_AUTO_COORD_NOT_SPECIFIED),
|
||||
|
||||
// Features
|
||||
hud_status(1),
|
||||
panel_status(0),
|
||||
hud_status(0),
|
||||
panel_status(1),
|
||||
sound(1),
|
||||
anti_alias_hud(0),
|
||||
|
||||
|
@ -182,8 +182,8 @@ fgOPTIONS::fgOPTIONS() :
|
|||
skyblend(1),
|
||||
textures(1),
|
||||
wireframe(0),
|
||||
xsize(640),
|
||||
ysize(480),
|
||||
xsize(800),
|
||||
ysize(600),
|
||||
bpp(16),
|
||||
view_mode(FG_VIEW_PILOT),
|
||||
|
||||
|
@ -257,11 +257,14 @@ fgOPTIONS::toggle_panel() {
|
|||
if ( current_panel != NULL )
|
||||
current_panel->setVisibility(true);
|
||||
}
|
||||
if ( panel_status ) {
|
||||
|
||||
// new rule .. "fov" shouldn't get messed with like this.
|
||||
/* if ( panel_status ) {
|
||||
fov *= 0.4232;
|
||||
} else {
|
||||
fov *= (1.0 / 0.4232);
|
||||
}
|
||||
} */
|
||||
|
||||
// fgReshape( xsize, ysize);
|
||||
fgReshape( current_view.get_winWidth(), current_view.get_winHeight() );
|
||||
|
||||
|
@ -634,7 +637,7 @@ int fgOPTIONS::parse_option( const string& arg ) {
|
|||
panel_status = true;
|
||||
if ( current_panel != NULL )
|
||||
current_panel->setVisibility(true);
|
||||
fov *= 0.4232;
|
||||
// fov *= 0.4232; /* NO!!! */
|
||||
} else if ( arg == "--disable-sound" ) {
|
||||
sound = false;
|
||||
} else if ( arg == "--enable-sound" ) {
|
||||
|
|
|
@ -42,10 +42,6 @@
|
|||
#include "views.hxx"
|
||||
|
||||
|
||||
// temporary (hopefully) hack
|
||||
static int panel_hist = 0;
|
||||
|
||||
|
||||
// This is a record containing current view parameters for the current
|
||||
// aircraft position
|
||||
FGView pilot_view;
|
||||
|
@ -72,10 +68,9 @@ void FGView::Init( void ) {
|
|||
winHeight = current_options.get_ysize();
|
||||
|
||||
if ( ! current_options.get_panel_status() ) {
|
||||
set_win_ratio( (GLfloat) winWidth / (GLfloat) winHeight );
|
||||
set_win_ratio( winHeight / winWidth );
|
||||
} else {
|
||||
set_win_ratio( (GLfloat) winWidth /
|
||||
((GLfloat) (winHeight)*0.4232) );
|
||||
set_win_ratio( (winHeight*0.4232) / winWidth );
|
||||
}
|
||||
|
||||
// This never changes -- NHV
|
||||
|
@ -137,6 +132,7 @@ inline static void fgMakeLOCAL( sgMat4 dst, const double Theta,
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Update the view volume, position, and orientation
|
||||
void FGView::UpdateViewParams( const FGInterface& f ) {
|
||||
UpdateViewMath(f);
|
||||
|
@ -147,8 +143,6 @@ void FGView::UpdateViewParams( const FGInterface& f ) {
|
|||
xglViewport(0, (GLint)((winHeight)*0.5768), (GLint)(winWidth),
|
||||
(GLint)((winHeight)*0.4232) );
|
||||
}
|
||||
|
||||
panel_hist = current_options.get_panel_status();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
bool update_fov;
|
||||
|
||||
// fov of view is specified in the y direction, win_ratio is used to
|
||||
// calculate the fov in the X direction = width/height
|
||||
// calculate the fov in the X direction = width / height
|
||||
double win_ratio;
|
||||
|
||||
// width & height of window
|
||||
|
|
Loading…
Reference in a new issue