ScreenCursor.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. ** Command & Conquer Renegade(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. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : W3DView *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/W3DView/ScreenCursor.h $Modtime:: $*
  25. * *
  26. * $Revision:: 4 $*
  27. * *
  28. *---------------------------------------------------------------------------------------------*
  29. * Functions: *
  30. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  31. #if defined(_MSC_VER)
  32. #pragma once
  33. #endif
  34. #ifndef __SCREENCURSOR_H
  35. #define __SCREENCURSOR_H
  36. #include "Resource.H"
  37. #include "rendobj.h"
  38. #include "vector3i.h"
  39. // Forward declarations
  40. class VertexMaterialClass;
  41. ///////////////////////////////////////////////////////////////////////////////
  42. //
  43. // ScreenCursorClass
  44. //
  45. ///////////////////////////////////////////////////////////////////////////////
  46. class ScreenCursorClass : public RenderObjClass
  47. {
  48. public:
  49. ////////////////////////////////////////////////////////////////////////
  50. // Public constructors/destructors
  51. ////////////////////////////////////////////////////////////////////////
  52. ScreenCursorClass (void);
  53. ScreenCursorClass (const ScreenCursorClass &src);
  54. virtual ~ScreenCursorClass (void);
  55. ////////////////////////////////////////////////////////////////////////
  56. // Public operators
  57. ////////////////////////////////////////////////////////////////////////
  58. const ScreenCursorClass &operator= (const ScreenCursorClass &src);
  59. ////////////////////////////////////////////////////////////////////////
  60. // Public methods
  61. ////////////////////////////////////////////////////////////////////////
  62. void Set_Window (HWND hwnd) { m_hWnd = hwnd; }
  63. void Set_Texture (TextureClass *texture);
  64. ////////////////////////////////////////////////////////////////////////
  65. // Base class overrides
  66. ////////////////////////////////////////////////////////////////////////
  67. RenderObjClass * Clone (void) const { return new ScreenCursorClass (*this); }
  68. virtual int Class_ID(void) const { return CLASSID_LAST + 103L; }
  69. virtual void Render (RenderInfoClass &rinfo);
  70. virtual void On_Frame_Update (void);
  71. virtual void Get_Obj_Space_Bounding_Sphere(SphereClass & sphere) const;
  72. virtual void Get_Obj_Space_Bounding_Box(AABoxClass & box) const;
  73. virtual void Notify_Added(SceneClass * scene);
  74. virtual void Notify_Removed(SceneClass * scene);
  75. protected:
  76. ////////////////////////////////////////////////////////////////////////
  77. // Protected methods
  78. ////////////////////////////////////////////////////////////////////////
  79. void Initialize (void);
  80. private:
  81. ////////////////////////////////////////////////////////////////////////
  82. // Private member data
  83. ////////////////////////////////////////////////////////////////////////
  84. HWND m_hWnd;
  85. Vector2 m_ScreenPos;
  86. TextureClass * m_pTexture;
  87. VertexMaterialClass *m_pVertMaterial;
  88. Vector3 m_Verticies[4];
  89. Vector3 m_Normals[4];
  90. Vector3i m_Triangles[2];
  91. Vector2 m_UVs[4];
  92. int m_Width;
  93. int m_Height;
  94. };
  95. #endif //__SCREENCURSOR_H