rem: DWORD TimeIn;
add: DWORD TimeIn, WaitTime;
context: int flash_rect_func(void *data){#define NORMAL_STRENGTH 4#define NORMAL_F_STRENGTH 0	DWORD TimeIn;	SIZE strength, fstrength, incr;	Task task = (Task)data;	fstrength = NORMAL_F_STRENGTH;	incr = 1;	strength = NORMAL_STRENGTH;	TimeIn = GetTimeCounter ();	while (!Task_ReadState(task, TASK_EXIT))	{		CONTEXT OldContext;		SetSemaphore (GraphicsSem);		OldContext = SetContext (ScreenContext);				if (flash_rect.extent.width)		{			BatchGraphics ();			SetContextClipRect (&flash_rect);			if (flash_frame)			{#define MIN_F_STRENGTH -3#define MAX_F_STRENGTH 3				if ((fstrength += incr) > MAX_F_STRENGTH)				{					fstrength = MAX_F_STRENGTH - 1;					incr = -1;				}				else if (fstrength < MIN_F_STRENGTH)				{					fstrength = MIN_F_STRENGTH + 1;					incr = 1;				}								if (fstrength != NORMAL_F_STRENGTH)				{					STAMP s;					ClearDrawable ();					SetGraphicStrength (fstrength > 0 ? fstrength : -fstrength, 16);										s.origin.x = s.origin.y = 0;					s.frame = flash_frame;					DrawStamp (&s);					if (fstrength < 0)						SetGraphicStrength (-8, 8); // add to -(partial mask)					else						SetGraphicStrength (8, -8); // add to (partial mask)				}				DrawFromExtraScreen (&flash_rect);			}			else			{#define MIN_STRENGTH 4#define MAX_STRENGTH 6				if ((strength += 2) > MAX_STRENGTH)					strength = MIN_STRENGTH;									SetGraphicStrength (strength, 4);				DrawFromExtraScreen (&flash_rect);			}						SetContextClipRect (NULL_PTR); // this will flush whatever						SetGraphicStrength (4, 4);							UnbatchGraphics ();		}		SetContext (OldContext);		ClearSemaphore (GraphicsSem);		SleepThreadUntil (TimeIn + (ONE_SECOND / 16));		TimeIn = GetTimeCounter ();	}	flash_task = 0;	FinishTask (task);	return(0);}