sdl - print usage when help arguments are passed even if SDL cannot be initialized

This commit is contained in:
punkrockguy318 2011-06-02 04:02:11 +00:00
parent a29f585d7b
commit cff16d4ae4
1 changed files with 10 additions and 0 deletions

View File

@ -496,6 +496,16 @@ void FCEUD_TraceInstruction() {
*/ */
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
// this is a hackish check for the --help arguemnts
// these are normally processed by the config parser, but SDL_Init
// must be run before the config parser: so if even SDL_Init fails,
// these four lines will still print the help output
if( !strcmp(argv[1], "--help") || !strcmp(argv[1],"-h"))
{
ShowUsage(argv[0]);
return 0;
}
int error, frameskip; int error, frameskip;
FCEUD_Message("Starting "FCEU_NAME_AND_VERSION"...\n"); FCEUD_Message("Starting "FCEU_NAME_AND_VERSION"...\n");