Browse Source

Several changes

1. Little change to the 'return to setting'
2. rename 'main_PSP.h' to 'main_PSP.c'
3. prevent entering game if gConfig.fLaunchSetting is TRUE
louyihua 8 years ago
parent
commit
4105283155
6 changed files with 20 additions and 26 deletions
  1. 1 2
      global.c
  2. 8 7
      main.c
  3. 0 0
      main_PSP.c
  4. 2 2
      text.c
  5. 7 13
      uigame.c
  6. 2 2
      winrt/SDLPal.Common/WinRTUtil.cpp

+ 1 - 2
global.c

@@ -326,8 +326,7 @@ PAL_InitGlobals(
 
   Parameters:
 
-    [IN]  uCodePage - the code page for text conversion.
-	[IN]  dwWordLength - the length of each word.
+    None.
 
   Return value:
 

+ 8 - 7
main.c

@@ -23,10 +23,6 @@
 
 #include "main.h"
 
-#ifdef PSP
-#include "main_PSP.h"
-#endif
-
 #if defined (NDS) && defined (GEKKO)
 
 # include <fat.h>
@@ -551,12 +547,17 @@ main(
    if (UTIL_Platform_Init(argc, argv) != 0)
 	   return -1;
 
+   //
+   // 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
+   //
+   if (gConfig.fLaunchSetting)
+	   return 0;
+
    //
    // Initialize everything
    //
-#ifdef PSP
-   sdlpal_psp_init();
-#endif
    PAL_Init();
 
    //

main_PSP.h → main_PSP.c


+ 2 - 2
text.c

@@ -51,8 +51,8 @@ static LPWSTR gc_rgszDefaultAdditionalWords[ATB_WORD_COUNT] = { NULL, L"\xFF11",
 
 #define SDLPAL_EXTRA_WORD_COUNT     1
 static LPWSTR gc_rgszSDLPalWords[CP_MAX][SDLPAL_EXTRA_WORD_COUNT] = {
-	{ L"\x555F\x52D5\x8A2D\x5B9A" },
-	{ L"\x542F\x52A8\x8BBE\x7F6E" },
+	{ L"\x8FD4\x56DE\x8A2D\x5B9A" },
+	{ L"\x8FD4\x56DE\x8BBE\x7F6E" },
 };
 
 LPWSTR g_rcCredits[12];

+ 7 - 13
uigame.c

@@ -633,29 +633,23 @@ PAL_SystemMenu(
       break;
 
    case 5:
-      //
+   case 6:
+	   //
       // Quit
       //
       if (PAL_ConfirmMenu())
       {
+         if (wReturnValue == 6)
+         {
+            gConfig.fLaunchSetting = TRUE;
+            PAL_SaveConfig();
+         }
          SOUND_PlayMUS(0, FALSE, 2);
          PAL_FadeOut(2);
          PAL_Shutdown(0);
       }
       break;
 
-   case 6:
-	   //
-	   // Launch setting
-	   //
-	   wReturnValue = (WORD)PAL_ConfirmMenu();
-	   if (wReturnValue != gConfig.fLaunchSetting)
-	   {
-		   gConfig.fLaunchSetting = wReturnValue;
-		   PAL_SaveConfig();
-	   }
-	   break;
-
 #if !defined(PAL_CLASSIC)
    case 7:
       //

+ 2 - 2
winrt/SDLPal.Common/WinRTUtil.cpp

@@ -68,7 +68,7 @@ BOOL UTIL_GetScreenSize(DWORD *pdwScreenWidth, DWORD *pdwScreenHeight)
 	IDXGIOutput* pOutput = nullptr;
 	DWORD retval = FALSE;
 
-#if _WIN32_WINNT >= 0x0A00
+#if NTDDI_VERSION >= NTDDI_WIN10
 	if (Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily != L"Windows.Mobile") return FALSE;
 #endif
 
@@ -82,7 +82,7 @@ BOOL UTIL_GetScreenSize(DWORD *pdwScreenWidth, DWORD *pdwScreenHeight)
 
 	if (SUCCEEDED(pOutput->GetDesc(&desc)))
 	{
-#if (_WIN32_WINNT < 0x0A00) && (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
+#if (NTDDI_VERSION < NTDDI_WIN10) && (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
 		*pdwScreenWidth = (desc.DesktopCoordinates.right - desc.DesktopCoordinates.left);
 		*pdwScreenHeight = (desc.DesktopCoordinates.bottom - desc.DesktopCoordinates.top);
 #else