#include "backend.h"
#include "moves.h"
#include "board.h"
+#include "draw.h"
#ifdef __EMX__
(squareSize + lineGap);
}
- DrawBorder(x,y, type);
+ DrawBorder(x,y, type, lineGap & 1); // pass whether lineGap is odd
}
int hi1X = -1, hi1Y = -1, hi2X = -1, hi2Y = -1;
FrameDelay(appData.animSpeed);
}
board[fromY][toY] = piece;
+ DrawGrid();
}
/* Main control logic for deciding what to animate and how */
if(Explode(board, fromX, fromY, toX, toY)) { // mark as damaged
int i,j;
for(i=0; i<BOARD_WIDTH; i++) for(j=0; j<BOARD_HEIGHT; j++)
- if((i-toX)*(i-toX) + (j-toY)*(j-toY) < 6) damage[0][j][i] = True;
+ if((i-toX)*(i-toX) + (j-toY)*(j-toY) < 6) damage[0][j][i] |= 1 + ((i-toX ^ j-toY) & 1);
}
/* Be sure end square is redrawn */
- damage[0][toY][toX] = True;
+ damage[0][toY][toX] |= True;
}
void
if (do_flash && piece != EmptySquare && appData.flashCount > 0) {
for (i=0; i<appData.flashCount; ++i) {
DrawOneSquare(x, y, piece, square_color, 0, string, 0);
- DrawExpose(NULL, x, y, squareSize, squareSize);
+ GraphExpose(currBoard, x, y, squareSize, squareSize);
FlashDelay(flash_delay);
DrawOneSquare(x, y, EmptySquare, square_color, 0, string, 0);
- DrawExpose(NULL, x, y, squareSize, squareSize);
+ GraphExpose(currBoard, x, y, squareSize, squareSize);
FlashDelay(flash_delay);
}
}
DrawDragPiece();
if(exposeAll)
- DrawExpose(NULL, 0, 0, BOARD_WIDTH*(squareSize + lineGap) + lineGap, BOARD_HEIGHT*(squareSize + lineGap) + lineGap);
+ GraphExpose(currBoard, 0, 0, BOARD_WIDTH*(squareSize + lineGap) + lineGap, BOARD_HEIGHT*(squareSize + lineGap) + lineGap);
else {
for (i = 0; i < BOARD_HEIGHT; i++)
for (j = 0; j < BOARD_WIDTH; j++)
(squareSize + lineGap);
}
if(damage[nr][i][j] & 2) // damage by old or new arrow
- DrawExpose(NULL, x - lineGap, y - lineGap, squareSize + 2*lineGap, squareSize + 2*lineGap);
+ GraphExpose(currBoard, x - lineGap, y - lineGap, squareSize + 2*lineGap, squareSize + 2*lineGap);
else
- DrawExpose(NULL, x, y, squareSize, squareSize);
+ GraphExpose(currBoard, x, y, squareSize, squareSize);
damage[nr][i][j] &= ~2; // remember damage by newly drawn error in '2' bit, to schedule it for erasure next draw
}
}