From 353ec70f8cb078d50363e02164c1f00d769e9e04 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 27 Jun 1998 16:54:32 +0000 Subject: [PATCH] Replaced "extern displayInstruments" with a entry in fgOPTIONS. Don't change the view port when displaying the panel. --- Main/GLUTkey.cxx | 13 ++++++------ Main/GLUTmain.cxx | 52 +++++++++++++++++++++++++---------------------- Main/fg_init.cxx | 10 ++++----- Main/options.cxx | 5 +++++ Main/options.hxx | 5 +++++ 5 files changed, 50 insertions(+), 35 deletions(-) diff --git a/Main/GLUTkey.cxx b/Main/GLUTkey.cxx index 410222b4b..3d7214ea3 100644 --- a/Main/GLUTkey.cxx +++ b/Main/GLUTkey.cxx @@ -50,9 +50,6 @@ #include "views.hxx" -extern int displayInstruments; - - /* Handle keyboard events */ void GLUTkey(unsigned char k, int x, int y) { fgCONTROLS *c; @@ -108,7 +105,7 @@ void GLUTkey(unsigned char k, int x, int y) { t->warp_delta -= 30; return; case 87: /* W key */ - displayInstruments = !displayInstruments; + o->panel_status = !(o->panel_status); return; case 88: /* X key */ o->fov *= 1.05; @@ -290,9 +287,13 @@ void GLUTspecialkey(int k, int x, int y) { /* $Log$ -/* Revision 1.12 1998/06/12 14:27:26 curt -/* Pui -> PUI, Gui -> GUI. +/* Revision 1.13 1998/06/27 16:54:32 curt +/* Replaced "extern displayInstruments" with a entry in fgOPTIONS. +/* Don't change the view port when displaying the panel. /* + * Revision 1.12 1998/06/12 14:27:26 curt + * Pui -> PUI, Gui -> GUI. + * * Revision 1.11 1998/06/12 00:57:38 curt * Added support for Pui/Gui. * Converted fog to GL_FOG_EXP2. diff --git a/Main/GLUTmain.cxx b/Main/GLUTmain.cxx index c85e8f15a..1d5dbce5f 100644 --- a/Main/GLUTmain.cxx +++ b/Main/GLUTmain.cxx @@ -85,9 +85,6 @@ fgGENERAL general; // Another hack int use_signals = 0; -// Yet another other hack. Used for my prototype instrument code. (Durk) -int displayInstruments; - // Global structures for the Audio library #ifdef HAVE_AUDIO_SUPPORT slScheduler audio_sched ( 8000 ) ; @@ -176,20 +173,20 @@ static void fgUpdateViewParams( void ) { v->Update(f); v->UpdateWorldToEye(f); - if (displayInstruments) { - xglViewport( 0, (GLint)((v->winHeight) / 2 ) , - (GLint)(v->winWidth), (GLint)(v->winHeight) / 2 ); - // Tell GL we are about to modify the projection parameters - xglMatrixMode(GL_PROJECTION); - xglLoadIdentity(); - gluPerspective(o->fov, v->win_ratio / 2.0, 1.0, 100000.0); - } else { - xglViewport(0, 0 , (GLint)(v->winWidth), (GLint)(v->winHeight) ); - // Tell GL we are about to modify the projection parameters - xglMatrixMode(GL_PROJECTION); - xglLoadIdentity(); - gluPerspective(o->fov, v->win_ratio, 10.0, 100000.0); - } + // if (!o->panel_status) { + // xglViewport( 0, (GLint)((v->winHeight) / 2 ) , + // (GLint)(v->winWidth), (GLint)(v->winHeight) / 2 ); + // Tell GL we are about to modify the projection parameters + // xglMatrixMode(GL_PROJECTION); + // xglLoadIdentity(); + // gluPerspective(o->fov, v->win_ratio / 2.0, 1.0, 100000.0); + // } else { + xglViewport(0, 0 , (GLint)(v->winWidth), (GLint)(v->winHeight) ); + // Tell GL we are about to modify the projection parameters + xglMatrixMode(GL_PROJECTION); + xglLoadIdentity(); + gluPerspective(o->fov, v->win_ratio, 10.0, 100000.0); + // } xglMatrixMode(GL_MODELVIEW); xglLoadIdentity(); @@ -227,8 +224,12 @@ static void fgUpdateViewParams( void ) { } +#ifdef 0 // Draw a basic instrument panel static void fgUpdateInstrViewParams( void ) { + + exit(0); + fgVIEW *v; v = ¤t_view; @@ -268,6 +269,7 @@ static void fgUpdateInstrViewParams( void ) { xglMatrixMode(GL_MODELVIEW); xglPopMatrix(); } +#endif // Update all Visuals (redraws anything graphics related) @@ -380,15 +382,13 @@ static void fgRenderFrame( void ) { xglDisable( GL_TEXTURE_2D ); - // display HUD - if( o->hud_status ) { - fgCockpitUpdate(); - } + // display HUD && Panel + fgCockpitUpdate(); // display instruments - if (displayInstruments) { - fgUpdateInstrViewParams(); - } + // if (!o->panel_status) { + // fgUpdateInstrViewParams(); + // } puDisplay(); xglutSwapBuffers(); } @@ -745,6 +745,10 @@ int main( int argc, char **argv ) { // $Log$ +// Revision 1.28 1998/06/27 16:54:32 curt +// Replaced "extern displayInstruments" with a entry in fgOPTIONS. +// Don't change the view port when displaying the panel. +// // Revision 1.27 1998/06/17 21:35:10 curt // Refined conditional audio support compilation. // Moved texture parameter setup calls to ../Scenery/materials.cxx diff --git a/Main/fg_init.cxx b/Main/fg_init.cxx index 5978b3c0e..dd0890bd8 100644 --- a/Main/fg_init.cxx +++ b/Main/fg_init.cxx @@ -59,8 +59,7 @@ #include "options.hxx" #include "views.hxx" -// extern int show_hud; // HUD state -extern int displayInstruments; + extern const char *default_root; @@ -367,9 +366,6 @@ int fgInitSubsystems( void ) { fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ ); - // Let's not show the instrument panel - displayInstruments = 0; - // Joystick support if (fgJoystickInit(0) ) { // Joystick initialized ok. @@ -387,6 +383,10 @@ int fgInitSubsystems( void ) { // $Log$ +// Revision 1.21 1998/06/27 16:54:33 curt +// Replaced "extern displayInstruments" with a entry in fgOPTIONS. +// Don't change the view port when displaying the panel. +// // Revision 1.20 1998/06/17 21:35:12 curt // Refined conditional audio support compilation. // Moved texture parameter setup calls to ../Scenery/materials.cxx diff --git a/Main/options.cxx b/Main/options.cxx index b6908d681..5efd62e1e 100644 --- a/Main/options.cxx +++ b/Main/options.cxx @@ -69,6 +69,7 @@ fgOPTIONS::fgOPTIONS( void ) { // Features hud_status = 1; + panel_status = 1; // Rendering options fog = 2; // nicest @@ -433,6 +434,10 @@ fgOPTIONS::~fgOPTIONS( void ) { // $Log$ +// Revision 1.13 1998/06/27 16:54:34 curt +// Replaced "extern displayInstruments" with a entry in fgOPTIONS. +// Don't change the view port when displaying the panel. +// // Revision 1.12 1998/06/17 21:35:13 curt // Refined conditional audio support compilation. // Moved texture parameter setup calls to ../Scenery/materials.cxx diff --git a/Main/options.hxx b/Main/options.hxx index dc88b418c..73203f227 100644 --- a/Main/options.hxx +++ b/Main/options.hxx @@ -48,6 +48,7 @@ public: // Features int hud_status; // HUD on/off + int panel_status; // Panel on/off // Rendering options int fog; // Fog enabled/disabled @@ -97,6 +98,10 @@ extern fgOPTIONS current_options; // $Log$ +// Revision 1.9 1998/06/27 16:54:34 curt +// Replaced "extern displayInstruments" with a entry in fgOPTIONS. +// Don't change the view port when displaying the panel. +// // Revision 1.8 1998/05/16 13:08:36 curt // C++ - ified views.[ch]xx // Shuffled some additional view parameters into the fgVIEW class. -- 2.39.2