Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #include "replay/screenshot.h"
  5. #include "replay/replayutils.h"
  6. #include "replay/iclientreplaycontext.h"
  7. #include "KeyValues.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. //----------------------------------------------------------------------------------------
  11. bool CReplayScreenshot::Read( KeyValues *pIn )
  12. {
  13. m_nWidth = pIn->GetInt( "w" );
  14. m_nHeight = pIn->GetInt( "h" );
  15. V_strcpy_safe( m_szBaseFilename, pIn->GetString( "file", "" ) );
  16. return true;
  17. }
  18. void CReplayScreenshot::Write( KeyValues *pOut )
  19. {
  20. pOut->SetInt( "w", m_nWidth );
  21. pOut->SetInt( "h", m_nHeight );
  22. pOut->SetString( "file", m_szBaseFilename );
  23. }
  24. const char *CReplayScreenshot::GetSubKeyTitle() const
  25. {
  26. return m_szBaseFilename;
  27. }
  28. const char *CReplayScreenshot::GetPath() const
  29. {
  30. extern IClientReplayContext *g_pClientReplayContext;
  31. return Replay_va( "%s%s%c", g_pClientReplayContext->GetBaseDir(), SUBDIR_SCREENSHOTS, CORRECT_PATH_SEPARATOR );
  32. }
  33. //----------------------------------------------------------------------------------------