DXGL r699 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r698‎ | r699 | r700 >
Date:03:16, 13 March 2017
Author:admin
Status:new
Tags:
Comment:
Populate DXGLCFG first pass scaling controls.
Fix typing in aspect ratio entries.
Modified paths:
  • /dxglcfg/dxglcfg.c (modified) (history)
  • /dxglcfg2/dxglcfg2.c (modified) (history)
  • /dxglcfg2/dxglcfg2.rc (modified) (history)

Diff [purge]

Index: dxglcfg/dxglcfg.c
@@ -222,8 +222,8 @@
223223
224224 void FloatToAspect(float f, LPTSTR aspect)
225225 {
226 - float integer;
227 - float dummy;
 226+ double integer;
 227+ double dummy;
228228 float fract;
229229 TCHAR denominator[5];
230230 int i;
@@ -542,7 +542,7 @@
543543 ReleaseDC(hGLWnd,dc);
544544 DestroyWindow(hGLWnd);
545545 // Load global settings.
546 - // scaler
 546+ // video mode
547547 _tcscpy(buffer,_T("Change desktop resolution"));
548548 SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,0,(LPARAM)buffer);
549549 _tcscpy(buffer,_T("Stretch to screen"));
@@ -560,7 +560,7 @@
561561 _tcscpy(buffer,_T("Crop to screen (experimental)"));
562562 SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,7,(LPARAM)buffer);
563563 SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_SETCURSEL,cfg->scaler,0);
564 - // fullmode
 564+ // fullscreen window mode
565565 _tcscpy(buffer, _T("Exclusive fullscreen"));
566566 SendDlgItemMessage(hWnd, IDC_FULLMODE, CB_ADDSTRING, 0, (LPARAM)buffer);
567567 _tcscpy(buffer, _T("Non-exclusive fullscreen"));
@@ -577,7 +577,26 @@
578578 // colormode
579579 if(cfg->colormode) SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETCHECK,BST_CHECKED,0);
580580 else SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETCHECK,BST_UNCHECKED,0);
581 - // scalingfilter
 581+ // first scaling filter
 582+ _tcscpy(buffer, _T("Nearest"));
 583+ SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_ADDSTRING, 0, (LPARAM)buffer);
 584+ _tcscpy(buffer, _T("Bilinear"));
 585+ SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_ADDSTRING, 1, (LPARAM)buffer);
 586+ SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_SETCURSEL, cfg->scalingfilter, 0);
 587+ // first scaling sizes
 588+ _tcscpy(buffer, _T("Auto"));
 589+ SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 590+ _tcscpy(buffer, _T("1x"));
 591+ SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 592+ _tcscpy(buffer, _T("1x2"));
 593+ SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 594+ _tcscpy(buffer, _T("2x"));
 595+ SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 596+ _tcscpy(buffer, _T("3x"));
 597+ SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 598+ _tcscpy(buffer, _T("4x"));
 599+ SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 600+ // final scaling filter
582601 _tcscpy(buffer,_T("Nearest"));
583602 SendDlgItemMessage(hWnd,IDC_SCALE,CB_ADDSTRING,0,(LPARAM)buffer);
584603 _tcscpy(buffer,_T("Bilinear"));
Index: dxglcfg2/dxglcfg2.c
@@ -270,8 +270,8 @@
271271
272272 void FloatToAspect(float f, LPTSTR aspect)
273273 {
274 - float integer;
275 - float dummy;
 274+ double integer;
 275+ double dummy;
276276 float fract;
277277 TCHAR denominator[5];
278278 int i;
@@ -774,7 +774,7 @@
775775 tabopen = 0;
776776
777777 // Load global settings.
778 - // scaler
 778+ // video mode
779779 _tcscpy(buffer,_T("Change desktop resolution"));
780780 SendDlgItemMessage(hTabs[0], IDC_VIDMODE, CB_ADDSTRING, 0, (LPARAM)buffer);
781781 _tcscpy(buffer,_T("Stretch to screen"));
@@ -792,10 +792,43 @@
793793 _tcscpy(buffer,_T("Crop to screen (experimental)"));
794794 SendDlgItemMessage(hTabs[0],IDC_VIDMODE,CB_ADDSTRING,7,(LPARAM)buffer);
795795 SendDlgItemMessage(hTabs[0],IDC_VIDMODE,CB_SETCURSEL,cfg->scaler,0);
 796+ // fullscreen window mode
 797+ _tcscpy(buffer, _T("Exclusive fullscreen"));
 798+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_ADDSTRING, 0, (LPARAM)buffer);
 799+ _tcscpy(buffer, _T("Non-exclusive fullscreen"));
 800+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_ADDSTRING, 1, (LPARAM)buffer);
 801+ _tcscpy(buffer, _T("Non-resizable window"));
 802+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_ADDSTRING, 2, (LPARAM)buffer);
 803+ _tcscpy(buffer, _T("Resizable window"));
 804+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_ADDSTRING, 3, (LPARAM)buffer);
 805+ _tcscpy(buffer, _T("Borderless window"));
 806+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_ADDSTRING, 4, (LPARAM)buffer);
 807+ _tcscpy(buffer, _T("Borderless window (scaled)"));
 808+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_ADDSTRING, 5, (LPARAM)buffer);
 809+ SendDlgItemMessage(hTabs[0], IDC_FULLMODE, CB_SETCURSEL, cfg->fullmode, 0);
