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.

72 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef SCREENSHOT_H
  5. #define SCREENSHOT_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "replay/basereplayserializeable.h"
  11. #include "mathlib/vector.h"
  12. #include "qlimits.h"
  13. #include "strtools.h"
  14. //----------------------------------------------------------------------------------------
  15. #define SUBDIR_SCREENSHOTS "screenshots"
  16. //----------------------------------------------------------------------------------------
  17. class CReplayScreenshot : public CBaseReplaySerializeable
  18. {
  19. public:
  20. inline CReplayScreenshot( int nWidth = 0, int nHeight = 0, const char *pBaseFilename = NULL )
  21. : m_nWidth( nWidth ), m_nHeight( nHeight )
  22. {
  23. if ( pBaseFilename )
  24. {
  25. V_strncpy( m_szBaseFilename, pBaseFilename, sizeof( m_szBaseFilename ) );
  26. }
  27. }
  28. virtual bool Read( KeyValues *pIn );
  29. virtual void Write( KeyValues *pOut );
  30. virtual const char *GetSubKeyTitle() const;
  31. virtual const char *GetPath() const;
  32. int m_nWidth; // Screenshot width (does not include power-of-2 padding)
  33. int m_nHeight; // Screenshot height (does not include power-of-2 padding)
  34. char m_szBaseFilename[ MAX_OSPATH ];
  35. };
  36. //----------------------------------------------------------------------------------------
  37. struct CaptureScreenshotParams_t // To be passed from the client into IReplayHistoryManager::CaptureScreenshot()
  38. {
  39. float m_flDelay; // Delay from now (in seconds) when we will take the screenshot
  40. int m_nEntity; // Should be 0 if no camera adjustment is needed, otherwise should be the index of the entity index from which m_posCamera will be based
  41. Vector m_posCamera; // Local position, relative to entity's index (if m_nEntity > 0) for camera position
  42. QAngle m_angCamera; // World angles of camera - used if m_bUseCameraAngles is true
  43. bool m_bUseCameraAngles; // Should we use m_angCamera - m_nEntity can't be 0
  44. bool m_bIgnoreMinTimeBetweenScreenshots; // Force screenshot, regardless of replay_mintimebetweenscreenshots?
  45. bool m_bPrimary; // Only set to true for the primary screenshot, which is taken when the user saves their replay
  46. };
  47. //----------------------------------------------------------------------------------------
  48. struct WriteReplayScreenshotParams_t // Passed from the engine into the client to take a screenshot
  49. {
  50. const char *m_pFilename;
  51. int m_nWidth;
  52. int m_nHeight;
  53. Vector *m_pOrigin; // Perspective origin from which to render. Can be NULL
  54. QAngle *m_pAngles; // Perspective angles from which to render. Can be NULL
  55. };
  56. //----------------------------------------------------------------------------------------
  57. #endif // SCREENSHOT_H