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.

70 lines
2.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #if !defined( HOST_SAVERESTORE_H )
  10. #define HOST_SAVERESTORE_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. class CSaveRestoreData;
  15. abstract_class ISaveRestore
  16. {
  17. public:
  18. virtual void Init( void ) = 0;
  19. virtual void Shutdown( void ) = 0;
  20. virtual void OnFrameRendered() = 0;
  21. virtual bool SaveFileExists( const char *pName ) = 0;
  22. virtual bool LoadGame( const char *pName ) = 0;
  23. virtual char *GetSaveDir(void) = 0;
  24. virtual void ClearSaveDir( void ) = 0;
  25. virtual void RequestClearSaveDir( void ) = 0;
  26. virtual int LoadGameState( char const *level, bool createPlayers ) = 0;
  27. virtual void LoadAdjacentEnts( const char *pOldLevel, const char *pLandmarkName ) = 0;
  28. virtual const char *FindRecentSave( char *pNameBuf, int nameBufLen ) = 0;
  29. virtual void ForgetRecentSave() = 0;
  30. virtual int SaveGameSlot( const char *pSaveName, const char *pSaveComment, bool onlyThisLevel = false, bool bSetMostRecent = true, const char *pszDestMap = NULL, const char *pszLandmark = NULL ) = 0;
  31. virtual bool SaveGameState( bool bTransition, CSaveRestoreData ** = NULL, bool bOpenContainer = true, bool bIsAutosaveOrDangerous = false ) = 0;
  32. virtual int IsValidSave( void ) = 0;
  33. virtual void Finish( CSaveRestoreData *save ) = 0;
  34. virtual void RestoreClientState( char const *fileName, bool adjacent ) = 0;
  35. virtual void RestoreAdjacenClientState( char const *map ) = 0;
  36. virtual int SaveReadNameAndComment( FileHandle_t f, OUT_Z_CAP(nameSize) char *name, int nameSize, OUT_Z_CAP(commentSize) char *comment, int commentSize ) = 0;
  37. virtual int GetMostRecentElapsedMinutes( void ) = 0;
  38. virtual int GetMostRecentElapsedSeconds( void ) = 0;
  39. virtual int GetMostRecentElapsedTimeSet( void ) = 0;
  40. virtual void SetMostRecentElapsedMinutes( const int min ) = 0;
  41. virtual void SetMostRecentElapsedSeconds( const int sec ) = 0;
  42. virtual void UpdateSaveGameScreenshots() = 0;
  43. virtual void OnFinishedClientRestore() = 0;
  44. virtual void AutoSaveDangerousIsSafe() = 0;
  45. virtual char const *GetMostRecentlyLoadedFileName() = 0;
  46. virtual char const *GetSaveFileName() = 0;
  47. virtual bool IsXSave( void ) = 0;
  48. virtual void SetIsXSave( bool bState ) = 0;
  49. virtual void FinishAsyncSave() = 0;
  50. virtual bool StorageDeviceValid() = 0;
  51. virtual void SetMostRecentSaveGame( const char *lpszFilename ) = 0;
  52. virtual bool IsSaveInProgress() = 0;
  53. };
  54. void *SaveAllocMemory( size_t num, size_t size, bool bClear = false );
  55. void SaveFreeMemory( void *pSaveMem );
  56. extern ISaveRestore *saverestore;
  57. #endif // HOST_SAVERESTORE_H