DXGL r409 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r408‎ | r409 | r410 >
Date:02:25, 12 December 2013
Author:admin
Status:new
Tags:
Comment:
Add DPI scaling variable to cfgmgr
Fill in DPI scaling combo box
Modified paths:
  • /cfgmgr/ReadMe.txt (modified) (history)
  • /cfgmgr/cfgmgr.cpp (modified) (history)
  • /cfgmgr/cfgmgr.h (modified) (history)
  • /dxglcfg/dxglcfg.cpp (modified) (history)

Diff [purge]

Index: cfgmgr/ReadMe.txt
@@ -121,6 +121,16 @@
122122 0 - Automatic
123123 1 - OpenGL Standard
124124
 125+Member DPIScale
 126+REG_DWORD HKCU\DXGL\<app>\DPIScale
 127+Enable DPI scaling fix
 128+The program may be restarted if the Windows AppCompat method is enabled or
 129+disabled.
 130+Valid settings:
 131+0 - Disabled
 132+1 - Enabled
 133+2 - Use Windows AppCompat
 134+
125135 Member aspect
126136 REG_DWORD HKCU\DXGL\<app>\ScreenAspect
127137 Screen aspect ratio to simulate, if the scaler is 1 or 4.
Index: cfgmgr/cfgmgr.cpp
@@ -106,7 +106,7 @@
107107
108108 float ReadFloat(HKEY hKey, float original, float &mask, LPCTSTR value)
109109 {
110 - DWORD dwOut;
 110+ float dwOut;
111111 DWORD sizeout = 4;
112112 DWORD regdword = REG_DWORD;
113113 LSTATUS error = RegQueryValueEx(hKey,value,NULL,&regdword,(LPBYTE)&dwOut,&sizeout);
Index: cfgmgr/cfgmgr.h
@@ -37,8 +37,9 @@
3838 bool ExtraModes;
3939 DWORD TextureFormat;
4040 DWORD TexUpload;
 41+ DWORD DPIScale;
 42+ float aspect;
4143 bool Windows8Detected;
42 - float aspect;
4344 } DXGLCFG;
4445
4546 void ReadSettings(HKEY hKey, DXGLCFG *cfg, DXGLCFG *mask, bool global, bool dll, LPTSTR dir);
Index: dxglcfg/dxglcfg.cpp
@@ -584,6 +584,14 @@
585585 _tcscpy(buffer,_T("Automatic"));
586586 SendDlgItemMessage(hWnd,IDC_TEXUPLOAD,CB_ADDSTRING,0,(LPARAM)buffer);
587587 SendDlgItemMessage(hWnd,IDC_TEXUPLOAD,CB_SETCURSEL,cfg->TexUpload,0);
 588+ // DPI
 589+ _tcscpy(buffer, _T("Disabled"));
 590+ SendDlgItemMessage(hWnd,IDC_DPISCALE,CB_ADDSTRING,0,(LPARAM)buffer);
 591+ _tcscpy(buffer, _T("Enabled"));
 592+ SendDlgItemMessage(hWnd,IDC_DPISCALE,CB_ADDSTRING,1,(LPARAM)buffer);
 593+ _tcscpy(buffer, _T("Windows AppCompat"));
 594+ SendDlgItemMessage(hWnd,IDC_DPISCALE,CB_ADDSTRING,2,(LPARAM)buffer);
 595+ SendDlgItemMessage(hWnd,IDC_DPISCALE,CB_SETCURSEL,cfg->DPIScale,0);
588596 // Add installed programs
589597 current_app = 1;
590598 appcount = 1;