Esempio n. 1
0
///
/// MyBltMaskBitMapRastPort()
static void MyBltMaskBitMapRastPort(struct BitMap *srcBitMap, LONG xSrc, LONG ySrc, struct RastPort *destRP, LONG xDest, LONG yDest, LONG xSize, LONG ySize, ULONG minterm, APTR bltMask)
{
  ENTER();

  if(GetBitMapAttr(srcBitMap, BMA_FLAGS) & BMF_INTERLEAVED)
  {
    LONG src_depth = GetBitMapAttr(srcBitMap, BMA_DEPTH);
    struct Rectangle rect;
    struct BltHook hook;

    // Define the destination rectangle in the rastport
    rect.MinX = xDest;
    rect.MinY = yDest;
    rect.MaxX = xDest + xSize - 1;
    rect.MaxY = yDest + ySize - 1;

    // Initialize the hook
    InitHook(&hook.hook, BltMaskHook, NULL);
    hook.srcBitMap = srcBitMap;
    hook.srcx = xSrc;
    hook.srcy = ySrc;
    hook.destx = xDest;
    hook.desty = yDest;

    // Initialize a bitmap where all plane pointers points to the mask
    InitBitMap(&hook.maskBitMap, src_depth, GetBitMapAttr(srcBitMap, BMA_WIDTH), GetBitMapAttr(srcBitMap, BMA_HEIGHT));
    while(src_depth)
    {
      hook.maskBitMap.Planes[--src_depth] = bltMask;
    }

    // Blit onto the Rastport */
    DoHookClipRects(&hook.hook, destRP, &rect);
  }
  else
  {
    BltMaskBitMapRastPort(srcBitMap, xSrc, ySrc, destRP, xDest, yDest, xSize, ySize, minterm, bltMask);
  }

  LEAVE();
}
Esempio n. 2
0
VOID MyBltMaskBitMapRastPort( struct BitMap *srcBitMap, LONG xSrc, LONG ySrc, struct RastPort *destRP, LONG xDest, LONG yDest, LONG xSize, LONG ySize, ULONG minterm, APTR bltMask)
{
	if (GetBitMapAttr(srcBitMap,BMA_FLAGS)&BMF_INTERLEAVED)
	{
		LONG src_depth = GetBitMapAttr(srcBitMap,BMA_DEPTH);
		struct Rectangle rect;
		struct BltMaskHook hook;

		/* Define the destination rectangle in the rastport */
		rect.MinX = xDest;
		rect.MinY = yDest;
		rect.MaxX = xDest + xSize - 1;
		rect.MaxY = yDest + ySize - 1;

		/* Initialize the hook */
#if defined(__AMIGAOS4__) || defined(__MORPHOS__) || defined(__AROS__)
		hook.hook.h_Entry = (HOOKFUNC)hookEntry;
		hook.hook.h_SubEntry = (HOOKFUNC)HookFunc_BltMask;
#else
		hook.hook.h_Entry = (HOOKFUNC)HookFunc_BltMask;
#endif
		hook.srcBitMap = srcBitMap;
		hook.srcx = xSrc;
		hook.srcy = ySrc;
		hook.destx = xDest;
		hook.desty = yDest;

		/* Initialize a bitmap where all plane pointers points to the mask */
		InitBitMap(&hook.maskBitMap,src_depth,GetBitMapAttr(srcBitMap,BMA_WIDTH),GetBitMapAttr(srcBitMap,BMA_HEIGHT));
		while (src_depth)
			hook.maskBitMap.Planes[--src_depth] = (PLANEPTR)bltMask;

		/* Blit onto the Rastport */
		DoHookClipRects(&hook.hook,destRP,&rect);
	} else
	{
		BltMaskBitMapRastPort(srcBitMap, xSrc, ySrc, destRP, xDest, yDest, xSize, ySize, minterm, (PLANEPTR)bltMask);
	}
}
Esempio n. 3
0
VOID BackFillClass::DrawBackground (struct RenderMessage &rmsg, LONG minx, LONG miny, LONG maxx, LONG maxy, LONG left, LONG top)
{
  struct RastPort *rp = rmsg.RPort;

  if(Picture && (Picture->Flags & PicFLG_Complete))
  {
    struct BackfillInfo info = { Picture, left, top, minx, miny };
    struct Rectangle rect = { minx, miny, maxx, maxy };
    MakeCppHook(BackFillHook,BackFillCode);

	BackFillHook.h_Data = &info;
    //InitHook(&BackFillHook, BackFillHook, &info);

    DoHookClipRects(&BackFillHook, rp, &rect);
  }
  else
  {
    SetAPen(rp, rmsg.Colours[Col_Background]);
    if(minx <= maxx && miny <= maxy)
      RectFill(rp, minx, miny, maxx, maxy);
  }
}