cinematicgameobj.h 4.5 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. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Commando *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/cinematicgameobj.h $*
  25. * *
  26. * $Author:: Tom_s $*
  27. * *
  28. * $Modtime:: 9/17/01 4:24p $*
  29. * *
  30. * $Revision:: 19 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef CINEMATICGAMEOBJ_H
  36. #define CINEMATICGAMEOBJ_H
  37. #ifndef ALWAYS_H
  38. #include "always.h"
  39. #endif
  40. #ifndef ARMEDGAMEOBJ_H
  41. #include "armedgameobj.h"
  42. #endif
  43. class AudibleSoundClass;
  44. /*
  45. ** CinematicGameObjDef - Defintion class for a CinematicGameObj
  46. */
  47. class CinematicGameObjDef : public ArmedGameObjDef
  48. {
  49. public:
  50. CinematicGameObjDef( void );
  51. virtual uint32 Get_Class_ID( void ) const;
  52. virtual PersistClass * Create( void ) const ;
  53. virtual bool Save( ChunkSaveClass &csave );
  54. virtual bool Load( ChunkLoadClass &cload );
  55. virtual const PersistFactoryClass & Get_Factory( void ) const;
  56. DECLARE_EDITABLE( CinematicGameObjDef, ArmedGameObjDef );
  57. protected:
  58. int SoundDefID;
  59. StringClass SoundBoneName;
  60. StringClass AnimationName;
  61. bool AutoFireWeapon;
  62. bool DestroyAfterAnimation;
  63. bool CameraRelative;
  64. friend class CinematicGameObj;
  65. };
  66. /*
  67. **
  68. */
  69. class CinematicGameObj : public ArmedGameObj {
  70. public:
  71. CinematicGameObj();
  72. virtual ~CinematicGameObj();
  73. // Definitions
  74. virtual void Init( void );
  75. void Init( const CinematicGameObjDef & definition );
  76. const CinematicGameObjDef & Get_Definition( void ) const ;
  77. void Cinematic_Init( void );
  78. // Save / Load / Construction Factory
  79. virtual bool Save( ChunkSaveClass & csave );
  80. virtual bool Load( ChunkLoadClass & cload );
  81. virtual void On_Post_Load( void );
  82. virtual const PersistFactoryClass & Get_Factory( void ) const;
  83. // Think
  84. virtual void Think( void );
  85. virtual void Post_Think( void );
  86. // Type Identification
  87. virtual CinematicGameObj *As_CinematicGameObj( void ) { return this; }
  88. // Sound
  89. void Set_Sound( int sound_def_id, const char * bone_name = "" );
  90. // Damage
  91. virtual bool Takes_Explosion_Damage( void ) { return false; }
  92. virtual void Completely_Damaged( const OffenseObjectClass & damager );
  93. // Information
  94. float Get_Animation_Length( void );
  95. // Network support
  96. //TSS: why import with no export?
  97. //virtual void Import_Creation( BitStreamClass &packet );
  98. // Network support
  99. virtual void Export_Rare( BitStreamClass &packet );
  100. virtual void Import_Rare( BitStreamClass &packet );
  101. protected:
  102. AudibleSoundClass *Sound;
  103. };
  104. #endif // CINEMATICGAMEOBJ_H