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 1dd8363c3f
commit 4529e564e4
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_SNPRINTF( ch, sizeof(ch), (XP_UCHAR*)"%d", val );
textP = ch;
} else if ( dict_faceIsBitmap( dict, tile ) ) {
bitmap = dict_getFaceBitmap( dict, tile, XP_FALSE );
XP_ASSERT( !!bitmap );
} 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) );
textP = ch;
}

View file

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