当前位置: 首页>>代码示例>>C++>>正文


C++ c_prt函数代码示例

本文整理汇总了C++中c_prt函数的典型用法代码示例。如果您正苦于以下问题:C++ c_prt函数的具体用法?C++ c_prt怎么用?C++ c_prt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了c_prt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mon_summary

static void mon_summary(int gid, const int *object_list, int n, int top,
						int row, int col)
{
	int i;
	int kills = 0;

	/* Access the race */
	for (i = 0; i < n; i++) {
		int oid = default_join[object_list[i + top]].oid;
		kills += l_list[oid].pkills;
	}

	/* Different display for the first item if we've got uniques to show */
	if (gid == 0
		&& (rf_has((&r_info[default_join[object_list[0]].oid])->flags,
				   RF_UNIQUE))) {
		c_prt(TERM_L_BLUE, format("%d known uniques, %d slain.", n, kills),
			  row, col);
	} else {
		int tkills = 0;

		for (i = 0; i < z_info->r_max; i++)
			tkills += l_list[i].pkills;

		c_prt(TERM_L_BLUE,
			  format("Creatures slain: %d/%d (in group/in total)", kills,
					 tkills), row, col);
	}
}
开发者ID:NickMcConnell,项目名称:FAangband,代码行数:29,代码来源:ui-knowledge.c

示例2: print_abilities

/*
 * Draw the abilities list
 */
void print_abilities(s32b table[], s32b max, s32b sel, s32b start)
{
	s32b i, j;
	s32b wid, hgt;
	cptr keys;

	Term_clear();
	Term_get_size(&wid, &hgt);

	c_prt(TERM_WHITE, format("%s Abilities Screen", game_module), 0, 28);
	keys = format("#Bup#W/#Bdown#W to move, #Bright#W to buy, #B?#W for help");
	display_message(0, 1, strlen(keys), TERM_WHITE, keys);
	c_prt((p_ptr->skill_points) ? TERM_L_BLUE : TERM_L_RED,
	      format("Skill points left: %d", p_ptr->skill_points), 2, 0);

	print_desc_aux(ab_info[table[sel]].desc, 3, 0);

	for (j = start; j < start + (hgt - 7); j++)
	{
		byte color = TERM_WHITE;
		char deb = ' ', end = ' ';

		if (j >= max) break;

		i = table[j];

		if (ab_info[i].acquired)
			color = TERM_L_BLUE;
		else if (can_learn_ability(i))
			color = TERM_WHITE;
		else
			color = TERM_L_DARK;


		if (j == sel)
		{
			color = TERM_L_GREEN;
			deb = '[';
			end = ']';
		}

		c_prt(color, format("%c.%c%s", deb, end, ab_info[i].name),
		      j + 7 - start, 0);

		if (!ab_info[i].acquired)
		{
			c_prt(color, format("%d", ab_info[i].cost), j + 7 - start, 60);
		}
		else
		{
			c_prt(color, "Known", j + 7 - start, 60);
		}
	}
}
开发者ID:jcubic,项目名称:ToME,代码行数:57,代码来源:skills.c

示例3: display_monster

/*
 * Display a monster
 */
static void display_monster(int col, int row, bool cursor, int oid)
{
    /* HACK Get the race index. (Should be a wrapper function) */
    int r_idx = default_join[oid].oid;

    /* Access the race */
    monster_race *r_ptr = &r_info[r_idx];
    monster_lore *l_ptr = &l_list[r_idx];

    /* Choose colors */
    byte attr = curs_attrs[CURS_KNOWN][(int) cursor];
    byte a = r_ptr->x_attr;
    byte c = r_ptr->x_char;

    /* Display the name */
    c_prt(attr, r_ptr->name, row, col);

    if ((tile_width > 1) || (tile_height > 1))
	return;

    /* Display symbol */
    big_pad(66, row, a, c);

    /* Display kills */
    if (rf_has(r_ptr->flags, RF_UNIQUE))
	put_str(format("%s", (r_ptr->max_num == 0) ? " dead" : "alive"), row,
		70);
    else
	put_str(format("%5d", l_ptr->pkills), row, 70);
}
开发者ID:artes-liberales,项目名称:FAangband,代码行数:33,代码来源:ui-knowledge.c

示例4: display_feature

/*
 * Display the features in a group.
 */
static void display_feature(int col, int row, bool cursor, int oid)
{
	/* Get the feature index */
	int f_idx = oid;

	/* Access the feature */
	feature_type *f_ptr = &f_info[f_idx];

	/* Choose a color */
	byte attr = curs_attrs[CURS_KNOWN][(int) cursor];

	/* Display the name */
	c_prt(attr, f_ptr->name, row, col);

	if (tile_height == 1) {
		/* Display symbols */
		col = 65;
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_DARK],
					   f_ptr->x_char[FEAT_LIGHTING_DARK]);
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_LIT],
					   f_ptr->x_char[FEAT_LIGHTING_LIT]);
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_TORCH],
				f_ptr->x_char[FEAT_LIGHTING_TORCH]);
		col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_LOS],
				f_ptr->x_char[FEAT_LIGHTING_LOS]);
	}

}
开发者ID:NickMcConnell,项目名称:FAangband,代码行数:31,代码来源:ui-knowledge.c

示例5: textui_textblock_place

void textui_textblock_place(textblock *tb, region orig_area, const char *header)
{
	const char *text = textblock_text(tb);
	const byte *attrs = textblock_attrs(tb);

	/* xxx on resize this should be recalculated */
	region area = region_calculate(orig_area);

	size_t *line_starts = NULL, *line_lengths = NULL;
	size_t n_lines;

	n_lines = textblock_calculate_lines(tb,
			&line_starts, &line_lengths, area.width);

	area.page_rows--;

	if (n_lines > (size_t) area.page_rows)
		n_lines = area.page_rows;

	c_prt(TERM_L_BLUE, header, area.row, area.col);
	area.row++;

	display_area(text, attrs, line_starts, line_lengths, n_lines, area, 0);

	mem_free(line_starts);
	mem_free(line_lengths);
}
开发者ID:BlackDragonB,项目名称:angband,代码行数:27,代码来源:ui.c

示例6: wiz_create_item_display

static void wiz_create_item_display(menu_type *m, int oid, bool cursor,
		int row, int col, int width)
{
	char buf[80];
	object_base_name(buf, sizeof buf, oid, TRUE);
	c_prt(curs_attrs[CURS_KNOWN][0 != cursor], buf, row, col);
}
开发者ID:mtadd,项目名称:angband,代码行数:7,代码来源:wizard.c

示例7: spoil_spells_by_realm

static void spoil_spells_by_realm(void)
{
    int i, row, col, realm_idx;
    while (1)
    {
        Term_clear();

        prt("Realm Spoilers", 2, 0);

        /* Realms */
        row = 4;
        col = 2;
        c_prt(TERM_RED, "Realms", row++, col - 2);

        for (realm_idx = REALM_LIFE; realm_idx <= MAX_MAGIC; realm_idx++)
        {
            prt(format("(%c) %s", 'a' + realm_idx - 1, realm_names[realm_idx]), row++, col);
        }

        i = inkey();
        if (i == ESCAPE) break;
        realm_idx = i - 'a' + 1;

        if (REALM_LIFE <= realm_idx && realm_idx <= MAX_MAGIC)
            _spoil_spells_by_realm_aux1(realm_idx);
     }
}
开发者ID:Alkalinear,项目名称:poschengband,代码行数:27,代码来源:wizard1.c

示例8: _spoil_spells_by_realm_aux2

static void _spoil_spells_by_realm_aux2(int realm_idx, int class1_idx)
{
    int i, row, col, class_idx, choice;
    vec_ptr vec = vec_alloc(NULL);

    for (class_idx = 0; class_idx < MAX_CLASS; class_idx++)
    {
        if (_check_realm(class_idx, realm_idx))
            vec_add_int(vec, class_idx);
    }

    vec_sort(vec, (vec_cmp_f)_cmp_class_name);

    while (1)
    {
        Term_clear();

        c_prt(TERM_L_BLUE, format("%s", realm_names[realm_idx]), 2, 0);
        c_prt(TERM_L_BLUE, format("First Class: %s", get_class_aux(class1_idx, 0)->name), 3, 0);

        /* Classes */
        row = 4;
        col = 2;
        c_prt(TERM_RED, "Second Class", row++, col - 2);

        for (i = 0; i < vec_length(vec); i++)
        {
            int      class_idx = vec_get_int(vec, i);
            class_t *class_ptr = get_class_aux(class_idx, 0);

            prt(format("(%c) %s", 'a' + i, class_ptr->name), row++, col);
        }

        i = inkey();
        if (i == ESCAPE) break;
        choice = i - 'a';

        if (0 <= choice && choice < vec_length(vec))
        {
            class_idx = vec_get_int(vec, choice);
            _spoil_spells_by_realm_aux3(realm_idx, class1_idx, class_idx);
        }
     }

    vec_free(vec);
}
开发者ID:Alkalinear,项目名称:poschengband,代码行数:46,代码来源:wizard1.c

示例9: wiz_create_item_subdisplay

void wiz_create_item_subdisplay(menu_type * m, int oid, bool cursor,
								int row, int col, int width)
{
	int *choices = menu_priv(m);
	char buf[80];

	/* Artifacts */
	if (choose_artifact) {
		get_art_name(buf, choices[oid]);
		c_prt(curs_attrs[CURS_KNOWN][0 != cursor], buf, row, col);
	}
	/* Regular objects */
	else {
		object_kind_name(buf, sizeof buf, choices[oid], TRUE);
		c_prt(curs_attrs[CURS_KNOWN][0 != cursor], buf, row, col);
	}
}
开发者ID:NickMcConnell,项目名称:Beleriand,代码行数:17,代码来源:wizard2.c

示例10: wiz_create_item_subdisplay

/** Object kind selection */
void wiz_create_item_subdisplay(menu_type *m, int oid, bool cursor,
		int row, int col, int width)
{
	object_kind **choices = menu_priv(m);
	char buf[80];

	object_kind_name(buf, sizeof buf, choices[oid], TRUE);
	c_prt(curs_attrs[CURS_KNOWN][0 != cursor], buf, row, col);
}
开发者ID:mtadd,项目名称:angband,代码行数:10,代码来源:wizard.c

示例11: option_toggle_display

/**
 * Displays an option entry.
 */
static void option_toggle_display(struct menu *m, int oid, bool cursor,
		int row, int col, int width)
{
	byte attr = curs_attrs[CURS_KNOWN][cursor != 0];
	bool *options = menu_priv(m);

	c_prt(attr, format("%-45s: %s  (%s)", option_desc(oid),
			options[oid] ? "yes" : "no ", option_name(oid)), row, col);
}
开发者ID:CrypticGator,项目名称:angband,代码行数:12,代码来源:ui-options.c

示例12: display_artifact

/*
 * Display an artifact label
 */
static void display_artifact(int col, int row, bool cursor, int oid)
{
	byte attr = curs_attrs[CURS_KNOWN][(int) cursor];
	char o_name[80];

	get_artifact_display_name(o_name, sizeof o_name, oid);

	c_prt(attr, o_name, row, col);
}
开发者ID:NickMcConnell,项目名称:FAangband,代码行数:12,代码来源:ui-knowledge.c

示例13: jump_display

/**
 * Display an entry on the jump menu
 */
void jump_display(menu_type *menu, int oid, bool cursor, int row, int col,
                  int width)
{
    const u16b *choice = menu_priv(menu);

    byte attr = (cursor ? TERM_L_BLUE : TERM_WHITE);

    c_prt(attr, locality_name[stage_map[choice[oid]][LOCALITY]], row, col);

}
开发者ID:mjdrinen,项目名称:FAangband,代码行数:13,代码来源:wizard2.c

示例14: display_ego_item

static void display_ego_item(int col, int row, bool cursor, int oid)
{
	/* HACK: Access the object */
	ego_item_type *e_ptr = &e_info[default_join[oid].oid];

	/* Choose a color */
	byte attr = curs_attrs[0 != (int) e_ptr->everseen][0 != (int) cursor];

	/* Display the name */
	c_prt(attr, e_ptr->name, row, col);
}
开发者ID:NickMcConnell,项目名称:FAangband,代码行数:11,代码来源:ui-knowledge.c

示例15: display_options_item

static void display_options_item(struct menu *menu, int oid, bool cursor,
								 int row, int col, int width)
{
	size_t line = (size_t) oid;

	/* Most of the menu is svals, with a small "extra options" section below */
	if (line < N_ELEMENTS(sval_dependent)) {
		bool known = seen_tval(sval_dependent[line].tval);
		byte attr = curs_attrs[known ? CURS_KNOWN: CURS_UNKNOWN][(int)cursor];

		c_prt(attr, sval_dependent[line].desc, row, col);
	} else {
		byte attr = curs_attrs[CURS_KNOWN][(int)cursor];

		line = line - N_ELEMENTS(sval_dependent) - 1;

		if (line < N_ELEMENTS(extra_item_options))
			c_prt(attr, extra_item_options[line].name, row, col);
	}
}
开发者ID:CrypticGator,项目名称:angband,代码行数:20,代码来源:ui-options.c


注:本文中的c_prt函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。