From 7fd0746cfe3e86ab0cf8d2d1158fe716c943724d Mon Sep 17 00:00:00 2001 From: victor Date: Sun, 30 May 2004 03:36:23 +0000 Subject: standoutput git-svn-id: http://opensvn.csie.org/pttbbs/branches/victor.screen@2034 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/screen.c | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/mbbsd/screen.c b/mbbsd/screen.c index a96b9f99..221ccd93 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -77,6 +77,41 @@ rel_move(int was_col, int was_ln, int new_col, int new_ln) do_move(new_col, new_ln); } +static void +standoutput(char *buf, int ds, int de, int sso, int eso) +{ + if (eso <= ds || sso >= de) { + output(buf + ds, de - ds); + } else { +#if 0 + if (sso > ds) // does is not happened? + output(buf + ds, sso - ds); + else + vmsg("!!!!!!"); + o_standup(); + output(buf + sso, de - sso); + o_standdown(); + if (de > eso) // does is not happened? + output(buf + eso, de - eso); + else + vmsg("!!!!!!"); +#else + short st_start, st_end; + + st_start = MAX(sso, ds); + st_end = MIN(eso, de); + if (sso > ds) + output(buf + ds, sso - ds); + o_standup(); + output(buf + st_start, st_end - st_start); + o_standdown(); + if (de > eso) + output(buf + eso, de - eso); +#endif + } +} + + void redoscr() { @@ -91,7 +126,7 @@ redoscr() if ((len = bp->len)) { rel_move(tc_col, tc_line, 0, i); if (bp->mode & STANDOUT) { -// standoutput((char *)bp->data, 0, len, bp->sso, bp->eso); + standoutput((char *)bp->data, 0, len, bp->sso, bp->eso); } else output((char *)bp->data, len); @@ -157,7 +192,7 @@ refresh() rel_move(tc_col, tc_line, bp->smod, i); if (bp->mode & STANDOUT) { -// standoutput((char *)bp->data, bp->smod, bp->emod + 1, bp->sso, bp->eso); + standoutput((char *)bp->data, bp->smod, bp->emod + 1, bp->sso, bp->eso); } else output((char *)&bp->data[bp->smod], bp->emod - bp->smod + 1); -- cgit v1.2.3