- if (SDL_Init(SDL_INIT_EVENTTHREAD | SDL_INIT_NOPARACHUTE) < 0)
+#if defined(TARGET_SDL2)
+ int sdl_init_flags = SDL_INIT_EVENTS | SDL_INIT_NOPARACHUTE;
+#else
+ int sdl_init_flags = SDL_INIT_EVENTTHREAD | SDL_INIT_NOPARACHUTE;
+#endif
+
+ if (SDL_Init(sdl_init_flags) < 0)
void InitGfxWindowInfo(int win_xsize, int win_ysize)
{
gfx.win_xsize = win_xsize;
void InitGfxWindowInfo(int win_xsize, int win_ysize)
{
gfx.win_xsize = win_xsize;
gfx.real_sx, gfx.real_sy,
gfx.full_sxsize, gfx.full_sysize);
else if (mask == REDRAW_DOOR_1)
gfx.real_sx, gfx.real_sy,
gfx.full_sxsize, gfx.full_sysize);
else if (mask == REDRAW_DOOR_1)
BlitBitmapTiled(background_bitmap_tile, gfx.background_bitmap, 0, 0, 0, 0,
gfx.real_sx, gfx.real_sy, gfx.full_sxsize, gfx.full_sysize);
else if (mask == REDRAW_DOOR_1)
BlitBitmapTiled(background_bitmap_tile, gfx.background_bitmap, 0, 0, 0, 0,
gfx.real_sx, gfx.real_sy, gfx.full_sxsize, gfx.full_sysize);
else if (mask == REDRAW_DOOR_1)
BlitBitmapTiled(background_bitmap_tile, gfx.background_bitmap, 0, 0, 0, 0,
gfx.dx, gfx.dy, gfx.dxsize, gfx.dysize);
BlitBitmapTiled(background_bitmap_tile, gfx.background_bitmap, 0, 0, 0, 0,
gfx.dx, gfx.dy, gfx.dxsize, gfx.dysize);
void InitVideoBuffer(int width, int height, int depth, boolean fullscreen)
{
void InitVideoBuffer(int width, int height, int depth, boolean fullscreen)
{
video.width = width;
video.height = height;
video.depth = GetRealDepth(depth);
video.fullscreen_available = FULLSCREEN_STATUS;
video.fullscreen_enabled = FALSE;
video.width = width;
video.height = height;
video.depth = GetRealDepth(depth);
video.fullscreen_available = FULLSCREEN_STATUS;
video.fullscreen_enabled = FALSE;
+#if 1
+ if ((draw_mask & REDRAW_FIELD) && IN_GFX_FIELD_FULL(x, y))
+ return TRUE;
+
+ if ((draw_mask & REDRAW_DOOR_1) && IN_GFX_DOOR_1(x, y))
+ return TRUE;
+
+ if ((draw_mask & REDRAW_DOOR_2) && IN_GFX_DOOR_2(x, y))
+ return TRUE;
+
+ if ((draw_mask & REDRAW_DOOR_3) && IN_GFX_DOOR_3(x, y))
+ return TRUE;
+#else
if (DrawingDeactivated(dst_x, dst_y, width, height))
return;
if (DrawingDeactivated(dst_x, dst_y, width, height))
return;
/* !!! 2009-03-30: Fixed by using self-compiled, patched SDL.dll !!! */
/* (This bug still exists in the actual (as of 2009-06-15) version 1.2.13,
but is already fixed in SVN and should therefore finally be fixed with
the next official SDL release, which is probably version 1.2.14.) */
#if 1
/* !!! 2009-03-24: It seems that this problem still exists in 1.2.12 !!! */
/* !!! 2009-03-30: Fixed by using self-compiled, patched SDL.dll !!! */
/* (This bug still exists in the actual (as of 2009-06-15) version 1.2.13,
but is already fixed in SVN and should therefore finally be fixed with
the next official SDL release, which is probably version 1.2.14.) */
#if 1
/* !!! 2009-03-24: It seems that this problem still exists in 1.2.12 !!! */
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY / 2,
SDL_DEFAULT_REPEAT_INTERVAL / 2);
SDL_EnableUNICODE(1);
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY / 2,
SDL_DEFAULT_REPEAT_INTERVAL / 2);
SDL_EnableUNICODE(1);
int new_width, new_height;
/* calculate new image dimensions for normal sized image */
int new_width, new_height;
/* calculate new image dimensions for normal sized image */
SDL_MapRGB(tmp_surface_1->format, 0x00, 0x00, 0x00));
if ((old_bitmap->surface_masked = SDL_DisplayFormat(tmp_surface_1)) ==NULL)
Error(ERR_EXIT, "SDL_DisplayFormat() failed");
SDL_MapRGB(tmp_surface_1->format, 0x00, 0x00, 0x00));
if ((old_bitmap->surface_masked = SDL_DisplayFormat(tmp_surface_1)) ==NULL)
Error(ERR_EXIT, "SDL_DisplayFormat() failed");
SDL_MapRGB(old_surface->format, 0x00, 0x00, 0x00));
if ((old_bitmap->surface_masked = SDL_DisplayFormat(old_surface)) ==NULL)
Error(ERR_EXIT, "SDL_DisplayFormat() failed");
SDL_MapRGB(old_surface->format, 0x00, 0x00, 0x00));
if ((old_bitmap->surface_masked = SDL_DisplayFormat(old_surface)) ==NULL)
Error(ERR_EXIT, "SDL_DisplayFormat() failed");
SDL_PeepEvents(event, 1, SDL_PEEKEVENT, SDL_ALLEVENTS);
SDL_PeepEvents(event, 1, SDL_PEEKEVENT, SDL_ALLEVENTS);
#if 0
printf("unicode == '%d', sym == '%d', mod == '0x%04x'\n",
#if 0
printf("unicode == '%d', sym == '%d', mod == '0x%04x'\n",