include any mid-drag tile, if it's a blank, in the set of blank tiles

rendered in the second pass.  Mid-drag tiles were not being rendered
if they happened to be blanks.
This commit is contained in:
eehouse 2010-03-08 06:10:37 +00:00
parent 815a5f85b0
commit ec24df8546
3 changed files with 15 additions and 0 deletions

View file

@ -251,6 +251,7 @@ drawBoard( BoardCtxt* board )
somebody dirties a single cell? */
model_listPlacedBlanks( model, board->selPlayer,
board->trayVisState == TRAY_REVEALED, &bq );
dragDropAppendBlank( board, &bq );
invalBlanksWithNeighbors( board, &bq );
/* figure out now, before clearing inval bits, if we'll need to draw

View file

@ -336,6 +336,19 @@ dragDropIsBeingDragged( const BoardCtxt* board, XP_U16 col, XP_U16 row,
return result;
}
void
dragDropAppendBlank( const BoardCtxt* board, BlankQueue* bqp )
{
const DragState* ds = &board->dragState;
if ( ds->dtype == DT_TILE && ds->cur.obj == OBJ_BOARD ) {
if ( ds->isBlank ) {
bqp->col[bqp->nBlanks] = ds->cur.u.board.col;
bqp->row[bqp->nBlanks] = ds->cur.u.board.row;
++bqp->nBlanks;
}
}
}
void
dragDropGetTrayChanges( const BoardCtxt* board, XP_U16* rmvdIndx,
XP_U16* addedIndx )

View file

@ -41,6 +41,7 @@ XP_Bool dragDropSetAdd( BoardCtxt* board );
XP_Bool dragDropGetBoardTile( const BoardCtxt* board, XP_U16* col, XP_U16* row );
XP_Bool dragDropIsBeingDragged( const BoardCtxt* board, XP_U16 col, XP_U16 row,
XP_Bool* isOrigin );
void dragDropAppendBlank( const BoardCtxt* board, BlankQueue* bq );
/* return locations (0-based indices from left) in tray where a drag has added
* and removed a tile. Index larger than MAX_TRAY_TILES means invalid: don't