mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
Fix to compile and work with recent API changes. Still need to have
font caching in draw code work with the cellHt passed into draw_boardBegin rather than each cell's height since the latter can change now.
This commit is contained in:
parent
71110a195d
commit
377fc3c87a
4 changed files with 21 additions and 20 deletions
|
@ -240,7 +240,7 @@ dict_splitFaces( DictionaryCtxt* dict, const XP_U8* utf8,
|
||||||
XP_U16 nBytes, XP_U16 nFaces )
|
XP_U16 nBytes, XP_U16 nFaces )
|
||||||
{
|
{
|
||||||
XP_UCHAR* faces = XP_MALLOC( dict->mpool, nBytes + nFaces );
|
XP_UCHAR* faces = XP_MALLOC( dict->mpool, nBytes + nFaces );
|
||||||
XP_UCHAR** ptrs = XP_MALLOC( dict->mpool, nFaces * sizeof(ptrs[0]));
|
const XP_UCHAR** ptrs = XP_MALLOC( dict->mpool, nFaces * sizeof(ptrs[0]));
|
||||||
XP_U16 ii;
|
XP_U16 ii;
|
||||||
XP_UCHAR* next = faces;
|
XP_UCHAR* next = faces;
|
||||||
|
|
||||||
|
|
|
@ -1093,8 +1093,8 @@ ceGetCharValHts( const CEDrawCtx* dctx, const XP_Rect* xprect,
|
||||||
} /* ceGetCharValHts */
|
} /* ceGetCharValHts */
|
||||||
|
|
||||||
DLSTATIC XP_Bool
|
DLSTATIC XP_Bool
|
||||||
DRAW_FUNC_NAME(boardBegin)( DrawCtx* p_dctx,
|
DRAW_FUNC_NAME(boardBegin)( DrawCtx* p_dctx, const XP_Rect* XP_UNUSED(rect),
|
||||||
const XP_Rect* XP_UNUSED(rect),
|
XP_U16 XP_UNUSED(hScale), XP_U16 XP_UNUSED(vScale),
|
||||||
DrawFocusState dfs )
|
DrawFocusState dfs )
|
||||||
{
|
{
|
||||||
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
|
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
|
||||||
|
@ -1231,7 +1231,6 @@ DRAW_FUNC_NAME(drawCell)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
||||||
InsetRect( &rt, 1, 1 );
|
InsetRect( &rt, 1, 1 );
|
||||||
ceClipToRect( hdc, &rt );
|
ceClipToRect( hdc, &rt );
|
||||||
|
|
||||||
XP_ASSERT( xprect->height == globals->cellHt );
|
|
||||||
fce = ceGetSizedFont( dctx, RFONTS_CELL, xprect->height - CELL_BORDER,
|
fce = ceGetSizedFont( dctx, RFONTS_CELL, xprect->height - CELL_BORDER,
|
||||||
0, 0 );
|
0, 0 );
|
||||||
oldFont = SelectObject( hdc, fce->setFont );
|
oldFont = SelectObject( hdc, fce->setFont );
|
||||||
|
|
|
@ -109,8 +109,8 @@ static XP_Bool ce_util_askPassword( XW_UtilCtxt* uc, const XP_UCHAR* name,
|
||||||
static void ce_util_trayHiddenChange( XW_UtilCtxt* uc,
|
static void ce_util_trayHiddenChange( XW_UtilCtxt* uc,
|
||||||
XW_TrayVisState newState,
|
XW_TrayVisState newState,
|
||||||
XP_U16 nVisibleRows );
|
XP_U16 nVisibleRows );
|
||||||
static void ce_util_yOffsetChange( XW_UtilCtxt* uc, XP_U16 oldOffset,
|
static void ce_util_yOffsetChange( XW_UtilCtxt* uc, XP_U16 maxOffset,
|
||||||
XP_U16 newOffset );
|
XP_U16 oldOffset, XP_U16 newOffset );
|
||||||
static void ce_util_turnChanged( XW_UtilCtxt* uc );
|
static void ce_util_turnChanged( XW_UtilCtxt* uc );
|
||||||
static void ce_util_notifyGameOver( XW_UtilCtxt* uc );
|
static void ce_util_notifyGameOver( XW_UtilCtxt* uc );
|
||||||
static XP_Bool ce_util_hiliteCell( XW_UtilCtxt* uc, XP_U16 col,
|
static XP_Bool ce_util_hiliteCell( XW_UtilCtxt* uc, XP_U16 col,
|
||||||
|
@ -527,8 +527,8 @@ typedef struct CEBoardParms {
|
||||||
XP_U16 adjLeft;
|
XP_U16 adjLeft;
|
||||||
XP_U16 adjTop;
|
XP_U16 adjTop;
|
||||||
|
|
||||||
XP_U16 boardHScale;
|
XP_U16 boardWidth;
|
||||||
XP_U16 boardVScale;
|
XP_U16 boardHeight;
|
||||||
XP_U16 boardTop;
|
XP_U16 boardTop;
|
||||||
XP_U16 trayTop;
|
XP_U16 trayTop;
|
||||||
|
|
||||||
|
@ -704,8 +704,8 @@ figureBoardParms( CEAppGlobals* globals, const XP_U16 nRows,
|
||||||
bparms->scrnHeight = scrnHeight;
|
bparms->scrnHeight = scrnHeight;
|
||||||
bparms->adjLeft = adjLeft;
|
bparms->adjLeft = adjLeft;
|
||||||
bparms->adjTop = adjTop;
|
bparms->adjTop = adjTop;
|
||||||
bparms->boardHScale = hScale;
|
bparms->boardWidth = hScale * nRows;
|
||||||
bparms->boardVScale = vScale;
|
bparms->boardHeight = nVisibleRows * vScale;
|
||||||
bparms->boardTop = adjTop + (horiz? scoreHeight : 0);
|
bparms->boardTop = adjTop + (horiz? scoreHeight : 0);
|
||||||
bparms->trayTop = bparms->boardTop + (nVisibleRows * vScale) + 1;
|
bparms->trayTop = bparms->boardTop + (nVisibleRows * vScale) + 1;
|
||||||
bparms->trayHeight = trayHeight - 1;
|
bparms->trayHeight = trayHeight - 1;
|
||||||
|
@ -733,8 +733,7 @@ figureBoardParms( CEAppGlobals* globals, const XP_U16 nRows,
|
||||||
} /* figureBoardParms */
|
} /* figureBoardParms */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setOwnedRects( CEAppGlobals* globals, XP_U16 nRows,
|
setOwnedRects( CEAppGlobals* globals, const CEBoardParms* bparms )
|
||||||
const CEBoardParms* bparms )
|
|
||||||
{
|
{
|
||||||
RECT tmp;
|
RECT tmp;
|
||||||
XP_U16 scrollWidth = bparms->scrollWidth;
|
XP_U16 scrollWidth = bparms->scrollWidth;
|
||||||
|
@ -749,7 +748,7 @@ setOwnedRects( CEAppGlobals* globals, XP_U16 nRows,
|
||||||
XP_MEMCPY( &globals->ownedRects[OWNED_RECT_LEFT], &tmp,
|
XP_MEMCPY( &globals->ownedRects[OWNED_RECT_LEFT], &tmp,
|
||||||
sizeof(globals->ownedRects[OWNED_RECT_LEFT]) );
|
sizeof(globals->ownedRects[OWNED_RECT_LEFT]) );
|
||||||
|
|
||||||
tmp.left = tmp.right + (bparms->boardHScale * nRows) + scrollWidth;
|
tmp.left = tmp.right + bparms->boardWidth + scrollWidth;
|
||||||
tmp.right = bparms->scrnWidth;
|
tmp.right = bparms->scrnWidth;
|
||||||
XP_MEMCPY( &globals->ownedRects[OWNED_RECT_RIGHT], &tmp,
|
XP_MEMCPY( &globals->ownedRects[OWNED_RECT_RIGHT], &tmp,
|
||||||
sizeof(globals->ownedRects[OWNED_RECT_RIGHT]) );
|
sizeof(globals->ownedRects[OWNED_RECT_RIGHT]) );
|
||||||
|
@ -784,7 +783,7 @@ cePositionBoard( CEAppGlobals* globals )
|
||||||
XP_ASSERT( nCols <= CE_MAX_ROWS );
|
XP_ASSERT( nCols <= CE_MAX_ROWS );
|
||||||
|
|
||||||
figureBoardParms( globals, nCols, &bparms );
|
figureBoardParms( globals, nCols, &bparms );
|
||||||
setOwnedRects( globals, nCols, &bparms );
|
setOwnedRects( globals, &bparms );
|
||||||
|
|
||||||
#ifdef XWFEATURE_RELAY
|
#ifdef XWFEATURE_RELAY
|
||||||
if ( !!globals->game.comms ) {
|
if ( !!globals->game.comms ) {
|
||||||
|
@ -805,9 +804,8 @@ cePositionBoard( CEAppGlobals* globals )
|
||||||
}
|
}
|
||||||
|
|
||||||
board_setPos( globals->game.board, bparms.boardLeft,
|
board_setPos( globals->game.board, bparms.boardLeft,
|
||||||
bparms.boardTop, XP_FALSE );
|
bparms.boardTop, bparms.boardWidth, bparms.boardHeight,
|
||||||
board_setScale( globals->game.board, bparms.boardHScale,
|
XP_FALSE );
|
||||||
bparms.boardVScale );
|
|
||||||
|
|
||||||
board_setScoreboardLoc( globals->game.board, bparms.adjLeft, bparms.adjTop,
|
board_setScoreboardLoc( globals->game.board, bparms.adjLeft, bparms.adjTop,
|
||||||
bparms.scoreWidth,
|
bparms.scoreWidth,
|
||||||
|
@ -3530,8 +3528,8 @@ ce_util_trayHiddenChange( XW_UtilCtxt* uc, XW_TrayVisState XP_UNUSED(newState),
|
||||||
} /* ce_util_trayHiddenChange */
|
} /* ce_util_trayHiddenChange */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ce_util_yOffsetChange( XW_UtilCtxt* uc, XP_U16 XP_UNUSED(oldOffset),
|
ce_util_yOffsetChange( XW_UtilCtxt* uc, XP_U16 XP_UNUSED(maxOffset),
|
||||||
XP_U16 newOffset )
|
XP_U16 XP_UNUSED(oldOffset), XP_U16 newOffset )
|
||||||
{
|
{
|
||||||
#ifdef CEFEATURE_CANSCROLL
|
#ifdef CEFEATURE_CANSCROLL
|
||||||
CEAppGlobals* globals = (CEAppGlobals*)uc->closure;
|
CEAppGlobals* globals = (CEAppGlobals*)uc->closure;
|
||||||
|
|
|
@ -162,7 +162,11 @@ loadStateFromCurPrefs( CEAppGlobals* XP_UNUSED_STANDALONE(globals),
|
||||||
if ( globals->game.comms != NULL ) {
|
if ( globals->game.comms != NULL ) {
|
||||||
comms_getAddr( globals->game.comms, &prefsPrefs->addrRec );
|
comms_getAddr( globals->game.comms, &prefsPrefs->addrRec );
|
||||||
} else {
|
} else {
|
||||||
comms_getInitialAddr( &prefsPrefs->addrRec );
|
comms_getInitialAddr( &prefsPrefs->addrRec
|
||||||
|
#ifdef XWFEATURE_RELAY
|
||||||
|
,RELAY_NAME_DEFAULT, RELAY_PORT_DEFAULT
|
||||||
|
#endif
|
||||||
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} /* loadStateFromCurPrefs */
|
} /* loadStateFromCurPrefs */
|
||||||
|
|
Loading…
Reference in a new issue