implement Hal GetScanLine
authorMagnus Olsen <magnus@greatlord.com>
Sun, 30 Oct 2005 08:41:19 +0000 (08:41 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 30 Oct 2005 08:41:19 +0000 (08:41 +0000)
svn path=/trunk/; revision=18871

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

index bf4f2a6..de875ac 100644 (file)
@@ -410,3 +410,26 @@ HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,H
 
        return WaitVectorData.ddRVal;
 }
+
+HRESULT Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
+{
+       IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+
+    DDHAL_GETSCANLINEDATA GetScan;
+
+       if (!(This->DirectDrawGlobal.lpDDCBtmp->HALDDMiscellaneous.dwFlags & DDHAL_CB32_GETSCANLINE)) 
+       {
+               return DDERR_NODRIVERSUPPORT;
+       }
+
+       GetScan.lpDD = &This->DirectDrawGlobal;
+    GetScan.ddRVal = DDERR_NOTPALETTIZED;
+
+       if (This->DirectDrawGlobal.lpDDCBtmp->HALDD.GetScanLine(&GetScan) != DDHAL_DRIVER_HANDLED)
+       {
+          return DDERR_NODRIVERSUPPORT;
+       }
+
+       *lpdwScanLine = GetScan.ddRVal;
+       return  GetScan.ddRVal;
+}
index 990e639..ce80dfa 100644 (file)
@@ -391,7 +391,15 @@ HRESULT WINAPI Main_DirectDraw_GetMonitorFrequency(LPDIRECTDRAW7 iface,LPDWORD f
 
 HRESULT WINAPI Main_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
 {
-       DX_STUB;
+       DWORD ret;
+
+       if((ret = Hal_DirectDraw_GetScanLine( iface,  lpdwScanLine)) == DD_OK)
+               return ret;
+
+       if((ret = Hel_DirectDraw_GetScanLine( iface,  lpdwScanLine)) == DD_OK)
+               return ret;
+
+       return DDERR_NOTINITIALIZED;    
 }
 
 HRESULT WINAPI Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7 iface, LPBOOL status)
@@ -407,7 +415,6 @@ HRESULT WINAPI Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7 iface)
 HRESULT WINAPI Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
                                                                                                   HANDLE h)
 {
-
     DWORD ret;
 
     if((ret = Hal_DirectDraw_WaitForVerticalBlank( iface,  dwFlags, h)) == DD_OK)
index fb758c0..1bc261a 100644 (file)
@@ -81,7 +81,7 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC
        CreateData.lplpSList = pLocal;  
        
        /* this is the call we were waiting for */
-       if(CreateData.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED)
+       if(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED)
                return DDERR_INVALIDPARAMS;
        
        if(CreateData.ddRVal != DD_OK)
index ba9c30c..50ec596 100644 (file)
@@ -94,6 +94,7 @@ HRESULT Hal_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscap
 HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
                                        HANDLE h); 
 
+HRESULT Hal_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine);
 
 
 HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface);
@@ -106,6 +107,8 @@ HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscap
 HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
                                        HANDLE h); 
 
+HRESULT Hel_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine);
+
 
 
 /*********** Macros ***********/
index ccaf800..786690b 100644 (file)
@@ -37,3 +37,8 @@ HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,H
 {
        DX_STUB;
 }
+
+HRESULT Hel_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
+{
+       DX_STUB;
+}