added definitions for new screen transition effect (not yet implemented)
[rocksndiamonds.git] / src / libgame / sdl.c
index 8b8720c320fcfe182b5bdbbb3958d03034aeb9ce..628ee38dc4b0da4a7ecd09158259945198bf4ca7 100644 (file)
@@ -60,6 +60,23 @@ static void UpdateScreen(SDL_Rect *rect)
 
   LimitScreenUpdates(FALSE);
 
+#if 0
+  {
+    static int LastFrameCounter = 0;
+    boolean changed = (FrameCounter != LastFrameCounter);
+
+    printf("::: FrameCounter == %d [%s]\n", FrameCounter,
+          (changed ? "-" : "SAME FRAME UPDATED"));
+
+    LastFrameCounter = FrameCounter;
+
+    /*
+    if (FrameCounter % 2)
+      return;
+    */
+  }
+#endif
+
 #if defined(TARGET_SDL2)
 #if USE_RENDERER
   SDL_Surface *screen = backbuffer->surface;
@@ -454,7 +471,7 @@ void SDLInitVideoBuffer(DrawBuffer **backbuffer, DrawWindow **window,
 
   /* !!! SDL2 can only set the window icon if the window already exists !!! */
   /* set window icon */
-  SDLSetWindowIcon(program.sdl_icon_filename);
+  SDLSetWindowIcon(program.icon_filename);
 
   /* set window and icon title */
 #if defined(TARGET_SDL2)
@@ -716,9 +733,12 @@ boolean SDLSetVideoMode(DrawBuffer **backbuffer, boolean fullscreen)
   SDLRedrawWindow();                   // map window
 #endif
 
+#ifdef DEBUG
+#if defined(PLATFORM_WIN32)
+  // experimental drag and drop code
+
   SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
 
-#if defined(PLATFORM_WIN32)
   {
     SDL_SysWMinfo wminfo;
     HWND hwnd;
@@ -743,6 +763,7 @@ boolean SDLSetVideoMode(DrawBuffer **backbuffer, boolean fullscreen)
       DragAcceptFiles(hwnd, TRUE);
     }
   }
+#endif
 #endif
 
   return success;
@@ -1177,14 +1198,7 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
        if (draw_border_function != NULL)
          draw_border_function();
 
-#if defined(TARGET_SDL2)
-       // SDL_UpdateWindowSurface(sdl_window);
-       // SDL_UpdateWindowSurfaceRects(sdl_window, &dst_rect2, 1);
        UpdateScreen(&dst_rect2);
-#else
-       // SDL_UpdateRect(surface_screen, dst_x, dst_y, width, height);
-       UpdateScreen(&dst_rect2);
-#endif
       }
     }
   }
@@ -2373,7 +2387,10 @@ void SDLNextEvent(Event *event)
 
 void SDLHandleWindowManagerEvent(Event *event)
 {
+#ifdef DEBUG
 #if defined(PLATFORM_WIN32)
+  // experimental drag and drop code
+
   SDL_SysWMEvent *syswmevent = (SDL_SysWMEvent *)event;
   SDL_SysWMmsg *syswmmsg = (SDL_SysWMmsg *)(syswmevent->msg);
 
@@ -2411,6 +2428,7 @@ void SDLHandleWindowManagerEvent(Event *event)
 #endif
   }
 #endif
+#endif
 }