video.frame_delay = 0;
video.frame_delay_value = GAME_FRAME_DELAY;
+ video.shifted_up = FALSE;
+
SDLInitVideoBuffer(fullscreen);
video.initialized = TRUE;
free(new_bitmap);
}
-static void SetMaskedBitmapSurface(Bitmap *bitmap)
-{
- if (bitmap == NULL)
- return;
-
- SDL_Surface *surface = bitmap->surface;
-
- if (bitmap->surface_masked)
- SDL_FreeSurface(bitmap->surface_masked);
-
- SDL_SetColorKey(surface, SET_TRANSPARENT_PIXEL,
- SDL_MapRGB(surface->format, 0x00, 0x00, 0x00));
-
- if ((bitmap->surface_masked = SDLGetNativeSurface(surface)) == NULL)
- Error(ERR_EXIT, "SDL_DisplayFormat() failed");
-
- SDL_SetColorKey(surface, UNSET_TRANSPARENT_PIXEL, 0);
-}
-
static Bitmap *ZoomBitmap(Bitmap *src_bitmap, int zoom_width, int zoom_height)
{
- Bitmap *dst_bitmap = SDLZoomBitmap(src_bitmap, zoom_width, zoom_height);
-
- SetMaskedBitmapSurface(dst_bitmap);
-
- return dst_bitmap;
+ return SDLZoomBitmap(src_bitmap, zoom_width, zoom_height);
}
void ReCreateGameTileSizeBitmap(Bitmap **bitmaps)
return HandleKeyModState(KSYM_UNDEFINED, 0);
}
+void StartTextInput(int x, int y)
+{
+#if defined(TARGET_SDL2)
+ SDL_StartTextInput();
+
+#if defined(HAS_SCREEN_KEYBOARD)
+ if (y > video.height / 2)
+ video.shifted_up = TRUE;
+#endif
+#endif
+}
+
+void StopTextInput()
+{
+#if defined(TARGET_SDL2)
+ SDL_StopTextInput();
+
+#if defined(HAS_SCREEN_KEYBOARD)
+ video.shifted_up = FALSE;
+#endif
+#endif
+}
+
boolean CheckCloseWindowEvent(ClientMessageEvent *event)
{
if (event->type != EVENT_CLIENTMESSAGE)