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.

114 lines
3.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef REPLAYMOVIEMANAGER_H
  5. #define REPLAYMOVIEMANAGER_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "replay/ireplaymoviemanager.h"
  11. #include "replay/shared_defs.h"
  12. #include "genericpersistentmanager.h"
  13. #include "cl_replaymovie.h"
  14. #include "utlvector.h"
  15. //----------------------------------------------------------------------------------------
  16. class IClientReplayHistoryManager;
  17. struct MaterialSystem_Config_t;
  18. //----------------------------------------------------------------------------------------
  19. class CReplayMovieManager : public CGenericPersistentManager< CReplayMovie >,
  20. public IReplayMovieManager
  21. {
  22. typedef CGenericPersistentManager< CReplayMovie > BaseClass;
  23. public:
  24. CReplayMovieManager();
  25. ~CReplayMovieManager();
  26. virtual bool Init();
  27. //
  28. // CBaseThinker
  29. //
  30. virtual float GetNextThinkTime() const;
  31. //
  32. // IReplayMovieManager
  33. //
  34. virtual int GetMovieCount();
  35. virtual void GetMovieList( CUtlLinkedList< IReplayMovie * > &list );
  36. virtual IReplayMovie *GetMovie( ReplayHandle_t hMovie );
  37. virtual IReplayMovie *CreateAndAddMovie( ReplayHandle_t hReplay );
  38. virtual void DeleteMovie( ReplayHandle_t hMovie );
  39. virtual int GetNumMoviesDependentOnReplay( const CReplay *pReplay );
  40. virtual void SetPendingMovie( IReplayMovie *pMovie );
  41. virtual IReplayMovie *GetPendingMovie();
  42. virtual void FlagMovieForFlush( IReplayMovie *pMovie, bool bImmediate );
  43. virtual void GetMoviesAsQueryableItems( CUtlLinkedList< IQueryableReplayItem *, int > &lstMovies );
  44. virtual const char *GetRenderDir() const;
  45. virtual const char *GetRawExportDir() const;
  46. virtual void RenderMovie( RenderMovieParams_t const& params );
  47. virtual void RenderNextMovie();
  48. virtual bool IsRendering() const { return m_bIsRendering; }
  49. virtual bool RenderingCancelled() const { return m_bRenderingCancelled; }
  50. virtual void CompleteRender( bool bSuccess, bool bShowBrowser );
  51. virtual void ClearRenderCancelledFlag();
  52. virtual void CancelRender();
  53. void AddMovie( CReplayMovie *pNewMovie );
  54. CReplayMovie *CastMovie( IReplayMovie *pMovie );
  55. void CacheMovieTitle( const wchar_t *pTitle );
  56. void GetCachedMovieTitleAndClear( wchar_t *pOut, int nBufLength );
  57. RenderMovieParams_t &GetRenderMovieSettings() { return *m_pRenderMovieSettings; }
  58. private:
  59. //
  60. // CGenericPersistentManager
  61. //
  62. virtual const char *GetDebugName() const { return "movie manager"; }
  63. virtual const char *GetIndexFilename() const { return "movies." GENERIC_FILE_EXTENSION; }
  64. virtual CReplayMovie *Create();
  65. virtual const char *GetRelativeIndexPath() const;
  66. virtual int GetVersion() const;
  67. virtual int GetHandleBase() const { return MOVIE_HANDLE_BASE; }
  68. virtual IReplayContext *GetReplayContext() const;
  69. void AddReplayForRender( CReplay *pReplay, int iPerformance );
  70. void SetupVideo( RenderMovieParams_t const &params );
  71. void SetupHighDetailModels();
  72. void SetupHighDetailTextures();
  73. void SetupHighQualityAntialiasing();
  74. void SetupHighQualityFiltering();
  75. void SetupHighQualityShadowDetail();
  76. void SetupHighQualityHDR();
  77. void SetupHighQualityWaterDetail();
  78. void SetupMulticoreRender();
  79. void SetupHighQualityShaderDetail();
  80. void SetupColorCorrection();
  81. void SetupMotionBlur();
  82. wchar_t m_wszCachedMovieTitle[MAX_REPLAY_TITLE_LENGTH];
  83. IReplayMovie *m_pPendingMovie;
  84. MaterialSystem_Config_t *m_pVidModeSettings; // Used to restore video mode settings after render completion
  85. RenderMovieParams_t *m_pRenderMovieSettings;
  86. bool m_bIsRendering;
  87. bool m_bRenderingCancelled;
  88. //
  89. // TODO:
  90. // - date rendered
  91. //
  92. };
  93. //----------------------------------------------------------------------------------------
  94. #endif // REPLAYMOVIEMANAGER_H