mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
change trayCursorLoc to be a 3-bit number so stores smaller
This commit is contained in:
parent
974bf14ec4
commit
66eeeae7d6
1 changed files with 7 additions and 6 deletions
|
@ -174,7 +174,7 @@ drawTray( BoardCtxt* board, XP_Bool focussed )
|
||||||
|
|
||||||
#ifdef KEYBOARD_NAV
|
#ifdef KEYBOARD_NAV
|
||||||
if ( showFaces ) {
|
if ( showFaces ) {
|
||||||
TileBit cursorLoc = board->trayCursorLoc[turn];
|
TileBit cursorLoc = 1 << board->trayCursorLoc[turn];
|
||||||
if ( !!cursorLoc ) {
|
if ( !!cursorLoc ) {
|
||||||
XP_U16 index = indexForBits( cursorLoc );
|
XP_U16 index = indexForBits( cursorLoc );
|
||||||
figureTrayTileRect( board, index, &tileRect );
|
figureTrayTileRect( board, index, &tileRect );
|
||||||
|
@ -639,7 +639,7 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey )
|
||||||
selPlayer );
|
selPlayer );
|
||||||
XP_U16 pos;
|
XP_U16 pos;
|
||||||
TileBit newSel;
|
TileBit newSel;
|
||||||
TileBit oldSel = board->trayCursorLoc[selPlayer];
|
TileBit oldSel = 1 << board->trayCursorLoc[selPlayer];
|
||||||
|
|
||||||
numTrayTiles = MAX_TRAY_TILES;
|
numTrayTiles = MAX_TRAY_TILES;
|
||||||
|
|
||||||
|
@ -657,9 +657,10 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey )
|
||||||
++pos;
|
++pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
newSel = 1 << (pos % numTrayTiles);
|
pos %= numTrayTiles;
|
||||||
|
board->trayCursorLoc[selPlayer] = pos;
|
||||||
|
newSel = 1 << pos;
|
||||||
|
|
||||||
board->trayCursorLoc[selPlayer] = newSel;
|
|
||||||
board_invalTrayTiles( board, newSel | oldSel );
|
board_invalTrayTiles( board, newSel | oldSel );
|
||||||
result = XP_TRUE;
|
result = XP_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -670,7 +671,7 @@ tray_moveCursor( BoardCtxt* board, XP_Key cursorKey )
|
||||||
XP_Bool
|
XP_Bool
|
||||||
tray_keyAction( BoardCtxt* board )
|
tray_keyAction( BoardCtxt* board )
|
||||||
{
|
{
|
||||||
TileBit cursor = board->trayCursorLoc[board->selPlayer];
|
TileBit cursor = 1 << board->trayCursorLoc[board->selPlayer];
|
||||||
XP_Bool result;
|
XP_Bool result;
|
||||||
if ( !!cursor ) {
|
if ( !!cursor ) {
|
||||||
XP_S16 index = trayLocToIndex( board, indexForBits( cursor ) );
|
XP_S16 index = trayLocToIndex( board, indexForBits( cursor ) );
|
||||||
|
|
Loading…
Add table
Reference in a new issue