| Index: cfgmgr/cfgmgr.c |
| — | — | @@ -59,14 +59,16 @@ |
| 60 | 60 | #define INISECTION_HACKS 8
|
| 61 | 61 |
|
| 62 | 62 | static int ini_currentsection = 0;
|
| | 63 | +static int ini_depth = 0;
|
| 63 | 64 |
|
| 64 | 65 | void _tchartowchar(WCHAR *dest, TCHAR *src, int length)
|
| 65 | 66 | {
|
| 66 | 67 | #ifdef _UNICODE
|
| 67 | | - wcsncpy(dest,src,length);
|
| | 68 | + if (length == -1) wcscpy(dest, src);
|
| | 69 | + else wcsncpy(dest,src,length);
|
| 68 | 70 | #else
|
| 69 | 71 | int length2 = length;
|
| 70 | | - if(length == -1) length2 = strlen(src) + 1;
|
| | 72 | + if(length == -1) length2 = (int)strlen(src) + 1;
|
| 71 | 73 | MultiByteToWideChar(CP_ACP,0,src,length,dest,length2);
|
| 72 | 74 | #endif
|
| 73 | 75 | }
|
| — | — | @@ -74,14 +76,24 @@ |
| 75 | 77 | void _wchartotchar(TCHAR *dest, WCHAR *src, int length)
|
| 76 | 78 | {
|
| 77 | 79 | #ifdef _UNICODE
|
| 78 | | - wcsncpy(dest,src,length);
|
| | 80 | + if (length == -1) wcscpy(dest, src);
|
| | 81 | + else wcsncpy(dest, src, length);
|
| 79 | 82 | #else
|
| 80 | 83 | int length2 = length;
|
| 81 | | - if(length == -1) length2 = wcslen(src) + 1;
|
| | 84 | + if(length == -1) length2 = (int)wcslen(src) + 1;
|
| 82 | 85 | WideCharToMultiByte(CP_ACP,0,src,length,dest,length2,NULL,NULL);
|
| 83 | 86 | #endif
|
| 84 | 87 | }
|
| 85 | 88 |
|
| | 89 | +void utf8to16(WCHAR* dest, CHAR* src)
|
| | 90 | +{
|
| | 91 | + int sizein;
|
| | 92 | + int sizeout;
|
| | 93 | + sizein = strlen(src)+1;
|
| | 94 | + sizeout = MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, src, sizein, NULL, 0);
|
| | 95 | + MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, src, sizein, dest, sizeout);
|
| | 96 | +}
|
| | 97 | +
|
| 86 | 98 | /**
|
| 87 | 99 | * Gets the hexadecimal digit for a number; the number must be less than 16
|
| 88 | 100 | * or 0x10.
|
| — | — | @@ -1074,137 +1086,163 @@ |
| 1075 | 1087 | int ReadINICallback(DXGLCFG *cfg, const char *section, const char *name,
|
| 1076 | 1088 | const char *value)
|
| 1077 | 1089 | {
|
| | 1090 | + FILE *file;
|
| | 1091 | + TCHAR inipath[MAX_PATH + 10];
|
| 1078 | 1092 | #ifdef _UNICODE
|
| 1079 | 1093 | TCHAR unicode_path[MAX_PATH + 1];
|
| 1080 | 1094 | #endif
|
| 1081 | | - if (!_stricmp(section, "system"))
|
| | 1095 | + if (!_stricmp(name, "Include"))
|
| 1082 | 1096 | {
|
| 1083 | | - if (!_stricmp(name, "NoWriteRegistry")) cfg->NoWriteRegistry = INIBoolValue(value);
|
| 1084 | | - if (!_stricmp(name, "OverrideDefaults")) cfg->OverrideDefaults = INIBoolValue(value);
|
| 1085 | | - }
|
| 1086 | | - if (!_stricmp(section, "display"))
|
| 1087 | | - {
|
| 1088 | | - if (!_stricmp(name, "ScalingMode")) cfg->scaler = INIIntValue(value);
|
| 1089 | | - if (!_stricmp(name, "FullscreenWindowMode")) cfg->fullmode = INIIntValue(value);
|
| 1090 | | - if (!_stricmp(name, "ChangeColorDepth")) cfg->colormode = INIBoolValue(value);
|
| 1091 | | - if (!_stricmp(name, "AllColorDepths"))
|
| | 1097 | + ini_depth++;
|
| | 1098 | + if(ini_depth <= 16)
|
| 1092 | 1099 | {
|
| 1093 | | - if (!cfg->ParsedAddColorDepths)
|
| | 1100 | + _tcscpy(inipath, cfg->inipath);
|
| | 1101 | + _tcscat(inipath, _T("\\"));
|
| | 1102 | + #ifdef _UNICODE
|
| | 1103 | + utf8to16(unicode_path, value);
|
| | 1104 | + _tcsncat(inipath, unicode_path, MAX_PATH);
|
| | 1105 | + #else
|
| | 1106 | + _tcscat(inipath, value);
|
| | 1107 | + #endif
|
| | 1108 | + file = _tfopen(inipath, _T("r"));
|
| | 1109 | + if (file)
|
| 1094 | 1110 | {
|
| 1095 | | - if (INIBoolValue(value)) cfg->AddColorDepths = 1 | 4 | 16;
|
| 1096 | | - else cfg->AddColorDepths = 0;
|
| | 1111 | + ini_parse_file(file, ReadINICallback, cfg);
|
| | 1112 | + fclose(file);
|
| 1097 | 1113 | }
|
| 1098 | 1114 | }
|
| 1099 | | - if (!_stricmp(name, "AddColorDepths"))
|
| | 1115 | + ini_depth--;
|
| | 1116 | + }
|
| | 1117 | + else {
|
| | 1118 | + if (!_stricmp(section, "system"))
|
| 1100 | 1119 | {
|
| 1101 | | - cfg->ParsedAddColorDepths = TRUE;
|
| 1102 | | - cfg->AddColorDepths = INIIntValue(value);
|
| | 1120 | + if (!_stricmp(name, "NoWriteRegistry")) cfg->NoWriteRegistry = INIBoolValue(value);
|
| | 1121 | + if (!_stricmp(name, "OverrideDefaults")) cfg->OverrideDefaults = INIBoolValue(value);
|
| 1103 | 1122 | }
|
| 1104 | | - if (!_stricmp(name, "ExtraModes"))
|
| | 1123 | + if (!_stricmp(section, "display"))
|
| 1105 | 1124 | {
|
| 1106 | | - if (!cfg->ParsedAddModes)
|
| | 1125 | + if (!_stricmp(name, "ScalingMode")) cfg->scaler = INIIntValue(value);
|
| | 1126 | + if (!_stricmp(name, "FullscreenWindowMode")) cfg->fullmode = INIIntValue(value);
|
| | 1127 | + if (!_stricmp(name, "ChangeColorDepth")) cfg->colormode = INIBoolValue(value);
|
| | 1128 | + if (!_stricmp(name, "AllColorDepths"))
|
| 1107 | 1129 | {
|
| 1108 | | - if (INIBoolValue(value)) cfg->AddModes = 7;
|
| 1109 | | - else cfg->AddModes = 0;
|
| | 1130 | + if (!cfg->ParsedAddColorDepths)
|
| | 1131 | + {
|
| | 1132 | + if (INIBoolValue(value)) cfg->AddColorDepths = 1 | 4 | 16;
|
| | 1133 | + else cfg->AddColorDepths = 0;
|
| | 1134 | + }
|
| 1110 | 1135 | }
|
| | 1136 | + if (!_stricmp(name, "AddColorDepths"))
|
| | 1137 | + {
|
| | 1138 | + cfg->ParsedAddColorDepths = TRUE;
|
| | 1139 | + cfg->AddColorDepths = INIIntValue(value);
|
| | 1140 | + }
|
| | 1141 | + if (!_stricmp(name, "ExtraModes"))
|
| | 1142 | + {
|
| | 1143 | + if (!cfg->ParsedAddModes)
|
| | 1144 | + {
|
| | 1145 | + if (INIBoolValue(value)) cfg->AddModes = 7;
|
| | 1146 | + else cfg->AddModes = 0;
|
| | 1147 | + }
|
| | 1148 | + }
|
| | 1149 | + if (!_stricmp(name, "AddModes"))
|
| | 1150 | + {
|
| | 1151 | + cfg->ParsedAddModes = TRUE;
|
| | 1152 | + cfg->AddModes = INIIntValue(value);
|
| | 1153 | + }
|
| | 1154 | + if (!_stricmp(name, "SortModes")) cfg->SortModes = INIIntValue(value);
|
| | 1155 | + if (!_stricmp(name, "VSync")) cfg->vsync = INIIntValue(value);
|
| | 1156 | + if (!_stricmp(name, "CustomResolutionX")) cfg->CustomResolutionX = INIIntValue(value);
|
| | 1157 | + if (!_stricmp(name, "CustomResolutionY")) cfg->CustomResolutionY = INIIntValue(value);
|
| | 1158 | + if (!_stricmp(name, "CustomRefresh")) cfg->CustomRefresh = INIIntValue(value);
|
| | 1159 | + if (!_stricmp(name, "DisplayMultiplierX")) cfg->DisplayMultiplierX = INIFloatValue(value);
|
| | 1160 | + if (!_stricmp(name, "DisplayMultiplierY")) cfg->DisplayMultiplierY = INIFloatValue(value);
|
| | 1161 | + if (!_stricmp(name, "SingleBufferDevice")) cfg->SingleBufferDevice = INIBoolValue(value);
|
| 1111 | 1162 | }
|
| 1112 | | - if (!_stricmp(name, "AddModes"))
|
| | 1163 | + if (!_stricmp(section, "scaling"))
|
| 1113 | 1164 | {
|
| 1114 | | - cfg->ParsedAddModes = TRUE;
|
| 1115 | | - cfg->AddModes = INIIntValue(value);
|
| | 1165 | + if (!_stricmp(name, "ScalingFilter")) cfg->scalingfilter = INIIntValue(value);
|
| | 1166 | + if (!_stricmp(name, "BltScale")) cfg->BltScale = INIIntValue(value);
|
| | 1167 | + // Removed for DXGL 0.5.13 release
|
| | 1168 | + // if (!_stricmp(name, "BltThreshold")) cfg->BltThreshold = INIIntValue(value);
|
| | 1169 | + if (!_stricmp(name, "AdjustPrimaryResolution")) cfg->primaryscale = INIIntValue(value);
|
| | 1170 | + if (!_stricmp(name, "PrimaryScaleX")) cfg->primaryscalex = INIFloatValue(value);
|
| | 1171 | + if (!_stricmp(name, "PrimaryScaleY")) cfg->primaryscaley = INIFloatValue(value);
|
| | 1172 | + if (!_stricmp(name, "ScreenAspect")) cfg->aspect = INIAspectValue(value);
|
| | 1173 | + if (!_stricmp(name, "DPIScale")) cfg->DPIScale = INIIntValue(value);
|
| 1116 | 1174 | }
|
| 1117 | | - if (!_stricmp(name, "SortModes")) cfg->SortModes = INIIntValue(value);
|
| 1118 | | - if (!_stricmp(name, "VSync")) cfg->vsync = INIIntValue(value);
|
| 1119 | | - if (!_stricmp(name, "CustomResolutionX")) cfg->CustomResolutionX = INIIntValue(value);
|
| 1120 | | - if (!_stricmp(name, "CustomResolutionY")) cfg->CustomResolutionY = INIIntValue(value);
|
| 1121 | | - if (!_stricmp(name, "CustomRefresh")) cfg->CustomRefresh = INIIntValue(value);
|
| 1122 | | - if (!_stricmp(name, "DisplayMultiplierX")) cfg->DisplayMultiplierX = INIFloatValue(value);
|
| 1123 | | - if (!_stricmp(name, "DisplayMultiplierY")) cfg->DisplayMultiplierY = INIFloatValue(value);
|
| 1124 | | - if (!_stricmp(name, "SingleBufferDevice")) cfg->SingleBufferDevice = INIBoolValue(value);
|
| 1125 | | - }
|
| 1126 | | - if (!_stricmp(section, "scaling"))
|
| 1127 | | - {
|
| 1128 | | - if (!_stricmp(name, "ScalingFilter")) cfg->scalingfilter = INIIntValue(value);
|
| 1129 | | - if (!_stricmp(name, "BltScale")) cfg->BltScale = INIIntValue(value);
|
| 1130 | | - // Removed for DXGL 0.5.13 release
|
| 1131 | | - // if (!_stricmp(name, "BltThreshold")) cfg->BltThreshold = INIIntValue(value);
|
| 1132 | | - if (!_stricmp(name, "AdjustPrimaryResolution")) cfg->primaryscale = INIIntValue(value);
|
| 1133 | | - if (!_stricmp(name, "PrimaryScaleX")) cfg->primaryscalex = INIFloatValue(value);
|
| 1134 | | - if (!_stricmp(name, "PrimaryScaleY")) cfg->primaryscaley = INIFloatValue(value);
|
| 1135 | | - if (!_stricmp(name, "ScreenAspect")) cfg->aspect = INIAspectValue(value);
|
| 1136 | | - if (!_stricmp(name, "DPIScale")) cfg->DPIScale = INIIntValue(value);
|
| 1137 | | - }
|
| 1138 | | - if (!_stricmp(section, "postprocess"))
|
| 1139 | | - {
|
| 1140 | | - if (!_stricmp(name, "PostprocessFilter")) cfg->postfilter = INIIntValue(value);
|
| 1141 | | - if (!_stricmp(name, "PostprocessScaleX")) cfg->postsizex = INIFloatValue(value);
|
| 1142 | | - if (!_stricmp(name, "PostprocessScaleY")) cfg->postsizex = INIFloatValue(value);
|
| 1143 | | - if (!_stricmp(name, "EnableShader")) cfg->EnableShader = INIBoolValue(value);
|
| 1144 | | - if (!_stricmp(name, "ShaderFile"))
|
| | 1175 | + if (!_stricmp(section, "postprocess"))
|
| 1145 | 1176 | {
|
| | 1177 | + if (!_stricmp(name, "PostprocessFilter")) cfg->postfilter = INIIntValue(value);
|
| | 1178 | + if (!_stricmp(name, "PostprocessScaleX")) cfg->postsizex = INIFloatValue(value);
|
| | 1179 | + if (!_stricmp(name, "PostprocessScaleY")) cfg->postsizex = INIFloatValue(value);
|
| | 1180 | + if (!_stricmp(name, "EnableShader")) cfg->EnableShader = INIBoolValue(value);
|
| | 1181 | + if (!_stricmp(name, "ShaderFile"))
|
| | 1182 | + {
|
| 1146 | 1183 | #ifdef _UNICODE
|
| 1147 | | - MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, value, strlen(value), unicode_path, MAX_PATH);
|
| 1148 | | - _tcsncpy(cfg->shaderfile, unicode_path, MAX_PATH);
|
| | 1184 | + utf8to16(unicode_path, value);
|
| | 1185 | + _tcsncpy(cfg->shaderfile, unicode_path, MAX_PATH);
|
| 1149 | 1186 | #else
|
| 1150 | | - _tcsncpy(cfg->shaderfile, value, MAX_PATH);
|
| | 1187 | + _tcsncpy(cfg->shaderfile, value, MAX_PATH);
|
| 1151 | 1188 | #endif
|
| | 1189 | + }
|
| 1152 | 1190 | }
|
| | 1191 | + if (!_stricmp(section, "d3d"))
|
| | 1192 | + {
|
| | 1193 | + if (!_stricmp(name, "TextureFilter")) cfg->texfilter = INIIntValue(value);
|
| | 1194 | + if (!_stricmp(name, "AnisotropicFiltering")) cfg->anisotropic = INIIntValue(value);
|
| | 1195 | + if (!_stricmp(name, "Antialiasing")) cfg->msaa = INIHexValue(value);
|
| | 1196 | + if (!_stricmp(name, "D3DAspect")) cfg->aspect3d = INIIntValue(value);
|
| | 1197 | + if (!_stricmp(name, "LowColorRendering")) cfg->LowColorRendering = INIIntValue(value);
|
| | 1198 | + if (!_stricmp(name, "EnableDithering")) cfg->EnableDithering = INIIntValue(value);
|
| | 1199 | + if (!_stricmp(name, "LimitTextureFormats")) cfg->LimitTextureFormats = INIIntValue(value);
|
| | 1200 | + }
|
| | 1201 | + if (!_stricmp(section, "advanced"))
|
| | 1202 | + {
|
| | 1203 | + if (!_stricmp(name, "TextureFormat")) cfg->TextureFormat = INIIntValue(value);
|
| | 1204 | + if (!_stricmp(name, "TexUpload")) cfg->TexUpload = INIIntValue(value);
|
| | 1205 | + if (!_stricmp(name, "WindowPosition")) cfg->WindowPosition = INIIntValue(value);
|
| | 1206 | + if (!_stricmp(name, "RememberWindowSize")) cfg->RememberWindowSize = INIBoolValue(value);
|
| | 1207 | + if (!_stricmp(name, "RememberWindowPosition")) cfg->RememberWindowPosition = INIBoolValue(value);
|
| | 1208 | + if (!_stricmp(name, "NoResizeWindow")) cfg->NoResizeWindow = INIBoolValue(value);
|
| | 1209 | + if (!_stricmp(name, "WindowX")) cfg->WindowX = INIIntValue(value);
|
| | 1210 | + if (!_stricmp(name, "WindowY")) cfg->WindowY = INIIntValue(value);
|
| | 1211 | + if (!_stricmp(name, "WindowWidth")) cfg->WindowWidth = INIIntValue(value);
|
| | 1212 | + if (!_stricmp(name, "WindowHeight")) cfg->WindowHeight = INIIntValue(value);
|
| | 1213 | + if (!_stricmp(name, "WindowMaximized")) cfg->WindowMaximized = INIBoolValue(value);
|
| | 1214 | + if (!_stricmp(name, "CaptureMouse")) cfg->CaptureMouse = INIBoolValue(value);
|
| | 1215 | + }
|
| | 1216 | + if (!_stricmp(section, "debug"))
|
| | 1217 | + {
|
| | 1218 | + if (!_stricmp(name, "DebugNoExtFramebuffer")) cfg->DebugNoExtFramebuffer = INIBoolValue(value);
|
| | 1219 | + if (!_stricmp(name, "DebugNoArbFramebuffer")) cfg->DebugNoArbFramebuffer = INIBoolValue(value);
|
| | 1220 | + if (!_stricmp(name, "DebugNoES2Compatibility")) cfg->DebugNoES2Compatibility = INIBoolValue(value);
|
| | 1221 | + if (!_stricmp(name, "DebugNoExtDirectStateAccess")) cfg->DebugNoExtDirectStateAccess = INIBoolValue(value);
|
| | 1222 | + if (!_stricmp(name, "DebugNoArbDirectStateAccess")) cfg->DebugNoArbDirectStateAccess = INIBoolValue(value);
|
| | 1223 | + if (!_stricmp(name, "DebugNoSamplerObjects")) cfg->DebugNoSamplerObjects = INIBoolValue(value);
|
| | 1224 | + if (!_stricmp(name, "DebugNoGpuShader4")) cfg->DebugNoGpuShader4 = INIBoolValue(value);
|
| | 1225 | + if (!_stricmp(name, "DebugNoGLSL130")) cfg->DebugNoGLSL130 = INIBoolValue(value);
|
| | 1226 | + if (!_stricmp(name, "DebugUploadAfterUnlock")) cfg->DebugUploadAfterUnlock = INIBoolValue(value);
|
| | 1227 | + if (!_stricmp(name, "DebugBlendDestColorKey")) cfg->DebugBlendDestColorKey = INIBoolValue(value);
|
| | 1228 | + if (!_stricmp(name, "DebugNoMouseHooks")) cfg->DebugNoMouseHooks = INIBoolValue(value);
|
| | 1229 | + if (!_stricmp(name, "DebugNoPaletteRedraw")) cfg->DebugNoPaletteRedraw = INIBoolValue(value);
|
| | 1230 | + if (!_stricmp(name, "DebugMaxGLVersionMajor")) cfg->DebugMaxGLVersionMajor = INIIntValue(value);
|
| | 1231 | + if (!_stricmp(name, "DebugMaxGLVersionMinor")) cfg->DebugMaxGLVersionMinor = INIIntValue(value);
|
| | 1232 | + if (!_stricmp(name, "DebugTraceLevel")) cfg->DebugTraceLevel = INIIntValue(value);
|
| | 1233 | + }
|
| | 1234 | + if (!_stricmp(section, "hacks"))
|
| | 1235 | + {
|
| | 1236 | + if (!_stricmp(name, "HackCrop640480to640400")) cfg->HackCrop640480to640400 = INIBoolValue(value);
|
| | 1237 | + if (!_stricmp(name, "HackAutoExpandViewport")) cfg->HackAutoExpandViewport = INIIntBoolValue(value);
|
| | 1238 | + if (!_stricmp(name, "HackAutoScale512448to640480")) cfg->HackAutoExpandViewport = INIIntBoolValue(value);
|
| | 1239 | + if (!_stricmp(name, "HackAutoExpandViewportCompare")) cfg->HackAutoExpandViewportCompare = INIIntValue(value);
|
| | 1240 | + if (!_stricmp(name, "HackAutoExpandViewportValue")) cfg->HackAutoExpandViewportValue = INIHexValue(value);
|
| | 1241 | + if (!_stricmp(name, "HackNoTVRefresh")) cfg->HackNoTVRefresh = INIBoolValue(value);
|
| | 1242 | + if (!_stricmp(name, "HackSetCursor")) cfg->HackSetCursor = INIBoolValue(value);
|
| | 1243 | + if (!_stricmp(name, "HackPaletteDelay")) cfg->HackPaletteDelay = INIIntValue(value);
|
| | 1244 | + if (!_stricmp(name, "HackPaletteVsync")) cfg->HackPaletteVsync = INIBoolValue(value);
|
| | 1245 | + }
|
| 1153 | 1246 | }
|
| 1154 | | - if (!_stricmp(section, "d3d"))
|
| 1155 | | - {
|
| 1156 | | - if (!_stricmp(name, "TextureFilter")) cfg->texfilter = INIIntValue(value);
|
| 1157 | | - if (!_stricmp(name, "AnisotropicFiltering")) cfg->anisotropic = INIIntValue(value);
|
| 1158 | | - if (!_stricmp(name, "Antialiasing")) cfg->msaa = INIHexValue(value);
|
| 1159 | | - if (!_stricmp(name, "D3DAspect")) cfg->aspect3d = INIIntValue(value);
|
| 1160 | | - if (!_stricmp(name, "LowColorRendering")) cfg->LowColorRendering = INIIntValue(value);
|
| 1161 | | - if (!_stricmp(name, "EnableDithering")) cfg->EnableDithering = INIIntValue(value);
|
| 1162 | | - if (!_stricmp(name, "LimitTextureFormats")) cfg->LimitTextureFormats = INIIntValue(value);
|
| 1163 | | - }
|
| 1164 | | - if (!_stricmp(section, "advanced"))
|
| 1165 | | - {
|
| 1166 | | - if (!_stricmp(name, "TextureFormat")) cfg->TextureFormat = INIIntValue(value);
|
| 1167 | | - if (!_stricmp(name, "TexUpload")) cfg->TexUpload = INIIntValue(value);
|
| 1168 | | - if (!_stricmp(name, "WindowPosition")) cfg->WindowPosition = INIIntValue(value);
|
| 1169 | | - if (!_stricmp(name, "RememberWindowSize")) cfg->RememberWindowSize = INIBoolValue(value);
|
| 1170 | | - if (!_stricmp(name, "RememberWindowPosition")) cfg->RememberWindowPosition = INIBoolValue(value);
|
| 1171 | | - if (!_stricmp(name, "NoResizeWindow")) cfg->NoResizeWindow = INIBoolValue(value);
|
| 1172 | | - if (!_stricmp(name, "WindowX")) cfg->WindowX = INIIntValue(value);
|
| 1173 | | - if (!_stricmp(name, "WindowY")) cfg->WindowY = INIIntValue(value);
|
| 1174 | | - if (!_stricmp(name, "WindowWidth")) cfg->WindowWidth = INIIntValue(value);
|
| 1175 | | - if (!_stricmp(name, "WindowHeight")) cfg->WindowHeight = INIIntValue(value);
|
| 1176 | | - if (!_stricmp(name, "WindowMaximized")) cfg->WindowMaximized = INIBoolValue(value);
|
| 1177 | | - if (!_stricmp(name, "CaptureMouse")) cfg->CaptureMouse = INIBoolValue(value);
|
| 1178 | | - }
|
| 1179 | | - if (!_stricmp(section, "debug"))
|
| 1180 | | - {
|
| 1181 | | - if (!_stricmp(name, "DebugNoExtFramebuffer")) cfg->DebugNoExtFramebuffer = INIBoolValue(value);
|
| 1182 | | - if (!_stricmp(name, "DebugNoArbFramebuffer")) cfg->DebugNoArbFramebuffer = INIBoolValue(value);
|
| 1183 | | - if (!_stricmp(name, "DebugNoES2Compatibility")) cfg->DebugNoES2Compatibility = INIBoolValue(value);
|
| 1184 | | - if (!_stricmp(name, "DebugNoExtDirectStateAccess")) cfg->DebugNoExtDirectStateAccess = INIBoolValue(value);
|
| 1185 | | - if (!_stricmp(name, "DebugNoArbDirectStateAccess")) cfg->DebugNoArbDirectStateAccess = INIBoolValue(value);
|
| 1186 | | - if (!_stricmp(name, "DebugNoSamplerObjects")) cfg->DebugNoSamplerObjects = INIBoolValue(value);
|
| 1187 | | - if (!_stricmp(name, "DebugNoGpuShader4")) cfg->DebugNoGpuShader4 = INIBoolValue(value);
|
| 1188 | | - if (!_stricmp(name, "DebugNoGLSL130")) cfg->DebugNoGLSL130 = INIBoolValue(value);
|
| 1189 | | - if (!_stricmp(name, "DebugUploadAfterUnlock")) cfg->DebugUploadAfterUnlock = INIBoolValue(value);
|
| 1190 | | - if (!_stricmp(name, "DebugBlendDestColorKey")) cfg->DebugBlendDestColorKey = INIBoolValue(value);
|
| 1191 | | - if (!_stricmp(name, "DebugNoMouseHooks")) cfg->DebugNoMouseHooks = INIBoolValue(value);
|
| 1192 | | - if (!_stricmp(name, "DebugNoPaletteRedraw")) cfg->DebugNoPaletteRedraw = INIBoolValue(value);
|
| 1193 | | - if (!_stricmp(name, "DebugMaxGLVersionMajor")) cfg->DebugMaxGLVersionMajor = INIIntValue(value);
|
| 1194 | | - if (!_stricmp(name, "DebugMaxGLVersionMinor")) cfg->DebugMaxGLVersionMinor = INIIntValue(value);
|
| 1195 | | - if (!_stricmp(name, "DebugTraceLevel")) cfg->DebugTraceLevel = INIIntValue(value);
|
| 1196 | | - }
|
| 1197 | | - if (!_stricmp(section, "hacks"))
|
| 1198 | | - {
|
| 1199 | | - if (!_stricmp(name, "HackCrop640480to640400")) cfg->HackCrop640480to640400 = INIBoolValue(value);
|
| 1200 | | - if (!_stricmp(name, "HackAutoExpandViewport")) cfg->HackAutoExpandViewport = INIIntBoolValue(value);
|
| 1201 | | - if (!_stricmp(name, "HackAutoScale512448to640480")) cfg->HackAutoExpandViewport = INIIntBoolValue(value);
|
| 1202 | | - if (!_stricmp(name, "HackAutoExpandViewportCompare")) cfg->HackAutoExpandViewportCompare = INIIntValue(value);
|
| 1203 | | - if (!_stricmp(name, "HackAutoExpandViewportValue")) cfg->HackAutoExpandViewportValue = INIHexValue(value);
|
| 1204 | | - if (!_stricmp(name, "HackNoTVRefresh")) cfg->HackNoTVRefresh = INIBoolValue(value);
|
| 1205 | | - if (!_stricmp(name, "HackSetCursor")) cfg->HackSetCursor = INIBoolValue(value);
|
| 1206 | | - if (!_stricmp(name, "HackPaletteDelay")) cfg->HackPaletteDelay = INIIntValue(value);
|
| 1207 | | - if (!_stricmp(name, "HackPaletteVsync")) cfg->HackPaletteVsync = INIBoolValue(value);
|
| 1208 | | - }
|
| 1209 | 1247 | return 1;
|
| 1210 | 1248 | }
|
| 1211 | 1249 |
|
| — | — | @@ -1212,9 +1250,11 @@ |
| 1213 | 1251 | {
|
| 1214 | 1252 | FILE *file;
|
| 1215 | 1253 | TCHAR inipath[MAX_PATH + 10];
|
| | 1254 | + ini_depth = 0;
|
| 1216 | 1255 | GetModuleFileName(NULL, inipath, MAX_PATH);
|
| 1217 | 1256 | GetDirFromPath(inipath);
|
| 1218 | | - _tcscat(inipath, _T("\\dxgl.ini"));
|
| | 1257 | + _tcscpy(cfg->inipath, inipath);
|
| | 1258 | + _tcscat(inipath, _T("\\dxgl.cfg"));
|
| 1219 | 1259 | file = _tfopen(inipath, _T("r"));
|
| 1220 | 1260 | if (file)
|
| 1221 | 1261 | {
|
| — | — | @@ -1221,6 +1261,17 @@ |
| 1222 | 1262 | ini_parse_file(file, ReadINICallback, cfg);
|
| 1223 | 1263 | fclose(file);
|
| 1224 | 1264 | }
|
| | 1265 | + else
|
| | 1266 | + {
|
| | 1267 | + GetDirFromPath(inipath);
|
| | 1268 | + _tcscat(inipath, _T("\\dxgl.ini"));
|
| | 1269 | + file = _tfopen(inipath, _T("r"));
|
| | 1270 | + if (file)
|
| | 1271 | + {
|
| | 1272 | + ini_parse_file(file, ReadINICallback, cfg);
|
| | 1273 | + fclose(file);
|
| | 1274 | + }
|
| | 1275 | + }
|
| 1225 | 1276 | }
|
| 1226 | 1277 |
|
| 1227 | 1278 | void SetINISection(HANDLE file, int section)
|
| — | — | @@ -2336,6 +2387,8 @@ |
| 2337 | 2388 | RegCloseKey(hKey);
|
| 2338 | 2389 | }
|
| 2339 | 2390 | ver2to3:
|
| | 2391 | + // Transfer profiles to pre-migrate path
|
| | 2392 | +
|
| 2340 | 2393 | return;
|
| 2341 | 2394 | }
|
| 2342 | 2395 |
|
| Index: cfgmgr/cfgmgr.h |
| — | — | @@ -113,6 +113,8 @@ |
| 114 | 114 | BOOL ParsedAddColorDepths;
|
| 115 | 115 | BOOL ParsedAddModes;
|
| 116 | 116 | TCHAR regkey[MAX_PATH + 80];
|
| | 117 | + // For parsing .ini file
|
| | 118 | + TCHAR inipath[MAX_PATH];
|
| 117 | 119 | } DXGLCFG;
|
| 118 | 120 |
|
| 119 | 121 | typedef struct
|
| Index: dxgl-example.ini |
| — | — | @@ -52,6 +52,19 @@ |
| 53 | 53 | ; Default is false.
|
| 54 | 54 | NoUninstall=false
|
| 55 | 55 |
|
| | 56 | +; Include - String
|
| | 57 | +; If set, DXGL will load the file listed and parse it, much like an "include"
|
| | 58 | +; file. This can allow using multiple configuration files. Please note that
|
| | 59 | +; DXGL will stop parsing the current file and parse the specified file before
|
| | 60 | +; continuing on. This option can be repeated to load multiple files, and
|
| | 61 | +; supports only relative paths. In addition, this option will only load up to
|
| | 62 | +; 16 files deep.
|
| | 63 | +; Installation control options are currently only supported in the root
|
| | 64 | +; configuration file.
|
| | 65 | +; Include options can be in any section of the .ini file, however included
|
| | 66 | +; files must have their own sections.
|
| | 67 | +;Include=dxgl-custom.ini
|
| | 68 | +
|
| 56 | 69 | [display]
|
| 57 | 70 | ; ScalingMode - Integer
|
| 58 | 71 | ; Determines the method DXGL will use to scale full screen modes.
|