]> git.mxchange.org Git - flightgear.git/commitdiff
Added panel changes sent in by Friedemann.
authorcurt <curt>
Mon, 8 Mar 1999 21:56:37 +0000 (21:56 +0000)
committercurt <curt>
Mon, 8 Mar 1999 21:56:37 +0000 (21:56 +0000)
Added a splash screen randomization since we have several nice splash screens.

Main/GLUTmain.cxx
Main/fg_init.cxx
Main/splash.cxx
Main/views.cxx

index bfa7c4a7cada1461aa151b09c734e4acbcedf7ad..5d4929bf41d5c3fb0de828e751d1e3218570acd6 100644 (file)
@@ -71,6 +71,7 @@
 #include <Math/fg_geodesy.hxx>
 #include <Math/mat3.h>
 #include <Math/polar3d.hxx>
+#include <Math/fg_random.h>
 #include <PUI/pu.h>
 #include <Scenery/scenery.hxx>
 #include <Scenery/tilemgr.hxx>
@@ -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 = &current_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.
 //
index a731711f6b2423bb992f4aa6b710faa3f4977a7b..bef0375d3218581693bc3a5d88a60f55b5b2e657 100644 (file)
@@ -53,7 +53,6 @@
 #include <Cockpit/cockpit.hxx>
 #include <Joystick/joystick.hxx>
 #include <Math/fg_geodesy.hxx>
-#include <Math/fg_random.h>
 #include <Math/point3d.hxx>
 #include <Math/polar3d.hxx>
 #include <Scenery/scenery.hxx>
@@ -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.
 //
index a663f10df50c7702f4fd7a1eca2483275b6f5fc9..9322aaf975dd9a33a182255bb6d20f0cdcd005ff 100644 (file)
@@ -38,6 +38,7 @@
 
 #include <Debug/logstream.hxx>
 #include <Main/options.hxx>
+#include <Math/fg_random.h>
 #include <Objects/texload.h>
 
 #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.
index 8bad74132b0a511844b759d66039909a930ad417..fb4004846f908df87fa61dd45412856137134c5b 100644 (file)
@@ -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.
 //