diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-04-12 22:17:30 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-04-12 22:17:30 +0800 |
commit | 61d51a1fab7d1f2a6dd23f472237425dea5a450d (patch) | |
tree | d3348182187a640c9969ecaaaef1ff0fb20b8a66 | |
parent | 9501bfb0788917808445791b66b98e8b0dc5f7ce (diff) | |
download | pttbbs-61d51a1fab7d1f2a6dd23f472237425dea5a450d.tar pttbbs-61d51a1fab7d1f2a6dd23f472237425dea5a450d.tar.gz pttbbs-61d51a1fab7d1f2a6dd23f472237425dea5a450d.tar.bz2 pttbbs-61d51a1fab7d1f2a6dd23f472237425dea5a450d.tar.lz pttbbs-61d51a1fab7d1f2a6dd23f472237425dea5a450d.tar.xz pttbbs-61d51a1fab7d1f2a6dd23f472237425dea5a450d.tar.zst pttbbs-61d51a1fab7d1f2a6dd23f472237425dea5a450d.zip |
Fix screen line calculation. #1FXflAsI (PttCurrent)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5628 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/screen.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/pttbbs/mbbsd/screen.c b/pttbbs/mbbsd/screen.c index b03dd784..606ec5e2 100644 --- a/pttbbs/mbbsd/screen.c +++ b/pttbbs/mbbsd/screen.c @@ -18,6 +18,16 @@ static unsigned char _typeahead = 1; #define MODIFIED (1) /* if line has been modifed, screen output */ #define STANDOUT (2) /* if this line has a standout region */ +inline +screenline_t* GetLine(int i) { + return &big_picture[(i + roll) % scr_lns]; +} + +inline +screenline_t* GetCurrentLine() { + return GetLine(cur_ln); +} + void change_scroll_range(int top, int bottom) { @@ -122,7 +132,7 @@ move_ansi(int y, int x) if (y >= scr_lns || x < 1) return; - slp = &big_picture[y]; + slp = GetLine(y); if (slp->len < 1) return; @@ -156,7 +166,7 @@ getyx_ansi(int *py, int *px) if (y >= scr_lns || x < 1) return; - slp = &big_picture[y]; + slp = GetLine(y); if (slp->len < 1) return; c = slp->data[x]; @@ -165,14 +175,6 @@ getyx_ansi(int *py, int *px) slp->data[x] = c; } -static inline -screenline_t* GetCurrentLine(){ - register int i = cur_ln + roll; - if(i >= scr_lns) - i %= scr_lns; - return &big_picture[i]; -} - static void rel_move(int was_col, int was_ln, int new_col, int new_ln) { |