PDTA_DestBitMap (struct BitMap *) -- Pointer to the remapped
bitmap.
PDTA_GRegs (ULONG *) -- Color table; this table is initialized
during the layout process and will contain the colours the
picture will use after remapping. If no remapping takes
place, these colours will match those in the PDTA_CRegs table.
PDTA_BitMap (struct BitMap *) -- Pointer to a class-allocated
bitmap, that will end up being freed by the picture class in the
OM_DISPOSE method.
PDTA_CRegs (ULONG *) -- Color table to use with SetRGB32CM().
Applicability is (G).
@asman, post #2
@asman, post #4
PDTA_NumColors (UWORD) -- Number of colors used by the picture.
@pch, post #8
static struct BitMap* bmap = NULL; struct TagItem tags[] = { {PDTA_ColorRegisters, (ULONG)&cregs}, {PDTA_NumColors, (ULONG)&num}, {TAG_END, TAG_END} }; { struct Screen* screen = LockPubScreen(NULL); Object* o = NewDTObject("tiles.iff", DTA_GroupID, GID_PICTURE, PDTA_Remap, TRUE, PDTA_Screen, (ULONG)screen, TAG_END); if (NULL != o) { DoDTMethod(o, NULL, NULL, DTM_PROCLAYOUT,NULL,TRUE); result = GfxGetBitmapTiles(o); if (0 == result) { GetDTAttrsA(o, tags); ULONG screen = ScreenGetAddress(); struct Screen* scr = (struct Screen*)screen; for (int i = 0; i < num; ++i) { SetRGB4(&scr->ViewPort, i, cregs[i].red, cregs[i].green, cregs[i].blue); } } DisposeDTObject(o); } UnlockPubScreen(NULL, screen); } /*--------------------------------------------------------------------------*/ static int GfxGetBitmapTiles(Object* o) { struct BitMap* bm; GetDTAttrs(o, PDTA_DestBitMap, &bm, TAG_END); const ULONG width = GetBitMapAttr(bm, BMA_WIDTH); const ULONG height = GetBitMapAttr(bm, BMA_HEIGHT); const ULONG depth = GetBitMapAttr(bm, BMA_DEPTH); const ULONG flags = BMF_DISPLAYABLE|BMF_CLEAR; bmap = AllocBitMap(width, height, depth, flags, NULL); if (NULL != bmap) { BltBitMap(bm, 0, 0, bmap, 0, 0, width, height, 0xC0, 0xFF, NULL); return 0; } return -1; }
@asman, post #9
@pch, post #10
@asman, post #17
GetRGB32(wbScreen->ViewPort.ColorMap, 0, 32, &wbColors[0]);
@asman, post #18
/* clear UserPort so Intuition will not free it */ win->UserPort = NULL;
@pch, post #19
A tak na marginesie co dokladnie zeruje ten zapis w C:
/* clear UserPort so Intuition will not free it */
win->UserPort = NULL;
bo w blitzu nie moge napisac *win\UserPort=0, musze wyzerowac poszczegolne pola tej struktury ale czy w tym wypadku wszystkie czy tylko \mp_SigBit ?
@Hexmage960, post #20
@asman, post #17
@pch, post #24