savegame.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Commando *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/savegame.h $*
  25. * *
  26. * $Author:: Patrick $*
  27. * *
  28. * $Modtime:: 11/02/01 2:19p $*
  29. * *
  30. * $Revision:: 8 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef SAVEGAME_H
  36. #define SAVEGAME_H
  37. #include "always.h"
  38. #include "wwstring.h"
  39. #include "widestring.h"
  40. /*
  41. **
  42. */
  43. class SaveGameManager {
  44. public:
  45. // Map filename (LSD) access
  46. static void Set_Map_Filename( const char * filename ) { MapFilename = filename; }
  47. static const char * Get_Map_Filename( void ) { return MapFilename; }
  48. // Description access
  49. static void Set_Description( const WCHAR * text ) { Description = text; }
  50. static const WCHAR * Get_Description( void ) { return Description; }
  51. // Mission description access
  52. static int Get_Mission_Description_ID( void ) { return MissionDescriptionID; }
  53. static void Set_Mission_Description_ID( int id ) { MissionDescriptionID = id; }
  54. // Utility functions
  55. static bool Smart_Peek_Description( const char *filename, WideStringClass &description, WideStringClass &mission_name );
  56. static bool Smart_Peek_Map_Name( const char * filename, StringClass &map_name );
  57. static bool Peek_Description( const char *filename, WideStringClass &description, WideStringClass &mission_name );
  58. static bool Peek_Map_Name( const char * filename, StringClass &map_name );
  59. // LDD Access - Editor only calls Save_Game, App calls both
  60. static void _cdecl Save_Game( const char * filename, ... );
  61. static void Load_Game( const char * filename );
  62. static void Pre_Load_Game( const char * filename, StringClass &filename_to_load, StringClass &lsd_filename );
  63. static const char * Get_Current_Game_Filename( void ) { return CurrentGameFilename; }
  64. // LSD Access - Editor only calls Save_Level, App only calls Load_Level
  65. static void Save_Level( void );
  66. static void Load_Level( void );
  67. // DDB Access - Editor only calls Save_Level, App only calls Load_Level
  68. static void Save_Definitions( const char * filename = DefaultDefinitionFilename );
  69. static void Load_Definitions( const char * filename = DefaultDefinitionFilename );
  70. // Generic SaveLoadSubSystem Access
  71. static void Load_Save_Load_System( const char * filename, bool auto_post_load );
  72. static void _cdecl Save_Save_Load_System( const char * filename, ... );
  73. protected:
  74. static StringClass MapFilename;
  75. static StringClass CurrentGameFilename;
  76. static WideStringClass Description;
  77. static int MissionDescriptionID;
  78. static const char * DefaultDefinitionFilename;
  79. };
  80. #endif // SAVEGAME_H