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

Function nocmov

win/tty/termcap.c:558–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

556 then action must be taken in trampoli.[ch]. */
557
558void
559nocmov(int x, int y)
560{
561 if ((int) ttyDisplay->cury > y) {
562 if (UP) {
563 while ((int) ttyDisplay->cury > y) { /* Go up. */
564 xputs(UP);
565 ttyDisplay->cury--;
566 }
567 } else if (nh_CM) {
568 cmov(x, y);
569 } else if (HO) {
570 home();
571 tty_curs(BASE_WINDOW, x + 1, y);
572 } /* else impossible("..."); */
573 } else if ((int) ttyDisplay->cury < y) {
574 if (XD) {
575 while ((int) ttyDisplay->cury < y) {
576 xputs(XD);
577 ttyDisplay->cury++;
578 }
579 } else if (nh_CM) {
580 cmov(x, y);
581 } else {
582 while ((int) ttyDisplay->cury < y) {
583 (void) xputc('\n');
584 ttyDisplay->curx = 0;
585 ttyDisplay->cury++;
586 }
587 }
588 }
589 if ((int) ttyDisplay->curx < x) { /* Go to the right. */
590 if (!nh_ND) {
591 cmov(x, y);
592 } else { /* bah */
593 /* should instead print what is there already */
594 while ((int) ttyDisplay->curx < x) {
595 xputs(nh_ND);
596 ttyDisplay->curx++;
597 }
598 }
599 } else if ((int) ttyDisplay->curx > x) {
600 while ((int) ttyDisplay->curx > x) { /* Go to the left. */
601 xputs(BC);
602 ttyDisplay->curx--;
603 }
604 }
605}
606
607void
608cmov(int x, int y)

Callers 1

tty_cursFunction · 0.70

Calls 5

tty_cursFunction · 0.85
xputsFunction · 0.70
cmovFunction · 0.70
homeFunction · 0.70
xputcFunction · 0.70

Tested by

no test coverage detected