Browse Source

fix SDL1 compile errors

Wei Mingzhi 9 years ago
parent
commit
36896899c6
3 changed files with 10 additions and 2 deletions
  1. 0 2
      input.c
  2. 4 0
      ui.c
  3. 6 0
      video.c

+ 0 - 2
input.c

@@ -924,9 +924,7 @@ PAL_EventFilter(
    PAL_KeyboardEventFilter(lpEvent);
    PAL_MouseEventFilter(lpEvent);
    PAL_JoystickEventFilter(lpEvent);
-#if SDL_VERSION_ATLEAST(2,0,0)
    PAL_TouchEventFilter(lpEvent);
-#endif
 
    //
    // All events are handled here; don't put anything to the internal queue

+ 4 - 0
ui.c

@@ -182,7 +182,9 @@ PAL_CreateBox(
          return NULL;
       }
 
+#if SDL_VERSION_ATLEAST(2,0,0)
       SDL_SetSurfacePalette(save, gpScreen->format->palette);
+#endif
       SDL_BlitSurface(gpScreen, &rect, save, NULL);
 
       lpBox->lpSavedArea = save;
@@ -294,7 +296,9 @@ PAL_CreateSingleLineBox(
          return NULL;
       }
 
+#if SDL_VERSION_ATLEAST(2,0,0)
       SDL_SetSurfacePalette(save, gpScreen->format->palette);
+#endif
       SDL_BlitSurface(gpScreen, &rect, save, NULL);
 
       lpBox->pos = pos;

+ 6 - 0
video.c

@@ -86,9 +86,15 @@ VIDEO_Init(
    //
    // Before we can render anything, we need a window and a renderer.
    //
+#if defined (__IOS__) || defined (__ANDROID__)
+   gpWindow = SDL_CreateWindow("Pal",
+      SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 320, 200,
+      SDL_WINDOW_SHOWN);
+#else
    gpWindow = SDL_CreateWindow("Pal",
       SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 400,
       SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
+#endif
 
    if (gpWindow == NULL)
    {