DXGL r714 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r713
|
r714
|
r715
>
Date:
23:27, 11 June 2017
Author:
admin
Status:
new
Tags:
Comment:
Support super/subsampling in "Adjust primary resolution" and "Change desktop resolution"
Modified paths:
/ddraw/glDirectDraw.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDraw.cpp
—
—
@@ -486,7 +486,8 @@
487
487
if (!_isnan(dxglcfg.firstscalex) && !_isnan(dxglcfg.firstscaley) &&
488
488
(dxglcfg.firstscalex > 0.25f) && (dxglcfg.firstscaley > 0.25f) &&
489
489
(dxglcfg.firstscalex != 1.0f) && (dxglcfg.firstscaley != 1.0f) &&
490
- ((dxglcfg.scaler == 0) || ((dxglcfg.scaler >= 4) && (dxglcfg.scaler <= 6))))
490
+ ((dxglcfg.scaler == 0) || ((dxglcfg.scaler >= 4) && (dxglcfg.scaler <= 6))) &&
491
+ (!dxglcfg.primaryscale))
491
492
scalemodes = TRUE;
492
493
else scalemodes = FALSE;
493
494
while(EnumDisplaySettings(NULL,modenum++,&mode))
—
—
@@ -1809,8 +1810,17 @@
1810
1811
default:
1811
1812
newmode.dmSize = sizeof(DEVMODE);
1812
1813
newmode.dmDriverExtra = 0;
1813
- newmode.dmPelsWidth = dwWidth * xscale;
1814
- newmode.dmPelsHeight = dwHeight * yscale;
1814
+ if (!dxglcfg.primaryscale || (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
1815
+ (dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f)))
1816
+ {
1817
+ newmode.dmPelsWidth = dwWidth * xscale;
1818
+ newmode.dmPelsHeight = dwHeight * yscale;
1819
+ }
1820
+ else
1821
+ {
1822
+ newmode.dmPelsWidth = dwWidth;
1823
+ newmode.dmPelsHeight = dwHeight;
1824
+ }
1815
1825
if (dxglcfg.colormode)
1816
1826
newmode.dmBitsPerPel = dwBPP;
1817
1827
else newmode.dmBitsPerPel = currmode.dmBitsPerPel;
—
—
@@ -1824,9 +1834,17 @@
1825
1835
{
1826
1836
case DISP_CHANGE_SUCCESSFUL:
1827
1837
if (fullscreen) this->currmode = newmode;
1828
- primaryx = newmode.dmPelsWidth / xscale;
1838
+ if (dxglcfg.primaryscale)
1839
+ {
1840
+ primaryx = newmode.dmPelsWidth;
1841
+ primaryy = newmode.dmPelsHeight;
1842
+ }
1843
+ else
1844
+ {
1845
+ primaryx = newmode.dmPelsWidth / xscale;
1846
+ primaryy = newmode.dmPelsHeight / yscale;
1847
+ }
1829
1848
screenx = newmode.dmPelsWidth;
1830
- primaryy = newmode.dmPelsHeight / yscale;
1831
1849
screeny = newmode.dmPelsHeight;
1832
1850
internalx = newmode.dmPelsWidth;
1833
1851
internaly = newmode.dmPelsHeight;
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version