home *** CD-ROM | disk | FTP | other *** search
- // -------- piece.cpp
-
- #include "ttt.h"
-
- int Piece::XYs[][2] = {
- { lfx, tpy },
- { mdx, tpy },
- { btx, tpy },
- { lfx, mdy },
- { mdx, mdy },
- { btx, mdy },
- { lfx, bty },
- { mdx, bty },
- { btx, bty }
- };
-
- void Piece::placemarker(int square, int piece)
- {
- show_image(XYs[square-1][0], XYs[square-1][1], piece);
- board->update(square, piece);
- }
- void Piece::drawline(int i)
- {
- int x, y, line;
- if (i < 3) {
- x = XYs[0][0]-7;
- y = XYs[i*3][1]+20;
- line = 3;
- }
- else if (i < 6) {
- x = XYs[i][0]+20;
- y = XYs[0][1]-7;
- line = 4;
- }
- else {
- x = XYs[0][0]+23;
- y = XYs[0][1]+23;
- line = i-1;
- }
- show_image(x, y, line);
- board->update();
- }
-