Browse Source

make fLaunchSetting defaults to PAL_HAS_CONFIG_PAGE

LouYihua 7 years ago
parent
commit
16c1f81d75
3 changed files with 12 additions and 8 deletions
  1. 4 0
      common.h
  2. 7 7
      main.c
  3. 1 1
      palcfg.c

+ 4 - 0
common.h

@@ -234,4 +234,8 @@ typedef enum tagLOGLEVEL
 # define PAL_DEFAULT_LOGLEVEL  LOGLEVEL_MAX
 #endif
 
+#ifndef PAL_HAS_CONFIG_PAGE
+# define PAL_HAS_CONFIG_PAGE   FALSE
+#endif
+
 #endif

+ 7 - 7
main.c

@@ -486,16 +486,16 @@ main(
    if (UTIL_Platform_Init(argc, argv) != 0)
 	   return -1;
 
-   // Without the detection, app will automatically exit on platforms that dont have config page.
-#if defined(PAL_HAS_CONFIG_PAGE) && PAL_HAS_CONFIG_PAGE
    //
-   // Should launch setting
-   // However, it may arrive here through the activatation event on WinRT platform
-   // So close the current process so that the new process can go to setting
+   // Should launch setting?
+   // Generally, the condition should never be TRUE as the UTIL_Platform_Init is assumed
+   // to handle gConfig.fLaunchSetting correctly. However, it may actually be true due to
+   // the activatation event on WinRT platform, so close the current process to make new
+   // process go to setting.
+   // For platforms without configuration page available, this condition will NEVER be true.
    //
-   if (gConfig.fLaunchSetting)
+   if (PAL_HAS_CONFIG_PAGE && gConfig.fLaunchSetting)
 	   return 0;
-#endif
 
    //
    // If user requests a file-based log, then add it after the system-specific one.

+ 1 - 1
palcfg.c

@@ -38,7 +38,7 @@
 static const ConfigItem gConfigItems[PALCFG_ALL_MAX] = {
 	{ PALCFG_FULLSCREEN,        PALCFG_BOOLEAN,  "FullScreen",        10, MAKE_VALUE(FALSE,                         FALSE,                 TRUE) },
 	{ PALCFG_KEEPASPECTRATIO,   PALCFG_BOOLEAN,  "KeepAspectRatio",   15, MAKE_VALUE(TRUE,                          FALSE,                 TRUE) },
-	{ PALCFG_LAUNCHSETTING,     PALCFG_BOOLEAN,  "LaunchSetting",     13, MAKE_VALUE(TRUE,                          FALSE,                 TRUE) },
+	{ PALCFG_LAUNCHSETTING,     PALCFG_BOOLEAN,  "LaunchSetting",     13, MAKE_VALUE(PAL_HAS_CONFIG_PAGE,           FALSE,                 TRUE) },
 	{ PALCFG_STEREO,            PALCFG_BOOLEAN,  "Stereo",             6, MAKE_VALUE(TRUE,                          FALSE,                 TRUE) },                  // Default for stereo audio
 	{ PALCFG_USEEMBEDDEDFONTS,  PALCFG_BOOLEAN,  "UseEmbeddedFonts",  16, MAKE_VALUE(TRUE,                          FALSE,                 TRUE) },                  // Default for using embedded fonts in DOS version
 	{ PALCFG_USESURROUNDOPL,    PALCFG_BOOLEAN,  "UseSurroundOPL",    14, MAKE_VALUE(TRUE,                          FALSE,                 TRUE) },                  // Default for using surround opl