X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsdl.c;h=f751fe85be2a5e568b94c6929f3ea79fc5f3d0ee;hb=e3ef41011a3564492d12988716af8fc1f090ac6b;hp=66320a5b296d12265eea5b96e13c454eafae1432;hpb=ddd58a300bd5996f69a8ec41d1fd140fe7a46f18;p=rocksndiamonds.git diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 66320a5b..f751fe85 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -296,6 +296,26 @@ boolean SDLSetVideoMode(DrawBuffer **backbuffer, boolean fullscreen) } } + +#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; } @@ -402,8 +422,6 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, int src_x = x, src_y = y; int dst_x = x, dst_y = y; unsigned int time_last, time_current; - float alpha; - int alpha_final; src_rect.x = src_x; src_rect.y = src_y; @@ -498,6 +516,7 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, int ypos[melt_columns]; int max_steps = height / 8 + 32; int steps_done = 0; + float steps = 0; int i; SDL_BlitSurface(surface_source, &src_rect, surface_screen, &dst_rect); @@ -520,7 +539,6 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, while (!done) { - float steps; int steps_final; time_last = time_current; @@ -610,6 +628,9 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, } else { + float alpha; + int alpha_final; + for (alpha = 0.0; alpha < 255.0;) { time_last = time_current; @@ -1786,6 +1807,36 @@ void SDLNextEvent(Event *event) } } +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 */