DXGL r843 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r842‎ | r843 | r844 >
Date:22:27, 5 August 2018
Author:admin
Status:new
Tags:
Comment:
Add common SVGA modes to "Additional display modes"
Modified paths:
  • /Help/html/config/display/additionaldisplaymodes.htmlbody (modified) (history)
  • /ReadMe.md (modified) (history)
  • /ddraw/glDirectDraw.cpp (modified) (history)
  • /dxgl-example.ini (modified) (history)
  • /dxglcfg/dxglcfg.cpp (modified) (history)

Diff [purge]

Index: Help/html/config/display/additionaldisplaymodes.htmlbody
@@ -136,4 +136,21 @@
137137 896x672, 60Hz refresh<br />
138138 928x696, 60Hz refresh
139139 </code>
 140+</p>
 141+<h1>Common SVGA resolutions</h1>
 142+<p>
 143+ Adds several common 4:3 and 5:4 display resolutions used by SVGA type graphics adapters. This option is useful when running under Wine on a system that doesn&#8217;t support mode switching.<br />
 144+ The following video modes are added:<br />
 145+ <code>
 146+ 640x480, 60Hz refresh<br />
 147+ 800x600, 56Hz refresh<br />
 148+ 800x600, 60Hz refresh<br />
 149+ 1024x768, 60Hz refresh<br />
 150+ 1152x864, 60Hz refresh<br />
 151+ 1280x960, 60Hz refresh<br />
 152+ 1280x1024, 60Hz refresh<br />
 153+ 1600x1200, 60Hz refresh<br />
 154+ 1920x1440, 60Hz refresh<br />
 155+ 2048x1536, 60Hz refresh
 156+ </code>
140157 </p>
\ No newline at end of file
Index: ReadMe.md
@@ -1,4 +1,4 @@
2 -# DXGL 0.5.14
 2+# DXGL 0.5.15
33 https://www.dxgl.info
44
55 ## Introduction
Index: ddraw/glDirectDraw.cpp
@@ -214,6 +214,23 @@
215215 const int END_UNCOMMONMODES = __LINE__ - 4;
216216 const int NumUncommonModes = END_UNCOMMONMODES - START_UNCOMMONMODES;
217217
 218+const int START_COMMONSVGAMODES = __LINE__;
 219+const int CommonSVGAModes[][3] =
 220+{
 221+ { 640,480,60 },
 222+ { 800,600,56 },
 223+ { 800,600,60 },
 224+ { 1024,768,60 },
 225+ { 1152,864,60 },
 226+ { 1280,960,60 },
 227+ { 1280,1024,60 },
 228+ { 1600,1200,60 },
 229+ { 1920,1440,60 },
 230+ { 2048,1536,60 }
 231+};
 232+const int END_COMMONSVGAMODES = __LINE__ - 4;
 233+const int NumCommonSVGAModes = END_COMMONSVGAMODES - START_COMMONSVGAMODES;
 234+
218235 const int START_DOUBLEDMODESCOUNT = __LINE__;
219236 const int DoubledModes[] [5] =
220237 {
@@ -637,6 +654,8 @@
638655 AddExtraResolutions(&modes, &modenum, UHD2Modes, NumUHD2Modes);
639656 if (dxglcfg.AddModes & 64) //Very uncommon resolutions
640657 AddExtraResolutions(&modes, &modenum, UncommonModes, NumUncommonModes);
 658+ if (dxglcfg.AddModes & 128) //Common SVGA modes
 659+ AddExtraResolutions(&modes, &modenum, CommonSVGAModes, NumCommonSVGAModes);
641660 }
642661 if (dxglcfg.AddModes && (_isnan(dxglcfg.postsizex) || _isnan(dxglcfg.postsizey) ||
643662 (dxglcfg.postsizex < 0.25f) || (dxglcfg.postsizey < 0.25f)))
Index: dxgl-example.ini
@@ -137,6 +137,8 @@
138138 ; 16 - Add QHD to UHD modes.
139139 ; 32 - Add over-4K UHD modes. Check GPU specifications before enabling.
140140 ; 64 - Add very uncommon resolutions of all dimensions.
 141+; 128 - Add common SVGA modes. Use under Wine if your display driver doesn't
 142+; support modeswitching.
141143 ; Default is 1.
142144 AddModes=1
143145
@@ -628,6 +630,7 @@
629631 ; 3 - Activate when the pixel value matches a set value (i.e. palette index)
630632 ; 4 - Activate when the pixel value is less than or equal to a set value
631633 ; 5 - Activate when the pixel value is greater than or equal to a set value
 634+; 6 - Activate when the pixel value is one of 3 8-bit values in 8-bit mode
632635 ; Default is 0
633636 HackAutoExpandViewportCompare=0
634637
Index: dxglcfg/dxglcfg.cpp
@@ -143,7 +143,7 @@
144144 _T("32-bit")
145145 };
146146
147 -static const TCHAR *extramodes[7] = {
 147+static const TCHAR *extramodes[8] = {
148148 _T("Common low resolutions"),
149149 _T("Uncommon low resolutions"),
150150 _T("Uncommon SD resolutions"),
@@ -150,7 +150,8 @@
151151 _T("High Definition resolutions"),
152152 _T("Ultra-HD resolutions"),
153153 _T("Ultra-HD above 4k"),
154 - _T("Very uncommon resolutions")
 154+ _T("Very uncommon resolutions"),
 155+ _T("Common SVGA resolutions")
155156 };
156157
157158 DWORD AddApp(LPCTSTR path, BOOL copyfile, BOOL admin, BOOL force, HWND hwnd)
@@ -1502,7 +1503,7 @@
15031504 {
15041505 r.left = r.left + 2;
15051506 r.right = r.left + GetSystemMetrics(SM_CXMENUCHECK);
1506 - if (drawitem->itemID == 7)
 1507+ if (drawitem->itemID == 8)
15071508 {
15081509 if (!cfgmask->AddModes)
15091510 DrawCheck(drawitem->hDC, drawitem->itemState & ODS_SELECTED, TRUE, FALSE, FALSE, &r);
@@ -1550,6 +1551,9 @@
15511552 case 64:
15521553 _tcscpy(combotext, extramodes[6]);
15531554 break;
 1555+ case 128:
 1556+ _tcscpy(combotext, extramodes[7]);
 1557+ break;
15541558 default:
15551559 _tcscpy(combotext, _T("Multiple selections"));
15561560 }
@@ -1616,7 +1620,7 @@
16171621 if (ExtraModes_Dropdown)
16181622 {
16191623 cursel = SendDlgItemMessage(hWnd, IDC_EXTRAMODES, CB_GETCURSEL, 0, 0);
1620 - if (cursel == 7)
 1624+ if (cursel == 8)
16211625 {
16221626 if (cfgmask->AddModes) cfgmask->AddModes = 0;
16231627 else cfgmask->AddModes = 1;
@@ -3323,7 +3327,7 @@
33243328 SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_ADDSTRING, i, (LPARAM)buffer);
33253329 }
33263330 SendDlgItemMessage(hTabs[0], IDC_COLORDEPTH, CB_SETCURSEL, cfg->AddColorDepths, 0);
3327 - for (i = 0; i < 7; i++)
 3331+ for (i = 0; i < 8; i++)
33283332 {
33293333 _tcscpy(buffer, extramodes[i]);
33303334 SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, i, (LPARAM)buffer);