1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

video & audio correction; win/lose

This commit is contained in:
Laserlicht
2023-09-22 21:45:12 +02:00
committed by GitHub
parent a4cb74f0dc
commit 30c6cf3b98
6 changed files with 51 additions and 17 deletions

View File

@@ -349,7 +349,7 @@ void CVideoPlayer::redraw( int x, int y, SDL_Surface *dst, bool update )
show(x, y, dst, update);
}
void CVideoPlayer::update( int x, int y, SDL_Surface *dst, bool forceRedraw, bool update )
void CVideoPlayer::update( int x, int y, SDL_Surface *dst, bool forceRedraw, bool update, std::function<void()> restart)
{
if (sws == nullptr)
return;
@@ -368,6 +368,8 @@ void CVideoPlayer::update( int x, int y, SDL_Surface *dst, bool forceRedraw, boo
show(x,y,dst,update);
else
{
if(restart)
restart();
VideoPath filenameToReopen = fname; // create copy to backup this->fname
open(filenameToReopen);
nextFrame();