DXGL r14 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r13‎ | r14 | r15 >
Date:17:50, 27 November 2011
Author:admin
Status:new
Tags:
Comment:
Fix configuration loading
Modified paths:
  • /cfgmgr/cfgmgr.cpp (modified) (history)

Diff [purge]

Index: cfgmgr/cfgmgr.cpp
@@ -67,7 +67,7 @@
6868 }
6969
7070
71 -bool ReadBool(HKEY hKey, bool &mask, LPTSTR value)
 71+bool ReadBool(HKEY hKey, bool original, bool &mask, LPTSTR value)
7272 {
7373 DWORD dwOut;
7474 DWORD sizeout = 4;
@@ -82,11 +82,11 @@
8383 else
8484 {
8585 mask = false;
86 - return false;
 86+ return original;
8787 }
8888 }
8989
90 -DWORD ReadDWORD(HKEY hKey, DWORD &mask, LPTSTR value)
 90+DWORD ReadDWORD(HKEY hKey, DWORD original, DWORD &mask, LPTSTR value)
9191 {
9292 DWORD dwOut;
9393 DWORD sizeout = 4;
@@ -100,7 +100,7 @@
101101 else
102102 {
103103 mask = 0;
104 - return 0;
 104+ return original;
105105 }
106106 }
107107
@@ -126,22 +126,22 @@
127127 LONG error;
128128 DWORD regmultisz = REG_MULTI_SZ;
129129 DWORD sizeout=4;
130 - cfg->scaler = ReadDWORD(hKey,cfgmask->scaler,_T("ScalingMode"));
131 - cfg->colormode = ReadBool(hKey,cfgmask->colormode,_T("ChangeColorDepth"));
132 - cfg->scalingfilter = ReadDWORD(hKey,cfgmask->scalingfilter,_T("ScalingFilter"));
133 - cfg->texfilter = ReadDWORD(hKey,cfgmask->texfilter,_T("TextureFilter"));
134 - cfg->anisotropic = ReadDWORD(hKey,cfgmask->anisotropic,_T("AnisotropicFiltering"));
135 - cfg->msaa = ReadDWORD(hKey,cfgmask->msaa,_T("Antialiasing"));
136 - cfg->aspect = ReadDWORD(hKey,cfgmask->aspect,_T("AdjustAspectRatio"));
137 - cfg->highres = ReadBool(hKey,cfgmask->highres,_T("AdjustPrimaryResolution"));
 130+ cfg->scaler = ReadDWORD(hKey,cfg->scaler,cfgmask->scaler,_T("ScalingMode"));
 131+ cfg->colormode = ReadBool(hKey,cfg->colormode,cfgmask->colormode,_T("ChangeColorDepth"));
 132+ cfg->scalingfilter = ReadDWORD(hKey,cfg->scalingfilter,cfgmask->scalingfilter,_T("ScalingFilter"));
 133+ cfg->texfilter = ReadDWORD(hKey,cfg->texfilter,cfgmask->texfilter,_T("TextureFilter"));
 134+ cfg->anisotropic = ReadDWORD(hKey,cfg->anisotropic,cfgmask->anisotropic,_T("AnisotropicFiltering"));
 135+ cfg->msaa = ReadDWORD(hKey,cfg->msaa,cfgmask->msaa,_T("Antialiasing"));
 136+ cfg->aspect = ReadDWORD(hKey,cfg->aspect,cfgmask->aspect,_T("AdjustAspectRatio"));
 137+ cfg->highres = ReadBool(hKey,cfg->highres,cfgmask->highres,_T("AdjustPrimaryResolution"));
138138 ReadPath(hKey,cfg->shaderfile,cfgmask->shaderfile,_T("ShaderFile"));
139 - cfg->SortModes = ReadDWORD(hKey,cfgmask->SortModes,_T("SortModes"));
140 - cfg->AllColorDepths = ReadBool(hKey,cfgmask->AllColorDepths,_T("AllColorDepths"));
141 - cfg->ExtraModes = ReadBool(hKey,cfgmask->ExtraModes,_T("ExtraModes"));
142 - cfg->vsync = ReadDWORD(hKey,cfgmask->vsync,_T("VSync"));
143 - cfg->audio3d = ReadBool(hKey,cfgmask->audio3d,_T("Use3DAudio"));
144 - cfg->audioglobal = ReadBool(hKey,cfgmask->audioglobal,_T("GlobalAudio"));
145 - cfg->inputglobal = ReadBool(hKey,cfgmask->inputglobal,_T("GlobalInput"));
 139+ cfg->SortModes = ReadDWORD(hKey,cfg->SortModes,cfgmask->SortModes,_T("SortModes"));
 140+ cfg->AllColorDepths = ReadBool(hKey,cfg->AllColorDepths,cfgmask->AllColorDepths,_T("AllColorDepths"));
 141+ cfg->ExtraModes = ReadBool(hKey,cfg->ExtraModes,cfgmask->ExtraModes,_T("ExtraModes"));
 142+ cfg->vsync = ReadDWORD(hKey,cfg->vsync,cfgmask->vsync,_T("VSync"));
 143+ cfg->audio3d = ReadBool(hKey,cfg->audio3d,cfgmask->audio3d,_T("Use3DAudio"));
 144+ cfg->audioglobal = ReadBool(hKey,cfg->audioglobal,cfgmask->audioglobal,_T("GlobalAudio"));
 145+ cfg->inputglobal = ReadBool(hKey,cfg->inputglobal,cfgmask->inputglobal,_T("GlobalInput"));
146146 if(!global && dll)
147147 {
148148 LPTSTR paths;