rem: SetSemaphore (&GraphicsSem);
add: SetSemaphore (GraphicsSem);
context: DrawBluePrint (PMENU_STATE pMS){	COUNT num_frames;	STAMP s;	SetSemaphore (&GraphicsSem);	SetContext (SpaceContext);	pMS->ModuleFrame = CaptureDrawable (			LoadGraphic (SISBLU_MASK_ANIM)			);	BatchGraphics ();	s.origin.x = s.origin.y = 0;	s.frame = DecFrameIndex (pMS->ModuleFrame);	SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x16), 0x01));	DrawFilledStamp (&s);	for (num_frames = 0; num_frames < NUM_DRIVE_SLOTS; ++num_frames)	{		DrawShipPiece (pMS, GLOBAL_SIS (DriveSlots[num_frames]),				num_frames, TRUE);	}	for (num_frames = 0; num_frames < NUM_JET_SLOTS; ++num_frames)	{		DrawShipPiece (pMS, GLOBAL_SIS (JetSlots[num_frames]),				num_frames, TRUE);	}	for (num_frames = 0; num_frames < NUM_MODULE_SLOTS; ++num_frames)	{		BYTE which_piece;		which_piece = GLOBAL_SIS (ModuleSlots[num_frames]);		if (!(pMS->CurState == SHIPYARD && which_piece == CREW_POD))			DrawShipPiece (pMS, which_piece, num_frames, TRUE);	}	SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0x1F), 0x09));	for (num_frames = 0; num_frames < NUM_MODULE_SLOTS; ++num_frames)	{		BYTE which_piece;		which_piece = GLOBAL_SIS (ModuleSlots[num_frames]);		if (pMS->CurState == SHIPYARD && which_piece == CREW_POD)			DrawShipPiece (pMS, which_piece, num_frames, TRUE);	}	{		num_frames = GLOBAL_SIS (CrewEnlisted);		GLOBAL_SIS (CrewEnlisted) = 0;		while (num_frames--)		{			POINT pt;			GetCPodCapacity (&pt);			DrawPoint (&pt);			++GLOBAL_SIS (CrewEnlisted);		}	}	{		RECT r;		num_frames = GLOBAL_SIS (TotalElementMass);		GLOBAL_SIS (TotalElementMass) = 0;		r.extent.width = 9;		r.extent.height = 1;		while (num_frames)		{			COUNT m;			m = num_frames < SBAY_MASS_PER_ROW ?					num_frames : SBAY_MASS_PER_ROW;			GLOBAL_SIS (TotalElementMass) += m;			GetSBayCapacity (&r.corner);			DrawFilledRectangle (&r);			num_frames -= m;		}	}	if (GLOBAL_SIS (FuelOnBoard) > FUEL_RESERVE)	{		DWORD FuelVolume;		RECT r;		FuelVolume = GLOBAL_SIS (FuelOnBoard) - FUEL_RESERVE;		GLOBAL_SIS (FuelOnBoard) = FUEL_RESERVE;		r.extent.width = 3;		r.extent.height = 1;		while (FuelVolume)		{			COUNT m;			GetFTankCapacity (&r.corner);			DrawPoint (&r.corner);			r.corner.x += r.extent.width + 1;			DrawPoint (&r.corner);			r.corner.x -= r.extent.width;			SetContextForeGroundColor (SetContextBackGroundColor (BLACK_COLOR));			DrawFilledRectangle (&r);			m = FuelVolume < FUEL_VOLUME_PER_ROW ?					(COUNT)FuelVolume : FUEL_VOLUME_PER_ROW;			GLOBAL_SIS (FuelOnBoard) += m;			FuelVolume -= m;		}	}	UnbatchGraphics ();	DestroyDrawable (ReleaseDrawable (pMS->ModuleFrame));	pMS->ModuleFrame = 0;	ClearSemaphore (&GraphicsSem);}