#include <Aircraft/aircraft.h>
#include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
+#include <Cockpit/hud.hxx>
#include <Debug/fg_debug.h>
#include <GUI/gui.h>
#include <Include/fg_constants.h>
v->goal_view_offset = FG_PI * 1.75;
return;
case 72: /* H key */
- status = current_options.get_hud_status();
- current_options.set_hud_status(!status);
+ // status = current_options.get_hud_status();
+ // current_options.set_hud_status(!status);
+ HUD_brightkey( true );
return;
case 77: /* M key */
t->warp -= 60;
case 87: /* W key */
#if defined(FX) && !defined(WIN32)
fullscreen = ( !fullscreen );
+#if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW)
XMesaSetFXmode(fullscreen ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW);
+#endif
#endif
return;
case 88: /* X key */
case 51: /* numeric keypad 3 (Pg Dn) */
fgThrottleMove(0, -0.01);
return;
+ case 104: /* h key */
+ HUD_brightkey( false );
+ return;
case 109: /* m key */
t->warp += 60;
return;
/* $Log$
-/* Revision 1.15 1998/07/13 21:01:34 curt
-/* Wrote access functions for current fgOPTIONS.
+/* Revision 1.16 1998/07/16 17:33:34 curt
+/* "H" / "h" now control hud brightness as well with off being one of the
+/* states.
+/* Better checking for xmesa/fx 3dfx fullscreen/window support for deciding
+/* whether or not to build in the feature.
+/* Translucent menu support.
+/* HAVE_AUDIO_SUPPORT -> ENABLE_AUDIO_SUPPORT
+/* Use fork() / wait() for playing mp3 init music in background under unix.
+/* Changed default tile diameter to 5.
/*
+ * Revision 1.15 1998/07/13 21:01:34 curt
+ * Wrote access functions for current fgOPTIONS.
+ *
* Revision 1.14 1998/07/06 02:42:02 curt
* Added support for switching between fullscreen and window mode for
* Mesa/3dfx/glide.
#include <sys/stat.h> /* for stat() */
#ifdef HAVE_UNISTD_H
-# include <unistd.h> /* for stat() */
+# include <unistd.h> /* for fork() && stat() */
+# include <sys/types.h> /* for wait() */
+# include <sys/wait.h> /* for wait() */
#endif
#include <Include/fg_constants.h> // for VERSION
#include <Astro/stars.hxx>
#include <Astro/sun.hxx>
-#ifdef HAVE_AUDIO_SUPPORT
+#ifdef ENABLE_AUDIO_SUPPORT
# include <Audio/src/sl.h>
# include <Audio/src/sm.h>
#endif
int use_signals = 0;
// Global structures for the Audio library
-#ifdef HAVE_AUDIO_SUPPORT
+#ifdef ENABLE_AUDIO_SUPPORT
slScheduler *audio_sched;
smMixer *audio_mixer;
slSample *s1;
if ( (current_options.get_fog() == 1) ||
(current_options.get_shading() == 0) ) {
// if fastest fog requested, or if flat shading force fastest
- xglHint (GL_FOG_HINT, GL_FASTEST );
+ xglHint ( GL_FOG_HINT, GL_FASTEST );
} else if ( current_options.get_fog() == 2 ) {
- xglHint (GL_FOG_HINT, GL_NICEST );
+ xglHint ( GL_FOG_HINT, GL_NICEST );
}
if ( current_options.get_wireframe() ) {
// draw wire frame
// if (!o->panel_status) {
// fgUpdateInstrViewParams();
// }
+
+ // We can do translucent menus, so why not. :-)
+ xglEnable ( GL_BLEND ) ;
+ xglBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
puDisplay();
+ xglDisable ( GL_BLEND ) ;
}
xglutSwapBuffers();
global_events.Process();
// Run audio scheduler
-#ifdef HAVE_AUDIO_SUPPORT
+#ifdef ENABLE_AUDIO_SUPPORT
audio_sched -> update();
#endif
static void fgIdleFunction ( void ) {
fgGENERAL *g;
char path[256], mp3file[256], command[256], slfile[256];
- static char *lockfile = "/tmp/mpg123.running";
+ // static char *lockfile = "/tmp/mpg123.running";
g = &general;
current_options.get_fg_root(mp3file);
strcat(mp3file, "/Sounds/");
strcat(mp3file, "intro.mp3");
+ /*
sprintf(command,
"(touch %s; mpg123 %s > /dev/null 2>&1; /bin/rm %s) &",
lockfile, mp3file, lockfile );
+ */
+ sprintf(command, "mpg123 %s > /dev/null 2>&1", mp3file);
fgPrintf( FG_GENERAL, FG_INFO,
"Starting intro music: %s\n", mp3file);
- system(command);
+
+ int pid = fork () ;
+
+ if ( pid == 0 ) {
+ system ( command );
+ exit ( 0 ) ;
+ }
}
#endif
idle_state++;
} else if ( idle_state == 6 ) {
// Initialize audio support
-#ifdef HAVE_AUDIO_SUPPORT
+#ifdef ENABLE_AUDIO_SUPPORT
#if !defined(WIN32)
if ( current_options.get_intro_music() ) {
// Let's wait for mpg123 to finish
- struct stat stat_buf;
+ // struct stat stat_buf;
fgPrintf( FG_GENERAL, FG_INFO,
- "Waiting for mpg123 player to finish " );
+ "Waiting for mpg123 player to finish ...\n" );
+ /*
while ( stat(lockfile, &stat_buf) == 0 ) {
// file exist, wait ...
sleep(1);
fgPrintf( FG_GENERAL, FG_INFO, ".");
}
fgPrintf( FG_GENERAL, FG_INFO, "\n");
+ */
+
+ wait(0);
}
#endif // WIN32
audio_sched -> setSafetyMargin ( 1.0 ) ;
current_options.get_fg_root(path);
strcat(path, "/Sounds/");
-
strcpy(slfile, path);
- strcat(slfile, "prpidle.wav");
- // s1 = new slSample ( slfile );
- s1 = new slSample ( "/dos/X-System-HSR/sounds/xp_recip.wav",
- audio_sched );
+ strcat(slfile, "wasp.wav");
+
+ s1 = new slSample ( slfile );
+ // s1 = new slSample ( "/dos/X-System-HSR/sounds/xp_recip.wav",
+ // audio_sched );
printf("Rate = %d Bps = %d Stereo = %d\n",
s1 -> getRate(), s1 -> getBps(), s1 -> getStereo());
audio_sched -> loopSample ( s1 );
// $Log$
+// Revision 1.36 1998/07/16 17:33:35 curt
+// "H" / "h" now control hud brightness as well with off being one of the
+// states.
+// Better checking for xmesa/fx 3dfx fullscreen/window support for deciding
+// whether or not to build in the feature.
+// Translucent menu support.
+// HAVE_AUDIO_SUPPORT -> ENABLE_AUDIO_SUPPORT
+// Use fork() / wait() for playing mp3 init music in background under unix.
+// Changed default tile diameter to 5.
+//
// Revision 1.35 1998/07/13 21:01:36 curt
// Wrote access functions for current fgOPTIONS.
//