From ba30de7fcf3e0547864521e71ab3116f6f194be3 Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Meyer Date: Fri, 28 Aug 2009 22:27:22 -0700 Subject: [PATCH] cmenu: refactor cswprint function Now that cprint is smarter, cswprint can be simplified. Signed-off-by: Pierre-Alexandre Meyer --- com32/cmenu/libmenu/tui.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/com32/cmenu/libmenu/tui.c b/com32/cmenu/libmenu/tui.c index 330b46f..c8461ed 100644 --- a/com32/cmenu/libmenu/tui.c +++ b/com32/cmenu/libmenu/tui.c @@ -216,24 +216,9 @@ void cswprint(const char *str, char attr, char left) { char page = getdisppage(); char newattr = 0, cha, chb; - char row, col; - char nr, nc; - nr = getnumrows(); - nc = getnumcols(); - getpos(&row, &col, page); while (*str) { switch (*str) { - case '\b': - --col; - break; - case '\n': - ++row; - col = left; - break; - case '\r': - //col=left; - break; case BELL: // Bell Char beep(); break; @@ -257,18 +242,8 @@ void cswprint(const char *str, char attr, char left) } break; default: - putch(*str, attr, page); - ++col; + cprint(*str, attr, 1, page); } - if (col >= nc) { - ++row; - col = left; - } - if (row > nr) { - scrollup(); - row = nr; - } - gotoxy(row, col, page); str++; } } -- 2.7.4