implment Hal FlipToGDISurface
authorMagnus Olsen <magnus@greatlord.com>
Sun, 30 Oct 2005 09:21:03 +0000 (09:21 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 30 Oct 2005 09:21:03 +0000 (09:21 +0000)
svn path=/trunk/; revision=18873

reactos/lib/ddraw/hal/ddraw.c
reactos/lib/ddraw/main/ddraw.c
reactos/lib/ddraw/rosdraw.h
reactos/lib/ddraw/soft/ddraw.c

index de875ac..a8e6c0e 100644 (file)
@@ -393,7 +393,7 @@ HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,H
 
        DDHAL_WAITFORVERTICALBLANKDATA WaitVectorData;
 
-       if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)) 
+       if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)) 
        {
                return DDERR_NODRIVERSUPPORT;
        }
@@ -417,7 +417,7 @@ HRESULT Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
 
     DDHAL_GETSCANLINEDATA GetScan;
 
-       if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_CB32_GETSCANLINE)) 
+       if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_GETSCANLINE)) 
        {
                return DDERR_NODRIVERSUPPORT;
        }
@@ -433,3 +433,26 @@ HRESULT Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
        *lpdwScanLine = GetScan.ddRVal;
        return  GetScan.ddRVal;
 }
+
+HRESULT Hal_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface) 
+{
+       IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+
+       DDHAL_FLIPTOGDISURFACEDATA FlipGdi;
+
+       if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_FLIPTOGDISURFACE)) 
+       {
+               return DDERR_NODRIVERSUPPORT;
+       }
+
+       FlipGdi.lpDD = &This->DirectDrawGlobal;
+    FlipGdi.ddRVal = DDERR_NOTPALETTIZED;
+
+       if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.FlipToGDISurface(&FlipGdi) != DDHAL_DRIVER_HANDLED)
+       {
+          return DDERR_NODRIVERSUPPORT;
+       }
+       
+       /* FIXME where should FlipGdi.dwToGDI be fill in */
+    return  FlipGdi.ddRVal;
+}
index ce80dfa..4c5765f 100644 (file)
@@ -287,7 +287,15 @@ HRESULT WINAPI Main_DirectDraw_EnumSurfaces(LPDIRECTDRAW7 iface, DWORD dwFlags,
 
 HRESULT WINAPI Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface) 
 {
-       DX_STUB;
+       DWORD ret;
+
+       if((ret = Hal_DirectDraw_FlipToGDISurface( iface)) == DD_OK)
+               return ret;
+
+       if((ret = Hel_DirectDraw_FlipToGDISurface( iface)) == DD_OK)
+               return ret;
+
+       return DDERR_NOTINITIALIZED;  
 }
 
 HRESULT WINAPI Main_DirectDraw_GetCaps(LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps,
index 50ec596..e6eccbe 100644 (file)
@@ -95,6 +95,9 @@ HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
                                        HANDLE h); 
 
 HRESULT Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine);
+HRESULT Hal_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface); 
+
+
 
 
 HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface);
@@ -108,7 +111,7 @@ HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
                                        HANDLE h); 
 
 HRESULT Hel_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine);
-
+HRESULT Hel_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface);
 
 
 /*********** Macros ***********/
index 786690b..3172425 100644 (file)
@@ -42,3 +42,9 @@ HRESULT Hel_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
 {
        DX_STUB;
 }
+
+HRESULT Hel_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface) 
+{
+       DX_STUB;
+}
+