debug macros and wierd rewrite of code using random and mod. This makes it work on ce!

This commit is contained in:
ehouse 2006-01-31 06:42:53 +00:00
parent 323240fa6b
commit 502cddcf1f
2 changed files with 8 additions and 4 deletions

View file

@ -137,4 +137,8 @@ typedef struct CommonPrefs {
#endif
#define LOG_FUNC() XP_LOGF( "IN: %s", __FUNCTION__ )
#define LOG_RETURNF(fmt,val) XP_LOGF( "%s => " fmt, __FUNCTION__, val )
#define LOG_RETURN_VOID() LOG_RETURNF("%s","void")
#endif

View file

@ -131,10 +131,10 @@ getRandomTile( PoolContext* pool )
* in that case if move to shuffling once and just taking tiles off the
* top thereafter.
*/
XP_U16 index = (XP_U16)(XP_RANDOM() % pool->numTilesLeft);
Tile result;
result = getNthPoolTile( pool, index );
XP_U16 r = (XP_U16)XP_RANDOM();
XP_U16 index = (XP_U16)(r % pool->numTilesLeft);
Tile result = getNthPoolTile( pool, index );
--pool->lettersLeft[result];
--pool->numTilesLeft;