mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
fix bug that demo can't play when demo pause and use start_video
This commit is contained in:
parent
fb81000351
commit
3c085b53ed
|
@ -3314,6 +3314,9 @@ void CClient::Con_StartVideo(IConsole::IResult *pResult, void *pUserData)
|
|||
{
|
||||
new CVideo((CGraphics_Threaded*)pSelf->m_pGraphics, pSelf->Storage(), pSelf->m_pConsole, pSelf->Graphics()->ScreenWidth(), pSelf->Graphics()->ScreenHeight(), "");
|
||||
IVideo::Current()->start();
|
||||
bool paused = pSelf->m_DemoPlayer.Info()->m_Info.m_Paused;
|
||||
if(paused)
|
||||
IVideo::Current()->pause(true);
|
||||
}
|
||||
else
|
||||
pSelf->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "videorecorder", "Videorecorder already running.");
|
||||
|
|
|
@ -167,10 +167,10 @@ void CVideo::start()
|
|||
m_vframe = 0;
|
||||
}
|
||||
|
||||
void CVideo::pause()
|
||||
void CVideo::pause(bool p)
|
||||
{
|
||||
if(ms_pCurrentVideo)
|
||||
m_Recording ^= true;
|
||||
m_Recording = !p;
|
||||
}
|
||||
|
||||
void CVideo::stop()
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
|
||||
virtual void start();
|
||||
virtual void stop();
|
||||
virtual void pause();
|
||||
virtual void pause(bool p);
|
||||
|
||||
virtual void nextVideoFrame();
|
||||
virtual void nextVideoFrame_thread();
|
||||
|
|
|
@ -681,7 +681,7 @@ void CDemoPlayer::Pause()
|
|||
m_Info.m_Info.m_Paused = 1;
|
||||
#if defined(CONF_VIDEORECORDER)
|
||||
if(IVideo::Current() && g_Config.m_ClVideoPauseWithDemo)
|
||||
IVideo::Current()->pause();
|
||||
IVideo::Current()->pause(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -695,7 +695,7 @@ void CDemoPlayer::Unpause()
|
|||
}
|
||||
#if defined(CONF_VIDEORECORDER)
|
||||
if(IVideo::Current() && g_Config.m_ClVideoPauseWithDemo)
|
||||
IVideo::Current()->pause();
|
||||
IVideo::Current()->pause(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ public:
|
|||
|
||||
virtual void start() = 0;
|
||||
virtual void stop() = 0;
|
||||
virtual void pause() = 0;
|
||||
virtual void pause(bool p) = 0;
|
||||
|
||||
virtual void nextVideoFrame() = 0;
|
||||
virtual bool frameRendered() = 0;
|
||||
|
|
Loading…
Reference in a new issue