DXGL r410 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r409‎ | r410 | r411 >
Date:16:48, 15 December 2013
Author:admin
Status:new
Tags:
Comment:
Read and write DPI scaling setting.
Modified paths:
  • /cfgmgr/cfgmgr.cpp (modified) (history)
  • /dxglcfg/dxglcfg.cpp (modified) (history)

Diff [purge]

Index: cfgmgr/cfgmgr.cpp
@@ -160,6 +160,7 @@
161161 cfg->TextureFormat = ReadDWORD(hKey,cfg->TextureFormat,cfgmask->TextureFormat,_T("TextureFormat"));
162162 cfg->TexUpload = ReadDWORD(hKey,cfg->TexUpload,cfgmask->TexUpload,_T("TexUpload"));
163163 cfg->Windows8Detected = ReadBool(hKey,cfg->Windows8Detected,cfgmask->Windows8Detected,_T("Windows8Detected"));
 164+ cfg->DPIScale = ReadDWORD(hKey,cfg->DPIScale,cfgmask->DPIScale,_T("DPIScale"));
164165 if(!global && dll)
165166 {
166167 LPTSTR paths;
@@ -240,6 +241,7 @@
241242 WriteDWORD(hKey,cfg->TextureFormat,cfgmask->TextureFormat,_T("TextureFormat"));
242243 WriteDWORD(hKey,cfg->TexUpload,cfgmask->TexUpload,_T("TexUpload"));
243244 WriteBool(hKey,cfg->Windows8Detected,cfgmask->Windows8Detected,_T("Windows8Detected"));
 245+ WriteDWORD(hKey,cfg->DPIScale,cfgmask->DPIScale,_T("DPIScale"));
244246 }
245247
246248 tstring newregname;
@@ -433,6 +435,7 @@
434436 {
435437 HKEY hKey;
436438 ZeroMemory(cfg,sizeof(DXGLCFG));
 439+ cfg->DPIScale = 1;
437440 RegCreateKeyEx(HKEY_CURRENT_USER,regkeyglobal,0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,NULL);
438441 ReadSettings(hKey,cfg,NULL,true,false,NULL);
439442 if(!cfg->Windows8Detected)
@@ -453,6 +456,7 @@
454457 tstring regkey = regkeybase;
455458 regkey.append(name);
456459 ZeroMemory(cfg,sizeof(DXGLCFG));
 460+ cfg->DPIScale = 1;
457461 RegCreateKeyEx(HKEY_CURRENT_USER,regkey.c_str(),0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,NULL);
458462 ReadSettings(hKey,cfg,mask,false,false,NULL);
459463 RegCloseKey(hKey);
Index: dxglcfg/dxglcfg.cpp
@@ -927,6 +927,11 @@
928928 EnableWindow(GetDlgItem(hWnd,IDC_APPLY),true);
929929 *dirty = true;
930930 break;
 931+ case IDC_DPISCALE:
 932+ cfg->DPIScale = GetCombo(hWnd,IDC_DPISCALE,cfgmask->DPIScale);
 933+ EnableWindow(GetDlgItem(hWnd, IDC_APPLY), true);
 934+ *dirty = true;
 935+ break;
931936 case IDC_SHADER:
932937 if(HIWORD(wParam) == EN_CHANGE)
933938 {