Small fix.
[wine/multimedia.git] / graphics / win16drv / brush.c
blob61a4fe3263c94523b021b433ff367814bdd6ec8a
1 /*
2 * GDI brush objects - win16drv
4 * Copyright 1997 John Harvey
5 */
7 #include <stdlib.h>
8 #include "brush.h"
9 #include "win16drv.h"
10 #include "heap.h"
11 #include "debugtools.h"
13 DEFAULT_DEBUG_CHANNEL(win16drv)
15 HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush,
16 BRUSHOBJ * brush )
18 WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
19 HBRUSH16 prevHandle = dc->w.hBrush;
20 int nSize;
21 LOGBRUSH16 lBrush16;
22 dc->w.hBrush = hbrush;
23 lBrush16.lbStyle = brush->logbrush.lbStyle;
24 lBrush16.lbColor = brush->logbrush.lbColor;
25 lBrush16.lbHatch = brush->logbrush.lbHatch;
28 if ( physDev->BrushInfo )
30 TRACE("UnRealizing BrushInfo\n");
31 nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
32 physDev->BrushInfo,
33 physDev->BrushInfo, 0);
35 else
37 nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH,
38 &lBrush16, 0, 0);
39 physDev->BrushInfo = SEGPTR_ALLOC( nSize );
43 nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_BRUSH,
44 &lBrush16,
45 physDev->BrushInfo,
46 win16drv_SegPtr_TextXForm);
48 return prevHandle;