X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=io.c;h=4ca069ff8f7844a16648b5b6fb07bc7e3521923a;hb=04eb89075222f6a4b3f44acd81582a20b9ecbde2;hp=309069318356ed571d6bd5f7c8f31280b9ba6590;hpb=fee8e83e1b2c4d61bd0346d282dd89074580140b;p=super-star-trek.git diff --git a/io.c b/io.c index 3090693..4ca069f 100644 --- a/io.c +++ b/io.c @@ -277,6 +277,20 @@ void prouts(char *fmt, ...) { #endif /* SERGEEV */ } +void c_printf (char *format, ... ) +{ + char buffer[BUFSIZ]; /* Well, BUFSIZ is from ncurses... */ + va_list argp; + va_start(argp,format); + vsprintf(buffer,format,argp); + va_end(argp); +#ifdef SERGEEV + waddstr(conio_scr,buffer); +#else + proutn(buffer); +#endif /* SERGEEV */ +} + void warble(void) /* sound and visual effects for teleportation */ { @@ -327,5 +341,21 @@ void getline(char *line, int max) { } } +void setwnd(short wndnum){ +/* change windows -- OK for this to be a no-op in tty mode */ +#ifdef SERGEEV + int cury; + cury=wherey()+wnds[curwnd].wndtop-wnds[wndnum].wndtop; + if ((curwnd==0)&&(wndnum!=0)) clrscr(); + window(wnds[wndnum].wndleft, wnds[wndnum].wndtop, wnds[wndnum].wndright, wnds[wndnum].wndbottom); + if ((curwnd==wndnum)&&(cury>wnds[wndnum].wndbottom-wnds[wndnum].wndtop+1)){ + gotoxy(wnds[wndnum].wndright-wnds[wndnum].wndleft+1,wnds[wndnum].wndbottom-wnds[wndnum].wndtop+1); + skip(1); + } + curwnd=wndnum; + gotoxy(1,cury); +#endif /* SERGEEV */ +} + void commandhook(char *cmd, int before) { }