Skip to content

Commit

Permalink
Engine: clear screen after video only if respective flag is set
Browse files Browse the repository at this point in the history
This fixes a black "flash" occuring right after the OGV playback.
  • Loading branch information
ivan-mogilko committed Oct 10, 2023
1 parent a77393a commit 882e185
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Engine/media/video/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,12 +548,15 @@ static void video_run(std::unique_ptr<VideoPlayer> video, int flags, VideoSkipTy

// Clear the screen after stopping playback
// TODO: needed for FLIC, but perhaps may be done differently
if (gfxDriver->UsesMemoryBackBuffer())
if ((flags & kVideo_ClearScreen) != 0)
{
Bitmap *screen_bmp = gfxDriver->GetMemoryBackBuffer();
screen_bmp->Clear();
if (gfxDriver->UsesMemoryBackBuffer())
{
Bitmap *screen_bmp = gfxDriver->GetMemoryBackBuffer();
screen_bmp->Clear();
}
render_to_screen();
}
render_to_screen();

invalidate_screen();
ags_clear_input_state();
Expand Down

0 comments on commit 882e185

Please sign in to comment.