mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-26 09:58:20 +01:00
Fix so curses-only builds and curses build doesn't segfault.
This commit is contained in:
parent
7b781b9ff1
commit
d053f0731f
4 changed files with 18 additions and 6 deletions
|
@ -2167,6 +2167,7 @@ clearCurHintRect( BoardCtxt* board )
|
|||
invalCurHintRect( board, board->selPlayer );
|
||||
board->hasHintRect[board->selPlayer] = XP_FALSE;
|
||||
} /* clearCurHintRect */
|
||||
#endif /* XWFEATURE_SEARCHLIMIT */
|
||||
|
||||
static XP_Bool
|
||||
handlePenDownOnBoard( BoardCtxt* board, XP_U16 xx, XP_U16 yy )
|
||||
|
@ -2188,7 +2189,6 @@ handlePenDownOnBoard( BoardCtxt* board, XP_U16 xx, XP_U16 yy )
|
|||
|
||||
return result;
|
||||
} /* handlePenDownOnBoard */
|
||||
#endif /* POINTER_SUPPORT */
|
||||
|
||||
/* If there's a password, ask it; if they match, change the state of the tray
|
||||
* to TRAY_REVEALED (unless we're not supposed to show the tiles). Return
|
||||
|
|
|
@ -32,9 +32,11 @@ static XP_Bool dragDropContinueImpl( BoardCtxt* board, XP_U16 xx, XP_U16 yy,
|
|||
BoardObjectType* onWhichP );
|
||||
static void invalDragObjRange( BoardCtxt* board, const DragObjInfo* from,
|
||||
const DragObjInfo* to );
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
static void invalHintRectDiffs( BoardCtxt* board, const DragObjInfo* cur,
|
||||
const DragObjInfo* nxt );
|
||||
static void setLimitsFrom( const BoardCtxt* board, BdHintLimits* limits );
|
||||
#endif
|
||||
|
||||
static void startScrollTimerIf( BoardCtxt* board );
|
||||
|
||||
|
@ -328,6 +330,7 @@ dragDropGetTrayChanges( const BoardCtxt* board, XP_U16* rmvdIndx,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
XP_Bool
|
||||
dragDropGetHintLimits( const BoardCtxt* board, BdHintLimits* limits )
|
||||
{
|
||||
|
@ -337,6 +340,7 @@ dragDropGetHintLimits( const BoardCtxt* board, BdHintLimits* limits )
|
|||
}
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
XP_Bool
|
||||
dragDropIsDividerDrag( const BoardCtxt* board )
|
||||
|
@ -355,6 +359,7 @@ dragDropTileInfo( const BoardCtxt* board, Tile* tile, XP_Bool* isBlank )
|
|||
*isBlank = ds->isBlank;
|
||||
}
|
||||
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
static void
|
||||
invalHintRectDiffs( BoardCtxt* board, const DragObjInfo* cur,
|
||||
const DragObjInfo* nxt )
|
||||
|
@ -385,7 +390,8 @@ invalHintRectDiffs( BoardCtxt* board, const DragObjInfo* cur,
|
|||
invalCellRegion( board, startCol, startRow, nxt->u.board.col,
|
||||
nxt->u.board.row );
|
||||
}
|
||||
}
|
||||
} /* invalHintRectDiffs */
|
||||
#endif
|
||||
|
||||
static XP_Bool
|
||||
dragDropContinueImpl( BoardCtxt* board, XP_U16 xx, XP_U16 yy,
|
||||
|
@ -502,6 +508,7 @@ invalDragObjRange( BoardCtxt* board, const DragObjInfo* from,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
static void
|
||||
setLimitsFrom( const BoardCtxt* board, BdHintLimits* limits )
|
||||
{
|
||||
|
@ -511,6 +518,7 @@ setLimitsFrom( const BoardCtxt* board, BdHintLimits* limits )
|
|||
limits->top = XP_MIN( ds->start.u.board.row, ds->cur.u.board.row );
|
||||
limits->bottom = XP_MAX( ds->start.u.board.row, ds->cur.u.board.row );
|
||||
}
|
||||
#endif
|
||||
|
||||
static XP_Bool
|
||||
scrollTimerProc( void* closure, XWTimerReason why )
|
||||
|
|
|
@ -46,8 +46,11 @@ XP_Bool dragDropIsBeingDragged( const BoardCtxt* board, XP_U16 col, XP_U16 row,
|
|||
*/
|
||||
void dragDropGetTrayChanges( const BoardCtxt* board, XP_U16* rmvdIndx,
|
||||
XP_U16* addedIndx );
|
||||
XP_Bool dragDropGetHintLimits( const BoardCtxt* board, BdHintLimits* limits );
|
||||
XP_Bool dragDropIsDividerDrag( const BoardCtxt* board );
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
XP_Bool dragDropGetHintLimits( const BoardCtxt* board, BdHintLimits* limits );
|
||||
#endif
|
||||
|
||||
|
||||
void dragDropTileInfo( const BoardCtxt* board, Tile* tile, XP_Bool* isBlank );
|
||||
|
||||
|
|
|
@ -302,14 +302,15 @@ curses_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
|
|||
{
|
||||
CursesDrawCtx* dctx = (CursesDrawCtx*)p_dctx;
|
||||
XP_UCHAR loc[4] = { ' ', ' ', ' ', '\0' };
|
||||
XP_ASSERT( XP_STRLEN(letter) < sizeof(loc) );
|
||||
XP_ASSERT( rect->width < sizeof(loc) );
|
||||
XP_MEMCPY( loc, letter, strlen(letter) );
|
||||
if ( !!letter ) {
|
||||
XP_MEMCPY( loc, letter, strlen(letter) );
|
||||
}
|
||||
|
||||
/* in case it's not 1x1 */
|
||||
eraseRect( dctx, rect );
|
||||
|
||||
if ( letter[0] == LETTER_NONE ) {
|
||||
if ( (flags & (CELL_DRAGSRC|CELL_ISEMPTY)) != 0 ) {
|
||||
switch ( bonus ) {
|
||||
case BONUS_DOUBLE_LETTER:
|
||||
loc[0] = '+'; break;
|
||||
|
|
Loading…
Reference in a new issue