Pass string for tile even when it has a bitmap. Let platform decide which to use.

This commit is contained in:
ehouse 2008-12-04 06:13:59 +00:00
parent 088ab1451e
commit d3d3dd561f
2 changed files with 10 additions and 7 deletions

View file

@ -383,10 +383,11 @@ drawCell( BoardCtxt* board, XP_U16 col, XP_U16 row, XP_Bool skipBlanks )
XP_U16 val = dict_getTileValue( dict, valTile ); XP_U16 val = dict_getTileValue( dict, valTile );
XP_SNPRINTF( ch, sizeof(ch), (XP_UCHAR*)"%d", val ); XP_SNPRINTF( ch, sizeof(ch), (XP_UCHAR*)"%d", val );
textP = ch; textP = ch;
} else if ( dict_faceIsBitmap( dict, tile ) ) {
bitmap = dict_getFaceBitmap( dict, tile, XP_FALSE );
XP_ASSERT( !!bitmap );
} else { } else {
if ( dict_faceIsBitmap( dict, tile ) ) {
bitmap = dict_getFaceBitmap( dict, tile, XP_FALSE );
XP_ASSERT( !!bitmap );
}
(void)dict_tilesToString( dict, &tile, 1, ch, sizeof(ch) ); (void)dict_tilesToString( dict, &tile, 1, ch, sizeof(ch) );
textP = ch; textP = ch;
} }

View file

@ -268,14 +268,16 @@ getTileDrawInfo( const BoardCtxt* board, Tile tile, XP_Bool isBlank,
DictionaryCtxt* dict = model_getDictionary( board->model ); DictionaryCtxt* dict = model_getDictionary( board->model );
if ( isBlank ) { if ( isBlank ) {
tile = dict_getBlankTile( dict ); tile = dict_getBlankTile( dict );
}
*value = dict_getTileValue( dict, tile );
if ( dict_faceIsBitmap( dict, tile ) ) {
*bitmap = dict_getFaceBitmap( dict, tile, XP_TRUE );
} else { } else {
dict_tilesToString( dict, &tile, 1, buf, len ); dict_tilesToString( dict, &tile, 1, buf, len );
face = buf; face = buf;
} }
*value = dict_getTileValue( dict, tile );
if ( dict_faceIsBitmap( dict, tile ) ) {
*bitmap = dict_getFaceBitmap( dict, tile, XP_TRUE );
}
return face; return face;
} }