gfx.draw_global_anim_function(DRAW_GLOBAL_ANIM_STAGE_2);
}
-static void UpdateScreen(SDL_Rect *rect)
+static void UpdateScreenExt(SDL_Rect *rect, boolean with_frame_delay)
{
static unsigned int update_screen_delay = 0;
unsigned int update_screen_delay_value = 50; /* (milliseconds) */
#endif
// global synchronization point of the game to align video frame delay
- WaitUntilDelayReached(&video.frame_delay, video.frame_delay_value);
+ if (with_frame_delay)
+ WaitUntilDelayReached(&video.frame_delay, video.frame_delay_value);
#if defined(TARGET_SDL2)
// show render target buffer on screen
#endif
}
+static void UpdateScreen_WithFrameDelay(SDL_Rect *rect)
+{
+ UpdateScreenExt(rect, TRUE);
+}
+
+static void UpdateScreen_WithoutFrameDelay(SDL_Rect *rect)
+{
+ UpdateScreenExt(rect, FALSE);
+}
+
static void SDLSetWindowIcon(char *basename)
{
/* (setting the window icon on Mac OS X would replace the high-quality
void SDLRedrawWindow()
{
- UpdateScreen(NULL);
+ UpdateScreen_WithoutFrameDelay(NULL);
}
#endif
&src_rect, real_dst_bitmap->surface, &dst_rect);
if (dst_bitmap == window)
- UpdateScreen(&dst_rect);
+ UpdateScreen_WithFrameDelay(&dst_rect);
}
void SDLBlitTexture(Bitmap *bitmap,
SDL_FillRect(real_dst_bitmap->surface, &rect, color);
if (dst_bitmap == window)
- UpdateScreen(&rect);
+ UpdateScreen_WithFrameDelay(&rect);
}
void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
if (draw_border_function != NULL)
draw_border_function();
- UpdateScreen(&dst_rect2);
+ UpdateScreen_WithFrameDelay(&dst_rect2);
}
}
}
draw_border_function();
/* only update the region of the screen that is affected from fading */
- UpdateScreen(&dst_rect2);
+ UpdateScreen_WithFrameDelay(&dst_rect2);
}
}
else /* fading in, fading out or cross-fading */
draw_border_function();
/* only update the region of the screen that is affected from fading */
- UpdateScreen(&dst_rect);
+ UpdateScreen_WithFrameDelay(&dst_rect);
}
}
while (time_current < time_post_delay)
{
// updating the screen contains waiting for frame delay (non-busy)
- UpdateScreen(NULL);
+ UpdateScreen_WithFrameDelay(NULL);
time_current = SDL_GetTicks();
}