From 3eddaf80525ca1a7b156179bf87e09c55386aee6 Mon Sep 17 00:00:00 2001 From: harry Date: Sun, 14 Aug 2022 20:15:50 -0400 Subject: [PATCH] Fixed Qt GUI --help command line option when no window system is present (X11/wayland). There is now a pre-gui initialization sweep of command line options. Also added a --version command line option and a warning that the --no-gui option is not supported (should someone try to use it). Fixes issue #528. --- src/drivers/Qt/fceuWrapper.cpp | 24 ++++++++++++++++++++---- src/drivers/Qt/fceuWrapper.h | 1 + src/drivers/Qt/main.cpp | 5 ++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/drivers/Qt/fceuWrapper.cpp b/src/drivers/Qt/fceuWrapper.cpp index d701fcfb..8c5ef9e7 100644 --- a/src/drivers/Qt/fceuWrapper.cpp +++ b/src/drivers/Qt/fceuWrapper.cpp @@ -642,6 +642,7 @@ static const char *DriverUsage = static void ShowUsage(const char *prog) { int i,j; + FCEUD_Message("Starting " FCEU_NAME_AND_VERSION "...\n"); printf("\nUsage is as follows:\n%s filename\n\n",prog); puts(DriverUsage); #ifdef _S9XLUA_H @@ -681,11 +682,9 @@ static void ShowUsage(const char *prog) } -int fceuWrapperInit( int argc, char *argv[] ) +// Pre-GUI initialization. +int fceuWrapperPreInit( int argc, char *argv[] ) { - int opt, error; - std::string s; - for (int i=0; i