[DDRAW] Fake line sweeping of the monitor

Christian Costa titan.costa at wanadoo.fr
Fri Dec 24 09:27:04 CST 2004


Hi,

This prevents native quartz to block in fullscreen.

Changelog:
Fake line sweeping of the monitor.

Christian Costa   titan.costa at wanadoo.fr

-------------- next part --------------
Index: ddraw_private.h
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/ddraw_private.h,v
retrieving revision 1.44
diff -u -r1.44 ddraw_private.h
--- ddraw_private.h	2 Aug 2004 18:24:40 -0000	1.44
+++ ddraw_private.h	24 Dec 2004 14:11:21 -0000
@@ -111,6 +111,7 @@
     DWORD width, height;
     LONG pitch;
     DDPIXELFORMAT pixelformat;
+    DWORD cur_scanline;
 
     /* Should each of these go into some structure? */
     DWORD orig_width, orig_height;
Index: ddraw/main.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/ddraw/main.c,v
retrieving revision 1.55
diff -u -r1.55 main.c
--- ddraw/main.c	19 Nov 2004 18:05:15 -0000	1.55
+++ ddraw/main.c	24 Dec 2004 14:11:24 -0000
@@ -1010,9 +1010,20 @@
 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;
 }


More information about the wine-patches mailing list