Index: cfgmgr/ReadMe.txt |
— | — | @@ -106,4 +106,11 @@ |
107 | 107 | Valid settings:
|
108 | 108 | 0 - Determined by application
|
109 | 109 | 1 - Off
|
110 | | -2 - On |
\ No newline at end of file |
| 110 | +2 - On
|
| 111 | +
|
| 112 | +Member texformat
|
| 113 | +REG_DWORD HKCU\DXGL\<app>\TexFormat
|
| 114 | +Texture format
|
| 115 | +Valid settings:
|
| 116 | +0 - RGBA8
|
| 117 | +1 - Optimized |
\ No newline at end of file |
Index: cfgmgr/cfgmgr.cpp |
— | — | @@ -139,6 +139,7 @@ |
140 | 140 | cfg->AllColorDepths = ReadBool(hKey,cfg->AllColorDepths,cfgmask->AllColorDepths,_T("AllColorDepths"));
|
141 | 141 | cfg->ExtraModes = ReadBool(hKey,cfg->ExtraModes,cfgmask->ExtraModes,_T("ExtraModes"));
|
142 | 142 | cfg->vsync = ReadDWORD(hKey,cfg->vsync,cfgmask->vsync,_T("VSync"));
|
| 143 | + cfg->texformat = ReadBool(hKey,cfg->texformat,cfgmask->texformat,_T("TexFormat"));
|
143 | 144 | if(!global && dll)
|
144 | 145 | {
|
145 | 146 | LPTSTR paths;
|
— | — | @@ -213,6 +214,7 @@ |
214 | 215 | WriteDWORD(hKey,cfg->SortModes,cfgmask->SortModes,_T("SortModes"));
|
215 | 216 | WriteBool(hKey,cfg->AllColorDepths,cfgmask->AllColorDepths,_T("AllColorDepths"));
|
216 | 217 | WriteBool(hKey,cfg->ExtraModes,cfgmask->ExtraModes,_T("ExtraModes"));
|
| 218 | + WriteBool(hKey,cfg->texformat,cfgmask->texformat,_T("TexFormat"));
|
217 | 219 | WriteDWORD(hKey,cfg->vsync,cfgmask->vsync,_T("VSync"));
|
218 | 220 | }
|
219 | 221 |
|
Index: cfgmgr/cfgmgr.h |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | DWORD SortModes;
|
37 | 37 | bool AllColorDepths;
|
38 | 38 | bool ExtraModes;
|
| 39 | + bool texformat;
|
39 | 40 | } DXGLCFG;
|
40 | 41 |
|
41 | 42 | void ReadSettings(HKEY hKey, DXGLCFG *cfg, DXGLCFG *mask, bool global, bool dll, LPTSTR dir);
|
Index: ddraw/glDirectDrawSurface.cpp |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | // DXGL
|
3 | | -// Copyright (C) 2011 William Feely
|
| 3 | +// Copyright (C) 2011-2012 William Feely
|
4 | 4 |
|
5 | 5 | // This library is free software; you can redistribute it and/or
|
6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
— | — | @@ -349,7 +349,8 @@ |
350 | 350 | case 8:
|
351 | 351 | texformat = GL_LUMINANCE;
|
352 | 352 | texformat2 = GL_UNSIGNED_BYTE;
|
353 | | - texformat3 = GL_LUMINANCE8;
|
| 353 | + if(dxglcfg.texformat) texformat3 = GL_LUMINANCE8;
|
| 354 | + else texformat3 = GL_RGBA8;
|
354 | 355 | ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_PALETTEINDEXED8;
|
355 | 356 | ddsd.ddpfPixelFormat.dwRBitMask = 0;
|
356 | 357 | ddsd.ddpfPixelFormat.dwGBitMask = 0;
|
— | — | @@ -359,7 +360,8 @@ |
360 | 361 | case 15:
|
361 | 362 | texformat = GL_BGRA;
|
362 | 363 | texformat2 = GL_UNSIGNED_SHORT_1_5_5_5_REV;
|
363 | | - texformat3 = GL_RGB5_A1;
|
| 364 | + if(dxglcfg.texformat) texformat3 = GL_RGB5_A1;
|
| 365 | + else texformat3 = GL_RGBA8;
|
364 | 366 | ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
|
365 | 367 | ddsd.ddpfPixelFormat.dwRBitMask = 0x7C00;
|
366 | 368 | ddsd.ddpfPixelFormat.dwGBitMask = 0x3E0;
|
— | — | @@ -370,7 +372,8 @@ |
371 | 373 | case 16:
|
372 | 374 | texformat = GL_RGB;
|
373 | 375 | texformat2 = GL_UNSIGNED_SHORT_5_6_5;
|
374 | | - texformat3 = GL_RGB;
|
| 376 | + if(dxglcfg.texformat) texformat3 = GL_RGB;
|
| 377 | + else texformat3 = GL_RGBA8;
|
375 | 378 | ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
|
376 | 379 | ddsd.ddpfPixelFormat.dwRBitMask = 0xF800;
|
377 | 380 | ddsd.ddpfPixelFormat.dwGBitMask = 0x7E0;
|
— | — | @@ -380,7 +383,8 @@ |
381 | 384 | case 24:
|
382 | 385 | texformat = GL_BGR;
|
383 | 386 | texformat2 = GL_UNSIGNED_BYTE;
|
384 | | - texformat3 = GL_RGB8;
|
| 387 | + if(dxglcfg.texformat) texformat3 = GL_RGB8;
|
| 388 | + else texformat3 = GL_RGBA8;
|
385 | 389 | ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
|
386 | 390 | ddsd.ddpfPixelFormat.dwRBitMask = 0xFF0000;
|
387 | 391 | ddsd.ddpfPixelFormat.dwGBitMask = 0xFF00;
|
Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | // DXGL
|
3 | | -// Copyright (C) 2011 William Feely
|
| 3 | +// Copyright (C) 2011-2012 William Feely
|
4 | 4 |
|
5 | 5 | // This library is free software; you can redistribute it and/or
|
6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
— | — | @@ -552,6 +552,9 @@ |
553 | 553 | else SendDlgItemMessage(hWnd,IDC_EXTRAMODES,BM_SETCHECK,BST_UNCHECKED,0);
|
554 | 554 | // shader path
|
555 | 555 | SetText(hWnd,IDC_SHADER,cfg->shaderfile,cfgmask->shaderfile,false);
|
| 556 | + // texture format
|
| 557 | + if(cfg->texformat) SendDlgItemMessage(hWnd,IDC_TEXFORMAT,BM_SETCHECK,BST_CHECKED,0);
|
| 558 | + else SendDlgItemMessage(hWnd,IDC_TEXFORMAT,BM_SETCHECK,BST_UNCHECKED,0);
|
556 | 559 | // Add installed programs
|
557 | 560 | current_app = 1;
|
558 | 561 | appcount = 1;
|
— | — | @@ -769,7 +772,7 @@ |
770 | 773 | SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
|
771 | 774 | SendDlgItemMessage(hWnd,IDC_UNCOMMONCOLOR,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
|
772 | 775 | SendDlgItemMessage(hWnd,IDC_EXTRAMODES,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
|
773 | | - SendDlgItemMessage(hWnd,IDC_SYSMEMCACHE,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
|
| 776 | + SendDlgItemMessage(hWnd,IDC_TEXFORMAT,BM_SETSTYLE,BS_AUTO3STATE,(LPARAM)TRUE);
|
774 | 777 | }
|
775 | 778 | else if(!current_app && tristate)
|
776 | 779 | {
|
— | — | @@ -794,7 +797,7 @@ |
795 | 798 | SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
|
796 | 799 | SendDlgItemMessage(hWnd,IDC_UNCOMMONCOLOR,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
|
797 | 800 | SendDlgItemMessage(hWnd,IDC_EXTRAMODES,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
|
798 | | - SendDlgItemMessage(hWnd,IDC_SYSMEMCACHE,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
|
| 801 | + SendDlgItemMessage(hWnd,IDC_TEXFORMAT,BM_SETSTYLE,BS_AUTOCHECKBOX,(LPARAM)TRUE);
|
799 | 802 | }
|
800 | 803 | // Read settings into controls
|
801 | 804 | SetCombo(hWnd,IDC_VIDMODE,cfg->scaler,cfgmask->scaler,tristate);
|
— | — | @@ -808,6 +811,7 @@ |
809 | 812 | SetCheck(hWnd,IDC_COLOR,cfg->colormode,cfgmask->colormode,tristate);
|
810 | 813 | SetCheck(hWnd,IDC_HIGHRES,cfg->highres,cfgmask->highres,tristate);
|
811 | 814 | SetCheck(hWnd,IDC_UNCOMMONCOLOR,cfg->AllColorDepths,cfgmask->AllColorDepths,tristate);
|
| 815 | + SetCheck(hWnd,IDC_TEXFORMAT,cfg->texformat,cfgmask->texformat,tristate);
|
812 | 816 | SetCheck(hWnd,IDC_EXTRAMODES,cfg->ExtraModes,cfgmask->ExtraModes,tristate);
|
813 | 817 | SetText(hWnd,IDC_SHADER,cfg->shaderfile,cfgmask->shaderfile,tristate);
|
814 | 818 | }
|
— | — | @@ -871,6 +875,11 @@ |
872 | 876 | EnableWindow(GetDlgItem(hWnd,IDC_APPLY),true);
|
873 | 877 | *dirty = true;
|
874 | 878 | break;
|
| 879 | + case IDC_TEXFORMAT:
|
| 880 | + cfg->texformat = GetCheck(hWnd,IDC_TEXFORMAT,cfgmask->texformat);
|
| 881 | + EnableWindow(GetDlgItem(hWnd,IDC_APPLY),true);
|
| 882 | + *dirty = true;
|
| 883 | + break;
|
875 | 884 | case IDC_SHADER:
|
876 | 885 | if(HIWORD(wParam) == EN_CHANGE)
|
877 | 886 | {
|
Index: dxglcfg/dxglcfg.rc |
— | — | @@ -60,12 +60,12 @@ |
61 | 61 | COMBOBOX IDC_MSAA, 196, 155, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
62 | 62 | LTEXT "Aspect ratio", IDC_STATIC, 300, 145, 40, 8, SS_LEFT
|
63 | 63 | COMBOBOX IDC_ASPECT, 299, 155, 100, 14, CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
64 | | - AUTOCHECKBOX "Always cache surfaces to system memory", IDC_SYSMEMCACHE, 196, 173, 149, 10
|
65 | 64 | AUTOCHECKBOX "Adjust Primary resolution", IDC_HIGHRES, 299, 28, 96, 8
|
66 | 65 | AUTOCHECKBOX "Support All Color Depths", IDC_UNCOMMONCOLOR, 299, 55, 94, 8
|
67 | 66 | AUTOCHECKBOX "Add Extra Display Modes", IDC_EXTRAMODES, 299, 42, 100, 8
|
68 | 67 | LTEXT "Sort video modes", IDC_STATIC, 195, 39, 56, 8, SS_LEFT
|
69 | 68 | COMBOBOX IDC_SORTMODES, 195, 49, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
| 69 | + AUTOCHECKBOX "Use optimized texture internal formats", IDC_TEXFORMAT, 196, 173, 149, 10
|
70 | 70 | }
|
71 | 71 |
|
72 | 72 |
|
Index: dxglcfg/resource.h |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | #define IDI_DXGL 107
|
25 | 25 | #define IDI_DXGLSM 109
|
26 | 26 | #define IDI_STAR 111
|
27 | | -#define IDC_SYSMEMCACHE 1001
|
| 27 | +#define IDC_TEXFORMAT 1001
|
28 | 28 | #define IDC_HIGHRES 1002
|
29 | 29 | #define IDC_SORTMODES 1003
|
30 | 30 | #define IDC_UNCOMMONCOLOR 1004
|