Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bd97589d
Commit
bd97589d
authored
Jan 18, 2012
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Jan 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Let GetRasterStatus return D3D_OK, again.
parent
b18ff8b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
swapchain.c
dlls/wined3d/swapchain.c
+32
-5
No files found.
dlls/wined3d/swapchain.c
View file @
bd97589d
...
...
@@ -206,19 +206,46 @@ HRESULT CDECL wined3d_swapchain_get_raster_status(const struct wined3d_swapchain
struct
wined3d_raster_status
*
raster_status
)
{
static
BOOL
warned
;
LARGE_INTEGER
counter
,
freq_per_sec
;
LONGLONG
freq_per_frame
,
freq_per_line
;
struct
wined3d_display_mode
mode
;
/* No OpenGL equivalent */
if
(
!
warned
)
{
FIXME
(
"swapchain %p, raster_status %p stub!
\n
"
,
swapchain
,
raster_status
);
FIXME
(
"swapchain %p, raster_status %p s
emi-s
tub!
\n
"
,
swapchain
,
raster_status
);
warned
=
TRUE
;
}
/* Obtaining the raster status is a widely implemented but optional
* feature. When this method returns OK StarCraft 2 expects the
* raster_status->InVBlank value to actually change over time. To prevent
* StarCraft 2 from running in an infinite loop at startup this method
* returns INVALIDCALL. */
return
WINED3DERR_INVALIDCALL
;
* raster_status->InVBlank value to actually change over time.
* And Endless Alice Crysis doesn't care even if this method fails.
* Thus this method returns OK and fakes raster_status by
* QueryPerformanceCounter. */
if
(
!
QueryPerformanceCounter
(
&
counter
)
||
!
QueryPerformanceFrequency
(
&
freq_per_sec
))
return
WINED3DERR_INVALIDCALL
;
if
(
FAILED
(
wined3d_swapchain_get_display_mode
(
swapchain
,
&
mode
)))
return
WINED3DERR_INVALIDCALL
;
if
(
mode
.
refresh_rate
==
DEFAULT_REFRESH_RATE
)
mode
.
refresh_rate
=
60
;
freq_per_frame
=
freq_per_sec
.
QuadPart
/
mode
.
refresh_rate
;
/* Assume 20 scan lines in the vertical blank */
freq_per_line
=
freq_per_frame
/
(
mode
.
height
+
20
);
raster_status
->
scan_line
=
(
counter
.
QuadPart
%
freq_per_frame
)
/
freq_per_line
;
if
(
raster_status
->
scan_line
<
mode
.
height
)
raster_status
->
in_vblank
=
FALSE
;
else
{
raster_status
->
scan_line
=
0
;
raster_status
->
in_vblank
=
TRUE
;
}
TRACE
(
"Returning fake value, in_vblank %u, scan_line %u.
\n
"
,
raster_status
->
in_vblank
,
raster_status
->
scan_line
);
return
WINED3D_OK
;
}
HRESULT
CDECL
wined3d_swapchain_get_display_mode
(
const
struct
wined3d_swapchain
*
swapchain
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment