Added an enable/disable splash screen option.
Added an enable/disable intro music option. Added an enable/disable instrument panel option. Added an enable/disable mouse pointer option. Added using namespace std for compilers that support this.
This commit is contained in:
parent
77572d53d4
commit
f17b1af1e3
4 changed files with 103 additions and 27 deletions
|
@ -302,7 +302,9 @@ static void fgRenderFrame( void ) {
|
||||||
|
|
||||||
if ( idle_state != 1000 ) {
|
if ( idle_state != 1000 ) {
|
||||||
// still initializing, draw the splash screen
|
// still initializing, draw the splash screen
|
||||||
fgSplashUpdate(0.0);
|
if ( o->splash_screen == 1 ) {
|
||||||
|
fgSplashUpdate(0.0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// idle_state is now 1000 meaning we've finished all our
|
// idle_state is now 1000 meaning we've finished all our
|
||||||
// initializations and are running the main loop, so this will
|
// initializations and are running the main loop, so this will
|
||||||
|
@ -610,21 +612,25 @@ static void fgIdleFunction ( void ) {
|
||||||
|
|
||||||
if ( idle_state == 0 ) {
|
if ( idle_state == 0 ) {
|
||||||
// Initialize the splash screen right away
|
// Initialize the splash screen right away
|
||||||
fgSplashInit();
|
if ( o->splash_screen ) {
|
||||||
|
fgSplashInit();
|
||||||
|
}
|
||||||
|
|
||||||
idle_state++;
|
idle_state++;
|
||||||
} else if ( idle_state == 1 ) {
|
} else if ( idle_state == 1 ) {
|
||||||
// Start the intro music
|
// Start the intro music
|
||||||
#ifndef WIN32
|
#if !defined(WIN32)
|
||||||
strcpy(mp3file, o->fg_root);
|
if ( o->intro_music ) {
|
||||||
strcat(mp3file, "/Sounds/");
|
strcpy(mp3file, o->fg_root);
|
||||||
strcat(mp3file, "intro.mp3");
|
strcat(mp3file, "/Sounds/");
|
||||||
sprintf(command,
|
strcat(mp3file, "intro.mp3");
|
||||||
"(touch %s; ampg123 %s > /dev/null 2>&1; /bin/rm %s) &",
|
sprintf(command,
|
||||||
lockfile, mp3file, lockfile );
|
"(touch %s; ampg123 %s > /dev/null 2>&1; /bin/rm %s) &",
|
||||||
fgPrintf( FG_GENERAL, FG_INFO,
|
lockfile, mp3file, lockfile );
|
||||||
"Starting intro music: %s\n", mp3file);
|
fgPrintf( FG_GENERAL, FG_INFO,
|
||||||
system(command);
|
"Starting intro music: %s\n", mp3file);
|
||||||
|
system(command);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
idle_state++;
|
idle_state++;
|
||||||
|
@ -673,18 +679,20 @@ static void fgIdleFunction ( void ) {
|
||||||
// Initialize audio support
|
// Initialize audio support
|
||||||
#ifdef HAVE_AUDIO_SUPPORT
|
#ifdef HAVE_AUDIO_SUPPORT
|
||||||
|
|
||||||
#ifndef WIN32
|
#if !defined(WIN32)
|
||||||
// Let's wait for mpg123 to finish
|
if ( o->intro_music ) {
|
||||||
struct stat stat_buf;
|
// Let's wait for mpg123 to finish
|
||||||
|
struct stat stat_buf;
|
||||||
|
|
||||||
fgPrintf( FG_GENERAL, FG_INFO,
|
fgPrintf( FG_GENERAL, FG_INFO,
|
||||||
"Waiting for mpg123 player to finish " );
|
"Waiting for mpg123 player to finish " );
|
||||||
while ( stat(lockfile, &stat_buf) == 0 ) {
|
while ( stat(lockfile, &stat_buf) == 0 ) {
|
||||||
// file exist, wait ...
|
// file exist, wait ...
|
||||||
sleep(1);
|
sleep(1);
|
||||||
fgPrintf( FG_GENERAL, FG_INFO, ".");
|
fgPrintf( FG_GENERAL, FG_INFO, ".");
|
||||||
|
}
|
||||||
|
fgPrintf( FG_GENERAL, FG_INFO, "\n");
|
||||||
}
|
}
|
||||||
fgPrintf( FG_GENERAL, FG_INFO, "\n");
|
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
// audio_sched = new slScheduler ( 8000 );
|
// audio_sched = new slScheduler ( 8000 );
|
||||||
|
@ -720,7 +728,9 @@ static void fgIdleFunction ( void ) {
|
||||||
|
|
||||||
fgMainLoop();
|
fgMainLoop();
|
||||||
} else {
|
} else {
|
||||||
fgSplashUpdate(0.0);
|
if ( o->splash_screen == 1 ) {
|
||||||
|
fgSplashUpdate(0.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -859,6 +869,13 @@ int main( int argc, char **argv ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.31 1998/07/06 21:34:17 curt
|
||||||
|
// Added an enable/disable splash screen option.
|
||||||
|
// Added an enable/disable intro music option.
|
||||||
|
// Added an enable/disable instrument panel option.
|
||||||
|
// Added an enable/disable mouse pointer option.
|
||||||
|
// Added using namespace std for compilers that support this.
|
||||||
|
//
|
||||||
// Revision 1.30 1998/07/06 02:42:03 curt
|
// Revision 1.30 1998/07/06 02:42:03 curt
|
||||||
// Added support for switching between fullscreen and window mode for
|
// Added support for switching between fullscreen and window mode for
|
||||||
// Mesa/3dfx/glide.
|
// Mesa/3dfx/glide.
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
|
|
||||||
#include <string> // Standard C++ string library
|
#include <string> // Standard C++ string library
|
||||||
#include <map> // STL associative "array"
|
#include <map> // STL associative "array"
|
||||||
|
#ifdef NEEDNAMESPACESTD
|
||||||
|
using namespace std;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -70,6 +73,13 @@ public:
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.6 1998/07/06 21:34:19 curt
|
||||||
|
// Added an enable/disable splash screen option.
|
||||||
|
// Added an enable/disable intro music option.
|
||||||
|
// Added an enable/disable instrument panel option.
|
||||||
|
// Added an enable/disable mouse pointer option.
|
||||||
|
// Added using namespace std for compilers that support this.
|
||||||
|
//
|
||||||
// Revision 1.5 1998/06/17 21:35:11 curt
|
// Revision 1.5 1998/06/17 21:35:11 curt
|
||||||
// Refined conditional audio support compilation.
|
// Refined conditional audio support compilation.
|
||||||
// Moved texture parameter setup calls to ../Scenery/materials.cxx
|
// Moved texture parameter setup calls to ../Scenery/materials.cxx
|
||||||
|
|
|
@ -67,6 +67,11 @@ fgOPTIONS::fgOPTIONS( void ) {
|
||||||
// default airport id
|
// default airport id
|
||||||
strcpy(airport_id, "");
|
strcpy(airport_id, "");
|
||||||
|
|
||||||
|
// Miscellaneous
|
||||||
|
splash_screen = 1;
|
||||||
|
intro_music = 1;
|
||||||
|
mouse_pointer = 0;
|
||||||
|
|
||||||
// Features
|
// Features
|
||||||
hud_status = 1;
|
hud_status = 1;
|
||||||
panel_status = 0;
|
panel_status = 0;
|
||||||
|
@ -101,11 +106,11 @@ static int parse_int(char *arg) {
|
||||||
arg++;
|
arg++;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("parse_int(): arg = %s\n", arg);
|
// printf("parse_int(): arg = %s\n", arg);
|
||||||
|
|
||||||
result = atoi(arg);
|
result = atoi(arg);
|
||||||
|
|
||||||
printf("parse_int(): result = %d\n", result);
|
// printf("parse_int(): result = %d\n", result);
|
||||||
|
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
@ -244,7 +249,7 @@ static int parse_tile_radius(char *arg) {
|
||||||
if ( radius < FG_RADIUS_MIN ) { radius = FG_RADIUS_MIN; }
|
if ( radius < FG_RADIUS_MIN ) { radius = FG_RADIUS_MIN; }
|
||||||
if ( radius > FG_RADIUS_MAX ) { radius = FG_RADIUS_MAX; }
|
if ( radius > FG_RADIUS_MAX ) { radius = FG_RADIUS_MAX; }
|
||||||
|
|
||||||
printf("parse_tile_radius(): radius = %d\n", radius);
|
// printf("parse_tile_radius(): radius = %d\n", radius);
|
||||||
|
|
||||||
return(radius);
|
return(radius);
|
||||||
}
|
}
|
||||||
|
@ -272,10 +277,26 @@ int fgOPTIONS::parse_option( char *arg ) {
|
||||||
(strcmp(arg, "-h") == 0) ) {
|
(strcmp(arg, "-h") == 0) ) {
|
||||||
// help/usage request
|
// help/usage request
|
||||||
return(FG_OPTIONS_HELP);
|
return(FG_OPTIONS_HELP);
|
||||||
|
} else if ( strcmp(arg, "--disable-splash-screen") == 0 ) {
|
||||||
|
splash_screen = 0;
|
||||||
|
} else if ( strcmp(arg, "--enable-splash-screen") == 0 ) {
|
||||||
|
splash_screen = 1;
|
||||||
|
} else if ( strcmp(arg, "--disable-intro-music") == 0 ) {
|
||||||
|
intro_music = 0;
|
||||||
|
} else if ( strcmp(arg, "--enable-intro-music") == 0 ) {
|
||||||
|
intro_music = 1;
|
||||||
|
} else if ( strcmp(arg, "--disable-mouse-pointer") == 0 ) {
|
||||||
|
mouse_pointer = 1;
|
||||||
|
} else if ( strcmp(arg, "--enable-mouse-pointer") == 0 ) {
|
||||||
|
mouse_pointer = 2;
|
||||||
} else if ( strcmp(arg, "--disable-hud") == 0 ) {
|
} else if ( strcmp(arg, "--disable-hud") == 0 ) {
|
||||||
hud_status = 0;
|
hud_status = 0;
|
||||||
} else if ( strcmp(arg, "--enable-hud") == 0 ) {
|
} else if ( strcmp(arg, "--enable-hud") == 0 ) {
|
||||||
hud_status = 1;
|
hud_status = 1;
|
||||||
|
} else if ( strcmp(arg, "--disable-panel") == 0 ) {
|
||||||
|
panel_status = 0;
|
||||||
|
} else if ( strcmp(arg, "--enable-panel") == 0 ) {
|
||||||
|
panel_status = 1;
|
||||||
} else if ( strncmp(arg, "--airport-id=", 13) == 0 ) {
|
} else if ( strncmp(arg, "--airport-id=", 13) == 0 ) {
|
||||||
arg += 13;
|
arg += 13;
|
||||||
strncpy(airport_id, arg, 4);
|
strncpy(airport_id, arg, 4);
|
||||||
|
@ -331,7 +352,7 @@ int fgOPTIONS::parse_command_line( int argc, char **argv ) {
|
||||||
fgPrintf(FG_GENERAL, FG_INFO, "Processing command line arguments\n");
|
fgPrintf(FG_GENERAL, FG_INFO, "Processing command line arguments\n");
|
||||||
|
|
||||||
while ( i < argc ) {
|
while ( i < argc ) {
|
||||||
fgPrintf(FG_GENERAL, FG_INFO, "argv[%d] = %s\n", i, argv[i]);
|
fgPrintf(FG_GENERAL, FG_DEBUG, "argv[%d] = %s\n", i, argv[i]);
|
||||||
|
|
||||||
result = parse_option(argv[i]);
|
result = parse_option(argv[i]);
|
||||||
if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
|
if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
|
||||||
|
@ -391,11 +412,20 @@ void fgOPTIONS::usage ( void ) {
|
||||||
printf("General Options:\n");
|
printf("General Options:\n");
|
||||||
printf("\t--help -h: print usage\n");
|
printf("\t--help -h: print usage\n");
|
||||||
printf("\t--fg-root=path: specify the root path for all the data files\n");
|
printf("\t--fg-root=path: specify the root path for all the data files\n");
|
||||||
|
printf("\t--disable-splash-screen: disable splash screen\n");
|
||||||
|
printf("\t--enable-splash-screen: enable splash screen\n");
|
||||||
|
printf("\t--disable-intro-music: disable introduction music\n");
|
||||||
|
printf("\t--enable-intro-music: enable introduction music\n");
|
||||||
|
printf("\t--disable-mouse-pointer: disable extra mouse pointer\n");
|
||||||
|
printf("\t--enable-mouse-pointer: enable extra mouse pointer (i.e. for\n");
|
||||||
|
printf("\t\tfull screen voodoo/voodoo-II based cards.\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
printf("Features:\n");
|
printf("Features:\n");
|
||||||
printf("\t--disable-hud: disable heads up display\n");
|
printf("\t--disable-hud: disable heads up display\n");
|
||||||
printf("\t--enable-hud: enable heads up display\n");
|
printf("\t--enable-hud: enable heads up display\n");
|
||||||
|
printf("\t--disable-panel: disable instrument panel\n");
|
||||||
|
printf("\t--enable-panel: enable instrumetn panel\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
printf("Initial Position:\n");
|
printf("Initial Position:\n");
|
||||||
|
@ -434,6 +464,13 @@ fgOPTIONS::~fgOPTIONS( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.15 1998/07/06 21:34:19 curt
|
||||||
|
// Added an enable/disable splash screen option.
|
||||||
|
// Added an enable/disable intro music option.
|
||||||
|
// Added an enable/disable instrument panel option.
|
||||||
|
// Added an enable/disable mouse pointer option.
|
||||||
|
// Added using namespace std for compilers that support this.
|
||||||
|
//
|
||||||
// Revision 1.14 1998/07/04 00:52:26 curt
|
// Revision 1.14 1998/07/04 00:52:26 curt
|
||||||
// Add my own version of gluLookAt() (which is nearly identical to the
|
// Add my own version of gluLookAt() (which is nearly identical to the
|
||||||
// Mesa/glu version.) But, by calculating the Model View matrix our selves
|
// Mesa/glu version.) But, by calculating the Model View matrix our selves
|
||||||
|
|
|
@ -46,6 +46,11 @@ public:
|
||||||
// ID of initial starting airport
|
// ID of initial starting airport
|
||||||
char airport_id[5];
|
char airport_id[5];
|
||||||
|
|
||||||
|
// Miscellaneous
|
||||||
|
int splash_screen; // show splash screen
|
||||||
|
int intro_music; // play introductory music
|
||||||
|
int mouse_pointer; // show mouse pointer
|
||||||
|
|
||||||
// Features
|
// Features
|
||||||
int hud_status; // HUD on/off
|
int hud_status; // HUD on/off
|
||||||
int panel_status; // Panel on/off
|
int panel_status; // Panel on/off
|
||||||
|
@ -98,6 +103,13 @@ extern fgOPTIONS current_options;
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.10 1998/07/06 21:34:20 curt
|
||||||
|
// Added an enable/disable splash screen option.
|
||||||
|
// Added an enable/disable intro music option.
|
||||||
|
// Added an enable/disable instrument panel option.
|
||||||
|
// Added an enable/disable mouse pointer option.
|
||||||
|
// Added using namespace std for compilers that support this.
|
||||||
|
//
|
||||||
// Revision 1.9 1998/06/27 16:54:34 curt
|
// Revision 1.9 1998/06/27 16:54:34 curt
|
||||||
// Replaced "extern displayInstruments" with a entry in fgOPTIONS.
|
// Replaced "extern displayInstruments" with a entry in fgOPTIONS.
|
||||||
// Don't change the view port when displaying the panel.
|
// Don't change the view port when displaying the panel.
|
||||||
|
|
Loading…
Add table
Reference in a new issue