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

Function mar_add_status_str

outdated/win/gem/wingem1.c:1685–1717  ·  view source on GitHub ↗
(str, line)

Source from the content-addressed store, hash-verified

1683/************************* mar_add_status_str *******************************/
1684
1685void
1686mar_add_status_str(str, line)
1687const char *str;
1688int line;
1689{
1690 int i, last_diff = -1;
1691 GRECT area = { 0, line * status_font.ch, status_font.cw, status_font.ch };
1692 for (i = 0; (i < status_w - 2) && str[i]; i++)
1693 if (str[i] != status_line[line][i]) {
1694 if (last_diff == -1)
1695 area.g_x = i * status_font.cw;
1696 else
1697 area.g_w += status_font.cw;
1698 last_diff = i;
1699 status_line[line][i] = str[i];
1700 } else if (last_diff >= 0) {
1701 add_dirty_rect(dr_stat, &area);
1702 last_diff = -1;
1703 area.g_w = status_font.cw;
1704 }
1705 for (; i < status_w - 1; i++) {
1706 if (status_line[line][i]) {
1707 if (last_diff == -1)
1708 area.g_x = i * status_font.cw;
1709 else
1710 area.g_w += status_font.cw;
1711 last_diff = i;
1712 }
1713 status_line[line][i] = 0;
1714 }
1715 if (last_diff >= 0)
1716 add_dirty_rect(dr_stat, &area);
1717}
1718
1719/************************* mar_set_menu_title *******************************/
1720

Callers 1

Gem_putstrFunction · 0.85

Calls 1

add_dirty_rectFunction · 0.85

Tested by

no test coverage detected