From 3d41fc53003e3a6a707a55ed0284b9dc5c90f980 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 8 Mar 1999 21:56:37 +0000 Subject: [PATCH] Added panel changes sent in by Friedemann. Added a splash screen randomization since we have several nice splash screens. --- Main/GLUTmain.cxx | 24 +++++++++--------------- Main/fg_init.cxx | 8 ++++---- Main/splash.cxx | 12 +++++++++++- Main/views.cxx | 16 +++++++++++++--- 4 files changed, 37 insertions(+), 23 deletions(-) diff --git a/Main/GLUTmain.cxx b/Main/GLUTmain.cxx index bfa7c4a7c..5d4929bf4 100644 --- a/Main/GLUTmain.cxx +++ b/Main/GLUTmain.cxx @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -99,9 +100,6 @@ static int idle_state = 0; // Another hack int use_signals = 0; -// Yet another hack, this time for the panel -int panel_hist = 0; - // Global structures for the Audio library #ifdef ENABLE_AUDIO_SUPPORT slEnvelope pitch_envelope ( 1, SL_SAMPLE_ONE_SHOT ) ; @@ -232,7 +230,6 @@ static void fgRenderFrame( void ) { FGView *v = ¤t_view; double angle; - static int iteration = 0; // GLfloat black[4] = { 0.0, 0.0, 0.0, 1.0 }; GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 }; GLfloat terrain_color[4] = { 0.54, 0.44, 0.29, 1.0 }; @@ -348,14 +345,8 @@ static void fgRenderFrame( void ) { xglDisable( GL_TEXTURE_2D ); xglDisable( GL_FOG ); - if ( (iteration == 0) && (current_options.get_panel_status()) ) { - // Did we run this loop before ?? ...and do we need the panel ?? - fgPanelReInit(0, 0, 1024, 768); - } - // display HUD && Panel fgCockpitUpdate(); - iteration = 1; // don't ReInit the panel in the future // We can do translucent menus, so why not. :-) xglEnable ( GL_BLEND ) ; @@ -812,7 +803,7 @@ static void fgReshape( int width, int height ) { // the system. current_view.UpdateViewParams(); if ( current_options.get_panel_status() ) { - fgPanelReInit(0, 0, 1024, 768); + FGPanel::OurPanel->ReInit(0, 0, 1024, 768); } } } @@ -935,9 +926,6 @@ int main( int argc, char **argv ) { _control87(MCW_EM, MCW_EM); /* defined in float.h */ #endif - // Initialize the [old] debugging output system - // fgInitDebug(); - // set default log levels fglog().setLogLevels( FG_ALL, FG_INFO ); @@ -948,6 +936,9 @@ int main( int argc, char **argv ) { FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" ); FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" ); + // seed the random number generater + fg_srandom(); + // Attempt to locate and parse a config file // First check fg_root string config = current_options.get_fg_root() + "/system.fgfsrc"; @@ -970,7 +961,6 @@ int main( int argc, char **argv ) { // line parsing or maybe the user just requested help ... :-) current_options.usage(); FG_LOG( FG_GENERAL, FG_ALERT, "\nExiting ..."); - // cout << endl << "Exiting ..." << endl; exit(-1); } @@ -1007,6 +997,10 @@ int main( int argc, char **argv ) { // $Log$ +// Revision 1.87 1999/03/08 21:56:37 curt +// Added panel changes sent in by Friedemann. +// Added a splash screen randomization since we have several nice splash screens. +// // Revision 1.86 1999/02/26 22:09:47 curt // Added initial support for native SGI compilers. // diff --git a/Main/fg_init.cxx b/Main/fg_init.cxx index a731711f6..bef0375d3 100644 --- a/Main/fg_init.cxx +++ b/Main/fg_init.cxx @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -165,9 +164,6 @@ int fgInitSubsystems( void ) FG_LOG( FG_GENERAL, FG_INFO, "Initialize Subsystems"); FG_LOG( FG_GENERAL, FG_INFO, "========== =========="); - // seed the random number generater - fg_srandom(); - // allocates structures so must happen before any of the flight // model or control parameters are set fgAircraftInit(); // In the future this might not be the case. @@ -395,6 +391,10 @@ int fgInitSubsystems( void ) // $Log$ +// Revision 1.69 1999/03/08 21:56:39 curt +// Added panel changes sent in by Friedemann. +// Added a splash screen randomization since we have several nice splash screens. +// // Revision 1.68 1999/03/02 01:03:15 curt // Tweaks for building with native SGI compilers. // diff --git a/Main/splash.cxx b/Main/splash.cxx index a663f10df..9322aaf97 100644 --- a/Main/splash.cxx +++ b/Main/splash.cxx @@ -38,6 +38,7 @@ #include #include
+#include #include #include "splash.hxx" @@ -70,7 +71,12 @@ void fgSplashInit ( void ) { xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // load in the texture data - tpath = current_options.get_fg_root() + "/Textures/Splash2.rgb"; + int num = (int)(fg_random() * 4.0 + 1.0); + char num_str[256]; + sprintf(num_str, "%d", num); + tpath = current_options.get_fg_root() + "/Textures/Splash"; + tpath += num_str; + tpath += ".rgb"; if ( (splash_texbuf = read_rgb_texture(tpath.c_str(), &width, &height)) == NULL ) @@ -149,6 +155,10 @@ void fgSplashUpdate ( double progress ) { // $Log$ +// Revision 1.10 1999/03/08 21:56:40 curt +// Added panel changes sent in by Friedemann. +// Added a splash screen randomization since we have several nice splash screens. +// // Revision 1.9 1998/12/09 18:50:26 curt // Converted "class fgVIEW" to "class FGView" and updated to make data // members private and make required accessor functions. diff --git a/Main/views.cxx b/Main/views.cxx index 8bad74132..fb4004846 100644 --- a/Main/views.cxx +++ b/Main/views.cxx @@ -73,7 +73,14 @@ void FGView::Init( void ) { winWidth = current_options.get_xsize(); winHeight = current_options.get_ysize(); - win_ratio = (double) winWidth / (double) winHeight; + + if ( ! current_options.get_panel_status() ) { + current_view.set_win_ratio( (GLfloat) winWidth / (GLfloat) winHeight ); + } else { + current_view.set_win_ratio( (GLfloat) winWidth / + ((GLfloat) (winHeight)*0.4232) ); + } + force_update_fov_math(); } @@ -205,7 +212,7 @@ void FGView::UpdateViewParams( void ) { if ((current_options.get_panel_status() != panel_hist) && (current_options.get_panel_status())) { - fgPanelReInit( 0, 0, 1024, 768); + FGPanel::OurPanel->ReInit( 0, 0, 1024, 768); } if ( ! current_options.get_panel_status() ) { @@ -296,7 +303,6 @@ void FGView::UpdateViewMath( FGInterface *f ) { p.setz( p.radius() + scenery.cur_elev + 0.5 * METER_TO_FEET ); } - abs_view_pos = fgPolarToCart3d(p); view_pos = abs_view_pos - scenery.center; @@ -601,6 +607,10 @@ FGView::~FGView( void ) { // $Log$ +// Revision 1.34 1999/03/08 21:56:41 curt +// Added panel changes sent in by Friedemann. +// Added a splash screen randomization since we have several nice splash screens. +// // Revision 1.33 1999/02/05 21:29:14 curt // Modifications to incorporate Jon S. Berndts flight model code. // -- 2.39.5