VisWindowDialog.h 3.5 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. #if !defined(AFX_VISWINDOWDIALOG_H__AB6CCD3A_88BB_4D66_AA1C_9B6E69C99409__INCLUDED_)
  19. #define AFX_VISWINDOWDIALOG_H__AB6CCD3A_88BB_4D66_AA1C_9B6E69C99409__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "resource.h"
  24. /////////////////////////////////////////////////////////////////////////////
  25. // Forward declarations
  26. /////////////////////////////////////////////////////////////////////////////
  27. class VisRasterizerClass;
  28. /////////////////////////////////////////////////////////////////////////////
  29. //
  30. // VisWindowDialogClass
  31. //
  32. /////////////////////////////////////////////////////////////////////////////
  33. class VisWindowDialogClass : public CDialog
  34. {
  35. // Construction
  36. public:
  37. VisWindowDialogClass (CWnd* pParent = NULL);
  38. ~VisWindowDialogClass (void);
  39. // Dialog Data
  40. //{{AFX_DATA(VisWindowDialogClass)
  41. enum { IDD = IDD_VIS_WINDOW };
  42. // NOTE: the ClassWizard will add data members here
  43. //}}AFX_DATA
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(VisWindowDialogClass)
  47. protected:
  48. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  49. //}}AFX_VIRTUAL
  50. // Implementation
  51. protected:
  52. // Generated message map functions
  53. //{{AFX_MSG(VisWindowDialogClass)
  54. afx_msg void OnPaint();
  55. virtual BOOL OnInitDialog();
  56. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  57. //}}AFX_MSG
  58. DECLARE_MESSAGE_MAP()
  59. public:
  60. ///////////////////////////////////////////////////////////////////
  61. // Public methods
  62. ///////////////////////////////////////////////////////////////////
  63. void Create (void);
  64. void Update_Display (VisRasterizerClass &rasterizer);
  65. BOOL OnToolTipNeedText(UINT id, NMHDR * pNMHDR, LRESULT * pResult);
  66. BOOL PreTranslateMessage(MSG* pMsg);
  67. public:
  68. ///////////////////////////////////////////////////////////////////
  69. // Public methods
  70. ///////////////////////////////////////////////////////////////////
  71. void Free_DIB_Section (void);
  72. void Create_DIB_Section (int width, int height);
  73. void Paint_Display (void);
  74. private:
  75. ///////////////////////////////////////////////////////////////////
  76. // Private methods
  77. ///////////////////////////////////////////////////////////////////
  78. int Hit_Test(CPoint point) const;
  79. unsigned int Id_To_Pixel(unsigned int id) const;
  80. unsigned int Pixel_To_Id(unsigned int pixel) const;
  81. ///////////////////////////////////////////////////////////////////
  82. // Private member data
  83. ///////////////////////////////////////////////////////////////////
  84. HDC MemDC;
  85. HBITMAP Bitmap;
  86. BYTE * BitmapBits;
  87. int Width;
  88. int Height;
  89. unsigned CurToolTipVisId;
  90. CToolTipCtrl ToolTip;
  91. };
  92. //{{AFX_INSERT_LOCATION}}
  93. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  94. #endif // !defined(AFX_VISWINDOWDIALOG_H__AB6CCD3A_88BB_4D66_AA1C_9B6E69C99409__INCLUDED_)