Pass scores and remaining tiles count to draw_scoreBegin so can

determine font size based on max length.   API change.
This commit is contained in:
ehouse 2009-11-18 13:24:56 +00:00
parent e9287fcbbf
commit 3eadd93aa6
2 changed files with 16 additions and 13 deletions

View file

@ -135,7 +135,9 @@ typedef struct DrawCtxVTable {
XP_S16 nTilesLeft, XP_Bool focussed );
void DRAW_VTABLE_NAME(scoreBegin) ( DrawCtx* dctx, const XP_Rect* rect,
XP_U16 numPlayers, DrawFocusState dfs );
XP_U16 numPlayers,
const XP_S16* const scores,
XP_S16 remCount, DrawFocusState dfs );
void DRAW_VTABLE_NAME(measureScoreText) ( DrawCtx* dctx,
const XP_Rect* r,
const DrawScoreInfo* dsi,
@ -252,8 +254,8 @@ struct DrawCtx {
#define draw_trayBegin( dc, r, o, f ) CALL_DRAW_NAME3(trayBegin,dc, r, o, f)
#define draw_vertScrollBoard( dc, r, d, f ) \
CALL_DRAW_NAME3(vertScrollBoard, (dc),(r),(d),(f))
#define draw_scoreBegin( dc, r, t, f ) \
CALL_DRAW_NAME3( scoreBegin,(dc), (r), (t), (f))
#define draw_scoreBegin( dc, r, t, s, c, f ) \
CALL_DRAW_NAME5( scoreBegin,(dc), (r), (t), (s), (c), (f))
#define draw_measureRemText( dc, r, n, wp, hp ) \
CALL_DRAW_NAME4(measureRemText, (dc), (r), (n), (wp), (hp) )
#define draw_drawRemText( dc, ri, ro, n, f ) \

View file

@ -93,7 +93,18 @@ drawScoreBoard( BoardCtxt* board )
}
}
#endif
/* Get the scores from the model or by calculating them based on
the end-of-game state. */
if ( board->gameOver ) {
model_figureFinalScores( model, &scores, NULL );
} else {
for ( ii = 0; ii < nPlayers; ++ii ) {
scores.arr[ii] = model_getPlayerScore( model, ii );
}
}
draw_scoreBegin( board->draw, &board->scoreBdBounds, nPlayers,
scores.arr, nTilesInPool,
dfsFor( board, OBJ_SCORE ) );
/* Let platform decide whether the rem: string should be given any
@ -114,16 +125,6 @@ drawScoreBoard( BoardCtxt* board )
}
*adjustDim -= remDim;
/* Get the scores from the model or by calculating them based on
the end-of-game state. */
if ( board->gameOver ) {
model_figureFinalScores( model, &scores, NULL );
} else {
for ( ii = 0; ii < nPlayers; ++ii ) {
scores.arr[ii] = model_getPlayerScore( model, ii );
}
}
totalDim = remDim;
/* Give as much room as possible to the entry for the player whose