rem: FILE *load_fp;  GetDirEntryContents (SetAbsDirEntryTableIndex (
add: pMS->TeamDE = SetAbsDirEntryTableIndex (
context: DrawFileStrings (PMELEE_STATE pMS, int HiLiteState){#define ENTRY_HEIGHT 32	COORD y;	COUNT top, bot;	TEXT Text, rtText;	CONTEXT OldContext;	UNICODE buf[60];	Text.baseline.x = 5;	y = 34;	Text.align = ALIGN_LEFT;	rtText.pStr = buf;	rtText.align = ALIGN_RIGHT;	rtText.baseline.x = Text.baseline.x + NUM_MELEE_COLUMNS			* (MELEE_BOX_WIDTH + MELEE_BOX_SPACE) - 1;					top = pMS->TopTeamIndex;	if (HiLiteState == 1)	{		COUNT new_;		new_ = pMS->CurIndex;		bot = pMS->BotTeamIndex;		if (new_ < top || new_ > bot)		{			if (new_ < top)				top = new_;			else				top += new_ - bot;			pMS->TopTeamIndex = top;			HiLiteState = -1;		}	}	OldContext = SetContext (SpaceContext);	SetContextFont (MicroFont);	BatchGraphics ();	if (HiLiteState != -1)	{		bot = pMS->CurIndex - top;		Text.baseline.y = y + bot * ENTRY_HEIGHT;		Text.pStr = pMS->FileList[bot].TeamName;		Text.CharCount = (COUNT)~0;		SetContextForeGroundColor (				HiLiteState == 0				? BUILD_COLOR (MAKE_RGB15 (15, 16, 27), 0x00)				: BUILD_COLOR (MAKE_RGB15 (23, 24, 29), 0x00)				);		DrawText (&Text);		rtText.baseline.y = Text.baseline.y;		wsprintf (buf, "%d", GetTeamValue (&pMS->FileList[bot]));		rtText.CharCount = (COUNT)~0;		DrawText (&rtText);	}	else	{		COUNT teams_left;		DrawMeleeIcon (28);		Text.baseline.y = y;		teams_left = (COUNT)(				GetDirEntryTableCount (pMS->TeamDE) + NUM_PREBUILT - top				);		if (teams_left)		{			bot = top - 1;			do			{				COUNT row, col;				STAMP s;				if (++bot < NUM_PREBUILT)					pMS->FileList[bot - top] = pMS->PreBuiltList[bot];				else				{					FILE *load_fp;					GetDirEntryContents (SetAbsDirEntryTableIndex (							pMS->TeamDE, bot - NUM_PREBUILT							), (STRINGPTR)buf, FALSE);					load_fp = OpenResFile (buf, "rb");					if (load_fp)					{						if (LengthResFile (load_fp) != sizeof (pMS->FileList[bot - top])								|| ReadTeamImage (&pMS->FileList[bot - top], load_fp) == -1)							pMS->FileList[bot - top] = pMS->PreBuiltList[0];						CloseResFile (load_fp);					}				}				{					Text.pStr = pMS->FileList[bot - top].TeamName;					Text.CharCount = (COUNT)~0;					SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (15, 16, 27), 0x00));					DrawText (&Text);					rtText.baseline.y = Text.baseline.y;					wsprintf (buf, "%d", GetTeamValue (&pMS->FileList[bot - top]));					rtText.CharCount = (COUNT)~0;					DrawText (&rtText);				}				s.origin.x = Text.baseline.x + 1;				s.origin.y = Text.baseline.y + 4;				for (row = 0; row < NUM_MELEE_ROWS; ++row)				{					for (col = 0; col < NUM_MELEE_COLUMNS; ++col)					{						BYTE StarShip;												if ((StarShip = pMS->FileList[bot - top].ShipList[row][col])								!= (BYTE)~0)						{							HSTARSHIP hStarShip;							STARSHIPPTR StarShipPtr;							hStarShip = GetStarShipFromIndex (&master_q, StarShip);							StarShipPtr = LockStarShip (&master_q, hStarShip);							s.frame = StarShipPtr->RaceDescPtr->ship_info.icons;							DrawStamp (&s);							s.origin.x += 18;							UnlockStarShip (&master_q, hStarShip);						}					}				}				Text.baseline.y += ENTRY_HEIGHT;			} while (--teams_left && bot - top < MAX_VIS_TEAMS - 1);			pMS->BotTeamIndex = bot;		}	}	UnbatchGraphics ();	SetContext (OldContext);}