summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-05-30 11:36:23 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-05-30 11:36:23 +0800
commit7fd0746cfe3e86ab0cf8d2d1158fe716c943724d (patch)
tree47ef58d369499e382c87742b89d958698a7b24a7
parentcbc07c65e3399ce8c1e3fbc6c5fe8cc3268f3d01 (diff)
downloadpttbbs-7fd0746cfe3e86ab0cf8d2d1158fe716c943724d.tar
pttbbs-7fd0746cfe3e86ab0cf8d2d1158fe716c943724d.tar.gz
pttbbs-7fd0746cfe3e86ab0cf8d2d1158fe716c943724d.tar.bz2
pttbbs-7fd0746cfe3e86ab0cf8d2d1158fe716c943724d.tar.lz
pttbbs-7fd0746cfe3e86ab0cf8d2d1158fe716c943724d.tar.xz
pttbbs-7fd0746cfe3e86ab0cf8d2d1158fe716c943724d.tar.zst
pttbbs-7fd0746cfe3e86ab0cf8d2d1158fe716c943724d.zip
standoutput
git-svn-id: http://opensvn.csie.org/pttbbs/branches/victor.screen@2034 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/screen.c39
1 files 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);