Ejemplo n.º 1
0
static void DisplayText(int x, int y, const char *text, int hilite)
{
	if (hilite)
		TextStringWithTableAt(x, y, text, tableFlamed);
	else
		TextStringAt(x, y, text);
}
Ejemplo n.º 2
0
static void DisplayAt(int x, int y, const char *s, int hilite)
{
	if (hilite)
		TextStringWithTableAt(x, y, s, &tableFlamed);
	else
		TextStringAt(x, y, s);
}
Ejemplo n.º 3
0
void DisplayMenuItem(int x, int y, const char *s, int selected)
{
	if (selected)
		TextStringWithTableAt(x, y, s, tableFlamed);
	else
		TextStringAt(x, y, s);
		
	return;
}
Ejemplo n.º 4
0
static void ShowCredits(void)
{
	static int creditIndex = 0;
	static int lastTick = 0;
	int t;

	TextStringWithTableAt(16, SCREEN_HEIGHT - 50, "Credits:", &tableDarker);
	TextStringWithTableAt(20, SCREEN_HEIGHT - 40, credits[creditIndex].name, &tablePurple);
	TextStringWithTableAt(20, SCREEN_HEIGHT - 40 + TextHeight(), credits[creditIndex].message, &tableDarker);

	t = clock() / CLOCKS_PER_SEC;

	if (t > lastTick + CREDIT_PERIOD) {
		creditIndex++;
		if (creditIndex >= sizeof(credits) / sizeof(credits[0]))
			creditIndex = 0;
		lastTick = t;
	}
}
Ejemplo n.º 5
0
static void DisplaySummary()
{
	int i, y, x, x2;
	char sScore[20];
	unsigned char *scr = GetDstScreen();
	unsigned char color;

	y = SCREEN_HEIGHT - 5 - TextHeight(); // 10 pixels from bottom

	for (i = 0; i < gMission.missionData->objectiveCount; i++) {
		if (gMission.objectives[i].required > 0 ||
		    gMission.objectives[i].done > 0) {
			// Objective color dot
			color = gMission.objectives[i].color;

			x = 5;
			Draw_Rect(x, (y + 3), 2, 2, color);

			x += 5;
			x2 = x + TextWidth(gMission.missionData->objectives[i].description) + 5;

			sprintf(sScore, "(%d)", gMission.objectives[i].done);

			if (gMission.objectives[i].required <= 0) {
				TextStringWithTableAt(x, y,
						      gMission.missionData->objectives[i].description,
						      &tablePurple);
				TextStringWithTableAt(x2, y, sScore, &tablePurple);
			} else if (gMission.objectives[i].done >= gMission.objectives[i].required) {
				TextStringWithTableAt(x, y,
						      gMission.missionData->objectives[i].description,
						      &tableFlamed);
				TextStringWithTableAt(x2, y, sScore, &tableFlamed);
			} else {
				TextStringAt(x, y, gMission.missionData->objectives[i].description);
				TextStringAt(x2, y, sScore);
			}
			y -= (TextHeight() + 1);
		}
	}
}
Ejemplo n.º 6
0
void TextStringSpecial(const char *s, unsigned int opts, unsigned int xpad, unsigned int ypad)
{
    int scrw = SCREEN_WIDTH;
    int scrh = SCREEN_HEIGHT;
    int x, y, w, h;

    x = y = w = h = 0;
    w = TextWidth(s);
    h = TextHeight();

    if (FLAG_SET(opts, TEXT_XCENTER))	{
        x = (scrw - w) / 2;
    }
    if (FLAG_SET(opts, TEXT_YCENTER))	{
        y = (scrh - h) / 2;
    }

    if (FLAG_SET(opts, TEXT_LEFT))		{
        x = 0 + xpad;
    }
    if (FLAG_SET(opts, TEXT_RIGHT))		{
        x = scrw - w - xpad;
    }

    if (FLAG_SET(opts, TEXT_TOP))		{
        y = 0 + ypad;
    }
    if (FLAG_SET(opts, TEXT_BOTTOM))	{
        y = scrh - h - ypad;
    }

    if (FLAG_SET(opts, TEXT_FLAMED)) {
        TextStringWithTableAt(x, y, s, &tableFlamed);
    } else if (FLAG_SET(opts, TEXT_PURPLE)) {
        TextStringWithTableAt(x, y, s, &tablePurple);
    } else {
        TextStringAt(x, y, s);
    }
}