Exemple #1
0
void ObjEditApply(LPIMAGE lpImage, LPOBJECT lpObject,
				BOOL fApplyData, BOOL fApplyAlpha,
				BOOL fInitFrame)
/***********************************************************************/
{
LPALPHA lpAlpha;
LPOBJECT lpNext;
BOOL fInitingData, fInitingAlpha;

if (!fApplyData && !fApplyAlpha)
	return;

lpObject->InitUndoType = 0;
fInitingAlpha = fInitFrame && fApplyAlpha;
fInitingData = fInitFrame && fApplyData;
lpAlpha = lpObject->lpAlpha;
if (fApplyData)
	{
	if (lpObject->fBothDirty)
		fApplyAlpha = YES;
	if (lpObject == ImgGetBase(lpImage))
		{
		ImgPurgeObjects(lpImage);
		lpNext = lpObject;
		while (lpNext = ImgGetNextObjectEx(lpImage, lpNext, YES, NO, NO))
			lpNext->fUndoDeleted = NO;
		}
	if (!fInitingData)
		PixmapFreeUndo(&lpObject->Pixmap);
	else
		PixmapEditApply(&lpObject->Pixmap);
	lpObject->DataUndoType = 0;
	lpObject->DataDirty = NO;
	}
if (fApplyAlpha)
	{
	if (lpObject->lpUndoAlpha)
		{
		MaskClose(lpObject->lpUndoAlpha);
		lpObject->lpUndoAlpha = NULL;
		}
	if (lpAlpha)
		{
		if (!fInitingAlpha)
			PixmapFreeUndo(&lpAlpha->Pixmap);
		else
			PixmapEditApply(&lpAlpha->Pixmap);
		}
	lpObject->AlphaUndoType = 0;
	lpObject->AlphaDirty = NO;
	}
lpObject->fBothDirty = NO;
}
Exemple #2
0
void CImage::ObjEditApply(LPOBJECT lpObject,
				BOOL fApplyData, BOOL fApplyAlpha,
				BOOL fInitFrame)
{
LPALPHA lpAlpha;
LPOBJECT lpNext;
BOOL fInitingData, fInitingAlpha;

if (!fApplyData && !fApplyAlpha)
	return;

lpObject->InitUndoType = 0;
fInitingAlpha = fInitFrame && fApplyAlpha;
fInitingData = fInitFrame && fApplyData;
lpAlpha = lpObject->lpAlpha;
if (fApplyData)
	{
	if (lpObject->fBothDirty)
		fApplyAlpha = YES;
	if (lpObject == GetBase())
		{
		PurgeObjects();
		lpNext = lpObject;
		while (lpNext = GetNextObject(lpNext, YES, NO, NO))
			lpNext->fUndoDeleted = NO;
		}
	if (!fInitingData)
		PixmapFreeUndo(&lpObject->Pixmap);
	else
		PixmapEditApply(&lpObject->Pixmap);
   if (lpObject->lpUndoText)
      {
      delete lpObject->lpUndoText;
      lpObject->lpUndoText = NULL;
      }
	if (lpObject->UndoColorMap)
		{
		FrameDestroyColorMap(lpObject->UndoColorMap);
		lpObject->UndoColorMap = NULL;
		}
	lpObject->DataUndoType = 0;
	lpObject->DataDirty = NO;
	}
if (fApplyAlpha)
	{
	if (lpObject->lpUndoAlpha)
		{
		MaskClose(lpObject->lpUndoAlpha);
		lpObject->lpUndoAlpha = NULL;
		}
	if (lpAlpha)
		{
		if (!fInitingAlpha)
			PixmapFreeUndo(&lpAlpha->Pixmap);
		else
			PixmapEditApply(&lpAlpha->Pixmap);
		}
	lpObject->AlphaUndoType = 0;
	lpObject->AlphaDirty = NO;
	}
lpObject->fBothDirty = NO;
}