fullscreen_xoffset = (fullscreen_width - video.width) / 2;
fullscreen_yoffset = (fullscreen_height - video.height) / 2;
+#if 1
+ checked_free(video.fullscreen_modes);
+
+ video.fullscreen_modes = NULL;
+ video.fullscreen_mode_current = NULL;
+#endif
+
/* get available hardware supported fullscreen modes */
modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE);
should never be drawn to directly, it would do no harm nevertheless. */
/* create additional (symbolic) buffer for double-buffering */
+#if 1
+ ReCreateBitmap(window, video.width, video.height, video.depth);
+#else
*window = CreateBitmap(video.width, video.height, video.depth);
+#endif
}
boolean SDLSetVideoMode(DrawBuffer **backbuffer, boolean fullscreen)
if (*backbuffer == NULL)
*backbuffer = CreateBitmapStruct();
+ /* (real bitmap might be larger in fullscreen mode with video offsets) */
+ (*backbuffer)->width = video.width;
+ (*backbuffer)->height = video.height;
+
if (fullscreen && !video.fullscreen_enabled && video.fullscreen_available)
{
setFullscreenParameters(setup.fullscreen_mode);
(*backbuffer)->surface = new_surface;
video.fullscreen_enabled = FALSE;
+
success = TRUE;
}
}
+#if 1
+ SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
+
+#if defined(PLATFORM_WIN32)
+ {
+ SDL_SysWMinfo wminfo;
+ HWND hwnd;
+
+ SDL_VERSION(&wminfo.version);
+ SDL_GetWMInfo(&wminfo);
+
+ hwnd = wminfo.window;
+
+ DragAcceptFiles(hwnd, TRUE);
+ }
+#endif
+#endif
+
+
return success;
}
int dst_x = x, dst_y = y;
unsigned int time_last, time_current;
+ /* check if screen size has changed */
+ if (surface_source != NULL && (video.width != surface_source->w ||
+ video.height != surface_source->h))
+ {
+ SDL_FreeSurface(surface_source);
+ SDL_FreeSurface(surface_target);
+ SDL_FreeSurface(surface_black);
+
+ initialization_needed = TRUE;
+ }
+
src_rect.x = src_x;
src_rect.y = src_y;
src_rect.w = width;
{
int x, y;
tColorRGBA *sp, *csp, *dp;
- int sgap, dgap;
+#if 0
+ int sgap;
+#endif
+ int dgap;
/* pointer setup */
sp = csp = (tColorRGBA *) src->pixels;
dp = (tColorRGBA *) dst->pixels;
+#if 0
sgap = src->pitch - src->w * 4;
+#endif
dgap = dst->pitch - dst->w * 4;
for (y = 0; y < dst->h; y++)
{
int x, y, sx, sy, *sax, *say, *csax, *csay, csx, csy;
tColorRGBA *sp, *csp, *dp;
- int sgap, dgap;
+#if 0
+ int sgap;
+#endif
+ int dgap;
/* use specialized zoom function when scaling down to exactly half size */
if (src->w == 2 * dst->w &&
/* pointer setup */
sp = csp = (tColorRGBA *) src->pixels;
dp = (tColorRGBA *) dst->pixels;
+#if 0
sgap = src->pitch - src->w * 4;
+#endif
dgap = dst->pitch - dst->w * 4;
csay = say;
}
}
+void SDLHandleWindowManagerEvent(Event *event)
+{
+#if defined(PLATFORM_WIN32)
+ SDL_SysWMEvent *syswmevent = (SDL_SysWMEvent *)event;
+ SDL_SysWMmsg *syswmmsg = (SDL_SysWMmsg *)(syswmevent->msg);
+
+ if (syswmmsg->msg == WM_DROPFILES)
+ {
+ HDROP hdrop = (HDROP)syswmmsg->wParam;
+ int i, num_files;
+
+ printf("::: SDL_SYSWMEVENT:\n");
+
+ num_files = DragQueryFile(hdrop, 0xffffffff, NULL, 0);
+
+ for (i = 0; i < num_files; i++)
+ {
+ int buffer_len = DragQueryFile(hdrop, i, NULL, 0);
+ char buffer[buffer_len + 1];
+
+ DragQueryFile(hdrop, i, buffer, buffer_len + 1);
+
+ printf("::: - '%s'\n", buffer);
+ }
+
+ DragFinish((HDROP)syswmmsg->wParam);
+ }
+#endif
+}
+
/* ========================================================================= */
/* joystick functions */