VideoConfigDialog.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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_VIDEOCONFIGDIALOG_H__BE670D78_397C_4AFE_A45A_C7798BA1869B__INCLUDED_)
  19. #define AFX_VIDEOCONFIGDIALOG_H__BE670D78_397C_4AFE_A45A_C7798BA1869B__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "resource.h"
  24. #include "vector.h"
  25. #include "rddesc.h"
  26. #include "..\..\combat\specialbuilds.h"
  27. /*
  28. #ifdef MULTIPLAYERDEMO
  29. #define RENEGADE_SUB_KEY_NAME_RENDER "Software\\Westwood\\RenegadeMPDemo\\Render"
  30. #else
  31. #define RENEGADE_SUB_KEY_NAME_RENDER "Software\\Westwood\\Renegade\\Render"
  32. #endif // MULTIPLAYERDEMO
  33. */
  34. #if defined(FREEDEDICATEDSERVER)
  35. #define RENEGADE_SUB_KEY_NAME_RENDER "Software\\Westwood\\RenegadeFDS\\Render"
  36. #elif defined(MULTIPLAYERDEMO)
  37. #define RENEGADE_SUB_KEY_NAME_RENDER "Software\\Westwood\\RenegadeMPDemo\\Render"
  38. #elif defined(BETACLIENT)
  39. #define RENEGADE_SUB_KEY_NAME_RENDER "Software\\Westwood\\RenegadeBeta\\Render"
  40. #else
  41. #define RENEGADE_SUB_KEY_NAME_RENDER "Software\\Westwood\\Renegade\\Render"
  42. #endif
  43. /////////////////////////////////////////////////////////////////////////////
  44. //
  45. // VideoConfigDialogClass
  46. //
  47. /////////////////////////////////////////////////////////////////////////////
  48. class VideoConfigDialogClass : public CDialog
  49. {
  50. // Construction
  51. public:
  52. VideoConfigDialogClass(CWnd* pParent = NULL); // standard constructor
  53. ~VideoConfigDialogClass();
  54. // Dialog Data
  55. //{{AFX_DATA(VideoConfigDialogClass)
  56. enum { IDD = IDD_VIDEO_CONFIG };
  57. CSliderCtrl m_ResSliderCtrl;
  58. CListCtrl m_DriverListCtrl;
  59. //}}AFX_DATA
  60. // Overrides
  61. // ClassWizard generated virtual function overrides
  62. //{{AFX_VIRTUAL(VideoConfigDialogClass)
  63. protected:
  64. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  65. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  66. //}}AFX_VIRTUAL
  67. // Implementation
  68. protected:
  69. // Generated message map functions
  70. //{{AFX_MSG(VideoConfigDialogClass)
  71. virtual BOOL OnInitDialog();
  72. afx_msg void OnDestroy();
  73. afx_msg void OnItemchangedDriverList(NMHDR* pNMHDR, LRESULT* pResult);
  74. afx_msg void OnSelchangeBitdepthCombo();
  75. afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  76. afx_msg void OnWindowedCheck();
  77. //}}AFX_MSG
  78. DECLARE_MESSAGE_MAP()
  79. public:
  80. /////////////////////////////////////////////////////////////////
  81. // Public methods
  82. /////////////////////////////////////////////////////////////////
  83. void Apply_Changes (void);
  84. static VideoConfigDialogClass* Get_Instance();
  85. int Get_Current_Bit_Depth() const { return CurrentBitDepth; }
  86. int Get_Current_Driver_Index() const { return CurrentDriverIndex; }
  87. const D3DADAPTER_IDENTIFIER8& Get_Current_Adapter_Identifier() const { return CurrentAdapterIdentifier; }
  88. const D3DCAPS8& Get_Current_Caps() const { return CurrentCaps; }
  89. private:
  90. /////////////////////////////////////////////////////////////////
  91. // Private methods
  92. /////////////////////////////////////////////////////////////////
  93. void Update_Display_Settings (void);
  94. void Update_Color_Combo (void);
  95. void Update_Resolution_Slider (void);
  96. void Update_Resolution_Text (void);
  97. void Select_Default_Resolution (void);
  98. /////////////////////////////////////////////////////////////////
  99. // Private member data
  100. /////////////////////////////////////////////////////////////////
  101. DynamicVectorClass<ResolutionDescClass> ResolutionList;
  102. int CurrentWidth;
  103. int CurrentHeight;
  104. int CurrentBitDepth;
  105. bool CurrentIsWindowed;
  106. int CurrentDriverIndex;
  107. D3DCAPS8 CurrentCaps;
  108. D3DADAPTER_IDENTIFIER8 CurrentAdapterIdentifier;
  109. };
  110. //{{AFX_INSERT_LOCATION}}
  111. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  112. #endif // !defined(AFX_VIDEOCONFIGDIALOG_H__BE670D78_397C_4AFE_A45A_C7798BA1869B__INCLUDED_)