rem: RECT clip_r, temp_r, old_r;
add: RECT clip_r, temp_r, flash_rect1, old_r;
context: SetFlashRect (PRECT pRect, FRAME f){	RECT clip_r, temp_r, old_r;	CONTEXT OldContext;	FRAME old_f;	int create_flash = 0;	if (! flash_mutex)		flash_mutex = CreateMutex ();	old_r = flash_rect;	old_f = flash_frame;			if (pRect != (PRECT)~0L)	{		GetContextClipRect (&clip_r);		OldContext = SetContext (ScreenContext);	}	else	{		//Don't flash when using the PC menu 		if (optWhichMenu == OPT_PC) 		{ 			OldContext = SetContext (ScreenContext); 			pRect = 0; 		} 		else 		{ 			OldContext = SetContext (StatusContext); 			GetContextClipRect (&clip_r); 			pRect = &temp_r; 			temp_r.corner.x = RADAR_X - clip_r.corner.x; 			temp_r.corner.y = RADAR_Y - clip_r.corner.y; 			temp_r.extent.width = RADAR_WIDTH; 			temp_r.extent.height = RADAR_HEIGHT; 			SetContext (ScreenContext);		}	}	if (pRect == 0 || pRect->extent.width == 0)	{		flash_rect.extent.width = 0;		if (flash_task)		{			ClearSemaphore (GraphicsSem);			ConcludeTask (flash_task);			SetSemaphore (GraphicsSem);		}	}	else	{		flash_rect = *pRect;		flash_rect.corner.x += clip_r.corner.x;		flash_rect.corner.y += clip_r.corner.y;		flash_rect.extent.height += flash_rect.corner.y & 1;		flash_rect.corner.y &= ~1;		create_flash = 1;	}		flash_frame = f;	if (old_r.extent.width			&& (old_r.extent.width != flash_rect.extent.width			|| old_r.extent.height != flash_rect.extent.height			|| old_r.corner.x != flash_rect.corner.x			|| old_r.corner.y != flash_rect.corner.y			|| old_f != flash_frame))	{		if (flash_screen_frame)		{			STAMP old_s;			old_s.origin.x = old_r.corner.x;			old_s.origin.y = old_r.corner.y;			old_s.frame = flash_screen_frame;			DrawStamp (&old_s);			DestroyDrawable (ReleaseDrawable (flash_screen_frame));			flash_screen_frame = 0;		}		else			fprintf (stderr, "couldn't locate flash_screen_rect\n");	}		if (flash_rect.extent.width)	{		if (flash_screen_frame)			DestroyDrawable (ReleaseDrawable (flash_screen_frame));		flash_screen_frame = CaptureDrawable (LoadDisplayPixmap (&flash_rect, (FRAME)0));	}	LockMutex (flash_mutex);	flash_changed = 1;	UnlockMutex (flash_mutex);	// we create the thread after the LoadIntoExtraScreen	// so there is no race between the FlushGraphics in flash_task	// and the Enqueue in LoadIntoExtraScreen	if (create_flash && flash_task == 0)	{		flash_task = AssignTask (flash_rect_func, 2048,				"flash rectangle");	}	SetContext (OldContext);}