W3DStatusCircle.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. #pragma once
  24. #ifndef __STATUS_CIRCLE_H_
  25. #define __STATUS_CIRCLE_H_
  26. #include "always.h"
  27. #include "rendobj.h"
  28. #include "w3d_file.h"
  29. #include "dx8vertexbuffer.h"
  30. #include "dx8indexbuffer.h"
  31. #include "shader.h"
  32. #include "vertmaterial.h"
  33. #include "Lib/BaseType.h"
  34. //
  35. // W3DStatusCircle: Object generated from 2D Height grid
  36. //
  37. //
  38. class W3DStatusCircle : public RenderObjClass
  39. {
  40. public:
  41. W3DStatusCircle(void);
  42. W3DStatusCircle(const W3DStatusCircle & src);
  43. W3DStatusCircle & operator = (const W3DStatusCircle &);
  44. ~W3DStatusCircle(void);
  45. /////////////////////////////////////////////////////////////////////////////
  46. // Render Object Interface
  47. /////////////////////////////////////////////////////////////////////////////
  48. virtual RenderObjClass * Clone(void) const;
  49. virtual int Class_ID(void) const;
  50. virtual void Render(RenderInfoClass & rinfo);
  51. // virtual void Special_Render(SpecialRenderInfoClass & rinfo);
  52. // virtual void Set_Transform(const Matrix3D &m);
  53. // virtual void Set_Position(const Vector3 &v);
  54. //TODO: MW: do these later - only needed for collision detection
  55. virtual bool Cast_Ray(RayCollisionTestClass & raytest);
  56. // virtual Bool Cast_AABox(AABoxCollisionTestClass & boxtest);
  57. // virtual Bool Cast_OBBox(OBBoxCollisionTestClass & boxtest);
  58. // virtual Bool Intersect_AABox(AABoxIntersectionTestClass & boxtest);
  59. // virtual Bool Intersect_OBBox(OBBoxIntersectionTestClass & boxtest);
  60. virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const;
  61. virtual void Get_Obj_Space_Bounding_Box(AABoxClass & aabox) const;
  62. // virtual int Get_Num_Polys(void) const;
  63. // virtual const char * Get_Name(void) const;
  64. // virtual void Set_Name(const char * name);
  65. // unsigned int Get_Flags(void) { return Flags; }
  66. // void Set_Flags(unsigned int flags) { Flags = flags; }
  67. // void Set_Flag(unsigned int flag, Bool onoff) { Flags &= (~flag); if (onoff) Flags |= flag; }
  68. int updateBlock(void);
  69. Int freeMapResources(void);
  70. void static setColor(Int r, Int g, Int b) {m_needUpdate = true; m_diffuse = (b) + (g<<8) + (r<<16);};
  71. protected:
  72. Int m_numTriangles; //dimensions of list
  73. static Int m_diffuse;
  74. static Bool m_needUpdate;
  75. DX8IndexBufferClass *m_indexBuffer; //indices defining a triangle strip the covers full terrain
  76. ShaderClass m_shaderClass; //shader or rendering state for heightmap
  77. VertexMaterialClass *m_vertexMaterialClass;
  78. DX8VertexBufferClass *m_vertexBufferCircle; //collection of vertexes that make the circle.
  79. DX8VertexBufferClass *m_vertexBufferScreen; //2 triangle quad that covers the screen.
  80. int initData(void);
  81. Int updateCircleVB(void);
  82. Int updateScreenVB(Int diffuse);
  83. };
  84. #endif // end __DRAW_OBJECT_H_