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
5c85f96f
Commit
5c85f96f
authored
Apr 06, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Improve GetScanLine stub so it's usable for timing related tasks.
parent
6f9e3308
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
ddraw.c
dlls/ddraw/ddraw.c
+14
-5
No files found.
dlls/ddraw/ddraw.c
View file @
5c85f96f
...
...
@@ -1964,8 +1964,8 @@ static HRESULT WINAPI ddraw7_GetScanLine(IDirectDraw7 *iface, DWORD *Scanline)
{
struct
ddraw
*
ddraw
=
impl_from_IDirectDraw7
(
iface
);
struct
wined3d_display_mode
mode
;
static
DWORD
cur_scanline
;
static
BOOL
hide
=
FALSE
;
DWORD
time
,
frame_progress
,
lines
;
TRACE
(
"iface %p, line %p.
\n
"
,
iface
,
Scanline
);
...
...
@@ -1982,11 +1982,20 @@ static HRESULT WINAPI ddraw7_GetScanLine(IDirectDraw7 *iface, DWORD *Scanline)
/* Fake the line sweeping of the monitor */
/* FIXME: We should synchronize with a source to keep the refresh rate */
*
Scanline
=
cur_scanline
++
;
/* Assume 20 scan lines in the vertical blank */
if
(
cur_scanline
>=
mode
.
height
+
20
)
cur_scanline
=
0
;
/* Simulate a 60Hz display */
time
=
GetTickCount
();
frame_progress
=
time
&
15
;
/* time % (1000 / 60) */
if
(
!
frame_progress
)
{
*
Scanline
=
0
;
return
DDERR_VERTICALBLANKINPROGRESS
;
}
/* Convert frame_progress to estimated scan line. Return any line from
* block determined by time. Some lines may be never returned */
lines
=
mode
.
height
/
15
;
*
Scanline
=
(
frame_progress
-
1
)
*
lines
+
time
%
lines
;
return
DD_OK
;
}
...
...
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