DXGL r393 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r392
|
r393
|
r394
>
Date:
19:00, 1 July 2013
Author:
admin
Status:
new
Tags:
Comment:
Fix GetScanLine timing.
Modified paths:
/ddraw/glDirectDraw.cpp
(modified) (
history
)
/ddraw/timer.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDraw.cpp
—
—
@@ -1101,7 +1101,7 @@
1102
1102
if(!primary) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
1103
1103
if(!initialized) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
1104
1104
*lpdwScanLine = renderer->GetScanLine();
1105
- if(*lpdwScanLine > primary->fakey) TRACE_RET(HRESULT,23,DDERR_VERTICALBLANKINPROGRESS);
1105
+ if(*lpdwScanLine >= primary->fakey) TRACE_RET(HRESULT,23,DDERR_VERTICALBLANKINPROGRESS);
1106
1106
TRACE_EXIT(23,DD_OK);
1107
1107
return DD_OK;
1108
1108
}
—
—
@@ -1113,7 +1113,7 @@
1114
1114
if(!renderer) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
1115
1115
if(!primary) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
1116
1116
if(!initialized) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
1117
- if(renderer->GetScanLine() > primary->fakey) *lpbIsInVB = TRUE;
1117
+ if(renderer->GetScanLine() >= primary->fakey) *lpbIsInVB = TRUE;
1118
1118
else *lpbIsInVB = FALSE;
1119
1119
TRACE_EXIT(23,DD_OK);
1120
1120
return DD_OK;
Index: ddraw/timer.cpp
—
—
@@ -64,8 +64,11 @@
65
65
if (timertype == 1) QueryPerformanceCounter(&timerpos);
66
66
else timerpos.QuadPart = timeGetTime();
67
67
timerpos.QuadPart -= timer_base.QuadPart;
68
- sync_pos = fmod((double) timerpos.QuadPart, monitor_period);
68
+ double milliseconds;
69
+ if (timertype == 1) milliseconds = ((double) timerpos.QuadPart / (double)timer_frequency) * 1000.0;
70
+ else milliseconds = (double) timerpos.QuadPart;
71
+ sync_pos = fmod(milliseconds, monitor_period);
69
72
sync_pos /= monitor_period;
70
- sync_pos *= 1000.0;
73
+ sync_pos *= (double)lines;
71
74
return sync_pos;
72
75
}
\ No newline at end of file
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