Index: cfgmgr/cfgmgr.cbp |
— | — | @@ -0,0 +1,47 @@ |
| 2 | +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
| 3 | +<CodeBlocks_project_file> |
| 4 | + <FileVersion major="1" minor="6" /> |
| 5 | + <Project> |
| 6 | + <Option title="cfgmgr" /> |
| 7 | + <Option pch_mode="2" /> |
| 8 | + <Option compiler="gcc" /> |
| 9 | + <Build> |
| 10 | + <Target title="Debug"> |
| 11 | + <Option output="libcfgmgr" prefix_auto="1" extension_auto="1" /> |
| 12 | + <Option working_dir="" /> |
| 13 | + <Option object_output="obj\Debug\" /> |
| 14 | + <Option type="2" /> |
| 15 | + <Option compiler="gcc" /> |
| 16 | + <Option createDefFile="1" /> |
| 17 | + <Compiler> |
| 18 | + <Add option="-Wall" /> |
| 19 | + <Add option="-g" /> |
| 20 | + </Compiler> |
| 21 | + </Target> |
| 22 | + <Target title="Release"> |
| 23 | + <Option output="libcfgmgr" prefix_auto="1" extension_auto="1" /> |
| 24 | + <Option working_dir="" /> |
| 25 | + <Option object_output="obj\Release\" /> |
| 26 | + <Option type="2" /> |
| 27 | + <Option compiler="gcc" /> |
| 28 | + <Option createDefFile="1" /> |
| 29 | + <Compiler> |
| 30 | + <Add option="-Wall" /> |
| 31 | + <Add option="-O2" /> |
| 32 | + </Compiler> |
| 33 | + <Linker> |
| 34 | + <Add option="-s" /> |
| 35 | + </Linker> |
| 36 | + </Target> |
| 37 | + </Build> |
| 38 | + <Unit filename="main.c"> |
| 39 | + <Option compilerVar="CC" /> |
| 40 | + </Unit> |
| 41 | + <Extensions> |
| 42 | + <code_completion /> |
| 43 | + <envvars /> |
| 44 | + <debugger /> |
| 45 | + <lib_finder disable_auto="1" /> |
| 46 | + </Extensions> |
| 47 | + </Project> |
| 48 | +</CodeBlocks_project_file> |
Index: cfgmgr/cfgmgr.cpp |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | }
|
47 | 47 | }
|
48 | 48 |
|
49 | | -int FindStringInMultiSz(LPTSTR multisz, LPTSTR comp)
|
| 49 | +int FindStringInMultiSz(LPTSTR multisz, LPCTSTR comp)
|
50 | 50 | {
|
51 | 51 | LPTSTR str = multisz;
|
52 | 52 | while(str[0] != 0)
|
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | return 0;
|
58 | 58 | }
|
59 | 59 |
|
60 | | -void AddStringToMultiSz(LPTSTR multisz, LPTSTR string)
|
| 60 | +void AddStringToMultiSz(LPTSTR multisz, LPCTSTR string)
|
61 | 61 | {
|
62 | 62 | LPTSTR str = multisz;
|
63 | 63 | while(str[0] != 0)
|
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | }
|
69 | 69 |
|
70 | 70 |
|
71 | | -bool ReadBool(HKEY hKey, bool original, bool &mask, LPTSTR value)
|
| 71 | +bool ReadBool(HKEY hKey, bool original, bool &mask, LPCTSTR value)
|
72 | 72 | {
|
73 | 73 | DWORD dwOut;
|
74 | 74 | DWORD sizeout = 4;
|
— | — | @@ -86,7 +86,7 @@ |
87 | 87 | }
|
88 | 88 | }
|
89 | 89 |
|
90 | | -DWORD ReadDWORD(HKEY hKey, DWORD original, DWORD &mask, LPTSTR value)
|
| 90 | +DWORD ReadDWORD(HKEY hKey, DWORD original, DWORD &mask, LPCTSTR value)
|
91 | 91 | {
|
92 | 92 | DWORD dwOut;
|
93 | 93 | DWORD sizeout = 4;
|
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | }
|
106 | 106 | }
|
107 | 107 |
|
108 | | -void ReadPath(HKEY hKey, TCHAR *path, TCHAR *mask, LPTSTR value)
|
| 108 | +void ReadPath(HKEY hKey, TCHAR *path, TCHAR *mask, LPCTSTR value)
|
109 | 109 | {
|
110 | 110 | DWORD sizeout = MAX_PATH*sizeof(TCHAR);
|
111 | 111 | DWORD regsz = REG_SZ;
|
— | — | @@ -175,7 +175,7 @@ |
176 | 176 | }
|
177 | 177 | }
|
178 | 178 |
|
179 | | -void WriteBool(HKEY hKey, bool value, bool mask, LPTSTR name)
|
| 179 | +void WriteBool(HKEY hKey, bool value, bool mask, LPCTSTR name)
|
180 | 180 | {
|
181 | 181 | const DWORD one = 1;
|
182 | 182 | const DWORD zero = 0;
|
— | — | @@ -187,14 +187,14 @@ |
188 | 188 | else RegDeleteValue(hKey,name);
|
189 | 189 | }
|
190 | 190 |
|
191 | | -void WriteDWORD(HKEY hKey, DWORD value, DWORD mask, LPTSTR name)
|
| 191 | +void WriteDWORD(HKEY hKey, DWORD value, DWORD mask, LPCTSTR name)
|
192 | 192 | {
|
193 | 193 | if(mask) RegSetValueEx(hKey,name,0,REG_DWORD,(BYTE*)&value,4);
|
194 | 194 | else RegDeleteValue(hKey,name);
|
195 | 195 | }
|
196 | | -void WritePath(HKEY hKey, const TCHAR *path, const TCHAR *mask, LPTSTR name)
|
| 196 | +void WritePath(HKEY hKey, const TCHAR *path, const TCHAR *mask, LPCTSTR name)
|
197 | 197 | {
|
198 | | - if(mask[0]) RegSetValueEx(hKey,name,0,REG_SZ,(BYTE*)path,(_tcsnlen(path,MAX_PATH+1)+1)*sizeof(TCHAR));
|
| 198 | + if(mask[0]) RegSetValueEx(hKey,name,0,REG_SZ,(BYTE*)path,(_tcslen(path)+1)*sizeof(TCHAR));
|
199 | 199 | else RegDeleteValue(hKey,name);
|
200 | 200 | }
|
201 | 201 |
|
— | — | @@ -216,7 +216,7 @@ |
217 | 217 | WriteDWORD(hKey,cfg->SortModes,cfgmask->SortModes,_T("SortModes"));
|
218 | 218 | WriteBool(hKey,cfg->AllColorDepths,cfgmask->AllColorDepths,_T("AllColorDepths"));
|
219 | 219 | WriteBool(hKey,cfg->ExtraModes,cfgmask->ExtraModes,_T("ExtraModes"));
|
220 | | - WriteDWORD(hKey,cfg->vsync,cfgmask->vsync,_T("VSync"));
|
| 220 | + WriteDWORD(hKey,cfg->vsync,cfgmask->vsync,_T("VSync"));
|
221 | 221 | }
|
222 | 222 |
|
223 | 223 | tstring newregname;
|
— | — | @@ -341,4 +341,4 @@ |
342 | 342 | RegCreateKeyEx(HKEY_CURRENT_USER,regkey.c_str(),NULL,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,NULL);
|
343 | 343 | WriteSettings(hKey,cfg,mask,false);
|
344 | 344 | RegCloseKey(hKey);
|
345 | | -} |
\ No newline at end of file |
| 345 | +}
|
Index: cfgmgr/cfgmgr.depend |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +# depslib dependency file v1.0
|
| 3 | +1324171697 source:c:\programming\projects\dxgl\cfgmgr\crc32.cpp
|
| 4 | + "stdafx.h"
|
| 5 | + <stdio.h>
|
| 6 | + <stdlib.h>
|
| 7 | +
|
| 8 | +1324226084 c:\programming\projects\dxgl\cfgmgr\stdafx.h
|
| 9 | + <stdlib.h>
|
| 10 | + <cstdio>
|
| 11 | + <Windows.h>
|
| 12 | + <string>
|
| 13 | +
|
| 14 | +1324171697 source:c:\programming\projects\dxgl\cfgmgr\stdafx.cpp
|
| 15 | + "stdafx.h"
|
| 16 | +
|
| 17 | +1324226069 source:c:\programming\projects\dxgl\cfgmgr\cfgmgr.cpp
|
| 18 | + "stdafx.h"
|
| 19 | + "crc32.h"
|
| 20 | + "cfgmgr.h"
|
| 21 | + <tchar.h>
|
| 22 | +
|
| 23 | +1324171697 c:\programming\projects\dxgl\cfgmgr\crc32.h
|
| 24 | +
|
| 25 | +1324171697 c:\programming\projects\dxgl\cfgmgr\cfgmgr.h
|
| 26 | +
|
Index: cfgmgr/stdafx.h |
— | — | @@ -21,5 +21,9 @@ |
22 | 22 | #define _CRT_SECURE_NO_WARNINGS
|
23 | 23 |
|
24 | 24 | #include <stdlib.h>
|
| 25 | +#include <cstdio>
|
25 | 26 | #include <Windows.h>
|
26 | 27 | #include <string>
|
| 28 | +#ifndef LSTATUS
|
| 29 | +typedef LONG LSTATUS;
|
| 30 | +#endif
|
Index: dxgl.workspace |
— | — | @@ -0,0 +1,4 @@ |
| 2 | +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
| 3 | +<CodeBlocks_workspace_file> |
| 4 | + <Workspace title="DXGL" /> |
| 5 | +</CodeBlocks_workspace_file> |