Replaced "extern displayInstruments" with a entry in fgOPTIONS.
Don't change the view port when displaying the panel.
This commit is contained in:
parent
3fb9a879a7
commit
353ec70f8c
5 changed files with 50 additions and 35 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue