MCPcopy Create free account
hub / github.com/NetHack/NetHack / tty_refresh_inventory

Function tty_refresh_inventory

win/tty/wintty.c:3428–3476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3426}
3427
3428void
3429tty_refresh_inventory(int start, int stop, int y)
3430{
3431 int row = y, col, col_limit = stop;
3432 struct WinDesc *cw = 0;
3433 winid window = WIN_INVEN;
3434 struct tty_perminvent_cell *cell;
3435 boolean printing_glyphs;
3436
3437 if (window == WIN_ERR || !iflags.perm_invent
3438 || gp.perm_invent_toggling_direction == toggling_off)
3439 return;
3440
3441 if ((cw = wins[window]) == (struct WinDesc *) 0)
3442 ttywindowpanic();
3443
3444 if (col_limit > cw->maxcol)
3445 col_limit = cw->maxcol;
3446
3447 /* we've been asked to redisplay a portion of the screen, one row */
3448 printing_glyphs = FALSE;
3449 for (col = start - 1; col < col_limit; ++col) {
3450 cell = &cw->cells[row][col];
3451 if (cell->color != ttyDisplay->color + 1) {
3452 term_start_color(cell->color - 1);
3453 ttyDisplay->color = cell->color - 1;
3454 }
3455 if (cell->glyph) {
3456 tty_print_glyph(window, col + 1, row, cell->content.gi,
3457 &nul_glyphinfo);
3458 printing_glyphs = TRUE;
3459 } else {
3460 if (printing_glyphs)
3461 end_glyphout();
3462 if (col != cw->curx || row != cw->cury)
3463 tty_curs(window, col + 1, row);
3464 (void) putchar(cell->content.ttychar);
3465 ttyDisplay->curx++;
3466 cw->curx++;
3467 }
3468 cell->refresh = 0;
3469 }
3470 if (printing_glyphs)
3471 end_glyphout();
3472 if (ttyDisplay->color != NO_COLOR) {
3473 term_end_color();
3474 ttyDisplay->color = NO_COLOR;
3475 }
3476}
3477
3478static void
3479tty_invent_box_glyph_init(struct WinDesc *cw)

Callers 2

ttyinv_inuse_twosidesFunction · 0.85
docornerFunction · 0.85

Calls 5

tty_print_glyphFunction · 0.85
end_glyphoutFunction · 0.85
tty_cursFunction · 0.85
term_start_colorFunction · 0.70
term_end_colorFunction · 0.70

Tested by

no test coverage detected