#include "platform.h"
-#if defined(PLATFORM_MSDOS)
-#include <fcntl.h>
-#endif
-
#include "system.h"
#include "image.h"
#include "sound.h"
void InitProgramInfo(char *argv0,
char *userdata_subdir, char *userdata_subdir_unix,
- char *program_title, char *window_title, char *icon_title,
+ char *program_title,
+#if 0
+ char *window_title,
+#endif
+ char *icon_title,
char *x11_icon_filename, char *x11_iconmask_filename,
- char *sdl_icon_filename, char *msdos_cursor_filename,
+ char *sdl_icon_filename,
char *cookie_prefix, char *filename_prefix,
int program_version)
{
program.userdata_path = getUserGameDataDir();
program.program_title = program_title;
+#if 1
+ program.window_title = "(undefined)";
+#else
program.window_title = window_title;
+#endif
program.icon_title = icon_title;
program.x11_icon_filename = x11_icon_filename;
program.x11_iconmask_filename = x11_iconmask_filename;
program.sdl_icon_filename = sdl_icon_filename;
- program.msdos_cursor_filename = msdos_cursor_filename;
program.cookie_prefix = cookie_prefix;
program.filename_prefix = filename_prefix;
program.error_file = stderr;
}
+void SetWindowTitle()
+{
+ program.window_title = program.window_title_function();
+
+#if defined(TARGET_SDL)
+ SDLSetWindowTitle();
+#endif
+}
+
+void InitWindowTitleFunction(char *(*window_title_function)(void))
+{
+ program.window_title_function = window_title_function;
+}
+
void InitExitMessageFunction(void (*exit_message_function)(char *, va_list))
{
program.exit_message_function = exit_message_function;
// this is initialized in GetOptions(), but may already be used before
options.verbose = TRUE;
-#if defined(PLATFORM_MSDOS)
- _fmode = O_BINARY;
-#endif
-
#if defined(PLATFORM_MACOSX)
updateUserGameDataDir();
#endif
void ClosePlatformDependentStuff(void)
{
-#if defined(PLATFORM_WIN32) || defined(PLATFORM_MSDOS)
+#if defined(PLATFORM_WIN32)
closeErrorFile();
#endif
-
-#if defined(PLATFORM_MSDOS)
- dumpErrorFile();
-#endif
}
void InitGfxFieldInfo(int sx, int sy, int sxsize, int sysize,
gfx.vysize = vysize;
}
+void InitGfxDoor3Info(int ex, int ey, int exsize, int eysize)
+{
+ gfx.ex = ex;
+ gfx.ey = ey;
+ gfx.exsize = exsize;
+ gfx.eysize = eysize;
+}
+
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)
- {
DrawBitmapFromTile(gfx.background_bitmap, background_bitmap_tile,
gfx.dx, gfx.dy,
gfx.dxsize, gfx.dysize);
- }
}
#else
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);
- }
}
#endif
#endif
}
+void LimitScreenUpdates(boolean enable)
+{
+#if defined(TARGET_SDL)
+ SDLLimitScreenUpdates(enable);
+#endif
+}
+
void InitVideoDisplay(void)
{
#if defined(TARGET_SDL)
void InitVideoBuffer(int width, int height, int depth, boolean fullscreen)
{
+#if 0
+ printf("::: InitVideoBuffer\n");
+#endif
+
video.width = width;
video.height = height;
video.depth = GetRealDepth(depth);
video.fullscreen_available = FULLSCREEN_STATUS;
video.fullscreen_enabled = FALSE;
+ // video.fullscreen_initial = FALSE;
#if 0
video.fullscreen_mode_current = NULL;
video.fullscreen_modes = NULL;
#endif
+ video.window_scaling_available = WINDOW_SCALING_STATUS;
+
#if defined(TARGET_SDL)
SDLInitVideoBuffer(&backbuffer, &window, fullscreen);
#else
if (draw_mask & REDRAW_ALL)
return TRUE;
+#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 ((draw_mask & REDRAW_FIELD) &&
x >= gfx.real_sx && x < gfx.real_sx + gfx.full_sxsize)
return TRUE;
if ((draw_mask & REDRAW_DOOR_2) &&
x >= gfx.dx && y >= gfx.vy)
return TRUE;
+#endif
return FALSE;
}
int dst_x_unclipped = dst_x;
int dst_y_unclipped = dst_y;
+ if (src_bitmap == NULL || dst_bitmap == NULL)
+ return;
+
if (DrawingDeactivated(dst_x, dst_y, width, height))
return;
height = dst_bitmap->height - dst_y;
#endif
-#if 0
+#if 1
+ /* !!! 2013-12-11: An "old friend" is back. Same bug in SDL2 2.0.1 !!! */
+#if 1
/* !!! 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 !!! */
-#if defined(TARGET_SDL) && defined(PLATFORM_WIN32)
+ //#if defined(TARGET_SDL) && defined(PLATFORM_WIN32)
+#if defined(TARGET_SDL2)
if (src_bitmap == dst_bitmap)
{
/* !!! THIS IS A BUG (IN THE SDL LIBRARY?) AND SHOULD BE FIXED !!! */
#endif
#endif
#endif
+#endif
#if 0
if (dst_x < gfx.sx + gfx.sxsize)
/* mouse pointer functions */
/* ------------------------------------------------------------------------- */
-#if !defined(PLATFORM_MSDOS)
#define USE_ONE_PIXEL_PLAYFIELD_MOUSEPOINTER 0
+
/* XPM image definitions */
static const char *cursor_image_none[] =
{
/* hot spot */
"0,0"
};
+
#if USE_ONE_PIXEL_PLAYFIELD_MOUSEPOINTER
static const char *cursor_image_dot[] =
{
return cursor;
}
-#endif /* !PLATFORM_MSDOS */
void SetMouseCursor(int mode)
{
-#if !defined(PLATFORM_MSDOS)
static struct MouseCursorInfo *cursor_none = NULL;
static struct MouseCursorInfo *cursor_playfield = NULL;
struct MouseCursorInfo *cursor_new;
#elif defined(TARGET_X11_NATIVE)
X11SetMouseCursor(cursor_new);
#endif
-#endif
}
SDLOpenAudio();
#elif defined(PLATFORM_UNIX)
UnixOpenAudio();
-#elif defined(PLATFORM_MSDOS)
- MSDOSOpenAudio();
#endif
}
SDLCloseAudio();
#elif defined(PLATFORM_UNIX)
UnixCloseAudio();
-#elif defined(PLATFORM_MSDOS)
- MSDOSCloseAudio();
#endif
audio.sound_enabled = FALSE;
SDLInitJoysticks();
#elif defined(PLATFORM_UNIX)
UnixInitJoysticks();
-#elif defined(PLATFORM_MSDOS)
- MSDOSInitJoysticks();
#endif
#if 0
return SDLReadJoystick(nr, x, y, b1, b2);
#elif defined(PLATFORM_UNIX)
return UnixReadJoystick(nr, x, y, b1, b2);
-#elif defined(PLATFORM_MSDOS)
- return MSDOSReadJoystick(nr, x, y, b1, b2);
#endif
}