summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-08-26 16:27:59 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-08-26 16:27:59 +0800
commite7130cce084e10e93494b6695245b71acb1c1160 (patch)
tree57affbae6ee72dc26e6eb5056cdeb1c3576d983c
parentbd3ae512413d166c2c2fcb88821fe8e75ccf6807 (diff)
downloadpttbbs-e7130cce084e10e93494b6695245b71acb1c1160.tar
pttbbs-e7130cce084e10e93494b6695245b71acb1c1160.tar.gz
pttbbs-e7130cce084e10e93494b6695245b71acb1c1160.tar.bz2
pttbbs-e7130cce084e10e93494b6695245b71acb1c1160.tar.lz
pttbbs-e7130cce084e10e93494b6695245b71acb1c1160.tar.xz
pttbbs-e7130cce084e10e93494b6695245b71acb1c1160.tar.zst
pttbbs-e7130cce084e10e93494b6695245b71acb1c1160.zip
less screen copying in ofo water ball mode
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2167 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/common.h13
-rw-r--r--mbbsd/io.c10
-rw-r--r--mbbsd/talk.c8
3 files changed, 24 insertions, 7 deletions
diff --git a/include/common.h b/include/common.h
index 1532131a..c830454a 100644
--- a/include/common.h
+++ b/include/common.h
@@ -147,6 +147,19 @@
#define LEN_AUTHOR1 5
#define LEN_AUTHOR2 7
+
+/* ----------------------------------------------------- */
+/* 水球模式 邊界定義 */
+/* ----------------------------------------------------- */
+#define WB_OFO_USER_TOP 7
+#define WB_OFO_USER_BOTTOM 11
+#define WB_OFO_USER_HEIGHT ((WB_OFO_MSG_BOTTOM) - (WB_OFO_MSG_TOP) + 1)
+#define WB_OFO_USER_LEFT 28
+#define WB_OFO_MSG_TOP 15
+#define WB_OFO_MSG_BOTTOM 22
+#define WB_OFO_MSG_LEFT 4
+
+
/* ----------------------------------------------------- */
/* 群組名單模式 Ptt */
/* ----------------------------------------------------- */
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 129aba90..1840162d 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -285,16 +285,20 @@ igetch()
if (currutmp == NULL)
return (ch);
+#define WB_OFO_WINDOW_HEIGHT ((WB_OFO_MSG_BOTTOM) - (WB_OFO_USER_TOP) + 1)
+
if (currutmp->msgs[0].pid &&
WATERMODE(WATER_OFO) && wmofo == NOTREPLYING) {
int y, x, my_newfd;
- screenline_t *screen0 = calloc(t_lines, sizeof(screenline_t));
- memcpy(screen0, big_picture, t_lines * sizeof(screenline_t));
+ screenline_t *screen0 = calloc(WB_OFO_WINDOW_HEIGHT, sizeof(screenline_t));
+ memcpy(screen0, &big_picture[WB_OFO_USER_TOP - 1],
+ WB_OFO_WINDOW_HEIGHT * sizeof(screenline_t));
getyx(&y, &x);
my_newfd = i_newfd;
i_newfd = 0;
my_write2();
- memcpy(big_picture, screen0, t_lines * sizeof(screenline_t));
+ memcpy(&big_picture[WB_OFO_USER_TOP - 1], screen0,
+ WB_OFO_WINDOW_HEIGHT * sizeof(screenline_t));
i_newfd = my_newfd;
move(y, x);
free(screen0);
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index 672dff81..b0c22f4c 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -498,9 +498,9 @@ my_write2(void)
currstat = DBACK;
//init screen
- move(7, 28);
+ move(WB_OFO_USER_TOP, WB_OFO_USER_LEFT);
outs("\033[1;33;46m ↑ 水球反擊對象 ↓\033[0m");
- for (i = 0; i < 5; ++i)
+ for (i = 0; i < WB_OFO_USER_HEIGHT;++i)
if (swater[i] == NULL || swater[i]->pid == 0)
break;
else {
@@ -510,10 +510,10 @@ my_write2(void)
swater[i]->uin = search_ulist_pid(swater[i]->pid);
water_scr(swater[i], i, 0);
}
- move(15, 4);
+ move(WB_OFO_MSG_TOP, WB_OFO_MSG_LEFT);
outs("\033[0m \033[1;35m◇\033[1;36m────────────────"
"─────────────────\033[1;35m◇\033[0m ");
- move(22, 4);
+ move(WB_OFO_MSG_BOTTOM, WB_OFO_MSG_LEFT);
outs(" \033[1;35m◇\033[1;36m────────────────"
"─────────────────\033[1;35m◇\033[0m ");
water_scr(swater[0], 0, 1);