effectrecycler.h 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 : Renegade *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/effectrecycler.h $*
  25. * *
  26. * Original Author:: Greg Hjelstrom *
  27. * *
  28. * $Author:: Greg_h $*
  29. * *
  30. * $Modtime:: 7/11/01 3:16p $*
  31. * *
  32. * $Revision:: 3 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #if defined(_MSC_VER)
  38. #pragma once
  39. #endif
  40. #ifndef EFFECTRECYCLER_H
  41. #define EFFECTRECYCLER_H
  42. #include "always.h"
  43. #include "robjlist.h"
  44. #include "multilist.h"
  45. #include "combatphysobserver.h"
  46. #include "renderobjectrecycler.h"
  47. class Matrix3D;
  48. class TimedDecorationPhysDefClass;
  49. class TimedDecorationPhysClass;
  50. class RenderObjClass;
  51. /**
  52. ** EffectRecyclerClass
  53. ** This class can recycle any "fire-and-forget" eye-candy type rendering objects. It
  54. ** will recycle both the render objects and timed-deco-phys wrappers internally. This
  55. ** system will be used for things in the game like surface-effect particle emitters,
  56. ** explosions, etc.
  57. **
  58. ** This object will create/recycle the desired render object, insert it into the combat
  59. ** scene, and reclaim the objects when the animation/emitter finishes.
  60. */
  61. class EffectRecyclerClass : public CombatPhysObserverClass
  62. {
  63. public:
  64. EffectRecyclerClass(void);
  65. ~EffectRecyclerClass(void);
  66. void Reset(void);
  67. void Spawn_Effect(TimedDecorationPhysDefClass * definition,const Matrix3D & tm);
  68. void Spawn_Effect(const char * render_obj_name,const Matrix3D & tm,float time = -1.0f);
  69. /*
  70. ** PhysObserver Interface - whenever an effect expires, we can re-use the model and
  71. ** physics object.
  72. */
  73. virtual void Object_Removed_From_Scene(PhysClass * observed_obj);
  74. private:
  75. TimedDecorationPhysClass * internal_get_tdeco(void);
  76. RenderObjClass * internal_get_model(const char * robj_name,const Matrix3D & tm);
  77. RenderObjectRecyclerClass ModelRecycler;
  78. RefMultiListClass<TimedDecorationPhysClass> InactiveTDecos;
  79. };
  80. #endif //EFFECTRECYCLER_H