Index: cfgmgr/ReadMe.txt |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | REG_DWORD HKCU\DXGL\Profiles\<app>\FirstScaleX
|
40 | 40 | Amount to stretch the display in the X direction for the first pass.
|
41 | 41 | If either X or Y is set to 0 or less than 0.25, automatically choose
|
42 | | -2x or 2x1 scaling for certain low resolutions.
|
| 42 | +2x, 2x1, or 1x2 scaling for certain low resolutions.
|
43 | 43 | Stored as a 32-bit float encoded as a DWORD.
|
44 | 44 |
|
45 | 45 | Member firstscaley
|
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | REG_DWORD HKCU\DXGL\Profiles\<app>\FirstScaley
|
47 | 47 | Amount to stretch the display in the Y direction for the first pass.
|
48 | 48 | If either X or Y is set to 0 or less than 0.25, automatically choose
|
49 | | -2x or 2x1 scaling for certain low resolutions.
|
| 49 | +2x, 2x1, or 1x2 scaling for certain low resolutions.
|
50 | 50 | Stored as a 32-bit float encoded as a DWORD.
|
51 | 51 |
|
52 | 52 | Member scalingfilter
|
Index: cfgmgr/cfgmgr.c |
— | — | @@ -723,6 +723,7 @@ |
724 | 724 | HKEY hKey;
|
725 | 725 | ZeroMemory(cfg,sizeof(DXGLCFG));
|
726 | 726 | cfg->DPIScale = 1;
|
| 727 | + cfg->AddModes = 1;
|
727 | 728 | if (initial) RegOpenKeyEx(HKEY_CURRENT_USER, regkeyglobal, 0, KEY_READ, &hKey);
|
728 | 729 | else RegCreateKeyEx(HKEY_CURRENT_USER, regkeyglobal, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, NULL);
|
729 | 730 | if (hKey)
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -95,7 +95,9 @@ |
96 | 96 | return false;
|
97 | 97 | }
|
98 | 98 |
|
99 | | -const int ExtraModes[30] [3] = {
|
| 99 | +const int START_EXTRAMODESCOUNT = __LINE__;
|
| 100 | +const int ExtraModes[] [3] =
|
| 101 | +{
|
100 | 102 | {320,175,70},
|
101 | 103 | {320,200,70},
|
102 | 104 | {320,240,60},
|
— | — | @@ -109,6 +111,7 @@ |
110 | 112 | {416,312,75},
|
111 | 113 | {512,384,60},
|
112 | 114 | {576,432,60},
|
| 115 | + {640,200,70},
|
113 | 116 | {640,350,70},
|
114 | 117 | {640,400,70},
|
115 | 118 | {640,512,60},
|
— | — | @@ -127,7 +130,27 @@ |
128 | 131 | {960,600,60},
|
129 | 132 | {960,720,60}
|
130 | 133 | };
|
| 134 | +const int END_EXTRAMODESCOUNT = __LINE__ - 4;
|
| 135 | +const int numextramodes = END_EXTRAMODESCOUNT - START_EXTRAMODESCOUNT;
|
131 | 136 |
|
| 137 | +const int START_DOUBLEDMODESCOUNT = __LINE__;
|
| 138 | +const int DoubledModes[] [5] =
|
| 139 | +{
|
| 140 | + {320,175,70,640,350},
|
| 141 | + {320,200,70,640,400},
|
| 142 | + {320,240,60,640,480},
|
| 143 | + {320,400,70,640,400},
|
| 144 | + {320,480,60,640,480},
|
| 145 | + {640,200,70,640,400},
|
| 146 | + {360,200,70,720,400},
|
| 147 | + {360,240,60,720,480},
|
| 148 | + {360,400,70,720,400},
|
| 149 | + {360,480,60,720,480},
|
| 150 | + {400,300,60,800,600}
|
| 151 | +};
|
| 152 | +const int END_DOUBLEDMODESCOUNT = __LINE__ - 4;
|
| 153 | +const int numdoubledmodes = END_DOUBLEDMODESCOUNT - START_DOUBLEDMODESCOUNT;
|
| 154 | +
|
132 | 155 | bool ScanColorMode(DEVMODE *array, DWORD count, int bpp)
|
133 | 156 | {
|
134 | 157 | for(DWORD i = 0; i < count; i++)
|
— | — | @@ -150,7 +173,7 @@ |
151 | 174 |
|
152 | 175 | void AddExtraResolutions(DEVMODE **array, DWORD *count)
|
153 | 176 | {
|
154 | | - DEVMODE *array2 = (DEVMODE *)malloc(sizeof(DEVMODE)*5*30);
|
| 177 | + DEVMODE *array2 = (DEVMODE *)malloc(sizeof(DEVMODE)*5*numextramodes);
|
155 | 178 | DEVMODE compmode = *array[0];
|
156 | 179 | DWORD newcount = 0;
|
157 | 180 | int i;
|
— | — | @@ -157,7 +180,7 @@ |
158 | 181 | if(ScanColorMode(*array,*count,8))
|
159 | 182 | {
|
160 | 183 | compmode.dmBitsPerPel = 8;
|
161 | | - for(i = 0; i < 30; i++)
|
| 184 | + for(i = 0; i < numextramodes; i++)
|
162 | 185 | {
|
163 | 186 | compmode.dmPelsWidth = ExtraModes[i][0];
|
164 | 187 | compmode.dmPelsHeight = ExtraModes[i][1];
|
— | — | @@ -172,7 +195,7 @@ |
173 | 196 | if(ScanColorMode(*array,*count,15))
|
174 | 197 | {
|
175 | 198 | compmode.dmBitsPerPel = 15;
|
176 | | - for(i = 0; i < 30; i++)
|
| 199 | + for(i = 0; i < numextramodes; i++)
|
177 | 200 | {
|
178 | 201 | compmode.dmPelsWidth = ExtraModes[i][0];
|
179 | 202 | compmode.dmPelsHeight = ExtraModes[i][1];
|
— | — | @@ -187,7 +210,7 @@ |
188 | 211 | if(ScanColorMode(*array,*count,16))
|
189 | 212 | {
|
190 | 213 | compmode.dmBitsPerPel = 16;
|
191 | | - for(i = 0; i < 30; i++)
|
| 214 | + for(i = 0; i < numextramodes; i++)
|
192 | 215 | {
|
193 | 216 | compmode.dmPelsWidth = ExtraModes[i][0];
|
194 | 217 | compmode.dmPelsHeight = ExtraModes[i][1];
|
— | — | @@ -202,7 +225,7 @@ |
203 | 226 | if(ScanColorMode(*array,*count,24))
|
204 | 227 | {
|
205 | 228 | compmode.dmBitsPerPel = 24;
|
206 | | - for(i = 0; i < 30; i++)
|
| 229 | + for(i = 0; i < numextramodes; i++)
|
207 | 230 | {
|
208 | 231 | compmode.dmPelsWidth = ExtraModes[i][0];
|
209 | 232 | compmode.dmPelsHeight = ExtraModes[i][1];
|
— | — | @@ -217,7 +240,7 @@ |
218 | 241 | if(ScanColorMode(*array,*count,32))
|
219 | 242 | {
|
220 | 243 | compmode.dmBitsPerPel = 32;
|
221 | | - for(i = 0; i < 30; i++)
|
| 244 | + for(i = 0; i < numextramodes; i++)
|
222 | 245 | {
|
223 | 246 | compmode.dmPelsWidth = ExtraModes[i][0];
|
224 | 247 | compmode.dmPelsHeight = ExtraModes[i][1];
|
— | — | @@ -237,7 +260,99 @@ |
238 | 261 |
|
239 | 262 | void AddDoubledResolutions(DEVMODE **array, DWORD *count)
|
240 | 263 | {
|
241 | | -//#error Add doubled resolutions
|
| 264 | + DEVMODE *array2 = (DEVMODE *)malloc(sizeof(DEVMODE) * 5 * numdoubledmodes);
|
| 265 | + DEVMODE compmode = *array[0];
|
| 266 | + DWORD newcount = 0;
|
| 267 | + int i;
|
| 268 | + if (ScanColorMode(*array, *count, 8));
|
| 269 | + {
|
| 270 | + compmode.dmBitsPerPel = 8;
|
| 271 | + for (i = 0; i < numdoubledmodes; i++)
|
| 272 | + {
|
| 273 | + compmode.dmPelsWidth = DoubledModes[i][3];
|
| 274 | + compmode.dmPelsHeight = DoubledModes[i][4];
|
| 275 | + compmode.dmDisplayFrequency = DoubledModes[i][2];
|
| 276 | + if (ScanModeListNoRefresh(*array, compmode, *count))
|
| 277 | + {
|
| 278 | + compmode.dmPelsWidth = DoubledModes[i][0];
|
| 279 | + compmode.dmPelsHeight = DoubledModes[i][1];
|
| 280 | + array2[newcount] = compmode;
|
| 281 | + newcount++;
|
| 282 | + }
|
| 283 | + }
|
| 284 | + }
|
| 285 | + if (ScanColorMode(*array, *count, 15));
|
| 286 | + {
|
| 287 | + compmode.dmBitsPerPel = 15;
|
| 288 | + for (i = 0; i < numdoubledmodes; i++)
|
| 289 | + {
|
| 290 | + compmode.dmPelsWidth = DoubledModes[i][3];
|
| 291 | + compmode.dmPelsHeight = DoubledModes[i][4];
|
| 292 | + compmode.dmDisplayFrequency = DoubledModes[i][2];
|
| 293 | + if (ScanModeListNoRefresh(*array, compmode, *count))
|
| 294 | + {
|
| 295 | + compmode.dmPelsWidth = DoubledModes[i][0];
|
| 296 | + compmode.dmPelsHeight = DoubledModes[i][1];
|
| 297 | + array2[newcount] = compmode;
|
| 298 | + newcount++;
|
| 299 | + }
|
| 300 | + }
|
| 301 | + }
|
| 302 | + if (ScanColorMode(*array, *count, 16));
|
| 303 | + {
|
| 304 | + compmode.dmBitsPerPel = 16;
|
| 305 | + for (i = 0; i < numdoubledmodes; i++)
|
| 306 | + {
|
| 307 | + compmode.dmPelsWidth = DoubledModes[i][3];
|
| 308 | + compmode.dmPelsHeight = DoubledModes[i][4];
|
| 309 | + compmode.dmDisplayFrequency = DoubledModes[i][2];
|
| 310 | + if (ScanModeListNoRefresh(*array, compmode, *count))
|
| 311 | + {
|
| 312 | + compmode.dmPelsWidth = DoubledModes[i][0];
|
| 313 | + compmode.dmPelsHeight = DoubledModes[i][1];
|
| 314 | + array2[newcount] = compmode;
|
| 315 | + newcount++;
|
| 316 | + }
|
| 317 | + }
|
| 318 | + }
|
| 319 | + if (ScanColorMode(*array, *count, 24));
|
| 320 | + {
|
| 321 | + compmode.dmBitsPerPel = 24;
|
| 322 | + for (i = 0; i < numdoubledmodes; i++)
|
| 323 | + {
|
| 324 | + compmode.dmPelsWidth = DoubledModes[i][3];
|
| 325 | + compmode.dmPelsHeight = DoubledModes[i][4];
|
| 326 | + compmode.dmDisplayFrequency = DoubledModes[i][2];
|
| 327 | + if (ScanModeListNoRefresh(*array, compmode, *count))
|
| 328 | + {
|
| 329 | + compmode.dmPelsWidth = DoubledModes[i][0];
|
| 330 | + compmode.dmPelsHeight = DoubledModes[i][1];
|
| 331 | + array2[newcount] = compmode;
|
| 332 | + newcount++;
|
| 333 | + }
|
| 334 | + }
|
| 335 | + }
|
| 336 | + if (ScanColorMode(*array, *count, 32));
|
| 337 | + {
|
| 338 | + compmode.dmBitsPerPel = 32;
|
| 339 | + for (i = 0; i < numdoubledmodes; i++)
|
| 340 | + {
|
| 341 | + compmode.dmPelsWidth = DoubledModes[i][3];
|
| 342 | + compmode.dmPelsHeight = DoubledModes[i][4];
|
| 343 | + compmode.dmDisplayFrequency = DoubledModes[i][2];
|
| 344 | + if (ScanModeListNoRefresh(*array, compmode, *count))
|
| 345 | + {
|
| 346 | + compmode.dmPelsWidth = DoubledModes[i][0];
|
| 347 | + compmode.dmPelsHeight = DoubledModes[i][1];
|
| 348 | + array2[newcount] = compmode;
|
| 349 | + newcount++;
|
| 350 | + }
|
| 351 | + }
|
| 352 | + }
|
| 353 | + *array = (DEVMODE *)realloc(*array, (*count + newcount) * sizeof(DEVMODE));
|
| 354 | + memcpy(&(*array)[*count - 1], array2, newcount * sizeof(DEVMODE));
|
| 355 | + free(array2);
|
| 356 | + *count += newcount;
|
242 | 357 | }
|
243 | 358 |
|
244 | 359 | void AddExtraColorModes(DEVMODE **array, DWORD *count)
|
— | — | @@ -398,8 +513,8 @@ |
399 | 514 | if(dxglcfg.AddColorDepths) AddExtraColorModes(&modes,&modenum); // FIXME: Add color depths by bitmask
|
400 | 515 | DiscardDuplicateModes(&modes,&modenum);
|
401 | 516 | if(dxglcfg.AddModes && (dxglcfg.scaler != 0)) AddExtraResolutions(&modes,&modenum); // FIXME: Add modes by bitmask
|
402 | | - if (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
|
403 | | - (dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f))
|
| 517 | + if (dxglcfg.AddModes && (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
|
| 518 | + (dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f)))
|
404 | 519 | AddDoubledResolutions(&modes, &modenum);
|
405 | 520 | modenum--;
|
406 | 521 | switch(dxglcfg.SortModes)
|
— | — | @@ -1663,7 +1778,7 @@ |
1664 | 1779 | {
|
1665 | 1780 | if (dwWidth <= 400) xscale = 2;
|
1666 | 1781 | else xscale = 1;
|
1667 | | - if (dwHeight <= 240) yscale = 2;
|
| 1782 | + if (dwHeight <= 300) yscale = 2;
|
1668 | 1783 | else yscale = 1;
|
1669 | 1784 | }
|
1670 | 1785 | else
|
Index: ddraw/glRenderer.cpp |
— | — | @@ -3347,7 +3347,7 @@ |
3348 | 3348 | {
|
3349 | 3349 | if (sizes[2] <= 400) This->firstscalex = 2.0f;
|
3350 | 3350 | else This->firstscalex = 1.0f;
|
3351 | | - if (sizes[3] <= 240) This->firstscaley = 2.0f;
|
| 3351 | + if (sizes[3] <= 300) This->firstscaley = 2.0f;
|
3352 | 3352 | else This->firstscaley = 1.0f;
|
3353 | 3353 | }
|
3354 | 3354 | else
|
— | — | @@ -3737,8 +3737,8 @@ |
3738 | 3738 | {
|
3739 | 3739 | if (width <= 400) This->firstscalex = 2.0f;
|
3740 | 3740 | else This->firstscaley = 1.0f;
|
3741 | | - if (height <= 240) This->firstscaley = 2;
|
3742 | | - else This->firstscaley = 1;
|
| 3741 | + if (height <= 300) This->firstscaley = 2.0f;
|
| 3742 | + else This->firstscaley = 1.0f;
|
3743 | 3743 | }
|
3744 | 3744 | else
|
3745 | 3745 | {
|