W3DDebrisDraw.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. ** Command & Conquer Generals(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. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: W3DDebrisDraw.h //////////////////////////////////////////////////////////////////////////
  24. // Author: Steven Johnson
  25. // Desc: Debris drawing
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef __W3D_DEBRIS_DRAW_H_
  29. #define __W3D_DEBRIS_DRAW_H_
  30. // INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
  31. #include "Common/GameType.h"
  32. #include "Common/DrawModule.h"
  33. #include "Common/FileSystem.h" // this is only here to pull in LOAD_TEST_ASSETS
  34. // FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
  35. class Thing;
  36. class RenderObjClass;
  37. class HAnimClass;
  38. class Shadow;
  39. class FXList;
  40. //-------------------------------------------------------------------------------------------------
  41. class W3DDebrisDraw : public DrawModule, public DebrisDrawInterface
  42. {
  43. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( W3DDebrisDraw, "W3DDebrisDraw" )
  44. MAKE_STANDARD_MODULE_MACRO( W3DDebrisDraw )
  45. public:
  46. W3DDebrisDraw( Thing *thing, const ModuleData* moduleData );
  47. // virtual destructor prototype provided by memory pool declaration
  48. /// the draw method
  49. virtual void doDrawModule(const Matrix3D* transformMtx);
  50. virtual void setShadowsEnabled(Bool enable);
  51. virtual void releaseShadows(void) {}; ///< we don't care about preserving temporary shadows.
  52. virtual void allocateShadows(void) {}; ///< we don't care about preserving temporary shadows.
  53. virtual void setFullyObscuredByShroud(Bool fullyObscured);
  54. virtual void reactToTransformChange(const Matrix3D* oldMtx, const Coord3D* oldPos, Real oldAngle);
  55. virtual void reactToGeometryChange() { }
  56. virtual void setModelName(AsciiString name, Color color, ShadowType t);
  57. virtual void setAnimNames(AsciiString initial, AsciiString flying, AsciiString final, const FXList* finalFX);
  58. virtual DebrisDrawInterface* getDebrisDrawInterface() { return this; }
  59. virtual const DebrisDrawInterface* getDebrisDrawInterface() const { return this; }
  60. private:
  61. enum AnimStateType
  62. {
  63. INITIAL,
  64. FLYING,
  65. FINAL,
  66. STATECOUNT
  67. };
  68. AsciiString m_modelName;
  69. Color m_modelColor;
  70. AsciiString m_animInitial;
  71. AsciiString m_animFlying;
  72. AsciiString m_animFinal;
  73. RenderObjClass* m_renderObject; ///< W3D Render object for this drawable
  74. HAnimClass* m_anims[STATECOUNT];
  75. const FXList* m_fxFinal;
  76. Int m_state;
  77. Int m_frames;
  78. Bool m_finalStop;
  79. Shadow* m_shadow; ///< Updates/Renders shadows of this object
  80. };
  81. #endif // __W3D_DEBRIS_DRAW_H_