mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
remove dead param; fix inval and choice of inverted cells so recent
move is not shown when pending move is.
This commit is contained in:
parent
4065cdc1ed
commit
906e0c0b0f
1 changed files with 13 additions and 7 deletions
|
@ -374,7 +374,7 @@ board_prefsChanged( BoardCtxt* board, CommonPrefs* cp )
|
||||||
} /* board_prefsChanged */
|
} /* board_prefsChanged */
|
||||||
|
|
||||||
XP_Bool
|
XP_Bool
|
||||||
board_setYOffset( BoardCtxt* board, XP_U16 offset, XP_Bool invalRevealed )
|
board_setYOffset( BoardCtxt* board, XP_U16 offset )
|
||||||
{
|
{
|
||||||
XP_U16 oldOffset = board->yOffset;
|
XP_U16 oldOffset = board->yOffset;
|
||||||
XP_Bool result = oldOffset != offset;
|
XP_Bool result = oldOffset != offset;
|
||||||
|
@ -1389,6 +1389,8 @@ setTrayVisState( BoardCtxt* board, XW_TrayVisState newState )
|
||||||
change */
|
change */
|
||||||
model_foreachPendingCell( board->model, selPlayer,
|
model_foreachPendingCell( board->model, selPlayer,
|
||||||
boardCellChanged, board );
|
boardCellChanged, board );
|
||||||
|
/* ditto -- if there's a pending move */
|
||||||
|
model_foreachPrevCell( board->model, boardCellChanged, board );
|
||||||
|
|
||||||
board_invalTrayTiles( board, ALLTILES );
|
board_invalTrayTiles( board, ALLTILES );
|
||||||
board->dividerInvalid = XP_TRUE;
|
board->dividerInvalid = XP_TRUE;
|
||||||
|
@ -1600,13 +1602,19 @@ drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
|
||||||
XP_Rect cellRect;
|
XP_Rect cellRect;
|
||||||
Tile tile;
|
Tile tile;
|
||||||
XP_UCHAR ch[4];
|
XP_UCHAR ch[4];
|
||||||
XP_Bool isBlank, isEmpty, showPending, recent, pending = XP_FALSE;
|
XP_Bool isBlank, isEmpty, recent, pending = XP_FALSE;
|
||||||
XWBonusType bonus;
|
XWBonusType bonus;
|
||||||
ModelCtxt* model = board->model;
|
ModelCtxt* model = board->model;
|
||||||
DictionaryCtxt* dict = model_getDictionary( model );
|
DictionaryCtxt* dict = model_getDictionary( model );
|
||||||
XP_U16 selPlayer = board->selPlayer;
|
XP_U16 selPlayer = board->selPlayer;
|
||||||
XP_Bool showPrevMove =
|
/* We want to invert EITHER the current pending tiles OR the most recent
|
||||||
(0 == model_getCurrentMoveCount( model, selPlayer ));
|
* move. So if the tray is visible AND there are tiles missing from it,
|
||||||
|
* show them. Otherwise show the most recent move.
|
||||||
|
*/
|
||||||
|
XP_U16 curCount = model_getCurrentMoveCount( model, selPlayer );
|
||||||
|
XP_Bool showPending = board->trayVisState == TRAY_REVEALED
|
||||||
|
&& curCount > 0;
|
||||||
|
|
||||||
|
|
||||||
if ( dict != NULL && getCellRect( board, col, row, &cellRect ) ) {
|
if ( dict != NULL && getCellRect( board, col, row, &cellRect ) ) {
|
||||||
|
|
||||||
|
@ -1619,8 +1627,6 @@ drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
|
||||||
XP_UCHAR* textP = (XP_UCHAR*)ch;
|
XP_UCHAR* textP = (XP_UCHAR*)ch;
|
||||||
HintAtts hintAtts;
|
HintAtts hintAtts;
|
||||||
|
|
||||||
showPending = board->trayVisState == TRAY_REVEALED;
|
|
||||||
|
|
||||||
isEmpty = !model_getTile( model, col, row, showPending,
|
isEmpty = !model_getTile( model, col, row, showPending,
|
||||||
selPlayer, &tile, &isBlank,
|
selPlayer, &tile, &isBlank,
|
||||||
&pending, &recent );
|
&pending, &recent );
|
||||||
|
@ -1635,7 +1641,7 @@ drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
|
||||||
owner = (XP_S16)model_getCellOwner( model, col, row );
|
owner = (XP_S16)model_getCellOwner( model, col, row );
|
||||||
}
|
}
|
||||||
|
|
||||||
invert = pending || (showPrevMove && recent);
|
invert = showPending? pending : recent;
|
||||||
|
|
||||||
if ( board->showCellValues ) {
|
if ( board->showCellValues ) {
|
||||||
Tile valTile = isBlank? dict_getBlankTile( dict ) : tile;
|
Tile valTile = isBlank? dict_getBlankTile( dict ) : tile;
|
||||||
|
|
Loading…
Reference in a new issue