VisualOptionsDialog.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. // VisualOptionsDialog.cpp : implementation file
  19. //
  20. #include "stdafx.h"
  21. #include "leveledit.h"
  22. #include "VisualOptionsDialog.h"
  23. #include "Utils.H"
  24. #include "WW3D.H"
  25. #ifdef _DEBUG
  26. #define new DEBUG_NEW
  27. #undef THIS_FILE
  28. static char THIS_FILE[] = __FILE__;
  29. #endif
  30. /////////////////////////////////////////////////////////////////////////////
  31. //
  32. // Constants
  33. //
  34. /////////////////////////////////////////////////////////////////////////////
  35. const int MAX_REDUCTION = 5;
  36. //////////////////////////////////////////////////////////////
  37. //
  38. // VisualOptionsDialogClass
  39. //
  40. //////////////////////////////////////////////////////////////
  41. VisualOptionsDialogClass::VisualOptionsDialogClass(CWnd* pParent /*=NULL*/)
  42. : CDialog(VisualOptionsDialogClass::IDD, pParent)
  43. {
  44. //{{AFX_DATA_INIT(VisualOptionsDialogClass)
  45. // NOTE: the ClassWizard will add member initialization here
  46. //}}AFX_DATA_INIT
  47. }
  48. void VisualOptionsDialogClass::DoDataExchange(CDataExchange* pDX)
  49. {
  50. CDialog::DoDataExchange(pDX);
  51. //{{AFX_DATA_MAP(VisualOptionsDialogClass)
  52. DDX_Control(pDX, IDC_TEXTURE_SIZE_SLIDER, m_SizeSlider);
  53. //}}AFX_DATA_MAP
  54. }
  55. BEGIN_MESSAGE_MAP(VisualOptionsDialogClass, CDialog)
  56. //{{AFX_MSG_MAP(VisualOptionsDialogClass)
  57. //}}AFX_MSG_MAP
  58. END_MESSAGE_MAP()
  59. //////////////////////////////////////////////////////////////
  60. //
  61. // OnInitDialog
  62. //
  63. //////////////////////////////////////////////////////////////
  64. BOOL
  65. VisualOptionsDialogClass::OnInitDialog (void)
  66. {
  67. CDialog::OnInitDialog ();
  68. m_SizeSlider.SetRange (0, MAX_REDUCTION);
  69. // Set the current texture resolution
  70. int reduction = WW3D::Get_Texture_Reduction ();
  71. m_SizeSlider.SetPos (MAX_REDUCTION - reduction);
  72. // Set the wireframe check state
  73. //SendDlgItemMessage (IDC_WIREFRAME_CHECK, BM_SETCHECK, (WPARAM) WW3D::Get_Polygon_Mode () == WW3D::LINE);
  74. return TRUE;
  75. }
  76. //////////////////////////////////////////////////////////////
  77. //
  78. // OnOK
  79. //
  80. //////////////////////////////////////////////////////////////
  81. void
  82. VisualOptionsDialogClass::OnOK (void)
  83. {
  84. CWaitCursor wait_cursor;
  85. // Reduce textures
  86. int reduction = MAX_REDUCTION - m_SizeSlider.GetPos ();
  87. WW3D::Set_Texture_Reduction (reduction);
  88. // Switch between wireframe
  89. if (SendDlgItemMessage (IDC_WIREFRAME_CHECK, BM_GETCHECK)) {
  90. //WW3D::Set_Polygon_Mode (WW3D::LINE);
  91. } else {
  92. //WW3D::Set_Polygon_Mode (WW3D::FILL);
  93. }
  94. CDialog::OnOK ();
  95. return ;
  96. }