summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-08 22:00:40 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-08-08 22:00:40 +0800
commit72fa46586658fa5a7e797e66167583b17cb5a858 (patch)
tree94f45384e659aa3d8cf2d7722b997f8ad7ab5252 /include
parentc0ffbd8f8c761ca8a86b463686c8a54202ddc2b9 (diff)
downloadpttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar.gz
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar.bz2
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar.lz
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar.xz
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.tar.zst
pttbbs-72fa46586658fa5a7e797e66167583b17cb5a858.zip
fix chess internal coordinate.
!! NOTE !!, not compatible with older revision. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3009 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r--include/chc.h5
-rw-r--r--include/chess.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/include/chc.h b/include/chc.h
index 31aa49bc..eb1bae83 100644
--- a/include/chc.h
+++ b/include/chc.h
@@ -32,9 +32,10 @@
#define CHE_O(c) ((c) >> 3)
#define CHE_P(c) ((c) & 7)
-#define RTL(x) (((x) - 3) >> 1)
+#define RTL(myturn, x) ((myturn)==BLK?BRD_ROW-1-((x)-3)/2:((x)-3)/2)
+#define CTL(myturn, x) ((myturn)==BLK?BRD_COL-1-(x):(x))
#define dim(x) (sizeof(x) / sizeof(x[0]))
-#define LTR(x) ((x) * 2 + 3)
+#define LTR(myturn, x) ((((myturn)==BLK?BRD_ROW-1-(x):(x)) * 2) + 3)
#define CHE(a, b) ((a) | ((b) << 3))
#define BLACK_COLOR ANSI_COLOR(1;36)
diff --git a/include/chess.h b/include/chess.h
index 82b72a6e..766486aa 100644
--- a/include/chess.h
+++ b/include/chess.h
@@ -86,7 +86,7 @@ typedef struct ChessInfo {
const ChessGameMode mode;
const ChessUser user1;
const ChessUser user2;
- const char my; /* 我方顏色 */
+ const char myturn; /* 我方顏色 */
char turn;
char ipass, hepass;
@@ -113,7 +113,7 @@ typedef struct ChessInfo {
typedef struct ChessActions {
/* initial */
void (*init_user) (const userec_t* rec, ChessUser* user);
- void (*init_board) (const ChessInfo* info, void* board);
+ void (*init_board) (void* board);
/* playing */
void (*drawline) (const ChessInfo* info, int line);