Just popping in
Joined: 2007/7/17 15:56 Last Login
: 2007/12/21 14:13
From poland, dabrowa gornicza
Group:
Registered Users
|
@thomas
MUI have "nothing to talk" in drawing topic. ;) MUI only calls a method MUIM_Draw, which is used for drawing procedures.
The code is simply as possible; this is the init part in MUIM_Setup:
dto = NewDTObject(data->fileName, DTA_GroupID, GID_PICTURE, PDTA_DestMode, PMODE_V43, OBP_Precision, PRECISION_EXACT, PDTA_Remap, TRUE, TAG_DONE); if(dto) { struct image *gi = NULL; struct BitMapHeader *bmh; SetAttrs(dto, PDTA_Screen, (ULONG)scr, PDTA_UseFriendBitMap , TRUE, TAG_DONE); if (gi = (struct image *)MAllocVecPooled(sizeof(struct image))) { GetDTAttrs(dto, PDTA_BitMapHeader, (ULONG)&bmh, TAG_DONE); gi->picObject = dto; gi->imageFlags |= DFLG_Datatypes; data->width = bmh->bmh_Width; data->height = bmh->bmh_Height;
and draw procedure called in MUIM_Draw:
void drawDTPic(Object *dto, struct RastPort *rp, ULONG x, ULONG y, ULONG width, ULONG height) { struct BitMapHeader *bmh = NULL; struct BitMap *bm = NULL; BOOL success = FALSE;
if (DoMethod(dto, DTM_PROCLAYOUT, NULL, 1)) { GetDTAttrs(dto, PDTA_BitMapHeader, (ULONG)&bmh, TAG_DONE); if (bmh) { GetDTAttrs(dto, PDTA_DestBitMap, (ULONG)&bm, TAG_DONE); } }
if (DataTypesBase->lib_Version >= 44) { APTR handle = ObtainDTDrawInfoA(dto, TAG_DONE); if (handle) { success = DrawDTObjectA(rp, dto, x, y, width, height, 0, 0, TAG_DONE); ReleaseDTDrawInfo(dto, handle); } }
if (!success) { APTR mask = NULL; GetDTAttrs(dto, PDTA_MaskPlane, (ULONG)&mask, TAG_DONE); if (mask) { BltMaskBitMapRastPort(bm, 0, 0, rp, x, y, width, height, ABC|ABNC|ANBC, mask); } else { BltBitMapRastPort(bm, 0, 0, rp, x, y, width, height, ABC|ABNC|ANBC); } } }
|