doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SurfaceDlg.cpp
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 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.
23 
24 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.
25 
26 ===========================================================================
27 */
28 
29 #include "../../idlib/precompiled.h"
30 #pragma hdrstop
31 
32 #include "qe3.h"
33 #include "Radiant.h"
34 #include "SurfaceDlg.h"
35 #include "mainfrm.h"
36 
37 #ifdef _DEBUG
38 #define new DEBUG_NEW
39 #undef THIS_FILE
40 static char THIS_FILE[] = __FILE__;
41 #endif
42 
44 // CSurfaceDlg dialog
45 
47 
48 
49 CSurfaceDlg::CSurfaceDlg(CWnd* pParent /*=NULL*/)
50  : CDialog(CSurfaceDlg::IDD, pParent) {
51  //{{AFX_DATA_INIT(CSurfaceDlg)
52  m_nHorz = 3;
53  m_nVert = 3;
54  m_horzScale = 1.0f;
55  m_horzShift = 0.5f;
56  m_rotate = 15.0f;
57  m_vertScale = 1.0f;
58  m_vertShift = 0.5f;
59  m_strMaterial = _T("");
61  m_fHeight = 1.0f;
62  m_fWidth = 1.0f;
63  m_absolute = FALSE;
64  //}}AFX_DATA_INIT
65 }
66 
67 
68 void CSurfaceDlg::DoDataExchange(CDataExchange* pDX) {
69  CDialog::DoDataExchange(pDX);
70  //{{AFX_DATA_MAP(CSurfaceDlg)
71  DDX_Control(pDX, IDC_ROTATE, m_wndRotateEdit);
72  DDX_Control(pDX, IDC_EDIT_VERT, m_wndVert);
73  DDX_Control(pDX, IDC_EDIT_HORZ, m_wndHorz);
74  DDX_Control(pDX, IDC_SLIDER_VERT, m_wndVerticalSubdivisions);
75  DDX_Control(pDX, IDC_SLIDER_HORZ, m_wndHorzSubdivisions);
76  DDX_Control(pDX, IDC_SPIN_WIDTH, m_wndWidth);
77  DDX_Control(pDX, IDC_SPIN_HEIGHT, m_wndHeight);
78  DDX_Control(pDX, IDC_SPIN_VSHIFT, m_wndVShift);
79  DDX_Control(pDX, IDC_SPIN_ROTATE, m_wndRotate);
80  DDX_Control(pDX, IDC_SPIN_HSHIFT, m_wndHShift);
81  DDX_Text(pDX, IDC_EDIT_HORZ, m_nHorz);
82  DDV_MinMaxInt(pDX, m_nHorz, 1, 64);
83  DDX_Text(pDX, IDC_EDIT_VERT, m_nVert);
84  DDV_MinMaxInt(pDX, m_nVert, 1, 64);
85  DDX_Text(pDX, IDC_HSCALE, m_horzScale);
86  DDX_Text(pDX, IDC_HSHIFT, m_horzShift);
87  DDX_Text(pDX, IDC_ROTATE, m_rotate);
88  DDX_Text(pDX, IDC_VSCALE, m_vertScale);
89  DDX_Text(pDX, IDC_VSHIFT, m_vertShift);
90  DDX_Text(pDX, IDC_TEXTURE, m_strMaterial);
91  DDX_Check(pDX, IDC_CHECK_SUBDIVIDE, m_subdivide);
92  DDX_Text(pDX, IDC_EDIT_HEIGHT, m_fHeight);
93  DDX_Text(pDX, IDC_EDIT_WIDTH, m_fWidth);
94  DDX_Check(pDX, IDC_CHECK_ABSOLUTE, m_absolute);
95  //}}AFX_DATA_MAP
96 }
97 
98 
99 BEGIN_MESSAGE_MAP(CSurfaceDlg, CDialog)
100  //{{AFX_MSG_MAP(CSurfaceDlg)
101  ON_WM_HSCROLL()
102  ON_WM_KEYDOWN()
103  ON_WM_VSCROLL()
104  ON_WM_CLOSE()
105  ON_WM_DESTROY()
106  ON_BN_CLICKED(IDCANCEL, OnBtnCancel)
107  ON_BN_CLICKED(IDC_BTN_COLOR, OnBtnColor)
108  ON_WM_CTLCOLOR()
109  ON_WM_CREATE()
110  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_HSHIFT, OnDeltaPosSpin)
111  ON_BN_CLICKED(IDC_BTN_PATCHDETAILS, OnBtnPatchdetails)
112  ON_BN_CLICKED(IDC_BTN_PATCHNATURAL, OnBtnPatchnatural)
113  ON_BN_CLICKED(IDC_BTN_PATCHRESET, OnBtnPatchreset)
114  ON_BN_CLICKED(IDC_BTN_AXIAL, OnBtnAxial)
115  ON_BN_CLICKED(IDC_BTN_BRUSHFIT, OnBtnBrushfit)
116  ON_BN_CLICKED(IDC_BTN_FACEFIT, OnBtnFacefit)
117  ON_BN_CLICKED(IDC_CHECK_SUBDIVIDE, OnCheckSubdivide)
118  ON_EN_CHANGE(IDC_EDIT_HORZ, OnChangeEditHorz)
119  ON_EN_CHANGE(IDC_EDIT_VERT, OnChangeEditVert)
120  ON_EN_SETFOCUS(IDC_HSCALE, OnSetfocusHscale)
121  ON_EN_KILLFOCUS(IDC_HSCALE, OnKillfocusHscale)
122  ON_EN_KILLFOCUS(IDC_VSCALE, OnKillfocusVscale)
123  ON_EN_SETFOCUS(IDC_VSCALE, OnSetfocusVscale)
124  ON_EN_KILLFOCUS(IDC_EDIT_WIDTH, OnKillfocusEditWidth)
125  ON_EN_SETFOCUS(IDC_EDIT_WIDTH, OnSetfocusEditWidth)
126  ON_EN_KILLFOCUS(IDC_EDIT_HEIGHT, OnKillfocusEditHeight)
127  ON_EN_SETFOCUS(IDC_EDIT_HEIGHT, OnSetfocusEditHeight)
128  ON_BN_CLICKED(IDC_BTN_FLIPX, OnBtnFlipx)
129  ON_BN_CLICKED(IDC_BTN_FLIPY, OnBtnFlipy)
130  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ROTATE, OnDeltaPosSpin)
131  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_VSHIFT, OnDeltaPosSpin)
132  ON_EN_KILLFOCUS(IDC_ROTATE, OnKillfocusRotate)
133  ON_EN_SETFOCUS(IDC_ROTATE, OnSetfocusRotate)
134  //}}AFX_MSG_MAP
135 END_MESSAGE_MAP()
136 
138 // CSurfaceDlg message handlers
139 
140 
141 /*
142 ===================================================
143 
144  SURFACE INSPECTOR
145 
146 ===================================================
147 */
148 
149 texdef_t g_old_texdef;
150 texdef_t g_patch_texdef;
153 
154 /*
155 ==============
156 SetTexMods
157 
158 Set the fields to the current texdef
159 if one face selected -> will read this face texdef, else current texdef
160 if only patches selected, will read the patch texdef
161 ===============
162 */
163 extern void Face_GetScale_BrushPrimit(face_t *face, float *s, float *t, float *rot);
164 void CSurfaceDlg::SetTexMods() {
165  UpdateData(TRUE);
166  m_strMaterial = g_qeglobals.d_texturewin.texdef.name;
167  patchMesh_t *p = SinglePatchSelected();
168  if (p) {
169  m_subdivide = p->explicitSubdivisions;
170  m_strMaterial = p->d_texture->GetName();
171  } else {
172  m_subdivide = false;
173  }
174 
175  int faceCount = g_ptrSelectedFaces.GetSize();
176  face_t *selFace = NULL;
177  if (faceCount) {
178  selFace = reinterpret_cast < face_t * > (g_ptrSelectedFaces.GetAt(0));
179  } else {
180  if (selected_brushes.next != &selected_brushes) {
181  brush_t *b = selected_brushes.next;
182  if (!b->pPatch) {
183  selFace = b->brush_faces;
184  }
185  }
186  }
187 
188  if (selFace) {
189  float rot;
190  Face_GetScale_BrushPrimit(selFace, &m_horzScale, &m_vertScale, &rot);
191  } else {
192  m_horzScale = 1.0f;
193  m_vertScale = 1.0f;
194  }
195 
196  UpdateData(FALSE);
197 }
198 
199 
200 bool g_bNewFace = false;
201 bool g_bNewApplyHandling = false;
202 bool g_bGatewayhack = false;
203 
204 
205 /*
206 =================
207 UpdateSpinners
208 =================
209 */
210 
211 void CSurfaceDlg::UpdateSpinners(bool up, int nID) {
212  UpdateData(TRUE);
213  float hdiv = 0.0f;
214  float vdiv = 0.0f;
215  switch (nID) {
216  case IDC_SPIN_ROTATE :
218  break;
219  case IDC_SPIN_HSCALE :
220  m_horzScale += (up) ? 0.1f : -0.1f;
221  hdiv = (m_horzScale == 0.0f) ? 1.0f : m_horzScale;
222  Select_ScaleTexture( 1.0f / hdiv, 0.0f, true, ( m_absolute != FALSE ) );
223  UpdateData(FALSE);
224  break;
225  case IDC_SPIN_VSCALE :
226  m_vertScale += (up) ? 0.1f : -0.1f;
227  vdiv = (m_vertScale == 0.0f) ? 1.0f : m_vertScale;
228  Select_ScaleTexture( 0.0f, 1.0f / vdiv, true, ( m_absolute != FALSE ) );
229  UpdateData(FALSE);
230  break;
231  case IDC_SPIN_HSHIFT :
232  Select_ShiftTexture((up) ? m_horzShift : -m_horzShift, 0);
233  break;
234  case IDC_SPIN_VSHIFT :
235  Select_ShiftTexture(0, (up) ? m_vertShift : -m_vertShift);
236  break;
237  }
238  g_changed_surface = true;
239 }
240 
241 void CSurfaceDlg::UpdateSpinners(int nScrollCode, int nPos, CScrollBar* pBar) {
242 
243  return;
244  UpdateData(TRUE);
245  if ((nScrollCode != SB_LINEUP) && (nScrollCode != SB_LINEDOWN)) {
246  return;
247  }
248 
249  bool up = (nScrollCode == SB_LINEUP);
250 
251 // FIXME: bad resource define
252 #define IDC_ROTATEA 0
253 #define IDC_HSCALEA 0
254 #define IDC_VSCALEA 0
255 #define IDC_HSHIFTA 0
256 #define IDC_VSHIFTA 0
257 
258  if (pBar->GetSafeHwnd() == ::GetDlgItem(GetSafeHwnd(), IDC_ROTATEA)) {
260  } else if (pBar->GetSafeHwnd() == ::GetDlgItem(GetSafeHwnd(), IDC_HSCALEA)) {
261  Select_ScaleTexture((up) ? -m_horzScale : m_horzScale, 0, true, ( m_absolute != FALSE ) );
262  } else if (pBar->GetSafeHwnd() == ::GetDlgItem(GetSafeHwnd(), IDC_VSCALEA)) {
263  Select_ScaleTexture(0, (up) ? -m_vertScale : m_vertScale, true, ( m_absolute != FALSE ) );
264  } else if (pBar->GetSafeHwnd() == ::GetDlgItem(GetSafeHwnd(), IDC_HSHIFTA)) {
265  Select_ShiftTexture((up) ? -m_horzShift : m_horzShift, 0);
266  } else if (pBar->GetSafeHwnd() == ::GetDlgItem(GetSafeHwnd(), IDC_VSHIFTA)) {
267  Select_ShiftTexture((up) ? -m_vertShift : m_vertShift, 0);
268  }
269 
270  g_changed_surface = true;
271 }
272 
274  if (g_surfwin) {
275  g_dlgSurface.SetTexMods();
276  }
278 }
279 
280 bool ByeByeSurfaceDialog();
281 
282 void DoSurface (void) {
283 
287  // save current state for cancel
288  g_old_texdef = g_qeglobals.d_texturewin.texdef;
289  g_changed_surface = false;
290 
291  if (g_surfwin == NULL && g_dlgSurface.GetSafeHwnd() == NULL) {
292  g_patch_texdef.scale[0] = 0.05f;
293  g_patch_texdef.scale[1] = 0.05f;
294  g_patch_texdef.shift[0] = 0.05f;
295  g_patch_texdef.shift[1] = 0.05f;
296  // use rotation increment from preferences
298 
299  g_dlgSurface.Create(IDD_SURFACE);
300  CRect rct;
301  LONG lSize = sizeof(rct);
302  if (LoadRegistryInfo("radiant_SurfaceWindow", &rct, &lSize)) {
303  g_dlgSurface.SetWindowPos( NULL, rct.left, rct.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW );
304  }
305  g_dlgSurface.ShowWindow(SW_SHOW);
306  Sys_UpdateWindows(W_ALL);
307  } else {
308  g_surfwin = g_dlgSurface.GetSafeHwnd();
309  g_dlgSurface.SetTexMods ();
310  g_dlgSurface.ShowWindow(SW_SHOW);
311  }
312 }
313 
315  if (g_surfwin) {
316  if (g_bGatewayhack) {
317  PostMessage(g_surfwin, WM_COMMAND, IDC_APPLY, 0);
318  } else {
319  PostMessage(g_surfwin, WM_COMMAND, IDCANCEL, 0);
320  }
321  return true;
322  } else {
323  return false;
324  }
325 }
326 
328  CDialog::OnInitDialog();
329 
330  g_surfwin = GetSafeHwnd();
331  SetTexMods ();
332 
333  //m_wndHScale.SetRange(0, 100);
334  //m_wndVScale.SetRange(0, 100);
335  m_wndHShift.SetRange(0, 100);
336  m_wndVShift.SetRange(0, 100);
337  m_wndRotate.SetRange(0, 100);
338  m_wndWidth.SetRange(1, 32);
339  m_wndHeight.SetRange(1, 32);
340 
341  m_wndVerticalSubdivisions.SetRange(1, 32);
343  m_wndHorzSubdivisions.SetRange(1, 32);
347 
348  return TRUE; // return TRUE unless you set the focus to a control
349  // EXCEPTION: OCX Property Pages should return FALSE
350 }
351 
352 void CSurfaceDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) {
353  UpdateData(TRUE);
354  if (pScrollBar->IsKindOf(RUNTIME_CLASS(CSliderCtrl))) {
355  CSliderCtrl *ctrl = reinterpret_cast<CSliderCtrl*>(pScrollBar);
356  assert(ctrl);
357  if (ctrl == &m_wndVerticalSubdivisions) {
358  m_nVert = ctrl->GetPos();
359  } else {
360  m_nHorz = ctrl->GetPos();
361  }
362  UpdateData(FALSE);
363 
364  if (m_subdivide) {
365  Patch_SubdivideSelected( ( m_subdivide != FALSE ), m_nHorz, m_nVert );
366  }
367  }
368  Sys_UpdateWindows(W_CAMERA | W_XY);
369 }
370 
371 void CSurfaceDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) {
372 
373  CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
374 }
375 
376 void CSurfaceDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) {
377  //UpdateSpinners(nSBCode, nPos, pScrollBar);
378  //Sys_UpdateWindows(W_CAMERA);
379 }
380 
381 
383  //GetTexMods();
384  UpdateData(TRUE);
385  if (m_strMaterial.Find(":") >= 0) {
387  Select_UpdateTextureName(m_strMaterial);
388  }
389  g_surfwin = NULL;
390  CDialog::OnOK();
391  Sys_UpdateWindows(W_ALL);
392 }
393 
395  g_surfwin = NULL;
396  CDialog::OnClose();
397 }
398 
400  if (g_bGatewayhack) {
401  OnOK();
402  } else {
403  OnBtnCancel();
404  }
405 }
406 
408  if (GetSafeHwnd()) {
409  CRect rct;
410  GetWindowRect(rct);
411  SaveRegistryInfo("radiant_SurfaceWindow", &rct, sizeof(rct));
412  }
413  CDialog::OnDestroy();
414  g_surfwin = NULL;
415  Sys_UpdateWindows(W_ALL);
416 }
417 
419  g_qeglobals.d_texturewin.texdef = g_old_texdef;
420  if (g_changed_surface) {
421  //++timo if !g_qeglobals.m_bBrushPrimitMode send a NULL brushprimit_texdef
422  if (!g_qeglobals.m_bBrushPrimitMode) {
423  common->Printf("Warning : non brush primitive mode call to CSurfaceDlg::GetTexMods broken\n");
424  common->Printf(" ( Select_SetTexture not called )\n");
425  }
426  // Select_SetTexture(&g_qeglobals.d_texturewin.texdef);
427  }
428  g_surfwin = NULL;
429  DestroyWindow();
430 }
431 
433 }
434 
435 HBRUSH CSurfaceDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) {
436  HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
437  return hbr;
438 }
439 
440 int CSurfaceDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) {
441  if (CDialog::OnCreate(lpCreateStruct) == -1)
442  return -1;
443 
444  return 0;
445 }
446 
448  // TODO: Add your specialized code here and/or call the base class
449 
450  return CDialog::PreCreateWindow(cs);
451 }
452 
453 
454 void CSurfaceDlg::OnDeltaPosSpin(NMHDR* pNMHDR, LRESULT* pResult) {
455  NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
456  UpdateSpinners((pNMUpDown->iDelta > 0), pNMUpDown->hdr.idFrom);
457  *pResult = 0;
458 }
459 
461  Patch_NaturalizeSelected(true);
463  Sys_UpdateWindows(W_ALL);
464 }
465 
467  Select_SetTexture (&g_qeglobals.d_texturewin.texdef, &g_qeglobals.d_texturewin.brushprimit_texdef, false);
468  Patch_NaturalizeSelected();
470  g_changed_surface = true;
471  Sys_UpdateWindows(W_ALL);
472 }
473 
475  //CTextureLayout dlg;
476  //if (dlg.DoModal() == IDOK) {
477  // Patch_ResetTexturing(dlg.m_fX, dlg.m_fY);
478  //}
479  //Sys_UpdateWindows(W_ALL);
480 }
481 
483 }
484 
486  // TODO: Add your control notification handler code here
487 
488 }
489 
491  UpdateData(TRUE);
492 /*
493  brush_t *b;
494  for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) {
495  if (!b->patchBrush) {
496  for (face_t* pFace = b->brush_faces; pFace; pFace = pFace->next) {
497  g_ptrSelectedFaces.Add(pFace);
498  g_ptrSelectedFaceBrushes.Add(b);
499  }
500  }
501  }
502 */
503  Select_FitTexture(m_fHeight, m_fWidth);
505  //SetTexMods();
506  g_changed_surface = true;
507  Sys_UpdateWindows(W_ALL);
508 }
509 
510 
512  UpdateData( TRUE );
513  // turn any patches in explicit subdivides
514  Patch_SubdivideSelected( ( m_subdivide != FALSE ), m_nHorz, m_nVert );
516  Sys_UpdateWindows( W_CAMERA | W_XY );
517 }
518 
520 {
521  // TODO: If this is a RICHEDIT control, the control will not
522  // send this notification unless you override the CDialog::OnInitDialog()
523  // function and call CRichEditCtrl().SetEventMask()
524  // with the ENM_CHANGE flag ORed into the mask.
525 
526  // TODO: Add your control notification handler code here
527  UpdateData(TRUE);
528  // turn any patches in explicit subdivides
529  Patch_SubdivideSelected( ( m_subdivide != FALSE ), m_nHorz, m_nVert );
530  Sys_UpdateWindows(W_CAMERA | W_XY);
531 
532 }
533 
535 {
536  // TODO: If this is a RICHEDIT control, the control will not
537  // send this notification unless you override the CDialog::OnInitDialog()
538  // function and call CRichEditCtrl().SetEventMask()
539  // with the ENM_CHANGE flag ORed into the mask.
540 
541  // TODO: Add your control notification handler code here
542  UpdateData(TRUE);
543  // turn any patches in explicit subdivides
544  Patch_SubdivideSelected( ( m_subdivide != FALSE ), m_nHorz, m_nVert );
545  Sys_UpdateWindows(W_CAMERA | W_XY);
546 
547 }
548 
550 {
551  if (pMsg->message == WM_KEYDOWN) {
552  if (pMsg->wParam == VK_RETURN) {
553  if (focusControl) {
554  UpdateData(TRUE);
555  if (focusControl == &m_wndHScale) {
556  Select_ScaleTexture( m_horzScale, 1.0f, true, ( m_absolute != FALSE ) );
557  } else if (focusControl == &m_wndVScale) {
558  Select_ScaleTexture( 1.0f, m_vertScale, true, ( m_absolute != FALSE ) );
559  } else if (focusControl == &m_wndRotateEdit) {
561  } else if (focusControl == &m_wndHeight || focusControl == &m_wndWidth) {
562  Select_FitTexture( m_fHeight, m_fWidth );
563  }
564  }
565  return TRUE;
566  }
567  }
568  return CDialog::PreTranslateMessage(pMsg);
569 }
570 
572 {
574 }
575 
577 {
578  focusControl = NULL;
579 }
580 
582 {
583  focusControl = NULL;
584 }
585 
587 {
589 }
590 
592 {
593  focusControl = NULL;
594 }
595 
597 {
599 }
600 
602 {
603  focusControl = NULL;
604 }
605 
607 {
609 }
610 
612 {
613  Select_FlipTexture(false);
614 }
615 
617 {
618  Select_FlipTexture(true);
619 }
620 
622 {
623  focusControl = NULL;
624 }
625 
627 {
629 }
CMainFrame * g_pParentWnd
Definition: MainFrm.cpp:73
afx_msg void OnSetfocusEditHeight()
Definition: SurfaceDlg.cpp:606
#define IDC_BTN_FLIPY
afx_msg void OnChangeEditHorz()
Definition: SurfaceDlg.cpp:519
bool g_changed_surface
Definition: SurfaceDlg.cpp:152
afx_msg void OnSetfocusEditWidth()
Definition: SurfaceDlg.cpp:596
CSliderCtrl m_wndVerticalSubdivisions
Definition: SurfaceDlg.h:56
afx_msg void OnSetfocusHscale()
Definition: SurfaceDlg.cpp:571
#define IDC_VSCALEA
void WINAPI Sys_UpdateWindows(int nBits)
Definition: MainFrm.cpp:3974
afx_msg void OnBtnPatchreset()
Definition: SurfaceDlg.cpp:474
afx_msg void OnDestroy()
Definition: SurfaceDlg.cpp:407
assert(prefInfo.fullscreenBtn)
#define IDC_SLIDER_VERT
#define IDC_EDIT_HORZ
#define IDC_ROTATE
void SetTexMods()
Definition: SurfaceDlg.cpp:164
float m_horzShift
Definition: SurfaceDlg.h:68
brush_t selected_brushes
Definition: EditorMap.cpp:40
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
virtual BOOL PreTranslateMessage(MSG *pMsg)
Definition: SurfaceDlg.cpp:549
afx_msg void OnBtnFlipy()
Definition: SurfaceDlg.cpp:616
void Face_GetScale_BrushPrimit(face_t *face, float *s, float *t, float *rot)
afx_msg void OnChangeEditVert()
Definition: SurfaceDlg.cpp:534
afx_msg void OnCheckSubdivide()
Definition: SurfaceDlg.cpp:511
CEdit m_wndHorz
Definition: SurfaceDlg.h:55
CSpinButtonCtrl m_wndRotate
Definition: SurfaceDlg.h:62
afx_msg void OnBtnBrushfit()
Definition: SurfaceDlg.cpp:485
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
Definition: SurfaceDlg.cpp:376
float m_vertScale
Definition: SurfaceDlg.h:70
#define IDC_SPIN_HEIGHT
CSliderCtrl m_wndHorzSubdivisions
Definition: SurfaceDlg.h:57
#define IDC_HSCALE
CSpinButtonCtrl m_wndHeight
Definition: SurfaceDlg.h:59
float m_vertShift
Definition: SurfaceDlg.h:71
#define IDC_CHECK_SUBDIVIDE
CEdit m_wndRotateEdit
Definition: SurfaceDlg.h:53
CSpinButtonCtrl m_wndVScale
Definition: SurfaceDlg.h:61
afx_msg void OnKillfocusRotate()
Definition: SurfaceDlg.cpp:621
#define IDC_BTN_BRUSHFIT
#define IDC_BTN_FACEFIT
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
BOOL m_bNewApplyHandling
Definition: PrefsDlg.h:69
GLdouble s
Definition: glext.h:2935
HWND g_surfwin
Definition: SurfaceDlg.cpp:151
float m_fHeight
Definition: SurfaceDlg.h:74
bool LoadRegistryInfo(const char *pszName, void *pvBuf, long *plSize)
Definition: Radiant.cpp:405
#define IDC_ROTATEA
#define IDC_SPIN_VSCALE
CString m_strMaterial
Definition: SurfaceDlg.h:72
bool g_bGatewayhack
Definition: SurfaceDlg.cpp:202
#define BOOL
Definition: mprintf.c:71
afx_msg void OnBtnAxial()
Definition: SurfaceDlg.cpp:482
afx_msg void OnBtnPatchdetails()
Definition: SurfaceDlg.cpp:460
afx_msg void OnBtnCancel()
Definition: SurfaceDlg.cpp:418
#define IDC_SPIN_WIDTH
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
Definition: SurfaceDlg.cpp:371
CEdit m_wndVert
Definition: SurfaceDlg.h:54
#define IDC_SPIN_HSHIFT
afx_msg void OnKillfocusEditWidth()
Definition: SurfaceDlg.cpp:591
bool ByeByeSurfaceDialog()
Definition: SurfaceDlg.cpp:314
virtual void DoDataExchange(CDataExchange *pDX)
Definition: SurfaceDlg.cpp:68
CCamWnd * GetCamera()
Definition: MainFrm.h:123
afx_msg void OnKillfocusEditHeight()
Definition: SurfaceDlg.cpp:601
CSurfaceDlg g_dlgSurface
Definition: SurfaceDlg.cpp:46
#define IDC_EDIT_WIDTH
#define IDC_CHECK_ABSOLUTE
texdef_t g_old_texdef
Definition: SurfaceDlg.cpp:149
float m_horzScale
Definition: SurfaceDlg.h:67
#define IDC_SLIDER_HORZ
#define IDC_EDIT_VERT
BOOL m_bFace
Definition: PrefsDlg.h:65
idCommon * common
Definition: Common.cpp:206
CSpinButtonCtrl m_wndHShift
Definition: SurfaceDlg.h:63
#define NULL
Definition: Lib.h:88
#define IDC_VSHIFT
#define IDC_BTN_COLOR
virtual BOOL PreCreateWindow(CREATESTRUCT &cs)
Definition: SurfaceDlg.cpp:447
afx_msg void OnDeltaPosSpin(NMHDR *pNMHDR, LRESULT *pResult)
Definition: SurfaceDlg.cpp:454
void Select_RotateTexture(float amt, bool absolute)
CPtrArray & g_ptrSelectedFaces
#define IDD_SURFACE
bool SaveRegistryInfo(const char *pszName, void *pvBuf, long lSize)
Definition: Radiant.cpp:398
int m_nRotation
Definition: PrefsDlg.h:90
#define IDC_BTN_PATCHDETAILS
float m_fWidth
Definition: SurfaceDlg.h:75
BOOL m_subdivide
Definition: SurfaceDlg.h:73
virtual void Printf(const char *fmt,...) id_attribute((format(printf
#define IDC_APPLY
#define IDC_VSHIFTA
#define IDC_BTN_PATCHNATURAL
virtual void OnCancel()
Definition: SurfaceDlg.cpp:399
CSpinButtonCtrl m_wndHScale
Definition: SurfaceDlg.h:64
CSurfaceDlg(CWnd *pParent=NULL)
Definition: SurfaceDlg.cpp:49
idDeclManager * declManager
void MarkWorldDirty()
Definition: CamWnd.cpp:1977
afx_msg void OnBtnFacefit()
Definition: SurfaceDlg.cpp:490
GLubyte GLubyte b
Definition: glext.h:4662
#define IDC_HSHIFT
#define IDC_TEXTURE
texdef_t g_patch_texdef
Definition: SurfaceDlg.cpp:150
long LONG
#define IDC_EDIT_HEIGHT
void UpdateSpinners(int nScrollCode, int nPos, CScrollBar *pBar)
Definition: SurfaceDlg.cpp:241
#define IDC_SPIN_VSHIFT
tuple f
Definition: idal.py:89
void UpdateSurfaceDialog()
Definition: SurfaceDlg.cpp:273
#define IDC_VSCALE
afx_msg void OnKillfocusVscale()
Definition: SurfaceDlg.cpp:581
CPrefsDlg & g_PrefsDlg
Definition: MainFrm.cpp:75
float m_rotate
Definition: SurfaceDlg.h:69
afx_msg void OnKillfocusHscale()
Definition: SurfaceDlg.cpp:576
BOOL m_absolute
Definition: SurfaceDlg.h:76
afx_msg void OnSetfocusRotate()
Definition: SurfaceDlg.cpp:626
#define FALSE
Definition: mprintf.c:70
bool g_bNewApplyHandling
Definition: SurfaceDlg.cpp:201
CSpinButtonCtrl m_wndWidth
Definition: SurfaceDlg.h:58
#define IDC_HSCALEA
void DoSurface(void)
Definition: SurfaceDlg.cpp:282
#define IDC_BTN_PATCHRESET
BOOL m_bGatewayHack
Definition: PrefsDlg.h:72
#define IDC_BTN_AXIAL
#define IDC_SPIN_ROTATE
afx_msg void OnBtnPatchnatural()
Definition: SurfaceDlg.cpp:466
#define TRUE
Definition: mprintf.c:69
#define IDC_BTN_FLIPX
#define IDC_HSHIFTA
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar)
Definition: SurfaceDlg.cpp:352
virtual BOOL OnInitDialog()
Definition: SurfaceDlg.cpp:327
bool g_bNewFace
Definition: SurfaceDlg.cpp:200
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
Definition: SurfaceDlg.cpp:440
GLfloat GLfloat p
Definition: glext.h:4674
CWnd * focusControl
Definition: SurfaceDlg.h:43
void UpdateTextureBar()
Definition: MainFrm.cpp:4931
#define IDC_SPIN_HSCALE
afx_msg HBRUSH OnCtlColor(CDC *pDC, CWnd *pWnd, UINT nCtlColor)
Definition: SurfaceDlg.cpp:435
CSpinButtonCtrl m_wndVShift
Definition: SurfaceDlg.h:60
virtual void OnOK()
Definition: SurfaceDlg.cpp:382
afx_msg void OnClose()
Definition: SurfaceDlg.cpp:394
afx_msg void OnBtnFlipx()
Definition: SurfaceDlg.cpp:611
afx_msg void OnSetfocusVscale()
Definition: SurfaceDlg.cpp:586
GLdouble GLdouble t
Definition: glext.h:2943
afx_msg void OnBtnColor()
Definition: SurfaceDlg.cpp:432