DXGL r748 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r747‎ | r748 | r749 >
Date:07:02, 17 September 2017
Author:admin
Status:new
Tags:
Comment:
Fix DirectDraw1 Z-buffer textures.
Add modes to dxglcfg2
Restore beta example INI.
Set version to 0.5.13 beta.
Modified paths:
  • /common/releasever.h (modified) (history)
  • /ddraw/glTexture.cpp (modified) (history)
  • /dxgl-example.ini (modified) (history)
  • /dxglcfg2/dxglcfg2.c (modified) (history)

Diff [purge]

Index: common/releasever.h
@@ -4,8 +4,8 @@
55
66 #define DXGLMAJORVER 0
77 #define DXGLMINORVER 5
8 -#define DXGLPOINTVER 12
9 -#define DXGLBETA 0
 8+#define DXGLPOINTVER 13
 9+#define DXGLBETA 1
1010
1111 #define STR2(x) #x
1212 #define STR(x) STR2(x)
Index: ddraw/glTexture.cpp
@@ -145,6 +145,7 @@
146146 if (newtexture->levels[0].ddsd.ddsCaps.dwCaps & DDSCAPS_ZBUFFER)
147147 {
148148 newtexture->levels[0].ddsd.dwFlags |= DDSD_PIXELFORMAT;
 149+ newtexture->levels[0].ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
149150 newtexture->levels[0].ddsd.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER;
150151 if (!newtexture->levels[0].ddsd.ddpfPixelFormat.dwZBufferBitDepth)
151152 newtexture->levels[0].ddsd.ddpfPixelFormat.dwZBufferBitDepth = newtexture->levels[0].ddsd.dwRefreshRate;
Index: dxgl-example.ini
@@ -92,9 +92,26 @@
9393 ; AllColorDepths - Boolean
9494 ; Adds 8, 16, 24, and 32-bit color modes if they are not already
9595 ; added to the list of display modes passed to the program.
 96+; (future)Equivalent to setting AddColorDepths to 21.
 97+; (future)Overridden by AddColorDepths.
9698 ; Default is true if Windows 8 or higher is detected, false otherwise.
9799 AllColorDepths = true
98100
 101+; AddColorDepths - Integer
 102+; (future) Adds additional color modes if they are not already
 103+; added to the list of display modes passed to the program.
 104+; This is a bit-mapped variable, add up the desired color depths from
 105+; the list of values below:
 106+; 1 - Add 8-bit modes
 107+; 2 - Add 15-bit modes
 108+; 4 - Add 16-bit modes
 109+; 8 - Add 24-bit modes
 110+; 16 - Add 32-bit modes
 111+; Default is 21 if Windows 8 or higher is detected, 0 otherwise.
 112+; Adding both 15 and 16 bit modes at the same time may cause
 113+; crashes or undefined behavior in some programs.
 114+AddColorDepths = 21
 115+
99116 ; ExtraModes - Boolean
100117 ; Adds additional video modes to the list of resolutions.
101118 ; If a display scaling mode is not set and postprocess scaling
@@ -101,8 +118,24 @@
102119 ; is set to automatic, it will add several low resolution pixel doubled
103120 ; video modes.
104121 ; Default is true.
 122+; (future)Equivalent to setting AddModes to 7. Overridden by AddModes.
105123 ExtraModes = true
106124
 125+; AddModes - Integer
 126+; (future) Adds additional video modes to the list of resolutions.
 127+; This is a bitmapped variable, add up the desired mode lists from
 128+; the list of values below:
 129+; 0 - None
 130+; 1 - Add common low-resolution modes
 131+; 2 - Add less common low-resolution modes
 132+; 4 - Add uncommon standard definition modes
 133+; 8 - Add high definition modes
 134+; 16 - Add QHD to UHD modes.
 135+; 32 - Add over-4K UHD modes. Check GPU specifications before enabling.
 136+; 64 - Add very uncommon resolutions of all dimensions.
 137+; Default is 1.
 138+AddModes = 1
 139+
107140 ; SortModes - Integer
108141 ; Determines whether or not to sort display modes by either
109142 ; resolution first or color depth first. This can make in-game
@@ -133,9 +166,31 @@
134167 ; The following values are valid:
135168 ; 0 - Use native primary surface size. Most compatible.
136169 ; 1 - Adjust primary surface size to match display.
 170+; The following will be added in the future:
 171+; 2 - Adjust primary surface to nearest integer multiple of native.
 172+; 3 - Use exact 1.5x scale.
 173+ ; 4 - Use exact 2x scale.
 174+; 5 - Use exact 2.5x scale.
 175+; 6 - Use exact 3x scale.
 176+; 7 - Use exact 4x scale.
 177+; 8 - Use custom scale.
137178 ; Default is 0.
138179 AdjustPrimaryResolution = 0
139180
 181+; PrimaryScaleX - Floating point
 182+; (future) Sets the scaling amount in the X dimension for custom primary
 183+; buffer scaling.
 184+; If zero, negative, or an invalid value, will be interpreted as 1.0
 185+; Default is 1.0
 186+PrimaryScaleX = 1.0
 187+
 188+; PrimaryScaleY - Floating point
 189+; (future) Sets the scaling amount in the Y dimension for custom primary
 190+; buffer scaling.
 191+; If zero, negative, or an invalid value, will be interpreted as 1.0
 192+; Default is 1.0
 193+PrimaryScaleY = 1.0
 194+
140195 ; ScreenAspect - Floating point or string
141196 ; Sets the aspect ratio of the display output.
142197 ; May be entered as a floating point number or as aspect ratio notation.
@@ -168,6 +223,8 @@
169224 [postprocess]
170225 ; PostprocessFilter - Integer
171226 ; Selects the filter to use for the postprocess pass.
 227+; (future)If a post processing shader is selected this will be clamped to 1
 228+; or overridden by the shader metadata.
172229 ; This will be ignored if there is no postprocess pass or scaling is 1.
173230 ; The following values are valid:
174231 ; 0 - Nearest-neighbor stretching
@@ -192,6 +249,21 @@
193250 ; Default is 0.0
194251 PostprocessScaleY = 0.0
195252
 253+; EnableShader - Boolean
 254+; (future) If true, uses a custom shader to render the postprocess pass.
 255+; Default is false
 256+EnableShader = false
 257+
 258+; ShaderFile - String
 259+; (future)Path to a file containing either a GLSL fragment shader or a
 260+; to-be-determined metadata file containing a shader pipeline and certain
 261+; parameters.
 262+; The path can be relative (will search the Shaders subdirectory of the
 263+; install directory and the path where the ddraw.dll implementation has been
 264+; placed) or absolute.
 265+; Default is undefined.
 266+; ShaderFile = example.fs
 267+
196268 [d3d]
197269 ; TextureFilter - Integer
198270 ; Texture filtering method for Direct3D draw commands.
Index: dxglcfg2/dxglcfg2.c
@@ -115,7 +115,7 @@
116116 _T("15/32-bit"),
117117 _T("8/15/32-bit"),
118118 _T("16/32-bit"),
119 - _T("8/16/32-bit"),
 119+ _T("8/16/32-bit (recommended)"),
120120 _T("8/15/32-bit"),
121121 _T("8/15/16/32-bit"),
122122 _T("24/32-bit"),
@@ -1230,8 +1230,16 @@
12311231 SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, 0, (LPARAM)buffer);
12321232 _tcscpy(buffer, _T("Uncommon low resolutions"));
12331233 SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, 1, (LPARAM)buffer);
1234 - _tcscpy(buffer, _T("Higher resolutions"));
 1234+ _tcscpy(buffer, _T("Uncommon SD resolutions"));
12351235 SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, 2, (LPARAM)buffer);
 1236+ _tcscpy(buffer, _T("High Definition resolutions"));
 1237+ SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, 3, (LPARAM)buffer);
 1238+ _tcscpy(buffer, _T("Ultra-HD resolutions"));
 1239+ SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, 4, (LPARAM)buffer);
 1240+ _tcscpy(buffer, _T("Ultra-HD above 4k"));
 1241+ SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, 5, (LPARAM)buffer);
 1242+ _tcscpy(buffer, _T("Very uncommon resolutions"));
 1243+ SendDlgItemMessage(hTabs[0], IDC_EXTRAMODES, CB_ADDSTRING, 6, (LPARAM)buffer);
12361244 //FIXME: Populate extra resolution combobox
12371245 // Enable shader
12381246 if (cfg->colormode) SendDlgItemMessage(hTabs[2], IDC_USESHADER, BM_SETCHECK, BST_CHECKED, 0);