mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
add option to pause video rendering when demo playing pause
This commit is contained in:
parent
b704ef299c
commit
b5c931279f
|
@ -167,6 +167,12 @@ void CVideo::start()
|
||||||
m_vframe = 0;
|
m_vframe = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CVideo::pause()
|
||||||
|
{
|
||||||
|
if(ms_pCurrentVideo)
|
||||||
|
m_Recording ^= true;
|
||||||
|
}
|
||||||
|
|
||||||
void CVideo::stop()
|
void CVideo::stop()
|
||||||
{
|
{
|
||||||
m_Recording = false;
|
m_Recording = false;
|
||||||
|
|
|
@ -59,6 +59,7 @@ public:
|
||||||
|
|
||||||
virtual void start();
|
virtual void start();
|
||||||
virtual void stop();
|
virtual void stop();
|
||||||
|
virtual void pause();
|
||||||
|
|
||||||
virtual void nextVideoFrame();
|
virtual void nextVideoFrame();
|
||||||
virtual void nextVideoFrame_thread();
|
virtual void nextVideoFrame_thread();
|
||||||
|
|
|
@ -677,6 +677,8 @@ void CDemoPlayer::DoTick()
|
||||||
void CDemoPlayer::Pause()
|
void CDemoPlayer::Pause()
|
||||||
{
|
{
|
||||||
m_Info.m_Info.m_Paused = 1;
|
m_Info.m_Info.m_Paused = 1;
|
||||||
|
if(IVideo::Current() && g_Config.m_ClVideoPauseWithDemo)
|
||||||
|
IVideo::Current()->pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDemoPlayer::Unpause()
|
void CDemoPlayer::Unpause()
|
||||||
|
@ -687,6 +689,8 @@ void CDemoPlayer::Unpause()
|
||||||
m_Info.start_time = time_get();*/
|
m_Info.start_time = time_get();*/
|
||||||
m_Info.m_Info.m_Paused = 0;
|
m_Info.m_Info.m_Paused = 0;
|
||||||
}
|
}
|
||||||
|
if(IVideo::Current() && g_Config.m_ClVideoPauseWithDemo)
|
||||||
|
IVideo::Current()->pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
int CDemoPlayer::Load(class IStorage *pStorage, class IConsole *pConsole, const char *pFilename, int StorageType)
|
int CDemoPlayer::Load(class IStorage *pStorage, class IConsole *pConsole, const char *pFilename, int StorageType)
|
||||||
|
|
|
@ -10,6 +10,7 @@ public:
|
||||||
|
|
||||||
virtual void start() = 0;
|
virtual void start() = 0;
|
||||||
virtual void stop() = 0;
|
virtual void stop() = 0;
|
||||||
|
virtual void pause() = 0;
|
||||||
|
|
||||||
virtual void nextVideoFrame() = 0;
|
virtual void nextVideoFrame() = 0;
|
||||||
virtual bool frameRendered() = 0;
|
virtual bool frameRendered() = 0;
|
||||||
|
|
|
@ -165,6 +165,7 @@ MACRO_CONFIG_INT(SvRescue, sv_rescue, 0, 0, 1, CFGFLAG_SERVER, "Allow /rescue co
|
||||||
MACRO_CONFIG_INT(SvRescueDelay, sv_rescue_delay, 5, 0, 1000, CFGFLAG_SERVER, "Number of seconds between two rescues")
|
MACRO_CONFIG_INT(SvRescueDelay, sv_rescue_delay, 5, 0, 1000, CFGFLAG_SERVER, "Number of seconds between two rescues")
|
||||||
|
|
||||||
#if defined(CONF_VIDEORECORDER)
|
#if defined(CONF_VIDEORECORDER)
|
||||||
|
MACRO_CONFIG_INT(ClVideoPauseWithDemo, cl_video_pausewithdemo, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Pause video rendering when demo playing pause")
|
||||||
MACRO_CONFIG_INT(ClVideoShowhud, cl_video_showhud, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD when rendering video")
|
MACRO_CONFIG_INT(ClVideoShowhud, cl_video_showhud, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD when rendering video")
|
||||||
MACRO_CONFIG_INT(ClVideoShowChat, cl_video_showchat, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show chat when rendering video")
|
MACRO_CONFIG_INT(ClVideoShowChat, cl_video_showchat, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show chat when rendering video")
|
||||||
MACRO_CONFIG_INT(ClVideoSndEnable, cl_video_sound_enable, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Use sound when rendering video")
|
MACRO_CONFIG_INT(ClVideoSndEnable, cl_video_sound_enable, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Use sound when rendering video")
|
||||||
|
|
Loading…
Reference in a new issue