mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
Indicate tiles whose values should be hidden with a new bit rather
than a negative value.
This commit is contained in:
parent
6453f49e67
commit
3e749c898c
3 changed files with 11 additions and 11 deletions
|
@ -482,12 +482,15 @@ drawDragTileIf( BoardCtxt* board )
|
||||||
dragDropTileInfo( board, &tile, &isBlank );
|
dragDropTileInfo( board, &tile, &isBlank );
|
||||||
|
|
||||||
face = getTileDrawInfo( board, tile, isBlank, &bitmap,
|
face = getTileDrawInfo( board, tile, isBlank, &bitmap,
|
||||||
&value, buf, sizeof(buf) );
|
&value, buf, sizeof(buf) );
|
||||||
|
|
||||||
flags = CELL_DRAGCUR;
|
flags = CELL_DRAGCUR;
|
||||||
if ( isBlank ) {
|
if ( isBlank ) {
|
||||||
flags |= CELL_ISBLANK;
|
flags |= CELL_ISBLANK;
|
||||||
}
|
}
|
||||||
|
if ( board->hideValsInTray && !board->showCellValues ) {
|
||||||
|
flags |= CELL_VALHIDDEN;
|
||||||
|
}
|
||||||
draw_drawTileMidDrag( board->draw, &rect, face, bitmap, value,
|
draw_drawTileMidDrag( board->draw, &rect, face, bitmap, value,
|
||||||
board->selPlayer, flags );
|
board->selPlayer, flags );
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,9 @@ typedef enum {
|
||||||
, CELL_ISSTAR = 0x04
|
, CELL_ISSTAR = 0x04
|
||||||
, CELL_ISCURSOR = 0x08
|
, CELL_ISCURSOR = 0x08
|
||||||
, CELL_ISEMPTY = 0x10 /* of a tray tile slot */
|
, CELL_ISEMPTY = 0x10 /* of a tray tile slot */
|
||||||
, CELL_DRAGSRC = 0x20 /* where drag originated */
|
, CELL_VALHIDDEN = 0x20 /* show letter only, not value */
|
||||||
, CELL_DRAGCUR = 0x40 /* where drag is now */
|
, CELL_DRAGSRC = 0x40 /* where drag originated */
|
||||||
|
, CELL_DRAGCUR = 0x80 /* where drag is now */
|
||||||
, CELL_ALL = 0xFF
|
, CELL_ALL = 0xFF
|
||||||
} CellFlags;
|
} CellFlags;
|
||||||
|
|
||||||
|
|
|
@ -160,13 +160,15 @@ drawTray( BoardCtxt* board )
|
||||||
XP_U16 numInTray = countTilesToShow( board );
|
XP_U16 numInTray = countTilesToShow( board );
|
||||||
XP_Bool isBlank;
|
XP_Bool isBlank;
|
||||||
XP_Bool isADrag = dragDropInProgress( board );
|
XP_Bool isADrag = dragDropInProgress( board );
|
||||||
|
CellFlags baseFlags = board->hideValsInTray && !board->showCellValues
|
||||||
|
? CELL_VALHIDDEN : CELL_NONE;
|
||||||
|
|
||||||
dragDropGetTrayChanges( board, &ddRmvdIndx, &ddAddedIndx );
|
dragDropGetTrayChanges( board, &ddRmvdIndx, &ddAddedIndx );
|
||||||
|
|
||||||
/* draw in reverse order so drawing happens after
|
/* draw in reverse order so drawing happens after
|
||||||
erasing */
|
erasing */
|
||||||
for ( ii = MAX_TRAY_TILES - 1; ii >= 0; --ii ) {
|
for ( ii = MAX_TRAY_TILES - 1; ii >= 0; --ii ) {
|
||||||
CellFlags flags = CELL_NONE;
|
CellFlags flags = baseFlags;
|
||||||
XP_U16 mask = 1 << ii;
|
XP_U16 mask = 1 << ii;
|
||||||
|
|
||||||
if ( (board->trayInvalBits & mask) == 0 ) {
|
if ( (board->trayInvalBits & mask) == 0 ) {
|
||||||
|
@ -210,11 +212,6 @@ drawTray( BoardCtxt* board )
|
||||||
textP = getTileDrawInfo( board, tile, isBlank,
|
textP = getTileDrawInfo( board, tile, isBlank,
|
||||||
&bitmap, &value,
|
&bitmap, &value,
|
||||||
buf, sizeof(buf) );
|
buf, sizeof(buf) );
|
||||||
if ( board->hideValsInTray
|
|
||||||
&& !board->showCellValues ) {
|
|
||||||
value = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( isADrag ) {
|
if ( isADrag ) {
|
||||||
if ( ddAddedIndx == ii ) {
|
if ( ddAddedIndx == ii ) {
|
||||||
flags |= CELL_HIGHLIGHT;
|
flags |= CELL_HIGHLIGHT;
|
||||||
|
@ -229,8 +226,7 @@ drawTray( BoardCtxt* board )
|
||||||
draw_drawTile( board->draw, &tileRect, textP,
|
draw_drawTile( board->draw, &tileRect, textP,
|
||||||
bitmap, value, flags );
|
bitmap, value, flags );
|
||||||
} else {
|
} else {
|
||||||
draw_drawTileBack( board->draw, &tileRect,
|
draw_drawTileBack( board->draw, &tileRect, flags );
|
||||||
flags );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue