1
0

r_transition.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. /*
  2. LICENSE
  3. -------
  4. Copyright 2005 Nullsoft, Inc.
  5. All rights reserved.
  6. Redistribution and use in source and binary forms, with or without modification,
  7. are permitted provided that the following conditions are met:
  8. * Redistributions of source code must retain the above copyright notice,
  9. this list of conditions and the following disclaimer.
  10. * Redistributions in binary form must reproduce the above copyright notice,
  11. this list of conditions and the following disclaimer in the documentation
  12. and/or other materials provided with the distribution.
  13. * Neither the name of Nullsoft nor the names of its contributors may be used to
  14. endorse or promote products derived from this software without specific prior written permission.
  15. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  16. IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  17. FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  18. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  19. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  20. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  21. IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. */
  24. #include <windows.h>
  25. #include <stdio.h>
  26. #include <commctrl.h>
  27. #include <process.h>
  28. #include "draw.h"
  29. #include "resource.h"
  30. #include "cfgwnd.h"
  31. #include "r_defs.h"
  32. #include "r_unkn.h"
  33. #include "r_transition.h"
  34. #include "render.h"
  35. #include <math.h>
  36. #include "../Agave/Language/api_language.h"
  37. extern char *scanstr_back(char *str, char *toscan, char *defval);
  38. int transitionmodes[] =
  39. {
  40. IDS_RANDOM,
  41. IDS_CROSS_DISSOLVE,
  42. IDS_L_R_PUSH,
  43. IDS_R_L_PUSH,
  44. IDS_T_B_PUSH,
  45. IDS_B_T_PUSH,
  46. IDS_9_RANDOM_BLOCKS,
  47. IDS_SPLIT_L_R_PUSH,
  48. IDS_L_R_CENTER_PUSH,
  49. IDS_L_R_CENTER_SQUEEZE,
  50. IDS_L_R_WIPE,
  51. IDS_R_L_WIPE,
  52. IDS_T_B_WIPE,
  53. IDS_B_T_WIPE,
  54. IDS_DOT_DISSOLVE,
  55. };
  56. static C_RenderTransitionClass *g_this;
  57. C_RenderTransitionClass::C_RenderTransitionClass()
  58. {
  59. last_file[0]=0;
  60. l_w=l_h=0;
  61. memset(fbs,0,sizeof(fbs));
  62. enabled=0;
  63. start_time=0;
  64. _dotransitionflag=0;
  65. initThread=0;
  66. }
  67. C_RenderTransitionClass::~C_RenderTransitionClass()
  68. {
  69. int x;
  70. if (initThread)
  71. {
  72. WaitForSingleObject(initThread,INFINITE);
  73. CloseHandle(initThread);
  74. initThread=0;
  75. } for (x = 0; x < 4; x ++)
  76. {
  77. if (fbs[x]) GlobalFree(fbs[x]);
  78. fbs[x]=NULL;
  79. }
  80. }
  81. unsigned int WINAPI C_RenderTransitionClass::m_initThread(LPVOID p)
  82. {
  83. C_RenderTransitionClass *_this=(C_RenderTransitionClass*)p;
  84. FILETIME ft;
  85. GetSystemTimeAsFileTime(&ft);
  86. srand(ft.dwLowDateTime|ft.dwHighDateTime^GetCurrentThreadId());
  87. if (cfg_transitions2&32)
  88. {
  89. extern HANDLE g_hThread;
  90. int d=GetThreadPriority(g_hThread);
  91. if (d == THREAD_PRIORITY_TIME_CRITICAL) d=THREAD_PRIORITY_HIGHEST;
  92. else if (d == THREAD_PRIORITY_HIGHEST) d=THREAD_PRIORITY_ABOVE_NORMAL;
  93. else if (d == THREAD_PRIORITY_ABOVE_NORMAL) d=THREAD_PRIORITY_NORMAL;
  94. else if (d == THREAD_PRIORITY_NORMAL) d=THREAD_PRIORITY_BELOW_NORMAL;
  95. else if (d == THREAD_PRIORITY_BELOW_NORMAL) d=THREAD_PRIORITY_LOWEST;
  96. else if (d == THREAD_PRIORITY_LOWEST) d=THREAD_PRIORITY_IDLE;
  97. SetThreadPriority(GetCurrentThread(),d);
  98. }
  99. int *fb=(int *)GlobalAlloc(GPTR,_this->l_w*_this->l_h*sizeof(int));
  100. char last_visdata[2][2][576]={0,};
  101. g_render_effects2->render(last_visdata,0x80000000,fb,fb,_this->l_w,_this->l_h);
  102. GlobalFree((HGLOBAL)fb);
  103. _this->_dotransitionflag=2;
  104. _endthreadex(0);
  105. return 0;
  106. }
  107. int C_RenderTransitionClass::LoadPreset(char *file, int which, C_UndoItem *item)
  108. {
  109. if (initThread)
  110. {
  111. if (WaitForSingleObject(initThread,0)==WAIT_TIMEOUT)
  112. {
  113. DDraw_SetStatusText("loading [wait]...",1000*100);
  114. return 2;
  115. }
  116. CloseHandle(initThread);
  117. initThread=0;
  118. }
  119. EnterCriticalSection(&g_render_cs);
  120. if (enabled)
  121. {
  122. enabled=0;
  123. }
  124. int r = 0;
  125. if (item)
  126. {
  127. g_render_effects2->__LoadPresetFromUndo(*item,1);
  128. last_which=which;
  129. _dotransitionflag=2;
  130. }
  131. else
  132. {
  133. lstrcpyn(last_file,file,sizeof(last_file));
  134. if (file[0]) r=g_render_effects2->__LoadPreset(file,1);
  135. else
  136. {
  137. g_render_effects2->clearRenders();
  138. }
  139. if (!r && l_w && l_h && (cfg_transitions2&which) && ((cfg_transitions2&128)||DDraw_IsFullScreen()))
  140. {
  141. DWORD id;
  142. last_which=which;
  143. _dotransitionflag=1;
  144. initThread=(HANDLE)_beginthreadex(NULL,0,m_initThread,(LPVOID)this,0,(unsigned int*)&id);
  145. DDraw_SetStatusText("loading...",1000*100);
  146. }
  147. else
  148. {
  149. last_which=which;
  150. _dotransitionflag=2;
  151. }
  152. if (r)
  153. {
  154. char s[MAX_PATH*2];
  155. wsprintf(s,WASABI_API_LNGSTRING(IDS_ERROR_LOADING_X),scanstr_back(last_file,"\\",last_file-1)+1);
  156. DDraw_SetStatusText(s);
  157. _dotransitionflag=3;
  158. }
  159. C_UndoStack::clear();
  160. C_UndoStack::saveundo(1);
  161. C_UndoStack::cleardirty();
  162. }
  163. LeaveCriticalSection(&g_render_cs);
  164. return !!r;
  165. }
  166. #define PI 3.14159265358979323846
  167. //264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848...
  168. extern int g_rnd_cnt;
  169. int C_RenderTransitionClass::render(char visdata[2][2][576], int isBeat, int *framebuffer, int *fbout, int w, int h)
  170. {
  171. if (_dotransitionflag||enabled) g_rnd_cnt=0;
  172. if (_dotransitionflag==2 || _dotransitionflag == 3)
  173. {
  174. int notext=_dotransitionflag==3;
  175. _dotransitionflag=0;
  176. if (cfg_transitions&last_which)
  177. {
  178. curtrans = (cfg_transition_mode&0x7fff) ? (cfg_transition_mode&0x7fff) : (rand() % ((sizeof(transitionmodes)/sizeof(transitionmodes[0]))-1))+1;
  179. if (cfg_transition_mode&0x8000) curtrans|=0x8000;
  180. ep[0]=0;
  181. ep[1]=2;
  182. mask=0;
  183. start_time=0;
  184. enabled=1;
  185. }
  186. C_RenderListClass *temp=g_render_effects;
  187. g_render_effects=g_render_effects2;
  188. g_render_effects2=temp;
  189. extern int need_repop;
  190. extern char *extension(char *fn);
  191. need_repop=1;
  192. PostMessage(g_hwndDlg,WM_USER+20,0,0);
  193. if (!notext && stricmp("aph",extension(last_file)))
  194. {
  195. char buf[512];
  196. strncpy(buf,scanstr_back(last_file,"\\",last_file-1)+1,510);
  197. buf[510]=0;
  198. scanstr_back(buf,".",buf+strlen(buf))[0]=0;
  199. strcat(buf," ");
  200. DDraw_SetStatusText(buf);
  201. }
  202. }
  203. if (!enabled)
  204. {
  205. int x;
  206. l_w=w;
  207. l_h=h;
  208. if (fbs[0]) for (x = 0; x < 4; x ++)
  209. {
  210. if (fbs[x])
  211. {
  212. GlobalFree(fbs[x]);
  213. fbs[x]=NULL;
  214. }
  215. }
  216. if (!initThread && g_render_effects2->getNumRenders())
  217. {
  218. g_render_effects2->clearRenders();
  219. g_render_effects2->freeBuffers();
  220. }
  221. return g_render_effects->render(visdata,isBeat,framebuffer,fbout,w,h);
  222. }
  223. // handle resize
  224. if (l_w != w || l_h != h || !fbs[0])
  225. {
  226. l_w=w;
  227. l_h=h;
  228. int x;
  229. for (x = 0; x < 4; x ++)
  230. {
  231. if (fbs[x]) GlobalFree(fbs[x]);
  232. fbs[x]=(int*)GlobalAlloc(GPTR,l_w*l_h*sizeof(int));
  233. }
  234. }
  235. if (start_time == 0)
  236. {
  237. memcpy(fbs[ep[0]],framebuffer,sizeof(int)*l_w*l_h);
  238. memcpy(fbs[ep[1]],framebuffer,sizeof(int)*l_w*l_h);
  239. }
  240. // maybe there's a faster way than using 3 more buffers without screwing
  241. // any effect... justin ?
  242. if (curtrans&0x8000)
  243. ep[1]^=g_render_effects2->render(visdata,isBeat,fbs[ep[1]],fbs[ep[1]^1],w,h)&1;
  244. ep[0]^=g_render_effects->render(visdata,isBeat,fbs[ep[0]],fbs[ep[0]^1],w,h)&1;
  245. int *p = fbs[ep[1]];
  246. int *d = fbs[ep[0]];
  247. int *o = framebuffer;
  248. int x=w*h;
  249. int ttime=250*cfg_transitions_speed;
  250. if (ttime<100) ttime=100;
  251. int n;
  252. if (!start_time) { n=0; start_time=GetTickCount(); }
  253. else n=MulDiv(GetTickCount()-start_time,256,ttime);
  254. if (n >= 255) n=255;
  255. float sintrans = (float)(sin(((float)n/255)*PI-PI/2)/2+0.5); // used for smoothing transitions
  256. // now sintrans does a smooth curve
  257. // from 0 to 1
  258. switch (curtrans&0x7fff)
  259. {
  260. case 1: // Crossfade
  261. mmx_adjblend_block(o,d,p,x,n);
  262. break;
  263. case 2: // Left to right push
  264. {
  265. int i = (int)(sintrans*w);
  266. int j;
  267. for (j=0;j<h;j++)
  268. {
  269. memcpy(framebuffer+(j*w), d+(j*w)+(w-i), i*4);
  270. memcpy(framebuffer+(j*w)+i, p+(j*w), (w-i)*4);
  271. }
  272. }
  273. break;
  274. case 3: // Right to left push
  275. {
  276. int i = (int)(sintrans*w);
  277. int j;
  278. for (j=0;j<h;j++)
  279. {
  280. memcpy(framebuffer+(j*w), p+(i+j*w), (w-i)*4);
  281. memcpy(framebuffer+(j*w)+(w-i), d+(j*w), i*4);
  282. }
  283. }
  284. break;
  285. case 4: // Top to bottom push
  286. {
  287. int i = (int)(sintrans*h);
  288. memcpy(framebuffer, d+(h-i)*w, w*i*4);
  289. memcpy(framebuffer+w*i, p, w*(h-i)*4);
  290. }
  291. break;
  292. case 5: // Bottom to Top push
  293. {
  294. int i = (int)(sintrans*h);
  295. memcpy(framebuffer,p+i*w, w*(h-i)*4);
  296. memcpy(framebuffer+w*(h-i), d, w*i*4);
  297. }
  298. break;
  299. case 6: // 9 random blocks
  300. {
  301. if (!(mask&(1<<(10+n/28))))
  302. {
  303. int r=0;
  304. if ((mask & 0x1ff) != 0x1ff)
  305. {
  306. do
  307. {
  308. r = rand()%9;
  309. }
  310. while ((1 << r) & mask);
  311. }
  312. mask |= (1<<r)|(1<<(10+n/28));
  313. }
  314. int j;
  315. int tw=w/3, th=h/3;
  316. int twr=w-2*tw;
  317. memcpy(framebuffer, p, w*h*4);
  318. int i;
  319. for (i=0;i<9;i++)
  320. {
  321. if (mask & (1<<i))
  322. {
  323. int end=i/3*th+th;
  324. if (i > 5) end=h;
  325. for (j=i/3*th;j<end;j++)
  326. memcpy(framebuffer+(j*w)+(i%3)*tw, d+(j*w)+(i%3)*tw, (i%3==2) ? twr*4 : tw*4);
  327. }
  328. }
  329. }
  330. break;
  331. case 7: // Left/Right to Right/Left
  332. {
  333. int i = (int)(sintrans*w);
  334. int j;
  335. for (j=0;j<h/2;j++)
  336. {
  337. memcpy(framebuffer+(i+j*w), p+(j*w), (w-i)*4);
  338. memcpy(framebuffer+(j*w), d+((j+1)*w)-i, i*4);
  339. }
  340. for (j=h/2;j<h;j++)
  341. {
  342. memcpy(framebuffer+(j*w), p+(i+j*w), (w-i)*4);
  343. memcpy(framebuffer+(j*w)+(w-i), d+(j*w), i*4);
  344. }
  345. }
  346. break;
  347. case 8: // Left/Right to Center
  348. {
  349. int i = (int)(sintrans*w/2);
  350. int j;
  351. for (j=0;j<h;j++)
  352. {
  353. memcpy(framebuffer+(j*w), d+((j+1)*w-i-w/2), i*4);
  354. memcpy(framebuffer+((j+1)*w-i), d+(j*w+w/2), i*4);
  355. memcpy(framebuffer+(j*w)+i, p+(j*w)+i, (w-i*2)*4);
  356. }
  357. }
  358. break;
  359. case 9: // Left/Right to Center, squeeze
  360. {
  361. int i = (int)(sintrans*w/2);
  362. int j;
  363. for (j=0;j<h;j++)
  364. {
  365. if (i)
  366. {
  367. int xl=i;
  368. int xp=0;
  369. int dxp=((w/2)<<16)/xl;
  370. int *ot=framebuffer+(j*w);
  371. int *it=d+(j*w);
  372. while (xl--)
  373. {
  374. *ot++=it[xp>>16];
  375. xp+=dxp;
  376. }
  377. }
  378. if (i*2 != w)
  379. {
  380. int xl=w-i*2;
  381. int xp=0;
  382. int dxp=(w<<16)/xl;
  383. int *ot=framebuffer+(j*w)+i;
  384. int *it=p+(j*w);
  385. while (xl--)
  386. {
  387. *ot++=it[xp>>16];
  388. xp+=dxp;
  389. }
  390. }
  391. if (i)
  392. {
  393. int xl=i;
  394. int xp=0;
  395. int dxp=((w/2)<<16)/xl;
  396. int *ot=framebuffer+(j*w)+w-i;
  397. int *it=d+(j*w)+w/2;
  398. while (xl--)
  399. {
  400. *ot++=it[xp>>16];
  401. xp+=dxp;
  402. }
  403. }
  404. }
  405. }
  406. break;
  407. case 10: // Left to right wipe
  408. {
  409. int i = (int)(sintrans*w);
  410. int j;
  411. for (j=0;j<h;j++)
  412. {
  413. memcpy(framebuffer+(i+j*w), p+(j*w)+i, (w-i)*4);
  414. memcpy(framebuffer+(j*w), d+(j*w), i*4);
  415. }
  416. }
  417. break;
  418. case 11: // Right to left wipe
  419. {
  420. int i = (int)(sintrans*w);
  421. int j;
  422. for (j=0;j<h;j++)
  423. {
  424. memcpy(framebuffer+(j*w), p+(j*w), (w-i)*4);
  425. memcpy(framebuffer+(j*w)+(w-i), d+(j*w)+(w-i), i*4);
  426. }
  427. }
  428. break;
  429. case 12: // Top to bottom wipe
  430. {
  431. int i = (int)(sintrans*h);
  432. memcpy(framebuffer, d, w*i*4);
  433. memcpy(framebuffer+w*i, p+w*i, w*(h-i)*4);
  434. }
  435. break;
  436. case 13: // Bottom to top wipe
  437. {
  438. int i = (int)(sintrans*h);
  439. memcpy(framebuffer, p, w*(h-i)*4);
  440. memcpy(framebuffer+w*(h-i), d+w*(h-i), w*i*4);
  441. }
  442. break;
  443. case 14: // dot dissolve
  444. {
  445. int i=((int)(sintrans*5))-5;
  446. int j;
  447. int t=0;
  448. int dir=1;
  449. if (i < 0)
  450. {
  451. dir=!dir;
  452. i++;
  453. i=-i;
  454. }
  455. i=1<<i;
  456. for (j = 0; j < h; j ++)
  457. {
  458. if (t++==i)
  459. {
  460. int x=w;
  461. t=0;
  462. int t2=0;
  463. int *of=framebuffer+j*w;
  464. int *p2=(dir?p:d)+j*w;
  465. int *d2=(dir?d:p)+j*w;
  466. while (x--)
  467. {
  468. if (t2++==i)
  469. {
  470. of[0]=p2[0];
  471. t2=0;
  472. }
  473. else of[0]=d2[0];
  474. p2++;
  475. d2++;
  476. of++;
  477. }
  478. }
  479. else
  480. memcpy(framebuffer+j*w,(dir?d:p)+j*w,w*sizeof(int));
  481. }
  482. }
  483. break;
  484. default:
  485. break;
  486. }
  487. if (n == 255)
  488. {
  489. int x;
  490. enabled=0;
  491. start_time=0;
  492. for (x = 0; x < 4; x ++)
  493. {
  494. if (fbs[x]) GlobalFree(fbs[x]);
  495. fbs[x]=NULL;
  496. }
  497. g_render_effects2->clearRenders();
  498. g_render_effects2->freeBuffers();
  499. }
  500. return 0;
  501. }
  502. BOOL CALLBACK C_RenderTransitionClass::g_DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam)
  503. {
  504. switch (uMsg)
  505. {
  506. case WM_INITDIALOG:
  507. {
  508. int x;
  509. for (x = 0; x < sizeof(transitionmodes)/sizeof(transitionmodes[0]); x ++)
  510. SendDlgItemMessage(hwndDlg,IDC_TRANSITION,CB_ADDSTRING,0,(LPARAM)WASABI_API_LNGSTRING(transitionmodes[x]));
  511. SendDlgItemMessage(hwndDlg,IDC_TRANSITION,CB_SETCURSEL,(WPARAM)cfg_transition_mode&0x7fff,0);
  512. SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_SETRANGE, TRUE, MAKELONG(1, 32));
  513. SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_SETPOS, TRUE, cfg_transitions_speed);
  514. if (cfg_transition_mode&0x8000) CheckDlgButton(hwndDlg,IDC_CHECK9,BST_CHECKED);
  515. if (cfg_transitions&1) CheckDlgButton(hwndDlg,IDC_CHECK2,BST_CHECKED);
  516. if (cfg_transitions&2) CheckDlgButton(hwndDlg,IDC_CHECK1,BST_CHECKED);
  517. if (cfg_transitions&4) CheckDlgButton(hwndDlg,IDC_CHECK8,BST_CHECKED);
  518. if (cfg_transitions2&1) CheckDlgButton(hwndDlg,IDC_CHECK10,BST_CHECKED);
  519. if (cfg_transitions2&2) CheckDlgButton(hwndDlg,IDC_CHECK11,BST_CHECKED);
  520. if (cfg_transitions2&4) CheckDlgButton(hwndDlg,IDC_CHECK3,BST_CHECKED);
  521. if (cfg_transitions2&32) CheckDlgButton(hwndDlg,IDC_CHECK4,BST_CHECKED);
  522. if (!(cfg_transitions2&128)) CheckDlgButton(hwndDlg,IDC_CHECK5,BST_CHECKED);
  523. }
  524. return 1;
  525. case WM_COMMAND:
  526. switch (LOWORD(wParam))
  527. {
  528. case IDC_TRANSITION:
  529. if (HIWORD(wParam) == CBN_SELCHANGE)
  530. {
  531. int r=SendDlgItemMessage(hwndDlg,IDC_TRANSITION,CB_GETCURSEL,0,0);
  532. if (r!=CB_ERR)
  533. {
  534. cfg_transition_mode&=~0x7fff;
  535. cfg_transition_mode |= r;
  536. }
  537. }
  538. break;
  539. case IDC_CHECK9:
  540. cfg_transition_mode&=0x7fff;
  541. cfg_transition_mode |= IsDlgButtonChecked(hwndDlg,IDC_CHECK9)?0x8000:0;
  542. break;
  543. case IDC_CHECK2:
  544. cfg_transitions &= ~1;
  545. cfg_transitions |= IsDlgButtonChecked(hwndDlg,IDC_CHECK2)?1:0;
  546. break;
  547. case IDC_CHECK1:
  548. cfg_transitions &= ~2;
  549. cfg_transitions |= IsDlgButtonChecked(hwndDlg,IDC_CHECK1)?2:0;
  550. break;
  551. case IDC_CHECK8:
  552. cfg_transitions &= ~4;
  553. cfg_transitions |= IsDlgButtonChecked(hwndDlg,IDC_CHECK8)?4:0;
  554. break;
  555. case IDC_CHECK10:
  556. cfg_transitions2 &= ~1;
  557. cfg_transitions2 |= IsDlgButtonChecked(hwndDlg,IDC_CHECK10)?1:0;
  558. break;
  559. case IDC_CHECK11:
  560. cfg_transitions2 &= ~2;
  561. cfg_transitions2 |= IsDlgButtonChecked(hwndDlg,IDC_CHECK11)?2:0;
  562. break;
  563. case IDC_CHECK3:
  564. cfg_transitions2 &= ~4;
  565. cfg_transitions2 |= IsDlgButtonChecked(hwndDlg,IDC_CHECK3)?4:0;
  566. break;
  567. case IDC_CHECK4:
  568. cfg_transitions2 &= ~32;
  569. cfg_transitions2 |= IsDlgButtonChecked(hwndDlg,IDC_CHECK4)?32:0;
  570. break;
  571. case IDC_CHECK5:
  572. cfg_transitions2 &= ~128;
  573. cfg_transitions2 |= IsDlgButtonChecked(hwndDlg,IDC_CHECK5)?0:128;
  574. break;
  575. }
  576. break;
  577. case WM_NOTIFY:
  578. if (LOWORD(wParam) == IDC_SPEED)
  579. cfg_transitions_speed = SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0);
  580. break;
  581. }
  582. return 0;
  583. }
  584. HWND C_RenderTransitionClass::conf(HINSTANCE hInstance, HWND hwndParent)
  585. {
  586. g_this = this;
  587. return WASABI_API_CREATEDIALOG(IDD_GCFG_TRANSITIONS,hwndParent,g_DlgProc);
  588. }