PatchDensityDlg.cpp 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code 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. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #include "../../idlib/precompiled.h"
  21. #pragma hdrstop
  22. #include "qe3.h"
  23. #include "Radiant.h"
  24. #include "PatchDensityDlg.h"
  25. #ifdef _DEBUG
  26. #define new DEBUG_NEW
  27. #undef THIS_FILE
  28. static char THIS_FILE[] = __FILE__;
  29. #endif
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CPatchDensityDlg dialog
  32. CPatchDensityDlg::CPatchDensityDlg(CWnd* pParent /*=NULL*/)
  33. : CDialog(CPatchDensityDlg::IDD, pParent)
  34. {
  35. //{{AFX_DATA_INIT(CPatchDensityDlg)
  36. //}}AFX_DATA_INIT
  37. }
  38. void CPatchDensityDlg::DoDataExchange(CDataExchange* pDX)
  39. {
  40. CDialog::DoDataExchange(pDX);
  41. //{{AFX_DATA_MAP(CPatchDensityDlg)
  42. DDX_Control(pDX, IDC_COMBO_WIDTH, m_wndWidth);
  43. DDX_Control(pDX, IDC_COMBO_HEIGHT, m_wndHeight);
  44. //}}AFX_DATA_MAP
  45. }
  46. BEGIN_MESSAGE_MAP(CPatchDensityDlg, CDialog)
  47. //{{AFX_MSG_MAP(CPatchDensityDlg)
  48. //}}AFX_MSG_MAP
  49. END_MESSAGE_MAP()
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CPatchDensityDlg message handlers
  52. int g_nXLat[] = {3,5,7,9,11,13,15};
  53. void CPatchDensityDlg::OnOK()
  54. {
  55. int nWidth = m_wndWidth.GetCurSel();
  56. int nHeight = m_wndHeight.GetCurSel();
  57. if (nWidth >= 0 && nWidth <= 6 && nHeight >= 0 && nHeight <= 6)
  58. {
  59. Patch_GenericMesh(g_nXLat[nWidth], g_nXLat[nHeight], g_pParentWnd->ActiveXY()->GetViewType());
  60. Sys_UpdateWindows(W_ALL);
  61. }
  62. CDialog::OnOK();
  63. }
  64. BOOL CPatchDensityDlg::OnInitDialog()
  65. {
  66. CDialog::OnInitDialog();
  67. m_wndWidth.SetCurSel(0);
  68. m_wndHeight.SetCurSel(0);
  69. return TRUE; // return TRUE unless you set the focus to a control
  70. // EXCEPTION: OCX Property Pages should return FALSE
  71. }