1 // Dialogs.cpp : implementation file
11 static char THIS_FILE
[] = __FILE__
;
20 const FMTINFO fmtInfoArray
[] =
22 D3DFMT_A8R8G8B8
, IDS_FMTDESC_A8R8G8B8
,
23 D3DFMT_A1R5G5B5
, IDS_FMTDESC_A1R5G5B5
,
24 D3DFMT_A4R4G4B4
, IDS_FMTDESC_A4R4G4B4
,
25 D3DFMT_R8G8B8
, IDS_FMTDESC_R8G8B8
,
26 D3DFMT_R5G6B5
, IDS_FMTDESC_R5G6B5
,
27 D3DFMT_A2R10G10B10
, IDS_FMTDESC_A2R10G10B10
,
28 D3DFMT_X8R8G8B8
, IDS_FMTDESC_X8R8G8B8
,
29 D3DFMT_X1R5G5B5
, IDS_FMTDESC_X1R5G5B5
,
30 D3DFMT_R3G3B2
, IDS_FMTDESC_R3G3B2
,
31 D3DFMT_A8R3G3B2
, IDS_FMTDESC_A8R3G3B2
,
32 D3DFMT_X4R4G4B4
, IDS_FMTDESC_X4R4G4B4
,
33 D3DFMT_A16B16G16R16
, IDS_FMTDESC_A16B16G16R16
,
34 D3DFMT_DXT1
, IDS_FMTDESC_DXT1
,
35 D3DFMT_DXT2
, IDS_FMTDESC_DXT2
,
36 D3DFMT_DXT3
, IDS_FMTDESC_DXT3
,
37 D3DFMT_DXT4
, IDS_FMTDESC_DXT4
,
38 D3DFMT_DXT5
, IDS_FMTDESC_DXT5
,
40 const int fmtInfoArraySize
= sizeof(fmtInfoArray
) / sizeof(fmtInfoArray
[0]);
42 /////////////////////////////////////////////////////////////////////////////
43 // CNewTextureDlg dialog
46 CNewTextureDlg::CNewTextureDlg(CWnd
* pParent
/*=NULL*/)
47 : CDialog(CNewTextureDlg::IDD
, pParent
)
49 //{{AFX_DATA_INIT(CNewTextureDlg)
55 m_strFmtDesc
= _T("");
61 void CNewTextureDlg::DoDataExchange(CDataExchange
* pDX
)
63 CDialog::DoDataExchange(pDX
);
64 //{{AFX_DATA_MAP(CNewTextureDlg)
65 DDX_Radio(pDX
, IDC_TEXTURE
, m_iTexType
);
66 DDX_Text(pDX
, IDC_WIDTH
, m_dwWidth
);
67 DDV_MinMaxInt(pDX
, m_dwWidth
, 1, 1024);
68 DDX_Text(pDX
, IDC_HEIGHT
, m_dwHeight
);
69 DDV_MinMaxInt(pDX
, m_dwHeight
, 1, 1024);
70 DDX_Text(pDX
, IDC_DEPTH
, m_dwDepth
);
71 DDV_MinMaxInt(pDX
, m_dwDepth
, 2, 1024);
72 DDX_Radio(pDX
, IDC_A8R8G8B8
, m_iFmt
);
73 DDX_Text(pDX
, IDC_FMTDESC
, m_strFmtDesc
);
74 DDX_Text(pDX
, IDC_MIPCOUNT
, m_numMips
);
75 DDV_MinMaxInt(pDX
, m_numMips
, 1, 20);
80 BEGIN_MESSAGE_MAP(CNewTextureDlg
, CDialog
)
81 //{{AFX_MSG_MAP(CNewTextureDlg)
82 ON_BN_CLICKED(IDC_TEXTURE
, OnChangeTextureType
)
83 ON_BN_CLICKED(IDC_A8R8G8B8
, OnChangeFormat
)
84 ON_BN_CLICKED(IDC_VOLUMETEXTURE
, OnChangeTextureType
)
85 ON_BN_CLICKED(IDC_CUBEMAP
, OnChangeTextureType
)
86 ON_BN_CLICKED(IDC_A4R4G4B4
, OnChangeFormat
)
87 ON_BN_CLICKED(IDC_A1R5G5B5
, OnChangeFormat
)
88 ON_BN_CLICKED(IDC_R5G6B5
, OnChangeFormat
)
89 ON_BN_CLICKED(IDC_R8G8B8
, OnChangeFormat
)
90 ON_BN_CLICKED(IDC_X8R8G8B8
, OnChangeFormat
)
91 ON_BN_CLICKED(IDC_X1R5G5B5
, OnChangeFormat
)
92 ON_BN_CLICKED(IDC_R3G3B2
, OnChangeFormat
)
93 ON_BN_CLICKED(IDC_A8R3G3B2
, OnChangeFormat
)
94 ON_BN_CLICKED(IDC_X4R4G4B4
, OnChangeFormat
)
95 ON_BN_CLICKED(IDC_DXT1
, OnChangeFormat
)
96 ON_BN_CLICKED(IDC_DXT2
, OnChangeFormat
)
97 ON_BN_CLICKED(IDC_DXT3
, OnChangeFormat
)
98 ON_BN_CLICKED(IDC_DXT4
, OnChangeFormat
)
99 ON_BN_CLICKED(IDC_DXT5
, OnChangeFormat
)
100 ON_BN_CLICKED(IDC_A2R10G10B10
, OnChangeFormat
)
101 ON_BN_CLICKED(IDC_A16B16G16R16
, OnChangeFormat
)
105 /////////////////////////////////////////////////////////////////////////////
106 // CNewTextureDlg message handlers
108 BOOL
CNewTextureDlg::OnInitDialog()
110 CDialog::OnInitDialog();
112 OnChangeTextureType();
115 return TRUE
; // return TRUE unless you set the focus to a control
116 // EXCEPTION: OCX Property Pages should return FALSE
120 void CNewTextureDlg::OnChangeTextureType()
127 GetDlgItem(IDC_VOLUMEDEPTHLABEL
)->EnableWindow(TRUE
);
128 GetDlgItem(IDC_DEPTH
)->EnableWindow(TRUE
);
132 // Normal or Cube Tex
133 GetDlgItem(IDC_VOLUMEDEPTHLABEL
)->EnableWindow(FALSE
);
134 GetDlgItem(IDC_DEPTH
)->EnableWindow(FALSE
);
142 void CNewTextureDlg::OnChangeFormat()
145 m_fmt
= fmtInfoArray
[m_iFmt
].fmt
;
146 m_strFmtDesc
.LoadString(fmtInfoArray
[m_iFmt
].idsFmtDesc
);
150 void CNewTextureDlg::OnOK()
154 // TODO: Need to do lots of validation of width/height/depth/mipcount here
159 m_fmt
= fmtInfoArray
[m_iFmt
].fmt
;
164 /////////////////////////////////////////////////////////////////////////////
165 // CCubeMapDlg dialog
168 CCubeMapDlg::CCubeMapDlg(CWnd
* pParent
/*=NULL*/)
169 : CDialog(CCubeMapDlg::IDD
, pParent
)
171 //{{AFX_DATA_INIT(CCubeMapDlg)
177 void CCubeMapDlg::DoDataExchange(CDataExchange
* pDX
)
179 CDialog::DoDataExchange(pDX
);
180 //{{AFX_DATA_MAP(CCubeMapDlg)
181 DDX_Radio(pDX
, IDC_POSX
, m_iFace
);
186 BEGIN_MESSAGE_MAP(CCubeMapDlg
, CDialog
)
187 //{{AFX_MSG_MAP(CCubeMapDlg)
188 // NOTE: the ClassWizard will add message map macros here
193 /////////////////////////////////////////////////////////////////////////////
194 // CVolumeMapDlg dialog
197 CVolumeMapDlg::CVolumeMapDlg(CWnd
* pParent
/*=NULL*/)
198 : CDialog(CVolumeMapDlg::IDD
, pParent
)
200 //{{AFX_DATA_INIT(CVolumeMapDlg)
206 void CVolumeMapDlg::DoDataExchange(CDataExchange
* pDX
)
208 CDialog::DoDataExchange(pDX
);
209 //{{AFX_DATA_MAP(CVolumeMapDlg)
210 DDX_Radio(pDX
, IDC_RADIO2
, m_powLayers
);
215 BEGIN_MESSAGE_MAP(CVolumeMapDlg
, CDialog
)
216 //{{AFX_MSG_MAP(CVolumeMapDlg)
217 // NOTE: the ClassWizard will add message map macros here
221 /////////////////////////////////////////////////////////////////////////////
222 // CVolumeMapDlg message handlers
225 /////////////////////////////////////////////////////////////////////////////
226 // CChangeFmtDlg dialog
229 CChangeFmtDlg::CChangeFmtDlg(CWnd
* pParent
/*=NULL*/)
230 : CDialog(CChangeFmtDlg::IDD
, pParent
)
232 //{{AFX_DATA_INIT(CChangeFmtDlg)
234 m_strFmtDesc
= _T("");
239 void CChangeFmtDlg::DoDataExchange(CDataExchange
* pDX
)
241 CDialog::DoDataExchange(pDX
);
242 //{{AFX_DATA_MAP(CChangeFmtDlg)
243 DDX_Radio(pDX
, IDC_A8R8G8B8
, m_iFmt
);
244 DDX_Text(pDX
, IDC_FMTDESC
, m_strFmtDesc
);
247 GetDlgItem( IDOK
)->EnableWindow( m_iFmt
!= m_iFmtInitial
);
251 BEGIN_MESSAGE_MAP(CChangeFmtDlg
, CDialog
)
252 //{{AFX_MSG_MAP(CChangeFmtDlg)
253 ON_BN_CLICKED(IDC_A1R5G5B5
, OnChangeFmt
)
254 ON_BN_CLICKED(IDC_A4R4G4B4
, OnChangeFmt
)
255 ON_BN_CLICKED(IDC_A8R8G8B8
, OnChangeFmt
)
256 ON_BN_CLICKED(IDC_R5G6B5
, OnChangeFmt
)
257 ON_BN_CLICKED(IDC_R8G8B8
, OnChangeFmt
)
258 ON_BN_CLICKED(IDC_X8R8G8B8
, OnChangeFmt
)
259 ON_BN_CLICKED(IDC_X1R5G5B5
, OnChangeFmt
)
260 ON_BN_CLICKED(IDC_R3G3B2
, OnChangeFmt
)
261 ON_BN_CLICKED(IDC_A8R3G3B2
, OnChangeFmt
)
262 ON_BN_CLICKED(IDC_X4R4G4B4
, OnChangeFmt
)
263 ON_BN_CLICKED(IDC_DXT1
, OnChangeFmt
)
264 ON_BN_CLICKED(IDC_DXT2
, OnChangeFmt
)
265 ON_BN_CLICKED(IDC_DXT3
, OnChangeFmt
)
266 ON_BN_CLICKED(IDC_DXT4
, OnChangeFmt
)
267 ON_BN_CLICKED(IDC_DXT5
, OnChangeFmt
)
268 ON_BN_CLICKED(IDC_A2R10G10B10
, OnChangeFmt
)
269 ON_BN_CLICKED(IDC_A16B16G16R16
, OnChangeFmt
)
273 /////////////////////////////////////////////////////////////////////////////
274 // CChangeFmtDlg message handlers
276 BOOL
CChangeFmtDlg::OnInitDialog()
278 CDialog::OnInitDialog();
280 for( m_iFmt
= 0; m_iFmt
< fmtInfoArraySize
; m_iFmt
++ )
282 if( m_fmt
== fmtInfoArray
[m_iFmt
].fmt
)
286 m_iFmtInitial
= m_iFmt
;
292 return TRUE
; // return TRUE unless you set the focus to a control
293 // EXCEPTION: OCX Property Pages should return FALSE
296 void CChangeFmtDlg::OnChangeFmt()
302 void CChangeFmtDlg::UpdateFmtDesc()
304 m_fmt
= fmtInfoArray
[m_iFmt
].fmt
;
305 m_strFmtDesc
.LoadString(fmtInfoArray
[m_iFmt
].idsFmtDesc
);
309 /////////////////////////////////////////////////////////////////////////////
310 // CResizeDialog dialog
313 CResizeDialog::CResizeDialog(CWnd
* pParent
/*=NULL*/)
314 : CDialog(CResizeDialog::IDD
, pParent
)
316 //{{AFX_DATA_INIT(CResizeDialog)
319 m_oldHeight
= _T("");
325 void CResizeDialog::DoDataExchange(CDataExchange
* pDX
)
327 CDialog::DoDataExchange(pDX
);
328 //{{AFX_DATA_MAP(CResizeDialog)
329 DDX_Text(pDX
, IDC_NEWHEIGHT
, m_newHeight
);
330 DDV_MinMaxUInt(pDX
, m_newHeight
, 1, 4096);
331 DDX_Text(pDX
, IDC_NEWWIDTH
, m_newWidth
);
332 DDV_MinMaxUInt(pDX
, m_newWidth
, 1, 4096);
333 DDX_Text(pDX
, IDC_OLDHEIGHT
, m_oldHeight
);
334 DDX_Text(pDX
, IDC_OLDWIDTH
, m_oldWidth
);
339 BEGIN_MESSAGE_MAP(CResizeDialog
, CDialog
)
340 //{{AFX_MSG_MAP(CResizeDialog)
344 /////////////////////////////////////////////////////////////////////////////
345 // CSpecularPowerDialog dialog
347 CSpecularPowerDialog::CSpecularPowerDialog(CWnd
* pParent
/*=NULL*/)
348 : CDialog(CSpecularPowerDialog::IDD
, pParent
)
350 //{{AFX_DATA_INIT(CSpecularPowerDialog)
351 m_specularPower
= _T("");
356 void CSpecularPowerDialog::DoDataExchange(CDataExchange
* pDX
)
358 CDialog::DoDataExchange(pDX
);
359 //{{AFX_DATA_MAP(CSpecularPowerDialog)
360 DDX_Text(pDX
, IDC_SPECULARPOWER
, m_specularPower
);
365 BEGIN_MESSAGE_MAP(CSpecularPowerDialog
, CDialog
)
366 //{{AFX_MSG_MAP(CSpecularPowerDialog)