DXGL r711 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r710
|
r711
|
r712
>
Date:
07:42, 2 June 2017
Author:
admin
Status:
new
Tags:
Comment:
Support scaling centered modes.
Fix an if statement always returning true.
Modified paths:
/ddraw/glDirectDraw.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDraw.cpp
—
—
@@ -264,7 +264,7 @@
265
265
DEVMODE compmode = *array[0];
266
266
DWORD newcount = 0;
267
267
int i;
268
- if (ScanColorMode(*array, *count, 8));
268
+ if (ScanColorMode(*array, *count, 8))
269
269
{
270
270
compmode.dmBitsPerPel = 8;
271
271
for (i = 0; i < numdoubledmodes; i++)
—
—
@@ -281,7 +281,7 @@
282
282
}
283
283
}
284
284
}
285
- if (ScanColorMode(*array, *count, 15));
285
+ if (ScanColorMode(*array, *count, 15))
286
286
{
287
287
compmode.dmBitsPerPel = 15;
288
288
for (i = 0; i < numdoubledmodes; i++)
—
—
@@ -298,7 +298,7 @@
299
299
}
300
300
}
301
301
}
302
- if (ScanColorMode(*array, *count, 16));
302
+ if (ScanColorMode(*array, *count, 16))
303
303
{
304
304
compmode.dmBitsPerPel = 16;
305
305
for (i = 0; i < numdoubledmodes; i++)
—
—
@@ -315,7 +315,7 @@
316
316
}
317
317
}
318
318
}
319
- if (ScanColorMode(*array, *count, 24));
319
+ if (ScanColorMode(*array, *count, 24))
320
320
{
321
321
compmode.dmBitsPerPel = 24;
322
322
for (i = 0; i < numdoubledmodes; i++)
—
—
@@ -332,7 +332,7 @@
333
333
}
334
334
}
335
335
}
336
- if (ScanColorMode(*array, *count, 32));
336
+ if (ScanColorMode(*array, *count, 32))
337
337
{
338
338
compmode.dmBitsPerPel = 32;
339
339
for (i = 0; i < numdoubledmodes; i++)
—
—
@@ -1787,10 +1787,10 @@
1788
1788
if (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
1789
1789
(dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f))
1790
1790
{
1791
- if (dwWidth <= 400) xscale = 2;
1792
- else xscale = 1;
1793
- if (dwHeight <= 300) yscale = 2;
1794
- else yscale = 1;
1791
+ if (dwWidth <= 400) xscale = 2.0f;
1792
+ else xscale = 1.0f;
1793
+ if (dwHeight <= 300) yscale = 2.0f;
1794
+ else yscale = 1.0f;
1795
1795
}
1796
1796
else
1797
1797
{
—
—
@@ -1948,9 +1948,11 @@
1949
1949
return DD_OK;
1950
1950
break;
1951
1951
case 3: // Center image
1952
- primaryx = internalx = dwWidth;
1952
+ primaryx = dwWidth;
1953
+ internalx = dwWidth * xscale;
1953
1954
screenx = currmode.dmPelsWidth;
1954
- primaryy = internaly = dwHeight;
1955
+ primaryy = dwHeight;
1956
+ internaly = dwHeight * yscale;
1955
1957
screeny = currmode.dmPelsHeight;
1956
1958
primarybpp = dwBPP;
1957
1959
if (dxglcfg.colormode) internalbpp = screenbpp = dwBPP;
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