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 /game/client/replay/replayrenderer.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/replay/replayrenderer.h')
| -rw-r--r-- | game/client/replay/replayrenderer.h | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/game/client/replay/replayrenderer.h b/game/client/replay/replayrenderer.h new file mode 100644 index 0000000..5c2a530 --- /dev/null +++ b/game/client/replay/replayrenderer.h @@ -0,0 +1,111 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +//=======================================================================================// + +#ifndef REPLAYRENDERER_H +#define REPLAYRENDERER_H +#ifdef _WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------- + +#include "replay/ireplaymovierenderer.h" +#include "replay/rendermovieparams.h" +#include "movieobjects/timeutils.h" +#include "fmtstr.h" + +//----------------------------------------------------------------------------- + +class CReplay; +class CReplayPerformance; +class IQuickTimeMovieMaker; +class CReplayRenderOverlay; +class IVideoRecorder; + +//----------------------------------------------------------------------------- + +class CReplayRenderer : public IReplayMovieRenderer +{ +public: + CReplayRenderer( CReplayRenderOverlay *pOverlay ); + ~CReplayRenderer(); + + const CReplayPerformance *GetPerformance() const; + const char *GetMovieFilename() const; + static int GetNumMotionBlurTimeSteps( int nQuality ); + + // + // IReplayMovieRenderer interface + // + virtual bool SetupRenderer( RenderMovieParams_t ¶ms, IReplayMovie *pMovie ); + virtual void ShutdownRenderer(); + virtual void RenderVideo(); + virtual void RenderAudio( unsigned char *pBuffer, int nSize, int nNumSamples ); + + virtual void SetAudioSyncFrame( bool isSync = false ); + virtual bool IsAudioSyncFrame(); + virtual float GetRecordingFrameDuration(); + + +private: + bool IsDepthOfFieldEnabled() const; + bool IsAntialiasingEnabled() const; + bool IsHDR() const; + bool IsMotionBlurEnabled() const; + int GetMotionBlurQuality() const; + int GetDepthOfFieldQuality() const; + int NumMotionBlurTimeSteps() const; + float GetFramerate() const; + void ComputeSampleCounts( int *pNSamplesPerTimeStep, int *pNTotalSamples ) const; + float GetViewModelFOVOffset(); + void SetupDOFMatrixSkewView( const Vector &pos, const QAngle &angles, int nSample, CViewSetup& viewSetup ); + void BeginRenderingSample( int nSample, int x, int y, int nWidth, int nHeight, float fTonemapScale ); + void EndRendering(); + void SetupSampleView( int x, int y, int w, int h, int nSample, CViewSetup& viewSetup ); + void InitBuffers( const RenderMovieParams_t ¶ms ); + void DrawResolvingQuad( int nWidth, int nHeight ); + float GetRenderLength( const CReplay *pReplay ); + void CompositeAndLayoffFrame( int nFrame ); + void RenderLayoffFrame( DmeTime_t time, int nCurSample, int nNumTotalSamples ); + void ResolveSamples( int nSample, DmeTime_t frametime, int x, int y, int nWidth, int nHeight, bool bShowUser, float flBloomScale ); + void LayoffFrame( int nFrame ); + double GetShutterSpeed() const; + void ClearToBlack( CTextureReference &buf, int x, int y, int nWidth, int nHeight ); + bool SetupJitterTable(); + void GetViewSetup( CViewSetup &viewsetup ); + + bool m_bIsAudioSyncFrame; + + const Vector2D *m_pJitterTable; + int m_nNumJitterSamples; + IVideoRecorder *m_pMovieMaker; + bool m_bCacheFullSceneState; + BGRA8888_t *m_pLayoffBuf; + IReplayMovie *m_pMovie; + RenderMovieParams_t m_RenderParams; + CTextureReference m_AccumBuffSample; + CTextureReference m_LayoffResult; + CTextureReference m_AccumBuffPingPong[2]; // Buffers and materials for ping-pong accumulation buffer + CMaterialReference m_FourSampleResolveMatRef; + bool m_bForceCheapDoF; + bool m_bShutterClosed; + int m_nCurrentPingPong; + int m_nFrame; + + ConVar *m_pViewmodelFov; + ConVar *m_pDefaultFov; + + int m_nTimeStep; + int m_nCurSample; + DmeTime_t m_curSampleTime; + + int m_iTgaFrame; + CFmtStr m_fmtTgaRenderDirName; + + CReplayRenderOverlay *m_pRenderOverlay; +}; + +//----------------------------------------------------------------------------- + +#endif // REPLAYRENDERER_H |