Browse Source

winphone: changed behavior of Back key to satisfy M$'s certification requirements.

Wei Mingzhi 9 years ago
parent
commit
12167f4adc
2 changed files with 7 additions and 7 deletions
  1. 1 1
      input.c
  2. 6 6
      video.c

+ 1 - 1
input.c

@@ -101,7 +101,7 @@ PAL_KeyboardEventFilter(
 
 #ifdef __WINPHONE__
       case SDLK_AC_BACK:
-         if (SDL_GetTicks() - g_uiLastBackKeyTime < 800)
+         if (g_uiLastBackKeyTime != 0 && SDL_GetTicks() - g_uiLastBackKeyTime < 800)
          {
             PAL_Shutdown();
             exit(0);

+ 6 - 6
video.c

@@ -444,7 +444,7 @@ VIDEO_UpdateScreen(
       if (gpBackKeyMessage)
       {
          extern unsigned int g_uiLastBackKeyTime;
-         if (SDL_GetTicks() - g_uiLastBackKeyTime < 800)
+         if (g_uiLastBackKeyTime != 0 && SDL_GetTicks() - g_uiLastBackKeyTime < 800)
          {
            SDL_RenderCopy(gpRenderer, gpBackKeyMessage, NULL, NULL);
          }
@@ -510,7 +510,7 @@ VIDEO_UpdateScreen(
       if (gpBackKeyMessage)
       {
          extern unsigned int g_uiLastBackKeyTime;
-         if (SDL_GetTicks() - g_uiLastBackKeyTime < 800)
+         if (g_uiLastBackKeyTime != 0 && SDL_GetTicks() - g_uiLastBackKeyTime < 800)
          {
            SDL_RenderCopy(gpRenderer, gpBackKeyMessage, NULL, NULL);
          }
@@ -547,7 +547,7 @@ VIDEO_UpdateScreen(
       if (gpBackKeyMessage)
       {
          extern unsigned int g_uiLastBackKeyTime;
-         if (SDL_GetTicks() - g_uiLastBackKeyTime < 800)
+         if (g_uiLastBackKeyTime != 0 && SDL_GetTicks() - g_uiLastBackKeyTime < 800)
          {
            SDL_RenderCopy(gpRenderer, gpBackKeyMessage, NULL, NULL);
          }
@@ -1012,7 +1012,7 @@ VIDEO_SwitchScreen(
       if (gpBackKeyMessage)
       {
          extern unsigned int g_uiLastBackKeyTime;
-         if (SDL_GetTicks() - g_uiLastBackKeyTime < 800)
+         if (g_uiLastBackKeyTime != 0 && SDL_GetTicks() - g_uiLastBackKeyTime < 800)
          {
            SDL_RenderCopy(gpRenderer, gpBackKeyMessage, NULL, NULL);
          }
@@ -1165,7 +1165,7 @@ VIDEO_FadeScreen(
             if (gpBackKeyMessage)
             {
                extern unsigned int g_uiLastBackKeyTime;
-               if (SDL_GetTicks() - g_uiLastBackKeyTime < 800)
+               if (g_uiLastBackKeyTime != 0 && SDL_GetTicks() - g_uiLastBackKeyTime < 800)
                {
                  SDL_RenderCopy(gpRenderer, gpBackKeyMessage, NULL, NULL);
                }
@@ -1196,7 +1196,7 @@ VIDEO_FadeScreen(
             if (gpBackKeyMessage)
             {
                extern unsigned int g_uiLastBackKeyTime;
-               if (SDL_GetTicks() - g_uiLastBackKeyTime < 800)
+               if (g_uiLastBackKeyTime != 0 && SDL_GetTicks() - g_uiLastBackKeyTime < 800)
                {
                   SDL_RenderCopy(gpRenderer, gpBackKeyMessage, NULL, NULL);
                }