Only forbid resizing when videorecorder is recording

This commit is contained in:
def 2020-06-19 08:19:40 +02:00
parent 7d428676e2
commit 47e6c7cce2
4 changed files with 12 additions and 3 deletions

View file

@ -21,6 +21,10 @@
#include <math.h> // cosf, sinf, log2f
#if defined(CONF_VIDEORECORDER)
#include "video.h"
#endif
#include "graphics_threaded.h"
static CVideoMode g_aFakeModes[] = {
@ -2050,9 +2054,7 @@ int CGraphics_Threaded::IssueInit()
if(g_Config.m_GfxFullscreen) Flags |= IGraphicsBackend::INITFLAG_FULLSCREEN;
if(g_Config.m_GfxVsync) Flags |= IGraphicsBackend::INITFLAG_VSYNC;
if(g_Config.m_GfxHighdpi) Flags |= IGraphicsBackend::INITFLAG_HIGHDPI;
#ifndef CONF_VIDEORECORDER
if(g_Config.m_GfxResizable) Flags |= IGraphicsBackend::INITFLAG_RESIZABLE;
#endif
int r = m_pBackend->Init("DDNet Client", &g_Config.m_GfxScreen, &g_Config.m_GfxScreenWidth, &g_Config.m_GfxScreenHeight, g_Config.m_GfxFsaaSamples, Flags, &m_DesktopScreenWidth, &m_DesktopScreenHeight, &m_ScreenWidth, &m_ScreenHeight, m_pStorage);
m_UseOpenGL3_3 = m_pBackend->IsOpenGL3_3();
@ -2186,6 +2188,11 @@ bool CGraphics_Threaded::SetWindowScreen(int Index)
void CGraphics_Threaded::Resize(int w, int h)
{
#if defined(CONF_VIDEORECORDER)
if (IVideo::Current() && IVideo::Current()->isRecording())
return;
#endif
if(m_ScreenWidth == w && m_ScreenHeight == h)
return;

View file

@ -281,7 +281,7 @@ int CInput::Update()
switch (Event.window.event)
{
case SDL_WINDOWEVENT_RESIZED:
#if defined(SDL_VIDEO_DRIVER_X11) && !defined(CONF_VIDEORECORDER)
#if defined(SDL_VIDEO_DRIVER_X11)
Graphics()->Resize(Event.window.data1, Event.window.data2);
#endif
break;

View file

@ -60,6 +60,7 @@ public:
virtual void start();
virtual void stop();
virtual void pause(bool p);
virtual bool isRecording() { return m_Recording; }
virtual void nextVideoFrame();
virtual void nextVideoFrame_thread();

View file

@ -11,6 +11,7 @@ public:
virtual void start() = 0;
virtual void stop() = 0;
virtual void pause(bool p) = 0;
virtual bool isRecording() = 0;
virtual void nextVideoFrame() = 0;
virtual bool frameRendered() = 0;