From 3e667e8bf274223b49012acc74707b3651668fe3 Mon Sep 17 00:00:00 2001 From: kcwu Date: Wed, 11 Sep 2002 07:16:49 +0000 Subject: not only long screen, but also width screen git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@518 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/screen.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'mbbsd/screen.c') diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 0dc36811..fb367618 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -1,11 +1,10 @@ -/* $Id: screen.c,v 1.9 2002/09/11 03:22:50 kcwu Exp $ */ +/* $Id: screen.c,v 1.10 2002/09/11 07:16:49 kcwu Exp $ */ #include "bbs.h" #ifdef SUPPORT_GB static int current_font_type = TYPE_BIG5; static int gbinited = 0; #endif -#define SCR_WIDTH 80 #define o_clear() output(clearbuf,clearbuflen) #define o_cleol() output(cleolbuf,cleolbuflen) #define o_scrollrev() output(scrollrev,scrollrevlen) @@ -119,6 +118,7 @@ redoscr() output((char *)bp->data, len); tc_col += len; if (tc_col >= t_columns) { + /* XXX Is this code right? */ if (automargins) tc_col = t_columns - 1; else { @@ -182,12 +182,15 @@ refresh() output((char *)&bp->data[bp->smod], bp->emod - bp->smod + 1); tc_col = bp->emod + 1; if (tc_col >= t_columns) { - if (automargins) { + /* XXX Is this code right? */ + if (automargins) + tc_col = t_columns - 1; + else { tc_col -= t_columns; - if (++tc_line >= t_lines) + tc_line++; + if (tc_line >= t_lines) tc_line = b_lines; - } else - tc_col = t_columns - 1; + } } } if (bp->oldlen > len) { @@ -423,7 +426,7 @@ edit_outs(char *text) if (current_font_type == TYPE_GB) text = hc_convert_str(text, HC_BIGtoGB, HC_DO_SINGLE); #endif - while ((ch = *text++) && (++column < SCR_WIDTH)) + while ((ch = *text++) && (++column < t_columns)) outch(ch == 27 ? '*' : ch); return 0; -- cgit v1.2.3