aboutsummaryrefslogtreecommitdiff
path: root/mp/src/common/replay/screenshot.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/common/replay/screenshot.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/common/replay/screenshot.h')
-rw-r--r--mp/src/common/replay/screenshot.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/mp/src/common/replay/screenshot.h b/mp/src/common/replay/screenshot.h
new file mode 100644
index 00000000..b6126e95
--- /dev/null
+++ b/mp/src/common/replay/screenshot.h
@@ -0,0 +1,72 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//=======================================================================================//
+
+#ifndef SCREENSHOT_H
+#define SCREENSHOT_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+//----------------------------------------------------------------------------------------
+
+#include "replay/basereplayserializeable.h"
+#include "mathlib/vector.h"
+#include "qlimits.h"
+#include "strtools.h"
+
+//----------------------------------------------------------------------------------------
+
+#define SUBDIR_SCREENSHOTS "screenshots"
+
+//----------------------------------------------------------------------------------------
+
+class CReplayScreenshot : public CBaseReplaySerializeable
+{
+public:
+ inline CReplayScreenshot( int nWidth = 0, int nHeight = 0, const char *pBaseFilename = NULL )
+ : m_nWidth( nWidth ), m_nHeight( nHeight )
+ {
+ if ( pBaseFilename )
+ {
+ V_strncpy( m_szBaseFilename, pBaseFilename, sizeof( m_szBaseFilename ) );
+ }
+ }
+
+ virtual bool Read( KeyValues *pIn );
+ virtual void Write( KeyValues *pOut );
+ virtual const char *GetSubKeyTitle() const;
+ virtual const char *GetPath() const;
+
+ int m_nWidth; // Screenshot width (does not include power-of-2 padding)
+ int m_nHeight; // Screenshot height (does not include power-of-2 padding)
+ char m_szBaseFilename[ MAX_OSPATH ];
+};
+
+//----------------------------------------------------------------------------------------
+
+struct CaptureScreenshotParams_t // To be passed from the client into IReplayHistoryManager::CaptureScreenshot()
+{
+ float m_flDelay; // Delay from now (in seconds) when we will take the screenshot
+ 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
+ Vector m_posCamera; // Local position, relative to entity's index (if m_nEntity > 0) for camera position
+ QAngle m_angCamera; // World angles of camera - used if m_bUseCameraAngles is true
+ bool m_bUseCameraAngles; // Should we use m_angCamera - m_nEntity can't be 0
+ bool m_bIgnoreMinTimeBetweenScreenshots; // Force screenshot, regardless of replay_mintimebetweenscreenshots?
+ bool m_bPrimary; // Only set to true for the primary screenshot, which is taken when the user saves their replay
+};
+
+//----------------------------------------------------------------------------------------
+
+struct WriteReplayScreenshotParams_t // Passed from the engine into the client to take a screenshot
+{
+ const char *m_pFilename;
+ int m_nWidth;
+ int m_nHeight;
+ Vector *m_pOrigin; // Perspective origin from which to render. Can be NULL
+ QAngle *m_pAngles; // Perspective angles from which to render. Can be NULL
+};
+
+//----------------------------------------------------------------------------------------
+
+#endif // SCREENSHOT_H