W3DSmudge.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. // FILE: W3DSmudge.h /////////////////////////////////////////////////////////
  19. #pragma once
  20. #ifndef _W3DSMUDGE_H_
  21. #define _W3DSMUDGE_H_
  22. #include "GameClient/Smudge.h"
  23. #include "sharebuf.h"
  24. class SmudgeGroupClass; //forward reference.
  25. class Vector3;
  26. class Vector4;
  27. class TextureClass;
  28. class RenderInfoClass;
  29. class DX8IndexBufferClass;
  30. //#define USE_COPY_RECTS 1 //this was the old method that didn't render to texture. Just copied backbuffer into texture. Slow on Nvidia.
  31. class W3DSmudgeManager : public SmudgeManager
  32. {
  33. public:
  34. W3DSmudgeManager( void );
  35. virtual ~W3DSmudgeManager();
  36. virtual void init(void);
  37. virtual void reset (void);
  38. void render (RenderInfoClass &rinfo);
  39. void ReleaseResources(void);
  40. void ReAcquireResources(void);
  41. private:
  42. Bool testHardwareSupport(void); ///<test if video card supports the effect.
  43. enum { MAX_POINTS_PER_GROUP = 512 };
  44. SmudgeGroupClass *m_smudgeGroup; ///< the point group that contains all of the particles
  45. ShareBufferClass<Vector3> *m_posBuffer; ///< array of particle positions
  46. ShareBufferClass<unsigned int> *m_RGBABuffer; ///< array of particle color and alpha
  47. ShareBufferClass<float> *m_sizeBuffer; ///< array of particle sizes
  48. #ifdef USE_COPY_RECTS
  49. TextureClass *m_backgroundTexture;
  50. #endif
  51. DX8IndexBufferClass *m_indexBuffer;
  52. Int m_backBufferWidth;
  53. Int m_backBufferHeight;
  54. };
  55. #endif //_W3DSMUDGE_H_