diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-09 01:28:04 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-09 01:28:04 +0800 |
commit | bd2018496f8a1b501932ac29e4cab72a1a94717c (patch) | |
tree | 9b3634c14ca22803002f5bcdd47a3276b7cfbd29 /mbbsd | |
parent | 749b08d0e4d06e3e6b17f0675d8dae507f5cbf4c (diff) | |
download | pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar.gz pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar.bz2 pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar.lz pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar.xz pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.tar.zst pttbbs-bd2018496f8a1b501932ac29e4cab72a1a94717c.zip |
use REDDOWN() macro to indicate chessboard flipping status.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3014 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/chc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/mbbsd/chc.c b/mbbsd/chc.c index 1b9a01d1..3e331a5d 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -241,10 +241,10 @@ chc_drawline(const ChessInfo* info, int line) } else if (line >= 3 && line <= 21) { outs(" "); for (i = 0; i < 9; i++) { - j = board[RTL(info->myturn,line)][CTL(info->myturn,i)]; + j = board[RTL(info,line)][CTL(info,i)]; if ((line & 1) == 1 && j) { if (tag->selected && - tag->select.r == RTL(info->myturn,line) && tag->select.c == CTL(info->myturn,i)) { + tag->select.r == RTL(info,line) && tag->select.c == CTL(info,i)) { prints("%s%s" ANSI_RESET, CHE_O(j) == BLK ? BLACK_REVERSE : RED_REVERSE, chess_str[CHE_O(j)][CHE_P(j)]); @@ -265,10 +265,10 @@ chc_drawline(const ChessInfo* info, int line) outs(" "); if (line == 2) for (i = 1; i <= 9; i++) - prints("%s ", num_str[0][i]); + prints("%s ", num_str[REDDOWN(info)?0:1][i]); else for (i = 9; i >= 1; i--) - prints("%s ", num_str[1][i]); + prints("%s ", num_str[REDDOWN(info)?1:0][i]); } if (info->photo) { @@ -506,8 +506,8 @@ chc_movechess(board_t board, const drc_t* move) static void chc_drawstep(ChessInfo* info, const drc_t* move) { - info->actions->drawline(info, LTR(info->myturn, move->from.r)); - info->actions->drawline(info, LTR(info->myturn, move->to.r)); + info->actions->drawline(info, LTR(info, move->from.r)); + info->actions->drawline(info, LTR(info, move->to.r)); } /* 求兩座標行或列(rowcol)的距離 */ @@ -729,7 +729,7 @@ chc_select(ChessInfo* info, rc_t scrloc, ChessGameResult* result) assert(tag); /* transform from screen to internal coordinate */ - if(info->myturn == RED) { + if(REDDOWN(info)) { loc = scrloc; } else { loc.r = BRD_ROW-scrloc.r-1; @@ -743,13 +743,13 @@ chc_select(ChessInfo* info, rc_t scrloc, ChessGameResult* result) /* they can pick up this */ tag->selected = 1; tag->select = loc; - chc_drawline(info, LTR(info->myturn, loc.r)); + chc_drawline(info, LTR(info, loc.r)); } return 0; } else if (tag->select.r == loc.r && tag->select.c == loc.c) { /* cancel selection */ tag->selected = 0; - chc_drawline(info, LTR(info->myturn, loc.r)); + chc_drawline(info, LTR(info, loc.r)); return 0; } else if (chc_canmove(board, tag->select, loc)) { /* moving the chess */ @@ -770,8 +770,8 @@ chc_select(ChessInfo* info, rc_t scrloc, ChessGameResult* result) getstep(board, &moving.from, &moving.to, info->last_movestr); chc_movechess(board, &moving); - chc_drawline(info, LTR(info->myturn, moving.from.r)); - chc_drawline(info, LTR(info->myturn, moving.to.r)); + chc_drawline(info, LTR(info, moving.from.r)); + chc_drawline(info, LTR(info, moving.to.r)); ChessHistoryAppend(info, &moving); ChessStepBroadcast(info, &moving); |