mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
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:
parent
458b904280
commit
1fa8b2e48f
5 changed files with 21 additions and 19 deletions
|
@ -151,8 +151,7 @@ typedef struct DrawCtxVTable {
|
||||||
XP_U16 playerNum,
|
XP_U16 playerNum,
|
||||||
CellFlags flags );
|
CellFlags flags );
|
||||||
|
|
||||||
void DRAW_VTABLE_NAME(drawTimer) ( DrawCtx* dctx, const XP_Rect* rInner,
|
void DRAW_VTABLE_NAME(drawTimer) ( DrawCtx* dctx, const XP_Rect* rect,
|
||||||
const XP_Rect* rOuter,
|
|
||||||
XP_U16 player, XP_S16 secondsLeft );
|
XP_U16 player, XP_S16 secondsLeft );
|
||||||
|
|
||||||
XP_Bool DRAW_VTABLE_NAME(drawCell) ( DrawCtx* dctx, const XP_Rect* rect,
|
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))
|
CALL_DRAW_NAME3(score_drawPlayer,(dc),(ri),(ro),(dsi))
|
||||||
#define draw_score_pendingScore(dc, r, s, p, f ) \
|
#define draw_score_pendingScore(dc, r, s, p, f ) \
|
||||||
CALL_DRAW_NAME4(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 ) \
|
#define draw_drawTimer( dc, r, plyr, sec ) \
|
||||||
CALL_DRAW_NAME4(drawTimer,(dc),(ri),(ro),(plyr),(sec))
|
CALL_DRAW_NAME3(drawTimer,(dc),(r),(plyr),(sec))
|
||||||
#define draw_drawCell( dc, rect, txt, bmap, t, o, bon, hi, f ) \
|
#define draw_drawCell( dc, rect, txt, bmap, t, o, bon, hi, f ) \
|
||||||
CALL_DRAW_NAME8(drawCell,(dc),(rect),(txt),(bmap),(t),(o),(bon),(hi),\
|
CALL_DRAW_NAME8(drawCell,(dc),(rect),(txt),(bmap),(t),(o),(bon),(hi),\
|
||||||
(f))
|
(f))
|
||||||
|
|
|
@ -249,7 +249,7 @@ drawTimer( BoardCtxt* board )
|
||||||
if ( board->gi->timerEnabled ) {
|
if ( board->gi->timerEnabled ) {
|
||||||
XP_S16 secondsLeft = figureSecondsLeft( board );
|
XP_S16 secondsLeft = figureSecondsLeft( board );
|
||||||
|
|
||||||
draw_drawTimer( board->draw, &board->timerBounds, &board->timerBounds,
|
draw_drawTimer( board->draw, &board->timerBounds,
|
||||||
board->selPlayer, secondsLeft );
|
board->selPlayer, secondsLeft );
|
||||||
}
|
}
|
||||||
} /* drawTimer */
|
} /* drawTimer */
|
||||||
|
|
|
@ -1004,7 +1004,6 @@ gtkFormatTimerText( XP_UCHAR* buf, XP_U16 bufLen, XP_S16 secondsLeft )
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rInner,
|
gtk_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rInner,
|
||||||
const XP_Rect* XP_UNUSED(rOuter),
|
|
||||||
XP_U16 XP_UNUSED(player), XP_S16 secondsLeft )
|
XP_U16 XP_UNUSED(player), XP_S16 secondsLeft )
|
||||||
{
|
{
|
||||||
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx;
|
||||||
|
|
|
@ -1283,8 +1283,7 @@ palmFormatTimerText( XP_UCHAR* buf, XP_S16 secondsLeft )
|
||||||
} /* palmFormatTimerText */
|
} /* palmFormatTimerText */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
palm_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rInner,
|
palm_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||||
const XP_Rect* XP_UNUSED(rOuter),
|
|
||||||
XP_U16 XP_UNUSED(player), XP_S16 secondsLeft )
|
XP_U16 XP_UNUSED(player), XP_S16 secondsLeft )
|
||||||
{
|
{
|
||||||
/* This is called both from within drawScoreboard and not, meaning that
|
/* 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;
|
PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx;
|
||||||
XP_UCHAR buf[10];
|
XP_UCHAR buf[10];
|
||||||
XP_Rect localR = *rInner;
|
XP_Rect localR = *rect;
|
||||||
RectangleType saveClip;
|
RectangleType saveClip;
|
||||||
XP_U16 len, width, y;
|
XP_U16 len, width, y;
|
||||||
|
|
||||||
|
|
|
@ -1479,13 +1479,14 @@ ceFormatScoreText( CEDrawCtx* dctx, const DrawScoreInfo* dsi, XP_U16 nameLen )
|
||||||
{
|
{
|
||||||
XP_UCHAR optPart[16];
|
XP_UCHAR optPart[16];
|
||||||
XP_UCHAR name[nameLen+1+1];
|
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
|
* For a vertical, it's
|
||||||
*
|
*
|
||||||
* [name]
|
* [name]
|
||||||
* 300
|
* 300
|
||||||
* 6
|
* [6]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while ( nameLen >= 1 ) {
|
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 */
|
if ( name[nameLen-1] == ' ' ) { /* don't end with space */
|
||||||
--nameLen;
|
--nameLen;
|
||||||
} else {
|
} else {
|
||||||
XP_STRCAT( name, dctx->scoreIsVertical? XP_CR : " " );
|
XP_STRCAT( name, div );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1502,8 +1503,7 @@ ceFormatScoreText( CEDrawCtx* dctx, const DrawScoreInfo* dsi, XP_U16 nameLen )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( dsi->nTilesLeft >= 0 ) {
|
if ( dsi->nTilesLeft >= 0 ) {
|
||||||
sprintf( optPart, "%s%d", dctx->scoreIsVertical? XP_CR : ":",
|
sprintf( optPart, "%s%d", div, dsi->nTilesLeft );
|
||||||
dsi->nTilesLeft );
|
|
||||||
} else {
|
} else {
|
||||||
optPart[0] = '\0';
|
optPart[0] = '\0';
|
||||||
}
|
}
|
||||||
|
@ -1659,8 +1659,7 @@ DRAW_FUNC_NAME(score_pendingScore)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
||||||
} /* ce_draw_score_pendingScore */
|
} /* ce_draw_score_pendingScore */
|
||||||
|
|
||||||
DLSTATIC void
|
DLSTATIC void
|
||||||
DRAW_FUNC_NAME(drawTimer)( DrawCtx* p_dctx, const XP_Rect* rInner,
|
DRAW_FUNC_NAME(drawTimer)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
||||||
const XP_Rect* XP_UNUSED(rOuter),
|
|
||||||
XP_U16 player, XP_S16 secondsLeft )
|
XP_U16 player, XP_S16 secondsLeft )
|
||||||
{
|
{
|
||||||
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
|
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 );
|
fce = ceGetSizedFont( dctx, 0, 0, RFONTS_SCORE );
|
||||||
|
|
||||||
XPRtoRECT( &rt, rInner );
|
XPRtoRECT( &rt, xprect );
|
||||||
|
|
||||||
isNegative = secondsLeft < 0;
|
isNegative = secondsLeft < 0;
|
||||||
if ( isNegative ) {
|
if ( isNegative ) {
|
||||||
|
@ -1699,10 +1698,16 @@ DRAW_FUNC_NAME(drawTimer)( DrawCtx* p_dctx, const XP_Rect* rInner,
|
||||||
|
|
||||||
ceSetTextColor( hdc, dctx, getPlayerColor(player) );
|
ceSetTextColor( hdc, dctx, getPlayerColor(player) );
|
||||||
ceSetBkColor( hdc, dctx, CE_BKG_COLOR );
|
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 );
|
oldFont = SelectObject( hdc, fce->setFont );
|
||||||
++rt.top;
|
|
||||||
ceDrawLinesClipped( hdc, fce, buf, CP_ACP, XP_TRUE, &rt );
|
ceDrawLinesClipped( hdc, fce, buf, CP_ACP, XP_TRUE, &rt );
|
||||||
SelectObject( hdc, oldFont );
|
SelectObject( hdc, oldFont );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue