From 60f6c41a6700133cb6b91019cc118319063af8ad Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 13 Sep 2011 20:02:23 +0200 Subject: [PATCH] ddraw: Just use a static variable for scanline emulation. Tracking it per ddraw object doesn't add much. --- dlls/ddraw/ddraw.c | 11 ++++++----- dlls/ddraw/ddraw_private.h | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index faa41257c61..4cf7c16282f 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -1880,29 +1880,30 @@ static HRESULT WINAPI ddraw1_WaitForVerticalBlank(IDirectDraw *iface, DWORD flag static HRESULT WINAPI ddraw7_GetScanLine(IDirectDraw7 *iface, DWORD *Scanline) { IDirectDrawImpl *This = impl_from_IDirectDraw7(iface); + static DWORD cur_scanline; static BOOL hide = FALSE; WINED3DDISPLAYMODE Mode; TRACE("iface %p, line %p.\n", iface, Scanline); /* This function is called often, so print the fixme only once */ - EnterCriticalSection(&ddraw_cs); if(!hide) { FIXME("iface %p, line %p partial stub!\n", iface, Scanline); hide = TRUE; } + EnterCriticalSection(&ddraw_cs); wined3d_device_get_display_mode(This->wined3d_device, 0, &Mode); + LeaveCriticalSection(&ddraw_cs); /* Fake the line sweeping of the monitor */ /* FIXME: We should synchronize with a source to keep the refresh rate */ - *Scanline = This->cur_scanline++; + *Scanline = cur_scanline++; /* Assume 20 scan lines in the vertical blank */ - if (This->cur_scanline >= Mode.Height + 20) - This->cur_scanline = 0; + if (cur_scanline >= Mode.Height + 20) + cur_scanline = 0; - LeaveCriticalSection(&ddraw_cs); return DD_OK; } diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 09e9aed2689..0731eb0c580 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -89,7 +89,6 @@ struct IDirectDrawImpl BOOL d3d_initialized; /* Misc ddraw fields */ - DWORD cur_scanline; BOOL fake_vblank; BOOL initialized;