Henri Verbeet : ddraw: Just use a static variable for scanline emulation.

Alexandre Julliard julliard at winehq.org
Wed Sep 14 12:25:38 CDT 2011


Module: wine
Branch: master
Commit: 60f6c41a6700133cb6b91019cc118319063af8ad
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=60f6c41a6700133cb6b91019cc118319063af8ad

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Sep 13 20:02:23 2011 +0200

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 faa4125..4cf7c16 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 09e9aed..0731eb0 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;
 




More information about the wine-cvs mailing list