prepared global animation functions to update different screen buffers
authorHolger Schemel <info@artsoft.org>
Mon, 23 May 2016 23:49:03 +0000 (01:49 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 23 May 2016 23:49:03 +0000 (01:49 +0200)
src/anim.c
src/anim.h
src/libgame/sdl.c
src/libgame/system.c
src/libgame/system.h

index 7dc621986b5e5f9fdd7138a58296697946796f1b..7f1670708cf2693fc3f0deb5d98858b6c6f656fd 100644 (file)
@@ -517,7 +517,7 @@ void InitGlobalAnimations()
   InitGlobalAnimControls();
 }
 
-void DrawGlobalAnimationsExt(int drawing_stage)
+void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage)
 {
   int mode_nr;
 
@@ -671,9 +671,9 @@ void DrawGlobalAnimationsExt(int drawing_stage)
   }
 }
 
-void DrawGlobalAnimations(int drawing_stage)
+void DrawGlobalAnimations(int drawing_target, int drawing_stage)
 {
-  DrawGlobalAnimationsExt(drawing_stage);
+  DrawGlobalAnimationsExt(drawing_target, drawing_stage);
 }
 
 boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part)
index b55a550fe8486d6bb169c37e6b008f54a5944a96..99de93ea660bff57a7f5125e4e25bfdcfdf280b4 100644 (file)
@@ -16,6 +16,6 @@
 int getAnimationFrame(int, int, int, int, int);
 
 void InitGlobalAnimations(void);
-void DrawGlobalAnimations(int);
+void DrawGlobalAnimations(int, int);
 
 #endif
index 4546e67d07dd175d3753bbdf1d324480c26ca52f..a88201fde27fb1ea3ea29dcbe34a8e633cd8cc42 100644 (file)
@@ -42,19 +42,19 @@ void SDLLimitScreenUpdates(boolean enable)
   limit_screen_updates = enable;
 }
 
-static void FinalizeScreen()
+static void FinalizeScreen(int draw_target)
 {
   // copy global animations to render target buffer, if defined (below border)
   if (gfx.draw_global_anim_function != NULL)
-    gfx.draw_global_anim_function(DRAW_GLOBAL_ANIM_STAGE_1);
+    gfx.draw_global_anim_function(draw_target, DRAW_GLOBAL_ANIM_STAGE_1);
 
   // copy global masked border to render target buffer, if defined
   if (gfx.draw_global_border_function != NULL)
-    gfx.draw_global_border_function(DRAW_TO_SCREEN);
+    gfx.draw_global_border_function(draw_target);
 
   // copy global animations to render target buffer, if defined (above border)
   if (gfx.draw_global_anim_function != NULL)
-    gfx.draw_global_anim_function(DRAW_GLOBAL_ANIM_STAGE_2);
+    gfx.draw_global_anim_function(draw_target, DRAW_GLOBAL_ANIM_STAGE_2);
 }
 
 static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay)
@@ -95,7 +95,7 @@ static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay)
     BlitBitmap(backbuffer, gfx.final_screen_bitmap, 0, 0,
               gfx.win_xsize, gfx.win_ysize, 0, 0);
 
-    FinalizeScreen();
+    FinalizeScreen(DRAW_TO_SCREEN);
 
     screen = gfx.final_screen_bitmap->surface;
 
@@ -142,7 +142,7 @@ static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay)
     SDL_RenderCopy(sdl_renderer, sdl_texture_stream, NULL, NULL);
 
   if (video.screen_rendering_mode != SPECIAL_RENDERING_BITMAP)
-    FinalizeScreen();
+    FinalizeScreen(DRAW_TO_SCREEN);
 
   // when using target texture, copy it to screen buffer
   if (video.screen_rendering_mode == SPECIAL_RENDERING_TARGET ||
index a5ebc4f05e2a5fd05e39986a918fb74b05892427..8b81ede9deef4db5b27ba81e47f74847b31d51d2 100644 (file)
@@ -241,7 +241,7 @@ void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void))
   gfx.draw_busy_anim_function = draw_busy_anim_function;
 }
 
-void InitGfxDrawGlobalAnimFunction(void (*draw_global_anim_function)(int))
+void InitGfxDrawGlobalAnimFunction(void (*draw_global_anim_function)(int, int))
 {
   gfx.draw_global_anim_function = draw_global_anim_function;
 }
index b7da38b53adcd21081a749a56c6609c8d36ddf37..151f83555d4dbfcf11e954b0956729ac2b712d8f 100644 (file)
@@ -865,7 +865,7 @@ struct GfxInfo
   int anim_random_frame;
 
   void (*draw_busy_anim_function)(void);
-  void (*draw_global_anim_function)(int);
+  void (*draw_global_anim_function)(int, int);
   void (*draw_global_border_function)(int);
 
   int cursor_mode;
@@ -1366,7 +1366,7 @@ void InitGfxWindowInfo(int, int);
 void InitGfxScrollbufferInfo(int, int);
 void InitGfxClipRegion(boolean, int, int, int, int);
 void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void));
-void InitGfxDrawGlobalAnimFunction(void (*draw_global_anim_function)(int));
+void InitGfxDrawGlobalAnimFunction(void (*draw_global_anim_function)(int, int));
 void InitGfxDrawGlobalBorderFunction(void (*draw_global_border_function)(int));
 void InitGfxCustomArtworkInfo();
 void InitGfxOtherSettings();