W3DTreeDraw.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. ** Command & Conquer Generals Zero Hour(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: W3DTreeDraw.h //////////////////////////////////////////////////////////////////////////
  24. // Author:
  25. // Desc:
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef __W3DTreeDraw_H_
  29. #define __W3DTreeDraw_H_
  30. // INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
  31. #include "Common/DrawModule.h"
  32. #include "WW3D2/Line3D.h"
  33. //-------------------------------------------------------------------------------------------------
  34. class W3DTreeDrawModuleData : public ModuleData
  35. {
  36. public:
  37. AsciiString m_modelName;
  38. AsciiString m_textureName;
  39. // Push aside parameters. [5/29/2003]
  40. UnsignedInt m_framesToMoveOutward;
  41. UnsignedInt m_framesToMoveInward;
  42. Real m_maxOutwardMovement;
  43. Real m_darkening;
  44. // Topple parameters. [7/7/2003]
  45. const FXList* m_toppleFX;
  46. const FXList* m_bounceFX;
  47. AsciiString m_stumpName;
  48. Real m_initialVelocityPercent;
  49. Real m_initialAccelPercent;
  50. Real m_bounceVelocityPercent;
  51. Real m_minimumToppleSpeed;
  52. Bool m_killWhenToppled;
  53. Bool m_doTopple;
  54. UnsignedInt m_sinkFrames; // How long it takes to sink after toppling. [7/11/2003]
  55. Real m_sinkDistance; // How far it sinks.
  56. Bool m_doShadow;
  57. W3DTreeDrawModuleData();
  58. ~W3DTreeDrawModuleData();
  59. static void buildFieldParse(MultiIniFieldParse& p);
  60. // ugh, hack
  61. virtual const W3DTreeDrawModuleData* getAsW3DTreeDrawModuleData() const { return this; }
  62. };
  63. //-------------------------------------------------------------------------------------------------
  64. /** W3D tree draw */
  65. //-------------------------------------------------------------------------------------------------
  66. class W3DTreeDraw : public DrawModule
  67. {
  68. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( W3DTreeDraw, "W3DTreeDraw" )
  69. MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( W3DTreeDraw, W3DTreeDrawModuleData )
  70. public:
  71. W3DTreeDraw( Thing *thing, const ModuleData* moduleData );
  72. // virtual destructor prototype provided by memory pool declaration
  73. virtual void doDrawModule(const Matrix3D* transformMtx);
  74. virtual void setShadowsEnabled(Bool enable) { }
  75. virtual void releaseShadows(void) {}; ///< we don't care about preserving temporary shadows.
  76. virtual void allocateShadows(void) {}; ///< we don't care about preserving temporary shadows.
  77. virtual void setFullyObscuredByShroud(Bool fullyObscured) { }
  78. virtual void reactToTransformChange(const Matrix3D* oldMtx, const Coord3D* oldPos, Real oldAngle);
  79. virtual void reactToGeometryChange() { }
  80. protected:
  81. Bool m_treeAdded;
  82. };
  83. #endif // __W3DTreeDraw_H_