Index: ddraw/glDirectDraw.cpp |
— | — | @@ -449,27 +449,25 @@ |
450 | 450 | case 15:
|
451 | 451 | compmode = (*array)[i];
|
452 | 452 | compmode.dmBitsPerPel = 16;
|
453 | | - if(!ScanModeList(*array,compmode,*count))
|
| 453 | + if(!ScanModeList(*array,compmode,*count) && (dxglcfg.AddColorDepths & 4))
|
454 | 454 | {
|
455 | 455 | array2[count2] = compmode;
|
456 | 456 | count2++;
|
457 | 457 | }
|
458 | 458 | break;
|
459 | | -#ifdef _DEBUG //FIXME: Temporarily removed in release builds for compatibility.
|
460 | 459 | case 16:
|
461 | 460 | compmode = (*array)[i];
|
462 | 461 | compmode.dmBitsPerPel = 15;
|
463 | | - if(!ScanModeList(*array,compmode,*count))
|
| 462 | + if(!ScanModeList(*array,compmode,*count) && (dxglcfg.AddColorDepths & 2))
|
464 | 463 | {
|
465 | 464 | array2[count2] = compmode;
|
466 | 465 | count2++;
|
467 | 466 | }
|
468 | 467 | break;
|
469 | | -#endif
|
470 | 468 | case 24:
|
471 | 469 | compmode = (*array)[i];
|
472 | 470 | compmode.dmBitsPerPel = 32;
|
473 | | - if(!ScanModeList(*array,compmode,*count))
|
| 471 | + if(!ScanModeList(*array,compmode,*count) && (dxglcfg.AddColorDepths & 16))
|
474 | 472 | {
|
475 | 473 | array2[count2] = compmode;
|
476 | 474 | count2++;
|
— | — | @@ -478,7 +476,7 @@ |
479 | 477 | case 32:
|
480 | 478 | compmode = (*array)[i];
|
481 | 479 | compmode.dmBitsPerPel = 24;
|
482 | | - if(!ScanModeList(*array,compmode,*count))
|
| 480 | + if(!ScanModeList(*array,compmode,*count) && (dxglcfg.AddColorDepths & 8))
|
483 | 481 | {
|
484 | 482 | array2[count2] = compmode;
|
485 | 483 | count2++;
|
— | — | @@ -485,23 +483,21 @@ |
486 | 484 | }
|
487 | 485 | compmode = (*array)[i];
|
488 | 486 | compmode.dmBitsPerPel = 16;
|
489 | | - if(!ScanModeList(*array,compmode,*count))
|
| 487 | + if(!ScanModeList(*array,compmode,*count) && (dxglcfg.AddColorDepths & 4))
|
490 | 488 | {
|
491 | 489 | array2[count2] = compmode;
|
492 | 490 | count2++;
|
493 | 491 | }
|
494 | 492 | compmode = (*array)[i];
|
495 | | -#ifdef _DEBUG //FIXME: Temporarily removed in release builds for compatibility.
|
496 | 493 | compmode.dmBitsPerPel = 15;
|
497 | | - if(!ScanModeList(*array,compmode,*count))
|
| 494 | + if(!ScanModeList(*array,compmode,*count) && (dxglcfg.AddColorDepths & 2))
|
498 | 495 | {
|
499 | 496 | array2[count2] = compmode;
|
500 | 497 | count2++;
|
501 | 498 | }
|
502 | 499 | compmode = (*array)[i];
|
503 | | -#endif
|
504 | 500 | compmode.dmBitsPerPel = 8;
|
505 | | - if(!ScanModeList(*array,compmode,*count))
|
| 501 | + if(!ScanModeList(*array,compmode,*count) && (dxglcfg.AddColorDepths & 1))
|
506 | 502 | {
|
507 | 503 | array2[count2] = compmode;
|
508 | 504 | count2++;
|
— | — | @@ -515,6 +511,13 @@ |
516 | 512 | memcpy(&(*array)[*count-1],array2,count2*sizeof(DEVMODE));
|
517 | 513 | free(array2);
|
518 | 514 | *count += count2;
|
| 515 | + if ((dxglcfg.AddColorDepths & 2) && !(dxglcfg.AddColorDepths & 4))
|
| 516 | + {
|
| 517 | + for (DWORD x = 0; x < (*count); x++)
|
| 518 | + {
|
| 519 | + if ((*array)[x].dmBitsPerPel == 15) (*array)[x].dmBitsPerPel = 16;
|
| 520 | + }
|
| 521 | + }
|
519 | 522 | }
|
520 | 523 |
|
521 | 524 | int SortDepth(const DEVMODE *mode1, const DEVMODE *mode2)
|
— | — | @@ -1910,6 +1913,8 @@ |
1911 | 1914 | LONG error;
|
1912 | 1915 | DWORD flags;
|
1913 | 1916 | int stretchmode;
|
| 1917 | + if ((dxglcfg.AddColorDepths & 2) && !(dxglcfg.AddColorDepths & 4) && (dwBPP == 16))
|
| 1918 | + dwBPP = 15;
|
1914 | 1919 | if(!oldmode.dmSize)
|
1915 | 1920 | {
|
1916 | 1921 | oldmode.dmSize = sizeof(DEVMODE);
|