From 171c9420c2918f0c5cb22156443fac4ac24f3972 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Mon, 27 Dec 2004 17:12:55 +0000 Subject: [PATCH] Fake line sweeping of the monitor. --- dlls/ddraw/ddraw/main.c | 15 +++++++++++++-- dlls/ddraw/ddraw_private.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/ddraw/main.c b/dlls/ddraw/ddraw/main.c index dfbc7d225a..80c2fc6ab5 100644 --- a/dlls/ddraw/ddraw/main.c +++ b/dlls/ddraw/ddraw/main.c @@ -1010,9 +1010,20 @@ HRESULT WINAPI Main_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine) { IDirectDrawImpl *This = (IDirectDrawImpl *)iface; - FIXME("(%p)->(%p)\n", This, lpdwScanLine); + static BOOL hide; - *lpdwScanLine = 1; + /* Since this method is called often, show the fixme only once */ + if (!hide) { + FIXME("(%p)->(%p) semi-stub\n", This, lpdwScanLine); + hide = TRUE; + } + + /* Fake the line sweeping of the monitor */ + /* FIXME: We should synchronize with a source to keep the refresh rate */ + *lpdwScanLine = This->cur_scanline++; + /* Assume 20 scan lines in the vertical blank */ + if (This->cur_scanline >= This->height + 20) + This->cur_scanline = 0; return DD_OK; } diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index b583dae4d8..7dad176eb8 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -111,6 +111,7 @@ struct IDirectDrawImpl DWORD width, height; LONG pitch; DDPIXELFORMAT pixelformat; + DWORD cur_scanline; /* Should each of these go into some structure? */ DWORD orig_width, orig_height;