DXGL r408 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r407‎ | r408 | r409 >
Date:01:58, 12 December 2013
Author:admin
Status:new
Tags:
Comment:
Update help image.
Adjust DXGLCFG tab order
Add aspect variable to cfgmgr
Modified paths:
  • /Help/dxglcfg.png (modified) (history)
  • /cfgmgr/ReadMe.txt (modified) (history)
  • /cfgmgr/cfgmgr.cpp (modified) (history)
  • /cfgmgr/cfgmgr.h (modified) (history)
  • /dxglcfg/dxglcfg.cpp (modified) (history)
  • /dxglcfg/dxglcfg.rc (modified) (history)

Diff [purge]

Index: Help/dxglcfg.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: cfgmgr/ReadMe.txt
@@ -121,6 +121,13 @@
122122 0 - Automatic
123123 1 - OpenGL Standard
124124
 125+Member aspect
 126+REG_DWORD HKCU\DXGL\<app>\ScreenAspect
 127+Screen aspect ratio to simulate, if the scaler is 1 or 4.
 128+Stored as a 32-bit float encoded as a DWORD.
 129+If zero, negative, or an invalid value, use automatic ratio based on square pixels.
 130+Positive values indicate a specific screen aspect ratio.
 131+
125132 Member Windows8Detected
126133 REG_DWORD HKCU\DXGL\Global\Windows8Detected
127134 Nonzero if Windows 8 (or later) is detected.
Index: cfgmgr/cfgmgr.cpp
@@ -104,6 +104,24 @@
105105 }
106106 }
107107
 108+float ReadFloat(HKEY hKey, float original, float &mask, LPCTSTR value)
 109+{
 110+ DWORD dwOut;
 111+ DWORD sizeout = 4;
 112+ DWORD regdword = REG_DWORD;
 113+ LSTATUS error = RegQueryValueEx(hKey,value,NULL,&regdword,(LPBYTE)&dwOut,&sizeout);
 114+ if(error == ERROR_SUCCESS)
 115+ {
 116+ mask = 1.0f;
 117+ return dwOut;
 118+ }
 119+ else
 120+ {
 121+ mask = 0.0f;
 122+ return original;
 123+ }
 124+}
 125+
108126 void ReadPath(HKEY hKey, TCHAR *path, TCHAR *mask, LPCTSTR value)
109127 {
110128 DWORD sizeout = MAX_PATH*sizeof(TCHAR);
Index: cfgmgr/cfgmgr.h
@@ -38,6 +38,7 @@
3939 DWORD TextureFormat;
4040 DWORD TexUpload;
4141 bool Windows8Detected;
 42+ float aspect;
4243 } DXGLCFG;
4344
4445 void ReadSettings(HKEY hKey, DXGLCFG *cfg, DXGLCFG *mask, bool global, bool dll, LPTSTR dir);
Index: dxglcfg/dxglcfg.cpp
@@ -284,6 +284,10 @@
285285 else mask[0] = 0xff;
286286 }
287287
 288+void SetAspectCombo(int item, float value)
 289+{
 290+}
 291+
288292 LRESULT CALLBACK DXGLCfgCallback(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
289293 {
290294 PIXELFORMATDESCRIPTOR pfd =
@@ -420,6 +424,18 @@
421425 _tcscpy(buffer,_T("Shader (primary only)"));
422426 SendDlgItemMessage(hWnd,IDC_SCALE,CB_ADDSTRING,3,(LPARAM)buffer);
423427 SendDlgItemMessage(hWnd,IDC_SCALE,CB_SETCURSEL,cfg->scalingfilter,0);
 428+ // aspect
 429+ _tcscpy(buffer,_T("Default"));
 430+ SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
 431+ _tcscpy(buffer,_T("4:3"));
 432+ SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
 433+ _tcscpy(buffer,_T("16:10"));
 434+ SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
 435+ _tcscpy(buffer,_T("16:9"));
 436+ SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
 437+ _tcscpy(buffer,_T("5:4"));
 438+ SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
 439+
424440 // highres
425441 if(cfg->highres) SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETCHECK,BST_CHECKED,0);
426442 else SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETCHECK,BST_UNCHECKED,0);
@@ -536,7 +552,7 @@
537553 EnableWindow(GetDlgItem(hWnd,IDC_MSAA),FALSE);
538554 cfg->msaa = 0;
539555 }
540 - // aspect
 556+ // aspect3d
541557 _tcscpy(buffer,_T("Stretch to display"));
542558 SendDlgItemMessage(hWnd,IDC_ASPECT3D,CB_ADDSTRING,0,(LPARAM)buffer);
543559 _tcscpy(buffer,_T("Expand viewable area"));
Index: dxglcfg/dxglcfg.rc
@@ -44,7 +44,7 @@
4545 GROUPBOX "Graphics", IDC_STATIC, 190, 4, 211, 238
4646 LTEXT "Video mode", IDC_STATIC, 195, 14, 38, 8, SS_LEFT
4747 COMBOBOX IDC_VIDMODE, 195, 24, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
48 - AUTOCHECKBOX "Change display color depth", IDC_COLOR, 299, 14, 100, 8
 48+ AUTOCHECKBOX "Change display color depth", IDC_COLOR, 299, 14, 100, 10
4949 LTEXT "Scaling method", IDC_STATIC, 195, 69, 49, 8, SS_LEFT
5050 COMBOBOX IDC_SCALE, 195, 79, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
5151 LTEXT "Vertical sync", IDC_STATIC, 299, 69, 41, 8, SS_LEFT
@@ -52,6 +52,10 @@
5353 LTEXT "Scaling shader", IDC_STATIC, 195, 94, 47, 8, SS_LEFT
5454 EDITTEXT IDC_SHADER, 195, 104, 183, 14, ES_AUTOHSCROLL
5555 PUSHBUTTON "...", IDC_BROWSESHADER, 379, 104, 20, 14
 56+ LTEXT "Screen aspect ratio", IDC_STATIC, 195, 120, 63, 8, SS_LEFT
 57+ LTEXT "DPI scaling mode", IDC_STATIC, 299, 120, 55, 8, SS_LEFT
 58+ COMBOBOX IDC_ASPECT, 195, 130, 102, 30, CBS_DROPDOWN | CBS_HASSTRINGS
 59+ COMBOBOX IDC_DPISCALE, 299, 130, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
5660 LTEXT "Texture filter", IDC_STATIC, 195, 145, 43, 8, SS_LEFT
5761 COMBOBOX IDC_TEXFILTER, 195, 155, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
5862 LTEXT "Anisotropic filtering", IDC_STATIC, 299, 145, 62, 8, SS_LEFT
@@ -69,10 +73,6 @@
7074 COMBOBOX IDC_TEXTUREFORMAT, 195, 205, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
7175 LTEXT "Texture access method", IDC_STATIC, 299, 195, 76, 8, SS_LEFT
7276 COMBOBOX IDC_TEXUPLOAD, 299, 205, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
73 - LTEXT "Screen aspect ratio", IDC_STATIC, 195, 120, 63, 8, SS_LEFT
74 - LTEXT "DPI scaling mode", IDC_STATIC, 299, 120, 55, 8, SS_LEFT
75 - COMBOBOX IDC_ASPECT, 195, 130, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
76 - COMBOBOX IDC_DPISCALE, 299, 130, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
7777 }
7878
7979