]> git.mxchange.org Git - flightgear.git/commitdiff
Added support for Pui/Gui.
authorcurt <curt>
Fri, 12 Jun 1998 00:57:38 +0000 (00:57 +0000)
committercurt <curt>
Fri, 12 Jun 1998 00:57:38 +0000 (00:57 +0000)
Converted fog to GL_FOG_EXP2.
Link to static simulator parts.
Update runfg.bat to try to be a little smarter.

Main/GLUTkey.cxx
Main/GLUTmain.cxx
Main/Makefile.am
Main/runfg.bat.in

index 3f49a0944f8ed0a2d796f528d38e38564f847081..824217dd645cb1d422b5577ce0927ed62eff9f2c 100644 (file)
@@ -40,7 +40,9 @@
 #include <Aircraft/aircraft.h>
 #include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
 #include <Debug/fg_debug.h>
+#include <Gui/gui.h>
 #include <Include/fg_constants.h>
+#include <Pui/pu.h>
 #include <Weather/weather.h>
 
 #include "GLUTkey.hxx"
@@ -58,6 +60,7 @@ void GLUTkey(unsigned char k, int x, int y) {
     fgTIME *t;
     fgVIEW *v;
     struct fgWEATHER *w;
+    float tmp;
 
     c = current_aircraft.controls;
     o = &current_options;
@@ -66,6 +69,7 @@ void GLUTkey(unsigned char k, int x, int y) {
     w = &current_weather;
 
     fgPrintf( FG_INPUT, FG_DEBUG, "Key hit = %d", k);
+    puKeyboard(k, PU_DOWN );
 
     if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) {
        fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
@@ -114,11 +118,9 @@ void GLUTkey(unsigned char k, int x, int y) {
            v->update_fov = TRUE;
            return;
        case 90: /* Z key */
-           w->visibility /= 1.10;
-           xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
-           xglFogf(GL_FOG_END, w->visibility);
-           fgPrintf( FG_INPUT, FG_DEBUG, 
-                     "Fog density = %.4f\n", w->visibility );
+           tmp = fgWeatherGetVisibility();   /* in meters */
+           tmp /= 1.10;
+           fgWeatherSetVisibility( tmp );
            return;
        // autopilot additions
        case 65: /* A key */
@@ -183,11 +185,9 @@ void GLUTkey(unsigned char k, int x, int y) {
            v->update_fov = TRUE;
            return;
        case 122: /* z key */
-           w->visibility *= 1.10;
-           xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
-           xglFogf(GL_FOG_END, w->visibility);
-           fgPrintf( FG_INPUT, FG_DEBUG, 
-                     "Fog density = %.4f\n", w->visibility);
+           tmp = fgWeatherGetVisibility();   /* in meters */
+           tmp *= 1.10;
+           fgWeatherSetVisibility( tmp );
            return;
        case 27: /* ESC */
            // if( fg_DebugOutput ) {
@@ -209,6 +209,7 @@ void GLUTspecialkey(int k, int x, int y) {
     v = &current_view;
 
     fgPrintf( FG_INPUT, FG_DEBUG, "Special key hit = %d", k);
+    puKeyboard(k + PU_KEY_GLUT_SPECIAL_OFFSET, PU_DOWN);
 
     if ( GLUT_ACTIVE_SHIFT && glutGetModifiers() ) {
        fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
@@ -241,6 +242,13 @@ void GLUTspecialkey(int k, int x, int y) {
     } else {
         fgPrintf( FG_INPUT, FG_DEBUG, "\n");
        switch (k) {
+       case GLUT_KEY_F10: /* F10 toggles menu on and off... */
+           printf("Invoking call back function");
+           hideMenuButton -> 
+               setValue ((int) !(hideMenuButton -> getValue() ) );
+           hideMenuButton -> invokeCallback();
+           //exit(1);
+           return;
        case GLUT_KEY_UP:
            fgElevMove(0.05);
            return;
@@ -282,9 +290,15 @@ void GLUTspecialkey(int k, int x, int y) {
 
 
 /* $Log$
-/* Revision 1.10  1998/05/27 02:24:05  curt
-/* View optimizations by Norman Vine.
+/* Revision 1.11  1998/06/12 00:57:38  curt
+/* Added support for Pui/Gui.
+/* Converted fog to GL_FOG_EXP2.
+/* Link to static simulator parts.
+/* Update runfg.bat to try to be a little smarter.
 /*
+ * Revision 1.10  1998/05/27 02:24:05  curt
+ * View optimizations by Norman Vine.
+ *
  * Revision 1.9  1998/05/16 13:05:21  curt
  * Added limits to fov.
  *
index cc8508a18721190e2d80c5a234abac4e232466c3..c6cb8699ec5a7b1d4008e677f4296e8743c8dba5 100644 (file)
 
 #include <Cockpit/cockpit.hxx>
 #include <Debug/fg_debug.h>
+#include <Gui/gui.h>
 #include <Joystick/joystick.h>
 #include <Math/fg_geodesy.h>
 #include <Math/mat3.h>
 #include <Math/polar3d.h>
+#include <Pui/pu.h>
 #include <Scenery/scenery.hxx>
 #include <Scenery/tilemgr.hxx>
 #include <Time/event.hxx>
@@ -138,10 +140,10 @@ static void fgInitVisuals( void ) {
     xglEnable( GL_LIGHT0 );
     xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
 
-    xglFogi (GL_FOG_MODE, GL_LINEAR);
-    xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
-    xglFogf (GL_FOG_END, w->visibility);
-    // xglFogf (GL_FOG_DENSITY, w->visibility);
+    // xglFogi (GL_FOG_MODE, GL_LINEAR);
+    xglFogi (GL_FOG_MODE, GL_EXP);
+    // Fog density is now set when the weather system is initialized
+    // xglFogf (GL_FOG_DENSITY, w->fog_density);
     if ( o->shading ) {
        xglHint (GL_FOG_HINT, GL_NICEST );
     } else {
@@ -282,6 +284,10 @@ static void fgRenderFrame( void ) {
     t = &cur_time_params;
     v = &current_view;
 
+    // this is just a temporary hack, to make me understand Pui
+    timerText -> setLabel (ctime (&t->cur_time));
+    // end of hack
+
     // update view volume parameters
     fgUpdateViewParams();
 
@@ -388,7 +394,7 @@ static void fgRenderFrame( void ) {
     if (displayInstruments) {
        fgUpdateInstrViewParams();
     }
-
+    puDisplay();
     xglutSwapBuffers();
 }
 
@@ -616,6 +622,11 @@ int fgGlutInitEvents( void ) {
     xglutKeyboardFunc( GLUTkey );
     glutSpecialFunc( GLUTspecialkey );
 
+    // call guiMouseFunc() whenever our little rodent is used
+    glutMouseFunc ( guiMouseFunc );
+    glutMotionFunc (guiMotionFunc );
+    glutPassiveMotionFunc (guiMotionFunc );
+
     // call fgMainLoop() whenever there is
     // nothing else to do
     xglutIdleFunc( fgMainLoop );
@@ -705,6 +716,9 @@ int main( int argc, char **argv ) {
                  "GLUT event handler initialization failed ...\n" );
     }
 
+    //Init the user interface
+    guiInit();
+
     // Initialize audio support
 #ifdef HAVE_OSS_AUDIO
     audio_mixer . setMasterVolume ( 30 ) ;  /* 50% of max volume. */
@@ -736,6 +750,12 @@ int main( int argc, char **argv ) {
 
 
 // $Log$
+// Revision 1.24  1998/06/12 00:57:39  curt
+// Added support for Pui/Gui.
+// Converted fog to GL_FOG_EXP2.
+// Link to static simulator parts.
+// Update runfg.bat to try to be a little smarter.
+//
 // Revision 1.23  1998/06/08 17:57:04  curt
 // Minor sound/startup position tweaks.
 //
index 76f240f8d777dd29dc915db49906cf42e2d79f56..a3c07746e14a5bc293e0175255c9b9b85356891f 100644 (file)
@@ -19,22 +19,24 @@ fg_SOURCES = \
        views.cxx views.hxx
 
 fg_LDADD = \
-       $(top_builddir)/Simulator/Aircraft/libAircraft.la \
-       $(top_builddir)/Simulator/Astro/libAstro.la \
-       $(top_builddir)/Simulator/Autopilot/libAutopilot.la \
-       $(top_builddir)/Simulator/Cockpit/libCockpit.la \
-       $(top_builddir)/Simulator/Controls/libControls.la \
-       $(top_builddir)/Simulator/Flight/libFlight.la \
-       $(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.la \
-       $(top_builddir)/Simulator/Flight/Slew/libSlew.la \
-       $(top_builddir)/Simulator/Scenery/libScenery.la \
-       $(top_builddir)/Simulator/Time/libTime.la \
-       $(top_builddir)/Simulator/Weather/libWeather.la \
-        $(top_builddir)/Simulator/Joystick/libJoystick.la \
+       $(top_builddir)/Simulator/Aircraft/libAircraft.a \
+       $(top_builddir)/Simulator/Astro/libAstro.a \
+       $(top_builddir)/Simulator/Autopilot/libAutopilot.a \
+       $(top_builddir)/Simulator/Cockpit/libCockpit.a \
+       $(top_builddir)/Simulator/Controls/libControls.a \
+       $(top_builddir)/Simulator/Flight/libFlight.a \
+       $(top_builddir)/Simulator/Flight/LaRCsim/libLaRCsim.a \
+       $(top_builddir)/Simulator/Flight/Slew/libSlew.a \
+       $(top_builddir)/Simulator/Gui/libGui.a \
+       $(top_builddir)/Simulator/Scenery/libScenery.a \
+       $(top_builddir)/Simulator/Time/libTime.a \
+       $(top_builddir)/Simulator/Weather/libWeather.a \
+        $(top_builddir)/Simulator/Joystick/libJoystick.a \
        $(AUDIO_LIBS) \
        $(top_builddir)/Lib/Math/libMath.la \
        $(top_builddir)/Lib/Bucket/libBucket.la \
        $(top_builddir)/Lib/Debug/libDebug.la \
+       $(top_builddir)/Lib/Pui/libPui.la \
        $(top_builddir)/Lib/zlib/libz.la
 
 INCLUDES += \
index 62c7f956984e5e5414c9fbbf74c1f4826fb45c29..7958217844139f93d3cc3deea44340d9c9af8fb1 100755 (executable)
@@ -1,23 +1,28 @@
 REM @ECHO OFF\r
 \r
-REM Skip ahead to CONT1 if FG_ROOT has a value\r
-IF NOT %FG_ROOT%.==. GOTO CONT1\r
+REM Skip ahead to RUN1 if %FG_ROOT%\BIN\FG.EXE exists\r
+IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1\r
 \r
+REM %FG_ROOT% wasn't set right so let's try "."\r
 SET FG_ROOT=.\r
+IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1\r
 \r
-:CONT1\r
+REM %FG_ROOT% wasn't set right so let's try ".."\r
+SET FG_ROOT=..\r
+IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1\r
 \r
-REM Check for the existance of the executable\r
-IF NOT EXIST %FG_ROOT%\BIN\FG.EXE GOTO ERROR1\r
+REM %FG_ROOT% wasn't set right so let's try "@prefix@"\r
+SET FG_ROOT=@prefix@\r
+IF EXIST %FG_ROOT%\BIN\FG.EXE GOTO RUN1\r
 \r
+ECHO Cannot find %FG_ROOT%\BIN\FG.EXE\r
+GOTO END\r
+\r
+:RUN1\r
 REM Now that FG_ROOT has been set, run the program\r
 ECHO FG_ROOT = %FG_ROOT%\r
 %FG_ROOT%\BIN\FG.EXE %1 %2 %3 %4 %5 %6 %7 %8 %9\r
 \r
 GOTO END\r
 \r
-:ERROR1\r
-ECHO Cannot find %FG_ROOT%\BIN\FG.EXE\r
-GOTO END\r
-\r
 :END\r