1
0
Fork 0

Replaced "extern displayInstruments" with a entry in fgOPTIONS.

Don't change the view port when displaying the panel.
This commit is contained in:
curt 1998-06-27 16:54:32 +00:00
parent 3fb9a879a7
commit 353ec70f8c
5 changed files with 50 additions and 35 deletions

View file

@ -50,9 +50,6 @@
#include "views.hxx" #include "views.hxx"
extern int displayInstruments;
/* Handle keyboard events */ /* Handle keyboard events */
void GLUTkey(unsigned char k, int x, int y) { void GLUTkey(unsigned char k, int x, int y) {
fgCONTROLS *c; fgCONTROLS *c;
@ -108,7 +105,7 @@ void GLUTkey(unsigned char k, int x, int y) {
t->warp_delta -= 30; t->warp_delta -= 30;
return; return;
case 87: /* W key */ case 87: /* W key */
displayInstruments = !displayInstruments; o->panel_status = !(o->panel_status);
return; return;
case 88: /* X key */ case 88: /* X key */
o->fov *= 1.05; o->fov *= 1.05;
@ -290,9 +287,13 @@ void GLUTspecialkey(int k, int x, int y) {
/* $Log$ /* $Log$
/* Revision 1.12 1998/06/12 14:27:26 curt /* Revision 1.13 1998/06/27 16:54:32 curt
/* Pui -> PUI, Gui -> GUI. /* 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 * Revision 1.11 1998/06/12 00:57:38 curt
* Added support for Pui/Gui. * Added support for Pui/Gui.
* Converted fog to GL_FOG_EXP2. * Converted fog to GL_FOG_EXP2.

View file

@ -85,9 +85,6 @@ fgGENERAL general;
// Another hack // Another hack
int use_signals = 0; int use_signals = 0;
// Yet another other hack. Used for my prototype instrument code. (Durk)
int displayInstruments;
// Global structures for the Audio library // Global structures for the Audio library
#ifdef HAVE_AUDIO_SUPPORT #ifdef HAVE_AUDIO_SUPPORT
slScheduler audio_sched ( 8000 ) ; slScheduler audio_sched ( 8000 ) ;
@ -176,20 +173,20 @@ static void fgUpdateViewParams( void ) {
v->Update(f); v->Update(f);
v->UpdateWorldToEye(f); v->UpdateWorldToEye(f);
if (displayInstruments) { // if (!o->panel_status) {
xglViewport( 0, (GLint)((v->winHeight) / 2 ) , // xglViewport( 0, (GLint)((v->winHeight) / 2 ) ,
(GLint)(v->winWidth), (GLint)(v->winHeight) / 2 ); // (GLint)(v->winWidth), (GLint)(v->winHeight) / 2 );
// Tell GL we are about to modify the projection parameters // Tell GL we are about to modify the projection parameters
xglMatrixMode(GL_PROJECTION); // xglMatrixMode(GL_PROJECTION);
xglLoadIdentity(); // xglLoadIdentity();
gluPerspective(o->fov, v->win_ratio / 2.0, 1.0, 100000.0); // gluPerspective(o->fov, v->win_ratio / 2.0, 1.0, 100000.0);
} else { // } else {
xglViewport(0, 0 , (GLint)(v->winWidth), (GLint)(v->winHeight) ); xglViewport(0, 0 , (GLint)(v->winWidth), (GLint)(v->winHeight) );
// Tell GL we are about to modify the projection parameters // Tell GL we are about to modify the projection parameters
xglMatrixMode(GL_PROJECTION); xglMatrixMode(GL_PROJECTION);
xglLoadIdentity(); xglLoadIdentity();
gluPerspective(o->fov, v->win_ratio, 10.0, 100000.0); gluPerspective(o->fov, v->win_ratio, 10.0, 100000.0);
} // }
xglMatrixMode(GL_MODELVIEW); xglMatrixMode(GL_MODELVIEW);
xglLoadIdentity(); xglLoadIdentity();
@ -227,8 +224,12 @@ static void fgUpdateViewParams( void ) {
} }
#ifdef 0
// Draw a basic instrument panel // Draw a basic instrument panel
static void fgUpdateInstrViewParams( void ) { static void fgUpdateInstrViewParams( void ) {
exit(0);
fgVIEW *v; fgVIEW *v;
v = &current_view; v = &current_view;
@ -268,6 +269,7 @@ static void fgUpdateInstrViewParams( void ) {
xglMatrixMode(GL_MODELVIEW); xglMatrixMode(GL_MODELVIEW);
xglPopMatrix(); xglPopMatrix();
} }
#endif
// Update all Visuals (redraws anything graphics related) // Update all Visuals (redraws anything graphics related)
@ -380,15 +382,13 @@ static void fgRenderFrame( void ) {
xglDisable( GL_TEXTURE_2D ); xglDisable( GL_TEXTURE_2D );
// display HUD // display HUD && Panel
if( o->hud_status ) { fgCockpitUpdate();
fgCockpitUpdate();
}
// display instruments // display instruments
if (displayInstruments) { // if (!o->panel_status) {
fgUpdateInstrViewParams(); // fgUpdateInstrViewParams();
} // }
puDisplay(); puDisplay();
xglutSwapBuffers(); xglutSwapBuffers();
} }
@ -745,6 +745,10 @@ int main( int argc, char **argv ) {
// $Log$ // $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 // Revision 1.27 1998/06/17 21:35:10 curt
// Refined conditional audio support compilation. // Refined conditional audio support compilation.
// Moved texture parameter setup calls to ../Scenery/materials.cxx // Moved texture parameter setup calls to ../Scenery/materials.cxx

View file

@ -59,8 +59,7 @@
#include "options.hxx" #include "options.hxx"
#include "views.hxx" #include "views.hxx"
// extern int show_hud; // HUD state
extern int displayInstruments;
extern const char *default_root; extern const char *default_root;
@ -367,9 +366,6 @@ int fgInitSubsystems( void ) {
fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ ); fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ );
// Let's not show the instrument panel
displayInstruments = 0;
// Joystick support // Joystick support
if (fgJoystickInit(0) ) { if (fgJoystickInit(0) ) {
// Joystick initialized ok. // Joystick initialized ok.
@ -387,6 +383,10 @@ int fgInitSubsystems( void ) {
// $Log$ // $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 // Revision 1.20 1998/06/17 21:35:12 curt
// Refined conditional audio support compilation. // Refined conditional audio support compilation.
// Moved texture parameter setup calls to ../Scenery/materials.cxx // Moved texture parameter setup calls to ../Scenery/materials.cxx

View file

@ -69,6 +69,7 @@ fgOPTIONS::fgOPTIONS( void ) {
// Features // Features
hud_status = 1; hud_status = 1;
panel_status = 1;
// Rendering options // Rendering options
fog = 2; // nicest fog = 2; // nicest
@ -433,6 +434,10 @@ fgOPTIONS::~fgOPTIONS( void ) {
// $Log$ // $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 // Revision 1.12 1998/06/17 21:35:13 curt
// Refined conditional audio support compilation. // Refined conditional audio support compilation.
// Moved texture parameter setup calls to ../Scenery/materials.cxx // Moved texture parameter setup calls to ../Scenery/materials.cxx

View file

@ -48,6 +48,7 @@ public:
// Features // Features
int hud_status; // HUD on/off int hud_status; // HUD on/off
int panel_status; // Panel on/off
// Rendering options // Rendering options
int fog; // Fog enabled/disabled int fog; // Fog enabled/disabled
@ -97,6 +98,10 @@ extern fgOPTIONS current_options;
// $Log$ // $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 // Revision 1.8 1998/05/16 13:08:36 curt
// C++ - ified views.[ch]xx // C++ - ified views.[ch]xx
// Shuffled some additional view parameters into the fgVIEW class. // Shuffled some additional view parameters into the fgVIEW class.