implement Hal WaitForVerticalBlank
authorMagnus Olsen <magnus@greatlord.com>
Sun, 30 Oct 2005 07:41:33 +0000 (07:41 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 30 Oct 2005 07:41:33 +0000 (07:41 +0000)
svn path=/trunk/; revision=18868

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

index 63e117d..87f33a2 100644 (file)
@@ -369,18 +369,46 @@ HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscap
        }
 
        mem.lpDD = &This->DirectDrawGlobal;     
+       mem.ddRVal = DDERR_NOTPALETTIZED;
+
        if (This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.GetAvailDriverMemory(&mem) != DDHAL_DRIVER_HANDLED)
        {
           return DDERR_NODRIVERSUPPORT;
        }
 
-
        ddscaps->dwCaps = mem.DDSCaps.dwCaps;
        ddscaps->dwCaps2 = mem.ddsCapsEx.dwCaps2;
     ddscaps->dwCaps3 = mem.ddsCapsEx.dwCaps3;
        ddscaps->dwCaps4 = mem.ddsCapsEx.dwCaps4;
        *total = mem.dwTotal;
        *free = mem.dwFree;
-
+       
        return mem.ddRVal;
 }
+
+HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h) 
+{
+
+       IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+
+       DDHAL_WAITFORVERTICALBLANKDATA WaitVectorData;
+
+       if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_CB32_WAITFORVERTICALBLANK)) 
+       {
+               return DDERR_NODRIVERSUPPORT;
+       }
+         
+       WaitVectorData.lpDD = &This->DirectDrawGlobal;
+       WaitVectorData.dwFlags = dwFlags;
+       WaitVectorData.hEvent = (DWORD)h;
+       WaitVectorData.ddRVal = DDERR_NOTPALETTIZED;
+
+       if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.WaitForVerticalBlank(&WaitVectorData) != DDHAL_DRIVER_HANDLED)
+       {
+          return DDERR_NODRIVERSUPPORT;
+       }
+
+       return WaitVectorData.ddRVal;
+
+       return DD_OK;
+}
index 85ba697..990e639 100644 (file)
@@ -407,8 +407,16 @@ HRESULT WINAPI Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface)
 HRESULT WINAPI Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
                                                                                                   HANDLE h)
 {
-  
-       DX_STUB;
+
+    DWORD ret;
+
+    if((ret = Hal_DirectDraw_WaitForVerticalBlank( iface,  dwFlags, h)) == DD_OK)
+               return ret;
+
+       if((ret = Hel_DirectDraw_WaitForVerticalBlank( iface,  dwFlags, h)) == DD_OK)
+               return ret;
+
+       return DDERR_NOTINITIALIZED;    
 }
 
 HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
@@ -416,7 +424,7 @@ HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS
 {      
        DWORD ret;
 
-     if((ret = Hal_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free)) == DD_OK)
+    if((ret = Hal_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free)) == DD_OK)
                return ret;
 
        if((ret = Hel_DirectDraw_GetAvailableVidMem (iface,ddscaps,total,free)) == DD_OK)
index 1294dc9..ba9c30c 100644 (file)
@@ -89,7 +89,11 @@ HRESULT Hal_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface);
 VOID Hal_DirectDraw_Release (LPDIRECTDRAW7 iface);
 
 HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
-                                  LPDWORD total, LPDWORD free);                                                                                           
+                                  LPDWORD total, LPDWORD free);        
+
+HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
+                                       HANDLE h); 
+
 
 
 HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface);
@@ -97,7 +101,11 @@ HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface);
 VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface);
 
 HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
-                                  LPDWORD total, LPDWORD free);                                                                                           
+                                  LPDWORD total, LPDWORD free);        
+
+HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
+                                       HANDLE h); 
+
 
 
 /*********** Macros ***********/
index a9a758f..ccaf800 100644 (file)
@@ -31,3 +31,9 @@ HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscap
 {
        DX_STUB;
 }
+
+
+HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h) 
+{
+       DX_STUB;
+}