796810 // colormode
797811 if (cfg->colormode) SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETCHECK, BST_CHECKED, 0);
798812 else SendDlgItemMessage(hTabs[0], IDC_COLOR, BM_SETCHECK, BST_UNCHECKED, 0);
799 - // scalingfilter
 813+ // first scaling filter
 814+ _tcscpy(buffer, _T("Nearest"));
 815+ SendDlgItemMessage(hTabs[0], IDC_PRESCALE, CB_ADDSTRING, 0, (LPARAM)buffer);
 816+ _tcscpy(buffer, _T("Bilinear"));
 817+ SendDlgItemMessage(hTabs[0], IDC_PRESCALE, CB_ADDSTRING, 1, (LPARAM)buffer);
 818+ SendDlgItemMessage(hTabs[0], IDC_PRESCALE, CB_SETCURSEL, cfg->scalingfilter, 0);
 819+ // first scaling sizes
 820+ _tcscpy(buffer, _T("Auto"));
 821+ SendDlgItemMessage(hTabs[0], IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 822+ _tcscpy(buffer, _T("1x"));
 823+ SendDlgItemMessage(hTabs[0], IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 824+ _tcscpy(buffer, _T("1x2"));
 825+ SendDlgItemMessage(hTabs[0], IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 826+ _tcscpy(buffer, _T("2x"));
 827+ SendDlgItemMessage(hTabs[0], IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 828+ _tcscpy(buffer, _T("3x"));
 829+ SendDlgItemMessage(hTabs[0], IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 830+ _tcscpy(buffer, _T("4x"));
 831+ SendDlgItemMessage(hTabs[0], IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
 832+ // final scaling filter
800833 _tcscpy(buffer,_T("Nearest"));
801834 SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_ADDSTRING, 0, (LPARAM)buffer);
802835 _tcscpy(buffer,_T("Bilinear"));
Index: dxglcfg2/dxglcfg2.rc
@@ -57,8 +57,8 @@
5858 LTEXT "DPI scaling mode", IDC_STATIC, 7, 107, 55, 8, SS_LEFT, WS_EX_LEFT
5959 COMBOBOX IDC_DPISCALE, 7, 117, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
6060 AUTOCHECKBOX "Change display color depth", IDC_COLOR, 9, 158, 100, 10, 0, WS_EX_LEFT
61 - LTEXT "Fullscreen mode", IDC_STATIC, 7, 132, 78, 9, SS_LEFT, WS_EX_LEFT
62 - COMBOBOX IDC_FULLMODE, 8, 143, 101, 30, CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
 61+ LTEXT "Fullscreen window mode", IDC_STATIC, 7, 132, 78, 9, SS_LEFT, WS_EX_LEFT
 62+ COMBOBOX IDC_FULLMODE, 8, 143, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
6363 LTEXT "Scaling method (1st pass)", IDC_STATIC, 7, 32, 83, 9, SS_LEFT, WS_EX_LEFT
6464 COMBOBOX IDC_PRESCALE, 7, 43, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
6565 LTEXT "1st Pass Scale size", 0, 114, 32, 60, 9, SS_LEFT, WS_EX_LEFT