Small unicode safe changes by me. Small msvc build error fix by jvangael@wisc.edu.
[reactos.git] / reactos / lib / ddraw / hal / surface_hal.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS
5 * FILE: lib/ddraw/hal/surface.c
6 * PURPOSE: DirectDraw HAL Implementation
7 * PROGRAMMER: Magnus Olsen, Maarten Bosma
8 *
9 */
10
11 #include "rosdraw.h"
12
13 HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rDest,
14 LPDIRECTDRAWSURFACE7 src, LPRECT rSrc, DWORD dwFlags, LPDDBLTFX lpbltfx)
15 {
16 DX_STUB;
17
18 IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
19 IDirectDrawSurfaceImpl* That = (IDirectDrawSurfaceImpl*)src;
20
21 if (!(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT))
22 {
23 return DDERR_NODRIVERSUPPORT;
24 }
25
26 DDHAL_BLTDATA BltData;
27 BltData.lpDD = &This->owner->DirectDrawGlobal;
28 BltData.dwFlags = dwFlags;
29 BltData.lpDDDestSurface = &This->Local;
30 if(rDest) BltData.rDest = *(RECTL*)rDest;
31 if(rSrc) BltData.rSrc = *(RECTL*)rSrc;
32 if(That) BltData.lpDDSrcSurface = &That->Local;
33 if(lpbltfx) BltData.bltFX = *lpbltfx;
34
35 if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.Blt(&BltData) != DDHAL_DRIVER_HANDLED)
36 {
37 return DDERR_NODRIVERSUPPORT;
38 }
39
40 return BltData.ddRVal;
41 }