1
0
Fork 0

Tweaks for the instrument panel.

This commit is contained in:
curt 1998-11-09 23:39:22 +00:00
parent 3563de2a16
commit 4fee7f9df2
2 changed files with 24 additions and 13 deletions

View file

@ -350,13 +350,10 @@ static void fgRenderFrame( void ) {
if ( (iteration == 0) && (current_options.get_panel_status()) ) { if ( (iteration == 0) && (current_options.get_panel_status()) ) {
// Did we run this loop before ?? ...and do we need the panel ?? // Did we run this loop before ?? ...and do we need the panel ??
fgPanelReInit(); fgPanelReInit(0, 0, 1024, 768);
} }
// display HUD && Panel // display HUD && Panel
if ( current_options.get_panel_status() ) {
xglViewport(0, 0, v->winWidth, v->winHeight);
}
fgCockpitUpdate(); fgCockpitUpdate();
iteration = 1; // don't ReInit the panel in the future iteration = 1; // don't ReInit the panel in the future
@ -747,7 +744,7 @@ static void fgReshape( int width, int height ) {
if ( ! current_options.get_panel_status() ) { if ( ! current_options.get_panel_status() ) {
v->win_ratio = (GLfloat) width / (GLfloat) height; v->win_ratio = (GLfloat) width / (GLfloat) height;
} else { } else {
v->win_ratio = (GLfloat) width / ((GLfloat) (height)*0.67); v->win_ratio = (GLfloat) width / ((GLfloat) (height)*0.4232);
} }
} }
@ -762,7 +759,7 @@ static void fgReshape( int width, int height ) {
// the system. // the system.
v->UpdateViewParams(); v->UpdateViewParams();
if ( current_options.get_panel_status() ) { if ( current_options.get_panel_status() ) {
fgPanelReInit(); fgPanelReInit(0, 0, 1024, 768);
} }
} }
@ -777,12 +774,7 @@ int fgGlutInit( int *argc, char **argv ) {
xglutInit(argc, argv); xglutInit(argc, argv);
// Define Display Parameters // Define Display Parameters
if ( ! current_options.get_panel_status() ) { xglutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
xglutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
} else {
xglutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE |
GLUT_STENCIL);
}
// Define initial window size // Define initial window size
xglutInitWindowSize(640, 480); xglutInitWindowSize(640, 480);
@ -899,6 +891,9 @@ int main( int argc, char **argv ) {
// $Log$ // $Log$
// Revision 1.65 1998/11/09 23:39:22 curt
// Tweaks for the instrument panel.
//
// Revision 1.64 1998/11/07 19:07:09 curt // Revision 1.64 1998/11/07 19:07:09 curt
// Enable release builds using the --without-logging option to the configure // Enable release builds using the --without-logging option to the configure
// script. Also a couple log message cleanups, plus some C to C++ comment // script. Also a couple log message cleanups, plus some C to C++ comment

View file

@ -28,6 +28,7 @@
#endif #endif
#include <Aircraft/aircraft.hxx> #include <Aircraft/aircraft.hxx>
#include <Cockpit/panel.hxx>
#include <Debug/logstream.hxx> #include <Debug/logstream.hxx>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Math/mat3.h> #include <Math/mat3.h>
@ -192,6 +193,11 @@ void fgVIEW::UpdateViewParams( void ) {
UpdateViewMath(f); UpdateViewMath(f);
UpdateWorldToEye(f); UpdateWorldToEye(f);
if ((current_options.get_panel_status() != panel_hist) && (current_options.get_panel_status()))
{
fgPanelReInit( 0, 0, 1024, 768);
}
// if (!o->panel_status) { // if (!o->panel_status) {
// xglViewport( 0, (GLint)((winHeight) / 2 ) , // xglViewport( 0, (GLint)((winHeight) / 2 ) ,
@ -201,7 +207,12 @@ void fgVIEW::UpdateViewParams( void ) {
// xglLoadIdentity(); // xglLoadIdentity();
// gluPerspective(o->fov, win_ratio / 2.0, 1.0, 100000.0); // gluPerspective(o->fov, win_ratio / 2.0, 1.0, 100000.0);
// } else { // } else {
xglViewport(0, 0 , (GLint)(winWidth), (GLint)(winHeight) ); if ( ! current_options.get_panel_status() ) {
xglViewport(0, 0 , (GLint)(winWidth), (GLint)(winHeight) );
} else {
xglViewport(0, (GLint)((winHeight)*0.5768), (GLint)(winWidth),
(GLint)((winHeight)*0.4232) );
}
// 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();
@ -246,6 +257,8 @@ void fgVIEW::UpdateViewParams( void ) {
// set the sun position // set the sun position
xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec ); xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
panel_hist = current_options.get_panel_status();
} }
@ -586,6 +599,9 @@ fgVIEW::~fgVIEW( void ) {
// $Log$ // $Log$
// Revision 1.26 1998/11/09 23:39:25 curt
// Tweaks for the instrument panel.
//
// Revision 1.25 1998/11/06 21:18:15 curt // Revision 1.25 1998/11/06 21:18:15 curt
// Converted to new logstream debugging facility. This allows release // Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using // builds with no messages at all (and no performance impact) by using