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/common/screenshot.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'replay/common/screenshot.cpp')
| -rw-r--r-- | replay/common/screenshot.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/replay/common/screenshot.cpp b/replay/common/screenshot.cpp new file mode 100644 index 0000000..8a0004b --- /dev/null +++ b/replay/common/screenshot.cpp @@ -0,0 +1,42 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +//=======================================================================================// + +#include "replay/screenshot.h" +#include "replay/replayutils.h" +#include "replay/iclientreplaycontext.h" +#include "KeyValues.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +//---------------------------------------------------------------------------------------- + +bool CReplayScreenshot::Read( KeyValues *pIn ) +{ + m_nWidth = pIn->GetInt( "w" ); + m_nHeight = pIn->GetInt( "h" ); + V_strcpy_safe( m_szBaseFilename, pIn->GetString( "file", "" ) ); + + return true; +} + +void CReplayScreenshot::Write( KeyValues *pOut ) +{ + pOut->SetInt( "w", m_nWidth ); + pOut->SetInt( "h", m_nHeight ); + pOut->SetString( "file", m_szBaseFilename ); +} + +const char *CReplayScreenshot::GetSubKeyTitle() const +{ + return m_szBaseFilename; +} + +const char *CReplayScreenshot::GetPath() const +{ + extern IClientReplayContext *g_pClientReplayContext; + return Replay_va( "%s%s%c", g_pClientReplayContext->GetBaseDir(), SUBDIR_SCREENSHOTS, CORRECT_PATH_SEPARATOR ); +} + +//----------------------------------------------------------------------------------------
\ No newline at end of file |