physstaticsavesystem.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : WWPhys *
  23. * *
  24. * $Archive:: /Commando/Code/wwphys/physstaticsavesystem.h $*
  25. * *
  26. * Author:: Greg Hjelstrom *
  27. * *
  28. * $Modtime:: 11/02/00 6:20p $*
  29. * *
  30. * $Revision:: 5 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef PHYSSTATICSAVESYSTEM_H
  39. #define PHYSSTATICSAVESYSTEM_H
  40. #include "always.h"
  41. #include "saveloadsubsystem.h"
  42. /**
  43. **
  44. ** PhysStaticDataSaveSystemClass
  45. ** This SaveLoadSubSystem handles saving the static "frame-work" of the physics scene.
  46. ** The "framework" for the scene is all of the pre-calculated static data like visibility
  47. ** tables and culling systems that the physics scene contains. This data is saved through
  48. ** a separate sub-system in order to allow our Editor to save it without also saving the
  49. ** static objects which exist inside the "framework". The editor normally doesn't save the
  50. ** objects in the physics scene since it re-creates them from their "definitions" each
  51. ** time a level is loaded into it. However, this data (visibility, pathfinding...) is too
  52. ** expensive to simply re-create each time so we put it into a separate sub-system that it
  53. ** can save.
  54. **
  55. */
  56. class PhysStaticDataSaveSystemClass : public SaveLoadSubSystemClass
  57. {
  58. public:
  59. virtual uint32 Chunk_ID (void) const;
  60. protected:
  61. virtual bool Save (ChunkSaveClass &csave);
  62. virtual bool Load (ChunkLoadClass &cload);
  63. virtual const char* Name() const { return "PhysStaticSaveSystemClass"; }
  64. virtual void On_Post_Load(void);
  65. /*
  66. ** internal chunk id's
  67. */
  68. enum
  69. {
  70. PSDSSC_CHUNKID_SCENE = 0x04433220,
  71. PSDSSC_CHUNKID_PATHFIND
  72. };
  73. };
  74. /**
  75. ** global instance of the static data save sub-system
  76. */
  77. extern PhysStaticDataSaveSystemClass _PhysStaticDataSaveSystem;
  78. /**
  79. **
  80. ** PhysStaticObjectsSaveSystemClass
  81. ** This SaveLoadSubSystem handles saving the static objects in the physics system.
  82. ** This sub-system is not called by the editor so data which needs to persist through
  83. ** an editor save-load needs to be placed in the PhysStaticFrameworkSaveSystem. On
  84. ** the other hand, all of the objects that are re-created by the editor need to be
  85. ** saved by this sub-system in order for them to persist when a level is exported to
  86. ** the game.
  87. **
  88. */
  89. class PhysStaticObjectsSaveSystemClass : public SaveLoadSubSystemClass
  90. {
  91. public:
  92. virtual uint32 Chunk_ID (void) const;
  93. protected:
  94. virtual bool Save (ChunkSaveClass &csave);
  95. virtual bool Load (ChunkLoadClass &cload);
  96. virtual const char* Name() const { return "PhysStaticObjectsSaveSystemClass"; }
  97. virtual void On_Post_Load (void);
  98. /*
  99. ** internal chunk id's
  100. */
  101. enum
  102. {
  103. PSOSSC_CHUNKID_SCENE = 0x06090609,
  104. };
  105. };
  106. /**
  107. ** global instance of the static objects save sub-system
  108. */
  109. extern PhysStaticObjectsSaveSystemClass _PhysStaticObjectsSaveSystem;
  110. #endif