DlgCreateEffectTexture.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. /* Copyright (c) 2002-2012 Croteam Ltd.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of version 2 of the GNU General Public License as published by
  4. the Free Software Foundation
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along
  10. with this program; if not, write to the Free Software Foundation, Inc.,
  11. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
  12. // DlgCreateEffectTexture.cpp : implementation file
  13. //
  14. #include "StdH.h"
  15. #include "DlgCreateEffectTexture.h"
  16. #include <Engine/Graphics/TextureEffects.h>
  17. #include <Engine/Templates/Stock_CTextureData.h>
  18. #ifdef _DEBUG
  19. #undef new
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CDlgCreateEffectTexture dialog
  26. #define MAX_ALLOWED_MEX_SIZE 1024*1024
  27. static CDlgCreateEffectTexture *pDialog;
  28. static PIX pixStartU;
  29. static PIX pixStartV;
  30. // called when user pressed LMB on preview effect window
  31. void _OnLeftMouseDown( PIX pixU, PIX pixV)
  32. {
  33. // store starting point
  34. pixStartU = pixU;
  35. pixStartV = pixV;
  36. }
  37. // called when user released LMB on preview effect window
  38. void _OnLeftMouseUp( PIX pixU, PIX pixV)
  39. {
  40. // obtain currently selected effect source type
  41. ULONG ulEffectSourceType = pDialog->m_ctrlEffectTypeCombo.GetCurSel();
  42. // add new effect source
  43. pDialog->m_tdCreated.td_ptegEffect->AddEffectSource( ulEffectSourceType, pixStartU, pixStartV, pixU, pixV);
  44. }
  45. // called when user pressed RMB on preview effect window
  46. void _OnRightMouseDown( PIX pixU, PIX pixV)
  47. {
  48. // obtain currently selected effect source type
  49. ULONG ulEffectSourceType = pDialog->m_ctrlEffectTypeCombo.GetCurSel();
  50. // add new effect source
  51. pDialog->m_tdCreated.td_ptegEffect->AddEffectSource( ulEffectSourceType, pixU, pixV, pixU, pixV);
  52. }
  53. // called when user pressed RMB and move mouse on preview effect window
  54. void _OnRightMouseMove( PIX pixU, PIX pixV)
  55. {
  56. // obtain currently selected effect source type
  57. ULONG ulEffectSourceType = pDialog->m_ctrlEffectTypeCombo.GetCurSel();
  58. // add new effect source
  59. pDialog->m_tdCreated.td_ptegEffect->AddEffectSource( ulEffectSourceType, pixU, pixV, pixU, pixV);
  60. }
  61. CDlgCreateEffectTexture::CDlgCreateEffectTexture(CTFileName fnInputFile/*=""*/, CWnd* pParent /*=NULL*/)
  62. : CDialog(CDlgCreateEffectTexture::IDD, pParent)
  63. {
  64. //{{AFX_DATA_INIT(CDlgCreateEffectTexture)
  65. m_strCreatedTextureName = _T("");
  66. m_strBaseTextureName = _T("");
  67. m_strRendSpeed = _T("");
  68. //}}AFX_DATA_INIT
  69. // set dialog ptr
  70. pDialog = this;
  71. // register left mouse button call back function
  72. m_wndViewCreatedTexture.SetLeftMouseButtonClicked( _OnLeftMouseDown);
  73. // register left mouse release button call back function
  74. m_wndViewCreatedTexture.SetLeftMouseButtonReleased( _OnLeftMouseUp);
  75. // register right mouse button call back function
  76. m_wndViewCreatedTexture.SetRightMouseButtonClicked( _OnRightMouseDown);
  77. // register right mouse button move call back function
  78. m_wndViewCreatedTexture.SetRightMouseButtonMoved( _OnRightMouseMove);
  79. // set invalid initial mip level and size for created texture
  80. m_mexInitialCreatedWidth = 2048;
  81. m_pixInitialCreatedWidth = 256;
  82. m_pixInitialCreatedHeight = 256;
  83. BOOL bCreateNew = TRUE;
  84. if( fnInputFile != "")
  85. {
  86. m_fnCreatedTextureName = fnInputFile;
  87. try
  88. {
  89. // load texture with the same name (if allready exists)
  90. m_tdCreated.Load_t( m_fnCreatedTextureName);
  91. // remember existing texture's width in mexels
  92. m_mexInitialCreatedWidth = m_tdCreated.GetWidth();
  93. m_pixInitialCreatedWidth = m_tdCreated.GetPixWidth();
  94. m_pixInitialCreatedHeight = m_tdCreated.GetPixHeight();
  95. bCreateNew = FALSE;
  96. }
  97. // if texture can't be obtained
  98. catch( char *err_str)
  99. {
  100. // never mind
  101. (void) err_str;
  102. }
  103. }
  104. else
  105. {
  106. // set texture name to unnamed
  107. m_fnCreatedTextureName = CTString("Unnamed");
  108. }
  109. // if we should create a new texture
  110. if( bCreateNew)
  111. {
  112. CTextureData *pBaseTexture;
  113. try
  114. {
  115. // obtain default texture as base
  116. pBaseTexture = _pTextureStock->Obtain_t( CTFILENAME("Textures\\Editor\\Default.tex"));
  117. }
  118. // if texture can't be obtained
  119. catch( char *err_str)
  120. {
  121. // stop executing program
  122. FatalError( "%s", err_str);
  123. }
  124. // create empty effect texture
  125. m_tdCreated.CreateEffectTexture(m_pixInitialCreatedWidth, m_pixInitialCreatedHeight,
  126. m_mexInitialCreatedWidth, pBaseTexture, 0);
  127. // release default texture
  128. _pTextureStock->Release(pBaseTexture);
  129. }
  130. m_wndViewCreatedTexture.m_toTexture.SetData( &m_tdCreated);
  131. // copy texture name to text control
  132. m_strCreatedTextureName = m_fnCreatedTextureName;
  133. m_bPreviewWindowsCreated = FALSE;
  134. }
  135. CDlgCreateEffectTexture::~CDlgCreateEffectTexture()
  136. {
  137. m_tdCreated.MarkUsed();
  138. m_wndViewCreatedTexture.m_toTexture.SetData( NULL);
  139. m_tdCreated.MarkUnused();
  140. }
  141. void CDlgCreateEffectTexture::SetNewBaseTexture( CTFileName fnNewBase)
  142. {
  143. if( fnNewBase != "")
  144. {
  145. // try to
  146. try
  147. {
  148. // obtain texture with the same name (if allready exists)
  149. CTextureData *pTD = _pTextureStock->Obtain_t( fnNewBase);
  150. pTD->Reload();
  151. if( pTD->td_ptegEffect != NULL)
  152. {
  153. _pTextureStock->Release( pTD);
  154. ThrowF_t( "Texture '%s' is an effect texture.", (CTString&)fnNewBase);
  155. }
  156. // if there is base texture obtained, release it
  157. if( m_tdCreated.td_ptdBaseTexture!= NULL)
  158. {
  159. _pTextureStock->Release( m_tdCreated.td_ptdBaseTexture);
  160. // reset base texture ptr
  161. m_tdCreated.td_ptdBaseTexture = NULL;
  162. }
  163. // set new base texture ptr
  164. m_tdCreated.td_ptdBaseTexture = pTD;
  165. m_pixInitialCreatedWidth = pTD->GetPixWidth();
  166. m_pixInitialCreatedHeight = pTD->GetPixHeight();
  167. UpdateData( FALSE);
  168. SelectPixSizeCombo();
  169. }
  170. catch(char *err_str)
  171. {
  172. AfxMessageBox( CString(err_str));
  173. return;
  174. }
  175. }
  176. }
  177. void CDlgCreateEffectTexture::DoDataExchange(CDataExchange* pDX)
  178. {
  179. CDialog::DoDataExchange(pDX);
  180. // if dialog is receiving data
  181. if(pDX->m_bSaveAndValidate == FALSE)
  182. {
  183. m_strBaseTextureName = "None";
  184. CTFileName fnNewBase;
  185. // if there is base texture obtained, get name
  186. if( m_tdCreated.td_ptdBaseTexture != NULL)
  187. {
  188. PIX pixBaseTextureWidth = m_tdCreated.td_ptdBaseTexture->GetPixWidth();
  189. PIX pixBaseTextureHeight = m_tdCreated.td_ptdBaseTexture->GetPixHeight();
  190. char achrBaseTextureName[ 256];
  191. sprintf( achrBaseTextureName, "%s (%d x %d)",
  192. (CTString&)m_tdCreated.td_ptdBaseTexture->GetName(),
  193. pixBaseTextureWidth, pixBaseTextureHeight);
  194. m_strBaseTextureName = achrBaseTextureName;
  195. }
  196. }
  197. //{{AFX_DATA_MAP(CDlgCreateEffectTexture)
  198. DDX_Control(pDX, IDC_CHEQUERED_ALPHA, m_ctrlCheckButton);
  199. DDX_Control(pDX, IDC_MEX_SIZE, m_ctrlMexSizeCombo);
  200. DDX_Control(pDX, IDC_PIX_WIDTH, m_ctrlPixWidthCombo);
  201. DDX_Control(pDX, IDC_PIX_HEIGHT, m_ctrlPixHeightCombo);
  202. DDX_Control(pDX, IDC_EFFECT_CLASS, m_ctrlEffectClassCombo);
  203. DDX_Control(pDX, IDC_EFFECT_TYPE, m_ctrlEffectTypeCombo);
  204. DDX_Text(pDX, IDC_CREATED_TEXTURE_NAME, m_strCreatedTextureName);
  205. DDX_Text(pDX, IDC_BASE_TEXTURE_NAME, m_strBaseTextureName);
  206. DDX_Text(pDX, IDC_REND_SPEED, m_strRendSpeed);
  207. //}}AFX_DATA_MAP
  208. // if dialog is giving data
  209. if(pDX->m_bSaveAndValidate != FALSE)
  210. {
  211. }
  212. }
  213. BEGIN_MESSAGE_MAP(CDlgCreateEffectTexture, CDialog)
  214. //{{AFX_MSG_MAP(CDlgCreateEffectTexture)
  215. ON_WM_PAINT()
  216. ON_BN_CLICKED(IDC_CHEQUERED_ALPHA, OnChequeredAlpha)
  217. ON_BN_CLICKED(ID_BROWSE_BASE, OnBrowseBase)
  218. ON_BN_CLICKED(ID_CREATE_AS, OnCreateAs)
  219. ON_BN_CLICKED(ID_REMOVE_ALL_EFFECTS, OnRemoveAllEffects)
  220. ON_CBN_SELCHANGE(IDC_PIX_HEIGHT, OnSelchangePixHeight)
  221. ON_CBN_SELCHANGE(IDC_PIX_WIDTH, OnSelchangePixWidth)
  222. ON_CBN_SELCHANGE(IDC_MEX_SIZE, OnSelchangeMexSize)
  223. ON_BN_CLICKED(ID_CREATE, OnCreate)
  224. ON_CBN_SELCHANGE(IDC_EFFECT_CLASS, OnSelchangeEffectClass)
  225. ON_CBN_SELCHANGE(IDC_EFFECT_TYPE, OnSelchangeEffectType)
  226. //}}AFX_MSG_MAP
  227. END_MESSAGE_MAP()
  228. /////////////////////////////////////////////////////////////////////////////
  229. // CDlgCreateEffectTexture message handlers
  230. void CDlgCreateEffectTexture::OnPaint()
  231. {
  232. CPaintDC dc(this); // device context for painting
  233. // if texture preview windows are not yet created
  234. if( !m_bPreviewWindowsCreated)
  235. {
  236. // ---------------- Create custom window that will show how created texture will look like
  237. CWnd *pWndCreatedTexturePreview = GetDlgItem(IDC_TEXTURE_PREVIEW_WINDOW);
  238. ASSERT(pWndCreatedTexturePreview != NULL);
  239. CRect rectPreviewCreatedTextureWnd;
  240. // get rectangle occupied by preview texture window
  241. pWndCreatedTexturePreview->GetWindowRect( &rectPreviewCreatedTextureWnd);
  242. ScreenToClient( &rectPreviewCreatedTextureWnd);
  243. // create window for for showing created texture
  244. m_wndViewCreatedTexture.Create( NULL, NULL, WS_BORDER|WS_VISIBLE, rectPreviewCreatedTextureWnd,
  245. this, IDW_VIEW_CREATED_TEXTURE);
  246. // mark that custom windows are created
  247. m_bPreviewWindowsCreated = TRUE;
  248. }
  249. }
  250. void CDlgCreateEffectTexture::OnChequeredAlpha()
  251. {
  252. // toggle chequered alpha on/off
  253. m_wndViewCreatedTexture.m_bChequeredAlpha = !m_wndViewCreatedTexture.m_bChequeredAlpha;
  254. }
  255. void CDlgCreateEffectTexture::InitializeSizeCombo(void)
  256. {
  257. // clear combo box
  258. m_ctrlMexSizeCombo.ResetContent();
  259. INDEX iSelectedWidth = m_ctrlPixWidthCombo.GetCurSel();
  260. INDEX iSelectedHeight = m_ctrlPixHeightCombo.GetCurSel();
  261. // obtain selected size in pixels
  262. m_pixInitialCreatedWidth = 1<<iSelectedWidth;
  263. m_pixInitialCreatedHeight = 1<<iSelectedHeight;
  264. // obtain all available potentions of source picture's dimensions
  265. INDEX iPotention = 0;
  266. // set default created texture's size
  267. INDEX iInitialSelectedSize = 0;
  268. FOREVER
  269. {
  270. char strSize[ 64];
  271. MEX mexPotentionWidth = m_pixInitialCreatedWidth * (1 << iPotention);
  272. MEX mexPotentionHeight = m_pixInitialCreatedHeight * (1 << iPotention);
  273. if( (mexPotentionWidth > MAX_ALLOWED_MEX_SIZE) ||
  274. (mexPotentionHeight > MAX_ALLOWED_MEX_SIZE))
  275. break;
  276. sprintf( strSize, "%.2f x %.2f",
  277. METERS_MEX( mexPotentionWidth), METERS_MEX( mexPotentionHeight));
  278. INDEX iAddedAs = m_ctrlMexSizeCombo.AddString( CString(strSize));
  279. // connect item and represented mex value
  280. m_ctrlMexSizeCombo.SetItemData( iAddedAs, mexPotentionWidth);
  281. // try to select consistent size
  282. if( mexPotentionWidth == m_mexInitialCreatedWidth)
  283. {
  284. iInitialSelectedSize = iPotention;
  285. }
  286. // next potention
  287. iPotention ++;
  288. }
  289. // select size
  290. m_ctrlMexSizeCombo.SetCurSel( iInitialSelectedSize);
  291. }
  292. void CDlgCreateEffectTexture::InitializeEffectTypeCombo( void)
  293. {
  294. // get selected effect class
  295. INDEX iClass = m_ctrlEffectClassCombo.GetCurSel();
  296. // obtain effect source table for current effect class
  297. struct TextureEffectSourceType *patestSourceEffectTypes =
  298. _ategtTextureEffectGlobalPresets[ iClass].tet_atestEffectSourceTypes;
  299. INDEX ctSourceEffectTypes = _ategtTextureEffectGlobalPresets[ iClass].tet_ctEffectSourceTypes;
  300. // initialize effect groups combo
  301. m_ctrlEffectTypeCombo.ResetContent();
  302. for( INDEX iEffectType=0; iEffectType<ctSourceEffectTypes; iEffectType++)
  303. {
  304. m_ctrlEffectTypeCombo.AddString(
  305. CString(patestSourceEffectTypes[ iEffectType].test_strName));
  306. }
  307. m_ctrlEffectTypeCombo.SetCurSel( 0);
  308. }
  309. void CDlgCreateEffectTexture::SelectPixSizeCombo(void)
  310. {
  311. m_ctrlPixWidthCombo.SetCurSel( 0);
  312. m_ctrlPixHeightCombo.SetCurSel( 0);
  313. for( INDEX iWidthItem=0; iWidthItem<m_ctrlPixWidthCombo.GetCount(); iWidthItem++)
  314. {
  315. if( (1<<iWidthItem) == m_pixInitialCreatedWidth)
  316. {
  317. m_ctrlPixWidthCombo.SetCurSel( iWidthItem);
  318. }
  319. }
  320. for( INDEX iHeightItem=0; iHeightItem<m_ctrlPixWidthCombo.GetCount(); iHeightItem++)
  321. {
  322. if( (1<<iHeightItem) == m_pixInitialCreatedHeight)
  323. {
  324. m_ctrlPixHeightCombo.SetCurSel( iHeightItem);
  325. }
  326. }
  327. InitializeSizeCombo();
  328. }
  329. BOOL CDlgCreateEffectTexture::OnInitDialog()
  330. {
  331. CDialog::OnInitDialog();
  332. // set default created texture's size
  333. INDEX iInitialSelectedSize = 0;
  334. // first combo entry is selected by default (requesting maximum mip maps to be created)
  335. INDEX iInitialSelectedMipMapCombo = 0;
  336. // fill width combo
  337. m_ctrlPixWidthCombo.ResetContent();
  338. m_ctrlPixWidthCombo.AddString(L"1");
  339. m_ctrlPixWidthCombo.AddString(L"2");
  340. m_ctrlPixWidthCombo.AddString(L"4");
  341. m_ctrlPixWidthCombo.AddString(L"8");
  342. m_ctrlPixWidthCombo.AddString(L"16");
  343. m_ctrlPixWidthCombo.AddString(L"32");
  344. m_ctrlPixWidthCombo.AddString(L"64");
  345. m_ctrlPixWidthCombo.AddString(L"128");
  346. m_ctrlPixWidthCombo.AddString(L"256");
  347. // fill height combo
  348. m_ctrlPixHeightCombo.ResetContent();
  349. m_ctrlPixHeightCombo.AddString(L"1");
  350. m_ctrlPixHeightCombo.AddString(L"2");
  351. m_ctrlPixHeightCombo.AddString(L"4");
  352. m_ctrlPixHeightCombo.AddString(L"8");
  353. m_ctrlPixHeightCombo.AddString(L"16");
  354. m_ctrlPixHeightCombo.AddString(L"32");
  355. m_ctrlPixHeightCombo.AddString(L"64");
  356. m_ctrlPixHeightCombo.AddString(L"128");
  357. m_ctrlPixHeightCombo.AddString(L"256");
  358. // initialize effect groups combo
  359. m_ctrlEffectClassCombo.ResetContent();
  360. for( INDEX iEffectClass=0; iEffectClass<_ctTextureEffectGlobalPresets; iEffectClass++)
  361. {
  362. m_ctrlEffectClassCombo.AddString(
  363. CString(_ategtTextureEffectGlobalPresets[ iEffectClass].tegt_strName));
  364. }
  365. INDEX iSelectedEffectClass = m_tdCreated.td_ptegEffect->teg_ulEffectType;
  366. m_ctrlEffectClassCombo.SetCurSel( iSelectedEffectClass);
  367. // initialize sub effects
  368. InitializeEffectTypeCombo();
  369. m_ctrlCheckButton.SetCheck( 1);
  370. SelectPixSizeCombo();
  371. return TRUE;
  372. }
  373. void CDlgCreateEffectTexture::OnBrowseBase()
  374. {
  375. CTFileName fnNewBase;
  376. // if there is base texture obtained, release it
  377. if( m_tdCreated.td_ptdBaseTexture != NULL)
  378. {
  379. fnNewBase = _EngineGUI.BrowseTexture( m_tdCreated.td_ptdBaseTexture->GetName(),
  380. KEY_NAME_BASE_TEXTURE_DIR, "Browse base texture");
  381. }
  382. else
  383. {
  384. fnNewBase = _EngineGUI.BrowseTexture( CTString(""), KEY_NAME_BASE_TEXTURE_DIR,
  385. "Browse base texture");
  386. }
  387. SetNewBaseTexture( fnNewBase);
  388. CreateTexture();
  389. }
  390. void CDlgCreateEffectTexture::OnRemoveAllEffects()
  391. {
  392. CreateTexture();
  393. }
  394. void CDlgCreateEffectTexture::OnSelchangeMexSize()
  395. {
  396. CreateTexture();
  397. }
  398. void CDlgCreateEffectTexture::OnSelchangePixHeight()
  399. {
  400. INDEX iSelectedWidth = m_ctrlPixWidthCombo.GetCurSel();
  401. INDEX iSelectedHeight = m_ctrlPixHeightCombo.GetCurSel();
  402. InitializeSizeCombo();
  403. CreateTexture();
  404. }
  405. void CDlgCreateEffectTexture::OnSelchangePixWidth()
  406. {
  407. INDEX iSelectedWidth = m_ctrlPixWidthCombo.GetCurSel();
  408. INDEX iSelectedHeight = m_ctrlPixHeightCombo.GetCurSel();
  409. InitializeSizeCombo();
  410. CreateTexture();
  411. }
  412. void CDlgCreateEffectTexture::CreateTexture( void)
  413. {
  414. // obtain selected sizes
  415. m_pixInitialCreatedWidth = 1<<m_ctrlPixWidthCombo.GetCurSel();
  416. m_pixInitialCreatedHeight = 1<<m_ctrlPixHeightCombo.GetCurSel();
  417. m_mexInitialCreatedWidth = m_ctrlMexSizeCombo.GetItemData( m_ctrlMexSizeCombo.GetCurSel());
  418. // get selected effect class
  419. INDEX iClass = m_ctrlEffectClassCombo.GetCurSel();
  420. // create empty effect texture
  421. m_tdCreated.CreateEffectTexture( m_pixInitialCreatedWidth, m_pixInitialCreatedHeight,
  422. m_mexInitialCreatedWidth, m_tdCreated.td_ptdBaseTexture, iClass);
  423. }
  424. void CDlgCreateEffectTexture::OnCreateAs()
  425. {
  426. // call save texture file requester
  427. CTFileName fnNewTexName = _EngineGUI.BrowseTexture( CTString(CStringA(m_strCreatedTextureName)),
  428. KEY_NAME_CREATE_TEXTURE_DIR, "Create texture as", FALSE);
  429. // if picked valid name
  430. if( fnNewTexName != "")
  431. {
  432. // save as final texture
  433. try
  434. {
  435. m_tdCreated.Save_t( fnNewTexName);
  436. }
  437. catch(char *err_str)
  438. {
  439. AfxMessageBox( CString(err_str));
  440. return;
  441. }
  442. // remember new name
  443. m_strCreatedTextureName = fnNewTexName;
  444. m_fnCreatedTextureName = fnNewTexName;
  445. // show the change
  446. UpdateData( FALSE);
  447. }
  448. }
  449. void CDlgCreateEffectTexture::OnCreate()
  450. {
  451. if( m_strCreatedTextureName == "Unnamed")
  452. {
  453. OnCreateAs();
  454. }
  455. else
  456. {
  457. // save as final texture
  458. try
  459. {
  460. m_fnCreatedTextureName = CTString( CStringA(m_strCreatedTextureName));
  461. m_tdCreated.Save_t( m_fnCreatedTextureName);
  462. }
  463. catch(char *err_str)
  464. {
  465. AfxMessageBox( CString(err_str));
  466. return;
  467. }
  468. }
  469. if( m_strCreatedTextureName != "Unnamed")
  470. {
  471. EndDialog( IDOK);
  472. }
  473. }
  474. void CDlgCreateEffectTexture::OnSelchangeEffectClass()
  475. {
  476. // initialize sub effects
  477. InitializeEffectTypeCombo();
  478. CreateTexture();
  479. }
  480. void CDlgCreateEffectTexture::OnSelchangeEffectType()
  481. {
  482. }