本文整理汇总了C++中Term_fresh函数的典型用法代码示例。如果您正苦于以下问题:C++ Term_fresh函数的具体用法?C++ Term_fresh怎么用?C++ Term_fresh使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Term_fresh函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle_signal_abort
/*
* Handle signal -- abort, kill, etc
*/
static void handle_signal_abort(int sig)
{
/* Disable handler */
(void)(*signal_aux)(sig, SIG_IGN);
/* Nothing to save, just quit */
if (!character_generated || character_saved) quit(NULL);
/* Clear the bottom line */
Term_erase(0, 23, 255);
/* Give a warning */
Term_putstr(0, 23, -1, TERM_RED,
"A gruesome software bug LEAPS out at you!");
/* Message */
Term_putstr(45, 23, -1, TERM_RED, "Panic save...");
/* Flush output */
Term_fresh();
/* Panic Save
p_ptr->panic_save = 1; */
/* Panic save */
my_strcpy(p_ptr->died_from, "(panic save)", sizeof(p_ptr->died_from));
/* Forbid suspend */
signals_ignore_tstp();
/* Attempt to save */
if (old_save())
{
Term_putstr(45, 23, -1, TERM_RED, "Panic save succeeded!");
}
/* Save failed */
else
{
Term_putstr(45, 23, -1, TERM_RED, "Panic save failed!");
}
/* Flush output */
Term_fresh();
/* Quit */
quit("software bug");
}
示例2: save_game
/**
* Save the game
*/
void save_game(void)
{
char name[80];
char path[1024];
/* Disturb the player */
disturb(player, 1);
/* Clear messages */
event_signal(EVENT_MESSAGE_FLUSH);
/* Handle stuff */
handle_stuff(player);
/* Message */
prt("Saving game...", 0, 0);
/* Refresh */
Term_fresh();
/* The player is not dead */
my_strcpy(player->died_from, "(saved)", sizeof(player->died_from));
/* Forbid suspend */
signals_ignore_tstp();
/* Save the player */
if (savefile_save(savefile))
prt("Saving game... done.", 0, 0);
else
prt("Saving game... failed!", 0, 0);
/* Refresh */
Term_fresh();
/* Save the window prefs */
strnfmt(name, sizeof(name), "%s.prf", player_safe_name(player, TRUE));
path_build(path, sizeof(path), ANGBAND_DIR_USER, name);
if (!prefs_save(path, option_dump, "Dump window settings"))
prt("Failed to save subwindow preferences", 0, 0);
/* Allow suspend again */
signals_handle_tstp();
/* Refresh */
Term_fresh();
/* Note that the player is not dead */
my_strcpy(player->died_from, "(alive and well)", sizeof(player->died_from));
}
示例3: cmsg_print
void cmsg_print(byte color, cptr msg)
{
if (world_monster) return;
if (statistics_hack) return;
/* Hack: msg_print(NULL) requests a flush if needed */
if (!msg)
{
if (!msg_line_is_empty())
msg_line_flush();
return;
}
if (character_generated)
{
if (_msg_append && _msg_count)
cmsg_append(color, msg);
else
cmsg_add(color, msg);
}
msg_line_display(color, msg);
if (auto_more_state == AUTO_MORE_SKIP_ONE)
auto_more_state = AUTO_MORE_PROMPT;
p_ptr->window |= PW_MESSAGE;
window_stuff();
if (fresh_message) /* ?? */
Term_fresh();
_msg_append = TRUE;
}
示例4: fix_object
/*
* Hack -- display object recall in sub-windows
*/
static void fix_object(void)
{
s32b j;
/* Scan windows */
for (j = 0; j < 8; j++)
{
term *old = Term;
/* No window */
if (!angband_term[j]) continue;
/* No relevant flags */
if (!flag_exists(&window_flag[j], FLAG_PW_OBJECT)) continue;
/* Activate */
Term_activate(angband_term[j]);
/* Clear */
Term_clear();
/* Display object info */
if (tracked_object)
if (!object_out_desc(tracked_object, NULL, FALSE, FALSE)) text_out("You see nothing special.");
/* Fresh */
Term_fresh();
/* Restore */
Term_activate(old);
}
}
示例5: send_world_score
bool send_world_score(bool do_send)
{
#ifdef WORLD_SCORE
if(send_score && do_send)
{
if(easy_band)
{
msg_print("Since you are in the Easy Mode, you cannot send score to world score server.");
}
else if(get_check_strict("Do you send score to the world score sever? ", (CHECK_NO_ESCAPE | CHECK_NO_HISTORY)))
{
errr err;
prt("",0,0);
prt("Sending...",0,0);
Term_fresh();
screen_save();
err = report_score();
screen_load();
if (err)
{
return FALSE;
}
prt("Completed. Hit any key.", 0, 0);
(void)inkey();
}
else return FALSE;
}
#endif
return TRUE;
}
示例6: fix_monster
/*
* Hack -- display monster recall in sub-windows
*/
static void fix_monster(void)
{
s32b j;
/* Scan windows */
for (j = 0; j < 8; j++)
{
term *old = Term;
/* No window */
if (!angband_term[j]) continue;
/* No relevant flags */
if (!flag_exists(&window_flag[j], FLAG_PW_MONSTER)) continue;
/* Activate */
Term_activate(angband_term[j]);
/* Display monster race info */
if (monster_race_idx) display_roff(monster_race_idx, monster_ego_idx);
/* Fresh */
Term_fresh();
/* Restore */
Term_activate(old);
}
}
示例7: send_world_score
/*!
* @brief スコアサーバへの転送処理
* @param do_send 実際に転送ア処置を行うか否か
* @return 転送が成功したらTRUEを返す
*/
bool send_world_score(bool do_send)
{
#ifdef WORLD_SCORE
if(send_score && do_send)
{
if(easy_band)
{
msg_print(_("初心者モードではワールドスコアに登録できません。",
"Since you are in the Easy Mode, you cannot send score to world score server."));
}
else if(get_check_strict(_("スコアをスコア・サーバに登録しますか? ", "Do you send score to the world score sever? "),
(CHECK_NO_ESCAPE | CHECK_NO_HISTORY)))
{
errr err;
prt("",0,0);
prt(_("送信中..", "Sending..."),0,0);
Term_fresh();
screen_save();
err = report_score();
screen_load();
if (err)
{
return FALSE;
}
prt(_("完了。何かキーを押してください。", "Completed. Hit any key."), 0, 0);
(void)inkey();
}
else return FALSE;
}
#endif
return TRUE;
}
示例8: target_set_closest
bool target_set_closest(int mode)
{
int y, x, m_idx;
monster_type *m_ptr;
char m_name[80];
bool visibility;
struct point_set *targets;
/* Cancel old target */
target_set_monster(0);
/* Get ready to do targetting */
targets = target_set_interactive_prepare(mode);
/* If nothing was prepared, then return */
if (point_set_size(targets) < 1)
{
msg("No Available Target.");
point_set_dispose(targets);
return FALSE;
}
/* Find the first monster in the queue */
y = targets->pts[0].y;
x = targets->pts[0].x;
m_idx = cave->m_idx[y][x];
/* Target the monster, if possible */
if ((m_idx <= 0) || !target_able(m_idx))
{
msg("No Available Target.");
point_set_dispose(targets);
return FALSE;
}
/* Target the monster */
m_ptr = cave_monster(cave, m_idx);
monster_desc(m_name, sizeof(m_name), m_ptr, 0x00);
if (!(mode & TARGET_QUIET))
msg("%^s is targeted.", m_name);
Term_fresh();
/* Set up target information */
monster_race_track(m_ptr->r_idx);
health_track(p_ptr, cave->m_idx[y][x]);
target_set_monster(m_idx);
/* Visual cue */
Term_get_cursor(&visibility);
(void)Term_set_cursor(TRUE);
move_cursor_relative(y, x);
Term_redraw_section(x, y, x, y);
/* TODO: what's an appropriate amount of time to spend highlighting */
Term_xtra(TERM_XTRA_DELAY, 150);
(void)Term_set_cursor(visibility);
point_set_dispose(targets);
return TRUE;
}
示例9: do_cmd_redraw
/**
* Redraw the screen
*
* This command performs various low level updates, clears all the "extra"
* windows, does a total redraw of the main window, and requests all of the
* interesting updates and redraws that I can think of.
*
* This command is also used to "instantiate" the results of the user
* selecting various things, such as graphics mode, so it must call
* the "TERM_XTRA_REACT" hook before redrawing the windows.
*
*/
void do_cmd_redraw(void)
{
int j;
term *old = Term;
/* Low level flush */
Term_flush();
/* Reset "inkey()" */
event_signal(EVENT_INPUT_FLUSH);
if (character_dungeon)
verify_panel();
/* Hack -- React to changes */
Term_xtra(TERM_XTRA_REACT, 0);
if (character_dungeon) {
/* Combine the pack (later) */
player->upkeep->notice |= (PN_COMBINE);
/* Update torch, gear */
player->upkeep->update |= (PU_TORCH | PU_INVEN);
/* Update stuff */
player->upkeep->update |= (PU_BONUS | PU_HP | PU_SPELLS);
/* Fully update the visuals */
player->upkeep->update |= (PU_FORGET_VIEW | PU_UPDATE_VIEW | PU_MONSTERS);
/* Redraw everything */
player->upkeep->redraw |= (PR_BASIC | PR_EXTRA | PR_MAP | PR_INVEN |
PR_EQUIP | PR_MESSAGE | PR_MONSTER |
PR_OBJECT | PR_MONLIST | PR_ITEMLIST);
}
/* Clear screen */
Term_clear();
if (character_dungeon) {
/* Hack -- update */
handle_stuff(player);
/* Place the cursor on the player */
if (0 != character_dungeon)
move_cursor_relative(player->px, player->py);
}
/* Redraw every window */
for (j = 0; j < ANGBAND_TERM_MAX; j++) {
if (!angband_term[j]) continue;
Term_activate(angband_term[j]);
Term_redraw();
Term_fresh();
Term_activate(old);
}
}
示例10: bell_message
/**
* Flush the output before displaying for emphasis
*/
void bell_message(game_event_type unused, game_event_data *data, void *user)
{
/* Flush the output */
Term_fresh();
display_message(unused, data, user);
player->upkeep->redraw |= PR_MESSAGE;
}
示例11: save_game
/*
* Save the game
*/
void save_game(void)
{
/* Disturb the player */
disturb(1, 0);
/* Clear messages */
message_flush();
/* Handle stuff */
handle_stuff();
/* Message */
prt("Saving game...", 0, 0);
/* Refresh */
Term_fresh();
/* The player is not dead */
my_strcpy(p_ptr->died_from, "(saved)", sizeof(p_ptr->died_from));
/* Forbid suspend */
signals_ignore_tstp();
/* Save the player */
if (old_save())
{
prt("Saving game... done.", 0, 0);
}
/* Save failed (oops) */
else
{
prt("Saving game... failed!", 0, 0);
}
/* Allow suspend again */
signals_handle_tstp();
/* Refresh */
Term_fresh();
/* Note that the player is not dead */
my_strcpy(p_ptr->died_from, "(alive and well)", sizeof(p_ptr->died_from));
}
示例12: Term_redraw
/*
* Redraw (and refresh) the whole window.
*/
errr Term_redraw(void)
{
/* Force "total erase" */
Term->total_erase = TRUE;
/* Hack -- Refresh */
Term_fresh();
/* Success */
return (0);
}
示例13: note
/*
* Hack -- Show information on the screen, one line at a time.
*
* Avoid the top two lines, to avoid interference with "msg_print()".
*/
static void note(cptr msg)
{
static int y = 2;
/* Draw the message */
prt(msg, y, 0);
/* Advance one line (wrap if needed) */
if (++y >= 24) y = 2;
/* Flush it */
Term_fresh();
}
示例14: load_path
/**
* Load the attr/char at each point along "path" which is on screen from
* "a" and "c". This was saved in draw_path().
*/
static void load_path(u16b path_n, u16b *path_g, wchar_t *c, int *a) {
int i;
for (i = 0; i < path_n; i++) {
int y = GRID_Y(path_g[i]);
int x = GRID_X(path_g[i]);
if (!panel_contains(y, x)) continue;
move_cursor_relative(y, x);
Term_addch(a[i], c[i]);
}
Term_fresh();
}
示例15: load_path
/*
* Load the attr/char at each point along "path" which is on screen from
* "a" and "c". This was saved in draw_path().
*/
static void load_path(u16b path_n, u16b *path_g, char *c, byte *a)
{
int i;
for (i = 0; i < path_n; i++)
{
if (!panel_contains(GRID_Y(path_g[i]), GRID_X(path_g[i]))) continue;
move_cursor_relative(GRID_Y(path_g[i]), GRID_X(path_g[i]));
(void)Term_addch(a[i], c[i]);
}
(void)Term_fresh();
}