W3DProjectileStreamDraw.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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: W3DProjectileStreamDraw.h ////////////////////////////////////////////////////////////
  24. // Tile a texture strung between Projectiles
  25. // Graham Smallwood, May 2002
  26. /////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef _W3D_PROJECTILE_STREAM_DRAW_H_
  29. #define _W3D_PROJECTILE_STREAM_DRAW_H_
  30. // INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
  31. #include "Common/DrawModule.h"
  32. #include "GameLogic/Module/ProjectileStreamUpdate.h" // I am the draw module for this update. Very tight.
  33. class SegmentedLineClass;
  34. class TextureClass;
  35. class Vector3;
  36. //-------------------------------------------------------------------------------------------------
  37. class W3DProjectileStreamDrawModuleData : public ModuleData
  38. {
  39. public:
  40. AsciiString m_textureName;
  41. Real m_width;
  42. Real m_tileFactor;
  43. Real m_scrollRate;
  44. Int m_maxSegments;
  45. W3DProjectileStreamDrawModuleData();
  46. ~W3DProjectileStreamDrawModuleData();
  47. static void buildFieldParse(MultiIniFieldParse& p);
  48. };
  49. //-------------------------------------------------------------------------------------------------
  50. class W3DProjectileStreamDraw : public DrawModule
  51. {
  52. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( W3DProjectileStreamDraw, "W3DProjectileStreamDraw" )
  53. MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( W3DProjectileStreamDraw, W3DProjectileStreamDrawModuleData )
  54. public:
  55. W3DProjectileStreamDraw( Thing *thing, const ModuleData* moduleData );
  56. // virtual destructor prototype provided by memory pool declaration
  57. virtual void doDrawModule(const Matrix3D* transformMtx);
  58. virtual void releaseShadows(void) {}; ///< we don't care about preserving temporary shadows.
  59. virtual void allocateShadows(void) {}; ///< we don't care about preserving temporary shadows.
  60. virtual void setShadowsEnabled(Bool ) { }
  61. virtual void setFullyObscuredByShroud(Bool);
  62. virtual void reactToTransformChange(const Matrix3D* oldMtx, const Coord3D* oldPos, Real oldAngle) { }
  63. virtual void reactToGeometryChange() { }
  64. protected:
  65. void makeOrUpdateLine( Vector3 *points, UnsignedInt pointCount, Int lineIndex );
  66. TextureClass *m_texture;
  67. SegmentedLineClass *m_allLines[MAX_PROJECTILE_STREAM]; ///< Persist, so I can ensure they live a full cycle, and minimize re-creates by holding on
  68. Int m_linesValid;
  69. };
  70. #endif