diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /replay/cl_screenshotmanager.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'replay/cl_screenshotmanager.h')
| -rw-r--r-- | replay/cl_screenshotmanager.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/replay/cl_screenshotmanager.h b/replay/cl_screenshotmanager.h new file mode 100644 index 0000000..536a3a8 --- /dev/null +++ b/replay/cl_screenshotmanager.h @@ -0,0 +1,66 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +//=======================================================================================// + +#ifndef CL_SCREENSHOTMANAGER_H +#define CL_SCREENSHOTMANAGER_H +#ifdef _WIN32 +#pragma once +#endif + +//---------------------------------------------------------------------------------------- + +#include "basethinker.h" +#include "replay/ireplayscreenshotmanager.h" +#include "replay/screenshot.h" + +//---------------------------------------------------------------------------------------- + +class CReplay; + +//---------------------------------------------------------------------------------------- + +class CScreenshotManager : public CBaseThinker, + public IReplayScreenshotManager +{ +public: + CScreenshotManager(); + ~CScreenshotManager(); + + bool Init(); + + bool ShouldCaptureScreenshot(); + void DoCaptureScreenshot(); + + void SetScreenshotReplay( ReplayHandle_t hReplay ); + ReplayHandle_t GetScreenshotReplay() const { return m_hScreenshotReplay; } + + // + // IReplayScreenshotManager + // + virtual void CaptureScreenshot( CaptureScreenshotParams_t& params ); + virtual void GetUnpaddedScreenshotSize( int &nOutWidth, int &nOutHeight ); + virtual void DeleteScreenshotsForReplay( CReplay *pReplay ); + +private: + // + // CBaseThinker + // + void Think(); + float GetNextThinkTime() const; + + float m_flScreenshotCaptureTime; + CaptureScreenshotParams_t m_screenshotParams; // Params for next scheduled screenshot + int m_aScreenshotWidths[3][2]; // [ 16:9, 16:10, 4:3 ][ lo res, hi res ] + + ReplayHandle_t m_hScreenshotReplay; // Destination replay for any screenshots taken - we always write to the "pending" + // replay for the most part, but if we want to take a screenshot after the local + // player is dead, we need to use a handle rather than using m_pPendingReplay directly, + // since it becomes NULL when the player dies. + float m_flLastScreenshotTime; + int m_nPrevScreenDims[2]; // Screenshot dimensions, used to determine if we should update the screenshot cache on the client +}; + +//---------------------------------------------------------------------------------------- + +#endif // CL_SCREENSHOTMANAGER_H |