Ejemplo n.º 1
0
int TextCharWidth(int c)
{
    if (c >= FIRST_CHAR && c <= LAST_CHAR && font[CHAR_INDEX(c)])
        return 1 + PicWidth(font[CHAR_INDEX(c)]) + dxText;
    else
        return 1 + PicWidth(font[CHAR_INDEX('.')]) + dxText;
}
Ejemplo n.º 2
0
void TextCharWithTable(char c, TranslationTable * table)
{
    int i = CHAR_INDEX(c);
    if (i >= 0 && i <= CHARS_IN_FONT && font[i]) {
        DrawTTPic(xText, yText, font[i], table, rleFont[i]);
        xText += 1 + PicWidth(font[i]) + dxText;
    } else {
        i = CHAR_INDEX('.');
        DrawTTPic(xText, yText, font[i], table, rleFont[i]);
        xText += 1 + PicWidth(font[i]) + dxText;
    }
}
Ejemplo n.º 3
0
void TextChar(char c)
{
    int i = CHAR_INDEX(c);
    if (i >= 0 && i <= CHARS_IN_FONT && font[i]) {
        DrawTPic(xText, yText, font[i], compiledFont[i]);
        xText += 1 + PicWidth(font[i]) + dxText;
    } else {
        i = CHAR_INDEX('.');
        DrawTPic(xText, yText, font[i], compiledFont[i]);
        xText += 1 + PicWidth(font[i]) + dxText;
    }
}
Ejemplo n.º 4
0
static int SelectMain(int cmd)
{
	static int index = 0;

	if (cmd == CMD_ESC) {
		if (index != MODE_QUIT)
			index = MODE_QUIT;
		else
			return MODE_QUIT;
	}
	if (AnyButton(cmd)) {
		switch (index) {
		case 0:
			gCampaign.dogFight = 0;
			gOptions.twoPlayers = 0;
			return MODE_CAMPAIGN;
		case 1:
			gCampaign.dogFight = 0;
			gOptions.twoPlayers = 1;
			return MODE_CAMPAIGN;
		case 2:
			gCampaign.dogFight = 1;
			return MODE_DOGFIGHT;
		}
		return index;
	}
	if (Left(cmd) || Up(cmd)) {
		index--;
		if (index < 0)
			index = MAIN_COUNT - 1;
		PlaySound(SND_SWITCH, 0, 255);
	} else if (Right(cmd) || Down(cmd)) {
		index++;
		if (index >= MAIN_COUNT)
			index = 0;
		PlaySound(SND_SWITCH, 0, 255);
	}

	DrawTPic((SCREEN_WIDTH - PicWidth(gPics[PIC_LOGO])) / 2, (SCREEN_HEIGHT / 12), gPics[PIC_LOGO], gCompiledPics[PIC_LOGO]);

	TextStringSpecial("Classic: " CDOGS_VERSION, TEXT_TOP | TEXT_LEFT, 20, 20);
	TextStringSpecial("SDL Port:  " CDOGS_SDL_VERSION, TEXT_TOP | TEXT_RIGHT, 20, 20);

	DisplayMenuAtCenter(mainMenu, MAIN_COUNT, index);
	
	return MODE_MAIN;
}
Ejemplo n.º 5
0
static void DisplayPlayer(TActor * player)
{
	int x, y;
	struct CharacterDescription *c;
	int pic;

	if (player) {
		c = &characterDesc[player->character];
		pic = cHeadPic[c->facePic][DIRECTION_DOWN][STATE_IDLE];
		x = MAP_XOFFS +
		    MAP_FACTOR * player->tileItem.x / TILE_WIDTH;
		y = MAP_YOFFS +
		    MAP_FACTOR * player->tileItem.y / TILE_HEIGHT;
		x -= PicWidth(gPics[pic]) / 2;
		y -= PicHeight(gPics[pic]) / 2;
		DrawTTPic(x, y, gPics[pic], c->table, gRLEPics[pic]);
	}
}
Ejemplo n.º 6
0
void MenuDisplayItems(MenuSystem *menu)
{
	int d = menu->current->u.normal.displayItems;
	if ((d & MENU_DISPLAY_ITEMS_CREDITS) && menu->creditsDisplayer != NULL)
	{
		ShowCredits(menu->creditsDisplayer);
	}
	if (d & MENU_DISPLAY_ITEMS_AUTHORS)
	{
		DrawTPic(
			(gGraphicsDevice.cachedConfig.ResolutionWidth - PicWidth(gPics[PIC_LOGO])) / 2,
			gGraphicsDevice.cachedConfig.ResolutionHeight / 12,
			gPics[PIC_LOGO],
			gCompiledPics[PIC_LOGO]);
		CDogsTextStringSpecial(
			"Classic: " CDOGS_VERSION, TEXT_TOP | TEXT_LEFT, 20, 20);
		CDogsTextStringSpecial(
			"SDL Port: " CDOGS_SDL_VERSION, TEXT_TOP | TEXT_RIGHT, 20, 20);
	}
}