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

Function draw_status

outdated/win/gem/wingem1.c:824–863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822}
823
824static int
825draw_status(PARMBLK *pb)
826{
827 GRECT area = *(GRECT *) &pb->pb_x;
828
829 area.g_x += 2 * status_font.cw - 2;
830 area.g_w -= 2 * status_font.cw - 2;
831 if (rc_intersect((GRECT *) &pb->pb_xc, &area)) {
832 int x = pb->pb_x, y = pb->pb_y, startx, stopx, starty, stopy, i;
833 char tmp;
834
835 /* void v_set_text(int font,int height,int color,int effect,int
836 * rotate,int out[4]) */
837 v_set_mode(MD_REPLACE);
838 v_set_text(status_font.id, status_font.size, BLACK, 0, 0, NULL);
839 x = (x + 2 * status_font.cw + 6) & ~7;
840
841 startx = (area.g_x - x) / status_font.cw;
842 starty = (area.g_y - y) / status_font.ch;
843 stopx =
844 (area.g_x + area.g_w + status_font.ch - 1 - x) / status_font.cw;
845 stopy =
846 (area.g_y + area.g_h + status_font.ch - 1 - y) / status_font.ch;
847 Max(&startx, 0); /* MAR -- Hmm, area.g_x could end up 1 below x */
848 Max(&stopx, 0);
849 x += startx * status_font.cw;
850 y += starty * status_font.ch;
851 /* Vsync();*/
852 area.g_h = status_font.ch;
853 for (i = starty; i < min(2, stopy);
854 i++, area.g_y += status_font.ch, y += status_font.ch) {
855 my_clear_area(&area);
856 tmp = status_line[i][stopx];
857 status_line[i][stopx] = 0;
858 (*v_mtext)(x_handle, x, y, &status_line[i][startx]);
859 status_line[i][stopx] = tmp;
860 }
861 }
862 return (0);
863}
864
865static int
866draw_inventory(PARMBLK *pb)

Callers

nothing calls this directly

Calls 1

my_clear_areaFunction · 0.85

Tested by

no test coverage detected