diff --git a/xwords4/android/XWords4/jni/drawwrapper.c b/xwords4/android/XWords4/jni/drawwrapper.c index 3eb323a3b..20c7b6927 100644 --- a/xwords4/android/XWords4/jni/drawwrapper.c +++ b/xwords4/android/XWords4/jni/drawwrapper.c @@ -107,12 +107,11 @@ makeDSI( AndDraw* draw, int indx, const DrawScoreInfo* dsi ) static XP_Bool and_draw_scoreBegin( DrawCtx* dctx, const XP_Rect* rect, - XP_U16 numPlayers, - const XP_S16* const scores, - XP_S16 remCount, DrawFocusState dfs ) + XP_U16 numPlayers, const XP_S16* const scores, + XP_S16 remCount, DrawFocusState XP_UNUSED(dfs) ) { jboolean result; - DRAW_CBK_HEADER("scoreBegin", "(Landroid/graphics/Rect;I[III)Z" ); + DRAW_CBK_HEADER("scoreBegin", "(Landroid/graphics/Rect;I[II)Z" ); jint jarr[numPlayers]; int ii; @@ -123,8 +122,7 @@ and_draw_scoreBegin( DrawCtx* dctx, const XP_Rect* rect, jobject jrect = makeJRect( draw, JCACHE_RECT0, rect ); result = (*env)->CallBooleanMethod( env, draw->jdraw, mid, - jrect, numPlayers, jscores, remCount, - dfs ); + jrect, numPlayers, jscores, remCount ); (*env)->DeleteLocalRef( env, jscores ); return result; @@ -220,15 +218,15 @@ and_draw_drawTimer( DrawCtx* dctx, const XP_Rect* rect, XP_U16 player, static XP_Bool and_draw_boardBegin( DrawCtx* dctx, const XP_Rect* rect, - XP_U16 cellWidth, XP_U16 cellHeight, DrawFocusState dfs ) + XP_U16 cellWidth, XP_U16 cellHeight, + DrawFocusState XP_UNUSED(dfs) ) { - DRAW_CBK_HEADER( "boardBegin", "(Landroid/graphics/Rect;III)Z" ); + DRAW_CBK_HEADER( "boardBegin", "(Landroid/graphics/Rect;II)Z" ); jobject jrect = makeJRect( draw, JCACHE_RECT0, rect ); jboolean result = (*env)->CallBooleanMethod( env, draw->jdraw, mid, - jrect, cellWidth, cellHeight, - (jint)dfs ); + jrect, cellWidth, cellHeight ); return result; } @@ -281,15 +279,14 @@ and_draw_vertScrollBoard( DrawCtx* XP_UNUSED(dctx), XP_Rect* XP_UNUSED(rect), static XP_Bool and_draw_trayBegin( DrawCtx* dctx, const XP_Rect* rect, XP_U16 owner, - DrawFocusState dfs ) + XP_S16 score, DrawFocusState XP_UNUSED(dfs) ) { DRAW_CBK_HEADER( "trayBegin", "(Landroid/graphics/Rect;II)Z" ); jobject jrect = makeJRect( draw, JCACHE_RECT0, rect ); jboolean result = (*env)->CallBooleanMethod( env, draw->jdraw, mid, - jrect, owner, (jint)dfs ); - + jrect, owner, score ); return result; } @@ -373,13 +370,13 @@ and_draw_score_pendingScore( DrawCtx* dctx, const XP_Rect* rect, static void and_draw_objFinished( DrawCtx* dctx, BoardObjectType typ, const XP_Rect* rect, - DrawFocusState dfs ) + DrawFocusState XP_UNUSED(dfs) ) { - DRAW_CBK_HEADER( "objFinished", "(ILandroid/graphics/Rect;I)V" ); + DRAW_CBK_HEADER( "objFinished", "(ILandroid/graphics/Rect;)V" ); jobject jrect = makeJRect( draw, JCACHE_RECT0, rect ); (*env)->CallVoidMethod( env, draw->jdraw, mid, - (jint)typ, jrect, (jint)dfs ); + (jint)typ, jrect ); } static void diff --git a/xwords4/android/XWords4/jni/utilwrapper.c b/xwords4/android/XWords4/jni/utilwrapper.c index 1b7adefd1..ed0bc12df 100644 --- a/xwords4/android/XWords4/jni/utilwrapper.c +++ b/xwords4/android/XWords4/jni/utilwrapper.c @@ -216,8 +216,7 @@ and_util_turnChanged(XW_UtilCtxt* uc) #endif static void -and_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl, - XWStreamCtxt* words, XP_U16 wordCount ) +and_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl, XWStreamCtxt* words ) { UTIL_CBK_HEADER( "informMove", "(Ljava/lang/String;Ljava/lang/String;)V" ); jstring jexpl = streamToJString( MPPARM(util->util.mpool) env, expl ); @@ -227,8 +226,6 @@ and_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl, (*env)->DeleteLocalRef( env, jexpl ); if ( !!jwords ) { (*env)->DeleteLocalRef( env, jwords ); - } else { - XP_ASSERT( 0 == wordCount ); } UTIL_CBK_TAIL(); } diff --git a/xwords4/android/XWords4/jni/xwjni.c b/xwords4/android/XWords4/jni/xwjni.c index 601d0ae6a..7ec9bae1a 100644 --- a/xwords4/android/XWords4/jni/xwjni.c +++ b/xwords4/android/XWords4/jni/xwjni.c @@ -1199,6 +1199,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1getState setBool( env, jgsi, "tradeTilesSelected", info.tradeTilesSelected ); setBool( env, jgsi, "gameIsConnected", info.gameIsConnected ); setBool( env, jgsi, "canShuffle", info.canShuffle ); + setBool( env, jgsi, "curTurnSelected", info.curTurnSelected ); XWJNI_END(); } diff --git a/xwords4/android/XWords4/res/menu/board_menu.xml b/xwords4/android/XWords4/res/menu/board_menu.xml index f2f65c6ec..0e4617561 100644 --- a/xwords4/android/XWords4/res/menu/board_menu.xml +++ b/xwords4/android/XWords4/res/menu/board_menu.xml @@ -3,8 +3,8 @@ + Dictionary.com - :en: + :en: http://dictionary.com/browse/%2$s --> TheFreeDictionary.com - :en:es: + :en:es: http://%1$s.thefreedictionary.com/_/dict.aspx?word=%2$s + Larousse.com + :fr: + http://www.larousse.com/%1$s/dictionaries/french/%2$s + + Littre.reverso.net + :fr: + http://littre.reverso.net/dictionnaire-francais/definition/%2$s + Google http://www.google.com/search?nl=%1$s\u0026q=%2$s diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index 5fc7b8d93..648c1bbc7 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -1774,5 +1774,7 @@ Pick a site Tap word to search Look up %s at + + Pass diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java index b60865d05..319ab60dd 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -597,12 +597,25 @@ public class BoardActivity extends XWActivity public boolean onPrepareOptionsMenu( Menu menu ) { super.onPrepareOptionsMenu( menu ); + boolean inTrade = false; if ( null != m_gsi ) { - boolean inTrade = m_gsi.inTrade; + inTrade = m_gsi.inTrade; menu.setGroupVisible( R.id.group_done, !inTrade ); } + if ( !inTrade ) { + MenuItem item = menu.findItem( R.id.board_menu_done ); + int strId; + if ( 0 >= m_view.curPending() ) { + strId = R.string.board_menu_pass; + } else { + strId = R.string.board_menu_done; + } + item.setTitle( strId ); + item.setEnabled( null == m_gsi || m_gsi.curTurnSelected ); + } + return true; } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java index 43d605753..428fc8e7b 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java @@ -80,6 +80,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, private int m_dictPtr = 0; private int m_lastSecsLeft; private int m_lastTimerPlayer; + private int m_pendingScore; private Handler m_viewHandler; // FontDims: exists to translate space available to the largest @@ -169,6 +170,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, m_viewHandler = new Handler(); } + @Override public boolean onTouchEvent( MotionEvent event ) { int action = event.getAction(); @@ -336,9 +338,14 @@ public class BoardView extends View implements DrawCtx, BoardHandler, m_jniThread.handle( JNIThread.JNICmd.CMD_INVALALL ); } + public int curPending() + { + return m_pendingScore; + } + // DrawCtxt interface implementation public boolean scoreBegin( Rect rect, int numPlayers, int[] scores, - int remCount, int dfs ) + int remCount ) { fillRectOther( rect, CommonPrefs.COLOR_BACKGRND ); m_canvas.save( Canvas.CLIP_SAVE_FLAG ); @@ -465,8 +472,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, } } - public boolean boardBegin( Rect rect, int cellWidth, int cellHeight, - int dfs ) + public boolean boardBegin( Rect rect, int cellWidth, int cellHeight ) { return true; } @@ -582,9 +588,10 @@ public class BoardView extends View implements DrawCtx, BoardHandler, } } - public boolean trayBegin ( Rect rect, int owner, int dfs ) + public boolean trayBegin ( Rect rect, int owner, int score ) { m_trayOwner = owner; + m_pendingScore = score; return true; } @@ -638,7 +645,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler, drawCentered( getResources().getString( R.string.pts ), rect, null ); } - public void objFinished( /*BoardObjectType*/int typ, Rect rect, int dfs ) + public void objFinished( /*BoardObjectType*/int typ, Rect rect ) { if ( DrawCtx.OBJ_SCORE == typ ) { m_canvas.restoreToCount(1); // in case new canvas... diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/DrawCtx.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/DrawCtx.java index 1e4d88892..b1767e1ef 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/DrawCtx.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/DrawCtx.java @@ -43,21 +43,19 @@ public interface DrawCtx { static final int OBJ_TRAY = 3; - boolean scoreBegin( Rect rect, int numPlayers, int[] scores, int remCount, - int dfs ); + boolean scoreBegin( Rect rect, int numPlayers, int[] scores, int remCount ); void measureRemText( Rect r, int nTilesLeft, int[] width, int[] height ); void measureScoreText( Rect r, DrawScoreInfo dsi, int[] width, int[] height ); void drawRemText( Rect rInner, Rect rOuter, int nTilesLeft, boolean focussed ); void score_drawPlayer( Rect rInner, Rect rOuter, DrawScoreInfo dsi ); void drawTimer( Rect rect, int player, int secondsLeft ); - boolean boardBegin( Rect rect, int cellWidth, int cellHeight, - int dfs ); + boolean boardBegin( Rect rect, int cellWidth, int cellHeight ); boolean drawCell( Rect rect, String text, int tile, int owner, int bonus, int hintAtts, int flags ); void drawBoardArrow ( Rect rect, int bonus, boolean vert, int hintAtts, int flags ); - boolean trayBegin ( Rect rect, int owner, int dfs ); + boolean trayBegin ( Rect rect, int owner, int score ); void drawTile( Rect rect, String text, int val, int flags ); void drawTileMidDrag ( Rect rect, String text, int val, int owner, int flags ); @@ -72,7 +70,7 @@ public interface DrawCtx { public static final int BONUS_TRIPLE_WORD = 4; public static final int INTRADE_MW_TEXT = 5; - void objFinished( /*BoardObjectType*/int typ, Rect rect, int dfs ); + void objFinished( /*BoardObjectType*/int typ, Rect rect ); void dictChanged( int dictPtr ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java index bcbfad91b..284b1f9df 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java @@ -99,6 +99,7 @@ public class JNIThread extends Thread { public boolean tradeTilesSelected; public boolean gameIsConnected; public boolean canShuffle; + public boolean curTurnSelected; public GameStateInfo clone() { GameStateInfo obj = null; try { diff --git a/xwords4/common/board.c b/xwords4/common/board.c index abba4a7cd..476cc61f9 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -541,6 +541,12 @@ board_getYOffset( const BoardCtxt* board ) return vsd->offset; } /* board_getYOffset */ +XP_Bool +board_curTurnSelected( const BoardCtxt* board ) +{ + return MY_TURN( board ); +} + XP_U16 board_visTileCount( const BoardCtxt* board ) { diff --git a/xwords4/common/board.h b/xwords4/common/board.h index dc5fc0cb0..2f37e7416 100644 --- a/xwords4/common/board.h +++ b/xwords4/common/board.h @@ -78,6 +78,7 @@ void board_reset( BoardCtxt* board ); XP_Bool board_setYOffset( BoardCtxt* board, XP_U16 newOffset ); XP_U16 board_getYOffset( const BoardCtxt* board ); +XP_Bool board_curTurnSelected( const BoardCtxt* board ); XP_U16 board_visTileCount( const BoardCtxt* board ); XP_Bool board_canShuffle( const BoardCtxt* board ); XP_Bool board_canTogglePending( const BoardCtxt* board ); diff --git a/xwords4/common/draw.h b/xwords4/common/draw.h index 96d681165..d66546bb0 100644 --- a/xwords4/common/draw.h +++ b/xwords4/common/draw.h @@ -129,7 +129,7 @@ typedef struct DrawCtxVTable { XP_S16 dist, DrawFocusState dfs ); XP_Bool DRAW_VTABLE_NAME(trayBegin) ( DrawCtx* dctx, const XP_Rect* rect, - XP_U16 owner, + XP_U16 owner, XP_S16 score, DrawFocusState dfs ); void DRAW_VTABLE_NAME(measureRemText) ( DrawCtx* dctx, const XP_Rect* r, XP_S16 nTilesLeft, @@ -257,8 +257,10 @@ struct DrawCtx { #define draw_dictChanged( dc, n, d ) CALL_DRAW_NAME2(dictChanged, (dc), (n), (d)) #define draw_boardBegin( dc,r,h,v,f ) CALL_DRAW_NAME4(boardBegin, (dc),\ (r),(h),(v),(f)) -#define draw_objFinished( dc, t, r, d ) CALL_DRAW_NAME3(objFinished, (dc), (t), (r), (d)) -#define draw_trayBegin( dc, r, o, f ) CALL_DRAW_NAME3(trayBegin,dc, r, o, f) +#define draw_objFinished( dc, t, r, d ) \ + CALL_DRAW_NAME3(objFinished, (dc), (t), (r), (d)) +#define draw_trayBegin( dc, r, o, s, f ) \ + CALL_DRAW_NAME4(trayBegin, dc, r, o, s, f) #define draw_vertScrollBoard( dc, r, d, f ) \ CALL_DRAW_NAME3(vertScrollBoard, (dc),(r),(d),(f)) #define draw_scoreBegin( dc, r, t, s, c, f ) \ diff --git a/xwords4/common/game.c b/xwords4/common/game.c index 20485d761..b02d58ee0 100644 --- a/xwords4/common/game.c +++ b/xwords4/common/game.c @@ -280,6 +280,7 @@ game_saveToStream( const XWGame* game, const CurGameInfo* gi, void game_getState( const XWGame* game, GameStateInfo* gsi ) { + gsi->curTurnSelected = board_curTurnSelected( game->board ); gsi->visTileCount = board_visTileCount( game->board ); gsi->canHint = board_canHint( game->board ); gsi->canRedo = board_canTogglePending( game->board ); diff --git a/xwords4/common/game.h b/xwords4/common/game.h index 1d967ec3b..139ac8878 100644 --- a/xwords4/common/game.h +++ b/xwords4/common/game.h @@ -97,6 +97,7 @@ typedef struct _GameStateInfo { XP_Bool tradeTilesSelected; XP_Bool gameIsConnected; XP_Bool canShuffle; + XP_Bool curTurnSelected; } GameStateInfo; typedef struct XWGame { diff --git a/xwords4/common/model.c b/xwords4/common/model.c index 6468e06e5..c17e1e72c 100644 --- a/xwords4/common/model.c +++ b/xwords4/common/model.c @@ -2045,19 +2045,15 @@ recordWord( const XP_UCHAR* word, XP_Bool isLegal, void* closure ) stream_putU8( stream, '\n' ); } stream_catString( stream, word ); - if ( NULL != info->nWordsP ) { - *info->nWordsP = info->nWords; - } return XP_TRUE; } WordNotifierInfo* -model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream, XP_U16* nWords ) +model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream ) { XP_ASSERT( model->vol.wni.proc == recordWord ); XP_ASSERT( model->vol.wni.closure == &model->vol.rwi ); model->vol.rwi.stream = stream; - model->vol.rwi.nWordsP = nWords; model->vol.rwi.nWords = 0; return &model->vol.wni; } @@ -2077,7 +2073,7 @@ model_getWordsPlayed( ModelCtxt* model, XP_U16 nTurns, XWStreamCtxt* stream ) } if ( model_undoLatestMoves( model, NULL, nTurns, NULL, NULL ) ) { - WordNotifierInfo* ni = model_initWordCounter( model, stream, NULL ); + WordNotifierInfo* ni = model_initWordCounter( model, stream ); /* Now push the undone moves back into the model one at a time. recordWord() will add each played word to the stream as it's scored */ diff --git a/xwords4/common/model.h b/xwords4/common/model.h index c62342b10..b24b2371f 100644 --- a/xwords4/common/model.h +++ b/xwords4/common/model.h @@ -272,8 +272,7 @@ XP_U16 figureMoveScore( const ModelCtxt* model, XP_U16 turn, MoveInfo* mvInfo, WordNotifierInfo* notifyInfo ); /* tap into internal WordNotifierInfo */ -WordNotifierInfo* model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream, - XP_U16* nWords ); +WordNotifierInfo* model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream ); /********************* persistence ********************/ #ifdef INCLUDE_IO_SUPPORT diff --git a/xwords4/common/modelp.h b/xwords4/common/modelp.h index 2d1085400..f9b15db7d 100644 --- a/xwords4/common/modelp.h +++ b/xwords4/common/modelp.h @@ -45,7 +45,6 @@ typedef struct PlayerCtxt { typedef struct _RecordWordsInfo { XWStreamCtxt* stream; - XP_U16* nWordsP; XP_U16 nWords; } RecordWordsInfo; diff --git a/xwords4/common/server.c b/xwords4/common/server.c index e89dac3d5..5ed8bbff1 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -93,7 +93,6 @@ typedef struct ServerNonvolatiles { RemoteAddress addresses[MAX_NUM_PLAYERS]; XWStreamCtxt* prevMoveStream; /* save it to print later */ XWStreamCtxt* prevWordsStream; - XP_U16 prevWordCount; } ServerNonvolatiles; struct ServerCtxt { @@ -758,8 +757,7 @@ makeRobotMove( ServerCtxt* server ) if ( !!stream ) { XWStreamCtxt* wordsStream = mkServerStream( server ); WordNotifierInfo* ni = - model_initWordCounter( model, wordsStream, - &server->nv.prevWordCount ); + model_initWordCounter( model, wordsStream ); (void)model_checkMoveLegal( model, turn, stream, ni ); XP_ASSERT( !server->nv.prevMoveStream ); server->nv.prevMoveStream = stream; @@ -870,8 +868,7 @@ showPrevScore( ServerCtxt* server ) stream_destroy( prevStream ); } - util_informMove( util, stream, server->nv.prevWordsStream, - server->nv.prevWordCount ); + util_informMove( util, stream, server->nv.prevWordsStream ); stream_destroy( stream ); stream_destroy( server->nv.prevWordsStream ); server->nv.prevWordsStream = NULL; @@ -1885,9 +1882,7 @@ makeMoveReportIf( ServerCtxt* server, XWStreamCtxt** wordsStream ) ModelCtxt* model = server->vol.model; stream = mkServerStream( server ); *wordsStream = mkServerStream( server ); - WordNotifierInfo* ni = - model_initWordCounter( model, *wordsStream, - &server->nv.prevWordCount ); + WordNotifierInfo* ni = model_initWordCounter( model, *wordsStream ); (void)model_checkMoveLegal( model, server->nv.currentTurn, stream, ni ); } return stream; diff --git a/xwords4/common/tray.c b/xwords4/common/tray.c index d81a78300..d9b9b9195 100644 --- a/xwords4/common/tray.c +++ b/xwords4/common/tray.c @@ -1,6 +1,6 @@ -/* -*- compile-command: "cd ../linux && make MEMDEBUG=TRUE"; -*- */ +/* -*- compile-command: "cd ../linux && make MEMDEBUG=TRUE -j3"; -*- */ /* - * Copyright 1997 - 2009 by Eric House (xwords@eehouse.org). All rights + * Copyright 1997 - 2011 by Eric House (xwords@eehouse.org). All rights * reserved. * * This program is free software; you can redistribute it and/or @@ -29,7 +29,9 @@ extern "C" { #endif /****************************** prototypes ******************************/ -static void drawPendingScore( BoardCtxt* board, XP_Bool hasCursor ); +static void drawPendingScore( BoardCtxt* board, XP_S16 turnScore, + XP_Bool hasCursor ); +static XP_S16 figurePendingScore( const BoardCtxt* board ); static XP_U16 countTilesToShow( BoardCtxt* board ); static void figureDividerRect( BoardCtxt* board, XP_Rect* rect ); @@ -130,8 +132,10 @@ drawTray( BoardCtxt* board ) const XP_S16 turn = board->selPlayer; PerTurnInfo* pti = board->selInfo; + XP_S16 turnScore = figurePendingScore( board ); + if ( draw_trayBegin( board->draw, &board->trayBounds, turn, - dfsFor( board, OBJ_TRAY ) ) ) { + turnScore, dfsFor( board, OBJ_TRAY ) ) ) { DictionaryCtxt* dictionary = model_getDictionary( board->model ); XP_S16 cursorBits = 0; XP_Bool cursorOnDivider = XP_FALSE; @@ -242,8 +246,7 @@ drawTray( BoardCtxt* board ) draw_drawTrayDivider( board->draw, ÷r, flags ); board->dividerInvalid = XP_FALSE; } - - drawPendingScore( board, + drawPendingScore( board, turnScore, (cursorBits & (1<<(MAX_TRAY_TILES-1))) != 0); } @@ -304,19 +307,25 @@ countTilesToShow( BoardCtxt* board ) return numToShow; } /* countTilesToShow */ +static XP_S16 +figurePendingScore( const BoardCtxt* board ) +{ + XP_S16 turnScore; + (void)getCurrentMoveScoreIfLegal( board->model, board->selPlayer, + (XWStreamCtxt*)NULL, + (WordNotifierInfo*)NULL, + &turnScore ); + return turnScore; +} + static void -drawPendingScore( BoardCtxt* board, XP_Bool hasCursor ) +drawPendingScore( BoardCtxt* board, XP_S16 turnScore, XP_Bool hasCursor ) { /* Draw the pending score down in the last tray's rect */ if ( countTilesToShow( board ) < MAX_TRAY_TILES ) { XP_U16 selPlayer = board->selPlayer; - XP_S16 turnScore = 0; XP_Rect lastTileR; - (void)getCurrentMoveScoreIfLegal( board->model, selPlayer, - (XWStreamCtxt*)NULL, - (WordNotifierInfo*)NULL, - &turnScore ); figureTrayTileRect( board, MAX_TRAY_TILES-1, &lastTileR ); draw_score_pendingScore( board->draw, &lastTileR, turnScore, selPlayer, diff --git a/xwords4/common/util.h b/xwords4/common/util.h index bee096c4d..4ba082f01 100644 --- a/xwords4/common/util.h +++ b/xwords4/common/util.h @@ -131,7 +131,7 @@ typedef struct UtilVtable { void (*m_util_turnChanged)(XW_UtilCtxt* uc); #endif void (*m_util_informMove)( XW_UtilCtxt* uc, XWStreamCtxt* expl, - XWStreamCtxt* words, XP_U16 wordCount ); + XWStreamCtxt* words ); void (*m_util_notifyGameOver)( XW_UtilCtxt* uc ); XP_Bool (*m_util_hiliteCell)( XW_UtilCtxt* uc, XP_U16 col, XP_U16 row ); @@ -228,8 +228,8 @@ struct XW_UtilCtxt { # define util_turnChanged( uc ) #endif -#define util_informMove(uc,e,w,wc) \ - (uc)->vtable->m_util_informMove( (uc),(e),(w),(wc) ) +#define util_informMove(uc,e,w) \ + (uc)->vtable->m_util_informMove( (uc),(e),(w)) #define util_notifyGameOver( uc ) \ (uc)->vtable->m_util_notifyGameOver((uc)) diff --git a/xwords4/linux/cursesdraw.c b/xwords4/linux/cursesdraw.c index 0eaf07440..b6a35beb6 100644 --- a/xwords4/linux/cursesdraw.c +++ b/xwords4/linux/cursesdraw.c @@ -1,6 +1,6 @@ -/* -*-mode: C; fill-column: 78; c-basic-offset: 4; compile-command: "make MEMDEBUG=TRUE"; -*- */ +/* -*- compile-command: "make MEMDEBUG=TRUE -j3"; -*- */ /* - * Copyright 1997-2008 by Eric House (xwords@eehouse.org). All rights + * Copyright 1997-2011 by Eric House (xwords@eehouse.org). All rights * reserved. * * This program is free software; you can redistribute it and/or @@ -91,6 +91,7 @@ static XP_Bool curses_draw_trayBegin( DrawCtx* XP_UNUSED(p_dctx), const XP_Rect* XP_UNUSED(rect), XP_U16 XP_UNUSED(owner), + XP_S16 XP_UNUSED(score), DrawFocusState XP_UNUSED(dfs) ) { return XP_TRUE; diff --git a/xwords4/linux/cursesmain.c b/xwords4/linux/cursesmain.c index 0dcf1c362..77d468734 100644 --- a/xwords4/linux/cursesmain.c +++ b/xwords4/linux/cursesmain.c @@ -334,8 +334,7 @@ cursesShowFinalScores( CursesAppGlobals* globals ) static void curses_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl, - XWStreamCtxt* XP_UNUSED(words), - XP_U16 XP_UNUSED(wordCount) ) + XWStreamCtxt* XP_UNUSED(words)) { CursesAppGlobals* globals = (CursesAppGlobals*)uc->closure; char* question = strFromStream( expl ); diff --git a/xwords4/linux/gtkdraw.c b/xwords4/linux/gtkdraw.c index eff227101..5d8326361 100644 --- a/xwords4/linux/gtkdraw.c +++ b/xwords4/linux/gtkdraw.c @@ -1,6 +1,6 @@ -/* -*- mode: C; fill-column: 78; c-basic-offset: 4; compile-command: "make MEMDEBUG=TRUE"; -*- */ +/* -*- compile-command: "make MEMDEBUG=TRUE -j3"; -*- */ /* - * Copyright 1997-2008 by Eric House (xwords@eehouse.org). All rights + * Copyright 1997-2011 by Eric House (xwords@eehouse.org). All rights * reserved. * * This program is free software; you can redistribute it and/or @@ -634,7 +634,8 @@ gtk_draw_invertCell( DrawCtx* XP_UNUSED(p_dctx), static XP_Bool gtk_draw_trayBegin( DrawCtx* p_dctx, const XP_Rect* XP_UNUSED(rect), - XP_U16 owner, DrawFocusState XP_UNUSED(dfs) ) + XP_U16 owner, XP_S16 XP_UNUSED(owner), + DrawFocusState XP_UNUSED(dfs) ) { GtkDrawCtx* dctx = (GtkDrawCtx*)p_dctx; dctx->trayOwner = owner; @@ -729,7 +730,7 @@ gtk_draw_drawTileMidDrag( DrawCtx* p_dctx, const XP_Rect* rect, const XP_UCHAR* textP, const XP_Bitmaps* bitmaps, XP_U16 val, XP_U16 owner, CellFlags flags ) { - gtk_draw_trayBegin( p_dctx, rect, owner, DFS_NONE ); + gtk_draw_trayBegin( p_dctx, rect, owner, 0, DFS_NONE ); gtkDrawTileImpl( p_dctx, rect, textP, bitmaps, val, flags | CELL_HIGHLIGHT, XP_FALSE ); } diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index 0230c5017..862c97e6e 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -1388,9 +1388,8 @@ gtkShowFinalScores( const CommonGlobals* cGlobals ) static void gtk_util_informMove( XW_UtilCtxt* XP_UNUSED(uc), XWStreamCtxt* XP_UNUSED(expl), - XWStreamCtxt* words, XP_U16 wordCount ) + XWStreamCtxt* words ) { - XP_LOGF( "%s(wordCount=%d)", __func__, wordCount ); char* question = strFromStream( words/*expl*/ ); (void)gtkask( question, GTK_BUTTONS_OK ); free( question );