diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp index 65a6fd39e..d14f83b7c 100644 --- a/src/engine/client/graphics_threaded.cpp +++ b/src/engine/client/graphics_threaded.cpp @@ -21,6 +21,10 @@ #include // 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; diff --git a/src/engine/client/input.cpp b/src/engine/client/input.cpp index d6ed511f6..310c6e852 100644 --- a/src/engine/client/input.cpp +++ b/src/engine/client/input.cpp @@ -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; diff --git a/src/engine/client/video.h b/src/engine/client/video.h index 51569b6d1..d65be0d77 100644 --- a/src/engine/client/video.h +++ b/src/engine/client/video.h @@ -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(); diff --git a/src/engine/shared/video.h b/src/engine/shared/video.h index ba9670c9a..09df5b5b4 100644 --- a/src/engine/shared/video.h +++ b/src/engine/shared/video.h @@ -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;