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

Function draw_msgline

outdated/win/gem/wingem1.c:784–822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782}
783
784static int
785draw_msgline(PARMBLK *pb)
786{
787 GRECT area = *(GRECT *) &pb->pb_x;
788
789 if (rc_intersect((GRECT *) &pb->pb_xc, &area)) {
790 int x = pb->pb_x, y = pb->pb_y + (msg_vis - 1) * msg_font.ch, foo, i;
791 char **ptr = &message_line[msg_pos], tmp;
792 int startx, stopx, starty, stopy;
793
794 x = (x + 7) & ~7; /* Byte alignment speeds output up */
795
796 v_set_mode(MD_REPLACE);
797
798 /* void v_set_text(int font,int height,int color,int effect,int
799 * rotate,int out[4]) */
800 v_set_text(msg_font.id, msg_font.size, FAIL, FAIL, 0, NULL);
801 vst_alignment(x_handle, 0, 5, &foo, &foo);
802 stopy = min(msg_pos, msg_vis);
803 /* Vsync();*/
804 startx =
805 (area.g_x - x) / msg_font.cw
806 - 1; /* MAR 06.02.2001 -- because italic covers the next char */
807 Max(&startx, 0);
808 stopx = (area.g_x + area.g_w + msg_font.cw - x - 1) / msg_font.cw;
809 x += startx * msg_font.cw;
810 for (i = 0; i < stopy; i++, y -= msg_font.ch, ptr--) {
811 if (message_age[msg_pos - i])
812 v_set_text(FAIL, 0, BLACK, 0, 0, NULL);
813 else
814 v_set_text(FAIL, 0, LBLACK, 4, 0, NULL);
815 tmp = (*ptr)[stopx];
816 (*ptr)[stopx] = 0;
817 (*v_mtext)(x_handle, x, y, &(*ptr)[startx]);
818 (*ptr)[stopx] = tmp;
819 }
820 }
821 return (0);
822}
823
824static int
825draw_status(PARMBLK *pb)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected