mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
use alpha to dim pending score rather than mucking with the rgb values
This commit is contained in:
parent
9d40930fff
commit
c32df1a487
1 changed files with 2 additions and 14 deletions
|
@ -50,6 +50,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
||||||
|
|
||||||
private static Bitmap s_bitmap; // the board
|
private static Bitmap s_bitmap; // the board
|
||||||
private static final int IN_TRADE_ALPHA = 0x3FFFFFFF;
|
private static final int IN_TRADE_ALPHA = 0x3FFFFFFF;
|
||||||
|
private static final int NOT_TURN_ALPHA = 0x3FFFFFFF;
|
||||||
private static final int PINCH_THRESHOLD = 40;
|
private static final int PINCH_THRESHOLD = 40;
|
||||||
private static final int SCORE_HT_DROP = 2;
|
private static final int SCORE_HT_DROP = 2;
|
||||||
private static final boolean DEBUG_DRAWFRAMES = false;
|
private static final boolean DEBUG_DRAWFRAMES = false;
|
||||||
|
@ -898,7 +899,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
||||||
|
|
||||||
int playerColor = m_playerColors[playerNum];
|
int playerColor = m_playerColors[playerNum];
|
||||||
if ( playerNum != curTurn ) {
|
if ( playerNum != curTurn ) {
|
||||||
playerColor = dimColor( playerColor );
|
playerColor &= NOT_TURN_ALPHA;
|
||||||
}
|
}
|
||||||
m_fillPaint.setColor( playerColor );
|
m_fillPaint.setColor( playerColor );
|
||||||
|
|
||||||
|
@ -1263,17 +1264,4 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
||||||
return zoomDir;
|
return zoomDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int dimColor( int playerColor )
|
|
||||||
{
|
|
||||||
int newColor = 0;
|
|
||||||
for ( int ii = 0; ii < 4; ++ii ) {
|
|
||||||
int byt = (playerColor >> 24) & 0xFF;
|
|
||||||
playerColor <<= 8;
|
|
||||||
byt += (0xFF - byt) / 2;
|
|
||||||
newColor <<= 8;
|
|
||||||
newColor |= byt;
|
|
||||||
}
|
|
||||||
return newColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue