remove unused param (not even compiled on Palm); on wince, try to

duplicate for timer the vertical offset used for scores.
This commit is contained in:
ehouse 2009-10-16 03:20:39 +00:00
parent 458b904280
commit 1fa8b2e48f
5 changed files with 21 additions and 19 deletions

View file

@ -151,8 +151,7 @@ typedef struct DrawCtxVTable {
XP_U16 playerNum,
CellFlags flags );
void DRAW_VTABLE_NAME(drawTimer) ( DrawCtx* dctx, const XP_Rect* rInner,
const XP_Rect* rOuter,
void DRAW_VTABLE_NAME(drawTimer) ( DrawCtx* dctx, const XP_Rect* rect,
XP_U16 player, XP_S16 secondsLeft );
XP_Bool DRAW_VTABLE_NAME(drawCell) ( DrawCtx* dctx, const XP_Rect* rect,
@ -265,8 +264,8 @@ struct DrawCtx {
CALL_DRAW_NAME3(score_drawPlayer,(dc),(ri),(ro),(dsi))
#define draw_score_pendingScore(dc, r, s, p, f ) \
CALL_DRAW_NAME4(score_pendingScore,(dc), (r), (s), (p), (f))
#define draw_drawTimer( dc, ri, ro, plyr, sec ) \
CALL_DRAW_NAME4(drawTimer,(dc),(ri),(ro),(plyr),(sec))
#define draw_drawTimer( dc, r, plyr, sec ) \
CALL_DRAW_NAME3(drawTimer,(dc),(r),(plyr),(sec))
#define draw_drawCell( dc, rect, txt, bmap, t, o, bon, hi, f ) \
CALL_DRAW_NAME8(drawCell,(dc),(rect),(txt),(bmap),(t),(o),(bon),(hi),\
(f))

View file

@ -249,7 +249,7 @@ drawTimer( BoardCtxt* board )
if ( board->gi->timerEnabled ) {
XP_S16 secondsLeft = figureSecondsLeft( board );
draw_drawTimer( board->draw, &board->timerBounds, &board->timerBounds,
draw_drawTimer( board->draw, &board->timerBounds,
board->selPlayer, secondsLeft );
}
} /* drawTimer */

View file

@ -1004,7 +1004,6 @@ gtkFormatTimerText( XP_UCHAR* buf, XP_U16 bufLen, XP_S16 secondsLeft )
static void
gtk_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rInner,
const XP_Rect* XP_UNUSED(rOuter),
XP_U16 XP_UNUSED(player), XP_S16 secondsLeft )
{
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;

View file

@ -1283,8 +1283,7 @@ palmFormatTimerText( XP_UCHAR* buf, XP_S16 secondsLeft )
} /* palmFormatTimerText */
static void
palm_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rInner,
const XP_Rect* XP_UNUSED(rOuter),
palm_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rect,
XP_U16 XP_UNUSED(player), XP_S16 secondsLeft )
{
/* This is called both from within drawScoreboard and not, meaning that
@ -1293,7 +1292,7 @@ palm_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rInner,
*/
PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx;
XP_UCHAR buf[10];
XP_Rect localR = *rInner;
XP_Rect localR = *rect;
RectangleType saveClip;
XP_U16 len, width, y;

View file

@ -1479,13 +1479,14 @@ ceFormatScoreText( CEDrawCtx* dctx, const DrawScoreInfo* dsi, XP_U16 nameLen )
{
XP_UCHAR optPart[16];
XP_UCHAR name[nameLen+1+1];
const XP_UCHAR* div = dctx->scoreIsVertical? XP_CR : ":";
/* For a horizontal scoreboard, we want [name ]300:6
/* For a horizontal scoreboard, we want [name:]300[:6]
* For a vertical, it's
*
* [name]
* 300
* 6
* [6]
*/
while ( nameLen >= 1 ) {
@ -1493,7 +1494,7 @@ ceFormatScoreText( CEDrawCtx* dctx, const DrawScoreInfo* dsi, XP_U16 nameLen )
if ( name[nameLen-1] == ' ' ) { /* don't end with space */
--nameLen;
} else {
XP_STRCAT( name, dctx->scoreIsVertical? XP_CR : " " );
XP_STRCAT( name, div );
break;
}
}
@ -1502,8 +1503,7 @@ ceFormatScoreText( CEDrawCtx* dctx, const DrawScoreInfo* dsi, XP_U16 nameLen )
}
if ( dsi->nTilesLeft >= 0 ) {
sprintf( optPart, "%s%d", dctx->scoreIsVertical? XP_CR : ":",
dsi->nTilesLeft );
sprintf( optPart, "%s%d", div, dsi->nTilesLeft );
} else {
optPart[0] = '\0';
}
@ -1659,8 +1659,7 @@ DRAW_FUNC_NAME(score_pendingScore)( DrawCtx* p_dctx, const XP_Rect* xprect,
} /* ce_draw_score_pendingScore */
DLSTATIC void
DRAW_FUNC_NAME(drawTimer)( DrawCtx* p_dctx, const XP_Rect* rInner,
const XP_Rect* XP_UNUSED(rOuter),
DRAW_FUNC_NAME(drawTimer)( DrawCtx* p_dctx, const XP_Rect* xprect,
XP_U16 player, XP_S16 secondsLeft )
{
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
@ -1676,7 +1675,7 @@ DRAW_FUNC_NAME(drawTimer)( DrawCtx* p_dctx, const XP_Rect* rInner,
fce = ceGetSizedFont( dctx, 0, 0, RFONTS_SCORE );
XPRtoRECT( &rt, rInner );
XPRtoRECT( &rt, xprect );
isNegative = secondsLeft < 0;
if ( isNegative ) {
@ -1699,10 +1698,16 @@ DRAW_FUNC_NAME(drawTimer)( DrawCtx* p_dctx, const XP_Rect* rInner,
ceSetTextColor( hdc, dctx, getPlayerColor(player) );
ceSetBkColor( hdc, dctx, CE_BKG_COLOR );
ceClearToBkground( dctx, rInner );
ceClearToBkground( dctx, xprect );
/* distribute any extra space */
XP_U16 width, height;
ceMeasureText( dctx, hdc, fce, buf, 0, &width, &height );
XP_S16 diff = (xprect->height - height) / 2;
rt.top += diff;
rt.bottom -= diff;
oldFont = SelectObject( hdc, fce->setFont );
++rt.top;
ceDrawLinesClipped( hdc, fce, buf, CP_ACP, XP_TRUE, &rt );
SelectObject( hdc, oldFont );