C++ c

您所在的位置:网站首页 prt函数 C++ c

C++ c

2023-10-17 14:25| 来源: 网络整理| 查看: 265

本文整理汇总了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 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;未经允许,请勿转载。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3