prevent buffer overflow, LoadString accepts the size of the buffer in TCHARs, not...
[reactos.git] / reactos / drivers / video / displays / vga / objects / copybits.c
1 #include "../vgaddi.h"
2 #include "../vgavideo/vgavideo.h"
3
4 #define DBG
5 #include <debug.h>
6
7 BOOL STDCALL
8 DrvCopyBits(OUT SURFOBJ* DestObj,
9 IN SURFOBJ* SourceObj,
10 IN CLIPOBJ* ClipObj,
11 IN XLATEOBJ* XLateObj,
12 IN RECTL* DestRectL,
13 IN POINTL* SrcPointL)
14 {
15 BOOL Done = FALSE;
16
17 if (STYPE_BITMAP == DestObj->iType && BMF_4BPP == DestObj->iBitmapFormat &&
18 STYPE_DEVICE == SourceObj->iType)
19 {
20 /* Screen to 4 BPP DIB */
21 DIB_BltFromVGA(SrcPointL->x, SrcPointL->y,
22 DestRectL->right - DestRectL->left,
23 DestRectL->bottom - DestRectL->top,
24 DestObj->pvScan0, DestObj->lDelta);
25 Done = TRUE;
26 }
27 else if (STYPE_DEVICE == DestObj->iType &&
28 STYPE_BITMAP == SourceObj->iType && BMF_4BPP == SourceObj->iBitmapFormat)
29 {
30 /* 4 BPP DIB to Screen */
31 DIB_BltToVGA(DestRectL->left, DestRectL->top,
32 DestRectL->right - DestRectL->left,
33 DestRectL->bottom - DestRectL->top,
34 SourceObj->pvScan0, SourceObj->lDelta,
35 0);
36 Done = TRUE;
37 }
38
39 return Done;
40 }