Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 290 of file surface_main.c.
Referenced by Thunk_DDrawSurface3_Blt().
{ DDHAL_BLTDATA mDdBlt; DX_WINDBG_trace(); if (ThisDest == NULL) { return DDERR_INVALIDPARAMS; } /* Zero out members in DDHAL_BLTDATA */ ZeroMemory(&mDdBlt, sizeof(DDHAL_BLTDATA)); ZeroMemory(&mDdBlt.bltFX, sizeof(DDBLTFX)); /* Check if we got HAL support for this api */ if (( ThisDest->lpLcl->lpGbl->lpDD->lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT) == DDHAL_SURFCB32_BLT) { mDdBlt.Blt = ThisDest->lpLcl->lpSurfMore->lpDD_lcl->lpGbl->lpDDCBtmp->HALDDSurface.Blt; } /* Check if we got HEL support for this api */ else if (( ThisDest->lpLcl->lpGbl->lpDD->lpDDCBtmp->HELDDSurface.dwFlags & DDHAL_SURFCB32_BLT) == DDHAL_SURFCB32_BLT) { mDdBlt.Blt = ThisDest->lpLcl->lpSurfMore->lpDD_lcl->lpGbl->lpDDCBtmp->HELDDSurface.Blt; } if (mDdBlt.Blt == NULL) { /* This API is unsupported */ return DDERR_UNSUPPORTED; } /* Prepare for draw, if we do not reset the DdResetVisrgn some graphics card will not draw on the screen */ if (!DdResetVisrgn( ThisDest->lpLcl->lpSurfMore->slist[0], NULL)) { DX_STUB_str("DdResetVisrgn failed"); } mDdBlt.lpDD = ThisDest->lpLcl->lpSurfMore->lpDD_lcl->lpGbl; mDdBlt.lpDDDestSurface = ThisDest->lpLcl->lpSurfMore->slist[0]; ThisDest->lpLcl->lpSurfMore->slist[0]->hDC = ThisDest->lpLcl->lpSurfMore->lpDD_lcl->hDC; /* Setup Src */ if (( ThisSrc != NULL ) ) { mDdBlt.lpDDSrcSurface = ThisSrc->lpLcl->lpSurfMore->slist[0]; ThisSrc->lpLcl->lpSurfMore->slist[0]->hDC = ThisSrc->lpLcl->lpSurfMore->lpDD_lcl->hDC; if (rsrc != NULL) { memmove(&mDdBlt.rSrc, rsrc, sizeof (RECTL)); } else { if(!GetWindowRect((HWND)ThisSrc->lpLcl->lpSurfMore->lpDD_lcl->hWnd, (RECT *)&mDdBlt.rSrc)) { DX_STUB_str("GetWindowRect failed"); } } /* FIXME * compare so we do not write too far * ThisDest->lpLcl->lpGbl->wWidth; <- surface max width * ThisDest->lpLcl->lpGbl->wHeight <- surface max heght * ThisDest->lpLcl->lpGbl->lPitch <- surface bpp */ } /* Setup dest */ if (rdst != NULL) { memmove(&mDdBlt.rDest, rdst, sizeof (RECTL)); } else { if (!GetWindowRect((HWND)ThisDest->lpLcl->lpSurfMore->lpDD_lcl->hWnd, (RECT *)&mDdBlt.rDest)) { DX_STUB_str("GetWindowRect failed"); } } /* FIXME * compare so we do not write too far * ThisDest->lpLcl->lpGbl->wWidth; <- surface max width * ThisDest->lpLcl->lpGbl->wHeight <- surface max heght * ThisDest->lpLcl->lpGbl->lPitch <- surface bpp */ /* setup bltFX */ if (lpbltfx != NULL) { memmove(&mDdBlt.bltFX, lpbltfx, sizeof (DDBLTFX)); } /* setup value that are not config yet */ mDdBlt.dwFlags = dwFlags; mDdBlt.IsClipped = FALSE; mDdBlt.bltFX.dwSize = sizeof(DDBLTFX); /* FIXME BltData.dwRectCnt BltData.dwROPFlags BltData.IsClipped BltData.prDestRects BltData.rOrigDest BltData.rOrigSrc BltData.ddRVal */ if (mDdBlt.Blt(&mDdBlt) != DDHAL_DRIVER_HANDLED) { DX_STUB_str("mDdBlt DDHAL_DRIVER_HANDLED"); return DDERR_NOBLTHW; } return mDdBlt.ddRVal; }