W3DDebugIcons.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #pragma once
  24. #ifndef __W3D_DEBUG_ICONS_H_
  25. #define __W3D_DEBUG_ICONS_H_
  26. #include "always.h"
  27. #include "rendobj.h"
  28. #include "vertmaterial.h"
  29. #include "Lib/BaseType.h"
  30. #if defined _DEBUG || defined _INTERNAL
  31. struct DebugIcon;
  32. //
  33. /// W3DDebugIcons: Draws huge numbers of debug icons for pathfinding quickly.
  34. //
  35. //
  36. class W3DDebugIcons : public RenderObjClass
  37. {
  38. public:
  39. W3DDebugIcons(void);
  40. W3DDebugIcons(const W3DDebugIcons & src);
  41. W3DDebugIcons & operator = (const W3DDebugIcons &);
  42. ~W3DDebugIcons(void);
  43. /////////////////////////////////////////////////////////////////////////////
  44. // Render Object Interface
  45. /////////////////////////////////////////////////////////////////////////////
  46. virtual RenderObjClass * Clone(void) const;
  47. virtual int Class_ID(void) const;
  48. virtual void Render(RenderInfoClass & rinfo);
  49. virtual bool Cast_Ray(RayCollisionTestClass & raytest);
  50. virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const;
  51. virtual void Get_Obj_Space_Bounding_Box(AABoxClass & aabox) const;
  52. protected:
  53. VertexMaterialClass *m_vertexMaterialClass;
  54. protected:
  55. static DebugIcon *m_debugIcons;
  56. static Int m_numDebugIcons;
  57. protected:
  58. enum {MAX_ICONS = 100000};
  59. void allocateIconsArray(void);
  60. void compressIconsArray(void);
  61. public:
  62. static void addIcon(const Coord3D *pos, Real width, Int numFramesDuration, RGBColor color);
  63. };
  64. #endif // _DEBUG or _INTERNAL
  65. #endif // end __W3D_DEBUG_ICONS_H_